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/compiler/compiler.gni")
6 import("//build/config/crypto.gni")
7 import("//build/config/features.gni")
8 import("//build/config/ui.gni")
9 import("//build/module_args/v8.gni")
10 import("//testing/test.gni")
11 import("//third_party/icu/config.gni")
12 import("//third_party/protobuf/proto_library.gni")
14 # TODO(cjhopman): //build/config/android/rules.gni also imports grit_rule.gni.
15 # Currently, that file can't be imported multiple times. Make this always
16 # imported when http://crbug.com/393704 is fixed.
18 import("//tools/grit/grit_rule.gni")
22 import("//build/config/android/config.gni")
23 import("//build/config/android/rules.gni")
25 import("//build/config/mac/mac_sdk.gni")
28 # The list of net files is kept in net.gypi. Read it.
29 gypi_values = exec_script("//build/gypi_to_gn.py",
30 [ rebase_path("net.gypi") ],
34 # Disable Kerberos on ChromeOS, Android and iOS, at least for now. It needs
35 # configuration (krb5.conf and so on).
36 use_kerberos = !is_chromeos && !is_android && !is_ios
38 # The way the cache uses mmap() is inefficient on some Android devices. If
39 # this flag is set, we hackily avoid using mmap() in the disk cache. We are
40 # pretty confident that mmap-ing the index would not hurt any existing x86
41 # android devices, but we cannot be so sure about the variety of ARM devices.
42 # So enable it for x86 only for now.
43 posix_avoid_mmap = is_android && current_cpu != "x86"
45 # WebSockets and socket stream code are used everywhere except iOS.
46 enable_websockets = !is_ios
47 use_v8_in_net = !is_ios
48 enable_built_in_dns = !is_ios
49 disable_ftp_support = is_ios
52 # Disables support for file URLs. File URL support requires use of icu.
53 disable_file_support = false
56 config("net_config") {
58 if (posix_avoid_mmap) {
59 defines += [ "POSIX_AVOID_MMAP" ]
61 if (disable_file_support) {
62 defines += [ "DISABLE_FILE_SUPPORT" ]
66 # net_internal_config is shared with net and net_small.
67 config("net_internal_config") {
69 # TODO(GYP) Note that the GYP file supports linux_link_kerberos (defaults to
70 # 0) which implies that we run pkg_config on kerberos and link to that
71 # rather than setting this define which will dynamically open it. That
72 # doesn't seem to be set in the regular builds, so we're skipping this
79 defines += [ "USE_KERBEROS" ]
81 include_dirs = [ "/usr/include/kerberosV" ]
85 if (enable_built_in_dns) {
86 defines += [ "ENABLE_BUILT_IN_DNS" ]
90 # net_shared_* are settings shared between net and net_small
91 net_shared_sources = gypi_values.net_nacl_common_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 = [
112 "//net/base/registry_controlled_domains",
113 "//third_party/protobuf:protobuf_lite",
117 net_shared_sources += gypi_values.net_non_nacl_sources
121 "//base/third_party/dynamic_annotations",
123 "//third_party/zlib",
127 net_shared_sources -= [
128 "http/http_auth_gssapi_posix.cc",
129 "http/http_auth_gssapi_posix.h",
130 "http/http_auth_handler_negotiate.cc",
131 "http/http_auth_handler_negotiate.h",
136 if (posix_avoid_mmap) {
137 net_shared_sources -= [ "disk_cache/blockfile/mapped_file_posix.cc" ]
139 net_shared_sources -=
140 [ "disk_cache/blockfile/mapped_file_avoid_mmap_posix.cc" ]
144 if (!enable_built_in_dns) {
145 net_shared_sources -= [
146 "dns/address_sorter_posix.cc",
147 "dns/address_sorter_posix.h",
153 net_shared_sources -= [
156 "cert/ct_log_verifier_nss.cc",
157 "cert/ct_objects_extractor_nss.cc",
158 "cert/jwk_serializer_nss.cc",
159 "cert/scoped_nss_types.h",
160 "cert/x509_util_nss.cc",
161 "quic/crypto/aead_base_decrypter_nss.cc",
162 "quic/crypto/aead_base_encrypter_nss.cc",
163 "quic/crypto/aes_128_gcm_12_decrypter_nss.cc",
164 "quic/crypto/aes_128_gcm_12_encrypter_nss.cc",
165 "quic/crypto/chacha20_poly1305_decrypter_nss.cc",
166 "quic/crypto/chacha20_poly1305_encrypter_nss.cc",
167 "quic/crypto/channel_id_nss.cc",
168 "quic/crypto/p256_key_exchange_nss.cc",
169 "quic/crypto/proof_source_chromium_nss.cc",
170 "socket/nss_ssl_util.cc",
171 "socket/nss_ssl_util.h",
172 "socket/ssl_client_socket_nss.cc",
173 "socket/ssl_client_socket_nss.h",
174 "socket/ssl_server_socket_nss.cc",
175 "socket/ssl_server_socket_nss.h",
178 # Always removed for !ios below.
179 net_shared_sources -= [
180 "cert/cert_verify_proc_nss.cc",
181 "cert/cert_verify_proc_nss.h",
185 net_shared_sources -= [ "cert/sha256_legacy_support_nss_win.cc" ]
187 if (!use_nss_certs && !is_ios) {
188 net_shared_sources -= [ "cert/x509_util_nss.h" ]
191 net_shared_sources -= [
192 "cert/ct_log_verifier_openssl.cc",
193 "cert/ct_objects_extractor_openssl.cc",
194 "cert/jwk_serializer_openssl.cc",
195 "cert/x509_util_openssl.cc",
196 "cert/x509_util_openssl.h",
197 "quic/crypto/aead_base_decrypter_openssl.cc",
198 "quic/crypto/aead_base_encrypter_openssl.cc",
199 "quic/crypto/aes_128_gcm_12_decrypter_openssl.cc",
200 "quic/crypto/aes_128_gcm_12_encrypter_openssl.cc",
201 "quic/crypto/chacha20_poly1305_decrypter_openssl.cc",
202 "quic/crypto/chacha20_poly1305_encrypter_openssl.cc",
203 "quic/crypto/channel_id_openssl.cc",
204 "quic/crypto/p256_key_exchange_openssl.cc",
205 "quic/crypto/proof_source_chromium_openssl.cc",
206 "quic/crypto/scoped_evp_aead_ctx.cc",
207 "quic/crypto/scoped_evp_aead_ctx.h",
208 "socket/ssl_client_socket_openssl.cc",
209 "socket/ssl_client_socket_openssl.h",
210 "socket/ssl_server_socket_openssl.cc",
211 "socket/ssl_server_socket_openssl.h",
212 "ssl/openssl_ssl_util.cc",
213 "ssl/openssl_ssl_util.h",
214 "ssl/ssl_client_session_cache_openssl.cc",
215 "ssl/ssl_client_session_cache_openssl.h",
216 "ssl/ssl_platform_key.h",
217 "ssl/threaded_ssl_private_key.cc",
218 "ssl/threaded_ssl_private_key.h",
221 net_shared_sources -= [ "ssl/ssl_platform_key_mac.cc" ]
224 net_shared_sources -= [ "ssl/ssl_platform_key_android.cc" ]
227 net_shared_sources -= [
228 "cert/sha256_legacy_support_openssl_win.cc",
229 "ssl/ssl_platform_key_win.cc",
233 net_shared_sources -= [
234 "ssl/client_key_store.cc",
235 "ssl/client_key_store.h",
236 "ssl/ssl_platform_key_nss.cc",
241 if (!use_openssl_certs) {
242 net_shared_sources -= [
243 "base/crypto_module_openssl.cc",
244 "base/keygen_handler_openssl.cc",
245 "base/openssl_private_key_store.h",
246 "base/openssl_private_key_store_memory.cc",
247 "cert/cert_database_openssl.cc",
248 "cert/cert_verify_proc_openssl.cc",
249 "cert/cert_verify_proc_openssl.h",
250 "cert/test_root_certs_openssl.cc",
251 "cert/x509_certificate_openssl.cc",
252 "ssl/openssl_client_key_store.cc",
253 "ssl/openssl_client_key_store.h",
256 net_shared_sources -= [ "base/openssl_private_key_store_android.cc" ]
260 # Android doesn't use these even when using OpenSSL.
261 net_shared_sources -= [
262 "base/openssl_private_key_store_memory.cc",
263 "cert/cert_database_openssl.cc",
264 "cert/cert_verify_proc_openssl.cc",
265 "cert/test_root_certs_openssl.cc",
270 if (use_glib && !is_chromeos) {
271 net_shared_configs += [ "//build/config/linux:gconf" ]
272 net_shared_deps += [ "//build/linux:gio" ]
276 net_shared_configs += [ "//build/config/linux:libresolv" ]
279 if (!use_nss_certs) {
280 net_shared_sources -= [
281 "base/crypto_module_nss.cc",
282 "base/keygen_handler_nss.cc",
283 "cert/cert_database_nss.cc",
284 "cert/nss_cert_database.cc",
285 "cert/nss_cert_database.h",
286 "cert/x509_certificate_nss.cc",
287 "ssl/client_cert_store_nss.cc",
288 "ssl/client_cert_store_nss.h",
289 "third_party/mozilla_security_manager/nsKeygenHandler.cpp",
290 "third_party/mozilla_security_manager/nsKeygenHandler.h",
291 "third_party/mozilla_security_manager/nsNSSCertificateDB.cpp",
292 "third_party/mozilla_security_manager/nsNSSCertificateDB.h",
293 "third_party/mozilla_security_manager/nsPKCS12Blob.cpp",
294 "third_party/mozilla_security_manager/nsPKCS12Blob.h",
297 # These files are part of the partial implementation of NSS on iOS so
298 # keep them in that case (even though use_nss_certs is not set).
299 net_shared_sources -= [
300 "cert/cert_verify_proc_nss.cc",
301 "cert/cert_verify_proc_nss.h",
302 "cert/test_root_certs_nss.cc",
303 "cert/x509_util_nss_certs.cc",
304 "cert_net/nss_ocsp.cc",
305 "cert_net/nss_ocsp.h",
309 # These were already removed on non-ChromeOS.
310 net_shared_sources -= [
311 "cert/nss_cert_database_chromeos.cc",
312 "cert/nss_cert_database_chromeos.h",
313 "cert/nss_profile_filter_chromeos.cc",
314 "cert/nss_profile_filter_chromeos.h",
317 net_shared_sources -= [
318 "ssl/client_key_store.cc",
319 "ssl/client_key_store.h",
320 "ssl/ssl_platform_key_nss.cc",
322 } else if (use_openssl) {
323 # client_cert_store_nss.c requires NSS_CmpCertChainWCANames from NSS's
324 # libssl, but our bundled copy is not built in OpenSSL ports. Pull that file
326 net_shared_sources += [ "third_party/nss/ssl/cmpcert.c" ]
330 net_shared_sources -= [
333 "dns/mdns_client.cc",
335 "dns/mdns_client_impl.cc",
336 "dns/mdns_client_impl.h",
337 "dns/record_parsed.cc",
338 "dns/record_parsed.h",
339 "dns/record_rdata.cc",
340 "dns/record_rdata.h",
345 net_shared_sources -= [ "http/http_auth_handler_ntlm_portable.cc" ]
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",
398 net_shared_public_deps += [ "//native_client_sdk/src/libraries/nacl_io" ]
402 sources = net_shared_sources
404 # Add back some sources that were otherwise filtered out.
405 set_sources_assignment_filter([])
406 sources += net_shared_unfiltered_sources
407 set_sources_assignment_filter(sources_assignment_filter)
410 configs += net_shared_configs
411 public_configs = [ ":net_config" ]
413 public_deps = net_shared_public_deps + [ "//url" ]
414 deps = net_shared_deps
418 "Foundation.framework",
419 "Security.framework",
420 "SystemConfiguration.framework",
427 "CFNetwork.framework",
428 "MobileCoreServices.framework",
429 "Security.framework",
430 "SystemConfiguration.framework",
436 if (!disable_file_support) {
437 sources += gypi_values.net_file_support_sources
440 if (!disable_ftp_support) {
441 sources += gypi_values.net_ftp_support_sources
444 if (enable_websockets) {
445 sources += gypi_values.net_websockets_sources
454 "base/filename_util_icu.cc",
455 "base/net_string_util_icu.cc",
456 "base/net_util_icu.cc",
462 # Same as net, but with ICU, file, ftp, and websocket support stripped.
463 component("net_small") {
464 sources = net_shared_sources
466 # Add back some sources that were otherwise filtered out.
467 set_sources_assignment_filter([])
468 sources += net_shared_unfiltered_sources
469 set_sources_assignment_filter(sources_assignment_filter)
473 configs += net_shared_configs
474 public_configs = [ ":net_config" ]
476 public_deps = net_shared_public_deps +
477 [ "//url:url_lib_use_icu_alternatives_on_android" ]
478 deps = net_shared_deps + [ ":net_jni_headers" ]
481 "DISABLE_FILE_SUPPORT",
482 "DISABLE_FTP_SUPPORT",
483 "USE_ICU_ALTERNATIVES_ON_ANDROID=1",
486 # Use ICU alternative on Android.
488 "base/net_string_util_icu_alternatives_android.cc",
489 "base/net_string_util_icu_alternatives_android.h",
494 grit("net_resources") {
495 source = "base/net_resources.grd"
496 use_qualified_include = true
498 "grit/net_resources.h",
503 proto_library("net_quic_proto") {
510 "quic/proto/cached_network_parameters.proto",
511 "quic/proto/source_address_token.proto",
513 cc_generator_options = "dllexport_decl=NET_EXPORT_PRIVATE:"
514 cc_include = "net/base/net_export.h"
516 defines = [ "NET_IMPLEMENTATION" ]
518 extra_configs = [ "//build/config/compiler:wexit_time_destructors" ]
521 static_library("extras") {
522 sources = gypi_values.net_extras_sources
523 configs += [ "//build/config/compiler:wexit_time_destructors" ]
531 static_library("http_server") {
533 "server/http_connection.cc",
534 "server/http_connection.h",
535 "server/http_server.cc",
536 "server/http_server.h",
537 "server/http_server_request_info.cc",
538 "server/http_server_request_info.h",
539 "server/http_server_response_info.cc",
540 "server/http_server_response_info.h",
541 "server/web_socket.cc",
542 "server/web_socket.h",
543 "server/web_socket_encoder.cc",
544 "server/web_socket_encoder.h",
547 "//build/config/compiler:no_size_t_to_int_warning",
548 "//build/config/compiler:wexit_time_destructors",
556 executable("dump_cache") {
559 "tools/dump_cache/dump_cache.cc",
560 "tools/dump_cache/dump_files.cc",
561 "tools/dump_cache/dump_files.h",
564 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
565 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
571 "//build/config/sanitizers:deps",
575 source_set("test_support") {
578 "base/load_timing_info_test_util.cc",
579 "base/load_timing_info_test_util.h",
580 "base/mock_file_stream.cc",
581 "base/mock_file_stream.h",
582 "base/test_completion_callback.cc",
583 "base/test_completion_callback.h",
584 "base/test_data_directory.cc",
585 "base/test_data_directory.h",
586 "cert/mock_cert_verifier.cc",
587 "cert/mock_cert_verifier.h",
588 "cookies/cookie_monster_store_test.cc",
589 "cookies/cookie_monster_store_test.h",
590 "cookies/cookie_store_test_callbacks.cc",
591 "cookies/cookie_store_test_callbacks.h",
592 "cookies/cookie_store_test_helpers.cc",
593 "cookies/cookie_store_test_helpers.h",
594 "disk_cache/disk_cache_test_base.cc",
595 "disk_cache/disk_cache_test_base.h",
596 "disk_cache/disk_cache_test_util.cc",
597 "disk_cache/disk_cache_test_util.h",
598 "dns/dns_test_util.cc",
599 "dns/dns_test_util.h",
600 "dns/mock_host_resolver.cc",
601 "dns/mock_host_resolver.h",
602 "dns/mock_mdns_socket_factory.cc",
603 "dns/mock_mdns_socket_factory.h",
604 "http/http_transaction_test_util.cc",
605 "http/http_transaction_test_util.h",
606 "log/test_net_log.cc",
607 "log/test_net_log.h",
608 "log/test_net_log_entry.cc",
609 "log/test_net_log_entry.h",
610 "log/test_net_log_util.cc",
611 "log/test_net_log_util.h",
612 "proxy/mock_proxy_resolver.cc",
613 "proxy/mock_proxy_resolver.h",
614 "proxy/mock_proxy_script_fetcher.cc",
615 "proxy/mock_proxy_script_fetcher.h",
616 "proxy/proxy_config_service_common_unittest.cc",
617 "proxy/proxy_config_service_common_unittest.h",
618 "socket/socket_test_util.cc",
619 "socket/socket_test_util.h",
620 "test/cert_test_util.cc",
621 "test/cert_test_util.h",
622 "test/cert_test_util_nss.cc",
623 "test/channel_id_test_util.cc",
624 "test/channel_id_test_util.h",
625 "test/ct_test_util.cc",
626 "test/ct_test_util.h",
627 "test/embedded_test_server/embedded_test_server.cc",
628 "test/embedded_test_server/embedded_test_server.h",
629 "test/embedded_test_server/http_connection.cc",
630 "test/embedded_test_server/http_connection.h",
631 "test/embedded_test_server/http_request.cc",
632 "test/embedded_test_server/http_request.h",
633 "test/embedded_test_server/http_response.cc",
634 "test/embedded_test_server/http_response.h",
635 "test/embedded_test_server/stream_listen_socket.cc",
636 "test/embedded_test_server/stream_listen_socket.h",
637 "test/embedded_test_server/tcp_listen_socket.cc",
638 "test/embedded_test_server/tcp_listen_socket.h",
639 "test/event_waiter.h",
640 "test/net_test_suite.cc",
641 "test/net_test_suite.h",
642 "test/python_utils.cc",
643 "test/python_utils.h",
644 "test/url_request/ssl_certificate_error_job.cc",
645 "test/url_request/ssl_certificate_error_job.h",
646 "test/url_request/url_request_failed_job.cc",
647 "test/url_request/url_request_failed_job.h",
648 "test/url_request/url_request_mock_data_job.cc",
649 "test/url_request/url_request_mock_data_job.h",
650 "test/url_request/url_request_slow_download_job.cc",
651 "test/url_request/url_request_slow_download_job.h",
652 "url_request/test_url_fetcher_factory.cc",
653 "url_request/test_url_fetcher_factory.h",
654 "url_request/url_request_test_util.cc",
655 "url_request/url_request_test_util.h",
659 "test/spawned_test_server/base_test_server.cc",
660 "test/spawned_test_server/base_test_server.h",
661 "test/spawned_test_server/local_test_server.cc",
662 "test/spawned_test_server/local_test_server.h",
663 "test/spawned_test_server/local_test_server_posix.cc",
664 "test/spawned_test_server/local_test_server_win.cc",
665 "test/spawned_test_server/spawned_test_server.h",
670 "//build/config:precompiled_headers",
672 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
673 "//build/config/compiler:no_size_t_to_int_warning",
678 "//base/test:test_support",
681 "//net/tools/tld_cleanup",
688 public_deps += [ "//third_party/protobuf:py_proto" ]
691 if (use_nss_certs || is_ios) {
692 public_deps += [ "//crypto:platform" ]
697 "test/spawned_test_server/remote_test_server.cc",
698 "test/spawned_test_server/remote_test_server.h",
699 "test/spawned_test_server/spawner_communicator.cc",
700 "test/spawned_test_server/spawner_communicator.h",
705 public_deps += [ ":net_with_v8" ]
710 "dns/mock_mdns_socket_factory.cc",
711 "dns/mock_mdns_socket_factory.h",
715 if (!use_nss_certs) {
716 sources -= [ "test/cert_test_util_nss.cc" ]
719 if (!disable_file_support) {
721 "test/url_request/url_request_mock_http_job.cc",
722 "test/url_request/url_request_mock_http_job.h",
723 "url_request/test_url_request_interceptor.cc",
724 "url_request/test_url_request_interceptor.h",
729 source_set("balsa") {
731 "tools/balsa/balsa_enums.h",
732 "tools/balsa/balsa_frame.cc",
733 "tools/balsa/balsa_frame.h",
734 "tools/balsa/balsa_headers.cc",
735 "tools/balsa/balsa_headers.h",
736 "tools/balsa/balsa_headers_token_utils.cc",
737 "tools/balsa/balsa_headers_token_utils.h",
738 "tools/balsa/balsa_visitor_interface.h",
739 "tools/balsa/http_message_constants.cc",
740 "tools/balsa/http_message_constants.h",
741 "tools/balsa/noop_balsa_visitor.h",
742 "tools/balsa/simple_buffer.cc",
743 "tools/balsa/simple_buffer.h",
744 "tools/balsa/split.cc",
745 "tools/balsa/split.h",
746 "tools/balsa/string_piece_utils.h",
747 "tools/quic/spdy_balsa_utils.cc",
748 "tools/quic/spdy_balsa_utils.h",
758 component("net_with_v8") {
760 "proxy/proxy_resolver_v8.cc",
761 "proxy/proxy_resolver_v8.h",
762 "proxy/proxy_resolver_v8_tracing.cc",
763 "proxy/proxy_resolver_v8_tracing.h",
764 "proxy/proxy_resolver_v8_tracing_wrapper.cc",
765 "proxy/proxy_resolver_v8_tracing_wrapper.h",
766 "proxy/proxy_service_v8.cc",
767 "proxy/proxy_service_v8.h",
770 defines = [ "NET_IMPLEMENTATION" ]
772 "//build/config/compiler:no_size_t_to_int_warning",
773 "//build/config/compiler:wexit_time_destructors",
788 if (use_v8_in_net && !is_android) {
789 source_set("net_browser_services") {
791 "dns/mojo_host_resolver_impl.cc",
792 "dns/mojo_host_resolver_impl.h",
793 "proxy/in_process_mojo_proxy_resolver_factory.cc",
794 "proxy/in_process_mojo_proxy_resolver_factory.h",
795 "proxy/mojo_proxy_resolver_factory.h",
796 "proxy/proxy_resolver_factory_mojo.cc",
797 "proxy/proxy_resolver_factory_mojo.h",
798 "proxy/proxy_service_mojo.cc",
799 "proxy/proxy_service_mojo.h",
803 ":mojo_type_converters",
808 "//third_party/mojo/src/mojo/public/cpp/bindings",
810 # NOTE(amistry): As long as we support in-process Mojo v8 PAC, we need
811 # this dependency since in_process_mojo_proxy_resolver_factory creates
812 # the utility process side Mojo services in the browser process.
813 # Ultimately, this will go away when we only support out-of-process.
814 ":net_utility_services",
818 source_set("mojo_type_converters") {
820 "dns/mojo_host_type_converters.cc",
821 "dns/mojo_host_type_converters.h",
822 "proxy/mojo_proxy_type_converters.cc",
823 "proxy/mojo_proxy_type_converters.h",
829 "//third_party/mojo/src/mojo/public/cpp/bindings",
833 source_set("net_utility_services") {
835 "dns/host_resolver_mojo.cc",
836 "dns/host_resolver_mojo.h",
837 "proxy/mojo_proxy_resolver_factory_impl.cc",
838 "proxy/mojo_proxy_resolver_factory_impl.h",
839 "proxy/mojo_proxy_resolver_impl.cc",
840 "proxy/mojo_proxy_resolver_impl.h",
841 "proxy/mojo_proxy_resolver_v8_tracing_bindings.h",
849 ":mojo_type_converters",
853 "//third_party/mojo/src/mojo/public/cpp/bindings",
858 if (!is_ios && !is_android) {
859 executable("crash_cache") {
862 "tools/crash_cache/crash_cache.cc",
865 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
866 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
871 "//build/config/sanitizers:deps",
875 executable("crl_set_dump") {
878 "tools/crl_set_dump/crl_set_dump.cc",
881 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
882 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
886 "//build/config/sanitizers:deps",
890 executable("dns_fuzz_stub") {
893 "tools/dns_fuzz_stub/dns_fuzz_stub.cc",
896 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
897 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
901 "//build/config/sanitizers:deps",
908 "tools/gdig/file_net_log.cc",
909 "tools/gdig/gdig.cc",
914 "//build/config/sanitizers:deps",
918 executable("get_server_time") {
921 "tools/get_server_time/get_server_time.cc",
924 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
925 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
930 "//build/config/sanitizers:deps",
935 executable("hpack_example_generator") {
938 "spdy/fuzzing/hpack_example_generator.cc",
941 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
942 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
946 "//build/config/sanitizers:deps",
950 executable("hpack_fuzz_mutator") {
953 "spdy/fuzzing/hpack_fuzz_mutator.cc",
956 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
957 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
961 "//build/config/sanitizers:deps",
965 executable("hpack_fuzz_wrapper") {
968 "spdy/fuzzing/hpack_fuzz_wrapper.cc",
971 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
972 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
976 "//build/config/sanitizers:deps",
981 executable("net_watcher") {
984 "tools/net_watcher/net_watcher.cc",
990 "//build/config/sanitizers:deps",
993 if (is_desktop_linux) {
995 "//build/config/linux:gconf",
996 "//build/config/linux:glib",
998 deps += [ "//build/linux:gio" ]
1003 executable("run_testserver") {
1006 "tools/testserver/run_testserver.cc",
1011 "//base/test:test_support",
1012 "//build/config/sanitizers:deps",
1017 executable("stress_cache") {
1020 "tools/stress_cache/stress_cache.cc",
1023 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1024 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
1029 "//build/config/sanitizers:deps",
1033 executable("tld_cleanup") {
1035 "tools/tld_cleanup/tld_cleanup.cc",
1038 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1039 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
1043 "//build/config/sanitizers:deps",
1044 "//net/tools/tld_cleanup",
1050 static_library("epoll_server") {
1052 "tools/epoll_server/epoll_server.cc",
1053 "tools/epoll_server/epoll_server.h",
1061 static_library("flip_in_mem_edsm_server_base") {
1064 "tools/flip_server/acceptor_thread.cc",
1065 "tools/flip_server/acceptor_thread.h",
1066 "tools/flip_server/constants.h",
1067 "tools/flip_server/create_listener.cc",
1068 "tools/flip_server/create_listener.h",
1069 "tools/flip_server/flip_config.cc",
1070 "tools/flip_server/flip_config.h",
1071 "tools/flip_server/http_interface.cc",
1072 "tools/flip_server/http_interface.h",
1073 "tools/flip_server/loadtime_measurement.h",
1074 "tools/flip_server/mem_cache.cc",
1075 "tools/flip_server/mem_cache.h",
1076 "tools/flip_server/output_ordering.cc",
1077 "tools/flip_server/output_ordering.h",
1078 "tools/flip_server/ring_buffer.cc",
1079 "tools/flip_server/ring_buffer.h",
1080 "tools/flip_server/sm_connection.cc",
1081 "tools/flip_server/sm_connection.h",
1082 "tools/flip_server/sm_interface.h",
1083 "tools/flip_server/spdy_interface.cc",
1084 "tools/flip_server/spdy_interface.h",
1085 "tools/flip_server/spdy_ssl.cc",
1086 "tools/flip_server/spdy_ssl.h",
1087 "tools/flip_server/spdy_util.cc",
1088 "tools/flip_server/spdy_util.h",
1089 "tools/flip_server/streamer_interface.cc",
1090 "tools/flip_server/streamer_interface.h",
1091 "tools/flip_server/url_to_filename_encoder.cc",
1092 "tools/flip_server/url_to_filename_encoder.h",
1093 "tools/flip_server/url_utilities.cc",
1094 "tools/flip_server/url_utilities.h",
1101 "//third_party/boringssl",
1105 executable("flip_in_mem_edsm_server_unittests") {
1108 "tools/flip_server/flip_test_utils.cc",
1109 "tools/flip_server/flip_test_utils.h",
1110 "tools/flip_server/http_interface_test.cc",
1111 "tools/flip_server/mem_cache_test.cc",
1112 "tools/flip_server/run_all_tests.cc",
1113 "tools/flip_server/spdy_interface_test.cc",
1114 "tools/flip_server/url_to_filename_encoder_unittest.cc",
1115 "tools/flip_server/url_utilities_unittest.cc",
1119 ":flip_in_mem_edsm_server_base",
1122 "//build/config/sanitizers:deps",
1125 "//third_party/boringssl",
1129 executable("flip_in_mem_edsm_server") {
1132 "tools/flip_server/flip_in_mem_edsm_server.cc",
1136 ":flip_in_mem_edsm_server_base",
1139 "//build/config/sanitizers:deps",
1143 source_set("epoll_quic_tools") {
1145 "tools/quic/quic_client.cc",
1146 "tools/quic/quic_client.h",
1147 "tools/quic/quic_default_packet_writer.cc",
1148 "tools/quic/quic_default_packet_writer.h",
1149 "tools/quic/quic_epoll_clock.cc",
1150 "tools/quic/quic_epoll_clock.h",
1151 "tools/quic/quic_epoll_connection_helper.cc",
1152 "tools/quic/quic_epoll_connection_helper.h",
1153 "tools/quic/quic_packet_reader.cc",
1154 "tools/quic/quic_packet_reader.h",
1155 "tools/quic/quic_packet_writer_wrapper.cc",
1156 "tools/quic/quic_packet_writer_wrapper.h",
1157 "tools/quic/quic_server.cc",
1158 "tools/quic/quic_server.h",
1159 "tools/quic/quic_socket_utils.cc",
1160 "tools/quic/quic_socket_utils.h",
1167 "//base/third_party/dynamic_annotations",
1169 "//third_party/boringssl",
1174 executable("epoll_quic_client") {
1176 "tools/quic/quic_client_bin.cc",
1181 ":epoll_quic_tools",
1183 ":simple_quic_tools",
1185 "//build/config/sanitizers:deps",
1186 "//third_party/boringssl",
1190 executable("epoll_quic_server") {
1192 "tools/quic/quic_server_bin.cc",
1197 ":epoll_quic_tools",
1199 ":simple_quic_tools",
1201 "//build/config/sanitizers:deps",
1202 "//third_party/boringssl",
1208 generate_jni("net_jni_headers") {
1210 "android/java/src/org/chromium/net/AndroidCertVerifyResult.java",
1211 "android/java/src/org/chromium/net/AndroidKeyStore.java",
1212 "android/java/src/org/chromium/net/AndroidNetworkLibrary.java",
1213 "android/java/src/org/chromium/net/AndroidPrivateKey.java",
1214 "android/java/src/org/chromium/net/AndroidTrafficStats.java",
1215 "android/java/src/org/chromium/net/GURLUtils.java",
1216 "android/java/src/org/chromium/net/HttpNegotiateAuthenticator.java",
1217 "android/java/src/org/chromium/net/NetStringUtil.java",
1218 "android/java/src/org/chromium/net/NetworkChangeNotifier.java",
1219 "android/java/src/org/chromium/net/ProxyChangeListener.java",
1220 "android/java/src/org/chromium/net/X509Util.java",
1224 generate_jni("net_test_jni_headers") {
1226 "android/javatests/src/org/chromium/net/AndroidKeyStoreTestUtil.java",
1227 "test/android/javatests/src/org/chromium/net/test/DummySpnegoAuthenticator.java",
1229 jni_package = "net/test"
1233 if (is_android || is_linux) {
1234 executable("disk_cache_memory_test") {
1237 "tools/disk_cache_memory_test/disk_cache_memory_test.cc",
1242 "//build/config/sanitizers:deps",
1247 source_set("simple_quic_tools") {
1249 "tools/quic/quic_client_base.cc",
1250 "tools/quic/quic_client_base.h",
1251 "tools/quic/quic_client_session.cc",
1252 "tools/quic/quic_client_session.h",
1253 "tools/quic/quic_dispatcher.cc",
1254 "tools/quic/quic_dispatcher.h",
1255 "tools/quic/quic_in_memory_cache.cc",
1256 "tools/quic/quic_in_memory_cache.h",
1257 "tools/quic/quic_per_connection_packet_writer.cc",
1258 "tools/quic/quic_per_connection_packet_writer.h",
1259 "tools/quic/quic_server_session.cc",
1260 "tools/quic/quic_server_session.h",
1261 "tools/quic/quic_simple_client.cc",
1262 "tools/quic/quic_simple_client.h",
1263 "tools/quic/quic_simple_per_connection_packet_writer.cc",
1264 "tools/quic/quic_simple_per_connection_packet_writer.h",
1265 "tools/quic/quic_simple_server.cc",
1266 "tools/quic/quic_simple_server.h",
1267 "tools/quic/quic_simple_server_packet_writer.cc",
1268 "tools/quic/quic_simple_server_packet_writer.h",
1269 "tools/quic/quic_spdy_client_stream.cc",
1270 "tools/quic/quic_spdy_client_stream.h",
1271 "tools/quic/quic_spdy_server_stream.cc",
1272 "tools/quic/quic_spdy_server_stream.h",
1273 "tools/quic/quic_time_wait_list_manager.cc",
1274 "tools/quic/quic_time_wait_list_manager.h",
1275 "tools/quic/synchronous_host_resolver.cc",
1276 "tools/quic/synchronous_host_resolver.h",
1281 "//base/third_party/dynamic_annotations",
1287 executable("quic_client") {
1289 "tools/quic/quic_simple_client_bin.cc",
1293 ":simple_quic_tools",
1295 "//build/config/sanitizers:deps",
1299 executable("quic_server") {
1301 "tools/quic/quic_simple_server_bin.cc",
1305 ":simple_quic_tools",
1307 "//build/config/sanitizers:deps",
1308 "//third_party/boringssl",
1309 "//third_party/protobuf:protobuf_lite",
1314 # TODO(GYP): Delete this after we've converted everything to GN.
1315 # The _run targets exist only for compatibility w/ GYP.
1316 group("net_unittests_run") {
1323 test("net_unittests") {
1324 sources = gypi_values.net_test_sources
1328 "websockets/websocket_stream_cookie_test.cc",
1329 "websockets/websocket_stream_create_test_base.cc",
1330 "websockets/websocket_stream_create_test_base.h",
1335 "//build/config:precompiled_headers",
1337 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1338 "//build/config/compiler:no_size_t_to_int_warning",
1347 ":simple_quic_tools",
1351 "//base:prefs_test_support",
1353 "//base/third_party/dynamic_annotations",
1355 "//crypto:platform",
1356 "//crypto:test_support",
1357 "//net/base/registry_controlled_domains",
1361 "//third_party/zlib",
1369 if (is_linux || is_mac || is_win) {
1371 "//third_party/pyftpdlib/",
1372 "//third_party/pywebsocket/",
1373 "//third_party/tlslite/",
1376 "//third_party/pyftpdlib/",
1377 "//third_party/pywebsocket/",
1378 "//third_party/tlslite/",
1381 "tools/testserver/",
1382 "//third_party/pyftpdlib/",
1383 "//third_party/pywebsocket/",
1384 "//third_party/tlslite/",
1385 "$root_out_dir/pyproto/google/",
1389 if (is_desktop_linux) {
1390 deps += [ ":epoll_quic_tools" ]
1393 sources += gypi_values.net_linux_test_sources
1395 ":epoll_quic_tools",
1397 ":flip_in_mem_edsm_server_base",
1401 if (is_mac || is_ios) {
1402 sources += gypi_values.net_base_test_mac_ios_sources
1406 sources -= [ "proxy/proxy_config_service_linux_unittest.cc" ]
1409 if (v8_use_external_startup_data) {
1413 if (!use_nss_certs) {
1415 "cert/nss_cert_database_unittest.cc",
1416 "ssl/client_cert_store_nss_unittest.cc",
1418 if (is_chromeos) { # Already removed for all non-ChromeOS builds.
1420 "cert/nss_cert_database_chromeos_unittest.cc",
1421 "cert/nss_profile_filter_chromeos_unittest.cc",
1427 # When building for OpenSSL, we need to exclude NSS specific tests
1428 # or functionality not supported by OpenSSL yet.
1429 # TODO(bulach): Add equivalent tests when the underlying
1430 # functionality is ported to OpenSSL.
1431 sources -= [ "quic/test_tools/crypto_test_utils_nss.cc" ]
1434 "cert/x509_util_openssl_unittest.cc",
1435 "quic/test_tools/crypto_test_utils_openssl.cc",
1436 "socket/ssl_client_socket_openssl_unittest.cc",
1437 "ssl/ssl_client_session_cache_openssl_unittest.cc",
1442 defines += [ "USE_KERBEROS" ]
1445 # These are excluded on Android, because the actual Kerberos support, which
1446 # these test, is in a separate app on Android.
1447 if (!use_kerberos || is_android) {
1449 "http/http_auth_gssapi_posix_unittest.cc",
1450 "http/mock_gssapi_library_posix.cc",
1451 "http/mock_gssapi_library_posix.h",
1454 if (!use_kerberos) {
1455 sources -= [ "http/http_auth_handler_negotiate_unittest.cc" ]
1458 if (use_openssl || (!is_desktop_linux && !is_chromeos && !is_ios)) {
1459 # Only include this test when on Posix and using NSS for
1460 # cert verification or on iOS (which also uses NSS for certs).
1461 sources -= [ "cert_net/nss_ocsp_unittest.cc" ]
1464 if (!use_openssl_certs) {
1465 sources -= [ "ssl/openssl_client_key_store_unittest.cc" ]
1468 if (!enable_websockets) {
1470 "server/http_connection_unittest.cc",
1471 "server/http_server_response_info_unittest.cc",
1472 "server/http_server_unittest.cc",
1473 "server/web_socket_encoder_unittest.cc",
1474 "websockets/websocket_basic_stream_test.cc",
1475 "websockets/websocket_channel_test.cc",
1476 "websockets/websocket_deflate_predictor_impl_test.cc",
1477 "websockets/websocket_deflate_stream_test.cc",
1478 "websockets/websocket_deflater_test.cc",
1479 "websockets/websocket_end_to_end_test.cc",
1480 "websockets/websocket_errors_test.cc",
1481 "websockets/websocket_extension_parser_test.cc",
1482 "websockets/websocket_frame_parser_test.cc",
1483 "websockets/websocket_frame_test.cc",
1484 "websockets/websocket_handshake_challenge_test.cc",
1485 "websockets/websocket_handshake_stream_create_helper_test.cc",
1486 "websockets/websocket_inflater_test.cc",
1487 "websockets/websocket_stream_test.cc",
1488 "websockets/websocket_test_util.cc",
1489 "websockets/websocket_test_util.h",
1491 deps -= [ ":http_server" ]
1494 if (disable_file_support) {
1496 "base/directory_lister_unittest.cc",
1497 "url_request/url_request_file_job_unittest.cc",
1501 if (disable_ftp_support) {
1503 "ftp/ftp_auth_cache_unittest.cc",
1504 "ftp/ftp_ctrl_response_buffer_unittest.cc",
1505 "ftp/ftp_directory_listing_parser_ls_unittest.cc",
1506 "ftp/ftp_directory_listing_parser_unittest.cc",
1507 "ftp/ftp_directory_listing_parser_unittest.h",
1508 "ftp/ftp_directory_listing_parser_vms_unittest.cc",
1509 "ftp/ftp_directory_listing_parser_windows_unittest.cc",
1510 "ftp/ftp_network_transaction_unittest.cc",
1511 "ftp/ftp_util_unittest.cc",
1512 "url_request/url_request_ftp_job_unittest.cc",
1516 if (!enable_built_in_dns) {
1518 "dns/address_sorter_posix_unittest.cc",
1519 "dns/address_sorter_unittest.cc",
1523 if (use_v8_in_net) {
1524 deps += [ ":net_with_v8" ]
1527 "proxy/proxy_resolver_v8_tracing_unittest.cc",
1528 "proxy/proxy_resolver_v8_tracing_wrapper_unittest.cc",
1529 "proxy/proxy_resolver_v8_unittest.cc",
1533 if (use_v8_in_net && !is_android) {
1535 ":net_browser_services",
1536 ":net_utility_services",
1537 "//mojo/environment:chromium",
1538 "//third_party/mojo/src/mojo/edk/system",
1542 "dns/host_resolver_mojo_unittest.cc",
1543 "dns/mojo_host_resolver_impl_unittest.cc",
1544 "proxy/mojo_proxy_resolver_factory_impl_unittest.cc",
1545 "proxy/mojo_proxy_resolver_impl_unittest.cc",
1546 "proxy/mojo_proxy_resolver_v8_tracing_bindings_unittest.cc",
1547 "proxy/proxy_resolver_factory_mojo_unittest.cc",
1548 "proxy/proxy_service_mojo_unittest.cc",
1554 "dns/mdns_cache_unittest.cc",
1555 "dns/mdns_client_unittest.cc",
1556 "dns/record_parsed_unittest.cc",
1557 "dns/record_rdata_unittest.cc",
1565 # 'action_name': 'copy_test_data',
1567 # 'test_data_files': [
1568 # 'data/ssl/certificates/',
1570 # 'data/url_request_unittest/',
1571 # 'data/verify_name_match_unittest/names/',
1572 # 'data/parse_certificate_unittest/',
1574 # 'test_data_prefix': 'net',
1576 # 'includes': [ '../build/copy_test_data_ios.gypi' ],
1580 # TODO(droger): The following tests are disabled because the
1581 # implementation is missing or incomplete.
1582 # KeygenHandler::GenKeyAndSignChallenge() is not ported to iOS.
1583 "base/keygen_handler_unittest.cc",
1584 "disk_cache/backend_unittest.cc",
1585 "disk_cache/blockfile/block_files_unittest.cc",
1587 # Need to read input data files.
1588 "filter/gzip_filter_unittest.cc",
1589 "socket/ssl_server_socket_unittest.cc",
1590 "spdy/fuzzing/hpack_fuzz_util_test.cc",
1593 "cert_net/cert_net_fetcher_impl_unittest.cc",
1594 "proxy/proxy_script_fetcher_impl_unittest.cc",
1595 "socket/ssl_client_socket_unittest.cc",
1596 "url_request/url_fetcher_impl_unittest.cc",
1597 "url_request/url_request_context_builder_unittest.cc",
1599 # Needs GetAppOutput().
1600 "test/python_utils_unittest.cc",
1602 # The following tests are disabled because they don't apply to
1604 # OS is not "linux" or "freebsd" or "openbsd".
1605 "socket/unix_domain_client_socket_posix_unittest.cc",
1606 "socket/unix_domain_server_socket_posix_unittest.cc",
1608 # See bug http://crbug.com/344533.
1609 "disk_cache/blockfile/index_table_v3_unittest.cc",
1615 # See bug http://crbug.com/344533.
1616 "disk_cache/blockfile/index_table_v3_unittest.cc",
1617 "dns/dns_config_service_posix_unittest.cc",
1620 ":net_test_jni_headers",
1622 # TODO(mmenke): This depends on test_support_base, which depends on
1623 # icu. Figure out a way to remove that dependency.
1624 "//testing/android/native_test:native_test_native_code",
1626 set_sources_assignment_filter([])
1627 sources += [ "base/address_tracker_linux_unittest.cc" ]
1628 set_sources_assignment_filter(sources_assignment_filter)
1629 isolate_file = "net_unittests.isolate"
1632 # Symbols for crashes when running tests on swarming.
1633 if (symbol_level > 0) {
1635 data += [ "$root_out_dir/net_unittests.exe.pdb" ]
1636 } else if (is_mac) {
1637 data += [ "$root_out_dir/net_unittests.dSYM/" ]
1642 # !is_android && !is_win && !is_mac
1644 executable("net_perftests") {
1647 "base/mime_sniffer_perftest.cc",
1648 "cookies/cookie_monster_perftest.cc",
1649 "disk_cache/blockfile/disk_cache_perftest.cc",
1650 "extras/sqlite/sqlite_persistent_cookie_store_perftest.cc",
1651 "proxy/proxy_resolver_perftest.cc",
1652 "udp/udp_socket_perftest.cc",
1655 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1656 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
1663 "//base/test:test_support_perf",
1664 "//build/config/sanitizers:deps",
1669 if (enable_websockets) {
1670 sources += [ "websockets/websocket_frame_perftest.cc" ]
1673 if (use_v8_in_net) {
1674 deps += [ ":net_with_v8" ]
1676 sources -= [ "proxy/proxy_resolver_perftest.cc" ]