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