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("//url/config.gni")
11 # TODO(cjhopman): //build/config/android/rules.gni also imports grit_rule.gni.
12 # Currently, that file can't be imported multiple times. Make this always
13 # imported when http://crbug.com/393704 is fixed.
15 import("//tools/grit/grit_rule.gni")
19 import("//build/config/android/config.gni")
20 import("//build/config/android/rules.gni")
22 import("//build/config/mac/mac_sdk.gni")
25 # The list of net files is kept in net.gypi. Read it.
26 gypi_values = exec_script("//build/gypi_to_gn.py",
27 [ rebase_path("net.gypi") ],
31 # Disable Kerberos on ChromeOS, Android and iOS, at least for now. It needs
32 # configuration (krb5.conf and so on).
33 use_kerberos = !is_chromeos && !is_android && !is_ios
35 # The way the cache uses mmap() is inefficient on some Android devices. If
36 # this flag is set, we hackily avoid using mmap() in the disk cache. We are
37 # pretty confident that mmap-ing the index would not hurt any existing x86
38 # android devices, but we cannot be so sure about the variety of ARM devices.
39 # So enable it for x86 only for now.
40 posix_avoid_mmap = is_android && cpu_arch != "x86"
42 # WebSockets and socket stream code are used everywhere except iOS.
43 enable_websockets = !is_ios
44 use_v8_in_net = !is_ios
45 enable_built_in_dns = !is_ios
46 disable_ftp_support = is_ios
49 # Disables support for file URLs. File URL support requires use of icu.
50 disable_file_support = false
53 config("net_config") {
55 if (posix_avoid_mmap) {
56 defines += [ "POSIX_AVOID_MMAP" ]
58 if (disable_file_support) {
59 defines += [ "DISABLE_FILE_SUPPORT" ]
63 # Disables Windows warning about size to int truncations.
64 # TODO(jschuh): crbug.com/167187 fix this and delete this config.
65 config("net_win_size_truncation") {
67 cflags = [ "/wd4267" ]
73 gypi_values.net_nacl_common_sources + gypi_values.net_non_nacl_sources
77 # TODO(GYP) Note that he GYP file supports linux_link_kerberos (defaults to
78 # 0) which implies that we run pkg_config on kerberos and link to that
79 # rather than setting this define which will dynamically open it. That
80 # doesn't seem to be set in the regular builds, so we're skipping this
85 configs += [ ":net_win_size_truncation" ]
86 public_configs = [ ":net_config" ]
98 "//base/third_party/dynamic_annotations",
99 "//net/base/registry_controlled_domains",
102 "//third_party/zlib",
107 defines += [ "USE_KERBEROS" ]
109 include_dirs += [ "/usr/include/kerberosV" ]
113 "http/http_auth_gssapi_posix.cc",
114 "http/http_auth_gssapi_posix.h",
115 "http/http_auth_handler_negotiate.h",
116 "http/http_auth_handler_negotiate.cc",
121 if (posix_avoid_mmap) {
122 sources -= [ "disk_cache/blockfile/mapped_file_posix.cc" ]
124 sources -= [ "disk_cache/blockfile/mapped_file_avoid_mmap_posix.cc" ]
128 if (disable_file_support) {
130 "base/directory_lister.cc",
131 "base/directory_lister.h",
132 "url_request/url_request_file_dir_job.cc",
133 "url_request/url_request_file_dir_job.h",
134 "url_request/url_request_file_job.cc",
135 "url_request/url_request_file_job.h",
136 "url_request/file_protocol_handler.cc",
137 "url_request/file_protocol_handler.h",
141 if (disable_ftp_support) {
143 "ftp/ftp_auth_cache.cc",
144 "ftp/ftp_auth_cache.h",
145 "ftp/ftp_ctrl_response_buffer.cc",
146 "ftp/ftp_ctrl_response_buffer.h",
147 "ftp/ftp_directory_listing_parser.cc",
148 "ftp/ftp_directory_listing_parser.h",
149 "ftp/ftp_directory_listing_parser_ls.cc",
150 "ftp/ftp_directory_listing_parser_ls.h",
151 "ftp/ftp_directory_listing_parser_netware.cc",
152 "ftp/ftp_directory_listing_parser_netware.h",
153 "ftp/ftp_directory_listing_parser_os2.cc",
154 "ftp/ftp_directory_listing_parser_os2.h",
155 "ftp/ftp_directory_listing_parser_vms.cc",
156 "ftp/ftp_directory_listing_parser_vms.h",
157 "ftp/ftp_directory_listing_parser_windows.cc",
158 "ftp/ftp_directory_listing_parser_windows.h",
159 "ftp/ftp_network_layer.cc",
160 "ftp/ftp_network_layer.h",
161 "ftp/ftp_network_session.cc",
162 "ftp/ftp_network_session.h",
163 "ftp/ftp_network_transaction.cc",
164 "ftp/ftp_network_transaction.h",
165 "ftp/ftp_request_info.h",
166 "ftp/ftp_response_info.cc",
167 "ftp/ftp_response_info.h",
168 "ftp/ftp_server_type_histograms.cc",
169 "ftp/ftp_server_type_histograms.h",
170 "ftp/ftp_transaction.h",
171 "ftp/ftp_transaction_factory.h",
174 "url_request/ftp_protocol_handler.cc",
175 "url_request/ftp_protocol_handler.h",
176 "url_request/url_request_ftp_job.cc",
177 "url_request/url_request_ftp_job.h",
181 if (enable_built_in_dns) {
182 defines += [ "ENABLE_BUILT_IN_DNS" ]
185 "dns/address_sorter_posix.cc",
186 "dns/address_sorter_posix.h",
195 "cert/ct_log_verifier_nss.cc",
196 "cert/ct_objects_extractor_nss.cc",
197 "cert/jwk_serializer_nss.cc",
198 "cert/scoped_nss_types.h",
199 "cert/test_root_certs_nss.cc",
200 "cert/x509_util_nss.cc",
201 "cert/x509_util_nss.h",
204 "quic/crypto/aead_base_decrypter_nss.cc",
205 "quic/crypto/aead_base_encrypter_nss.cc",
206 "quic/crypto/aes_128_gcm_12_decrypter_nss.cc",
207 "quic/crypto/aes_128_gcm_12_encrypter_nss.cc",
208 "quic/crypto/chacha20_poly1305_decrypter_nss.cc",
209 "quic/crypto/chacha20_poly1305_encrypter_nss.cc",
210 "quic/crypto/channel_id_nss.cc",
211 "quic/crypto/p256_key_exchange_nss.cc",
212 "socket/nss_ssl_util.cc",
213 "socket/nss_ssl_util.h",
214 "socket/ssl_client_socket_nss.cc",
215 "socket/ssl_client_socket_nss.h",
216 "socket/ssl_server_socket_nss.cc",
217 "socket/ssl_server_socket_nss.h",
221 "cert/nss_cert_database_chromeos.cc",
222 "cert/nss_cert_database_chromeos.h",
223 "cert/nss_profile_filter_chromeos.cc",
224 "cert/nss_profile_filter_chromeos.h",
228 # These are always removed for non-Linux cases below.
230 "base/crypto_module_nss.cc",
231 "base/keygen_handler_nss.cc",
232 "cert/cert_database_nss.cc",
233 "cert/nss_cert_database.cc",
234 "cert/nss_cert_database.h",
235 "cert/x509_certificate_nss.cc",
236 "third_party/mozilla_security_manager/nsKeygenHandler.cpp",
237 "third_party/mozilla_security_manager/nsKeygenHandler.h",
238 "third_party/mozilla_security_manager/nsNSSCertificateDB.cpp",
239 "third_party/mozilla_security_manager/nsNSSCertificateDB.h",
240 "third_party/mozilla_security_manager/nsPKCS12Blob.cpp",
241 "third_party/mozilla_security_manager/nsPKCS12Blob.h",
245 # Always removed for !ios below.
247 "cert/cert_verify_proc_nss.cc",
248 "cert/cert_verify_proc_nss.h",
252 sources -= [ "cert/sha256_legacy_support_nss_win.cc" ]
256 "base/crypto_module_openssl.cc",
257 "cert/ct_log_verifier_openssl.cc",
258 "cert/ct_objects_extractor_openssl.cc",
259 "cert/jwk_serializer_openssl.cc",
260 "cert/x509_util_openssl.cc",
261 "cert/x509_util_openssl.h",
262 "quic/crypto/aead_base_decrypter_openssl.cc",
263 "quic/crypto/aead_base_encrypter_openssl.cc",
264 "quic/crypto/aes_128_gcm_12_decrypter_openssl.cc",
265 "quic/crypto/aes_128_gcm_12_encrypter_openssl.cc",
266 "quic/crypto/chacha20_poly1305_decrypter_openssl.cc",
267 "quic/crypto/chacha20_poly1305_encrypter_openssl.cc",
268 "quic/crypto/channel_id_openssl.cc",
269 "quic/crypto/p256_key_exchange_openssl.cc",
270 "quic/crypto/scoped_evp_aead_ctx.cc",
271 "quic/crypto/scoped_evp_aead_ctx.h",
272 "socket/ssl_client_socket_openssl.cc",
273 "socket/ssl_client_socket_openssl.h",
274 "socket/ssl_server_socket_openssl.cc",
275 "socket/ssl_server_socket_openssl.h",
276 "socket/ssl_session_cache_openssl.cc",
277 "socket/ssl_session_cache_openssl.h",
278 "ssl/openssl_platform_key.h",
279 "ssl/openssl_ssl_util.cc",
280 "ssl/openssl_ssl_util.h",
283 sources -= [ "ssl/openssl_platform_key_mac.cc" ]
287 "cert/sha256_legacy_support_openssl_win.cc",
288 "ssl/openssl_platform_key_win.cc",
293 if (!use_openssl_certs) {
295 "base/keygen_handler_openssl.cc",
296 "base/openssl_private_key_store.h",
297 "base/openssl_private_key_store_memory.cc",
298 "cert/cert_database_openssl.cc",
299 "cert/cert_verify_proc_openssl.cc",
300 "cert/cert_verify_proc_openssl.h",
301 "cert/test_root_certs_openssl.cc",
302 "cert/x509_certificate_openssl.cc",
303 "ssl/openssl_client_key_store.cc",
304 "ssl/openssl_client_key_store.h",
307 sources -= [ "base/openssl_private_key_store_android.cc" ]
309 } else if (is_android) {
310 # Android doesn't use these even when using OpenSSL.
312 "base/openssl_private_key_store_memory.cc",
313 "cert/cert_database_openssl.cc",
314 "cert/cert_verify_proc_openssl.cc",
315 "cert/test_root_certs_openssl.cc",
319 if (use_glib && !is_chromeos) {
320 configs += [ "//build/config/linux:gconf" ]
321 deps += [ "//build/config/linux:gio" ]
325 configs += [ "//build/config/linux:libresolv" ]
328 "base/crypto_module_nss.cc",
329 "base/keygen_handler_nss.cc",
330 "cert/cert_database_nss.cc",
331 "cert/nss_cert_database.cc",
332 "cert/nss_cert_database.h",
333 "cert/x509_certificate_nss.cc",
334 "third_party/mozilla_security_manager/nsKeygenHandler.cpp",
335 "third_party/mozilla_security_manager/nsKeygenHandler.h",
336 "third_party/mozilla_security_manager/nsNSSCertificateDB.cpp",
337 "third_party/mozilla_security_manager/nsNSSCertificateDB.h",
338 "third_party/mozilla_security_manager/nsPKCS12Blob.cpp",
339 "third_party/mozilla_security_manager/nsPKCS12Blob.h",
342 if (!is_ios && !use_openssl) {
343 # These files are part of the partial implementation of NSS on iOS so
344 # keep them in that case.
346 "cert/test_root_certs_nss.cc",
353 if (!use_nss_certs) {
355 "ssl/client_cert_store_nss.cc",
356 "ssl/client_cert_store_nss.h",
359 # These files are part of the partial implementation of NSS on iOS so
360 # keep them in that case (even though use_nss_certs is not set).
362 "cert/cert_verify_proc_nss.cc",
363 "cert/cert_verify_proc_nss.h",
367 # These were already removed on non-ChromeOS.
369 "ssl/client_cert_store_chromeos.cc",
370 "ssl/client_cert_store_chromeos.h",
375 if (!enable_websockets) {
377 "websockets/websocket_basic_handshake_stream.cc",
378 "websockets/websocket_basic_handshake_stream.h",
379 "websockets/websocket_basic_stream.cc",
380 "websockets/websocket_basic_stream.h",
381 "websockets/websocket_channel.cc",
382 "websockets/websocket_channel.h",
383 "websockets/websocket_deflate_predictor.h",
384 "websockets/websocket_deflate_predictor_impl.cc",
385 "websockets/websocket_deflate_predictor_impl.h",
386 "websockets/websocket_deflate_stream.cc",
387 "websockets/websocket_deflate_stream.h",
388 "websockets/websocket_deflater.cc",
389 "websockets/websocket_deflater.h",
390 "websockets/websocket_errors.cc",
391 "websockets/websocket_errors.h",
392 "websockets/websocket_extension.cc",
393 "websockets/websocket_extension.h",
394 "websockets/websocket_extension_parser.cc",
395 "websockets/websocket_extension_parser.h",
396 "websockets/websocket_frame.cc",
397 "websockets/websocket_frame.h",
398 "websockets/websocket_frame_parser.cc",
399 "websockets/websocket_frame_parser.h",
400 "websockets/websocket_handshake_constants.cc",
401 "websockets/websocket_handshake_constants.h",
402 "websockets/websocket_handshake_challenge.cc",
403 "websockets/websocket_handshake_challenge.h",
404 "websockets/websocket_handshake_request_info.cc",
405 "websockets/websocket_handshake_request_info.h",
406 "websockets/websocket_handshake_response_info.cc",
407 "websockets/websocket_handshake_response_info.h",
408 "websockets/websocket_handshake_stream_base.h",
409 "websockets/websocket_handshake_stream_create_helper.cc",
410 "websockets/websocket_handshake_stream_create_helper.h",
411 "websockets/websocket_inflater.cc",
412 "websockets/websocket_inflater.h",
413 "websockets/websocket_mux.h",
414 "websockets/websocket_stream.cc",
415 "websockets/websocket_stream.h",
423 "dns/mdns_client.cc",
425 "dns/mdns_client_impl.cc",
426 "dns/mdns_client_impl.h",
427 "dns/record_parsed.cc",
428 "dns/record_parsed.h",
429 "dns/record_rdata.cc",
430 "dns/record_rdata.h",
436 "http/http_auth_handler_ntlm_portable.cc",
437 "socket/socket_libevent.cc",
438 "socket/socket_libevent.h",
439 "socket/tcp_socket_libevent.cc",
440 "socket/tcp_socket_libevent.h",
441 "udp/udp_socket_libevent.cc",
442 "udp/udp_socket_libevent.h",
446 "base/winsock_init.cc",
447 "base/winsock_init.h",
448 "base/winsock_util.cc",
449 "base/winsock_util.h",
450 "proxy/proxy_resolver_winhttp.cc",
451 "proxy/proxy_resolver_winhttp.h",
457 "Foundation.framework",
458 "Security.framework",
459 "SystemConfiguration.framework",
465 # Add back some sources that were otherwise filtered out. iOS additionally
466 # doesn't set USE_NSS but needs some of the files.
467 set_sources_assignment_filter([])
469 "base/net_util_mac.cc",
470 "base/net_util_mac.h",
471 "base/network_change_notifier_mac.cc",
472 "base/network_config_watcher_mac.cc",
473 "base/platform_mime_util_mac.mm",
474 "cert/cert_verify_proc_nss.cc",
475 "cert/cert_verify_proc_nss.h",
476 "cert/test_root_certs_nss.cc",
477 "cert/x509_util_nss.cc",
478 "cert/x509_util_nss.h",
479 "proxy/proxy_resolver_mac.cc",
480 "proxy/proxy_server_mac.cc",
484 set_sources_assignment_filter(sources_assignment_filter)
486 sources -= [ "disk_cache/blockfile/file_posix.cc" ]
488 "CFNetwork.framework",
489 "MobileCoreServices.framework",
490 "Security.framework",
491 "SystemConfiguration.framework",
496 if (is_ios || is_mac) {
497 sources += gypi_values.net_base_mac_ios_sources
501 # Add some Linux sources that were excluded by the filter, but which
503 set_sources_assignment_filter([])
505 "base/platform_mime_util_linux.cc",
506 "base/address_tracker_linux.cc",
507 "base/address_tracker_linux.h",
508 "base/net_util_linux.cc",
509 "base/net_util_linux.h",
511 set_sources_assignment_filter(sources_assignment_filter)
513 if (!is_android_webview_build) {
514 deps += [ ":net_jni_headers" ]
518 if (use_icu_alternatives_on_android) {
524 "base/filename_util_icu.cc",
525 "base/net_string_util_icu.cc",
526 "base/net_util_icu.cc",
529 "base/net_string_util_icu_alternatives_android.cc",
530 "base/net_string_util_icu_alternatives_android.h",
535 grit("net_resources") {
536 source = "base/net_resources.grd"
537 use_qualified_include = true
539 "grit/net_resources.h",
545 static_library("extras") {
546 sources = gypi_values.net_extras_sources
547 configs += [ "//build/config/compiler:wexit_time_destructors" ]
554 static_library("http_server") {
556 "server/http_connection.cc",
557 "server/http_connection.h",
558 "server/http_server.cc",
559 "server/http_server.h",
560 "server/http_server_request_info.cc",
561 "server/http_server_request_info.h",
562 "server/http_server_response_info.cc",
563 "server/http_server_response_info.h",
564 "server/web_socket.cc",
565 "server/web_socket.h",
566 "server/web_socket_encoder.cc",
567 "server/web_socket_encoder.h",
570 "//build/config/compiler:wexit_time_destructors",
571 ":net_win_size_truncation",
579 executable("dump_cache") {
582 "tools/dump_cache/cache_dumper.cc",
583 "tools/dump_cache/cache_dumper.h",
584 "tools/dump_cache/dump_cache.cc",
585 "tools/dump_cache/dump_files.cc",
586 "tools/dump_cache/dump_files.h",
587 "tools/dump_cache/simple_cache_dumper.cc",
588 "tools/dump_cache/simple_cache_dumper.h",
589 "tools/dump_cache/url_to_filename_encoder.cc",
590 "tools/dump_cache/url_to_filename_encoder.h",
591 "tools/dump_cache/url_utilities.h",
592 "tools/dump_cache/url_utilities.cc",
595 configs += [ ":net_win_size_truncation" ]
604 source_set("test_support") {
607 "base/captured_net_log_entry.cc",
608 "base/captured_net_log_entry.h",
609 "base/capturing_net_log.cc",
610 "base/capturing_net_log.h",
611 "base/capturing_net_log_observer.cc",
612 "base/capturing_net_log_observer.h",
613 "base/load_timing_info_test_util.cc",
614 "base/load_timing_info_test_util.h",
615 "base/mock_file_stream.cc",
616 "base/mock_file_stream.h",
617 "base/test_completion_callback.cc",
618 "base/test_completion_callback.h",
619 "base/test_data_directory.cc",
620 "base/test_data_directory.h",
621 "cert/mock_cert_verifier.cc",
622 "cert/mock_cert_verifier.h",
623 "cookies/cookie_monster_store_test.cc",
624 "cookies/cookie_monster_store_test.h",
625 "cookies/cookie_store_test_callbacks.cc",
626 "cookies/cookie_store_test_callbacks.h",
627 "cookies/cookie_store_test_helpers.cc",
628 "cookies/cookie_store_test_helpers.h",
629 "disk_cache/disk_cache_test_base.cc",
630 "disk_cache/disk_cache_test_base.h",
631 "disk_cache/disk_cache_test_util.cc",
632 "disk_cache/disk_cache_test_util.h",
633 "dns/dns_test_util.cc",
634 "dns/dns_test_util.h",
635 "dns/mock_host_resolver.cc",
636 "dns/mock_host_resolver.h",
637 "dns/mock_mdns_socket_factory.cc",
638 "dns/mock_mdns_socket_factory.h",
639 "http/http_transaction_test_util.cc",
640 "http/http_transaction_test_util.h",
641 "proxy/mock_proxy_resolver.cc",
642 "proxy/mock_proxy_resolver.h",
643 "proxy/mock_proxy_script_fetcher.cc",
644 "proxy/mock_proxy_script_fetcher.h",
645 "proxy/proxy_config_service_common_unittest.cc",
646 "proxy/proxy_config_service_common_unittest.h",
647 "socket/socket_test_util.cc",
648 "socket/socket_test_util.h",
649 "test/cert_test_util.cc",
650 "test/cert_test_util.h",
651 "test/cert_test_util_nss.cc",
652 "test/ct_test_util.cc",
653 "test/ct_test_util.h",
654 "test/embedded_test_server/embedded_test_server.cc",
655 "test/embedded_test_server/embedded_test_server.h",
656 "test/embedded_test_server/http_connection.cc",
657 "test/embedded_test_server/http_connection.h",
658 "test/embedded_test_server/http_request.cc",
659 "test/embedded_test_server/http_request.h",
660 "test/embedded_test_server/http_response.cc",
661 "test/embedded_test_server/http_response.h",
662 "test/net_test_suite.cc",
663 "test/net_test_suite.h",
664 "test/python_utils.cc",
665 "test/python_utils.h",
666 "test/spawned_test_server/base_test_server.cc",
667 "test/spawned_test_server/base_test_server.h",
668 "test/spawned_test_server/local_test_server_posix.cc",
669 "test/spawned_test_server/local_test_server_win.cc",
670 "test/spawned_test_server/local_test_server.cc",
671 "test/spawned_test_server/local_test_server.h",
672 "test/spawned_test_server/remote_test_server.cc",
673 "test/spawned_test_server/remote_test_server.h",
674 "test/spawned_test_server/spawned_test_server.h",
675 "test/spawned_test_server/spawner_communicator.cc",
676 "test/spawned_test_server/spawner_communicator.h",
677 "test/url_request/url_request_failed_job.cc",
678 "test/url_request/url_request_failed_job.h",
679 "test/url_request/url_request_mock_data_job.cc",
680 "test/url_request/url_request_mock_data_job.h",
681 "test/url_request/url_request_mock_http_job.cc",
682 "test/url_request/url_request_mock_http_job.h",
683 "url_request/test_url_fetcher_factory.cc",
684 "url_request/test_url_fetcher_factory.h",
685 "url_request/test_url_request_interceptor.cc",
686 "url_request/test_url_request_interceptor.h",
687 "url_request/url_request_test_util.cc",
688 "url_request/url_request_test_util.h",
691 configs += [ ":net_win_size_truncation" ]
695 "//base/test:test_support",
698 "//net/tools/tld_cleanup",
704 if (!use_openssl && (use_nss_certs || is_ios)) {
705 public_deps += [ "//crypto:platform" ]
710 "test/spawned_test_server/remote_test_server.cc",
711 "test/spawned_test_server/remote_test_server.h",
712 "test/spawned_test_server/spawner_communicator.cc",
713 "test/spawned_test_server/spawner_communicator.h",
718 public_deps += [ ":net_with_v8" ]
723 "dns/mock_mdns_socket_factory.cc",
724 "dns/mock_mdns_socket_factory.h",
728 if (!use_nss_certs) {
729 sources -= [ "test/cert_test_util_nss.cc" ]
733 source_set("balsa") {
735 "tools/balsa/balsa_enums.h",
736 "tools/balsa/balsa_frame.cc",
737 "tools/balsa/balsa_frame.h",
738 "tools/balsa/balsa_headers.cc",
739 "tools/balsa/balsa_headers.h",
740 "tools/balsa/balsa_headers_token_utils.cc",
741 "tools/balsa/balsa_headers_token_utils.h",
742 "tools/balsa/balsa_visitor_interface.h",
743 "tools/balsa/http_message_constants.cc",
744 "tools/balsa/http_message_constants.h",
745 "tools/balsa/noop_balsa_visitor.h",
746 "tools/balsa/simple_buffer.cc",
747 "tools/balsa/simple_buffer.h",
748 "tools/balsa/split.cc",
749 "tools/balsa/split.h",
750 "tools/balsa/string_piece_utils.h",
751 "tools/quic/spdy_utils.cc",
752 "tools/quic/spdy_utils.h",
762 component("net_with_v8") {
764 "proxy/proxy_resolver_v8.cc",
765 "proxy/proxy_resolver_v8.h",
766 "proxy/proxy_resolver_v8_tracing.cc",
767 "proxy/proxy_resolver_v8_tracing.h",
768 "proxy/proxy_service_v8.cc",
769 "proxy/proxy_service_v8.h",
772 defines = [ "NET_IMPLEMENTATION" ]
774 ":net_win_size_truncation",
775 "//build/config/compiler:wexit_time_destructors",
790 if (!is_ios && !is_android) {
791 executable("crash_cache") {
794 "tools/crash_cache/crash_cache.cc",
796 configs += [ ":net_win_size_truncation" ]
804 executable("crl_set_dump") {
807 "tools/crl_set_dump/crl_set_dump.cc",
809 configs += [ ":net_win_size_truncation" ]
816 executable("dns_fuzz_stub") {
819 "tools/dns_fuzz_stub/dns_fuzz_stub.cc",
821 configs += [ ":net_win_size_truncation" ]
831 "tools/gdig/file_net_log.cc",
832 "tools/gdig/gdig.cc",
840 executable("get_server_time") {
843 "tools/get_server_time/get_server_time.cc",
845 configs += [ ":net_win_size_truncation" ]
855 executable("net_watcher") {
858 "tools/net_watcher/net_watcher.cc",
866 if (is_desktop_linux) {
868 "//build/config/linux:gconf",
869 "//build/config/linux:glib",
871 deps += [ "//build/config/linux:gio" ]
876 executable("run_testserver") {
879 "tools/testserver/run_testserver.cc",
882 ":net", # TODO(brettw) bug 363749: this shouldn't be necessary. It's not
883 # in the GYP build, and can be removed when the bug is fixed.
886 "//base/test:test_support",
891 executable("stress_cache") {
894 "disk_cache/blockfile/stress_cache.cc",
896 configs += [ ":net_win_size_truncation" ]
904 executable("tld_cleanup") {
906 "tools/tld_cleanup/tld_cleanup.cc",
908 configs += [ ":net_win_size_truncation" ]
912 "//net/tools/tld_cleanup",
918 static_library("epoll_server") {
920 "tools/epoll_server/epoll_server.cc",
921 "tools/epoll_server/epoll_server.h",
929 static_library("flip_in_mem_edsm_server_base") {
932 "tools/dump_cache/url_to_filename_encoder.cc",
933 "tools/dump_cache/url_to_filename_encoder.h",
934 "tools/dump_cache/url_utilities.h",
935 "tools/dump_cache/url_utilities.cc",
936 "tools/flip_server/acceptor_thread.h",
937 "tools/flip_server/acceptor_thread.cc",
938 "tools/flip_server/create_listener.cc",
939 "tools/flip_server/create_listener.h",
940 "tools/flip_server/constants.h",
941 "tools/flip_server/flip_config.cc",
942 "tools/flip_server/flip_config.h",
943 "tools/flip_server/http_interface.cc",
944 "tools/flip_server/http_interface.h",
945 "tools/flip_server/loadtime_measurement.h",
946 "tools/flip_server/mem_cache.h",
947 "tools/flip_server/mem_cache.cc",
948 "tools/flip_server/output_ordering.cc",
949 "tools/flip_server/output_ordering.h",
950 "tools/flip_server/ring_buffer.cc",
951 "tools/flip_server/ring_buffer.h",
952 "tools/flip_server/sm_connection.cc",
953 "tools/flip_server/sm_connection.h",
954 "tools/flip_server/sm_interface.h",
955 "tools/flip_server/spdy_ssl.cc",
956 "tools/flip_server/spdy_ssl.h",
957 "tools/flip_server/spdy_interface.cc",
958 "tools/flip_server/spdy_interface.h",
959 "tools/flip_server/spdy_util.cc",
960 "tools/flip_server/spdy_util.h",
961 "tools/flip_server/streamer_interface.cc",
962 "tools/flip_server/streamer_interface.h",
969 "//third_party/boringssl",
973 executable("flip_in_mem_edsm_server_unittests") {
976 "tools/flip_server/flip_test_utils.cc",
977 "tools/flip_server/flip_test_utils.h",
978 "tools/flip_server/http_interface_test.cc",
979 "tools/flip_server/mem_cache_test.cc",
980 "tools/flip_server/run_all_tests.cc",
981 "tools/flip_server/spdy_interface_test.cc",
984 ":flip_in_mem_edsm_server_base",
989 "//third_party/boringssl",
993 executable("flip_in_mem_edsm_server") {
996 "tools/flip_server/flip_in_mem_edsm_server.cc",
999 ":flip_in_mem_edsm_server_base",
1005 source_set("quic_base") {
1007 "tools/quic/quic_client.cc",
1008 "tools/quic/quic_client.h",
1009 "tools/quic/quic_client_session.cc",
1010 "tools/quic/quic_client_session.h",
1011 "tools/quic/quic_default_packet_writer.cc",
1012 "tools/quic/quic_default_packet_writer.h",
1013 "tools/quic/quic_dispatcher.h",
1014 "tools/quic/quic_dispatcher.cc",
1015 "tools/quic/quic_epoll_clock.cc",
1016 "tools/quic/quic_epoll_clock.h",
1017 "tools/quic/quic_epoll_connection_helper.cc",
1018 "tools/quic/quic_epoll_connection_helper.h",
1019 "tools/quic/quic_in_memory_cache.cc",
1020 "tools/quic/quic_in_memory_cache.h",
1021 "tools/quic/quic_packet_writer_wrapper.cc",
1022 "tools/quic/quic_packet_writer_wrapper.h",
1023 "tools/quic/quic_per_connection_packet_writer.cc",
1024 "tools/quic/quic_per_connection_packet_writer.h",
1025 "tools/quic/quic_server.cc",
1026 "tools/quic/quic_server.h",
1027 "tools/quic/quic_server_session.cc",
1028 "tools/quic/quic_server_session.h",
1029 "tools/quic/quic_socket_utils.cc",
1030 "tools/quic/quic_socket_utils.h",
1031 "tools/quic/quic_spdy_client_stream.cc",
1032 "tools/quic/quic_spdy_client_stream.h",
1033 "tools/quic/quic_spdy_server_stream.cc",
1034 "tools/quic/quic_spdy_server_stream.h",
1035 "tools/quic/quic_time_wait_list_manager.h",
1036 "tools/quic/quic_time_wait_list_manager.cc",
1043 "//base/third_party/dynamic_annotations",
1045 "//third_party/boringssl",
1050 executable("quic_client") {
1052 "tools/quic/quic_client_bin.cc",
1058 "//third_party/boringssl",
1064 generate_jni("net_jni_headers") {
1066 "android/java/src/org/chromium/net/AndroidCertVerifyResult.java",
1067 "android/java/src/org/chromium/net/AndroidKeyStore.java",
1068 "android/java/src/org/chromium/net/AndroidNetworkLibrary.java",
1069 "android/java/src/org/chromium/net/AndroidPrivateKey.java",
1070 "android/java/src/org/chromium/net/GURLUtils.java",
1071 "android/java/src/org/chromium/net/NetworkChangeNotifier.java",
1072 "android/java/src/org/chromium/net/ProxyChangeListener.java",
1073 "android/java/src/org/chromium/net/X509Util.java",
1077 generate_jni("net_test_jni_headers") {
1079 "android/javatests/src/org/chromium/net/AndroidKeyStoreTestUtil.java",
1085 if (is_android || is_linux) {
1086 executable("disk_cache_memory_test") {
1089 "tools/disk_cache_memory_test/disk_cache_memory_test.cc",
1098 # TODO(GYP) make this compile on Android, we need some native test deps done.
1099 # TODO(GYP) Also doesn't work on Windows; dependency on boringssl is wrong.
1100 # TODO(GYP) Also doesn't work on Mac, need to figure out why not.
1101 if (!is_android && !is_win && !is_mac) {
1102 source_set("quic_tools") {
1104 "quic/quic_dispatcher.cc",
1105 "quic/quic_dispatcher.h",
1106 "quic/quic_in_memory_cache.cc",
1107 "quic/quic_in_memory_cache.h",
1108 "quic/quic_per_connection_packet_writer.cc",
1109 "quic/quic_per_connection_packet_writer.h",
1110 "quic/quic_server.cc",
1111 "quic/quic_server.h",
1112 "quic/quic_server_packet_writer.cc",
1113 "quic/quic_server_packet_writer.h",
1114 "quic/quic_server_session.cc",
1115 "quic/quic_server_session.h",
1116 "quic/quic_spdy_server_stream.cc",
1117 "quic/quic_spdy_server_stream.h",
1118 "quic/quic_time_wait_list_manager.cc",
1119 "quic/quic_time_wait_list_manager.h",
1124 "//base/third_party/dynamic_annotations",
1129 test("net_unittests") {
1130 sources = gypi_values.net_test_sources
1132 configs += [ ":net_win_size_truncation" ]
1143 "//base:prefs_test_support",
1145 "//base/third_party/dynamic_annotations",
1147 "//crypto:platform",
1148 "//crypto:test_support",
1149 "//net/base/registry_controlled_domains",
1152 "//third_party/zlib",
1157 sources += gypi_values.net_linux_test_sources
1161 ":flip_in_mem_edsm_server_base",
1166 if (is_mac || is_ios) {
1167 sources += gypi_values.net_base_test_mac_ios_sources
1171 sources -= [ "proxy/proxy_config_service_linux_unittest.cc" ]
1176 # See bug http://crbug.com/344533.
1177 "disk_cache/blockfile/index_table_v3_unittest.cc",
1179 # No res_ninit() et al on Android, so this doesn't make a lot of
1181 "dns/dns_config_service_posix_unittest.cc",
1184 ":net_javatests", # FIXME(brettw)
1185 ":net_test_jni_headers",
1189 if (v8_use_external_startup_data) {
1193 if (!use_nss_certs) {
1194 sources -= [ "ssl/client_cert_store_nss_unittest.cc" ]
1195 if (is_chromeos) { # Already removed for all non-ChromeOS builds.
1196 sources -= [ "ssl/client_cert_store_chromeos_unittest.cc" ]
1201 # When building for OpenSSL, we need to exclude NSS specific tests
1202 # or functionality not supported by OpenSSL yet.
1203 # TODO(bulach): Add equivalent tests when the underlying
1204 # functionality is ported to OpenSSL.
1206 "cert/nss_cert_database_unittest.cc",
1207 "cert/x509_util_nss_unittest.cc",
1208 "quic/test_tools/crypto_test_utils_nss.cc",
1211 # These were already removed in the non-ChromeOS case.
1213 "cert/nss_cert_database_chromeos_unittest.cc",
1214 "cert/nss_profile_filter_chromeos_unittest.cc",
1219 "cert/x509_util_openssl_unittest.cc",
1220 "quic/test_tools/crypto_test_utils_openssl.cc",
1221 "socket/ssl_client_socket_openssl_unittest.cc",
1222 "socket/ssl_session_cache_openssl_unittest.cc",
1224 if (!is_desktop_linux && !is_chromeos) {
1225 sources -= [ "cert/nss_cert_database_unittest.cc" ]
1230 defines += [ "USE_KERBEROS" ]
1233 "http/http_auth_gssapi_posix_unittest.cc",
1234 "http/http_auth_handler_negotiate_unittest.cc",
1235 "http/mock_gssapi_library_posix.cc",
1236 "http/mock_gssapi_library_posix.h",
1240 if (use_openssl || (!is_desktop_linux && !is_chromeos && !is_ios)) {
1241 # Only include this test when on Posix and using NSS for
1242 # cert verification or on iOS (which also uses NSS for certs).
1243 sources -= [ "ocsp/nss_ocsp_unittest.cc" ]
1246 if (!use_openssl_certs) {
1247 sources -= [ "ssl/openssl_client_key_store_unittest.cc" ]
1250 if (!enable_websockets) {
1252 "server/http_connection_unittest.cc",
1253 "server/http_server_response_info_unittest.cc",
1254 "server/http_server_unittest.cc",
1255 "server/web_socket_encoder_unittest.cc",
1256 "websockets/websocket_basic_stream_test.cc",
1257 "websockets/websocket_channel_test.cc",
1258 "websockets/websocket_deflate_predictor_impl_test.cc",
1259 "websockets/websocket_deflate_stream_test.cc",
1260 "websockets/websocket_deflater_test.cc",
1261 "websockets/websocket_errors_test.cc",
1262 "websockets/websocket_extension_parser_test.cc",
1263 "websockets/websocket_frame_parser_test.cc",
1264 "websockets/websocket_frame_test.cc",
1265 "websockets/websocket_handshake_challenge_test.cc",
1266 "websockets/websocket_handshake_stream_create_helper_test.cc",
1267 "websockets/websocket_inflater_test.cc",
1268 "websockets/websocket_stream_test.cc",
1269 "websockets/websocket_test_util.cc",
1270 "websockets/websocket_test_util.h",
1272 deps -= [ ":http_server" ]
1275 if (disable_file_support) {
1277 "base/directory_lister_unittest.cc",
1278 "url_request/url_request_file_job_unittest.cc",
1282 if (disable_ftp_support) {
1284 "ftp/ftp_auth_cache_unittest.cc",
1285 "ftp/ftp_ctrl_response_buffer_unittest.cc",
1286 "ftp/ftp_directory_listing_parser_ls_unittest.cc",
1287 "ftp/ftp_directory_listing_parser_netware_unittest.cc",
1288 "ftp/ftp_directory_listing_parser_os2_unittest.cc",
1289 "ftp/ftp_directory_listing_parser_unittest.cc",
1290 "ftp/ftp_directory_listing_parser_unittest.h",
1291 "ftp/ftp_directory_listing_parser_vms_unittest.cc",
1292 "ftp/ftp_directory_listing_parser_windows_unittest.cc",
1293 "ftp/ftp_network_transaction_unittest.cc",
1294 "ftp/ftp_util_unittest.cc",
1295 "url_request/url_request_ftp_job_unittest.cc",
1299 if (!enable_built_in_dns) {
1301 "dns/address_sorter_posix_unittest.cc",
1302 "dns/address_sorter_unittest.cc",
1306 # Always need use_v8_in_net to be 1 to run on Android, so just remove
1307 # net_unittest's dependency on v8 when using icu alternatives instead of
1308 # setting use_v8_in_net to 0.
1309 if (use_v8_in_net && !use_icu_alternatives_on_android) {
1310 deps += [ ":net_with_v8" ]
1313 "proxy/proxy_resolver_v8_unittest.cc",
1314 "proxy/proxy_resolver_v8_tracing_unittest.cc",
1320 "dns/mdns_cache_unittest.cc",
1321 "dns/mdns_client_unittest.cc",
1322 "dns/record_parsed_unittest.cc",
1323 "dns/record_rdata_unittest.cc",
1331 # 'action_name': 'copy_test_data',
1333 # 'test_data_files': [
1334 # 'data/ssl/certificates/',
1336 # 'data/url_request_unittest/',
1338 # 'test_data_prefix': 'net',
1340 # 'includes': [ '../build/copy_test_data_ios.gypi' ],
1344 # TODO(droger): The following tests are disabled because the
1345 # implementation is missing or incomplete.
1346 # KeygenHandler::GenKeyAndSignChallenge() is not ported to iOS.
1347 "base/keygen_handler_unittest.cc",
1348 "disk_cache/backend_unittest.cc",
1349 "disk_cache/blockfile/block_files_unittest.cc",
1351 # Need to read input data files.
1352 "filter/gzip_filter_unittest.cc",
1353 "socket/ssl_server_socket_unittest.cc",
1354 "spdy/fuzzing/hpack_fuzz_util_test.cc",
1357 "proxy/proxy_script_fetcher_impl_unittest.cc",
1358 "socket/ssl_client_socket_unittest.cc",
1359 "url_request/url_fetcher_impl_unittest.cc",
1360 "url_request/url_request_context_builder_unittest.cc",
1362 # Needs GetAppOutput().
1363 "test/python_utils_unittest.cc",
1365 # The following tests are disabled because they don't apply to
1367 # OS is not "linux" or "freebsd" or "openbsd".
1368 "socket/unix_domain_client_socket_posix_unittest.cc",
1369 "socket/unix_domain_listen_socket_posix_unittest.cc",
1370 "socket/unix_domain_server_socket_posix_unittest.cc",
1372 # See bug http://crbug.com/344533.
1373 "disk_cache/blockfile/index_table_v3_unittest.cc",
1378 sources -= [ "dns/dns_config_service_posix_unittest.cc" ]
1381 # # TODO(mmenke): This depends on test_support_base, which depends on
1382 # # icu. Figure out a way to remove that dependency.
1384 # '../testing/android/native_test.gyp:native_test_native_code',
1387 set_sources_assignment_filter([])
1388 sources += [ "base/address_tracker_linux_unittest.cc" ]
1389 set_sources_assignment_filter(sources_assignment_filter)
1392 if (use_icu_alternatives_on_android) {
1394 "base/filename_util_unittest.cc",
1395 "base/net_util_icu_unittest.cc",
1397 deps -= [ "//base:i18n" ]
1401 executable("quic_server") {
1403 "quic/quic_server_bin.cc",
1409 "//third_party/boringssl",
1412 } # !is_android && !is_win && !is_mac