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 "quic/crypto/proof_source_chromium_nss.cc",
164 "socket/nss_ssl_util.cc",
165 "socket/nss_ssl_util.h",
166 "socket/ssl_client_socket_nss.cc",
167 "socket/ssl_client_socket_nss.h",
168 "socket/ssl_server_socket_nss.cc",
169 "socket/ssl_server_socket_nss.h",
172 # Always removed for !ios below.
173 net_shared_sources -= [
174 "cert/cert_verify_proc_nss.cc",
175 "cert/cert_verify_proc_nss.h",
179 net_shared_sources -= [ "cert/sha256_legacy_support_nss_win.cc" ]
181 if (!use_nss_certs && !is_ios) {
182 net_shared_sources -= [ "cert/x509_util_nss.h" ]
185 net_shared_sources -= [
186 "cert/ct_log_verifier_openssl.cc",
187 "cert/ct_objects_extractor_openssl.cc",
188 "cert/jwk_serializer_openssl.cc",
189 "cert/x509_util_openssl.cc",
190 "cert/x509_util_openssl.h",
191 "quic/crypto/aead_base_decrypter_openssl.cc",
192 "quic/crypto/aead_base_encrypter_openssl.cc",
193 "quic/crypto/aes_128_gcm_12_decrypter_openssl.cc",
194 "quic/crypto/aes_128_gcm_12_encrypter_openssl.cc",
195 "quic/crypto/chacha20_poly1305_decrypter_openssl.cc",
196 "quic/crypto/chacha20_poly1305_encrypter_openssl.cc",
197 "quic/crypto/channel_id_openssl.cc",
198 "quic/crypto/p256_key_exchange_openssl.cc",
199 "quic/crypto/proof_source_chromium_openssl.cc",
200 "quic/crypto/scoped_evp_aead_ctx.cc",
201 "quic/crypto/scoped_evp_aead_ctx.h",
202 "socket/ssl_client_socket_openssl.cc",
203 "socket/ssl_client_socket_openssl.h",
204 "socket/ssl_server_socket_openssl.cc",
205 "socket/ssl_server_socket_openssl.h",
206 "ssl/openssl_ssl_util.cc",
207 "ssl/openssl_ssl_util.h",
208 "ssl/ssl_client_session_cache_openssl.cc",
209 "ssl/ssl_client_session_cache_openssl.h",
210 "ssl/ssl_platform_key.h",
211 "ssl/threaded_ssl_private_key.cc",
212 "ssl/threaded_ssl_private_key.h",
215 net_shared_sources -= [ "ssl/ssl_platform_key_mac.cc" ]
218 net_shared_sources -= [ "ssl/ssl_platform_key_android.cc" ]
221 net_shared_sources -= [
222 "cert/sha256_legacy_support_openssl_win.cc",
223 "ssl/ssl_platform_key_win.cc",
227 net_shared_sources -= [
228 "ssl/client_key_store.cc",
229 "ssl/client_key_store.h",
230 "ssl/ssl_platform_key_nss.cc",
235 if (!use_openssl_certs) {
236 net_shared_sources -= [
237 "base/crypto_module_openssl.cc",
238 "base/keygen_handler_openssl.cc",
239 "base/openssl_private_key_store.h",
240 "base/openssl_private_key_store_memory.cc",
241 "cert/cert_database_openssl.cc",
242 "cert/cert_verify_proc_openssl.cc",
243 "cert/cert_verify_proc_openssl.h",
244 "cert/test_root_certs_openssl.cc",
245 "cert/x509_certificate_openssl.cc",
246 "ssl/openssl_client_key_store.cc",
247 "ssl/openssl_client_key_store.h",
250 net_shared_sources -= [ "base/openssl_private_key_store_android.cc" ]
254 # Android doesn't use these even when using OpenSSL.
255 net_shared_sources -= [
256 "base/openssl_private_key_store_memory.cc",
257 "cert/cert_database_openssl.cc",
258 "cert/cert_verify_proc_openssl.cc",
259 "cert/test_root_certs_openssl.cc",
264 if (use_glib && !is_chromeos) {
265 net_shared_configs += [ "//build/config/linux:gconf" ]
266 net_shared_deps += [ "//build/linux:gio" ]
270 net_shared_configs += [ "//build/config/linux:libresolv" ]
273 if (!use_nss_certs) {
274 net_shared_sources -= [
275 "base/crypto_module_nss.cc",
276 "base/keygen_handler_nss.cc",
277 "cert/cert_database_nss.cc",
278 "cert/nss_cert_database.cc",
279 "cert/nss_cert_database.h",
280 "cert/x509_certificate_nss.cc",
281 "ssl/client_cert_store_nss.cc",
282 "ssl/client_cert_store_nss.h",
283 "third_party/mozilla_security_manager/nsKeygenHandler.cpp",
284 "third_party/mozilla_security_manager/nsKeygenHandler.h",
285 "third_party/mozilla_security_manager/nsNSSCertificateDB.cpp",
286 "third_party/mozilla_security_manager/nsNSSCertificateDB.h",
287 "third_party/mozilla_security_manager/nsPKCS12Blob.cpp",
288 "third_party/mozilla_security_manager/nsPKCS12Blob.h",
291 # These files are part of the partial implementation of NSS on iOS so
292 # keep them in that case (even though use_nss_certs is not set).
293 net_shared_sources -= [
294 "cert/cert_verify_proc_nss.cc",
295 "cert/cert_verify_proc_nss.h",
296 "cert/test_root_certs_nss.cc",
297 "cert/x509_util_nss_certs.cc",
298 "cert_net/nss_ocsp.cc",
299 "cert_net/nss_ocsp.h",
303 # These were already removed on non-ChromeOS.
304 net_shared_sources -= [
305 "cert/nss_cert_database_chromeos.cc",
306 "cert/nss_cert_database_chromeos.h",
307 "cert/nss_profile_filter_chromeos.cc",
308 "cert/nss_profile_filter_chromeos.h",
311 net_shared_sources -= [
312 "ssl/client_key_store.cc",
313 "ssl/client_key_store.h",
314 "ssl/ssl_platform_key_nss.cc",
316 } else if (use_openssl) {
317 # client_cert_store_nss.c requires NSS_CmpCertChainWCANames from NSS's
318 # libssl, but our bundled copy is not built in OpenSSL ports. Pull that file
320 net_shared_sources += [ "third_party/nss/ssl/cmpcert.c" ]
324 net_shared_sources -= [
327 "dns/mdns_client.cc",
329 "dns/mdns_client_impl.cc",
330 "dns/mdns_client_impl.h",
331 "dns/record_parsed.cc",
332 "dns/record_parsed.h",
333 "dns/record_rdata.cc",
334 "dns/record_rdata.h",
339 net_shared_sources -= [
340 "http/http_auth_handler_ntlm_portable.cc",
341 "socket/socket_libevent.cc",
342 "socket/socket_libevent.h",
343 "socket/tcp_socket_libevent.cc",
344 "socket/tcp_socket_libevent.h",
345 "udp/udp_socket_libevent.cc",
346 "udp/udp_socket_libevent.h",
349 net_shared_sources -= [
350 "base/winsock_init.cc",
351 "base/winsock_init.h",
352 "base/winsock_util.cc",
353 "base/winsock_util.h",
354 "proxy/proxy_resolver_winhttp.cc",
355 "proxy/proxy_resolver_winhttp.h",
360 # Add back some sources that were otherwise filtered out. iOS needs some Mac
362 net_shared_unfiltered_sources += [
363 "base/mac/url_conversions.h",
364 "base/mac/url_conversions.mm",
365 "base/network_change_notifier_mac.cc",
366 "base/network_config_watcher_mac.cc",
367 "base/network_interfaces_mac.cc",
368 "base/network_interfaces_mac.h",
369 "base/platform_mime_util_mac.mm",
370 "proxy/proxy_resolver_mac.cc",
371 "proxy/proxy_server_mac.cc",
374 net_shared_sources -= [ "disk_cache/blockfile/file_posix.cc" ]
376 "//third_party/nss:nspr",
378 "//net/third_party/nss/ssl:libssl",
382 if (is_ios || is_mac) {
383 net_shared_sources += gypi_values.net_base_mac_ios_sources
387 net_shared_deps += [ ":net_jni_headers" ]
389 # Add some Linux sources that were excluded by the filter, but which
391 net_shared_unfiltered_sources += [
392 "base/address_tracker_linux.cc",
393 "base/address_tracker_linux.h",
394 "base/network_interfaces_linux.cc",
395 "base/network_interfaces_linux.h",
396 "base/platform_mime_util_linux.cc",
401 sources = net_shared_sources
403 # Add back some sources that were otherwise filtered out.
404 set_sources_assignment_filter([])
405 sources += net_shared_unfiltered_sources
406 set_sources_assignment_filter(sources_assignment_filter)
409 configs += net_shared_configs
410 public_configs = [ ":net_config" ]
412 public_deps = net_shared_public_deps + [ "//url" ]
413 deps = net_shared_deps
417 "Foundation.framework",
418 "Security.framework",
419 "SystemConfiguration.framework",
426 "CFNetwork.framework",
427 "MobileCoreServices.framework",
428 "Security.framework",
429 "SystemConfiguration.framework",
434 if (!disable_file_support) {
435 sources += gypi_values.net_file_support_sources
438 if (!disable_ftp_support) {
439 sources += gypi_values.net_ftp_support_sources
442 if (enable_websockets) {
443 sources += gypi_values.net_websockets_sources
452 "base/filename_util_icu.cc",
453 "base/net_string_util_icu.cc",
454 "base/net_util_icu.cc",
459 # Same as net, but with ICU, file, ftp, and websocket support stripped.
460 component("net_small") {
461 sources = net_shared_sources
463 # Add back some sources that were otherwise filtered out.
464 set_sources_assignment_filter([])
465 sources += net_shared_unfiltered_sources
466 set_sources_assignment_filter(sources_assignment_filter)
470 configs += net_shared_configs
471 public_configs = [ ":net_config" ]
473 public_deps = net_shared_public_deps +
474 [ "//url:url_lib_use_icu_alternatives_on_android" ]
475 deps = net_shared_deps + [ ":net_jni_headers" ]
478 "DISABLE_FILE_SUPPORT",
479 "DISABLE_FTP_SUPPORT",
480 "USE_ICU_ALTERNATIVES_ON_ANDROID=1",
483 # Use ICU alternative on Android.
485 "base/net_string_util_icu_alternatives_android.cc",
486 "base/net_string_util_icu_alternatives_android.h",
491 grit("net_resources") {
492 source = "base/net_resources.grd"
493 use_qualified_include = true
495 "grit/net_resources.h",
500 proto_library("net_quic_proto") {
507 "quic/proto/cached_network_parameters.proto",
508 "quic/proto/source_address_token.proto",
510 cc_generator_options = "dllexport_decl=NET_EXPORT_PRIVATE:"
511 cc_include = "net/base/net_export.h"
513 defines = [ "NET_IMPLEMENTATION" ]
515 extra_configs = [ "//build/config/compiler:wexit_time_destructors" ]
518 static_library("extras") {
519 sources = gypi_values.net_extras_sources
520 configs += [ "//build/config/compiler:wexit_time_destructors" ]
528 static_library("http_server") {
530 "server/http_connection.cc",
531 "server/http_connection.h",
532 "server/http_server.cc",
533 "server/http_server.h",
534 "server/http_server_request_info.cc",
535 "server/http_server_request_info.h",
536 "server/http_server_response_info.cc",
537 "server/http_server_response_info.h",
538 "server/web_socket.cc",
539 "server/web_socket.h",
540 "server/web_socket_encoder.cc",
541 "server/web_socket_encoder.h",
544 "//build/config/compiler:no_size_t_to_int_warning",
545 "//build/config/compiler:wexit_time_destructors",
553 executable("dump_cache") {
556 "tools/dump_cache/dump_cache.cc",
557 "tools/dump_cache/dump_files.cc",
558 "tools/dump_cache/dump_files.h",
561 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
562 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
568 "//build/config/sanitizers:deps",
572 source_set("test_support") {
575 "base/load_timing_info_test_util.cc",
576 "base/load_timing_info_test_util.h",
577 "base/mock_file_stream.cc",
578 "base/mock_file_stream.h",
579 "base/test_completion_callback.cc",
580 "base/test_completion_callback.h",
581 "base/test_data_directory.cc",
582 "base/test_data_directory.h",
583 "cert/mock_cert_verifier.cc",
584 "cert/mock_cert_verifier.h",
585 "cookies/cookie_monster_store_test.cc",
586 "cookies/cookie_monster_store_test.h",
587 "cookies/cookie_store_test_callbacks.cc",
588 "cookies/cookie_store_test_callbacks.h",
589 "cookies/cookie_store_test_helpers.cc",
590 "cookies/cookie_store_test_helpers.h",
591 "disk_cache/disk_cache_test_base.cc",
592 "disk_cache/disk_cache_test_base.h",
593 "disk_cache/disk_cache_test_util.cc",
594 "disk_cache/disk_cache_test_util.h",
595 "dns/dns_test_util.cc",
596 "dns/dns_test_util.h",
597 "dns/mock_host_resolver.cc",
598 "dns/mock_host_resolver.h",
599 "dns/mock_mdns_socket_factory.cc",
600 "dns/mock_mdns_socket_factory.h",
601 "http/http_transaction_test_util.cc",
602 "http/http_transaction_test_util.h",
603 "log/test_net_log.cc",
604 "log/test_net_log.h",
605 "log/test_net_log_entry.cc",
606 "log/test_net_log_entry.h",
607 "log/test_net_log_util.cc",
608 "log/test_net_log_util.h",
609 "proxy/mock_proxy_resolver.cc",
610 "proxy/mock_proxy_resolver.h",
611 "proxy/mock_proxy_script_fetcher.cc",
612 "proxy/mock_proxy_script_fetcher.h",
613 "proxy/proxy_config_service_common_unittest.cc",
614 "proxy/proxy_config_service_common_unittest.h",
615 "socket/socket_test_util.cc",
616 "socket/socket_test_util.h",
617 "test/cert_test_util.cc",
618 "test/cert_test_util.h",
619 "test/cert_test_util_nss.cc",
620 "test/channel_id_test_util.cc",
621 "test/channel_id_test_util.h",
622 "test/ct_test_util.cc",
623 "test/ct_test_util.h",
624 "test/embedded_test_server/embedded_test_server.cc",
625 "test/embedded_test_server/embedded_test_server.h",
626 "test/embedded_test_server/http_connection.cc",
627 "test/embedded_test_server/http_connection.h",
628 "test/embedded_test_server/http_request.cc",
629 "test/embedded_test_server/http_request.h",
630 "test/embedded_test_server/http_response.cc",
631 "test/embedded_test_server/http_response.h",
632 "test/embedded_test_server/stream_listen_socket.cc",
633 "test/embedded_test_server/stream_listen_socket.h",
634 "test/embedded_test_server/tcp_listen_socket.cc",
635 "test/embedded_test_server/tcp_listen_socket.h",
636 "test/event_waiter.h",
637 "test/net_test_suite.cc",
638 "test/net_test_suite.h",
639 "test/python_utils.cc",
640 "test/python_utils.h",
641 "test/url_request/ssl_certificate_error_job.cc",
642 "test/url_request/ssl_certificate_error_job.h",
643 "test/url_request/url_request_failed_job.cc",
644 "test/url_request/url_request_failed_job.h",
645 "test/url_request/url_request_mock_data_job.cc",
646 "test/url_request/url_request_mock_data_job.h",
647 "test/url_request/url_request_slow_download_job.cc",
648 "test/url_request/url_request_slow_download_job.h",
649 "url_request/test_url_fetcher_factory.cc",
650 "url_request/test_url_fetcher_factory.h",
651 "url_request/url_request_test_util.cc",
652 "url_request/url_request_test_util.h",
656 "test/spawned_test_server/base_test_server.cc",
657 "test/spawned_test_server/base_test_server.h",
658 "test/spawned_test_server/local_test_server.cc",
659 "test/spawned_test_server/local_test_server.h",
660 "test/spawned_test_server/local_test_server_posix.cc",
661 "test/spawned_test_server/local_test_server_win.cc",
662 "test/spawned_test_server/spawned_test_server.h",
667 "//build/config:precompiled_headers",
669 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
670 "//build/config/compiler:no_size_t_to_int_warning",
675 "//base/test:test_support",
678 "//net/tools/tld_cleanup",
685 public_deps += [ "//third_party/protobuf:py_proto" ]
688 if (use_nss_certs || is_ios) {
689 public_deps += [ "//crypto:platform" ]
694 "test/spawned_test_server/remote_test_server.cc",
695 "test/spawned_test_server/remote_test_server.h",
696 "test/spawned_test_server/spawner_communicator.cc",
697 "test/spawned_test_server/spawner_communicator.h",
702 public_deps += [ ":net_with_v8" ]
707 "dns/mock_mdns_socket_factory.cc",
708 "dns/mock_mdns_socket_factory.h",
712 if (!use_nss_certs) {
713 sources -= [ "test/cert_test_util_nss.cc" ]
716 if (!disable_file_support) {
718 "test/url_request/url_request_mock_http_job.cc",
719 "test/url_request/url_request_mock_http_job.h",
720 "url_request/test_url_request_interceptor.cc",
721 "url_request/test_url_request_interceptor.h",
726 source_set("balsa") {
728 "tools/balsa/balsa_enums.h",
729 "tools/balsa/balsa_frame.cc",
730 "tools/balsa/balsa_frame.h",
731 "tools/balsa/balsa_headers.cc",
732 "tools/balsa/balsa_headers.h",
733 "tools/balsa/balsa_headers_token_utils.cc",
734 "tools/balsa/balsa_headers_token_utils.h",
735 "tools/balsa/balsa_visitor_interface.h",
736 "tools/balsa/http_message_constants.cc",
737 "tools/balsa/http_message_constants.h",
738 "tools/balsa/noop_balsa_visitor.h",
739 "tools/balsa/simple_buffer.cc",
740 "tools/balsa/simple_buffer.h",
741 "tools/balsa/split.cc",
742 "tools/balsa/split.h",
743 "tools/balsa/string_piece_utils.h",
744 "tools/quic/spdy_balsa_utils.cc",
745 "tools/quic/spdy_balsa_utils.h",
755 component("net_with_v8") {
757 "proxy/proxy_resolver_v8.cc",
758 "proxy/proxy_resolver_v8.h",
759 "proxy/proxy_resolver_v8_tracing.cc",
760 "proxy/proxy_resolver_v8_tracing.h",
761 "proxy/proxy_resolver_v8_tracing_wrapper.cc",
762 "proxy/proxy_resolver_v8_tracing_wrapper.h",
763 "proxy/proxy_service_v8.cc",
764 "proxy/proxy_service_v8.h",
767 defines = [ "NET_IMPLEMENTATION" ]
769 "//build/config/compiler:no_size_t_to_int_warning",
770 "//build/config/compiler:wexit_time_destructors",
785 if (use_v8_in_net && !is_android) {
786 source_set("net_browser_services") {
788 "dns/mojo_host_resolver_impl.cc",
789 "dns/mojo_host_resolver_impl.h",
790 "proxy/in_process_mojo_proxy_resolver_factory.cc",
791 "proxy/in_process_mojo_proxy_resolver_factory.h",
792 "proxy/mojo_proxy_resolver_factory.h",
793 "proxy/proxy_resolver_factory_mojo.cc",
794 "proxy/proxy_resolver_factory_mojo.h",
795 "proxy/proxy_service_mojo.cc",
796 "proxy/proxy_service_mojo.h",
800 ":mojo_type_converters",
805 "//third_party/mojo/src/mojo/public/cpp/bindings",
807 # NOTE(amistry): As long as we support in-process Mojo v8 PAC, we need
808 # this dependency since in_process_mojo_proxy_resolver_factory creates
809 # the utility process side Mojo services in the browser process.
810 # Ultimately, this will go away when we only support out-of-process.
811 ":net_utility_services",
815 source_set("mojo_type_converters") {
817 "dns/mojo_host_type_converters.cc",
818 "dns/mojo_host_type_converters.h",
819 "proxy/mojo_proxy_type_converters.cc",
820 "proxy/mojo_proxy_type_converters.h",
826 "//third_party/mojo/src/mojo/public/cpp/bindings",
830 source_set("net_utility_services") {
832 "dns/host_resolver_mojo.cc",
833 "dns/host_resolver_mojo.h",
834 "proxy/mojo_proxy_resolver_factory_impl.cc",
835 "proxy/mojo_proxy_resolver_factory_impl.h",
836 "proxy/mojo_proxy_resolver_impl.cc",
837 "proxy/mojo_proxy_resolver_impl.h",
838 "proxy/mojo_proxy_resolver_v8_tracing_bindings.h",
846 ":mojo_type_converters",
850 "//third_party/mojo/src/mojo/public/cpp/bindings",
855 if (!is_ios && !is_android) {
856 executable("crash_cache") {
859 "tools/crash_cache/crash_cache.cc",
862 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
863 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
868 "//build/config/sanitizers:deps",
872 executable("crl_set_dump") {
875 "tools/crl_set_dump/crl_set_dump.cc",
878 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
879 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
883 "//build/config/sanitizers:deps",
887 executable("dns_fuzz_stub") {
890 "tools/dns_fuzz_stub/dns_fuzz_stub.cc",
893 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
894 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
898 "//build/config/sanitizers:deps",
905 "tools/gdig/file_net_log.cc",
906 "tools/gdig/gdig.cc",
911 "//build/config/sanitizers:deps",
915 executable("get_server_time") {
918 "tools/get_server_time/get_server_time.cc",
921 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
922 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
927 "//build/config/sanitizers:deps",
932 executable("hpack_example_generator") {
935 "spdy/fuzzing/hpack_example_generator.cc",
938 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
939 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
943 "//build/config/sanitizers:deps",
947 executable("hpack_fuzz_mutator") {
950 "spdy/fuzzing/hpack_fuzz_mutator.cc",
953 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
954 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
958 "//build/config/sanitizers:deps",
962 executable("hpack_fuzz_wrapper") {
965 "spdy/fuzzing/hpack_fuzz_wrapper.cc",
968 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
969 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
973 "//build/config/sanitizers:deps",
978 executable("net_watcher") {
981 "tools/net_watcher/net_watcher.cc",
987 "//build/config/sanitizers:deps",
990 if (is_desktop_linux) {
992 "//build/config/linux:gconf",
993 "//build/config/linux:glib",
995 deps += [ "//build/linux:gio" ]
1000 executable("run_testserver") {
1003 "tools/testserver/run_testserver.cc",
1008 "//base/test:test_support",
1009 "//build/config/sanitizers:deps",
1014 executable("stress_cache") {
1017 "tools/stress_cache/stress_cache.cc",
1020 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1021 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
1026 "//build/config/sanitizers:deps",
1030 executable("tld_cleanup") {
1032 "tools/tld_cleanup/tld_cleanup.cc",
1035 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1036 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
1040 "//build/config/sanitizers:deps",
1041 "//net/tools/tld_cleanup",
1047 static_library("epoll_server") {
1049 "tools/epoll_server/epoll_server.cc",
1050 "tools/epoll_server/epoll_server.h",
1058 static_library("flip_in_mem_edsm_server_base") {
1061 "tools/flip_server/acceptor_thread.cc",
1062 "tools/flip_server/acceptor_thread.h",
1063 "tools/flip_server/constants.h",
1064 "tools/flip_server/create_listener.cc",
1065 "tools/flip_server/create_listener.h",
1066 "tools/flip_server/flip_config.cc",
1067 "tools/flip_server/flip_config.h",
1068 "tools/flip_server/http_interface.cc",
1069 "tools/flip_server/http_interface.h",
1070 "tools/flip_server/loadtime_measurement.h",
1071 "tools/flip_server/mem_cache.cc",
1072 "tools/flip_server/mem_cache.h",
1073 "tools/flip_server/output_ordering.cc",
1074 "tools/flip_server/output_ordering.h",
1075 "tools/flip_server/ring_buffer.cc",
1076 "tools/flip_server/ring_buffer.h",
1077 "tools/flip_server/sm_connection.cc",
1078 "tools/flip_server/sm_connection.h",
1079 "tools/flip_server/sm_interface.h",
1080 "tools/flip_server/spdy_interface.cc",
1081 "tools/flip_server/spdy_interface.h",
1082 "tools/flip_server/spdy_ssl.cc",
1083 "tools/flip_server/spdy_ssl.h",
1084 "tools/flip_server/spdy_util.cc",
1085 "tools/flip_server/spdy_util.h",
1086 "tools/flip_server/streamer_interface.cc",
1087 "tools/flip_server/streamer_interface.h",
1088 "tools/flip_server/url_to_filename_encoder.cc",
1089 "tools/flip_server/url_to_filename_encoder.h",
1090 "tools/flip_server/url_utilities.cc",
1091 "tools/flip_server/url_utilities.h",
1098 "//third_party/boringssl",
1102 executable("flip_in_mem_edsm_server_unittests") {
1105 "tools/flip_server/flip_test_utils.cc",
1106 "tools/flip_server/flip_test_utils.h",
1107 "tools/flip_server/http_interface_test.cc",
1108 "tools/flip_server/mem_cache_test.cc",
1109 "tools/flip_server/run_all_tests.cc",
1110 "tools/flip_server/spdy_interface_test.cc",
1111 "tools/flip_server/url_to_filename_encoder_unittest.cc",
1112 "tools/flip_server/url_utilities_unittest.cc",
1116 ":flip_in_mem_edsm_server_base",
1119 "//build/config/sanitizers:deps",
1122 "//third_party/boringssl",
1126 executable("flip_in_mem_edsm_server") {
1129 "tools/flip_server/flip_in_mem_edsm_server.cc",
1133 ":flip_in_mem_edsm_server_base",
1136 "//build/config/sanitizers:deps",
1140 source_set("epoll_quic_tools") {
1142 "tools/quic/quic_client.cc",
1143 "tools/quic/quic_client.h",
1144 "tools/quic/quic_default_packet_writer.cc",
1145 "tools/quic/quic_default_packet_writer.h",
1146 "tools/quic/quic_epoll_clock.cc",
1147 "tools/quic/quic_epoll_clock.h",
1148 "tools/quic/quic_epoll_connection_helper.cc",
1149 "tools/quic/quic_epoll_connection_helper.h",
1150 "tools/quic/quic_packet_reader.cc",
1151 "tools/quic/quic_packet_reader.h",
1152 "tools/quic/quic_packet_writer_wrapper.cc",
1153 "tools/quic/quic_packet_writer_wrapper.h",
1154 "tools/quic/quic_server.cc",
1155 "tools/quic/quic_server.h",
1156 "tools/quic/quic_socket_utils.cc",
1157 "tools/quic/quic_socket_utils.h",
1164 "//base/third_party/dynamic_annotations",
1166 "//third_party/boringssl",
1171 executable("epoll_quic_client") {
1173 "tools/quic/quic_client_bin.cc",
1178 ":epoll_quic_tools",
1180 ":simple_quic_tools",
1182 "//build/config/sanitizers:deps",
1183 "//third_party/boringssl",
1187 executable("epoll_quic_server") {
1189 "tools/quic/quic_server_bin.cc",
1194 ":epoll_quic_tools",
1196 ":simple_quic_tools",
1198 "//build/config/sanitizers:deps",
1199 "//third_party/boringssl",
1205 generate_jni("net_jni_headers") {
1207 "android/java/src/org/chromium/net/AndroidCertVerifyResult.java",
1208 "android/java/src/org/chromium/net/AndroidKeyStore.java",
1209 "android/java/src/org/chromium/net/AndroidNetworkLibrary.java",
1210 "android/java/src/org/chromium/net/AndroidPrivateKey.java",
1211 "android/java/src/org/chromium/net/GURLUtils.java",
1212 "android/java/src/org/chromium/net/HttpNegotiateAuthenticator.java",
1213 "android/java/src/org/chromium/net/NetStringUtil.java",
1214 "android/java/src/org/chromium/net/NetworkChangeNotifier.java",
1215 "android/java/src/org/chromium/net/ProxyChangeListener.java",
1216 "android/java/src/org/chromium/net/X509Util.java",
1220 generate_jni("net_test_jni_headers") {
1222 "android/javatests/src/org/chromium/net/AndroidKeyStoreTestUtil.java",
1223 "test/android/javatests/src/org/chromium/net/test/DummySpnegoAuthenticator.java",
1225 jni_package = "net/test"
1229 if (is_android || is_linux) {
1230 executable("disk_cache_memory_test") {
1233 "tools/disk_cache_memory_test/disk_cache_memory_test.cc",
1238 "//build/config/sanitizers:deps",
1243 source_set("simple_quic_tools") {
1245 "tools/quic/quic_client_base.cc",
1246 "tools/quic/quic_client_base.h",
1247 "tools/quic/quic_client_session.cc",
1248 "tools/quic/quic_client_session.h",
1249 "tools/quic/quic_dispatcher.cc",
1250 "tools/quic/quic_dispatcher.h",
1251 "tools/quic/quic_in_memory_cache.cc",
1252 "tools/quic/quic_in_memory_cache.h",
1253 "tools/quic/quic_per_connection_packet_writer.cc",
1254 "tools/quic/quic_per_connection_packet_writer.h",
1255 "tools/quic/quic_server_session.cc",
1256 "tools/quic/quic_server_session.h",
1257 "tools/quic/quic_simple_client.cc",
1258 "tools/quic/quic_simple_client.h",
1259 "tools/quic/quic_simple_per_connection_packet_writer.cc",
1260 "tools/quic/quic_simple_per_connection_packet_writer.h",
1261 "tools/quic/quic_simple_server.cc",
1262 "tools/quic/quic_simple_server.h",
1263 "tools/quic/quic_simple_server_packet_writer.cc",
1264 "tools/quic/quic_simple_server_packet_writer.h",
1265 "tools/quic/quic_spdy_client_stream.cc",
1266 "tools/quic/quic_spdy_client_stream.h",
1267 "tools/quic/quic_spdy_server_stream.cc",
1268 "tools/quic/quic_spdy_server_stream.h",
1269 "tools/quic/quic_time_wait_list_manager.cc",
1270 "tools/quic/quic_time_wait_list_manager.h",
1271 "tools/quic/synchronous_host_resolver.cc",
1272 "tools/quic/synchronous_host_resolver.h",
1277 "//base/third_party/dynamic_annotations",
1283 executable("quic_client") {
1285 "tools/quic/quic_simple_client_bin.cc",
1289 ":simple_quic_tools",
1291 "//build/config/sanitizers:deps",
1295 executable("quic_server") {
1297 "tools/quic/quic_simple_server_bin.cc",
1301 ":simple_quic_tools",
1303 "//build/config/sanitizers:deps",
1304 "//third_party/boringssl",
1305 "//third_party/protobuf:protobuf_lite",
1310 # TODO(GYP): Delete this after we've converted everything to GN.
1311 # The _run targets exist only for compatibility w/ GYP.
1312 group("net_unittests_run") {
1319 test("net_unittests") {
1320 sources = gypi_values.net_test_sources
1324 "websockets/websocket_stream_cookie_test.cc",
1325 "websockets/websocket_stream_create_test_base.cc",
1326 "websockets/websocket_stream_create_test_base.h",
1331 "//build/config:precompiled_headers",
1333 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1334 "//build/config/compiler:no_size_t_to_int_warning",
1343 ":simple_quic_tools",
1347 "//base:prefs_test_support",
1349 "//base/third_party/dynamic_annotations",
1351 "//crypto:platform",
1352 "//crypto:test_support",
1353 "//net/base/registry_controlled_domains",
1357 "//third_party/zlib",
1365 if (is_linux || is_mac || is_win) {
1367 "//third_party/pyftpdlib/",
1368 "//third_party/pywebsocket/",
1369 "//third_party/tlslite/",
1372 "//third_party/pyftpdlib/",
1373 "//third_party/pywebsocket/",
1374 "//third_party/tlslite/",
1377 "tools/testserver/",
1378 "//third_party/pyftpdlib/",
1379 "//third_party/pywebsocket/",
1380 "//third_party/tlslite/",
1381 "$root_out_dir/pyproto/google/",
1385 if (is_desktop_linux) {
1386 deps += [ ":epoll_quic_tools" ]
1389 sources += gypi_values.net_linux_test_sources
1391 ":epoll_quic_tools",
1393 ":flip_in_mem_edsm_server_base",
1397 if (is_mac || is_ios) {
1398 sources += gypi_values.net_base_test_mac_ios_sources
1402 sources -= [ "proxy/proxy_config_service_linux_unittest.cc" ]
1405 if (v8_use_external_startup_data) {
1409 if (!use_nss_certs) {
1411 "cert/nss_cert_database_unittest.cc",
1412 "ssl/client_cert_store_nss_unittest.cc",
1414 if (is_chromeos) { # Already removed for all non-ChromeOS builds.
1416 "cert/nss_cert_database_chromeos_unittest.cc",
1417 "cert/nss_profile_filter_chromeos_unittest.cc",
1423 # When building for OpenSSL, we need to exclude NSS specific tests
1424 # or functionality not supported by OpenSSL yet.
1425 # TODO(bulach): Add equivalent tests when the underlying
1426 # functionality is ported to OpenSSL.
1427 sources -= [ "quic/test_tools/crypto_test_utils_nss.cc" ]
1430 "cert/x509_util_openssl_unittest.cc",
1431 "quic/test_tools/crypto_test_utils_openssl.cc",
1432 "socket/ssl_client_socket_openssl_unittest.cc",
1433 "ssl/ssl_client_session_cache_openssl_unittest.cc",
1438 defines += [ "USE_KERBEROS" ]
1441 # These are excluded on Android, because the actual Kerberos support, which
1442 # these test, is in a separate app on Android.
1443 if (!use_kerberos || is_android) {
1445 "http/http_auth_gssapi_posix_unittest.cc",
1446 "http/mock_gssapi_library_posix.cc",
1447 "http/mock_gssapi_library_posix.h",
1450 if (!use_kerberos) {
1451 sources -= [ "http/http_auth_handler_negotiate_unittest.cc" ]
1454 if (use_openssl || (!is_desktop_linux && !is_chromeos && !is_ios)) {
1455 # Only include this test when on Posix and using NSS for
1456 # cert verification or on iOS (which also uses NSS for certs).
1457 sources -= [ "cert_net/nss_ocsp_unittest.cc" ]
1460 if (!use_openssl_certs) {
1461 sources -= [ "ssl/openssl_client_key_store_unittest.cc" ]
1464 if (!enable_websockets) {
1466 "server/http_connection_unittest.cc",
1467 "server/http_server_response_info_unittest.cc",
1468 "server/http_server_unittest.cc",
1469 "server/web_socket_encoder_unittest.cc",
1470 "websockets/websocket_basic_stream_test.cc",
1471 "websockets/websocket_channel_test.cc",
1472 "websockets/websocket_deflate_predictor_impl_test.cc",
1473 "websockets/websocket_deflate_stream_test.cc",
1474 "websockets/websocket_deflater_test.cc",
1475 "websockets/websocket_end_to_end_test.cc",
1476 "websockets/websocket_errors_test.cc",
1477 "websockets/websocket_extension_parser_test.cc",
1478 "websockets/websocket_frame_parser_test.cc",
1479 "websockets/websocket_frame_test.cc",
1480 "websockets/websocket_handshake_challenge_test.cc",
1481 "websockets/websocket_handshake_stream_create_helper_test.cc",
1482 "websockets/websocket_inflater_test.cc",
1483 "websockets/websocket_stream_test.cc",
1484 "websockets/websocket_test_util.cc",
1485 "websockets/websocket_test_util.h",
1487 deps -= [ ":http_server" ]
1490 if (disable_file_support) {
1492 "base/directory_lister_unittest.cc",
1493 "url_request/url_request_file_job_unittest.cc",
1497 if (disable_ftp_support) {
1499 "ftp/ftp_auth_cache_unittest.cc",
1500 "ftp/ftp_ctrl_response_buffer_unittest.cc",
1501 "ftp/ftp_directory_listing_parser_ls_unittest.cc",
1502 "ftp/ftp_directory_listing_parser_unittest.cc",
1503 "ftp/ftp_directory_listing_parser_unittest.h",
1504 "ftp/ftp_directory_listing_parser_vms_unittest.cc",
1505 "ftp/ftp_directory_listing_parser_windows_unittest.cc",
1506 "ftp/ftp_network_transaction_unittest.cc",
1507 "ftp/ftp_util_unittest.cc",
1508 "url_request/url_request_ftp_job_unittest.cc",
1512 if (!enable_built_in_dns) {
1514 "dns/address_sorter_posix_unittest.cc",
1515 "dns/address_sorter_unittest.cc",
1519 if (use_v8_in_net) {
1520 deps += [ ":net_with_v8" ]
1523 "proxy/proxy_resolver_v8_tracing_unittest.cc",
1524 "proxy/proxy_resolver_v8_tracing_wrapper_unittest.cc",
1525 "proxy/proxy_resolver_v8_unittest.cc",
1529 if (use_v8_in_net && !is_android) {
1531 ":net_browser_services",
1532 ":net_utility_services",
1533 "//mojo/environment:chromium",
1534 "//third_party/mojo/src/mojo/edk/system",
1538 "dns/host_resolver_mojo_unittest.cc",
1539 "dns/mojo_host_resolver_impl_unittest.cc",
1540 "proxy/mojo_proxy_resolver_factory_impl_unittest.cc",
1541 "proxy/mojo_proxy_resolver_impl_unittest.cc",
1542 "proxy/mojo_proxy_resolver_v8_tracing_bindings_unittest.cc",
1543 "proxy/proxy_resolver_factory_mojo_unittest.cc",
1544 "proxy/proxy_service_mojo_unittest.cc",
1550 "dns/mdns_cache_unittest.cc",
1551 "dns/mdns_client_unittest.cc",
1552 "dns/record_parsed_unittest.cc",
1553 "dns/record_rdata_unittest.cc",
1561 # 'action_name': 'copy_test_data',
1563 # 'test_data_files': [
1564 # 'data/ssl/certificates/',
1566 # 'data/url_request_unittest/',
1567 # 'data/verify_name_match_unittest/names/',
1568 # 'data/parse_certificate_unittest/',
1570 # 'test_data_prefix': 'net',
1572 # 'includes': [ '../build/copy_test_data_ios.gypi' ],
1576 # TODO(droger): The following tests are disabled because the
1577 # implementation is missing or incomplete.
1578 # KeygenHandler::GenKeyAndSignChallenge() is not ported to iOS.
1579 "base/keygen_handler_unittest.cc",
1580 "disk_cache/backend_unittest.cc",
1581 "disk_cache/blockfile/block_files_unittest.cc",
1583 # Need to read input data files.
1584 "filter/gzip_filter_unittest.cc",
1585 "socket/ssl_server_socket_unittest.cc",
1586 "spdy/fuzzing/hpack_fuzz_util_test.cc",
1589 "cert_net/cert_net_fetcher_impl_unittest.cc",
1590 "proxy/proxy_script_fetcher_impl_unittest.cc",
1591 "socket/ssl_client_socket_unittest.cc",
1592 "url_request/url_fetcher_impl_unittest.cc",
1593 "url_request/url_request_context_builder_unittest.cc",
1595 # Needs GetAppOutput().
1596 "test/python_utils_unittest.cc",
1598 # The following tests are disabled because they don't apply to
1600 # OS is not "linux" or "freebsd" or "openbsd".
1601 "socket/unix_domain_client_socket_posix_unittest.cc",
1602 "socket/unix_domain_server_socket_posix_unittest.cc",
1604 # See bug http://crbug.com/344533.
1605 "disk_cache/blockfile/index_table_v3_unittest.cc",
1611 # See bug http://crbug.com/344533.
1612 "disk_cache/blockfile/index_table_v3_unittest.cc",
1613 "dns/dns_config_service_posix_unittest.cc",
1616 ":net_test_jni_headers",
1618 # TODO(mmenke): This depends on test_support_base, which depends on
1619 # icu. Figure out a way to remove that dependency.
1620 "//testing/android/native_test:native_test_native_code",
1622 set_sources_assignment_filter([])
1623 sources += [ "base/address_tracker_linux_unittest.cc" ]
1624 set_sources_assignment_filter(sources_assignment_filter)
1625 isolate_file = "net_unittests.isolate"
1628 # Symbols for crashes when running tests on swarming.
1629 if (symbol_level > 0) {
1631 data += [ "$root_out_dir/net_unittests.exe.pdb" ]
1632 } else if (is_mac) {
1633 data += [ "$root_out_dir/net_unittests.dSYM/" ]
1638 # !is_android && !is_win && !is_mac
1640 executable("net_perftests") {
1643 "base/mime_sniffer_perftest.cc",
1644 "cookies/cookie_monster_perftest.cc",
1645 "disk_cache/blockfile/disk_cache_perftest.cc",
1646 "extras/sqlite/sqlite_persistent_cookie_store_perftest.cc",
1647 "proxy/proxy_resolver_perftest.cc",
1648 "udp/udp_socket_perftest.cc",
1651 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1652 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
1659 "//base/test:test_support_perf",
1660 "//build/config/sanitizers:deps",
1665 if (enable_websockets) {
1666 sources += [ "websockets/websocket_frame_perftest.cc" ]
1669 if (use_v8_in_net) {
1670 deps += [ ":net_with_v8" ]
1672 sources -= [ "proxy/proxy_resolver_perftest.cc" ]