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/chromecast_build.gni")
6 import("//build/config/compiler/compiler.gni")
7 import("//build/config/crypto.gni")
8 import("//build/config/features.gni")
9 import("//build/config/ui.gni")
10 import("//build/module_args/v8.gni")
11 import("//testing/test.gni")
12 import("//third_party/icu/config.gni")
13 import("//third_party/protobuf/proto_library.gni")
15 # TODO(cjhopman): //build/config/android/rules.gni also imports grit_rule.gni.
16 # Currently, that file can't be imported multiple times. Make this always
17 # imported when http://crbug.com/393704 is fixed.
19 import("//tools/grit/grit_rule.gni")
23 import("//build/config/android/config.gni")
24 import("//build/config/android/rules.gni")
26 import("//build/config/mac/mac_sdk.gni")
29 # The list of net files is kept in net.gypi. Read it.
30 gypi_values = exec_script("//build/gypi_to_gn.py",
31 [ rebase_path("net.gypi") ],
35 # Disable Kerberos on ChromeOS, Android, iOS, and Chromecast, at least for now.
36 # It needs configuration (krb5.conf and so on).
37 use_kerberos = !is_chromeos && !is_android && !is_ios && !is_chromecast
39 # The way the cache uses mmap() is inefficient on some Android devices. If
40 # this flag is set, we hackily avoid using mmap() in the disk cache. We are
41 # pretty confident that mmap-ing the index would not hurt any existing x86
42 # android devices, but we cannot be so sure about the variety of ARM devices.
43 # So enable it for x86 only for now.
44 posix_avoid_mmap = is_android && current_cpu != "x86"
46 # WebSockets and socket stream code are used everywhere except iOS.
47 enable_websockets = !is_ios
48 use_v8_in_net = !is_ios
49 enable_built_in_dns = !is_ios
50 disable_ftp_support = is_ios
53 # Disables support for file URLs. File URL support requires use of icu.
54 disable_file_support = false
57 config("net_config") {
59 if (posix_avoid_mmap) {
60 defines += [ "POSIX_AVOID_MMAP" ]
62 if (disable_file_support) {
63 defines += [ "DISABLE_FILE_SUPPORT" ]
67 # net_internal_config is shared with net and net_small.
68 config("net_internal_config") {
70 # TODO(GYP) Note that the GYP file supports linux_link_kerberos (defaults to
71 # 0) which implies that we run pkg_config on kerberos and link to that
72 # rather than setting this define which will dynamically open it. That
73 # doesn't seem to be set in the regular builds, so we're skipping this
80 defines += [ "USE_KERBEROS" ]
82 include_dirs = [ "/usr/include/kerberosV" ]
86 if (enable_built_in_dns) {
87 defines += [ "ENABLE_BUILT_IN_DNS" ]
91 # net_shared_* are settings shared between net and net_small
92 net_shared_sources = gypi_values.net_nacl_common_sources
94 net_shared_unfiltered_sources = []
96 net_shared_configs = [
97 ":net_internal_config",
98 "//build/config:precompiled_headers",
100 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
101 "//build/config/compiler:no_size_t_to_int_warning",
104 net_shared_public_deps = [
113 "//net/base/registry_controlled_domains",
114 "//third_party/protobuf:protobuf_lite",
118 net_shared_sources += gypi_values.net_non_nacl_sources
122 "//base/third_party/dynamic_annotations",
124 "//third_party/zlib",
128 net_shared_sources -= [
129 "http/http_auth_gssapi_posix.cc",
130 "http/http_auth_gssapi_posix.h",
131 "http/http_auth_handler_negotiate.cc",
132 "http/http_auth_handler_negotiate.h",
137 if (posix_avoid_mmap) {
138 net_shared_sources -= [ "disk_cache/blockfile/mapped_file_posix.cc" ]
140 net_shared_sources -=
141 [ "disk_cache/blockfile/mapped_file_avoid_mmap_posix.cc" ]
145 if (!enable_built_in_dns) {
146 net_shared_sources -= [
147 "dns/address_sorter_posix.cc",
148 "dns/address_sorter_posix.h",
154 net_shared_sources -= [
157 "cert/ct_log_verifier_nss.cc",
158 "cert/ct_objects_extractor_nss.cc",
159 "cert/jwk_serializer_nss.cc",
160 "cert/scoped_nss_types.h",
161 "cert/x509_util_nss.cc",
162 "quic/crypto/aead_base_decrypter_nss.cc",
163 "quic/crypto/aead_base_encrypter_nss.cc",
164 "quic/crypto/aes_128_gcm_12_decrypter_nss.cc",
165 "quic/crypto/aes_128_gcm_12_encrypter_nss.cc",
166 "quic/crypto/chacha20_poly1305_decrypter_nss.cc",
167 "quic/crypto/chacha20_poly1305_encrypter_nss.cc",
168 "quic/crypto/channel_id_nss.cc",
169 "quic/crypto/p256_key_exchange_nss.cc",
170 "quic/crypto/proof_source_chromium_nss.cc",
171 "socket/nss_ssl_util.cc",
172 "socket/nss_ssl_util.h",
173 "socket/ssl_client_socket_nss.cc",
174 "socket/ssl_client_socket_nss.h",
175 "socket/ssl_server_socket_nss.cc",
176 "socket/ssl_server_socket_nss.h",
179 # Always removed for !ios below.
180 net_shared_sources -= [
181 "cert/cert_verify_proc_nss.cc",
182 "cert/cert_verify_proc_nss.h",
186 net_shared_sources -= [ "cert/sha256_legacy_support_nss_win.cc" ]
188 if (!use_nss_certs && !is_ios) {
189 net_shared_sources -= [ "cert/x509_util_nss.h" ]
192 net_shared_sources -= [
193 "cert/ct_log_verifier_openssl.cc",
194 "cert/ct_objects_extractor_openssl.cc",
195 "cert/jwk_serializer_openssl.cc",
196 "cert/x509_util_openssl.cc",
197 "cert/x509_util_openssl.h",
198 "quic/crypto/aead_base_decrypter_openssl.cc",
199 "quic/crypto/aead_base_encrypter_openssl.cc",
200 "quic/crypto/aes_128_gcm_12_decrypter_openssl.cc",
201 "quic/crypto/aes_128_gcm_12_encrypter_openssl.cc",
202 "quic/crypto/chacha20_poly1305_decrypter_openssl.cc",
203 "quic/crypto/chacha20_poly1305_encrypter_openssl.cc",
204 "quic/crypto/channel_id_openssl.cc",
205 "quic/crypto/p256_key_exchange_openssl.cc",
206 "quic/crypto/proof_source_chromium_openssl.cc",
207 "quic/crypto/scoped_evp_aead_ctx.cc",
208 "quic/crypto/scoped_evp_aead_ctx.h",
209 "socket/ssl_client_socket_openssl.cc",
210 "socket/ssl_client_socket_openssl.h",
211 "socket/ssl_server_socket_openssl.cc",
212 "socket/ssl_server_socket_openssl.h",
213 "ssl/openssl_ssl_util.cc",
214 "ssl/openssl_ssl_util.h",
215 "ssl/ssl_client_session_cache_openssl.cc",
216 "ssl/ssl_client_session_cache_openssl.h",
217 "ssl/ssl_platform_key.h",
218 "ssl/threaded_ssl_private_key.cc",
219 "ssl/threaded_ssl_private_key.h",
222 net_shared_sources -= [ "ssl/ssl_platform_key_mac.cc" ]
225 net_shared_sources -= [ "ssl/ssl_platform_key_android.cc" ]
228 net_shared_sources -= [
229 "cert/sha256_legacy_support_openssl_win.cc",
230 "ssl/ssl_platform_key_win.cc",
234 net_shared_sources -= [
235 "ssl/client_key_store.cc",
236 "ssl/client_key_store.h",
237 "ssl/ssl_platform_key_nss.cc",
242 if (!use_openssl_certs) {
243 net_shared_sources -= [
244 "base/crypto_module_openssl.cc",
245 "base/keygen_handler_openssl.cc",
246 "base/openssl_private_key_store.h",
247 "base/openssl_private_key_store_memory.cc",
248 "cert/cert_database_openssl.cc",
249 "cert/cert_verify_proc_openssl.cc",
250 "cert/cert_verify_proc_openssl.h",
251 "cert/test_root_certs_openssl.cc",
252 "cert/x509_certificate_openssl.cc",
253 "ssl/openssl_client_key_store.cc",
254 "ssl/openssl_client_key_store.h",
257 net_shared_sources -= [ "base/openssl_private_key_store_android.cc" ]
261 # Android doesn't use these even when using OpenSSL.
262 net_shared_sources -= [
263 "base/openssl_private_key_store_memory.cc",
264 "cert/cert_database_openssl.cc",
265 "cert/cert_verify_proc_openssl.cc",
266 "cert/test_root_certs_openssl.cc",
271 if (use_glib && !is_chromeos) {
272 net_shared_configs += [ "//build/config/linux:gconf" ]
273 net_shared_deps += [ "//build/linux:gio" ]
277 net_shared_configs += [ "//build/config/linux:libresolv" ]
280 if (!use_nss_certs) {
281 net_shared_sources -= [
282 "base/crypto_module_nss.cc",
283 "base/keygen_handler_nss.cc",
284 "cert/cert_database_nss.cc",
285 "cert/nss_cert_database.cc",
286 "cert/nss_cert_database.h",
287 "cert/x509_certificate_nss.cc",
288 "ssl/client_cert_store_nss.cc",
289 "ssl/client_cert_store_nss.h",
290 "third_party/mozilla_security_manager/nsKeygenHandler.cpp",
291 "third_party/mozilla_security_manager/nsKeygenHandler.h",
292 "third_party/mozilla_security_manager/nsNSSCertificateDB.cpp",
293 "third_party/mozilla_security_manager/nsNSSCertificateDB.h",
294 "third_party/mozilla_security_manager/nsPKCS12Blob.cpp",
295 "third_party/mozilla_security_manager/nsPKCS12Blob.h",
298 # These files are part of the partial implementation of NSS on iOS so
299 # keep them in that case (even though use_nss_certs is not set).
300 net_shared_sources -= [
301 "cert/cert_verify_proc_nss.cc",
302 "cert/cert_verify_proc_nss.h",
303 "cert/test_root_certs_nss.cc",
304 "cert/x509_util_nss_certs.cc",
305 "cert_net/nss_ocsp.cc",
306 "cert_net/nss_ocsp.h",
310 # These were already removed on non-ChromeOS.
311 net_shared_sources -= [
312 "cert/nss_cert_database_chromeos.cc",
313 "cert/nss_cert_database_chromeos.h",
314 "cert/nss_profile_filter_chromeos.cc",
315 "cert/nss_profile_filter_chromeos.h",
318 net_shared_sources -= [
319 "ssl/client_key_store.cc",
320 "ssl/client_key_store.h",
321 "ssl/ssl_platform_key_nss.cc",
323 } else if (use_openssl) {
324 # client_cert_store_nss.c requires NSS_CmpCertChainWCANames from NSS's
325 # libssl, but our bundled copy is not built in OpenSSL ports. Pull that file
327 net_shared_sources += [ "third_party/nss/ssl/cmpcert.c" ]
331 net_shared_sources -= [
334 "dns/mdns_client.cc",
336 "dns/mdns_client_impl.cc",
337 "dns/mdns_client_impl.h",
338 "dns/record_parsed.cc",
339 "dns/record_parsed.h",
340 "dns/record_rdata.cc",
341 "dns/record_rdata.h",
346 net_shared_sources -= [ "http/http_auth_handler_ntlm_portable.cc" ]
348 net_shared_sources -= [
349 "base/winsock_init.cc",
350 "base/winsock_init.h",
351 "base/winsock_util.cc",
352 "base/winsock_util.h",
353 "proxy/proxy_resolver_winhttp.cc",
354 "proxy/proxy_resolver_winhttp.h",
359 # Add back some sources that were otherwise filtered out. iOS needs some Mac
361 net_shared_unfiltered_sources += [
362 "base/mac/url_conversions.h",
363 "base/mac/url_conversions.mm",
364 "base/network_change_notifier_mac.cc",
365 "base/network_config_watcher_mac.cc",
366 "base/network_interfaces_mac.cc",
367 "base/network_interfaces_mac.h",
368 "base/platform_mime_util_mac.mm",
369 "proxy/proxy_resolver_mac.cc",
370 "proxy/proxy_server_mac.cc",
373 net_shared_sources -= [ "disk_cache/blockfile/file_posix.cc" ]
375 "//third_party/nss:nspr",
377 "//net/third_party/nss/ssl:libssl",
381 if (is_ios || is_mac) {
382 net_shared_sources += gypi_values.net_base_mac_ios_sources
386 net_shared_deps += [ ":net_jni_headers" ]
388 # Add some Linux sources that were excluded by the filter, but which
390 net_shared_unfiltered_sources += [
391 "base/address_tracker_linux.cc",
392 "base/address_tracker_linux.h",
393 "base/network_interfaces_linux.cc",
394 "base/network_interfaces_linux.h",
395 "base/platform_mime_util_linux.cc",
399 net_shared_public_deps += [ "//native_client_sdk/src/libraries/nacl_io" ]
403 sources = net_shared_sources
405 # Add back some sources that were otherwise filtered out.
406 set_sources_assignment_filter([])
407 sources += net_shared_unfiltered_sources
408 set_sources_assignment_filter(sources_assignment_filter)
411 configs += net_shared_configs
412 public_configs = [ ":net_config" ]
414 public_deps = net_shared_public_deps + [ "//url" ]
415 deps = net_shared_deps
419 "Foundation.framework",
420 "Security.framework",
421 "SystemConfiguration.framework",
428 "CFNetwork.framework",
429 "MobileCoreServices.framework",
430 "Security.framework",
431 "SystemConfiguration.framework",
437 if (!disable_file_support) {
438 sources += gypi_values.net_file_support_sources
441 if (!disable_ftp_support) {
442 sources += gypi_values.net_ftp_support_sources
445 if (enable_websockets) {
446 sources += gypi_values.net_websockets_sources
455 "base/filename_util_icu.cc",
456 "base/net_string_util_icu.cc",
457 "base/net_util_icu.cc",
463 # Same as net, but with ICU, file, ftp, and websocket support stripped.
464 component("net_small") {
465 sources = net_shared_sources
467 # Add back some sources that were otherwise filtered out.
468 set_sources_assignment_filter([])
469 sources += net_shared_unfiltered_sources
470 set_sources_assignment_filter(sources_assignment_filter)
474 configs += net_shared_configs
475 public_configs = [ ":net_config" ]
477 public_deps = net_shared_public_deps +
478 [ "//url:url_lib_use_icu_alternatives_on_android" ]
479 deps = net_shared_deps + [ ":net_jni_headers" ]
482 "DISABLE_FILE_SUPPORT",
483 "DISABLE_FTP_SUPPORT",
484 "USE_ICU_ALTERNATIVES_ON_ANDROID=1",
487 # Use ICU alternative on Android.
489 "base/net_string_util_icu_alternatives_android.cc",
490 "base/net_string_util_icu_alternatives_android.h",
495 grit("net_resources") {
496 source = "base/net_resources.grd"
497 use_qualified_include = true
499 "grit/net_resources.h",
504 proto_library("net_quic_proto") {
511 "quic/proto/cached_network_parameters.proto",
512 "quic/proto/source_address_token.proto",
514 cc_generator_options = "dllexport_decl=NET_EXPORT_PRIVATE:"
515 cc_include = "net/base/net_export.h"
517 defines = [ "NET_IMPLEMENTATION" ]
519 extra_configs = [ "//build/config/compiler:wexit_time_destructors" ]
522 static_library("extras") {
523 sources = gypi_values.net_extras_sources
524 configs += [ "//build/config/compiler:wexit_time_destructors" ]
532 static_library("http_server") {
534 "server/http_connection.cc",
535 "server/http_connection.h",
536 "server/http_server.cc",
537 "server/http_server.h",
538 "server/http_server_request_info.cc",
539 "server/http_server_request_info.h",
540 "server/http_server_response_info.cc",
541 "server/http_server_response_info.h",
542 "server/web_socket.cc",
543 "server/web_socket.h",
544 "server/web_socket_encoder.cc",
545 "server/web_socket_encoder.h",
548 "//build/config/compiler:no_size_t_to_int_warning",
549 "//build/config/compiler:wexit_time_destructors",
557 executable("dump_cache") {
560 "tools/dump_cache/dump_cache.cc",
561 "tools/dump_cache/dump_files.cc",
562 "tools/dump_cache/dump_files.h",
565 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
566 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
572 "//build/config/sanitizers:deps",
576 source_set("test_support") {
579 "base/load_timing_info_test_util.cc",
580 "base/load_timing_info_test_util.h",
581 "base/mock_file_stream.cc",
582 "base/mock_file_stream.h",
583 "base/test_completion_callback.cc",
584 "base/test_completion_callback.h",
585 "base/test_data_directory.cc",
586 "base/test_data_directory.h",
587 "cert/mock_cert_verifier.cc",
588 "cert/mock_cert_verifier.h",
589 "cookies/cookie_monster_store_test.cc",
590 "cookies/cookie_monster_store_test.h",
591 "cookies/cookie_store_test_callbacks.cc",
592 "cookies/cookie_store_test_callbacks.h",
593 "cookies/cookie_store_test_helpers.cc",
594 "cookies/cookie_store_test_helpers.h",
595 "disk_cache/disk_cache_test_base.cc",
596 "disk_cache/disk_cache_test_base.h",
597 "disk_cache/disk_cache_test_util.cc",
598 "disk_cache/disk_cache_test_util.h",
599 "dns/dns_test_util.cc",
600 "dns/dns_test_util.h",
601 "dns/mock_host_resolver.cc",
602 "dns/mock_host_resolver.h",
603 "dns/mock_mdns_socket_factory.cc",
604 "dns/mock_mdns_socket_factory.h",
605 "http/http_transaction_test_util.cc",
606 "http/http_transaction_test_util.h",
607 "log/test_net_log.cc",
608 "log/test_net_log.h",
609 "log/test_net_log_entry.cc",
610 "log/test_net_log_entry.h",
611 "log/test_net_log_util.cc",
612 "log/test_net_log_util.h",
613 "proxy/mock_proxy_resolver.cc",
614 "proxy/mock_proxy_resolver.h",
615 "proxy/mock_proxy_script_fetcher.cc",
616 "proxy/mock_proxy_script_fetcher.h",
617 "proxy/proxy_config_service_common_unittest.cc",
618 "proxy/proxy_config_service_common_unittest.h",
619 "socket/socket_test_util.cc",
620 "socket/socket_test_util.h",
621 "test/cert_test_util.cc",
622 "test/cert_test_util.h",
623 "test/cert_test_util_nss.cc",
624 "test/channel_id_test_util.cc",
625 "test/channel_id_test_util.h",
626 "test/ct_test_util.cc",
627 "test/ct_test_util.h",
628 "test/embedded_test_server/embedded_test_server.cc",
629 "test/embedded_test_server/embedded_test_server.h",
630 "test/embedded_test_server/http_connection.cc",
631 "test/embedded_test_server/http_connection.h",
632 "test/embedded_test_server/http_request.cc",
633 "test/embedded_test_server/http_request.h",
634 "test/embedded_test_server/http_response.cc",
635 "test/embedded_test_server/http_response.h",
636 "test/embedded_test_server/stream_listen_socket.cc",
637 "test/embedded_test_server/stream_listen_socket.h",
638 "test/embedded_test_server/tcp_listen_socket.cc",
639 "test/embedded_test_server/tcp_listen_socket.h",
640 "test/event_waiter.h",
641 "test/net_test_suite.cc",
642 "test/net_test_suite.h",
643 "test/python_utils.cc",
644 "test/python_utils.h",
645 "test/url_request/ssl_certificate_error_job.cc",
646 "test/url_request/ssl_certificate_error_job.h",
647 "test/url_request/url_request_failed_job.cc",
648 "test/url_request/url_request_failed_job.h",
649 "test/url_request/url_request_mock_data_job.cc",
650 "test/url_request/url_request_mock_data_job.h",
651 "test/url_request/url_request_slow_download_job.cc",
652 "test/url_request/url_request_slow_download_job.h",
653 "url_request/test_url_fetcher_factory.cc",
654 "url_request/test_url_fetcher_factory.h",
655 "url_request/url_request_test_util.cc",
656 "url_request/url_request_test_util.h",
660 "test/spawned_test_server/base_test_server.cc",
661 "test/spawned_test_server/base_test_server.h",
662 "test/spawned_test_server/local_test_server.cc",
663 "test/spawned_test_server/local_test_server.h",
664 "test/spawned_test_server/local_test_server_posix.cc",
665 "test/spawned_test_server/local_test_server_win.cc",
666 "test/spawned_test_server/spawned_test_server.h",
671 "//build/config:precompiled_headers",
673 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
674 "//build/config/compiler:no_size_t_to_int_warning",
679 "//base/test:test_support",
682 "//net/tools/tld_cleanup",
689 public_deps += [ "//third_party/protobuf:py_proto" ]
692 if (use_nss_certs || is_ios) {
693 public_deps += [ "//crypto:platform" ]
698 "test/spawned_test_server/remote_test_server.cc",
699 "test/spawned_test_server/remote_test_server.h",
700 "test/spawned_test_server/spawner_communicator.cc",
701 "test/spawned_test_server/spawner_communicator.h",
706 public_deps += [ ":net_with_v8" ]
711 "dns/mock_mdns_socket_factory.cc",
712 "dns/mock_mdns_socket_factory.h",
716 if (!use_nss_certs) {
717 sources -= [ "test/cert_test_util_nss.cc" ]
720 if (!disable_file_support) {
722 "test/url_request/url_request_mock_http_job.cc",
723 "test/url_request/url_request_mock_http_job.h",
724 "url_request/test_url_request_interceptor.cc",
725 "url_request/test_url_request_interceptor.h",
730 source_set("balsa") {
732 "tools/balsa/balsa_enums.h",
733 "tools/balsa/balsa_frame.cc",
734 "tools/balsa/balsa_frame.h",
735 "tools/balsa/balsa_headers.cc",
736 "tools/balsa/balsa_headers.h",
737 "tools/balsa/balsa_headers_token_utils.cc",
738 "tools/balsa/balsa_headers_token_utils.h",
739 "tools/balsa/balsa_visitor_interface.h",
740 "tools/balsa/http_message_constants.cc",
741 "tools/balsa/http_message_constants.h",
742 "tools/balsa/noop_balsa_visitor.h",
743 "tools/balsa/simple_buffer.cc",
744 "tools/balsa/simple_buffer.h",
745 "tools/balsa/split.cc",
746 "tools/balsa/split.h",
747 "tools/balsa/string_piece_utils.h",
748 "tools/quic/spdy_balsa_utils.cc",
749 "tools/quic/spdy_balsa_utils.h",
759 component("net_with_v8") {
761 "proxy/proxy_resolver_v8.cc",
762 "proxy/proxy_resolver_v8.h",
763 "proxy/proxy_resolver_v8_tracing.cc",
764 "proxy/proxy_resolver_v8_tracing.h",
765 "proxy/proxy_resolver_v8_tracing_wrapper.cc",
766 "proxy/proxy_resolver_v8_tracing_wrapper.h",
767 "proxy/proxy_service_v8.cc",
768 "proxy/proxy_service_v8.h",
771 defines = [ "NET_IMPLEMENTATION" ]
773 "//build/config/compiler:no_size_t_to_int_warning",
774 "//build/config/compiler:wexit_time_destructors",
789 if (use_v8_in_net && !is_android) {
790 source_set("net_browser_services") {
792 "dns/mojo_host_resolver_impl.cc",
793 "dns/mojo_host_resolver_impl.h",
794 "proxy/in_process_mojo_proxy_resolver_factory.cc",
795 "proxy/in_process_mojo_proxy_resolver_factory.h",
796 "proxy/mojo_proxy_resolver_factory.h",
797 "proxy/proxy_resolver_factory_mojo.cc",
798 "proxy/proxy_resolver_factory_mojo.h",
799 "proxy/proxy_service_mojo.cc",
800 "proxy/proxy_service_mojo.h",
804 ":mojo_type_converters",
809 "//third_party/mojo/src/mojo/public/cpp/bindings",
811 # NOTE(amistry): As long as we support in-process Mojo v8 PAC, we need
812 # this dependency since in_process_mojo_proxy_resolver_factory creates
813 # the utility process side Mojo services in the browser process.
814 # Ultimately, this will go away when we only support out-of-process.
815 ":net_utility_services",
819 source_set("mojo_type_converters") {
821 "dns/mojo_host_type_converters.cc",
822 "dns/mojo_host_type_converters.h",
823 "proxy/mojo_proxy_type_converters.cc",
824 "proxy/mojo_proxy_type_converters.h",
830 "//third_party/mojo/src/mojo/public/cpp/bindings",
834 source_set("net_utility_services") {
836 "dns/host_resolver_mojo.cc",
837 "dns/host_resolver_mojo.h",
838 "proxy/mojo_proxy_resolver_factory_impl.cc",
839 "proxy/mojo_proxy_resolver_factory_impl.h",
840 "proxy/mojo_proxy_resolver_impl.cc",
841 "proxy/mojo_proxy_resolver_impl.h",
842 "proxy/mojo_proxy_resolver_v8_tracing_bindings.h",
850 ":mojo_type_converters",
854 "//third_party/mojo/src/mojo/public/cpp/bindings",
859 if (!is_ios && !is_android) {
860 executable("crash_cache") {
863 "tools/crash_cache/crash_cache.cc",
866 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
867 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
872 "//build/config/sanitizers:deps",
876 executable("crl_set_dump") {
879 "tools/crl_set_dump/crl_set_dump.cc",
882 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
883 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
887 "//build/config/sanitizers:deps",
891 executable("dns_fuzz_stub") {
894 "tools/dns_fuzz_stub/dns_fuzz_stub.cc",
897 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
898 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
902 "//build/config/sanitizers:deps",
909 "tools/gdig/file_net_log.cc",
910 "tools/gdig/gdig.cc",
915 "//build/config/sanitizers:deps",
919 executable("get_server_time") {
922 "tools/get_server_time/get_server_time.cc",
925 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
926 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
931 "//build/config/sanitizers:deps",
936 executable("hpack_example_generator") {
939 "spdy/fuzzing/hpack_example_generator.cc",
942 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
943 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
947 "//build/config/sanitizers:deps",
951 executable("hpack_fuzz_mutator") {
954 "spdy/fuzzing/hpack_fuzz_mutator.cc",
957 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
958 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
962 "//build/config/sanitizers:deps",
966 executable("hpack_fuzz_wrapper") {
969 "spdy/fuzzing/hpack_fuzz_wrapper.cc",
972 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
973 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
977 "//build/config/sanitizers:deps",
982 executable("net_watcher") {
985 "tools/net_watcher/net_watcher.cc",
991 "//build/config/sanitizers:deps",
994 if (is_desktop_linux && use_gconf) {
996 "//build/config/linux:gconf",
997 "//build/config/linux:glib",
999 deps += [ "//build/linux:gio" ]
1004 executable("run_testserver") {
1007 "tools/testserver/run_testserver.cc",
1012 "//base/test:test_support",
1013 "//build/config/sanitizers:deps",
1018 executable("stress_cache") {
1021 "tools/stress_cache/stress_cache.cc",
1024 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1025 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
1030 "//build/config/sanitizers:deps",
1034 executable("tld_cleanup") {
1036 "tools/tld_cleanup/tld_cleanup.cc",
1039 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1040 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
1044 "//build/config/sanitizers:deps",
1045 "//net/tools/tld_cleanup",
1051 static_library("epoll_server") {
1053 "tools/epoll_server/epoll_server.cc",
1054 "tools/epoll_server/epoll_server.h",
1062 static_library("flip_in_mem_edsm_server_base") {
1065 "tools/flip_server/acceptor_thread.cc",
1066 "tools/flip_server/acceptor_thread.h",
1067 "tools/flip_server/constants.h",
1068 "tools/flip_server/create_listener.cc",
1069 "tools/flip_server/create_listener.h",
1070 "tools/flip_server/flip_config.cc",
1071 "tools/flip_server/flip_config.h",
1072 "tools/flip_server/http_interface.cc",
1073 "tools/flip_server/http_interface.h",
1074 "tools/flip_server/loadtime_measurement.h",
1075 "tools/flip_server/mem_cache.cc",
1076 "tools/flip_server/mem_cache.h",
1077 "tools/flip_server/output_ordering.cc",
1078 "tools/flip_server/output_ordering.h",
1079 "tools/flip_server/ring_buffer.cc",
1080 "tools/flip_server/ring_buffer.h",
1081 "tools/flip_server/sm_connection.cc",
1082 "tools/flip_server/sm_connection.h",
1083 "tools/flip_server/sm_interface.h",
1084 "tools/flip_server/spdy_interface.cc",
1085 "tools/flip_server/spdy_interface.h",
1086 "tools/flip_server/spdy_ssl.cc",
1087 "tools/flip_server/spdy_ssl.h",
1088 "tools/flip_server/spdy_util.cc",
1089 "tools/flip_server/spdy_util.h",
1090 "tools/flip_server/streamer_interface.cc",
1091 "tools/flip_server/streamer_interface.h",
1092 "tools/flip_server/url_to_filename_encoder.cc",
1093 "tools/flip_server/url_to_filename_encoder.h",
1094 "tools/flip_server/url_utilities.cc",
1095 "tools/flip_server/url_utilities.h",
1102 "//third_party/boringssl",
1106 executable("flip_in_mem_edsm_server_unittests") {
1109 "tools/flip_server/flip_test_utils.cc",
1110 "tools/flip_server/flip_test_utils.h",
1111 "tools/flip_server/http_interface_test.cc",
1112 "tools/flip_server/mem_cache_test.cc",
1113 "tools/flip_server/run_all_tests.cc",
1114 "tools/flip_server/spdy_interface_test.cc",
1115 "tools/flip_server/url_to_filename_encoder_unittest.cc",
1116 "tools/flip_server/url_utilities_unittest.cc",
1120 ":flip_in_mem_edsm_server_base",
1123 "//build/config/sanitizers:deps",
1126 "//third_party/boringssl",
1130 executable("flip_in_mem_edsm_server") {
1133 "tools/flip_server/flip_in_mem_edsm_server.cc",
1137 ":flip_in_mem_edsm_server_base",
1140 "//build/config/sanitizers:deps",
1144 source_set("epoll_quic_tools") {
1146 "tools/quic/quic_client.cc",
1147 "tools/quic/quic_client.h",
1148 "tools/quic/quic_default_packet_writer.cc",
1149 "tools/quic/quic_default_packet_writer.h",
1150 "tools/quic/quic_epoll_clock.cc",
1151 "tools/quic/quic_epoll_clock.h",
1152 "tools/quic/quic_epoll_connection_helper.cc",
1153 "tools/quic/quic_epoll_connection_helper.h",
1154 "tools/quic/quic_packet_reader.cc",
1155 "tools/quic/quic_packet_reader.h",
1156 "tools/quic/quic_packet_writer_wrapper.cc",
1157 "tools/quic/quic_packet_writer_wrapper.h",
1158 "tools/quic/quic_server.cc",
1159 "tools/quic/quic_server.h",
1160 "tools/quic/quic_socket_utils.cc",
1161 "tools/quic/quic_socket_utils.h",
1168 "//base/third_party/dynamic_annotations",
1170 "//third_party/boringssl",
1175 executable("epoll_quic_client") {
1177 "tools/quic/quic_client_bin.cc",
1182 ":epoll_quic_tools",
1184 ":simple_quic_tools",
1186 "//build/config/sanitizers:deps",
1187 "//third_party/boringssl",
1191 executable("epoll_quic_server") {
1193 "tools/quic/quic_server_bin.cc",
1198 ":epoll_quic_tools",
1200 ":simple_quic_tools",
1202 "//build/config/sanitizers:deps",
1203 "//third_party/boringssl",
1209 generate_jni("net_jni_headers") {
1211 "android/java/src/org/chromium/net/AndroidCertVerifyResult.java",
1212 "android/java/src/org/chromium/net/AndroidKeyStore.java",
1213 "android/java/src/org/chromium/net/AndroidNetworkLibrary.java",
1214 "android/java/src/org/chromium/net/AndroidPrivateKey.java",
1215 "android/java/src/org/chromium/net/AndroidTrafficStats.java",
1216 "android/java/src/org/chromium/net/GURLUtils.java",
1217 "android/java/src/org/chromium/net/HttpNegotiateAuthenticator.java",
1218 "android/java/src/org/chromium/net/NetStringUtil.java",
1219 "android/java/src/org/chromium/net/NetworkChangeNotifier.java",
1220 "android/java/src/org/chromium/net/ProxyChangeListener.java",
1221 "android/java/src/org/chromium/net/X509Util.java",
1225 generate_jni("net_test_jni_headers") {
1227 "android/javatests/src/org/chromium/net/AndroidKeyStoreTestUtil.java",
1228 "test/android/javatests/src/org/chromium/net/test/DummySpnegoAuthenticator.java",
1230 jni_package = "net/test"
1234 if (is_android || is_linux) {
1235 executable("disk_cache_memory_test") {
1238 "tools/disk_cache_memory_test/disk_cache_memory_test.cc",
1243 "//build/config/sanitizers:deps",
1248 source_set("simple_quic_tools") {
1250 "tools/quic/quic_client_base.cc",
1251 "tools/quic/quic_client_base.h",
1252 "tools/quic/quic_client_session.cc",
1253 "tools/quic/quic_client_session.h",
1254 "tools/quic/quic_dispatcher.cc",
1255 "tools/quic/quic_dispatcher.h",
1256 "tools/quic/quic_in_memory_cache.cc",
1257 "tools/quic/quic_in_memory_cache.h",
1258 "tools/quic/quic_per_connection_packet_writer.cc",
1259 "tools/quic/quic_per_connection_packet_writer.h",
1260 "tools/quic/quic_server_session.cc",
1261 "tools/quic/quic_server_session.h",
1262 "tools/quic/quic_simple_client.cc",
1263 "tools/quic/quic_simple_client.h",
1264 "tools/quic/quic_simple_per_connection_packet_writer.cc",
1265 "tools/quic/quic_simple_per_connection_packet_writer.h",
1266 "tools/quic/quic_simple_server.cc",
1267 "tools/quic/quic_simple_server.h",
1268 "tools/quic/quic_simple_server_packet_writer.cc",
1269 "tools/quic/quic_simple_server_packet_writer.h",
1270 "tools/quic/quic_spdy_client_stream.cc",
1271 "tools/quic/quic_spdy_client_stream.h",
1272 "tools/quic/quic_spdy_server_stream.cc",
1273 "tools/quic/quic_spdy_server_stream.h",
1274 "tools/quic/quic_time_wait_list_manager.cc",
1275 "tools/quic/quic_time_wait_list_manager.h",
1276 "tools/quic/synchronous_host_resolver.cc",
1277 "tools/quic/synchronous_host_resolver.h",
1282 "//base/third_party/dynamic_annotations",
1288 executable("quic_client") {
1290 "tools/quic/quic_simple_client_bin.cc",
1294 ":simple_quic_tools",
1296 "//build/config/sanitizers:deps",
1300 executable("quic_server") {
1302 "tools/quic/quic_simple_server_bin.cc",
1306 ":simple_quic_tools",
1308 "//build/config/sanitizers:deps",
1309 "//third_party/boringssl",
1310 "//third_party/protobuf:protobuf_lite",
1315 # TODO(GYP): Delete this after we've converted everything to GN.
1316 # The _run targets exist only for compatibility w/ GYP.
1317 group("net_unittests_run") {
1324 test("net_unittests") {
1325 sources = gypi_values.net_test_sources
1329 "websockets/websocket_stream_cookie_test.cc",
1330 "websockets/websocket_stream_create_test_base.cc",
1331 "websockets/websocket_stream_create_test_base.h",
1336 "//build/config:precompiled_headers",
1338 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1339 "//build/config/compiler:no_size_t_to_int_warning",
1348 ":simple_quic_tools",
1352 "//base:prefs_test_support",
1354 "//base/third_party/dynamic_annotations",
1356 "//crypto:platform",
1357 "//crypto:test_support",
1358 "//net/base/registry_controlled_domains",
1362 "//third_party/zlib",
1370 if (is_linux || is_mac || is_win) {
1372 "//third_party/pyftpdlib/",
1373 "//third_party/pywebsocket/",
1374 "//third_party/tlslite/",
1377 "//third_party/pyftpdlib/",
1378 "//third_party/pywebsocket/",
1379 "//third_party/tlslite/",
1382 "tools/testserver/",
1383 "//third_party/pyftpdlib/",
1384 "//third_party/pywebsocket/",
1385 "//third_party/tlslite/",
1386 "$root_out_dir/pyproto/google/",
1390 if (is_desktop_linux) {
1391 deps += [ ":epoll_quic_tools" ]
1394 sources += gypi_values.net_linux_test_sources
1396 ":epoll_quic_tools",
1398 ":flip_in_mem_edsm_server_base",
1402 if (is_mac || is_ios) {
1403 sources += gypi_values.net_base_test_mac_ios_sources
1407 sources -= [ "proxy/proxy_config_service_linux_unittest.cc" ]
1410 if (v8_use_external_startup_data) {
1414 if (!use_nss_certs) {
1416 "cert/nss_cert_database_unittest.cc",
1417 "ssl/client_cert_store_nss_unittest.cc",
1419 if (is_chromeos) { # Already removed for all non-ChromeOS builds.
1421 "cert/nss_cert_database_chromeos_unittest.cc",
1422 "cert/nss_profile_filter_chromeos_unittest.cc",
1428 # When building for OpenSSL, we need to exclude NSS specific tests
1429 # or functionality not supported by OpenSSL yet.
1430 # TODO(bulach): Add equivalent tests when the underlying
1431 # functionality is ported to OpenSSL.
1432 sources -= [ "quic/test_tools/crypto_test_utils_nss.cc" ]
1435 "cert/x509_util_openssl_unittest.cc",
1436 "quic/test_tools/crypto_test_utils_openssl.cc",
1437 "socket/ssl_client_socket_openssl_unittest.cc",
1438 "ssl/ssl_client_session_cache_openssl_unittest.cc",
1443 defines += [ "USE_KERBEROS" ]
1446 # These are excluded on Android, because the actual Kerberos support, which
1447 # these test, is in a separate app on Android.
1448 if (!use_kerberos || is_android) {
1450 "http/http_auth_gssapi_posix_unittest.cc",
1451 "http/mock_gssapi_library_posix.cc",
1452 "http/mock_gssapi_library_posix.h",
1455 if (!use_kerberos) {
1456 sources -= [ "http/http_auth_handler_negotiate_unittest.cc" ]
1459 if (use_openssl || (!is_desktop_linux && !is_chromeos && !is_ios)) {
1460 # Only include this test when on Posix and using NSS for
1461 # cert verification or on iOS (which also uses NSS for certs).
1462 sources -= [ "cert_net/nss_ocsp_unittest.cc" ]
1465 if (!use_openssl_certs) {
1466 sources -= [ "ssl/openssl_client_key_store_unittest.cc" ]
1469 if (!enable_websockets) {
1471 "server/http_connection_unittest.cc",
1472 "server/http_server_response_info_unittest.cc",
1473 "server/http_server_unittest.cc",
1474 "server/web_socket_encoder_unittest.cc",
1475 "websockets/websocket_basic_stream_test.cc",
1476 "websockets/websocket_channel_test.cc",
1477 "websockets/websocket_deflate_predictor_impl_test.cc",
1478 "websockets/websocket_deflate_stream_test.cc",
1479 "websockets/websocket_deflater_test.cc",
1480 "websockets/websocket_end_to_end_test.cc",
1481 "websockets/websocket_errors_test.cc",
1482 "websockets/websocket_extension_parser_test.cc",
1483 "websockets/websocket_frame_parser_test.cc",
1484 "websockets/websocket_frame_test.cc",
1485 "websockets/websocket_handshake_challenge_test.cc",
1486 "websockets/websocket_handshake_stream_create_helper_test.cc",
1487 "websockets/websocket_inflater_test.cc",
1488 "websockets/websocket_stream_test.cc",
1489 "websockets/websocket_test_util.cc",
1490 "websockets/websocket_test_util.h",
1492 deps -= [ ":http_server" ]
1495 if (disable_file_support) {
1497 "base/directory_lister_unittest.cc",
1498 "url_request/url_request_file_job_unittest.cc",
1502 if (disable_ftp_support) {
1504 "ftp/ftp_auth_cache_unittest.cc",
1505 "ftp/ftp_ctrl_response_buffer_unittest.cc",
1506 "ftp/ftp_directory_listing_parser_ls_unittest.cc",
1507 "ftp/ftp_directory_listing_parser_unittest.cc",
1508 "ftp/ftp_directory_listing_parser_unittest.h",
1509 "ftp/ftp_directory_listing_parser_vms_unittest.cc",
1510 "ftp/ftp_directory_listing_parser_windows_unittest.cc",
1511 "ftp/ftp_network_transaction_unittest.cc",
1512 "ftp/ftp_util_unittest.cc",
1513 "url_request/url_request_ftp_job_unittest.cc",
1517 if (!enable_built_in_dns) {
1519 "dns/address_sorter_posix_unittest.cc",
1520 "dns/address_sorter_unittest.cc",
1524 if (use_v8_in_net) {
1525 deps += [ ":net_with_v8" ]
1528 "proxy/proxy_resolver_v8_tracing_unittest.cc",
1529 "proxy/proxy_resolver_v8_tracing_wrapper_unittest.cc",
1530 "proxy/proxy_resolver_v8_unittest.cc",
1534 if (use_v8_in_net && !is_android) {
1536 ":net_browser_services",
1537 ":net_utility_services",
1538 "//mojo/environment:chromium",
1539 "//third_party/mojo/src/mojo/edk/system",
1543 "dns/host_resolver_mojo_unittest.cc",
1544 "dns/mojo_host_resolver_impl_unittest.cc",
1545 "proxy/mojo_proxy_resolver_factory_impl_unittest.cc",
1546 "proxy/mojo_proxy_resolver_impl_unittest.cc",
1547 "proxy/mojo_proxy_resolver_v8_tracing_bindings_unittest.cc",
1548 "proxy/proxy_resolver_factory_mojo_unittest.cc",
1549 "proxy/proxy_service_mojo_unittest.cc",
1555 "dns/mdns_cache_unittest.cc",
1556 "dns/mdns_client_unittest.cc",
1557 "dns/record_parsed_unittest.cc",
1558 "dns/record_rdata_unittest.cc",
1566 # 'action_name': 'copy_test_data',
1568 # 'test_data_files': [
1569 # 'data/ssl/certificates/',
1571 # 'data/url_request_unittest/',
1572 # 'data/verify_name_match_unittest/names/',
1573 # 'data/parse_certificate_unittest/',
1575 # 'test_data_prefix': 'net',
1577 # 'includes': [ '../build/copy_test_data_ios.gypi' ],
1581 # TODO(droger): The following tests are disabled because the
1582 # implementation is missing or incomplete.
1583 # KeygenHandler::GenKeyAndSignChallenge() is not ported to iOS.
1584 "base/keygen_handler_unittest.cc",
1585 "disk_cache/backend_unittest.cc",
1586 "disk_cache/blockfile/block_files_unittest.cc",
1588 # Need to read input data files.
1589 "filter/gzip_filter_unittest.cc",
1590 "socket/ssl_server_socket_unittest.cc",
1591 "spdy/fuzzing/hpack_fuzz_util_test.cc",
1594 "cert_net/cert_net_fetcher_impl_unittest.cc",
1595 "proxy/proxy_script_fetcher_impl_unittest.cc",
1596 "socket/ssl_client_socket_unittest.cc",
1597 "url_request/url_fetcher_impl_unittest.cc",
1598 "url_request/url_request_context_builder_unittest.cc",
1600 # Needs GetAppOutput().
1601 "test/python_utils_unittest.cc",
1603 # The following tests are disabled because they don't apply to
1605 # OS is not "linux" or "freebsd" or "openbsd".
1606 "socket/unix_domain_client_socket_posix_unittest.cc",
1607 "socket/unix_domain_server_socket_posix_unittest.cc",
1609 # See bug http://crbug.com/344533.
1610 "disk_cache/blockfile/index_table_v3_unittest.cc",
1616 # See bug http://crbug.com/344533.
1617 "disk_cache/blockfile/index_table_v3_unittest.cc",
1618 "dns/dns_config_service_posix_unittest.cc",
1621 ":net_test_jni_headers",
1623 # TODO(mmenke): This depends on test_support_base, which depends on
1624 # icu. Figure out a way to remove that dependency.
1625 "//testing/android/native_test:native_test_native_code",
1627 set_sources_assignment_filter([])
1628 sources += [ "base/address_tracker_linux_unittest.cc" ]
1629 set_sources_assignment_filter(sources_assignment_filter)
1630 isolate_file = "net_unittests.isolate"
1633 # Symbols for crashes when running tests on swarming.
1634 if (symbol_level > 0) {
1636 data += [ "$root_out_dir/net_unittests.exe.pdb" ]
1637 } else if (is_mac) {
1638 data += [ "$root_out_dir/net_unittests.dSYM/" ]
1643 # !is_android && !is_win && !is_mac
1645 executable("net_perftests") {
1648 "base/mime_sniffer_perftest.cc",
1649 "cookies/cookie_monster_perftest.cc",
1650 "disk_cache/blockfile/disk_cache_perftest.cc",
1651 "extras/sqlite/sqlite_persistent_cookie_store_perftest.cc",
1652 "proxy/proxy_resolver_perftest.cc",
1653 "udp/udp_socket_perftest.cc",
1656 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1657 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
1664 "//base/test:test_support_perf",
1665 "//build/config/sanitizers:deps",
1670 if (enable_websockets) {
1671 sources += [ "websockets/websocket_frame_perftest.cc" ]
1674 if (use_v8_in_net) {
1675 deps += [ ":net_with_v8" ]
1677 sources -= [ "proxy/proxy_resolver_perftest.cc" ]