1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 import("//build/config/crypto.gni")
6 import("//build/config/features.gni")
7 import("//build/config/ui.gni")
8 import("//build/module_args/v8.gni")
9 import("//testing/test.gni")
10 import("//third_party/icu/config.gni")
11 import("//third_party/protobuf/proto_library.gni")
13 # TODO(cjhopman): //build/config/android/rules.gni also imports grit_rule.gni.
14 # Currently, that file can't be imported multiple times. Make this always
15 # imported when http://crbug.com/393704 is fixed.
17 import("//tools/grit/grit_rule.gni")
21 import("//build/config/android/config.gni")
22 import("//build/config/android/rules.gni")
24 import("//build/config/mac/mac_sdk.gni")
27 # The list of net files is kept in net.gypi. Read it.
28 gypi_values = exec_script("//build/gypi_to_gn.py",
29 [ rebase_path("net.gypi") ],
33 # Disable Kerberos on ChromeOS, Android and iOS, at least for now. It needs
34 # configuration (krb5.conf and so on).
35 use_kerberos = !is_chromeos && !is_android && !is_ios
37 # The way the cache uses mmap() is inefficient on some Android devices. If
38 # this flag is set, we hackily avoid using mmap() in the disk cache. We are
39 # pretty confident that mmap-ing the index would not hurt any existing x86
40 # android devices, but we cannot be so sure about the variety of ARM devices.
41 # So enable it for x86 only for now.
42 posix_avoid_mmap = is_android && current_cpu != "x86"
44 # WebSockets and socket stream code are used everywhere except iOS.
45 enable_websockets = !is_ios
46 use_v8_in_net = !is_ios
47 enable_built_in_dns = !is_ios
48 disable_ftp_support = is_ios
51 # Disables support for file URLs. File URL support requires use of icu.
52 disable_file_support = false
55 config("net_config") {
57 if (posix_avoid_mmap) {
58 defines += [ "POSIX_AVOID_MMAP" ]
60 if (disable_file_support) {
61 defines += [ "DISABLE_FILE_SUPPORT" ]
65 # net_internal_config is shared with net and net_small.
66 config("net_internal_config") {
68 # TODO(GYP) Note that the GYP file supports linux_link_kerberos (defaults to
69 # 0) which implies that we run pkg_config on kerberos and link to that
70 # rather than setting this define which will dynamically open it. That
71 # doesn't seem to be set in the regular builds, so we're skipping this
78 defines += [ "USE_KERBEROS" ]
80 include_dirs = [ "/usr/include/kerberosV" ]
84 if (enable_built_in_dns) {
85 defines += [ "ENABLE_BUILT_IN_DNS" ]
89 # net_shared_* are settings shared between net and net_small
91 gypi_values.net_nacl_common_sources + gypi_values.net_non_nacl_sources
93 net_shared_unfiltered_sources = []
95 net_shared_configs = [
96 ":net_internal_config",
97 "//build/config:precompiled_headers",
99 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
100 "//build/config/compiler:no_size_t_to_int_warning",
103 net_shared_public_deps = [
113 "//base/third_party/dynamic_annotations",
114 "//net/base/registry_controlled_domains",
116 "//third_party/protobuf:protobuf_lite",
117 "//third_party/zlib",
121 net_shared_sources -= [
122 "http/http_auth_gssapi_posix.cc",
123 "http/http_auth_gssapi_posix.h",
124 "http/http_auth_handler_negotiate.cc",
125 "http/http_auth_handler_negotiate.h",
130 if (posix_avoid_mmap) {
131 net_shared_sources -= [ "disk_cache/blockfile/mapped_file_posix.cc" ]
133 net_shared_sources -=
134 [ "disk_cache/blockfile/mapped_file_avoid_mmap_posix.cc" ]
138 if (!enable_built_in_dns) {
139 net_shared_sources -= [
140 "dns/address_sorter_posix.cc",
141 "dns/address_sorter_posix.h",
147 net_shared_sources -= [
150 "cert/ct_log_verifier_nss.cc",
151 "cert/ct_objects_extractor_nss.cc",
152 "cert/jwk_serializer_nss.cc",
153 "cert/scoped_nss_types.h",
154 "cert/x509_util_nss.cc",
155 "quic/crypto/aead_base_decrypter_nss.cc",
156 "quic/crypto/aead_base_encrypter_nss.cc",
157 "quic/crypto/aes_128_gcm_12_decrypter_nss.cc",
158 "quic/crypto/aes_128_gcm_12_encrypter_nss.cc",
159 "quic/crypto/chacha20_poly1305_decrypter_nss.cc",
160 "quic/crypto/chacha20_poly1305_encrypter_nss.cc",
161 "quic/crypto/channel_id_nss.cc",
162 "quic/crypto/p256_key_exchange_nss.cc",
163 "socket/nss_ssl_util.cc",
164 "socket/nss_ssl_util.h",
165 "socket/ssl_client_socket_nss.cc",
166 "socket/ssl_client_socket_nss.h",
167 "socket/ssl_server_socket_nss.cc",
168 "socket/ssl_server_socket_nss.h",
171 # Always removed for !ios below.
172 net_shared_sources -= [
173 "cert/cert_verify_proc_nss.cc",
174 "cert/cert_verify_proc_nss.h",
178 net_shared_sources -= [ "cert/sha256_legacy_support_nss_win.cc" ]
180 if (!use_nss_certs && !is_ios) {
181 net_shared_sources -= [ "cert/x509_util_nss.h" ]
184 net_shared_sources -= [
185 "cert/ct_log_verifier_openssl.cc",
186 "cert/ct_objects_extractor_openssl.cc",
187 "cert/jwk_serializer_openssl.cc",
188 "cert/x509_util_openssl.cc",
189 "cert/x509_util_openssl.h",
190 "quic/crypto/aead_base_decrypter_openssl.cc",
191 "quic/crypto/aead_base_encrypter_openssl.cc",
192 "quic/crypto/aes_128_gcm_12_decrypter_openssl.cc",
193 "quic/crypto/aes_128_gcm_12_encrypter_openssl.cc",
194 "quic/crypto/chacha20_poly1305_decrypter_openssl.cc",
195 "quic/crypto/chacha20_poly1305_encrypter_openssl.cc",
196 "quic/crypto/channel_id_openssl.cc",
197 "quic/crypto/p256_key_exchange_openssl.cc",
198 "quic/crypto/scoped_evp_aead_ctx.cc",
199 "quic/crypto/scoped_evp_aead_ctx.h",
200 "socket/ssl_client_socket_openssl.cc",
201 "socket/ssl_client_socket_openssl.h",
202 "socket/ssl_server_socket_openssl.cc",
203 "socket/ssl_server_socket_openssl.h",
204 "ssl/openssl_ssl_util.cc",
205 "ssl/openssl_ssl_util.h",
206 "ssl/ssl_client_session_cache_openssl.cc",
207 "ssl/ssl_client_session_cache_openssl.h",
208 "ssl/ssl_platform_key.h",
209 "ssl/threaded_ssl_private_key.cc",
210 "ssl/threaded_ssl_private_key.h",
213 net_shared_sources -= [ "ssl/ssl_platform_key_mac.cc" ]
216 net_shared_sources -= [ "ssl/ssl_platform_key_android.cc" ]
219 net_shared_sources -= [
220 "cert/sha256_legacy_support_openssl_win.cc",
221 "ssl/ssl_platform_key_win.cc",
225 net_shared_sources -= [
226 "ssl/client_key_store.cc",
227 "ssl/client_key_store.h",
228 "ssl/ssl_platform_key_nss.cc",
233 if (!use_openssl_certs) {
234 net_shared_sources -= [
235 "base/crypto_module_openssl.cc",
236 "base/keygen_handler_openssl.cc",
237 "base/openssl_private_key_store.h",
238 "base/openssl_private_key_store_memory.cc",
239 "cert/cert_database_openssl.cc",
240 "cert/cert_verify_proc_openssl.cc",
241 "cert/cert_verify_proc_openssl.h",
242 "cert/test_root_certs_openssl.cc",
243 "cert/x509_certificate_openssl.cc",
244 "ssl/openssl_client_key_store.cc",
245 "ssl/openssl_client_key_store.h",
248 net_shared_sources -= [ "base/openssl_private_key_store_android.cc" ]
252 # Android doesn't use these even when using OpenSSL.
253 net_shared_sources -= [
254 "base/openssl_private_key_store_memory.cc",
255 "cert/cert_database_openssl.cc",
256 "cert/cert_verify_proc_openssl.cc",
257 "cert/test_root_certs_openssl.cc",
262 if (use_glib && !is_chromeos) {
263 net_shared_configs += [ "//build/config/linux:gconf" ]
264 net_shared_deps += [ "//build/linux:gio" ]
268 net_shared_configs += [ "//build/config/linux:libresolv" ]
271 if (!use_nss_certs) {
272 net_shared_sources -= [
273 "base/crypto_module_nss.cc",
274 "base/keygen_handler_nss.cc",
275 "cert/cert_database_nss.cc",
276 "cert/nss_cert_database.cc",
277 "cert/nss_cert_database.h",
278 "cert/x509_certificate_nss.cc",
279 "ssl/client_cert_store_nss.cc",
280 "ssl/client_cert_store_nss.h",
281 "third_party/mozilla_security_manager/nsKeygenHandler.cpp",
282 "third_party/mozilla_security_manager/nsKeygenHandler.h",
283 "third_party/mozilla_security_manager/nsNSSCertificateDB.cpp",
284 "third_party/mozilla_security_manager/nsNSSCertificateDB.h",
285 "third_party/mozilla_security_manager/nsPKCS12Blob.cpp",
286 "third_party/mozilla_security_manager/nsPKCS12Blob.h",
289 # These files are part of the partial implementation of NSS on iOS so
290 # keep them in that case (even though use_nss_certs is not set).
291 net_shared_sources -= [
292 "cert/cert_verify_proc_nss.cc",
293 "cert/cert_verify_proc_nss.h",
294 "cert/test_root_certs_nss.cc",
295 "cert/x509_util_nss_certs.cc",
296 "cert_net/nss_ocsp.cc",
297 "cert_net/nss_ocsp.h",
301 # These were already removed on non-ChromeOS.
302 net_shared_sources -= [
303 "cert/nss_cert_database_chromeos.cc",
304 "cert/nss_cert_database_chromeos.h",
305 "cert/nss_profile_filter_chromeos.cc",
306 "cert/nss_profile_filter_chromeos.h",
309 net_shared_sources -= [
310 "ssl/client_key_store.cc",
311 "ssl/client_key_store.h",
312 "ssl/ssl_platform_key_nss.cc",
314 } else if (use_openssl) {
315 # client_cert_store_nss.c requires NSS_CmpCertChainWCANames from NSS's
316 # libssl, but our bundled copy is not built in OpenSSL ports. Pull that file
318 net_shared_sources += [ "third_party/nss/ssl/cmpcert.c" ]
322 net_shared_sources -= [
325 "dns/mdns_client.cc",
327 "dns/mdns_client_impl.cc",
328 "dns/mdns_client_impl.h",
329 "dns/record_parsed.cc",
330 "dns/record_parsed.h",
331 "dns/record_rdata.cc",
332 "dns/record_rdata.h",
337 net_shared_sources -= [
338 "http/http_auth_handler_ntlm_portable.cc",
339 "socket/socket_libevent.cc",
340 "socket/socket_libevent.h",
341 "socket/tcp_socket_libevent.cc",
342 "socket/tcp_socket_libevent.h",
343 "udp/udp_socket_libevent.cc",
344 "udp/udp_socket_libevent.h",
347 net_shared_sources -= [
348 "base/winsock_init.cc",
349 "base/winsock_init.h",
350 "base/winsock_util.cc",
351 "base/winsock_util.h",
352 "proxy/proxy_resolver_winhttp.cc",
353 "proxy/proxy_resolver_winhttp.h",
358 # Add back some sources that were otherwise filtered out. iOS needs some Mac
360 net_shared_unfiltered_sources += [
361 "base/mac/url_conversions.h",
362 "base/mac/url_conversions.mm",
363 "base/network_change_notifier_mac.cc",
364 "base/network_config_watcher_mac.cc",
365 "base/network_interfaces_mac.cc",
366 "base/network_interfaces_mac.h",
367 "base/platform_mime_util_mac.mm",
368 "proxy/proxy_resolver_mac.cc",
369 "proxy/proxy_server_mac.cc",
372 net_shared_sources -= [ "disk_cache/blockfile/file_posix.cc" ]
374 "//third_party/nss:nspr",
376 "//net/third_party/nss/ssl:libssl",
380 if (is_ios || is_mac) {
381 net_shared_sources += gypi_values.net_base_mac_ios_sources
385 net_shared_deps += [ ":net_jni_headers" ]
387 # Add some Linux sources that were excluded by the filter, but which
389 net_shared_unfiltered_sources += [
390 "base/address_tracker_linux.cc",
391 "base/address_tracker_linux.h",
392 "base/network_interfaces_linux.cc",
393 "base/network_interfaces_linux.h",
394 "base/platform_mime_util_linux.cc",
399 sources = net_shared_sources
401 # Add back some sources that were otherwise filtered out.
402 set_sources_assignment_filter([])
403 sources += net_shared_unfiltered_sources
404 set_sources_assignment_filter(sources_assignment_filter)
407 configs += net_shared_configs
408 public_configs = [ ":net_config" ]
410 public_deps = net_shared_public_deps + [ "//url" ]
411 deps = net_shared_deps
415 "Foundation.framework",
416 "Security.framework",
417 "SystemConfiguration.framework",
424 "CFNetwork.framework",
425 "MobileCoreServices.framework",
426 "Security.framework",
427 "SystemConfiguration.framework",
432 if (!disable_file_support) {
433 sources += gypi_values.net_file_support_sources
436 if (!disable_ftp_support) {
437 sources += gypi_values.net_ftp_support_sources
440 if (enable_websockets) {
441 sources += gypi_values.net_websockets_sources
450 "base/filename_util_icu.cc",
451 "base/net_string_util_icu.cc",
452 "base/net_util_icu.cc",
457 # Same as net, but with ICU, file, ftp, and websocket support stripped.
458 component("net_small") {
459 sources = net_shared_sources
461 # Add back some sources that were otherwise filtered out.
462 set_sources_assignment_filter([])
463 sources += net_shared_unfiltered_sources
464 set_sources_assignment_filter(sources_assignment_filter)
468 configs += net_shared_configs
469 public_configs = [ ":net_config" ]
471 public_deps = net_shared_public_deps +
472 [ "//url:url_lib_use_icu_alternatives_on_android" ]
473 deps = net_shared_deps + [ ":net_jni_headers" ]
476 "DISABLE_FILE_SUPPORT",
477 "DISABLE_FTP_SUPPORT",
478 "USE_ICU_ALTERNATIVES_ON_ANDROID=1",
481 # Use ICU alternative on Android.
483 "base/net_string_util_icu_alternatives_android.cc",
484 "base/net_string_util_icu_alternatives_android.h",
489 grit("net_resources") {
490 source = "base/net_resources.grd"
491 use_qualified_include = true
493 "grit/net_resources.h",
498 proto_library("net_quic_proto") {
505 "quic/proto/cached_network_parameters.proto",
506 "quic/proto/source_address_token.proto",
508 cc_generator_options = "dllexport_decl=NET_EXPORT_PRIVATE:"
509 cc_include = "net/base/net_export.h"
511 defines = [ "NET_IMPLEMENTATION" ]
513 extra_configs = [ "//build/config/compiler:wexit_time_destructors" ]
516 static_library("extras") {
517 sources = gypi_values.net_extras_sources
518 configs += [ "//build/config/compiler:wexit_time_destructors" ]
526 static_library("http_server") {
528 "server/http_connection.cc",
529 "server/http_connection.h",
530 "server/http_server.cc",
531 "server/http_server.h",
532 "server/http_server_request_info.cc",
533 "server/http_server_request_info.h",
534 "server/http_server_response_info.cc",
535 "server/http_server_response_info.h",
536 "server/web_socket.cc",
537 "server/web_socket.h",
538 "server/web_socket_encoder.cc",
539 "server/web_socket_encoder.h",
542 "//build/config/compiler:no_size_t_to_int_warning",
543 "//build/config/compiler:wexit_time_destructors",
551 executable("dump_cache") {
554 "tools/dump_cache/dump_cache.cc",
555 "tools/dump_cache/dump_files.cc",
556 "tools/dump_cache/dump_files.h",
559 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
560 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
566 "//build/config/sanitizers:deps",
570 source_set("test_support") {
573 "base/load_timing_info_test_util.cc",
574 "base/load_timing_info_test_util.h",
575 "base/mock_file_stream.cc",
576 "base/mock_file_stream.h",
577 "base/test_completion_callback.cc",
578 "base/test_completion_callback.h",
579 "base/test_data_directory.cc",
580 "base/test_data_directory.h",
581 "cert/mock_cert_verifier.cc",
582 "cert/mock_cert_verifier.h",
583 "cookies/cookie_monster_store_test.cc",
584 "cookies/cookie_monster_store_test.h",
585 "cookies/cookie_store_test_callbacks.cc",
586 "cookies/cookie_store_test_callbacks.h",
587 "cookies/cookie_store_test_helpers.cc",
588 "cookies/cookie_store_test_helpers.h",
589 "disk_cache/disk_cache_test_base.cc",
590 "disk_cache/disk_cache_test_base.h",
591 "disk_cache/disk_cache_test_util.cc",
592 "disk_cache/disk_cache_test_util.h",
593 "dns/dns_test_util.cc",
594 "dns/dns_test_util.h",
595 "dns/mock_host_resolver.cc",
596 "dns/mock_host_resolver.h",
597 "dns/mock_mdns_socket_factory.cc",
598 "dns/mock_mdns_socket_factory.h",
599 "http/http_transaction_test_util.cc",
600 "http/http_transaction_test_util.h",
601 "log/test_net_log.cc",
602 "log/test_net_log.h",
603 "log/test_net_log_entry.cc",
604 "log/test_net_log_entry.h",
605 "log/test_net_log_util.cc",
606 "log/test_net_log_util.h",
607 "proxy/mock_proxy_resolver.cc",
608 "proxy/mock_proxy_resolver.h",
609 "proxy/mock_proxy_script_fetcher.cc",
610 "proxy/mock_proxy_script_fetcher.h",
611 "proxy/proxy_config_service_common_unittest.cc",
612 "proxy/proxy_config_service_common_unittest.h",
613 "socket/socket_test_util.cc",
614 "socket/socket_test_util.h",
615 "test/cert_test_util.cc",
616 "test/cert_test_util.h",
617 "test/cert_test_util_nss.cc",
618 "test/channel_id_test_util.cc",
619 "test/channel_id_test_util.h",
620 "test/ct_test_util.cc",
621 "test/ct_test_util.h",
622 "test/embedded_test_server/embedded_test_server.cc",
623 "test/embedded_test_server/embedded_test_server.h",
624 "test/embedded_test_server/http_connection.cc",
625 "test/embedded_test_server/http_connection.h",
626 "test/embedded_test_server/http_request.cc",
627 "test/embedded_test_server/http_request.h",
628 "test/embedded_test_server/http_response.cc",
629 "test/embedded_test_server/http_response.h",
630 "test/embedded_test_server/stream_listen_socket.cc",
631 "test/embedded_test_server/stream_listen_socket.h",
632 "test/embedded_test_server/tcp_listen_socket.cc",
633 "test/embedded_test_server/tcp_listen_socket.h",
634 "test/event_waiter.h",
635 "test/net_test_suite.cc",
636 "test/net_test_suite.h",
637 "test/python_utils.cc",
638 "test/python_utils.h",
639 "test/url_request/ssl_certificate_error_job.cc",
640 "test/url_request/ssl_certificate_error_job.h",
641 "test/url_request/url_request_failed_job.cc",
642 "test/url_request/url_request_failed_job.h",
643 "test/url_request/url_request_mock_data_job.cc",
644 "test/url_request/url_request_mock_data_job.h",
645 "test/url_request/url_request_slow_download_job.cc",
646 "test/url_request/url_request_slow_download_job.h",
647 "url_request/test_url_fetcher_factory.cc",
648 "url_request/test_url_fetcher_factory.h",
649 "url_request/url_request_test_util.cc",
650 "url_request/url_request_test_util.h",
654 "test/spawned_test_server/base_test_server.cc",
655 "test/spawned_test_server/base_test_server.h",
656 "test/spawned_test_server/local_test_server.cc",
657 "test/spawned_test_server/local_test_server.h",
658 "test/spawned_test_server/local_test_server_posix.cc",
659 "test/spawned_test_server/local_test_server_win.cc",
660 "test/spawned_test_server/spawned_test_server.h",
665 "//build/config:precompiled_headers",
667 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
668 "//build/config/compiler:no_size_t_to_int_warning",
673 "//base/test:test_support",
676 "//net/tools/tld_cleanup",
683 public_deps += [ "//third_party/protobuf:py_proto" ]
686 if (use_nss_certs || is_ios) {
687 public_deps += [ "//crypto:platform" ]
692 "test/spawned_test_server/remote_test_server.cc",
693 "test/spawned_test_server/remote_test_server.h",
694 "test/spawned_test_server/spawner_communicator.cc",
695 "test/spawned_test_server/spawner_communicator.h",
700 public_deps += [ ":net_with_v8" ]
705 "dns/mock_mdns_socket_factory.cc",
706 "dns/mock_mdns_socket_factory.h",
710 if (!use_nss_certs) {
711 sources -= [ "test/cert_test_util_nss.cc" ]
714 if (!disable_file_support) {
716 "test/url_request/url_request_mock_http_job.cc",
717 "test/url_request/url_request_mock_http_job.h",
718 "url_request/test_url_request_interceptor.cc",
719 "url_request/test_url_request_interceptor.h",
724 source_set("balsa") {
726 "tools/balsa/balsa_enums.h",
727 "tools/balsa/balsa_frame.cc",
728 "tools/balsa/balsa_frame.h",
729 "tools/balsa/balsa_headers.cc",
730 "tools/balsa/balsa_headers.h",
731 "tools/balsa/balsa_headers_token_utils.cc",
732 "tools/balsa/balsa_headers_token_utils.h",
733 "tools/balsa/balsa_visitor_interface.h",
734 "tools/balsa/http_message_constants.cc",
735 "tools/balsa/http_message_constants.h",
736 "tools/balsa/noop_balsa_visitor.h",
737 "tools/balsa/simple_buffer.cc",
738 "tools/balsa/simple_buffer.h",
739 "tools/balsa/split.cc",
740 "tools/balsa/split.h",
741 "tools/balsa/string_piece_utils.h",
742 "tools/quic/spdy_balsa_utils.cc",
743 "tools/quic/spdy_balsa_utils.h",
753 component("net_with_v8") {
755 "proxy/proxy_resolver_v8.cc",
756 "proxy/proxy_resolver_v8.h",
757 "proxy/proxy_resolver_v8_tracing.cc",
758 "proxy/proxy_resolver_v8_tracing.h",
759 "proxy/proxy_resolver_v8_tracing_wrapper.cc",
760 "proxy/proxy_resolver_v8_tracing_wrapper.h",
761 "proxy/proxy_service_v8.cc",
762 "proxy/proxy_service_v8.h",
765 defines = [ "NET_IMPLEMENTATION" ]
767 "//build/config/compiler:no_size_t_to_int_warning",
768 "//build/config/compiler:wexit_time_destructors",
783 if (use_v8_in_net && !is_android) {
784 source_set("net_browser_services") {
786 "dns/mojo_host_resolver_impl.cc",
787 "dns/mojo_host_resolver_impl.h",
788 "proxy/in_process_mojo_proxy_resolver_factory.cc",
789 "proxy/in_process_mojo_proxy_resolver_factory.h",
790 "proxy/mojo_proxy_resolver_factory.h",
791 "proxy/proxy_resolver_factory_mojo.cc",
792 "proxy/proxy_resolver_factory_mojo.h",
793 "proxy/proxy_service_mojo.cc",
794 "proxy/proxy_service_mojo.h",
798 ":mojo_type_converters",
803 "//third_party/mojo/src/mojo/public/cpp/bindings",
805 # NOTE(amistry): As long as we support in-process Mojo v8 PAC, we need
806 # this dependency since in_process_mojo_proxy_resolver_factory creates
807 # the utility process side Mojo services in the browser process.
808 # Ultimately, this will go away when we only support out-of-process.
809 ":net_utility_services",
813 source_set("mojo_type_converters") {
815 "dns/mojo_host_type_converters.cc",
816 "dns/mojo_host_type_converters.h",
817 "proxy/mojo_proxy_type_converters.cc",
818 "proxy/mojo_proxy_type_converters.h",
824 "//third_party/mojo/src/mojo/public/cpp/bindings",
828 source_set("net_utility_services") {
830 "dns/host_resolver_mojo.cc",
831 "dns/host_resolver_mojo.h",
832 "proxy/mojo_proxy_resolver_factory_impl.cc",
833 "proxy/mojo_proxy_resolver_factory_impl.h",
834 "proxy/mojo_proxy_resolver_impl.cc",
835 "proxy/mojo_proxy_resolver_impl.h",
836 "proxy/mojo_proxy_resolver_v8_tracing_bindings.h",
844 ":mojo_type_converters",
848 "//third_party/mojo/src/mojo/public/cpp/bindings",
853 if (!is_ios && !is_android) {
854 executable("crash_cache") {
857 "tools/crash_cache/crash_cache.cc",
860 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
861 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
866 "//build/config/sanitizers:deps",
870 executable("crl_set_dump") {
873 "tools/crl_set_dump/crl_set_dump.cc",
876 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
877 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
881 "//build/config/sanitizers:deps",
885 executable("dns_fuzz_stub") {
888 "tools/dns_fuzz_stub/dns_fuzz_stub.cc",
891 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
892 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
896 "//build/config/sanitizers:deps",
903 "tools/gdig/file_net_log.cc",
904 "tools/gdig/gdig.cc",
909 "//build/config/sanitizers:deps",
913 executable("get_server_time") {
916 "tools/get_server_time/get_server_time.cc",
919 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
920 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
925 "//build/config/sanitizers:deps",
930 executable("hpack_example_generator") {
933 "spdy/fuzzing/hpack_example_generator.cc",
936 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
937 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
941 "//build/config/sanitizers:deps",
945 executable("hpack_fuzz_mutator") {
948 "spdy/fuzzing/hpack_fuzz_mutator.cc",
951 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
952 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
956 "//build/config/sanitizers:deps",
960 executable("hpack_fuzz_wrapper") {
963 "spdy/fuzzing/hpack_fuzz_wrapper.cc",
966 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
967 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
971 "//build/config/sanitizers:deps",
976 executable("net_watcher") {
979 "tools/net_watcher/net_watcher.cc",
985 "//build/config/sanitizers:deps",
988 if (is_desktop_linux) {
990 "//build/config/linux:gconf",
991 "//build/config/linux:glib",
993 deps += [ "//build/linux:gio" ]
998 executable("run_testserver") {
1001 "tools/testserver/run_testserver.cc",
1006 "//base/test:test_support",
1007 "//build/config/sanitizers:deps",
1012 executable("stress_cache") {
1015 "tools/stress_cache/stress_cache.cc",
1018 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1019 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
1024 "//build/config/sanitizers:deps",
1028 executable("tld_cleanup") {
1030 "tools/tld_cleanup/tld_cleanup.cc",
1033 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1034 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
1038 "//build/config/sanitizers:deps",
1039 "//net/tools/tld_cleanup",
1045 static_library("epoll_server") {
1047 "tools/epoll_server/epoll_server.cc",
1048 "tools/epoll_server/epoll_server.h",
1056 static_library("flip_in_mem_edsm_server_base") {
1059 "tools/flip_server/acceptor_thread.cc",
1060 "tools/flip_server/acceptor_thread.h",
1061 "tools/flip_server/constants.h",
1062 "tools/flip_server/create_listener.cc",
1063 "tools/flip_server/create_listener.h",
1064 "tools/flip_server/flip_config.cc",
1065 "tools/flip_server/flip_config.h",
1066 "tools/flip_server/http_interface.cc",
1067 "tools/flip_server/http_interface.h",
1068 "tools/flip_server/loadtime_measurement.h",
1069 "tools/flip_server/mem_cache.cc",
1070 "tools/flip_server/mem_cache.h",
1071 "tools/flip_server/output_ordering.cc",
1072 "tools/flip_server/output_ordering.h",
1073 "tools/flip_server/ring_buffer.cc",
1074 "tools/flip_server/ring_buffer.h",
1075 "tools/flip_server/sm_connection.cc",
1076 "tools/flip_server/sm_connection.h",
1077 "tools/flip_server/sm_interface.h",
1078 "tools/flip_server/spdy_interface.cc",
1079 "tools/flip_server/spdy_interface.h",
1080 "tools/flip_server/spdy_ssl.cc",
1081 "tools/flip_server/spdy_ssl.h",
1082 "tools/flip_server/spdy_util.cc",
1083 "tools/flip_server/spdy_util.h",
1084 "tools/flip_server/streamer_interface.cc",
1085 "tools/flip_server/streamer_interface.h",
1086 "tools/flip_server/url_to_filename_encoder.cc",
1087 "tools/flip_server/url_to_filename_encoder.h",
1088 "tools/flip_server/url_utilities.cc",
1089 "tools/flip_server/url_utilities.h",
1096 "//third_party/boringssl",
1100 executable("flip_in_mem_edsm_server_unittests") {
1103 "tools/flip_server/flip_test_utils.cc",
1104 "tools/flip_server/flip_test_utils.h",
1105 "tools/flip_server/http_interface_test.cc",
1106 "tools/flip_server/mem_cache_test.cc",
1107 "tools/flip_server/run_all_tests.cc",
1108 "tools/flip_server/spdy_interface_test.cc",
1109 "tools/flip_server/url_to_filename_encoder_unittest.cc",
1110 "tools/flip_server/url_utilities_unittest.cc",
1114 ":flip_in_mem_edsm_server_base",
1117 "//build/config/sanitizers:deps",
1120 "//third_party/boringssl",
1124 executable("flip_in_mem_edsm_server") {
1127 "tools/flip_server/flip_in_mem_edsm_server.cc",
1131 ":flip_in_mem_edsm_server_base",
1134 "//build/config/sanitizers:deps",
1138 source_set("epoll_quic_tools") {
1140 "tools/quic/quic_client.cc",
1141 "tools/quic/quic_client.h",
1142 "tools/quic/quic_default_packet_writer.cc",
1143 "tools/quic/quic_default_packet_writer.h",
1144 "tools/quic/quic_epoll_clock.cc",
1145 "tools/quic/quic_epoll_clock.h",
1146 "tools/quic/quic_epoll_connection_helper.cc",
1147 "tools/quic/quic_epoll_connection_helper.h",
1148 "tools/quic/quic_packet_reader.cc",
1149 "tools/quic/quic_packet_reader.h",
1150 "tools/quic/quic_packet_writer_wrapper.cc",
1151 "tools/quic/quic_packet_writer_wrapper.h",
1152 "tools/quic/quic_server.cc",
1153 "tools/quic/quic_server.h",
1154 "tools/quic/quic_socket_utils.cc",
1155 "tools/quic/quic_socket_utils.h",
1162 "//base/third_party/dynamic_annotations",
1164 "//third_party/boringssl",
1169 executable("epoll_quic_client") {
1171 "tools/quic/quic_client_bin.cc",
1176 ":epoll_quic_tools",
1178 ":simple_quic_tools",
1180 "//build/config/sanitizers:deps",
1181 "//third_party/boringssl",
1185 executable("epoll_quic_server") {
1187 "tools/quic/quic_server_bin.cc",
1192 ":epoll_quic_tools",
1194 ":simple_quic_tools",
1196 "//build/config/sanitizers:deps",
1197 "//third_party/boringssl",
1203 generate_jni("net_jni_headers") {
1205 "android/java/src/org/chromium/net/AndroidCertVerifyResult.java",
1206 "android/java/src/org/chromium/net/AndroidKeyStore.java",
1207 "android/java/src/org/chromium/net/AndroidNetworkLibrary.java",
1208 "android/java/src/org/chromium/net/AndroidPrivateKey.java",
1209 "android/java/src/org/chromium/net/GURLUtils.java",
1210 "android/java/src/org/chromium/net/HttpNegotiateAuthenticator.java",
1211 "android/java/src/org/chromium/net/NetStringUtil.java",
1212 "android/java/src/org/chromium/net/NetworkChangeNotifier.java",
1213 "android/java/src/org/chromium/net/ProxyChangeListener.java",
1214 "android/java/src/org/chromium/net/X509Util.java",
1218 generate_jni("net_test_jni_headers") {
1220 "android/javatests/src/org/chromium/net/AndroidKeyStoreTestUtil.java",
1221 "test/android/javatests/src/org/chromium/net/test/DummySpnegoAuthenticator.java",
1223 jni_package = "net/test"
1227 if (is_android || is_linux) {
1228 executable("disk_cache_memory_test") {
1231 "tools/disk_cache_memory_test/disk_cache_memory_test.cc",
1236 "//build/config/sanitizers:deps",
1241 source_set("simple_quic_tools") {
1243 "tools/quic/quic_client_base.cc",
1244 "tools/quic/quic_client_base.h",
1245 "tools/quic/quic_client_session.cc",
1246 "tools/quic/quic_client_session.h",
1247 "tools/quic/quic_dispatcher.cc",
1248 "tools/quic/quic_dispatcher.h",
1249 "tools/quic/quic_in_memory_cache.cc",
1250 "tools/quic/quic_in_memory_cache.h",
1251 "tools/quic/quic_per_connection_packet_writer.cc",
1252 "tools/quic/quic_per_connection_packet_writer.h",
1253 "tools/quic/quic_server_session.cc",
1254 "tools/quic/quic_server_session.h",
1255 "tools/quic/quic_simple_client.cc",
1256 "tools/quic/quic_simple_client.h",
1257 "tools/quic/quic_simple_per_connection_packet_writer.cc",
1258 "tools/quic/quic_simple_per_connection_packet_writer.h",
1259 "tools/quic/quic_simple_server.cc",
1260 "tools/quic/quic_simple_server.h",
1261 "tools/quic/quic_simple_server_packet_writer.cc",
1262 "tools/quic/quic_simple_server_packet_writer.h",
1263 "tools/quic/quic_spdy_client_stream.cc",
1264 "tools/quic/quic_spdy_client_stream.h",
1265 "tools/quic/quic_spdy_server_stream.cc",
1266 "tools/quic/quic_spdy_server_stream.h",
1267 "tools/quic/quic_time_wait_list_manager.cc",
1268 "tools/quic/quic_time_wait_list_manager.h",
1269 "tools/quic/synchronous_host_resolver.cc",
1270 "tools/quic/synchronous_host_resolver.h",
1275 "//base/third_party/dynamic_annotations",
1281 executable("quic_client") {
1283 "tools/quic/quic_simple_client_bin.cc",
1287 ":simple_quic_tools",
1289 "//build/config/sanitizers:deps",
1293 executable("quic_server") {
1295 "tools/quic/quic_simple_server_bin.cc",
1299 ":simple_quic_tools",
1301 "//build/config/sanitizers:deps",
1302 "//third_party/boringssl",
1303 "//third_party/protobuf:protobuf_lite",
1308 # TODO(GYP): Delete this after we've converted everything to GN.
1309 # The _run targets exist only for compatibility w/ GYP.
1310 group("net_unittests_run") {
1317 test("net_unittests") {
1318 sources = gypi_values.net_test_sources
1322 "websockets/websocket_stream_cookie_test.cc",
1323 "websockets/websocket_stream_create_test_base.cc",
1324 "websockets/websocket_stream_create_test_base.h",
1329 "//build/config:precompiled_headers",
1331 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1332 "//build/config/compiler:no_size_t_to_int_warning",
1341 ":simple_quic_tools",
1345 "//base:prefs_test_support",
1347 "//base/third_party/dynamic_annotations",
1349 "//crypto:platform",
1350 "//crypto:test_support",
1352 "//net/base/registry_controlled_domains",
1356 "//third_party/zlib",
1364 if (is_linux || is_mac || is_win) {
1366 "//third_party/pyftpdlib/",
1367 "//third_party/pywebsocket/",
1368 "//third_party/tlslite/",
1371 "//third_party/pyftpdlib/",
1372 "//third_party/pywebsocket/",
1373 "//third_party/tlslite/",
1376 "tools/testserver/",
1377 "//third_party/pyftpdlib/",
1378 "//third_party/pywebsocket/",
1379 "//third_party/tlslite/",
1380 "$root_out_dir/pyproto/google/",
1384 if (is_desktop_linux) {
1385 deps += [ ":epoll_quic_tools" ]
1388 sources += gypi_values.net_linux_test_sources
1390 ":epoll_quic_tools",
1392 ":flip_in_mem_edsm_server_base",
1396 if (is_mac || is_ios) {
1397 sources += gypi_values.net_base_test_mac_ios_sources
1401 sources -= [ "proxy/proxy_config_service_linux_unittest.cc" ]
1404 if (v8_use_external_startup_data) {
1408 if (!use_nss_certs) {
1410 "cert/nss_cert_database_unittest.cc",
1411 "ssl/client_cert_store_nss_unittest.cc",
1413 if (is_chromeos) { # Already removed for all non-ChromeOS builds.
1415 "cert/nss_cert_database_chromeos_unittest.cc",
1416 "cert/nss_profile_filter_chromeos_unittest.cc",
1422 # When building for OpenSSL, we need to exclude NSS specific tests
1423 # or functionality not supported by OpenSSL yet.
1424 # TODO(bulach): Add equivalent tests when the underlying
1425 # functionality is ported to OpenSSL.
1426 sources -= [ "quic/test_tools/crypto_test_utils_nss.cc" ]
1429 "cert/x509_util_openssl_unittest.cc",
1430 "quic/test_tools/crypto_test_utils_openssl.cc",
1431 "socket/ssl_client_socket_openssl_unittest.cc",
1432 "ssl/ssl_client_session_cache_openssl_unittest.cc",
1437 defines += [ "USE_KERBEROS" ]
1440 # These are excluded on Android, because the actual Kerberos support, which
1441 # these test, is in a separate app on Android.
1442 if (!use_kerberos || is_android) {
1444 "http/http_auth_gssapi_posix_unittest.cc",
1445 "http/mock_gssapi_library_posix.cc",
1446 "http/mock_gssapi_library_posix.h",
1449 if (!use_kerberos) {
1450 sources -= [ "http/http_auth_handler_negotiate_unittest.cc" ]
1453 if (use_openssl || (!is_desktop_linux && !is_chromeos && !is_ios)) {
1454 # Only include this test when on Posix and using NSS for
1455 # cert verification or on iOS (which also uses NSS for certs).
1456 sources -= [ "cert_net/nss_ocsp_unittest.cc" ]
1459 if (!use_openssl_certs) {
1460 sources -= [ "ssl/openssl_client_key_store_unittest.cc" ]
1463 if (!enable_websockets) {
1465 "server/http_connection_unittest.cc",
1466 "server/http_server_response_info_unittest.cc",
1467 "server/http_server_unittest.cc",
1468 "server/web_socket_encoder_unittest.cc",
1469 "websockets/websocket_basic_stream_test.cc",
1470 "websockets/websocket_channel_test.cc",
1471 "websockets/websocket_deflate_predictor_impl_test.cc",
1472 "websockets/websocket_deflate_stream_test.cc",
1473 "websockets/websocket_deflater_test.cc",
1474 "websockets/websocket_end_to_end_test.cc",
1475 "websockets/websocket_errors_test.cc",
1476 "websockets/websocket_extension_parser_test.cc",
1477 "websockets/websocket_frame_parser_test.cc",
1478 "websockets/websocket_frame_test.cc",
1479 "websockets/websocket_handshake_challenge_test.cc",
1480 "websockets/websocket_handshake_stream_create_helper_test.cc",
1481 "websockets/websocket_inflater_test.cc",
1482 "websockets/websocket_stream_test.cc",
1483 "websockets/websocket_test_util.cc",
1484 "websockets/websocket_test_util.h",
1486 deps -= [ ":http_server" ]
1489 if (disable_file_support) {
1491 "base/directory_lister_unittest.cc",
1492 "url_request/url_request_file_job_unittest.cc",
1496 if (disable_ftp_support) {
1498 "ftp/ftp_auth_cache_unittest.cc",
1499 "ftp/ftp_ctrl_response_buffer_unittest.cc",
1500 "ftp/ftp_directory_listing_parser_ls_unittest.cc",
1501 "ftp/ftp_directory_listing_parser_unittest.cc",
1502 "ftp/ftp_directory_listing_parser_unittest.h",
1503 "ftp/ftp_directory_listing_parser_vms_unittest.cc",
1504 "ftp/ftp_directory_listing_parser_windows_unittest.cc",
1505 "ftp/ftp_network_transaction_unittest.cc",
1506 "ftp/ftp_util_unittest.cc",
1507 "url_request/url_request_ftp_job_unittest.cc",
1511 if (!enable_built_in_dns) {
1513 "dns/address_sorter_posix_unittest.cc",
1514 "dns/address_sorter_unittest.cc",
1518 if (use_v8_in_net) {
1519 deps += [ ":net_with_v8" ]
1522 "proxy/proxy_resolver_v8_tracing_unittest.cc",
1523 "proxy/proxy_resolver_v8_tracing_wrapper_unittest.cc",
1524 "proxy/proxy_resolver_v8_unittest.cc",
1528 if (use_v8_in_net && !is_android) {
1530 ":net_browser_services",
1531 ":net_utility_services",
1532 "//mojo/environment:chromium",
1533 "//third_party/mojo/src/mojo/edk/system",
1537 "dns/host_resolver_mojo_unittest.cc",
1538 "dns/mojo_host_resolver_impl_unittest.cc",
1539 "proxy/mojo_proxy_resolver_factory_impl_unittest.cc",
1540 "proxy/mojo_proxy_resolver_impl_unittest.cc",
1541 "proxy/mojo_proxy_resolver_v8_tracing_bindings_unittest.cc",
1542 "proxy/proxy_resolver_factory_mojo_unittest.cc",
1543 "proxy/proxy_service_mojo_unittest.cc",
1549 "dns/mdns_cache_unittest.cc",
1550 "dns/mdns_client_unittest.cc",
1551 "dns/record_parsed_unittest.cc",
1552 "dns/record_rdata_unittest.cc",
1560 # 'action_name': 'copy_test_data',
1562 # 'test_data_files': [
1563 # 'data/ssl/certificates/',
1565 # 'data/url_request_unittest/',
1566 # 'data/verify_name_match_unittest/names/',
1567 # 'data/parse_certificate_unittest/',
1569 # 'test_data_prefix': 'net',
1571 # 'includes': [ '../build/copy_test_data_ios.gypi' ],
1575 # TODO(droger): The following tests are disabled because the
1576 # implementation is missing or incomplete.
1577 # KeygenHandler::GenKeyAndSignChallenge() is not ported to iOS.
1578 "base/keygen_handler_unittest.cc",
1579 "disk_cache/backend_unittest.cc",
1580 "disk_cache/blockfile/block_files_unittest.cc",
1582 # Need to read input data files.
1583 "filter/gzip_filter_unittest.cc",
1584 "socket/ssl_server_socket_unittest.cc",
1585 "spdy/fuzzing/hpack_fuzz_util_test.cc",
1588 "cert_net/cert_net_fetcher_impl_unittest.cc",
1589 "proxy/proxy_script_fetcher_impl_unittest.cc",
1590 "socket/ssl_client_socket_unittest.cc",
1591 "url_request/url_fetcher_impl_unittest.cc",
1592 "url_request/url_request_context_builder_unittest.cc",
1594 # Needs GetAppOutput().
1595 "test/python_utils_unittest.cc",
1597 # The following tests are disabled because they don't apply to
1599 # OS is not "linux" or "freebsd" or "openbsd".
1600 "socket/unix_domain_client_socket_posix_unittest.cc",
1601 "socket/unix_domain_server_socket_posix_unittest.cc",
1603 # See bug http://crbug.com/344533.
1604 "disk_cache/blockfile/index_table_v3_unittest.cc",
1610 # See bug http://crbug.com/344533.
1611 "disk_cache/blockfile/index_table_v3_unittest.cc",
1612 "dns/dns_config_service_posix_unittest.cc",
1615 ":net_test_jni_headers",
1617 # TODO(mmenke): This depends on test_support_base, which depends on
1618 # icu. Figure out a way to remove that dependency.
1619 "//testing/android/native_test:native_test_native_code",
1621 set_sources_assignment_filter([])
1622 sources += [ "base/address_tracker_linux_unittest.cc" ]
1623 set_sources_assignment_filter(sources_assignment_filter)
1624 isolate_file = "net_unittests.isolate"
1627 # Symbols for crashes when running tests on swarming.
1628 if (symbol_level > 0) {
1630 data += [ "$root_out_dir/net_unittests.exe.pdb" ]
1631 } else if (is_mac) {
1632 data += [ "$root_out_dir/net_unittests.dSYM/" ]
1637 # !is_android && !is_win && !is_mac
1639 executable("net_perftests") {
1642 "base/mime_sniffer_perftest.cc",
1643 "cookies/cookie_monster_perftest.cc",
1644 "disk_cache/blockfile/disk_cache_perftest.cc",
1645 "extras/sqlite/sqlite_persistent_cookie_store_perftest.cc",
1646 "proxy/proxy_resolver_perftest.cc",
1647 "udp/udp_socket_perftest.cc",
1650 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1651 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
1658 "//base/test:test_support_perf",
1659 "//build/config/sanitizers:deps",
1664 if (enable_websockets) {
1665 sources += [ "websockets/websocket_frame_perftest.cc" ]
1668 if (use_v8_in_net) {
1669 deps += [ ":net_with_v8" ]
1671 sources -= [ "proxy/proxy_resolver_perftest.cc" ]