Make net_utility_services depend on net_with_v8 instead of net.
[chromium-blink-merge.git] / net / net.gyp
blob0d416c3cb6ee1d7fe05ed70032db7bfe9d6461f5
1 # Copyright 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.
6   'variables': {
7     'chromium_code': 1,
9     'linux_link_kerberos%': 0,
10     'conditions': [
11       ['chromeos==1 or embedded==1 or OS=="android" or OS=="ios"', {
12         # Disable Kerberos on ChromeOS, Android and iOS, at least for now.
13         # It needs configuration (krb5.conf and so on).
14         'use_kerberos%': 0,
15       }, {  # chromeos == 0 and embedded==0 and OS!="android" and OS!="ios"
16         'use_kerberos%': 1,
17       }],
18       ['OS=="android" and target_arch != "ia32"', {
19         # The way the cache uses mmap() is inefficient on some Android devices.
20         # If this flag is set, we hackily avoid using mmap() in the disk cache.
21         # We are pretty confident that mmap-ing the index would not hurt any
22         # existing x86 android devices, but we cannot be so sure about the
23         # variety of ARM devices. So enable it for x86 only for now.
24         'posix_avoid_mmap%': 1,
25       }, {
26         'posix_avoid_mmap%': 0,
27       }],
28       ['OS=="ios"', {
29         # Websockets and socket stream are not used on iOS.
30         'enable_websockets%': 0,
31         # iOS does not use V8.
32         'use_v8_in_net%': 0,
33         'enable_built_in_dns%': 0,
34       }, {
35         'enable_websockets%': 1,
36         'use_v8_in_net%': 1,
37         'enable_built_in_dns%': 1,
38       }],
39     ],
40   },
41   'includes': [
42     '../build/win_precompile.gypi',
43     'net.gypi',
44   ],
45   'targets': [
46     {
47       'target_name': 'net_derived_sources',
48       'type': 'none',
49       'sources': [
50         'base/registry_controlled_domains/effective_tld_names.gperf',
51         'base/registry_controlled_domains/effective_tld_names_unittest1.gperf',
52         'base/registry_controlled_domains/effective_tld_names_unittest2.gperf',
53         'base/registry_controlled_domains/effective_tld_names_unittest3.gperf',
54         'base/registry_controlled_domains/effective_tld_names_unittest4.gperf',
55         'base/registry_controlled_domains/effective_tld_names_unittest5.gperf',
56         'base/registry_controlled_domains/effective_tld_names_unittest6.gperf',
57       ],
58       'rules': [
59         {
60           'rule_name': 'dafsa',
61           'extension': 'gperf',
62           'outputs': [
63             '<(SHARED_INTERMEDIATE_DIR)/net/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT)-inc.cc',
64           ],
65           'inputs': [
66             'tools/tld_cleanup/make_dafsa.py',
67           ],
68           'action': [
69             'python',
70             'tools/tld_cleanup/make_dafsa.py',
71             '<(RULE_INPUT_PATH)',
72             '<(SHARED_INTERMEDIATE_DIR)/net/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT)-inc.cc',
73           ],
74         },
75       ],
76       'direct_dependent_settings': {
77         'include_dirs': [
78           '<(SHARED_INTERMEDIATE_DIR)'
79         ],
80       },
81     },
82     {
83       'target_name': 'net',
84       'type': '<(component)',
85       'variables': { 'enable_wexit_time_destructors': 1, },
86       'dependencies': [
87         '../base/base.gyp:base',
88         '../base/base.gyp:base_i18n',
89         '../base/base.gyp:base_prefs',
90         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
91         '../crypto/crypto.gyp:crypto',
92         '../sdch/sdch.gyp:sdch',
93         '../third_party/icu/icu.gyp:icui18n',
94         '../third_party/icu/icu.gyp:icuuc',
95         '../third_party/zlib/zlib.gyp:zlib',
96         '../url/url.gyp:url_lib',
97         'net_derived_sources',
98         'net_resources',
99       ],
100       'sources': [
101         '<@(net_nacl_common_sources)',
102         '<@(net_non_nacl_sources)',
103       ],
104       'defines': [
105         'NET_IMPLEMENTATION',
106       ],
107       'export_dependent_settings': [
108         '../base/base.gyp:base',
109       ],
110       'conditions': [
111         ['chromeos==1', {
112           'sources!': [
113              'base/network_change_notifier_linux.cc',
114              'base/network_change_notifier_linux.h',
115              'base/network_change_notifier_netlink_linux.cc',
116              'base/network_change_notifier_netlink_linux.h',
117              'proxy/proxy_config_service_linux.cc',
118              'proxy/proxy_config_service_linux.h',
119           ],
120         }],
121         ['use_kerberos==1', {
122           'defines': [
123             'USE_KERBEROS',
124           ],
125           'conditions': [
126             ['OS=="openbsd"', {
127               'include_dirs': [
128                 '/usr/include/kerberosV'
129               ],
130             }],
131             ['linux_link_kerberos==1', {
132               'link_settings': {
133                 'ldflags': [
134                   '<!@(krb5-config --libs gssapi)',
135                 ],
136               },
137             }, { # linux_link_kerberos==0
138               'defines': [
139                 'DLOPEN_KERBEROS',
140               ],
141             }],
142           ],
143         }, { # use_kerberos == 0
144           'sources!': [
145             'http/http_auth_gssapi_posix.cc',
146             'http/http_auth_gssapi_posix.h',
147             'http/http_auth_handler_negotiate.cc',
148             'http/http_auth_handler_negotiate.h',
149           ],
150         }],
151         ['posix_avoid_mmap==1', {
152           'defines': [
153             'POSIX_AVOID_MMAP',
154           ],
155           'direct_dependent_settings': {
156             'defines': [
157               'POSIX_AVOID_MMAP',
158             ],
159           },
160           'sources!': [
161             'disk_cache/blockfile/mapped_file_posix.cc',
162           ],
163         }, { # else
164           'sources!': [
165             'disk_cache/blockfile/mapped_file_avoid_mmap_posix.cc',
166           ],
167         }],
168         ['disable_file_support==1', {
169           # TODO(mmenke):  Should probably get rid of the dependency on
170           # net_resources in this case (It's used in net_util, to format
171           # directory listings.  Also used outside of net/).
172           'sources!': [
173             'base/directory_lister.cc',
174             'base/directory_lister.h',
175             'url_request/file_protocol_handler.cc',
176             'url_request/file_protocol_handler.h',
177             'url_request/url_request_file_dir_job.cc',
178             'url_request/url_request_file_dir_job.h',
179             'url_request/url_request_file_job.cc',
180             'url_request/url_request_file_job.h',
181           ],
182         }],
183         ['disable_ftp_support==1', {
184           'sources/': [
185             ['exclude', '^ftp/'],
186           ],
187           'sources!': [
188             'url_request/ftp_protocol_handler.cc',
189             'url_request/ftp_protocol_handler.h',
190             'url_request/url_request_ftp_job.cc',
191             'url_request/url_request_ftp_job.h',
192           ],
193         }],
194         ['enable_built_in_dns==1', {
195           'defines': [
196             'ENABLE_BUILT_IN_DNS',
197           ]
198         }, { # else
199           'sources!': [
200             'dns/address_sorter_posix.cc',
201             'dns/address_sorter_posix.h',
202             'dns/dns_client.cc',
203           ],
204         }],
205         ['use_openssl==1', {
206             'sources!': [
207               'base/crypto_module_nss.cc',
208               'base/keygen_handler_nss.cc',
209               'base/nss_memio.c',
210               'base/nss_memio.h',
211               'cert/cert_database_nss.cc',
212               'cert/cert_verify_proc_nss.cc',
213               'cert/cert_verify_proc_nss.h',
214               'cert/ct_log_verifier_nss.cc',
215               'cert/ct_objects_extractor_nss.cc',
216               'cert/jwk_serializer_nss.cc',
217               'cert/nss_cert_database.cc',
218               'cert/nss_cert_database.h',
219               'cert/nss_cert_database_chromeos.cc',
220               'cert/nss_cert_database_chromeos.h',
221               'cert/nss_profile_filter_chromeos.cc',
222               'cert/nss_profile_filter_chromeos.h',
223               'cert/scoped_nss_types.h',
224               'cert/sha256_legacy_support_nss_win.cc',
225               'cert/test_root_certs_nss.cc',
226               'cert/x509_certificate_nss.cc',
227               'cert/x509_util_nss.cc',
228               'cert/x509_util_nss.h',
229               'ocsp/nss_ocsp.cc',
230               'ocsp/nss_ocsp.h',
231               'quic/crypto/aead_base_decrypter_nss.cc',
232               'quic/crypto/aead_base_encrypter_nss.cc',
233               'quic/crypto/aes_128_gcm_12_decrypter_nss.cc',
234               'quic/crypto/aes_128_gcm_12_encrypter_nss.cc',
235               'quic/crypto/chacha20_poly1305_decrypter_nss.cc',
236               'quic/crypto/chacha20_poly1305_encrypter_nss.cc',
237               'quic/crypto/channel_id_nss.cc',
238               'quic/crypto/p256_key_exchange_nss.cc',
239               'socket/nss_ssl_util.cc',
240               'socket/nss_ssl_util.h',
241               'socket/ssl_client_socket_nss.cc',
242               'socket/ssl_client_socket_nss.h',
243               'socket/ssl_server_socket_nss.cc',
244               'socket/ssl_server_socket_nss.h',
245               'third_party/mozilla_security_manager/nsKeygenHandler.cpp',
246               'third_party/mozilla_security_manager/nsKeygenHandler.h',
247               'third_party/mozilla_security_manager/nsNSSCertificateDB.cpp',
248               'third_party/mozilla_security_manager/nsNSSCertificateDB.h',
249               'third_party/mozilla_security_manager/nsPKCS12Blob.cpp',
250               'third_party/mozilla_security_manager/nsPKCS12Blob.h',
251             ],
252             'dependencies': [
253               '../third_party/boringssl/boringssl.gyp:boringssl',
254             ],
255           },
256           {  # else !use_openssl: remove the unneeded files and depend on NSS.
257             'sources!': [
258               'base/crypto_module_openssl.cc',
259               'cert/ct_log_verifier_openssl.cc',
260               'cert/ct_objects_extractor_openssl.cc',
261               'cert/jwk_serializer_openssl.cc',
262               'cert/sha256_legacy_support_openssl_win.cc',
263               'cert/x509_util_openssl.cc',
264               'cert/x509_util_openssl.h',
265               'quic/crypto/aead_base_decrypter_openssl.cc',
266               'quic/crypto/aead_base_encrypter_openssl.cc',
267               'quic/crypto/aes_128_gcm_12_decrypter_openssl.cc',
268               'quic/crypto/aes_128_gcm_12_encrypter_openssl.cc',
269               'quic/crypto/chacha20_poly1305_decrypter_openssl.cc',
270               'quic/crypto/chacha20_poly1305_encrypter_openssl.cc',
271               'quic/crypto/channel_id_openssl.cc',
272               'quic/crypto/p256_key_exchange_openssl.cc',
273               'quic/crypto/scoped_evp_aead_ctx.cc',
274               'quic/crypto/scoped_evp_aead_ctx.h',
275               'socket/ssl_client_socket_openssl.cc',
276               'socket/ssl_client_socket_openssl.h',
277               'socket/ssl_server_socket_openssl.cc',
278               'socket/ssl_server_socket_openssl.h',
279               'socket/ssl_session_cache_openssl.cc',
280               'socket/ssl_session_cache_openssl.h',
281               'ssl/openssl_platform_key.h',
282               'ssl/openssl_platform_key_mac.cc',
283               'ssl/openssl_platform_key_win.cc',
284               'ssl/openssl_ssl_util.cc',
285               'ssl/openssl_ssl_util.h',
286             ],
287             'conditions': [
288               # Pull in the bundled or system NSS as appropriate.
289               [ 'desktop_linux == 1 or chromeos == 1', {
290                 'dependencies': [
291                   '../build/linux/system.gyp:ssl',
292                 ],
293               }, {
294                 'dependencies': [
295                   '../third_party/nss/nss.gyp:nspr',
296                   '../third_party/nss/nss.gyp:nss',
297                   'third_party/nss/ssl.gyp:libssl',
298                 ],
299               }]
300             ],
301           },
302         ],
303         [ 'use_openssl_certs == 0', {
304             'sources!': [
305               'base/keygen_handler_openssl.cc',
306               'base/openssl_private_key_store.h',
307               'base/openssl_private_key_store_android.cc',
308               'base/openssl_private_key_store_memory.cc',
309               'cert/cert_database_openssl.cc',
310               'cert/cert_verify_proc_openssl.cc',
311               'cert/cert_verify_proc_openssl.h',
312               'cert/test_root_certs_openssl.cc',
313               'cert/x509_certificate_openssl.cc',
314               'ssl/openssl_client_key_store.cc',
315               'ssl/openssl_client_key_store.h',
316             ],
317         }],
318         [ 'use_glib == 1', {
319             'dependencies': [
320               '../build/linux/system.gyp:gconf',
321               '../build/linux/system.gyp:gio',
322             ],
323         }],
324         [ 'desktop_linux == 1 or chromeos == 1', {
325             'conditions': [
326               ['os_bsd==1', {
327                 'sources!': [
328                   'base/network_change_notifier_linux.cc',
329                   'base/network_change_notifier_netlink_linux.cc',
330                   'proxy/proxy_config_service_linux.cc',
331                 ],
332               },{
333                 'dependencies': [
334                   '../build/linux/system.gyp:libresolv',
335                 ],
336               }],
337               ['OS=="solaris"', {
338                 'link_settings': {
339                   'ldflags': [
340                     '-R/usr/lib/mps',
341                   ],
342                 },
343               }],
344             ],
345           },
346           {  # else: OS is not in the above list
347             'sources!': [
348               'base/crypto_module_nss.cc',
349               'base/keygen_handler_nss.cc',
350               'cert/cert_database_nss.cc',
351               'cert/nss_cert_database.cc',
352               'cert/nss_cert_database.h',
353               'cert/test_root_certs_nss.cc',
354               'cert/x509_certificate_nss.cc',
355               'ocsp/nss_ocsp.cc',
356               'ocsp/nss_ocsp.h',
357               'third_party/mozilla_security_manager/nsKeygenHandler.cpp',
358               'third_party/mozilla_security_manager/nsKeygenHandler.h',
359               'third_party/mozilla_security_manager/nsNSSCertificateDB.cpp',
360               'third_party/mozilla_security_manager/nsNSSCertificateDB.h',
361               'third_party/mozilla_security_manager/nsPKCS12Blob.cpp',
362               'third_party/mozilla_security_manager/nsPKCS12Blob.h',
363             ],
364           },
365         ],
366         [ 'use_nss != 1', {
367             'sources!': [
368               'cert/cert_verify_proc_nss.cc',
369               'cert/cert_verify_proc_nss.h',
370               'ssl/client_cert_store_chromeos.cc',
371               'ssl/client_cert_store_chromeos.h',
372               'ssl/client_cert_store_nss.cc',
373               'ssl/client_cert_store_nss.h',
374             ],
375         }],
376         [ 'enable_websockets != 1', {
377             'sources/': [
378               ['exclude', '^websockets/'],
379             ],
380         }],
381         [ 'enable_mdns != 1', {
382             'sources!' : [
383               'dns/mdns_cache.cc',
384               'dns/mdns_cache.h',
385               'dns/mdns_client.cc',
386               'dns/mdns_client.h',
387               'dns/mdns_client_impl.cc',
388               'dns/mdns_client_impl.h',
389               'dns/record_parsed.cc',
390               'dns/record_parsed.h',
391               'dns/record_rdata.cc',
392               'dns/record_rdata.h',
393             ]
394         }],
395         [ 'OS == "win"', {
396             'sources!': [
397               'http/http_auth_handler_ntlm_portable.cc',
398               'socket/socket_libevent.cc',
399               'socket/socket_libevent.h',
400               'socket/tcp_socket_libevent.cc',
401               'socket/tcp_socket_libevent.h',
402               'udp/udp_socket_libevent.cc',
403               'udp/udp_socket_libevent.h',
404             ],
405              # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
406             'msvs_disabled_warnings': [4267, ],
407           }, { # else: OS != "win"
408             'sources!': [
409               'base/winsock_init.cc',
410               'base/winsock_init.h',
411               'base/winsock_util.cc',
412               'base/winsock_util.h',
413               'proxy/proxy_resolver_winhttp.cc',
414               'proxy/proxy_resolver_winhttp.h',
415             ],
416           },
417         ],
418         [ 'OS == "mac"', {
419             'link_settings': {
420               'libraries': [
421                 '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
422                 '$(SDKROOT)/System/Library/Frameworks/Security.framework',
423                 '$(SDKROOT)/System/Library/Frameworks/SystemConfiguration.framework',
424                 '$(SDKROOT)/usr/lib/libresolv.dylib',
425               ]
426             },
427           },
428         ],
429         [ 'OS == "ios"', {
430             'sources!': [
431               'disk_cache/blockfile/file_posix.cc',
432             ],
433             'link_settings': {
434               'libraries': [
435                 '$(SDKROOT)/System/Library/Frameworks/CFNetwork.framework',
436                 '$(SDKROOT)/System/Library/Frameworks/MobileCoreServices.framework',
437                 '$(SDKROOT)/System/Library/Frameworks/Security.framework',
438                 '$(SDKROOT)/System/Library/Frameworks/SystemConfiguration.framework',
439                 '$(SDKROOT)/usr/lib/libresolv.dylib',
440               ],
441             },
442           },
443         ],
444         [ 'OS == "ios" or OS == "mac"', {
445             'sources': [
446               '<@(net_base_mac_ios_sources)',
447             ],
448           },
449         ],
450         ['OS=="android" and _toolset=="target" and android_webview_build == 0', {
451           'dependencies': [
452              'net_java',
453           ],
454         }],
455         [ 'OS == "android"', {
456             'dependencies': [
457               'net_jni_headers',
458             ],
459             'sources!': [
460               'base/openssl_private_key_store_memory.cc',
461               'cert/cert_database_openssl.cc',
462               'cert/cert_verify_proc_openssl.cc',
463               'cert/test_root_certs_openssl.cc',
464             ],
465           },
466         ],
467         [ 'use_icu_alternatives_on_android == 1', {
468             'dependencies!': [
469               '../base/base.gyp:base_i18n',
470               '../third_party/icu/icu.gyp:icui18n',
471               '../third_party/icu/icu.gyp:icuuc',
472             ],
473             'sources!': [
474               'base/filename_util_icu.cc',
475               'base/net_string_util_icu.cc',
476               'base/net_util_icu.cc',
477             ],
478             'sources': [
479               'base/net_string_util_icu_alternatives_android.cc',
480               'base/net_string_util_icu_alternatives_android.h',
481             ],
482           },
483         ],
484       ],
485       'target_conditions': [
486         # These source files are excluded by default platform rules, but they
487         # are needed in specific cases on other platforms. Re-including them can
488         # only be done in target_conditions as it is evaluated after the
489         # platform rules.
490         ['OS == "android"', {
491           'sources/': [
492             ['include', '^base/platform_mime_util_linux\\.cc$'],
493             ['include', '^base/address_tracker_linux\\.cc$'],
494             ['include', '^base/address_tracker_linux\\.h$'],
495             ['include', '^base/net_util_linux\\.cc$'],
496             ['include', '^base/net_util_linux\\.h$'],
497           ],
498         }],
499         ['OS == "ios"', {
500           'sources/': [
501             ['include', '^base/mac/url_conversions\\.h$'],
502             ['include', '^base/mac/url_conversions\\.mm$'],
503             ['include', '^base/net_util_mac\\.cc$'],
504             ['include', '^base/net_util_mac\\.h$'],
505             ['include', '^base/network_change_notifier_mac\\.cc$'],
506             ['include', '^base/network_config_watcher_mac\\.cc$'],
507             ['include', '^base/platform_mime_util_mac\\.mm$'],
508             # The iOS implementation only partially uses NSS and thus does not
509             # defines |use_nss|. In particular the |USE_NSS| preprocessor
510             # definition is not used. The following files are needed though:
511             ['include', '^cert/cert_verify_proc_nss\\.cc$'],
512             ['include', '^cert/cert_verify_proc_nss\\.h$'],
513             ['include', '^cert/test_root_certs_nss\\.cc$'],
514             ['include', '^cert/x509_util_nss\\.cc$'],
515             ['include', '^cert/x509_util_nss\\.h$'],
516             ['include', '^proxy/proxy_resolver_mac\\.cc$'],
517             ['include', '^proxy/proxy_server_mac\\.cc$'],
518             ['include', '^ocsp/nss_ocsp\\.cc$'],
519             ['include', '^ocsp/nss_ocsp\\.h$'],
520           ],
521         }],
522       ],
523     },
524     {
525       'target_name': 'net_unittests',
526       'type': '<(gtest_target_type)',
527       'dependencies': [
528         '../base/base.gyp:base',
529         '../base/base.gyp:base_i18n',
530         '../base/base.gyp:base_prefs_test_support',
531         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
532         '../crypto/crypto.gyp:crypto',
533         '../crypto/crypto.gyp:crypto_test_support',
534         '../testing/gmock.gyp:gmock',
535         '../testing/gtest.gyp:gtest',
536         '../third_party/zlib/zlib.gyp:zlib',
537         '../url/url.gyp:url_lib',
538         'balsa',
539         'http_server',
540         'net',
541         'net_derived_sources',
542         'net_extras',
543         'net_test_support',
544         'quic_tools',
545       ],
546       'sources': [
547         '<@(net_test_sources)',
548       ],
549       'conditions': [
550         ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android"', {
551           'dependencies': [
552             'epoll_server',
553             'flip_in_mem_edsm_server_base',
554             'quic_base',
555           ],
556           'sources': [
557             '<@(net_linux_test_sources)',
558           ],
559         }],
560         ['OS == "mac" or OS == "ios"', {
561           'sources': [
562             '<@(net_base_test_mac_ios_sources)',
563           ],
564         }],
565         ['chromeos==1', {
566           'sources!': [
567             'proxy/proxy_config_service_linux_unittest.cc',
568           ],
569         }],
570         [ 'OS == "android"', {
571           'sources!': [
572             # See bug http://crbug.com/344533.
573             'disk_cache/blockfile/index_table_v3_unittest.cc',
574             # No res_ninit() et al on Android, so this doesn't make a lot of
575             # sense.
576             'dns/dns_config_service_posix_unittest.cc',
577           ],
578           'dependencies': [
579             'net_javatests',
580             'net_test_jni_headers',
581           ],
582         }],
583         [ 'use_nss != 1', {
584           'sources!': [
585             'ssl/client_cert_store_chromeos_unittest.cc',
586             'ssl/client_cert_store_nss_unittest.cc',
587           ],
588         }],
589         [ 'use_openssl == 1', {
590           # Avoid compiling/linking with the system library.
591           'dependencies': [
592             '../third_party/boringssl/boringssl.gyp:boringssl',
593           ],
594         }, {  # use_openssl == 0
595           'conditions': [
596             [ 'desktop_linux == 1 or chromeos == 1', {
597               'dependencies': [
598                 '../build/linux/system.gyp:ssl',
599               ],
600             }, {  # desktop_linux == 0 and chromeos == 0
601               'dependencies': [
602                 '../third_party/nss/nss.gyp:nspr',
603                 '../third_party/nss/nss.gyp:nss',
604                 'third_party/nss/ssl.gyp:libssl',
605               ],
606               'sources!': [
607                 'cert/nss_cert_database_unittest.cc',
608               ],
609             }],
610           ],
611         }],
612         [ 'os_posix == 1 and OS != "mac" and OS != "android" and OS != "ios"', {
613           'conditions': [
614             ['use_allocator!="none"', {
615               'dependencies': [
616                 '../base/allocator/allocator.gyp:allocator',
617               ],
618             }],
619           ],
620         }],
621         [ 'use_kerberos==1', {
622           'defines': [
623             'USE_KERBEROS',
624           ],
625         }, { # use_kerberos == 0
626           'sources!': [
627             'http/http_auth_gssapi_posix_unittest.cc',
628             'http/http_auth_handler_negotiate_unittest.cc',
629             'http/mock_gssapi_library_posix.cc',
630             'http/mock_gssapi_library_posix.h',
631           ],
632         }],
633         [ 'use_openssl == 1 or (desktop_linux == 0 and chromeos == 0 and OS != "ios")', {
634           # Only include this test when on Posix and using NSS for
635           # cert verification or on iOS (which also uses NSS for certs).
636           'sources!': [
637             'ocsp/nss_ocsp_unittest.cc',
638           ],
639         }],
640         [ 'use_openssl==1', {
641             # When building for OpenSSL, we need to exclude NSS specific tests
642             # or functionality not supported by OpenSSL yet.
643             # TODO(bulach): Add equivalent tests when the underlying
644             #               functionality is ported to OpenSSL.
645             'sources!': [
646               'cert/nss_cert_database_chromeos_unittest.cc',
647               'cert/nss_cert_database_unittest.cc',
648               'cert/nss_profile_filter_chromeos_unittest.cc',
649               'cert/x509_util_nss_unittest.cc',
650               'quic/test_tools/crypto_test_utils_nss.cc',
651             ],
652           }, {  # else !use_openssl: remove the unneeded files and pull in NSS.
653             'sources!': [
654               'cert/x509_util_openssl_unittest.cc',
655               'quic/test_tools/crypto_test_utils_openssl.cc',
656               'socket/ssl_client_socket_openssl_unittest.cc',
657               'socket/ssl_session_cache_openssl_unittest.cc',
658             ],
659           },
660         ],
661         [ 'use_openssl_certs == 0', {
662             'sources!': [
663               'ssl/openssl_client_key_store_unittest.cc',
664             ],
665         }],
666         [ 'enable_websockets != 1', {
667             'sources/': [
668               ['exclude', '^websockets/'],
669               ['exclude', '^server/'],
670             ],
671             'dependencies!': [
672               'http_server',
673             ],
674         }],
675         ['disable_file_support==1', {
676           'sources!': [
677             'base/directory_lister_unittest.cc',
678             'url_request/url_request_file_job_unittest.cc',
679           ],
680         }],
681         [ 'disable_ftp_support==1', {
682             'sources/': [
683               ['exclude', '^ftp/'],
684             ],
685             'sources!': [
686               'url_request/url_request_ftp_job_unittest.cc',
687             ],
688           },
689         ],
690         [ 'enable_built_in_dns!=1', {
691             'sources!': [
692               'dns/address_sorter_posix_unittest.cc',
693               'dns/address_sorter_unittest.cc',
694             ],
695           },
696         ],
697         # Always need use_v8_in_net to be 1 to run gyp on Android, so just
698         # remove net_unittest's dependency on v8 when using icu alternatives
699         # instead of setting use_v8_in_net to 0.
700         [ 'use_v8_in_net==1 and use_icu_alternatives_on_android==0', {
701             'dependencies': [
702               'net_with_v8',
703             ],
704           }, {  # else: !use_v8_in_net
705             'sources!': [
706               'proxy/proxy_resolver_v8_tracing_unittest.cc',
707               'proxy/proxy_resolver_v8_unittest.cc',
708             ],
709           },
710         ],
712         [ 'use_v8_in_net==1 and OS != "android"', {
713             'dependencies': [
714               'net_with_v8',
715               'net_browser_services',
716               'net_utility_services',
717               '../third_party/mojo/mojo_edk.gyp:mojo_system_impl',
718             ],
719           }, {  # else
720             'sources!': [
721               'dns/host_resolver_mojo_unittest.cc',
722               'dns/mojo_host_resolver_impl_unittest.cc',
723               'proxy/mojo_proxy_resolver_factory_impl_unittest.cc',
724               'proxy/mojo_proxy_resolver_impl_unittest.cc',
725             ],
726           },
727         ],
729         [ 'enable_mdns != 1', {
730             'sources!' : [
731               'dns/mdns_cache_unittest.cc',
732               'dns/mdns_client_unittest.cc',
733               'dns/mdns_query_unittest.cc',
734               'dns/record_parsed_unittest.cc',
735               'dns/record_rdata_unittest.cc',
736             ],
737         }],
738         [ 'OS == "win"', {
739             'sources!': [
740               'dns/dns_config_service_posix_unittest.cc',
741               'http/http_auth_gssapi_posix_unittest.cc',
742             ],
743             # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
744             'msvs_disabled_warnings': [4267, ],
745             'conditions': [
746               [ 'icu_use_data_file_flag == 0', {
747                 # This is needed to trigger the dll copy step on windows.
748                 # TODO(mark): Specifying this here shouldn't be necessary.
749                 'dependencies': [
750                   '../third_party/icu/icu.gyp:icudata',
751                 ],
752               }],
753             ],
754           },
755         ],
756         [ 'OS == "ios"', {
757             'actions': [
758               {
759                 'action_name': 'copy_test_data',
760                 'variables': {
761                   'test_data_files': [
762                     'data/ssl/certificates/',
763                     'data/test.html',
764                     'data/url_request_unittest/',
765                   ],
766                   'test_data_prefix': 'net',
767                 },
768                 'includes': [ '../build/copy_test_data_ios.gypi' ],
769               },
770             ],
771             'sources!': [
772               # TODO(droger): The following tests are disabled because the
773               # implementation is missing or incomplete.
774               # KeygenHandler::GenKeyAndSignChallenge() is not ported to iOS.
775               'base/keygen_handler_unittest.cc',
776               'disk_cache/backend_unittest.cc',
777               'disk_cache/blockfile/block_files_unittest.cc',
778               # Need to read input data files.
779               'filter/gzip_filter_unittest.cc',
780               # Need TestServer.
781               'proxy/proxy_script_fetcher_impl_unittest.cc',
782               'socket/ssl_client_socket_unittest.cc',
783               'socket/ssl_server_socket_unittest.cc',
784               'spdy/fuzzing/hpack_fuzz_util_test.cc',
785               # Needs GetAppOutput().
786               'test/python_utils_unittest.cc',
787               'url_request/url_fetcher_impl_unittest.cc',
788               'url_request/url_request_context_builder_unittest.cc',
790               # The following tests are disabled because they don't apply to
791               # iOS.
792               # OS is not "linux" or "freebsd" or "openbsd".
793               'socket/unix_domain_client_socket_posix_unittest.cc',
794               'socket/unix_domain_listen_socket_posix_unittest.cc',
795               'socket/unix_domain_server_socket_posix_unittest.cc',
797               # See bug http://crbug.com/344533.
798               'disk_cache/blockfile/index_table_v3_unittest.cc',
799             ],
800         }],
801         [ 'OS == "android"', {
802             'sources!': [
803               'dns/dns_config_service_posix_unittest.cc',
804             ],
805           },
806         ],
807         ['OS == "android"', {
808           # TODO(mmenke):  This depends on test_support_base, which depends on
809           #                icu.  Figure out a way to remove that dependency.
810           'dependencies': [
811             '../testing/android/native_test.gyp:native_test_native_code',
812           ]
813         }],
814         [ 'use_icu_alternatives_on_android == 1', {
815             'dependencies!': [
816               '../base/base.gyp:base_i18n',
817             ],
818             'sources!': [
819               'base/filename_util_unittest.cc',
820               'base/net_util_icu_unittest.cc',
821             ],
822           },
823         ],
824         ['v8_use_external_startup_data==1', {
825           'dependencies': [
826             '../gin/gin.gyp:gin',
827           ]
828         }],
829       ],
830       'target_conditions': [
831         # These source files are excluded by default platform rules, but they
832         # are needed in specific cases on other platforms. Re-including them can
833         # only be done in target_conditions as it is evaluated after the
834         # platform rules.
835         ['OS == "android"', {
836           'sources/': [
837             ['include', '^base/address_tracker_linux_unittest\\.cc$'],
838           ],
839         }],
840         ['OS == "ios"', {
841           'sources/': [
842             ['include', '^base/mac/url_conversions_unittest\\.mm$'],
843           ],
844         }],
845       ],
846     },
847     {
848       'target_name': 'net_perftests',
849       'type': 'executable',
850       'dependencies': [
851         '../base/base.gyp:base',
852         '../base/base.gyp:base_i18n',
853         '../base/base.gyp:test_support_perf',
854         '../testing/gtest.gyp:gtest',
855         '../url/url.gyp:url_lib',
856         'net',
857         'net_test_support',
858       ],
859       'sources': [
860         'cookies/cookie_monster_perftest.cc',
861         'disk_cache/blockfile/disk_cache_perftest.cc',
862         'proxy/proxy_resolver_perftest.cc',
863         'udp/udp_socket_perftest.cc',
864         'websockets/websocket_frame_perftest.cc',
865       ],
866       'conditions': [
867         [ 'use_v8_in_net==1', {
868             'dependencies': [
869               'net_with_v8',
870             ],
871           }, {  # else: !use_v8_in_net
872             'sources!': [
873               'proxy/proxy_resolver_perftest.cc',
874             ],
875           },
876         ],
877         [ 'OS == "win"', {
878             'conditions': [
879               [ 'icu_use_data_file_flag == 0', {
880                 # This is needed to trigger the dll copy step on windows.
881                 # TODO(mark): Specifying this here shouldn't be necessary.
882                 'dependencies': [
883                   '../third_party/icu/icu.gyp:icudata',
884                 ],
885               }],
886             ],
887             # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
888             'msvs_disabled_warnings': [4267, ],
889         }],
890         [ 'enable_websockets != 1', {
891           'sources!': [
892             'websockets/websocket_frame_perftest.cc',
893           ],
894         }],
895       ],
896     },
897     {
898       'target_name': 'net_test_support',
899       'type': 'static_library',
900       'dependencies': [
901         '../base/base.gyp:base',
902         '../base/base.gyp:test_support_base',
903         '../crypto/crypto.gyp:crypto',
904         '../net/tools/tld_cleanup/tld_cleanup.gyp:tld_cleanup_util',
905         '../testing/gtest.gyp:gtest',
906         '../testing/gmock.gyp:gmock',
907         '../url/url.gyp:url_lib',
908         'net',
909       ],
910       'export_dependent_settings': [
911         '../base/base.gyp:base',
912         # TODO(mmenke):  This depends on icu, figure out a way to build tests
913         #                without icu.
914         '../base/base.gyp:test_support_base',
915         '../testing/gtest.gyp:gtest',
916         '../testing/gmock.gyp:gmock',
917       ],
918       'sources': [
919         'base/captured_net_log_entry.cc',
920         'base/captured_net_log_entry.h',
921         'base/capturing_net_log.cc',
922         'base/capturing_net_log.h',
923         'base/capturing_net_log_observer.cc',
924         'base/capturing_net_log_observer.h',
925         'base/load_timing_info_test_util.cc',
926         'base/load_timing_info_test_util.h',
927         'base/mock_file_stream.cc',
928         'base/mock_file_stream.h',
929         'base/test_completion_callback.cc',
930         'base/test_completion_callback.h',
931         'base/test_data_directory.cc',
932         'base/test_data_directory.h',
933         'cert/mock_cert_verifier.cc',
934         'cert/mock_cert_verifier.h',
935         'cookies/cookie_monster_store_test.cc',
936         'cookies/cookie_monster_store_test.h',
937         'cookies/cookie_store_test_callbacks.cc',
938         'cookies/cookie_store_test_callbacks.h',
939         'cookies/cookie_store_test_helpers.cc',
940         'cookies/cookie_store_test_helpers.h',
941         'disk_cache/disk_cache_test_base.cc',
942         'disk_cache/disk_cache_test_base.h',
943         'disk_cache/disk_cache_test_util.cc',
944         'disk_cache/disk_cache_test_util.h',
945         'dns/dns_test_util.cc',
946         'dns/dns_test_util.h',
947         'dns/mock_host_resolver.cc',
948         'dns/mock_host_resolver.h',
949         'dns/mock_mdns_socket_factory.cc',
950         'dns/mock_mdns_socket_factory.h',
951         'http/http_transaction_test_util.cc',
952         'http/http_transaction_test_util.h',
953         'proxy/mock_proxy_resolver.cc',
954         'proxy/mock_proxy_resolver.h',
955         'proxy/mock_proxy_script_fetcher.cc',
956         'proxy/mock_proxy_script_fetcher.h',
957         'proxy/proxy_config_service_common_unittest.cc',
958         'proxy/proxy_config_service_common_unittest.h',
959         'socket/socket_test_util.cc',
960         'socket/socket_test_util.h',
961         'test/cert_test_util.cc',
962         'test/cert_test_util.h',
963         'test/cert_test_util_nss.cc',
964         'test/ct_test_util.cc',
965         'test/ct_test_util.h',
966         'test/embedded_test_server/embedded_test_server.cc',
967         'test/embedded_test_server/embedded_test_server.h',
968         'test/embedded_test_server/http_connection.cc',
969         'test/embedded_test_server/http_connection.h',
970         'test/embedded_test_server/http_request.cc',
971         'test/embedded_test_server/http_request.h',
972         'test/embedded_test_server/http_response.cc',
973         'test/embedded_test_server/http_response.h',
974         'test/event_waiter.h',
975         'test/net_test_suite.cc',
976         'test/net_test_suite.h',
977         'test/python_utils.cc',
978         'test/python_utils.h',
979         'test/spawned_test_server/base_test_server.cc',
980         'test/spawned_test_server/base_test_server.h',
981         'test/spawned_test_server/local_test_server.cc',
982         'test/spawned_test_server/local_test_server.h',
983         'test/spawned_test_server/local_test_server_posix.cc',
984         'test/spawned_test_server/local_test_server_win.cc',
985         'test/spawned_test_server/remote_test_server.cc',
986         'test/spawned_test_server/remote_test_server.h',
987         'test/spawned_test_server/spawned_test_server.h',
988         'test/spawned_test_server/spawner_communicator.cc',
989         'test/spawned_test_server/spawner_communicator.h',
990         'test/url_request/url_request_failed_job.cc',
991         'test/url_request/url_request_failed_job.h',
992         'test/url_request/url_request_mock_data_job.cc',
993         'test/url_request/url_request_mock_data_job.h',
994         'test/url_request/url_request_mock_http_job.cc',
995         'test/url_request/url_request_mock_http_job.h',
996         'test/url_request/url_request_slow_download_job.cc',
997         'test/url_request/url_request_slow_download_job.h',
998         'url_request/test_url_fetcher_factory.cc',
999         'url_request/test_url_fetcher_factory.h',
1000         'url_request/test_url_request_interceptor.cc',
1001         'url_request/test_url_request_interceptor.h',
1002         'url_request/url_request_test_util.cc',
1003         'url_request/url_request_test_util.h',
1004       ],
1005       'conditions': [
1006         ['OS != "ios"', {
1007           'dependencies': [
1008             '../third_party/protobuf/protobuf.gyp:py_proto',
1009           ],
1010         }],
1011         ['use_openssl == 0 and (use_nss == 1 or OS == "ios")', {
1012           'conditions': [
1013             [ 'desktop_linux == 1 or chromeos == 1', {
1014               'dependencies': [
1015                 '../build/linux/system.gyp:ssl',
1016               ],
1017             }, {  # desktop_linux == 0 and chromeos == 0
1018               'dependencies': [
1019                 '../third_party/nss/nss.gyp:nspr',
1020                 '../third_party/nss/nss.gyp:nss',
1021                 'third_party/nss/ssl.gyp:libssl',
1022               ],
1023             }],
1024           ],
1025         }],
1026         ['os_posix == 1 and OS != "mac" and OS != "android" and OS != "ios"', {
1027           'conditions': [
1028             ['use_allocator!="none"', {
1029               'dependencies': [
1030                 '../base/allocator/allocator.gyp:allocator',
1031               ],
1032             }],
1033           ],
1034         }],
1035         ['OS != "android"', {
1036           'sources!': [
1037             'test/spawned_test_server/remote_test_server.cc',
1038             'test/spawned_test_server/remote_test_server.h',
1039             'test/spawned_test_server/spawner_communicator.cc',
1040             'test/spawned_test_server/spawner_communicator.h',
1041           ],
1042         }],
1043         [ 'use_v8_in_net==1', {
1044             'dependencies': [
1045               'net_with_v8',
1046             ],
1047           },
1048         ],
1049         [ 'enable_mdns != 1', {
1050             'sources!' : [
1051               'dns/mock_mdns_socket_factory.cc',
1052               'dns/mock_mdns_socket_factory.h'
1053             ]
1054         }],
1055         [ 'use_nss != 1', {
1056             'sources!': [
1057               'test/cert_test_util_nss.cc',
1058             ],
1059         }],
1060       ],
1061       # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1062       'msvs_disabled_warnings': [4267, ],
1063     },
1064     {
1065       'target_name': 'net_resources',
1066       'type': 'none',
1067       'variables': {
1068         'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/net',
1069       },
1070       'actions': [
1071         {
1072           'action_name': 'net_resources',
1073           'variables': {
1074             'grit_grd_file': 'base/net_resources.grd',
1075           },
1076           'includes': [ '../build/grit_action.gypi' ],
1077         },
1078       ],
1079     },
1080     {
1081       'target_name': 'net_extras',
1082       'type': 'static_library',
1083       'variables': { 'enable_wexit_time_destructors': 1, },
1084       'dependencies': [
1085         '../base/base.gyp:base',
1086         '../sql/sql.gyp:sql',
1087         'net',
1088       ],
1089       'sources': [
1090         '<@(net_extras_sources)',
1091       ],
1092     },
1093     {
1094       'target_name': 'net_docs',
1095       'type': 'none',
1096       'actions': [
1097         {
1098           'action_name': 'net_docs',
1099           'variables': {
1100             'net_docs_input_dir': '.',
1101           },
1102           'inputs': [
1103             '<@(net_docs_sources)',
1104           ],
1105           'outputs': [
1106             '<(net_docs_output_dir)',
1107           ],
1108           'action': [
1109             'python',
1110             '<(net_docs_script)',
1111             '--input_path',
1112             '<(net_docs_input_dir)',
1113             '--output_path',
1114             '<(net_docs_output_dir)',
1115             '<@(net_docs_sources)',
1116           ],
1117           'message': 'Rendering network stack documentation',
1118         }
1119       ],
1120     },
1121     {
1122       'target_name': 'http_server',
1123       'type': 'static_library',
1124       'variables': { 'enable_wexit_time_destructors': 1, },
1125       'dependencies': [
1126         '../base/base.gyp:base',
1127         'net',
1128       ],
1129       'sources': [
1130         'server/http_connection.cc',
1131         'server/http_connection.h',
1132         'server/http_server.cc',
1133         'server/http_server.h',
1134         'server/http_server_request_info.cc',
1135         'server/http_server_request_info.h',
1136         'server/http_server_response_info.cc',
1137         'server/http_server_response_info.h',
1138         'server/web_socket.cc',
1139         'server/web_socket.h',
1140         'server/web_socket_encoder.cc',
1141         'server/web_socket_encoder.h',
1142       ],
1143       # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1144       'msvs_disabled_warnings': [4267, ],
1145     },
1146     {
1147       'target_name': 'balsa',
1148       'type': 'static_library',
1149       'dependencies': [
1150         '../base/base.gyp:base',
1151         'net',
1152       ],
1153       'sources': [
1154         'tools/balsa/balsa_enums.h',
1155         'tools/balsa/balsa_frame.cc',
1156         'tools/balsa/balsa_frame.h',
1157         'tools/balsa/balsa_headers.cc',
1158         'tools/balsa/balsa_headers.h',
1159         'tools/balsa/balsa_headers_token_utils.cc',
1160         'tools/balsa/balsa_headers_token_utils.h',
1161         'tools/balsa/balsa_visitor_interface.h',
1162         'tools/balsa/http_message_constants.cc',
1163         'tools/balsa/http_message_constants.h',
1164         'tools/balsa/noop_balsa_visitor.h',
1165         'tools/balsa/simple_buffer.cc',
1166         'tools/balsa/simple_buffer.h',
1167         'tools/balsa/split.cc',
1168         'tools/balsa/split.h',
1169         'tools/balsa/string_piece_utils.h',
1170         'tools/quic/spdy_utils.cc',
1171         'tools/quic/spdy_utils.h',
1172       ],
1173     },
1174     {
1175       'target_name': 'dump_cache',
1176       'type': 'executable',
1177       'dependencies': [
1178         '../base/base.gyp:base',
1179         'net',
1180         'net_test_support',
1181       ],
1182       'sources': [
1183         'tools/dump_cache/cache_dumper.cc',
1184         'tools/dump_cache/cache_dumper.h',
1185         'tools/dump_cache/dump_cache.cc',
1186         'tools/dump_cache/dump_files.cc',
1187         'tools/dump_cache/dump_files.h',
1188         'tools/dump_cache/simple_cache_dumper.cc',
1189         'tools/dump_cache/simple_cache_dumper.h',
1190         'tools/dump_cache/url_to_filename_encoder.cc',
1191         'tools/dump_cache/url_to_filename_encoder.h',
1192         'tools/dump_cache/url_utilities.cc',
1193         'tools/dump_cache/url_utilities.h',
1194       ],
1195       # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1196       'msvs_disabled_warnings': [4267, ],
1197     },
1198     {
1199       # This is a temporary target which will be merged into 'net' once the
1200       # dependency on balsa is eliminated and the classes are actually used.
1201       'target_name': 'quic_tools',
1202       'type': 'static_library',
1203       'dependencies': [
1204         '../base/base.gyp:base',
1205         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
1206         '../url/url.gyp:url_lib',
1207         'net',
1208       ],
1209       'sources': [
1210         'quic/quic_dispatcher.cc',
1211         'quic/quic_dispatcher.h',
1212         'quic/quic_in_memory_cache.cc',
1213         'quic/quic_in_memory_cache.h',
1214         'quic/quic_per_connection_packet_writer.cc',
1215         'quic/quic_per_connection_packet_writer.h',
1216         'quic/quic_server.cc',
1217         'quic/quic_server.h',
1218         'quic/quic_server_packet_writer.cc',
1219         'quic/quic_server_packet_writer.h',
1220         'quic/quic_server_session.cc',
1221         'quic/quic_server_session.h',
1222         'quic/quic_spdy_server_stream.cc',
1223         'quic/quic_spdy_server_stream.h',
1224         'quic/quic_time_wait_list_manager.cc',
1225         'quic/quic_time_wait_list_manager.h',
1226       ],
1227     },
1228   ],
1229   'conditions': [
1230     ['use_v8_in_net == 1', {
1231       'targets': [
1232         {
1233           'target_name': 'net_with_v8',
1234           'type': '<(component)',
1235           'variables': { 'enable_wexit_time_destructors': 1, },
1236           'dependencies': [
1237             '../base/base.gyp:base',
1238             '../gin/gin.gyp:gin',
1239             '../url/url.gyp:url_lib',
1240             '../v8/tools/gyp/v8.gyp:v8',
1241             'net'
1242           ],
1243           'defines': [
1244             'NET_IMPLEMENTATION',
1245           ],
1246           'sources': [
1247             'proxy/proxy_resolver_v8.cc',
1248             'proxy/proxy_resolver_v8.h',
1249             'proxy/proxy_resolver_v8_tracing.cc',
1250             'proxy/proxy_resolver_v8_tracing.h',
1251             'proxy/proxy_service_v8.cc',
1252             'proxy/proxy_service_v8.h',
1253           ],
1254           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1255           'msvs_disabled_warnings': [4267, ],
1256         },
1257       ],
1258     }],
1259     ['use_v8_in_net == 1 and OS != "android"', {
1260       'targets': [
1261         {
1262           # GN version: //net/interfaces
1263           'target_name': 'net_interfaces',
1264           'type': 'static_library',
1265           'sources': [
1266             'interfaces/host_resolver_service.mojom',
1267             'interfaces/proxy_resolver_service.mojom',
1268           ],
1269           'includes': [
1270             '../third_party/mojo/mojom_bindings_generator.gypi',
1271           ],
1272         },
1273         {
1274           # GN version: //net:net_browser_services
1275           'target_name': 'net_browser_services',
1276           'type': 'static_library',
1277           'sources': [
1278             'dns/mojo_host_resolver_impl.cc',
1279             'dns/mojo_host_resolver_impl.h',
1280           ],
1281           'dependencies': [
1282             'mojo_type_converters',
1283             'net',
1284             'net_interfaces',
1285             '../mojo/mojo_base.gyp:mojo_environment_chromium',
1286             '../third_party/mojo/mojo_public.gyp:mojo_cpp_bindings',
1287           ],
1288         },
1289         {
1290           # GN version: //net:net_utility_services
1291           'target_name': 'net_utility_services',
1292           'type': 'static_library',
1293           'sources': [
1294             'dns/host_resolver_mojo.cc',
1295             'dns/host_resolver_mojo.h',
1296             'proxy/mojo_proxy_resolver_factory_impl.cc',
1297             'proxy/mojo_proxy_resolver_factory_impl.h',
1298             'proxy/mojo_proxy_resolver_impl.cc',
1299             'proxy/mojo_proxy_resolver_impl.h',
1300           ],
1301           'dependencies': [
1302             'mojo_type_converters',
1303             'net_interfaces',
1304             'net_with_v8',
1305             '../mojo/mojo_base.gyp:mojo_url_type_converters',
1306             '../third_party/mojo/mojo_public.gyp:mojo_cpp_bindings',
1307           ],
1308         },
1309         {
1310           # GN version: //net:mojo_type_converters
1311           'target_name': 'mojo_type_converters',
1312           'type': 'static_library',
1313           'sources': [
1314             'dns/mojo_host_type_converters.cc',
1315             'dns/mojo_host_type_converters.h',
1316             'proxy/mojo_proxy_type_converters.cc',
1317             'proxy/mojo_proxy_type_converters.h',
1318           ],
1319           'dependencies': [
1320             'net',
1321             'net_interfaces',
1322             '../third_party/mojo/mojo_public.gyp:mojo_cpp_bindings',
1323           ],
1324         },
1325       ],
1326     }],
1327     ['OS != "ios" and OS != "android"', {
1328       'targets': [
1329         # iOS doesn't have the concept of simple executables, these targets
1330         # can't be compiled on the platform.
1331         {
1332           'target_name': 'crash_cache',
1333           'type': 'executable',
1334           'dependencies': [
1335             '../base/base.gyp:base',
1336             'net',
1337             'net_test_support',
1338           ],
1339           'sources': [
1340             'tools/crash_cache/crash_cache.cc',
1341           ],
1342           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1343           'msvs_disabled_warnings': [4267, ],
1344         },
1345         {
1346           'target_name': 'crl_set_dump',
1347           'type': 'executable',
1348           'dependencies': [
1349             '../base/base.gyp:base',
1350             'net',
1351           ],
1352           'sources': [
1353             'tools/crl_set_dump/crl_set_dump.cc',
1354           ],
1355           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1356           'msvs_disabled_warnings': [4267, ],
1357         },
1358         {
1359           'target_name': 'dns_fuzz_stub',
1360           'type': 'executable',
1361           'dependencies': [
1362             '../base/base.gyp:base',
1363             'net',
1364           ],
1365           'sources': [
1366             'tools/dns_fuzz_stub/dns_fuzz_stub.cc',
1367           ],
1368           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1369           'msvs_disabled_warnings': [4267, ],
1370         },
1371         {
1372           'target_name': 'gdig',
1373           'type': 'executable',
1374           'dependencies': [
1375             '../base/base.gyp:base',
1376             'net',
1377           ],
1378           'sources': [
1379             'tools/gdig/file_net_log.cc',
1380             'tools/gdig/gdig.cc',
1381           ],
1382         },
1383         {
1384           'target_name': 'get_server_time',
1385           'type': 'executable',
1386           'dependencies': [
1387             '../base/base.gyp:base',
1388             '../base/base.gyp:base_i18n',
1389             '../url/url.gyp:url_lib',
1390             'net',
1391           ],
1392           'sources': [
1393             'tools/get_server_time/get_server_time.cc',
1394           ],
1395           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1396           'msvs_disabled_warnings': [4267, ],
1397         },
1398         {
1399           'target_name': 'hpack_example_generator',
1400           'type': 'executable',
1401           'dependencies': [
1402             '../base/base.gyp:base',
1403             'net',
1404           ],
1405           'sources': [
1406             'spdy/fuzzing/hpack_example_generator.cc',
1407           ],
1408           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1409           'msvs_disabled_warnings': [4267, ],
1410         },
1411         {
1412           'target_name': 'hpack_fuzz_mutator',
1413           'type': 'executable',
1414           'dependencies': [
1415             '../base/base.gyp:base',
1416             'net',
1417           ],
1418           'sources': [
1419             'spdy/fuzzing/hpack_fuzz_mutator.cc',
1420           ],
1421           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1422           'msvs_disabled_warnings': [4267, ],
1423         },
1424         {
1425           'target_name': 'hpack_fuzz_wrapper',
1426           'type': 'executable',
1427           'dependencies': [
1428             '../base/base.gyp:base',
1429             'net',
1430           ],
1431           'sources': [
1432             'spdy/fuzzing/hpack_fuzz_wrapper.cc',
1433           ],
1434           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1435           'msvs_disabled_warnings': [4267, ],
1436         },
1437         {
1438           'target_name': 'net_watcher',
1439           'type': 'executable',
1440           'dependencies': [
1441             '../base/base.gyp:base',
1442             'net',
1443             'net_with_v8',
1444           ],
1445           'conditions': [
1446             [ 'use_glib == 1', {
1447                 'dependencies': [
1448                   '../build/linux/system.gyp:gconf',
1449                   '../build/linux/system.gyp:gio',
1450                 ],
1451               },
1452             ],
1453           ],
1454           'sources': [
1455             'tools/net_watcher/net_watcher.cc',
1456           ],
1457         },
1458         {
1459           'target_name': 'run_testserver',
1460           'type': 'executable',
1461           'dependencies': [
1462             '../base/base.gyp:base',
1463             '../base/base.gyp:test_support_base',
1464             '../testing/gtest.gyp:gtest',
1465             'net_test_support',
1466           ],
1467           'sources': [
1468             'tools/testserver/run_testserver.cc',
1469           ],
1470         },
1471         {
1472           'target_name': 'stress_cache',
1473           'type': 'executable',
1474           'dependencies': [
1475             '../base/base.gyp:base',
1476             'net',
1477             'net_test_support',
1478           ],
1479           'sources': [
1480             'tools/stress_cache/stress_cache.cc',
1481           ],
1482           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1483           'msvs_disabled_warnings': [4267, ],
1484         },
1485         {
1486           'target_name': 'tld_cleanup',
1487           'type': 'executable',
1488           'dependencies': [
1489             '../base/base.gyp:base',
1490             '../base/base.gyp:base_i18n',
1491             '../net/tools/tld_cleanup/tld_cleanup.gyp:tld_cleanup_util',
1492           ],
1493           'sources': [
1494             'tools/tld_cleanup/tld_cleanup.cc',
1495           ],
1496           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1497           'msvs_disabled_warnings': [4267, ],
1498         },
1499       ],
1500     }],
1501     ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android"', {
1502       'targets': [
1503         {
1504           'target_name': 'epoll_server',
1505           'type': 'static_library',
1506           'dependencies': [
1507             '../base/base.gyp:base',
1508             'net',
1509           ],
1510           'sources': [
1511             'tools/epoll_server/epoll_server.cc',
1512             'tools/epoll_server/epoll_server.h',
1513           ],
1514         },
1515         {
1516           'target_name': 'flip_in_mem_edsm_server_base',
1517           'type': 'static_library',
1518           'cflags': [
1519             '-Wno-deprecated',
1520           ],
1521           'dependencies': [
1522             '../base/base.gyp:base',
1523             '../third_party/boringssl/boringssl.gyp:boringssl',
1524             'balsa',
1525             'epoll_server',
1526             'net',
1527           ],
1528           'sources': [
1529             'tools/dump_cache/url_to_filename_encoder.cc',
1530             'tools/dump_cache/url_to_filename_encoder.h',
1531             'tools/dump_cache/url_utilities.cc',
1532             'tools/dump_cache/url_utilities.h',
1533             'tools/flip_server/acceptor_thread.cc',
1534             'tools/flip_server/acceptor_thread.h',
1535             'tools/flip_server/constants.h',
1536             'tools/flip_server/create_listener.cc',
1537             'tools/flip_server/create_listener.h',
1538             'tools/flip_server/flip_config.cc',
1539             'tools/flip_server/flip_config.h',
1540             'tools/flip_server/http_interface.cc',
1541             'tools/flip_server/http_interface.h',
1542             'tools/flip_server/loadtime_measurement.h',
1543             'tools/flip_server/mem_cache.cc',
1544             'tools/flip_server/mem_cache.h',
1545             'tools/flip_server/output_ordering.cc',
1546             'tools/flip_server/output_ordering.h',
1547             'tools/flip_server/ring_buffer.cc',
1548             'tools/flip_server/ring_buffer.h',
1549             'tools/flip_server/sm_connection.cc',
1550             'tools/flip_server/sm_connection.h',
1551             'tools/flip_server/sm_interface.h',
1552             'tools/flip_server/spdy_interface.cc',
1553             'tools/flip_server/spdy_interface.h',
1554             'tools/flip_server/spdy_ssl.cc',
1555             'tools/flip_server/spdy_ssl.h',
1556             'tools/flip_server/spdy_util.cc',
1557             'tools/flip_server/spdy_util.h',
1558             'tools/flip_server/streamer_interface.cc',
1559             'tools/flip_server/streamer_interface.h',
1560           ],
1561         },
1562         {
1563           'target_name': 'flip_in_mem_edsm_server_unittests',
1564           'type': 'executable',
1565           'dependencies': [
1566               '../testing/gtest.gyp:gtest',
1567               '../testing/gmock.gyp:gmock',
1568               '../third_party/boringssl/boringssl.gyp:boringssl',
1569               'flip_in_mem_edsm_server_base',
1570               'net',
1571               'net_test_support',
1572           ],
1573           'sources': [
1574             'tools/flip_server/flip_test_utils.cc',
1575             'tools/flip_server/flip_test_utils.h',
1576             'tools/flip_server/http_interface_test.cc',
1577             'tools/flip_server/mem_cache_test.cc',
1578             'tools/flip_server/run_all_tests.cc',
1579             'tools/flip_server/spdy_interface_test.cc',
1580           ],
1581         },
1582         {
1583           'target_name': 'flip_in_mem_edsm_server',
1584           'type': 'executable',
1585           'cflags': [
1586             '-Wno-deprecated',
1587           ],
1588           'dependencies': [
1589             '../base/base.gyp:base',
1590             'flip_in_mem_edsm_server_base',
1591             'net',
1592           ],
1593           'sources': [
1594             'tools/flip_server/flip_in_mem_edsm_server.cc',
1595           ],
1596         },
1597         {
1598           'target_name': 'quic_base',
1599           'type': 'static_library',
1600           'dependencies': [
1601             '../base/base.gyp:base',
1602             '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
1603             '../url/url.gyp:url_lib',
1604             'balsa',
1605             'epoll_server',
1606             'net',
1607           ],
1608           'sources': [
1609             'tools/quic/quic_client.cc',
1610             'tools/quic/quic_client.h',
1611             'tools/quic/quic_client_session.cc',
1612             'tools/quic/quic_client_session.h',
1613             'tools/quic/quic_default_packet_writer.cc',
1614             'tools/quic/quic_default_packet_writer.h',
1615             'tools/quic/quic_dispatcher.cc',
1616             'tools/quic/quic_dispatcher.h',
1617             'tools/quic/quic_epoll_clock.cc',
1618             'tools/quic/quic_epoll_clock.h',
1619             'tools/quic/quic_epoll_connection_helper.cc',
1620             'tools/quic/quic_epoll_connection_helper.h',
1621             'tools/quic/quic_in_memory_cache.cc',
1622             'tools/quic/quic_in_memory_cache.h',
1623             'tools/quic/quic_packet_writer_wrapper.cc',
1624             'tools/quic/quic_packet_writer_wrapper.h',
1625             'tools/quic/quic_per_connection_packet_writer.cc',
1626             'tools/quic/quic_per_connection_packet_writer.h',
1627             'tools/quic/quic_server.cc',
1628             'tools/quic/quic_server.h',
1629             'tools/quic/quic_server_session.cc',
1630             'tools/quic/quic_server_session.h',
1631             'tools/quic/quic_socket_utils.cc',
1632             'tools/quic/quic_socket_utils.h',
1633             'tools/quic/quic_spdy_client_stream.cc',
1634             'tools/quic/quic_spdy_client_stream.h',
1635             'tools/quic/quic_spdy_server_stream.cc',
1636             'tools/quic/quic_spdy_server_stream.h',
1637             'tools/quic/quic_time_wait_list_manager.cc',
1638             'tools/quic/quic_time_wait_list_manager.h',
1639           ],
1640         },
1641         {
1642           'target_name': 'quic_client',
1643           'type': 'executable',
1644           'dependencies': [
1645             '../base/base.gyp:base',
1646             'net',
1647             'quic_base',
1648           ],
1649           'sources': [
1650             'tools/quic/quic_client_bin.cc',
1651           ],
1652         },
1653         {
1654           'target_name': 'quic_server',
1655           'type': 'executable',
1656           'dependencies': [
1657             '../base/base.gyp:base',
1658             'net',
1659             'quic_tools',
1660           ],
1661           'sources': [
1662             'quic/quic_server_bin.cc',
1663           ],
1664         },
1665       ]
1666     }],
1667     ['OS=="android"', {
1668       'targets': [
1669         {
1670           'target_name': 'net_jni_headers',
1671           'type': 'none',
1672           'sources': [
1673             'android/java/src/org/chromium/net/AndroidCertVerifyResult.java',
1674             'android/java/src/org/chromium/net/AndroidKeyStore.java',
1675             'android/java/src/org/chromium/net/AndroidNetworkLibrary.java',
1676             'android/java/src/org/chromium/net/AndroidPrivateKey.java',
1677             'android/java/src/org/chromium/net/GURLUtils.java',
1678             'android/java/src/org/chromium/net/NetworkChangeNotifier.java',
1679             'android/java/src/org/chromium/net/ProxyChangeListener.java',
1680             'android/java/src/org/chromium/net/X509Util.java',
1681           ],
1682           'variables': {
1683             'jni_gen_package': 'net',
1684           },
1685           'includes': [ '../build/jni_generator.gypi' ],
1687           'conditions': [
1688             ['use_icu_alternatives_on_android==1', {
1689               'sources': [
1690                 'android/java/src/org/chromium/net/NetStringUtil.java',
1691               ],
1692             }],
1693           ],
1694         },
1695         {
1696           'target_name': 'net_test_jni_headers',
1697           'type': 'none',
1698           'sources': [
1699             'android/javatests/src/org/chromium/net/AndroidKeyStoreTestUtil.java',
1700           ],
1701           'variables': {
1702             'jni_gen_package': 'net',
1703           },
1704           'includes': [ '../build/jni_generator.gypi' ],
1705         },
1706         {
1707           'target_name': 'net_java',
1708           'type': 'none',
1709           'variables': {
1710             'java_in_dir': '../net/android/java',
1711           },
1712           'dependencies': [
1713             '../base/base.gyp:base',
1714             'cert_verify_status_android_java',
1715             'certificate_mime_types_java',
1716             'network_change_notifier_types_java',
1717             'net_errors_java',
1718             'private_key_types_java',
1719             'remote_android_keystore_aidl',
1720           ],
1721           'includes': [ '../build/java.gypi' ],
1722         },
1723         {
1724           # Processes the interface files for communication with an Android KeyStore
1725           # running in a separate process.
1726           'target_name': 'remote_android_keystore_aidl',
1727           'type': 'none',
1728           'variables': {
1729             'aidl_interface_file': '../net/android/java/src/org/chromium/net/IRemoteAndroidKeyStoreInterface.aidl',
1730           },
1731           'sources': [
1732             '../net/android/java/src/org/chromium/net/IRemoteAndroidKeyStore.aidl',
1733             '../net/android/java/src/org/chromium/net/IRemoteAndroidKeyStoreCallbacks.aidl',
1734           ],
1735           'includes': [ '../build/java_aidl.gypi' ],
1736         },
1737         {
1738           'target_name': 'net_java_test_support',
1739           'type': 'none',
1740           'variables': {
1741             'java_in_dir': '../net/test/android/javatests',
1742           },
1743           'includes': [ '../build/java.gypi' ],
1744         },
1745         {
1746           'target_name': 'net_javatests',
1747           'type': 'none',
1748           'variables': {
1749             'java_in_dir': '../net/android/javatests',
1750           },
1751           'dependencies': [
1752             '../base/base.gyp:base',
1753             '../base/base.gyp:base_java_test_support',
1754             'net_java',
1755           ],
1756           'includes': [ '../build/java.gypi' ],
1757         },
1758         {
1759           'target_name': 'net_errors_java',
1760           'type': 'none',
1761           'sources': [
1762             'android/java/NetError.template',
1763           ],
1764           'variables': {
1765             'package_name': 'org/chromium/net',
1766             'template_deps': ['base/net_error_list.h'],
1767           },
1768           'includes': [ '../build/android/java_cpp_template.gypi' ],
1769         },
1770         {
1771           'target_name': 'certificate_mime_types_java',
1772           'type': 'none',
1773           'variables': {
1774             'source_file': 'base/mime_util.h',
1775           },
1776           'includes': [ '../build/android/java_cpp_enum.gypi' ],
1777         },
1778         {
1779           'target_name': 'cert_verify_status_android_java',
1780           'type': 'none',
1781           'variables': {
1782             'source_file': 'android/cert_verify_result_android.h',
1783           },
1784           'includes': [ '../build/android/java_cpp_enum.gypi' ],
1785         },
1786         {
1787           'target_name': 'network_change_notifier_types_java',
1788           'type': 'none',
1789           'variables': {
1790             'source_file': 'base/network_change_notifier.h',
1791           },
1792           'includes': [ '../build/android/java_cpp_enum.gypi' ],
1793         },
1794         {
1795           'target_name': 'private_key_types_java',
1796           'type': 'none',
1797           'variables': {
1798             'source_file': 'android/keystore.h',
1799           },
1800           'includes': [ '../build/android/java_cpp_enum.gypi' ],
1801         },
1802         {
1803           'target_name': 'net_unittests_apk',
1804           'type': 'none',
1805           'dependencies': [
1806             'net_java',
1807             'net_javatests',
1808             'net_unittests',
1809           ],
1810           'conditions': [
1811             ['v8_use_external_startup_data==1', {
1812               'dependencies': [
1813                 '../v8/tools/gyp/v8.gyp:v8_external_snapshot',
1814               ],
1815               'copies': [
1816                 {
1817                 'destination': '<(asset_location)',
1818                   'files': [
1819                     '<(PRODUCT_DIR)/natives_blob.bin',
1820                     '<(PRODUCT_DIR)/snapshot_blob.bin',
1821                   ],
1822                 },
1823               ],
1824             }],
1825           ],
1826           'variables': {
1827             'test_suite_name': 'net_unittests',
1828             'conditions': [
1829               ['v8_use_external_startup_data==1', {
1830                 'asset_location': '<(PRODUCT_DIR)/net_unittests_apk/assets',
1831                 'additional_input_paths': [
1832                   '<(PRODUCT_DIR)/net_unittests_apk/assets/natives_blob.bin',
1833                   '<(PRODUCT_DIR)/net_unittests_apk/assets/snapshot_blob.bin',
1834                 ],
1835                 'inputs': [
1836                   '<(PRODUCT_DIR)/natives_blob.bin',
1837                   '<(PRODUCT_DIR)/snapshot_blob.bin',
1838                 ],
1839               }],
1840             ],
1841           },
1842           'includes': [ '../build/apk_test.gypi' ],
1843         },
1844       ],
1845     }],
1846     ['OS == "android" or OS == "linux"', {
1847       'targets': [
1848         {
1849           'target_name': 'disk_cache_memory_test',
1850           'type': 'executable',
1851           'dependencies': [
1852             '../base/base.gyp:base',
1853             'net',
1854           ],
1855           'sources': [
1856             'tools/disk_cache_memory_test/disk_cache_memory_test.cc',
1857           ],
1858         },
1859       ],
1860     }],
1861     ['test_isolation_mode != "noop"', {
1862       'targets': [
1863         {
1864           'target_name': 'net_unittests_run',
1865           'type': 'none',
1866           'dependencies': [
1867             'net_unittests',
1868           ],
1869           'includes': [
1870             '../build/isolate.gypi',
1871           ],
1872           'sources': [
1873             'net_unittests.isolate',
1874           ],
1875         },
1876       ],
1877     }],
1878   ],