Land Recent QUIC Changes.
[chromium-blink-merge.git] / net / BUILD.gn
bloba6760e4fc5da665697d46f3f1c1fc544e492c72c
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("//tools/grit/grit_rule.gni")
10 if (is_android) {
11   import("//build/config/android/config.gni")
12 } else if (is_mac) {
13   import("//build/config/mac/mac_sdk.gni")
16 # The list of net files is kept in net.gypi. Read it.
17 gypi_values = exec_script(
18     "//build/gypi_to_gn.py",
19     [ rebase_path("net.gypi") ],
20     "scope",
21     [ "net.gypi" ])
23 # Disable Kerberos on ChromeOS, Android and iOS, at least for now. It needs
24 # configuration (krb5.conf and so on).
25 use_kerberos = !is_chromeos && !is_android && !is_ios
27 # The way the cache uses mmap() is inefficient on some Android devices. If
28 # this flag is set, we hackily avoid using mmap() in the disk cache. We are
29 # pretty confident that mmap-ing the index would not hurt any existing x86
30 # android devices, but we cannot be so sure about the variety of ARM devices.
31 # So enable it for x86 only for now.
32 posix_avoid_mmap = is_android && cpu_arch != "x86"
34 # WebSockets and socket stream code are used everywhere except iOS.
35 enable_websockets = !is_ios
36 # TODO(brettw) put back to "!is_ios" when v8 is supported in GN build.
37 use_v8_in_net = false  # TODO(brettw)!is_ios
38 enable_built_in_dns = !is_ios
40 declare_args() {\r
41   # Disables support for file URLs.  File URL support requires use of icu.\r
42   disable_file_support = false\r
43 }\r
45 enable_ftp_support = !is_ios
47 config("net_config") {
48   defines = []
49   if (posix_avoid_mmap) {
50     defines += [ "POSIX_AVOID_MMAP" ]
51   }
52   if (disable_file_support) {
53     defines += [ "DISABLE_FILE_SUPPORT" ]
54   }
57 # Disables Windows warning about size to int truncations.
58 # TODO(jschuh): crbug.com/167187 fix this and delete this config.
59 config("net_win_size_truncation") {
60   if (is_win) {
61     cflags = [ "/wd4267" ]
62   }
65 component("net") {
66   sources =
67     gypi_values.net_nacl_common_sources +
68     gypi_values.net_non_nacl_sources
70   cflags = []
71   defines = [
72     # TODO(GYP) Note that he GYP file supports linux_link_kerberos (defaults to
73     # 0) which implies that we run pkg_config on kerberos and link to that
74     # rather than setting this define which will dynamically open it. That
75     # doesn't seem to be set in the regular builds, so we're skipping this
76     # capability here.
77     "DLOPEN_KERBEROS",
78     "NET_IMPLEMENTATION"
79   ]
80   configs += [ ":net_win_size_truncation" ]
81   direct_dependent_configs = [ ":net_config" ]
82   include_dirs = []
84   deps = [
85     ":net_resources",
86     "//base",
87     "//base:i18n",
88     "//base/third_party/dynamic_annotations",
89     "//crypto",
90     "//crypto:platform",
91     "//sdch",
92     "//third_party/icu",
93     "//third_party/zlib",
94     "//url",
95   ]
97   if (use_kerberos) {
98     defines += [ "USE_KERBEROS" ]
99     if (is_android) {
100       include_dirs += [ "/usr/include/kerberosV" ]
101     }
102   } else {
103     sources -= [
104       "http/http_auth_gssapi_posix.cc",
105       "http/http_auth_gssapi_posix.h",
106       "http/http_auth_handler_negotiate.h",
107       "http/http_auth_handler_negotiate.cc",
108     ]
109   }
111   if (is_posix) {
112     if (posix_avoid_mmap) {
113       sources -= [ "disk_cache/blockfile/mapped_file_posix.cc" ]
114     } else {
115       sources -= [ "disk_cache/blockfile/mapped_file_avoid_mmap_posix.cc" ]
116     }
117   }
119   if (disable_file_support) {
120     sources -= [
121       "base/directory_lister.cc",
122       "base/directory_lister.h",
123       "url_request/url_request_file_dir_job.cc",
124       "url_request/url_request_file_dir_job.h",
125       "url_request/url_request_file_job.cc",
126       "url_request/url_request_file_job.h",
127       "url_request/file_protocol_handler.cc",
128       "url_request/file_protocol_handler.h",
129     ]
130   }
132   if (!enable_ftp_support) {
133     sources -= [
134       "ftp/ftp_auth_cache.cc",
135       "ftp/ftp_auth_cache.h",
136       "ftp/ftp_ctrl_response_buffer.cc",
137       "ftp/ftp_ctrl_response_buffer.h",
138       "ftp/ftp_directory_listing_parser.cc",
139       "ftp/ftp_directory_listing_parser.h",
140       "ftp/ftp_directory_listing_parser_ls.cc",
141       "ftp/ftp_directory_listing_parser_ls.h",
142       "ftp/ftp_directory_listing_parser_netware.cc",
143       "ftp/ftp_directory_listing_parser_netware.h",
144       "ftp/ftp_directory_listing_parser_os2.cc",
145       "ftp/ftp_directory_listing_parser_os2.h",
146       "ftp/ftp_directory_listing_parser_vms.cc",
147       "ftp/ftp_directory_listing_parser_vms.h",
148       "ftp/ftp_directory_listing_parser_windows.cc",
149       "ftp/ftp_directory_listing_parser_windows.h",
150       "ftp/ftp_network_layer.cc",
151       "ftp/ftp_network_layer.h",
152       "ftp/ftp_network_session.cc",
153       "ftp/ftp_network_session.h",
154       "ftp/ftp_network_transaction.cc",
155       "ftp/ftp_network_transaction.h",
156       "ftp/ftp_request_info.h",
157       "ftp/ftp_response_info.cc",
158       "ftp/ftp_response_info.h",
159       "ftp/ftp_server_type_histograms.cc",
160       "ftp/ftp_server_type_histograms.h",
161       "ftp/ftp_transaction.h",
162       "ftp/ftp_transaction_factory.h",
163       "ftp/ftp_util.cc",
164       "ftp/ftp_util.h",
165       "url_request/ftp_protocol_handler.cc",
166       "url_request/ftp_protocol_handler.h",
167       "url_request/url_request_ftp_job.cc",
168       "url_request/url_request_ftp_job.h",
169     ]
170   }
172   if (enable_built_in_dns) {
173     defines += [ "ENABLE_BUILT_IN_DNS" ]
174   } else {
175     sources -= [
176       "dns/address_sorter_posix.cc",
177       "dns/address_sorter_posix.h",
178       "dns/dns_client.cc",
179     ]
180   }
182   if (use_openssl) {
183     sources -= [
184       "base/nss_memio.c",
185       "base/nss_memio.h",
186       "cert/ct_log_verifier_nss.cc",
187       "cert/ct_objects_extractor_nss.cc",
188       "cert/jwk_serializer_nss.cc",
189       "cert/scoped_nss_types.h",
190       "cert/x509_util_nss.cc",
191       "cert/x509_util_nss.h",
192       "quic/crypto/aead_base_decrypter_nss.cc",
193       "quic/crypto/aead_base_encrypter_nss.cc",
194       "quic/crypto/aes_128_gcm_12_decrypter_nss.cc",
195       "quic/crypto/aes_128_gcm_12_encrypter_nss.cc",
196       "quic/crypto/chacha20_poly1305_decrypter_nss.cc",
197       "quic/crypto/chacha20_poly1305_encrypter_nss.cc",
198       "quic/crypto/channel_id_nss.cc",
199       "quic/crypto/p256_key_exchange_nss.cc",
200       "socket/nss_ssl_util.cc",
201       "socket/nss_ssl_util.h",
202       "socket/ssl_client_socket_nss.cc",
203       "socket/ssl_client_socket_nss.h",
204       "socket/ssl_server_socket_nss.cc",
205       "socket/ssl_server_socket_nss.h",
206     ]
207     if (is_chromeos) {
208       sources -= [
209         "cert/nss_cert_database_chromeos.cc",
210         "cert/nss_cert_database_chromeos.h",
211         "cert/nss_profile_filter_chromeos.cc",
212         "cert/nss_profile_filter_chromeos.h",
213       ]
214     }
215     if (is_linux) {
216       # These are always removed for non-Linux cases below.
217       sources -= [
218         "base/crypto_module_nss.cc",
219         "base/keygen_handler_nss.cc",
220         "cert/cert_database_nss.cc",
221         "cert/nss_cert_database.cc",
222         "cert/nss_cert_database.h",
223         "cert/x509_certificate_nss.cc",
224         "third_party/mozilla_security_manager/nsKeygenHandler.cpp",
225         "third_party/mozilla_security_manager/nsKeygenHandler.h",
226         "third_party/mozilla_security_manager/nsNSSCertificateDB.cpp",
227         "third_party/mozilla_security_manager/nsNSSCertificateDB.h",
228         "third_party/mozilla_security_manager/nsPKCS12Blob.cpp",
229         "third_party/mozilla_security_manager/nsPKCS12Blob.h",
230       ]
231     }
232     if (is_ios) {
233       # Always removed for !ios below.
234       sources -= [
235         "cert/cert_verify_proc_nss.cc",
236         "cert/cert_verify_proc_nss.h",
237         "cert/test_root_certs_nss.cc",
238         "ocsp/nss_ocsp.cc",
239         "ocsp/nss_ocsp.h",
240       ]
241     }
242   } else {
243     sources -= [
244       "base/crypto_module_openssl.cc",
245       "base/keygen_handler_openssl.cc",
246       "cert/ct_log_verifier_openssl.cc",
247       "cert/ct_objects_extractor_openssl.cc",
248       "cert/jwk_serializer_openssl.cc",
249       "cert/x509_util_openssl.cc",
250       "cert/x509_util_openssl.h",
251       "quic/crypto/aead_base_decrypter_openssl.cc",
252       "quic/crypto/aead_base_encrypter_openssl.cc",
253       "quic/crypto/aes_128_gcm_12_decrypter_openssl.cc",
254       "quic/crypto/aes_128_gcm_12_encrypter_openssl.cc",
255       "quic/crypto/chacha20_poly1305_decrypter_openssl.cc",
256       "quic/crypto/chacha20_poly1305_encrypter_openssl.cc",
257       "quic/crypto/channel_id_openssl.cc",
258       "quic/crypto/p256_key_exchange_openssl.cc",
259       "quic/crypto/scoped_evp_aead_ctx.cc",
260       "quic/crypto/scoped_evp_aead_ctx.h",
261       "socket/ssl_client_socket_openssl.cc",
262       "socket/ssl_client_socket_openssl.h",
263       "socket/ssl_server_socket_openssl.cc",
264       "socket/ssl_session_cache_openssl.cc",
265       "socket/ssl_session_cache_openssl.h",
266     ]
267   }
269   if (!use_openssl_certs) {
270     sources -= [
271       "base/openssl_private_key_store.h",
272       "base/openssl_private_key_store_memory.cc",
273       "cert/cert_database_openssl.cc",
274       "cert/cert_verify_proc_openssl.cc",
275       "cert/cert_verify_proc_openssl.h",
276       "cert/test_root_certs_openssl.cc",
277       "cert/x509_certificate_openssl.cc",
278       "ssl/openssl_client_key_store.cc",
279       "ssl/openssl_client_key_store.h",
280     ]
281     if (is_android) {
282       sources -= [
283         "base/openssl_private_key_store_android.cc",
284       ]
285     }
286   }
288   if (use_glib) {
289     configs += [ "//build/config/linux:gconf" ]
290     deps += [ "//build/config/linux:gio" ]
291   }
293   if (is_linux) {
294     configs += [ "//build/config/linux:libresolv" ]
295   } else {
296     sources -= [
297       "base/crypto_module_nss.cc",
298       "base/keygen_handler_nss.cc",
299       "cert/cert_database_nss.cc",
300       "cert/nss_cert_database.cc",
301       "cert/nss_cert_database.h",
302       "cert/x509_certificate_nss.cc",
303       "third_party/mozilla_security_manager/nsKeygenHandler.cpp",
304       "third_party/mozilla_security_manager/nsKeygenHandler.h",
305       "third_party/mozilla_security_manager/nsNSSCertificateDB.cpp",
306       "third_party/mozilla_security_manager/nsNSSCertificateDB.h",
307       "third_party/mozilla_security_manager/nsPKCS12Blob.cpp",
308       "third_party/mozilla_security_manager/nsPKCS12Blob.h",
309     ]
311     if (!is_ios) {
312       # These files are part of the partial implementation of NSS on iOS so
313       # keep them in that case.
314       sources -= [
315         "cert/test_root_certs_nss.cc",
316         "ocsp/nss_ocsp.cc",
317         "ocsp/nss_ocsp.h",
318       ]
319     }
320   }
322   if (!use_nss_certs) {
323     sources -= [
324       "ssl/client_cert_store_nss.cc",
325       "ssl/client_cert_store_nss.h",
326     ]
327     if (!is_ios) {
328       # These files are part of the partial implementation of NSS on iOS so
329       # keep them in that case (even though use_nss_certs is not set).
330       sources -= [
331         "cert/cert_verify_proc_nss.cc",
332         "cert/cert_verify_proc_nss.h",
333       ]
334     }
335     if (is_chromeos) {
336       # These were already removed on non-ChromeOS.
337       sources -= [
338         "ssl/client_cert_store_chromeos.cc",
339         "ssl/client_cert_store_chromeos.h",
340       ]
341     }
342   }
344   if (!enable_websockets) {
345     sources -= [
346       "socket_stream/socket_stream.cc",
347       "socket_stream/socket_stream.h",
348       "socket_stream/socket_stream_job.cc",
349       "socket_stream/socket_stream_job.h",
350       "socket_stream/socket_stream_job_manager.cc",
351       "socket_stream/socket_stream_job_manager.h",
352       "socket_stream/socket_stream_metrics.cc",
353       "socket_stream/socket_stream_metrics.h",
354       "spdy/spdy_websocket_stream.cc",
355       "spdy/spdy_websocket_stream.h",
356       "websockets/websocket_basic_handshake_stream.cc",
357       "websockets/websocket_basic_handshake_stream.h",
358       "websockets/websocket_basic_stream.cc",
359       "websockets/websocket_basic_stream.h",
360       "websockets/websocket_channel.cc",
361       "websockets/websocket_channel.h",
362       "websockets/websocket_deflate_predictor.h",
363       "websockets/websocket_deflate_predictor_impl.cc",
364       "websockets/websocket_deflate_predictor_impl.h",
365       "websockets/websocket_deflate_stream.cc",
366       "websockets/websocket_deflate_stream.h",
367       "websockets/websocket_deflater.cc",
368       "websockets/websocket_deflater.h",
369       "websockets/websocket_errors.cc",
370       "websockets/websocket_errors.h",
371       "websockets/websocket_extension.cc",
372       "websockets/websocket_extension.h",
373       "websockets/websocket_extension_parser.cc",
374       "websockets/websocket_extension_parser.h",
375       "websockets/websocket_frame.cc",
376       "websockets/websocket_frame.h",
377       "websockets/websocket_frame_parser.cc",
378       "websockets/websocket_frame_parser.h",
379       "websockets/websocket_handshake_constants.cc",
380       "websockets/websocket_handshake_constants.h",
381       "websockets/websocket_handshake_handler.cc",
382       "websockets/websocket_handshake_handler.h",
383       "websockets/websocket_handshake_request_info.cc",
384       "websockets/websocket_handshake_request_info.h",
385       "websockets/websocket_handshake_response_info.cc",
386       "websockets/websocket_handshake_response_info.h",
387       "websockets/websocket_handshake_stream_base.h",
388       "websockets/websocket_handshake_stream_create_helper.cc",
389       "websockets/websocket_handshake_stream_create_helper.h",
390       "websockets/websocket_inflater.cc",
391       "websockets/websocket_inflater.h",
392       "websockets/websocket_job.cc",
393       "websockets/websocket_job.h",
394       "websockets/websocket_mux.h",
395       "websockets/websocket_net_log_params.cc",
396       "websockets/websocket_net_log_params.h",
397       "websockets/websocket_stream.cc",
398       "websockets/websocket_stream.h",
399       "websockets/websocket_throttle.cc",
400       "websockets/websocket_throttle.h",
401     ]
402   }
404   if (!enable_mdns) {
405     sources -= [
406       "dns/mdns_cache.cc",
407       "dns/mdns_cache.h",
408       "dns/mdns_client.cc",
409       "dns/mdns_client.h",
410       "dns/mdns_client_impl.cc",
411       "dns/mdns_client_impl.h",
412       "dns/record_parsed.cc",
413       "dns/record_parsed.h",
414       "dns/record_rdata.cc",
415       "dns/record_rdata.h",
416     ]
417   }
419   if (is_win) {
420     sources -= [
421       "http/http_auth_handler_ntlm_portable.cc",
422       "socket/tcp_socket_libevent.cc",
423       "socket/tcp_socket_libevent.h",
424       "udp/udp_socket_libevent.cc",
425       "udp/udp_socket_libevent.h",
426     ]
427     deps += [
428       "//third_party/nss:nspr",
429       "//third_party/nss",
430     ]
431   } else {  # !is_win
432     sources -= [
433       "base/winsock_init.cc",
434       "base/winsock_init.h",
435       "base/winsock_util.cc",
436       "base/winsock_util.h",
437       "proxy/proxy_resolver_winhttp.cc",
438       "proxy/proxy_resolver_winhttp.h",
439     ]
440   }
442   if (is_mac) {
443     deps += [
444       "//third_party/nss:nspr",
445       "//third_party/nss",
446     ]
447     libs = [
448       "Foundation.framework",
449       "Security.framework",
450       "SystemConfiguration.framework",
451       "resolv",
452     ]
453   }
455   if (is_ios) {
456     sources -= [ "disk_cache/blockfile/file_posix.cc" ]
457     deps += [
458       "//third_party/nss",
459     ]
460     libs = [
461       "CFNetwork.framework",
462       "MobileCoreServices.framework",
463       "Security.framework",
464       "SystemConfiguration.framework",
465       "resolv",
466     ]
467   }
469   if (is_android) {
470     if (!is_android_webview_build) {
471       deps += [ ":net_jni_headers" ]
473       # The net/android/keystore_openssl.cc source file needs to access an
474       # OpenSSL-internal header.
475       include_dirs = [ "//third_party/openssl" ]
476     }
477   }
480 grit("net_resources") {
481   source = "base/net_resources.grd"
484 source_set("http_server") {
485   sources = [
486     "server/http_connection.cc",
487     "server/http_connection.h",
488     "server/http_server.cc",
489     "server/http_server.h",
490     "server/http_server_request_info.cc",
491     "server/http_server_request_info.h",
492     "server/http_server_response_info.cc",
493     "server/http_server_response_info.h",
494     "server/web_socket.cc",
495     "server/web_socket.h",
496   ]
497   configs += [ "//build/config/compiler:wexit_time_destructors" ]
498   deps = [
499     ":net",
500     "//base",
501   ]
504 executable("dump_cache") {
505   sources = [
506     "tools/dump_cache/cache_dumper.cc",
507     "tools/dump_cache/cache_dumper.h",
508     "tools/dump_cache/dump_cache.cc",
509     "tools/dump_cache/dump_files.cc",
510     "tools/dump_cache/dump_files.h",
511     "tools/dump_cache/simple_cache_dumper.cc",
512     "tools/dump_cache/simple_cache_dumper.h",
513     "tools/dump_cache/upgrade_win.cc",
514     "tools/dump_cache/upgrade_win.h",
515     "tools/dump_cache/url_to_filename_encoder.cc",
516     "tools/dump_cache/url_to_filename_encoder.h",
517     "tools/dump_cache/url_utilities.h",
518     "tools/dump_cache/url_utilities.cc",
519   ]
521   configs += [ ":net_win_size_truncation" ]
523   deps = [
524     "//base",
525     ":net",
526     ":net_test_support",
527   ]
530 source_set("net_test_support") {
531   sources = [
532     "base/capturing_net_log.cc",
533     "base/capturing_net_log.h",
534     "base/load_timing_info_test_util.cc",
535     "base/load_timing_info_test_util.h",
536     "base/mock_file_stream.cc",
537     "base/mock_file_stream.h",
538     "base/test_completion_callback.cc",
539     "base/test_completion_callback.h",
540     "base/test_data_directory.cc",
541     "base/test_data_directory.h",
542     "cert/mock_cert_verifier.cc",
543     "cert/mock_cert_verifier.h",
544     "cookies/cookie_monster_store_test.cc",
545     "cookies/cookie_monster_store_test.h",
546     "cookies/cookie_store_test_callbacks.cc",
547     "cookies/cookie_store_test_callbacks.h",
548     "cookies/cookie_store_test_helpers.cc",
549     "cookies/cookie_store_test_helpers.h",
550     "disk_cache/disk_cache_test_base.cc",
551     "disk_cache/disk_cache_test_base.h",
552     "disk_cache/disk_cache_test_util.cc",
553     "disk_cache/disk_cache_test_util.h",
554     "dns/dns_test_util.cc",
555     "dns/dns_test_util.h",
556     "dns/mock_host_resolver.cc",
557     "dns/mock_host_resolver.h",
558     "dns/mock_mdns_socket_factory.cc",
559     "dns/mock_mdns_socket_factory.h",
560     "proxy/mock_proxy_resolver.cc",
561     "proxy/mock_proxy_resolver.h",
562     "proxy/mock_proxy_script_fetcher.cc",
563     "proxy/mock_proxy_script_fetcher.h",
564     "proxy/proxy_config_service_common_unittest.cc",
565     "proxy/proxy_config_service_common_unittest.h",
566     "socket/socket_test_util.cc",
567     "socket/socket_test_util.h",
568     "test/cert_test_util.cc",
569     "test/cert_test_util.h",
570     "test/ct_test_util.cc",
571     "test/ct_test_util.h",
572     "test/embedded_test_server/embedded_test_server.cc",
573     "test/embedded_test_server/embedded_test_server.h",
574     "test/embedded_test_server/http_connection.cc",
575     "test/embedded_test_server/http_connection.h",
576     "test/embedded_test_server/http_request.cc",
577     "test/embedded_test_server/http_request.h",
578     "test/embedded_test_server/http_response.cc",
579     "test/embedded_test_server/http_response.h",
580     "test/net_test_suite.cc",
581     "test/net_test_suite.h",
582     "test/python_utils.cc",
583     "test/python_utils.h",
584     "test/spawned_test_server/base_test_server.cc",
585     "test/spawned_test_server/base_test_server.h",
586     "test/spawned_test_server/local_test_server_posix.cc",
587     "test/spawned_test_server/local_test_server_win.cc",
588     "test/spawned_test_server/local_test_server.cc",
589     "test/spawned_test_server/local_test_server.h",
590     "test/spawned_test_server/remote_test_server.cc",
591     "test/spawned_test_server/remote_test_server.h",
592     "test/spawned_test_server/spawned_test_server.h",
593     "test/spawned_test_server/spawner_communicator.cc",
594     "test/spawned_test_server/spawner_communicator.h",
595     "url_request/test_url_fetcher_factory.cc",
596     "url_request/test_url_fetcher_factory.h",
597     "url_request/url_request_test_util.cc",
598     "url_request/url_request_test_util.h",
599   ]
601   configs += [ ":net_win_size_truncation" ]
603   deps = [
604     "//base",
605     "//base/test:test_support",
606     "//crypto:platform",
607     "//net",
608     "//net/tools/tld_cleanup",
609     "//testing/gmock",
610     "//testing/gtest",
611     "//url",
612   ]
614   if (is_ios) {
615     deps += [ "//third_party/nss" ]
616   }
618   if (!is_android) {
619     sources -= [
620       "test/spawned_test_server/remote_test_server.cc",
621       "test/spawned_test_server/remote_test_server.h",
622       "test/spawned_test_server/spawner_communicator.cc",
623       "test/spawned_test_server/spawner_communicator.h",
624     ]
625   }
627   if (use_v8_in_net) {
628     deps += [ ":net_with_v8" ]
629   }
631   if (!enable_mdns) {
632     sources -= [
633       "dns/mock_mdns_socket_factory.cc",
634       "dns/mock_mdns_socket_factory.h",
635     ]
636   }
638   forward_dependent_configs_from = deps
641 if (use_v8_in_net) {
642   component("net_with_v8") {
643     sources = [
644       "proxy/proxy_resolver_v8.cc",
645       "proxy/proxy_resolver_v8.h",
646       "proxy/proxy_resolver_v8_tracing.cc",
647       "proxy/proxy_resolver_v8_tracing.h",
648       "proxy/proxy_service_v8.cc",
649       "proxy/proxy_service_v8.h",
650     ]
652     defines = [ "NET_IMPLEMENTATION" ]
653     configs += [
654       ":net_win_size_truncation",
655       "//build/config/compiler:wexit_time_destructors",
656     ]
658     deps = [
659       ":net",
660       "//base",
661       "//gin",
662       "//url",
663       "//v8",
664     ]
665   }
668 if (!is_ios && !is_android) {
669   executable("crash_cache") {
670     sources = [ "tools/crash_cache/crash_cache.cc" ]
671     configs += [ ":net_win_size_truncation" ]
672     deps = [
673       ":net",
674       ":net_test_support",
675       "//base",
676     ]
677   }
679   executable("crl_set_dump") {
680     sources = [ "tools/crl_set_dump/crl_set_dump.cc" ]
681     configs += [ ":net_win_size_truncation" ]
682     deps = [
683       ":net",
684       "//base",
685     ]
686   }
688   executable("dns_fuzz_stub") {
689     sources = [ "tools/dns_fuzz_stub/dns_fuzz_stub.cc" ]
690     configs += [ ":net_win_size_truncation" ]
691     deps = [
692       ":net",
693       "//base",
694     ]
695   }
697   executable("gdig") {
698     sources = [
699       "tools/gdig/file_net_log.cc",
700       "tools/gdig/gdig.cc",
701     ]
702     deps = [
703       ":net",
704       "//base",
705     ]
706   }
708   executable("get_server_time") {
709     sources = [ "tools/get_server_time/get_server_time.cc" ]
710     configs += [ ":net_win_size_truncation" ]
711     deps = [
712       ":net",
713       "//base",
714       "//base:i18n",
715       "//url",
716     ]
717   }
719   if (use_v8_in_net) {
720     executable("net_watcher") {
721       sources = [ "tools/net_watcher/net_watcher.cc" ]
722       deps = [
723         ":net",
724         ":net_with_v8",
725         "//base",
726       ]
728       if (is_linux) {
729         configs += [ "//build/config/linux:gconf" ]
730         deps += [ "//build/config/linux:gio" ]
731       }
732     }
733   }
735   executable("run_testserver") {
736     sources = [ "tools/testserver/run_testserver.cc" ]
737     deps = [
738       ":net",  # TODO(brettw) bug 363749: this shouldn't be necessary. It's not
739                # in the GYP build, and can be removed when the bug is fixed.
740       ":net_test_support",
741       "//base",
742       "//base/test:test_support",
743       "//testing/gtest",
744     ]
745   }
747   executable("stress_cache") {
748     sources = [ "disk_cache/blockfile/stress_cache.cc" ]
749     configs += [ ":net_win_size_truncation" ]
750     deps = [
751       ":net",
752       ":net_test_support",
753       "//base",
754     ]
755   }
757   executable("tld_cleanup") {
758     sources = [ "tools/tld_cleanup/tld_cleanup.cc" ]
759     configs += [ ":net_win_size_truncation" ]
760     deps = [
761       "//base",
762       "//base:i18n",
763       "//net/tools/tld_cleanup",
764     ]
765   }
768 if (is_linux) {
769   source_set("balsa") {
770     sources = [
771       "tools/balsa/balsa_enums.h",
772       "tools/balsa/balsa_frame.cc",
773       "tools/balsa/balsa_frame.h",
774       "tools/balsa/balsa_headers.cc",
775       "tools/balsa/balsa_headers.h",
776       "tools/balsa/balsa_headers_token_utils.cc",
777       "tools/balsa/balsa_headers_token_utils.h",
778       "tools/balsa/balsa_visitor_interface.h",
779       "tools/balsa/http_message_constants.cc",
780       "tools/balsa/http_message_constants.h",
781       "tools/balsa/noop_balsa_visitor.h",
782       "tools/balsa/simple_buffer.cc",
783       "tools/balsa/simple_buffer.h",
784       "tools/balsa/split.cc",
785       "tools/balsa/split.h",
786       "tools/balsa/string_piece_utils.h",
787     ]
788     deps = [
789       ":net",
790       "//base",
791     ]
792   }
794   source_set("epoll_server") {
795     sources = [
796       "tools/epoll_server/epoll_server.cc",
797       "tools/epoll_server/epoll_server.h",
798     ]
799     deps = [
800       ":net",
801       "//base",
802     ]
803   }
805   source_set("flip_in_mem_edsm_server_base") {
806     sources = [
807       "tools/dump_cache/url_to_filename_encoder.cc",
808       "tools/dump_cache/url_to_filename_encoder.h",
809       "tools/dump_cache/url_utilities.h",
810       "tools/dump_cache/url_utilities.cc",
811       "tools/flip_server/acceptor_thread.h",
812       "tools/flip_server/acceptor_thread.cc",
813       "tools/flip_server/create_listener.cc",
814       "tools/flip_server/create_listener.h",
815       "tools/flip_server/constants.h",
816       "tools/flip_server/flip_config.cc",
817       "tools/flip_server/flip_config.h",
818       "tools/flip_server/http_interface.cc",
819       "tools/flip_server/http_interface.h",
820       "tools/flip_server/loadtime_measurement.h",
821       "tools/flip_server/mem_cache.h",
822       "tools/flip_server/mem_cache.cc",
823       "tools/flip_server/output_ordering.cc",
824       "tools/flip_server/output_ordering.h",
825       "tools/flip_server/ring_buffer.cc",
826       "tools/flip_server/ring_buffer.h",
827       "tools/flip_server/sm_connection.cc",
828       "tools/flip_server/sm_connection.h",
829       "tools/flip_server/sm_interface.h",
830       "tools/flip_server/spdy_ssl.cc",
831       "tools/flip_server/spdy_ssl.h",
832       "tools/flip_server/spdy_interface.cc",
833       "tools/flip_server/spdy_interface.h",
834       "tools/flip_server/spdy_util.cc",
835       "tools/flip_server/spdy_util.h",
836       "tools/flip_server/streamer_interface.cc",
837       "tools/flip_server/streamer_interface.h",
838     ]
839     deps = [
840       ":balsa",
841       ":epoll_server",
842       ":net",
843       "//base",
844       "//third_party/openssl",
845     ]
846   }
848   executable("flip_in_mem_edsm_server_unittests") {
849     sources = [
850       "tools/flip_server/flip_test_utils.cc",
851       "tools/flip_server/flip_test_utils.h",
852       "tools/flip_server/http_interface_test.cc",
853       "tools/flip_server/mem_cache_test.cc",
854       "tools/flip_server/run_all_tests.cc",
855       "tools/flip_server/spdy_interface_test.cc",
856     ]
857     deps = [
858       ":flip_in_mem_edsm_server_base",
859       ":net",
860       ":net_test_support",
861       "//testing/gtest",
862       "//testing/gmock",
863       "//third_party/openssl",
864     ]
865   }
867   executable("flip_in_mem_edsm_server") {
868     sources = [ "tools/flip_server/flip_in_mem_edsm_server.cc" ]
869     deps = [
870       ":flip_in_mem_edsm_server_base",
871       ":net",
872       "//base",
873     ]
874   }
876   source_set("quic_base") {
877     sources = [
878       "tools/quic/quic_client.cc",
879       "tools/quic/quic_client.h",
880       "tools/quic/quic_client_session.cc",
881       "tools/quic/quic_client_session.h",
882       "tools/quic/quic_default_packet_writer.cc",
883       "tools/quic/quic_default_packet_writer.h",
884       "tools/quic/quic_dispatcher.h",
885       "tools/quic/quic_dispatcher.cc",
886       "tools/quic/quic_epoll_clock.cc",
887       "tools/quic/quic_epoll_clock.h",
888       "tools/quic/quic_epoll_connection_helper.cc",
889       "tools/quic/quic_epoll_connection_helper.h",
890       "tools/quic/quic_in_memory_cache.cc",
891       "tools/quic/quic_in_memory_cache.h",
892       "tools/quic/quic_packet_writer_wrapper.cc",
893       "tools/quic/quic_packet_writer_wrapper.h",
894       "tools/quic/quic_server.cc",
895       "tools/quic/quic_server.h",
896       "tools/quic/quic_server_session.cc",
897       "tools/quic/quic_server_session.h",
898       "tools/quic/quic_socket_utils.cc",
899       "tools/quic/quic_socket_utils.h",
900       "tools/quic/quic_spdy_client_stream.cc",
901       "tools/quic/quic_spdy_client_stream.h",
902       "tools/quic/quic_spdy_server_stream.cc",
903       "tools/quic/quic_spdy_server_stream.h",
904       "tools/quic/quic_time_wait_list_manager.h",
905       "tools/quic/quic_time_wait_list_manager.cc",
906       "tools/quic/spdy_utils.cc",
907       "tools/quic/spdy_utils.h",
908     ]
909     deps = [
910       ":balsa",
911       ":epoll_server",
912       ":net",
913       "//base",
914       "//base/third_party/dynamic_annotations",
915       "//crypto",
916       "//third_party/openssl",
917       "//url",
918     ]
919   }
921   executable("quic_client") {
922     sources = [ "tools/quic/quic_client_bin.cc" ]
923     deps = [
924       ":quic_base",
925       ":net",
926       "//base",
927       "//third_party/openssl",
928     ]
929   }
931   executable("quic_server") {
932     sources = [ "tools/quic/quic_server_bin.cc" ]
933     deps = [
934       ":quic_base",
935       ":net",
936       "//base",
937       "//third_party/openssl",
938     ]
939   }
942 # TODO(GYP) Android net_jni_headers target and related.
944 if (is_android || is_linux) {
945   executable("disk_cache_memory_test") {
946     sources = [ "tools/disk_cache_memory_test/disk_cache_memory_test.cc" ]
947     deps = [
948       ":net",
949       "//base",
950     ]
951   }