Don't include a hash in settings/manageProfile.
[chromium-blink-merge.git] / net / net.gyp
blob8a292aa1864cd5c3a444f338c46abb88e20e4bc0
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.h',
148             'http/http_auth_handler_negotiate.cc',
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/url_request_file_dir_job.cc',
176             'url_request/url_request_file_dir_job.h',
177             'url_request/url_request_file_job.cc',
178             'url_request/url_request_file_job.h',
179             'url_request/file_protocol_handler.cc',
180             'url_request/file_protocol_handler.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/sha256_legacy_support_nss_win.cc',
224               'cert/scoped_nss_types.h',
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               'crypto/scoped_openssl_types.h',
266               'quic/crypto/aead_base_decrypter_openssl.cc',
267               'quic/crypto/aead_base_encrypter_openssl.cc',
268               'quic/crypto/aes_128_gcm_12_decrypter_openssl.cc',
269               'quic/crypto/aes_128_gcm_12_encrypter_openssl.cc',
270               'quic/crypto/chacha20_poly1305_decrypter_openssl.cc',
271               'quic/crypto/chacha20_poly1305_encrypter_openssl.cc',
272               'quic/crypto/channel_id_openssl.cc',
273               'quic/crypto/p256_key_exchange_openssl.cc',
274               'quic/crypto/scoped_evp_aead_ctx.cc',
275               'quic/crypto/scoped_evp_aead_ctx.h',
276               'socket/ssl_client_socket_openssl.cc',
277               'socket/ssl_client_socket_openssl.h',
278               'socket/ssl_server_socket_openssl.cc',
279               'socket/ssl_server_socket_openssl.h',
280               'socket/ssl_session_cache_openssl.cc',
281               'socket/ssl_session_cache_openssl.h',
282               'ssl/openssl_platform_key_mac.cc',
283               'ssl/openssl_platform_key_win.cc',
284               'ssl/openssl_platform_key.h',
285               'ssl/openssl_ssl_util.cc',
286               'ssl/openssl_ssl_util.h',
287             ],
288             'conditions': [
289               # Pull in the bundled or system NSS as appropriate.
290               [ 'desktop_linux == 1 or chromeos == 1', {
291                 'dependencies': [
292                   '../build/linux/system.gyp:ssl',
293                 ],
294               }, {
295                 'dependencies': [
296                   '../third_party/nss/nss.gyp:nspr',
297                   '../third_party/nss/nss.gyp:nss',
298                   'third_party/nss/ssl.gyp:libssl',
299                 ],
300               }]
301             ],
302             # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
303             'msvs_disabled_warnings': [4267, ],
304           },
305         ],
306         [ 'use_openssl_certs == 0', {
307             'sources!': [
308               'base/keygen_handler_openssl.cc',
309               'base/openssl_private_key_store.h',
310               'base/openssl_private_key_store_android.cc',
311               'base/openssl_private_key_store_memory.cc',
312               'cert/cert_database_openssl.cc',
313               'cert/cert_verify_proc_openssl.cc',
314               'cert/cert_verify_proc_openssl.h',
315               'cert/test_root_certs_openssl.cc',
316               'cert/x509_certificate_openssl.cc',
317               'ssl/openssl_client_key_store.cc',
318               'ssl/openssl_client_key_store.h',
319             ],
320         }],
321         [ 'use_glib == 1', {
322             'dependencies': [
323               '../build/linux/system.gyp:gconf',
324               '../build/linux/system.gyp:gio',
325             ],
326         }],
327         [ 'desktop_linux == 1 or chromeos == 1', {
328             'conditions': [
329               ['os_bsd==1', {
330                 'sources!': [
331                   'base/network_change_notifier_linux.cc',
332                   'base/network_change_notifier_netlink_linux.cc',
333                   'proxy/proxy_config_service_linux.cc',
334                 ],
335               },{
336                 'dependencies': [
337                   '../build/linux/system.gyp:libresolv',
338                 ],
339               }],
340               ['OS=="solaris"', {
341                 'link_settings': {
342                   'ldflags': [
343                     '-R/usr/lib/mps',
344                   ],
345                 },
346               }],
347             ],
348           },
349           {  # else: OS is not in the above list
350             'sources!': [
351               'base/crypto_module_nss.cc',
352               'base/keygen_handler_nss.cc',
353               'cert/cert_database_nss.cc',
354               'cert/nss_cert_database.cc',
355               'cert/nss_cert_database.h',
356               'cert/test_root_certs_nss.cc',
357               'cert/x509_certificate_nss.cc',
358               'ocsp/nss_ocsp.cc',
359               'ocsp/nss_ocsp.h',
360               'third_party/mozilla_security_manager/nsKeygenHandler.cpp',
361               'third_party/mozilla_security_manager/nsKeygenHandler.h',
362               'third_party/mozilla_security_manager/nsNSSCertificateDB.cpp',
363               'third_party/mozilla_security_manager/nsNSSCertificateDB.h',
364               'third_party/mozilla_security_manager/nsPKCS12Blob.cpp',
365               'third_party/mozilla_security_manager/nsPKCS12Blob.h',
366             ],
367           },
368         ],
369         [ 'use_nss != 1', {
370             'sources!': [
371               'cert/cert_verify_proc_nss.cc',
372               'cert/cert_verify_proc_nss.h',
373               'ssl/client_cert_store_nss.cc',
374               'ssl/client_cert_store_nss.h',
375               'ssl/client_cert_store_chromeos.cc',
376               'ssl/client_cert_store_chromeos.h',
377             ],
378         }],
379         [ 'enable_websockets != 1', {
380             'sources/': [
381               ['exclude', '^socket_stream/'],
382               ['exclude', '^websockets/'],
383             ],
384             'sources!': [
385               'spdy/spdy_websocket_stream.cc',
386               'spdy/spdy_websocket_stream.h',
387             ],
388         }],
389         [ 'enable_mdns != 1', {
390             'sources!' : [
391               'dns/mdns_cache.cc',
392               'dns/mdns_cache.h',
393               'dns/mdns_client.cc',
394               'dns/mdns_client.h',
395               'dns/mdns_client_impl.cc',
396               'dns/mdns_client_impl.h',
397               'dns/record_parsed.cc',
398               'dns/record_parsed.h',
399               'dns/record_rdata.cc',
400               'dns/record_rdata.h',
401             ]
402         }],
403         [ 'OS == "win"', {
404             'sources!': [
405               'http/http_auth_handler_ntlm_portable.cc',
406               'socket/socket_libevent.cc',
407               'socket/socket_libevent.h',
408               'socket/tcp_socket_libevent.cc',
409               'socket/tcp_socket_libevent.h',
410               'udp/udp_socket_libevent.cc',
411               'udp/udp_socket_libevent.h',
412             ],
413           }, { # else: OS != "win"
414             'sources!': [
415               'base/winsock_init.cc',
416               'base/winsock_init.h',
417               'base/winsock_util.cc',
418               'base/winsock_util.h',
419               'proxy/proxy_resolver_winhttp.cc',
420               'proxy/proxy_resolver_winhttp.h',
421             ],
422           },
423         ],
424         [ 'OS == "mac"', {
425             'link_settings': {
426               'libraries': [
427                 '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
428                 '$(SDKROOT)/System/Library/Frameworks/Security.framework',
429                 '$(SDKROOT)/System/Library/Frameworks/SystemConfiguration.framework',
430                 '$(SDKROOT)/usr/lib/libresolv.dylib',
431               ]
432             },
433           },
434         ],
435         [ 'OS == "ios"', {
436             'sources!': [
437               'disk_cache/blockfile/file_posix.cc',
438             ],
439             'link_settings': {
440               'libraries': [
441                 '$(SDKROOT)/System/Library/Frameworks/CFNetwork.framework',
442                 '$(SDKROOT)/System/Library/Frameworks/MobileCoreServices.framework',
443                 '$(SDKROOT)/System/Library/Frameworks/Security.framework',
444                 '$(SDKROOT)/System/Library/Frameworks/SystemConfiguration.framework',
445                 '$(SDKROOT)/usr/lib/libresolv.dylib',
446               ],
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           ],
496         }],
497         ['OS == "ios"', {
498           'sources/': [
499             ['include', '^base/network_change_notifier_mac\\.cc$'],
500             ['include', '^base/network_config_watcher_mac\\.cc$'],
501             ['include', '^base/platform_mime_util_mac\\.mm$'],
502             # The iOS implementation only partially uses NSS and thus does not
503             # defines |use_nss|. In particular the |USE_NSS| preprocessor
504             # definition is not used. The following files are needed though:
505             ['include', '^cert/cert_verify_proc_nss\\.cc$'],
506             ['include', '^cert/cert_verify_proc_nss\\.h$'],
507             ['include', '^cert/test_root_certs_nss\\.cc$'],
508             ['include', '^cert/x509_util_nss\\.cc$'],
509             ['include', '^cert/x509_util_nss\\.h$'],
510             ['include', '^proxy/proxy_resolver_mac\\.cc$'],
511             ['include', '^proxy/proxy_server_mac\\.cc$'],
512             ['include', '^ocsp/nss_ocsp\\.cc$'],
513             ['include', '^ocsp/nss_ocsp\\.h$'],
514           ],
515         }],
516       ],
517     },
518     {
519       'target_name': 'net_unittests',
520       'type': '<(gtest_target_type)',
521       'dependencies': [
522         '../base/base.gyp:base',
523         '../base/base.gyp:base_i18n',
524         '../base/base.gyp:base_prefs_test_support',
525         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
526         '../crypto/crypto.gyp:crypto',
527         '../crypto/crypto.gyp:crypto_test_support',
528         '../testing/gmock.gyp:gmock',
529         '../testing/gtest.gyp:gtest',
530         '../third_party/zlib/zlib.gyp:zlib',
531         '../url/url.gyp:url_lib',
532         'balsa',
533         'http_server',
534         'net',
535         'net_derived_sources',
536         'net_extras',
537         'net_test_support',
538         'quic_tools',
539       ],
540       'sources': [
541         '<@(net_test_sources)',
542       ],
543       'conditions': [
544         ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android"', {
545           'dependencies': [
546             'epoll_server',
547             'flip_in_mem_edsm_server_base',
548             'quic_base',
549           ],
550           'sources': [
551             '<@(net_linux_test_sources)',
552           ],
553         }],
554         ['chromeos==1', {
555           'sources!': [
556             'proxy/proxy_config_service_linux_unittest.cc',
557           ],
558         }],
559         [ 'OS == "android"', {
560           'sources!': [
561             # See bug http://crbug.com/344533.
562             'disk_cache/blockfile/index_table_v3_unittest.cc',
563             # No res_ninit() et al on Android, so this doesn't make a lot of
564             # sense.
565             'dns/dns_config_service_posix_unittest.cc',
566           ],
567           'dependencies': [
568             'net_javatests',
569             'net_test_jni_headers',
570           ],
571         }],
572         [ 'use_nss != 1', {
573           'sources!': [
574             'ssl/client_cert_store_nss_unittest.cc',
575             'ssl/client_cert_store_chromeos_unittest.cc',
576           ],
577         }],
578         [ 'use_openssl == 1', {
579           # Avoid compiling/linking with the system library.
580           'dependencies': [
581             '../third_party/boringssl/boringssl.gyp:boringssl',
582           ],
583         }, {  # use_openssl == 0
584           'conditions': [
585             [ 'desktop_linux == 1 or chromeos == 1', {
586               'dependencies': [
587                 '../build/linux/system.gyp:ssl',
588               ],
589             }, {  # desktop_linux == 0 and chromeos == 0
590               'dependencies': [
591                 '../third_party/nss/nss.gyp:nspr',
592                 '../third_party/nss/nss.gyp:nss',
593                 'third_party/nss/ssl.gyp:libssl',
594               ],
595               'sources!': [
596                 'cert/nss_cert_database_unittest.cc',
597               ],
598             }],
599           ],
600           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
601           'msvs_disabled_warnings': [4267, ],
602         }],
603         [ 'os_posix == 1 and OS != "mac" and OS != "android" and OS != "ios"', {
604           'conditions': [
605             ['use_allocator!="none"', {
606               'dependencies': [
607                 '../base/allocator/allocator.gyp:allocator',
608               ],
609             }],
610           ],
611         }],
612         [ 'use_kerberos==1', {
613           'defines': [
614             'USE_KERBEROS',
615           ],
616         }, { # use_kerberos == 0
617           'sources!': [
618             'http/http_auth_gssapi_posix_unittest.cc',
619             'http/http_auth_handler_negotiate_unittest.cc',
620             'http/mock_gssapi_library_posix.cc',
621             'http/mock_gssapi_library_posix.h',
622           ],
623         }],
624         [ 'use_openssl == 1 or (desktop_linux == 0 and chromeos == 0 and OS != "ios")', {
625           # Only include this test when on Posix and using NSS for
626           # cert verification or on iOS (which also uses NSS for certs).
627           'sources!': [
628             'ocsp/nss_ocsp_unittest.cc',
629           ],
630         }],
631         [ 'use_openssl==1', {
632             # When building for OpenSSL, we need to exclude NSS specific tests
633             # or functionality not supported by OpenSSL yet.
634             # TODO(bulach): Add equivalent tests when the underlying
635             #               functionality is ported to OpenSSL.
636             'sources!': [
637               'cert/nss_cert_database_unittest.cc',
638               'cert/nss_cert_database_chromeos_unittest.cc',
639               'cert/nss_profile_filter_chromeos_unittest.cc',
640               'cert/x509_util_nss_unittest.cc',
641               'quic/test_tools/crypto_test_utils_nss.cc',
642             ],
643           }, {  # else !use_openssl: remove the unneeded files and pull in NSS.
644             'sources!': [
645               'cert/x509_util_openssl_unittest.cc',
646               'quic/test_tools/crypto_test_utils_openssl.cc',
647               'socket/ssl_client_socket_openssl_unittest.cc',
648               'socket/ssl_session_cache_openssl_unittest.cc',
649             ],
650           },
651         ],
652         [ 'use_openssl_certs == 0', {
653             'sources!': [
654               'ssl/openssl_client_key_store_unittest.cc',
655             ],
656         }],
657         [ 'enable_websockets != 1', {
658             'sources/': [
659               ['exclude', '^socket_stream/'],
660               ['exclude', '^websockets/'],
661               ['exclude', '^spdy/spdy_websocket_stream_unittest\\.cc$'],
662             ],
663         }],
664         ['disable_file_support==1', {
665           'sources!': [
666             'base/directory_lister_unittest.cc',
667             'url_request/url_request_file_job_unittest.cc',
668           ],
669         }],
670         [ 'disable_ftp_support==1', {
671             'sources/': [
672               ['exclude', '^ftp/'],
673             ],
674             'sources!': [
675               'url_request/url_request_ftp_job_unittest.cc',
676             ],
677           },
678         ],
679         [ 'enable_built_in_dns!=1', {
680             'sources!': [
681               'dns/address_sorter_posix_unittest.cc',
682               'dns/address_sorter_unittest.cc',
683             ],
684           },
685         ],
686         # Always need use_v8_in_net to be 1 to run gyp on Android, so just
687         # remove net_unittest's dependency on v8 when using icu alternatives
688         # instead of setting use_v8_in_net to 0.
689         [ 'use_v8_in_net==1 and use_icu_alternatives_on_android==0', {
690             'dependencies': [
691               'net_with_v8',
692             ],
693           }, {  # else: !use_v8_in_net
694             'sources!': [
695               'proxy/proxy_resolver_v8_unittest.cc',
696               'proxy/proxy_resolver_v8_tracing_unittest.cc',
697             ],
698           },
699         ],
701         [ 'enable_mdns != 1', {
702             'sources!' : [
703               'dns/mdns_cache_unittest.cc',
704               'dns/mdns_client_unittest.cc',
705               'dns/mdns_query_unittest.cc',
706               'dns/record_parsed_unittest.cc',
707               'dns/record_rdata_unittest.cc',
708             ],
709         }],
710         [ 'OS == "win"', {
711             'sources!': [
712               'dns/dns_config_service_posix_unittest.cc',
713               'http/http_auth_gssapi_posix_unittest.cc',
714             ],
715             'conditions': [
716               [ 'icu_use_data_file_flag == 0', {
717                 # This is needed to trigger the dll copy step on windows.
718                 # TODO(mark): Specifying this here shouldn't be necessary.
719                 'dependencies': [
720                   '../third_party/icu/icu.gyp:icudata',
721                 ],
722               }],
723             ],
724           },
725         ],
726         [ 'OS == "ios"', {
727             'actions': [
728               {
729                 'action_name': 'copy_test_data',
730                 'variables': {
731                   'test_data_files': [
732                     'data/ssl/certificates/',
733                     'data/test.html',
734                     'data/url_request_unittest/',
735                   ],
736                   'test_data_prefix': 'net',
737                 },
738                 'includes': [ '../build/copy_test_data_ios.gypi' ],
739               },
740             ],
741             'sources!': [
742               # TODO(droger): The following tests are disabled because the
743               # implementation is missing or incomplete.
744               # KeygenHandler::GenKeyAndSignChallenge() is not ported to iOS.
745               'base/keygen_handler_unittest.cc',
746               'disk_cache/backend_unittest.cc',
747               'disk_cache/blockfile/block_files_unittest.cc',
748               # Need to read input data files.
749               'filter/gzip_filter_unittest.cc',
750               'socket/ssl_server_socket_unittest.cc',
751               'spdy/fuzzing/hpack_fuzz_util_test.cc',
752               # Need TestServer.
753               'proxy/proxy_script_fetcher_impl_unittest.cc',
754               'socket/ssl_client_socket_unittest.cc',
755               'url_request/url_fetcher_impl_unittest.cc',
756               'url_request/url_request_context_builder_unittest.cc',
757               # Needs GetAppOutput().
758               'test/python_utils_unittest.cc',
760               # The following tests are disabled because they don't apply to
761               # iOS.
762               # OS is not "linux" or "freebsd" or "openbsd".
763               'socket/unix_domain_client_socket_posix_unittest.cc',
764               'socket/unix_domain_listen_socket_posix_unittest.cc',
765               'socket/unix_domain_server_socket_posix_unittest.cc',
767               # See bug http://crbug.com/344533.
768               'disk_cache/blockfile/index_table_v3_unittest.cc',
769             ],
770         }],
771         [ 'OS == "android"', {
772             'sources!': [
773               'dns/dns_config_service_posix_unittest.cc',
774             ],
775           },
776         ],
777         ['OS == "android"', {
778           # TODO(mmenke):  This depends on test_support_base, which depends on
779           #                icu.  Figure out a way to remove that dependency.
780           'dependencies': [
781             '../testing/android/native_test.gyp:native_test_native_code',
782           ]
783         }],
784         [ 'use_icu_alternatives_on_android == 1', {
785             'dependencies!': [
786               '../base/base.gyp:base_i18n',
787             ],
788             'sources!': [
789               'base/filename_util_unittest.cc',
790               'base/net_util_icu_unittest.cc',
791             ],
792           },
793         ],
794         ['v8_use_external_startup_data==1', {
795           'dependencies': [
796             '../gin/gin.gyp:gin',
797           ]
798         }],
799       ],
800       'target_conditions': [
801         # These source files are excluded by default platform rules, but they
802         # are needed in specific cases on other platforms. Re-including them can
803         # only be done in target_conditions as it is evaluated after the
804         # platform rules.
805         ['OS == "android"', {
806           'sources/': [
807             ['include', '^base/address_tracker_linux_unittest\\.cc$'],
808           ],
809         }],
810       ],
811     },
812     {
813       'target_name': 'net_perftests',
814       'type': 'executable',
815       'dependencies': [
816         '../base/base.gyp:base',
817         '../base/base.gyp:base_i18n',
818         '../base/base.gyp:test_support_perf',
819         '../testing/gtest.gyp:gtest',
820         '../url/url.gyp:url_lib',
821         'net',
822         'net_test_support',
823       ],
824       'sources': [
825         'cookies/cookie_monster_perftest.cc',
826         'disk_cache/blockfile/disk_cache_perftest.cc',
827         'proxy/proxy_resolver_perftest.cc',
828         'websockets/websocket_frame_perftest.cc',
829       ],
830       'conditions': [
831         [ 'use_v8_in_net==1', {
832             'dependencies': [
833               'net_with_v8',
834             ],
835           }, {  # else: !use_v8_in_net
836             'sources!': [
837               'proxy/proxy_resolver_perftest.cc',
838             ],
839           },
840         ],
841         [ 'OS == "win"', {
842             'conditions': [
843               [ 'icu_use_data_file_flag == 0', {
844                 # This is needed to trigger the dll copy step on windows.
845                 # TODO(mark): Specifying this here shouldn't be necessary.
846                 'dependencies': [
847                   '../third_party/icu/icu.gyp:icudata',
848                 ],
849               }],
850             ],
851             # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
852             'msvs_disabled_warnings': [4267, ],
853         }],
854         [ 'enable_websockets != 1', {
855           'sources!': [
856             'websockets/websocket_frame_perftest.cc',
857           ],
858         }],
859       ],
860     },
861     {
862       'target_name': 'net_test_support',
863       'type': 'static_library',
864       'dependencies': [
865         '../base/base.gyp:base',
866         '../base/base.gyp:test_support_base',
867         '../net/tools/tld_cleanup/tld_cleanup.gyp:tld_cleanup_util',
868         '../testing/gtest.gyp:gtest',
869         '../testing/gmock.gyp:gmock',
870         '../url/url.gyp:url_lib',
871         'net',
872       ],
873       'export_dependent_settings': [
874         '../base/base.gyp:base',
875         # TODO(mmenke):  This depends on icu, figure out a way to build tests
876         #                without icu.
877         '../base/base.gyp:test_support_base',
878         '../testing/gtest.gyp:gtest',
879         '../testing/gmock.gyp:gmock',
880       ],
881       'sources': [
882         'base/capturing_net_log.cc',
883         'base/capturing_net_log.h',
884         'base/load_timing_info_test_util.cc',
885         'base/load_timing_info_test_util.h',
886         'base/mock_file_stream.cc',
887         'base/mock_file_stream.h',
888         'base/test_completion_callback.cc',
889         'base/test_completion_callback.h',
890         'base/test_data_directory.cc',
891         'base/test_data_directory.h',
892         'cert/mock_cert_verifier.cc',
893         'cert/mock_cert_verifier.h',
894         'cookies/cookie_monster_store_test.cc',
895         'cookies/cookie_monster_store_test.h',
896         'cookies/cookie_store_test_callbacks.cc',
897         'cookies/cookie_store_test_callbacks.h',
898         'cookies/cookie_store_test_helpers.cc',
899         'cookies/cookie_store_test_helpers.h',
900         'disk_cache/disk_cache_test_base.cc',
901         'disk_cache/disk_cache_test_base.h',
902         'disk_cache/disk_cache_test_util.cc',
903         'disk_cache/disk_cache_test_util.h',
904         'dns/dns_test_util.cc',
905         'dns/dns_test_util.h',
906         'dns/mock_host_resolver.cc',
907         'dns/mock_host_resolver.h',
908         'dns/mock_mdns_socket_factory.cc',
909         'dns/mock_mdns_socket_factory.h',
910         'http/http_transaction_test_util.cc',
911         'http/http_transaction_test_util.h',
912         'proxy/mock_proxy_resolver.cc',
913         'proxy/mock_proxy_resolver.h',
914         'proxy/mock_proxy_script_fetcher.cc',
915         'proxy/mock_proxy_script_fetcher.h',
916         'proxy/proxy_config_service_common_unittest.cc',
917         'proxy/proxy_config_service_common_unittest.h',
918         'socket/socket_test_util.cc',
919         'socket/socket_test_util.h',
920         'test/cert_test_util.cc',
921         'test/cert_test_util.h',
922         'test/cert_test_util_nss.cc',
923         'test/ct_test_util.cc',
924         'test/ct_test_util.h',
925         'test/embedded_test_server/embedded_test_server.cc',
926         'test/embedded_test_server/embedded_test_server.h',
927         'test/embedded_test_server/http_connection.cc',
928         'test/embedded_test_server/http_connection.h',
929         'test/embedded_test_server/http_request.cc',
930         'test/embedded_test_server/http_request.h',
931         'test/embedded_test_server/http_response.cc',
932         'test/embedded_test_server/http_response.h',
933         'test/net_test_suite.cc',
934         'test/net_test_suite.h',
935         'test/python_utils.cc',
936         'test/python_utils.h',
937         'test/spawned_test_server/base_test_server.cc',
938         'test/spawned_test_server/base_test_server.h',
939         'test/spawned_test_server/local_test_server_posix.cc',
940         'test/spawned_test_server/local_test_server_win.cc',
941         'test/spawned_test_server/local_test_server.cc',
942         'test/spawned_test_server/local_test_server.h',
943         'test/spawned_test_server/remote_test_server.cc',
944         'test/spawned_test_server/remote_test_server.h',
945         'test/spawned_test_server/spawned_test_server.h',
946         'test/spawned_test_server/spawner_communicator.cc',
947         'test/spawned_test_server/spawner_communicator.h',
948         'test/url_request/url_request_failed_job.cc',
949         'test/url_request/url_request_failed_job.h',
950         'test/url_request/url_request_mock_http_job.cc',
951         'test/url_request/url_request_mock_http_job.h',
952         'url_request/test_url_fetcher_factory.cc',
953         'url_request/test_url_fetcher_factory.h',
954         'url_request/test_url_request_interceptor.cc',
955         'url_request/test_url_request_interceptor.h',
956         'url_request/url_request_test_util.cc',
957         'url_request/url_request_test_util.h',
958       ],
959       'conditions': [
960         ['OS != "ios"', {
961           'dependencies': [
962             '../third_party/protobuf/protobuf.gyp:py_proto',
963           ],
964         }],
965         ['use_openssl == 0 and (use_nss == 1 or OS == "ios")', {
966           'conditions': [
967             [ 'desktop_linux == 1 or chromeos == 1', {
968               'dependencies': [
969                 '../build/linux/system.gyp:ssl',
970               ],
971             }, {  # desktop_linux == 0 and chromeos == 0
972               'dependencies': [
973                 '../third_party/nss/nss.gyp:nspr',
974                 '../third_party/nss/nss.gyp:nss',
975                 'third_party/nss/ssl.gyp:libssl',
976               ],
977             }],
978           ],
979           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
980           'msvs_disabled_warnings': [4267, ],
981         }],
982         ['os_posix == 1 and OS != "mac" and OS != "android" and OS != "ios"', {
983           'conditions': [
984             ['use_allocator!="none"', {
985               'dependencies': [
986                 '../base/allocator/allocator.gyp:allocator',
987               ],
988             }],
989           ],
990         }],
991         ['OS != "android"', {
992           'sources!': [
993             'test/spawned_test_server/remote_test_server.cc',
994             'test/spawned_test_server/remote_test_server.h',
995             'test/spawned_test_server/spawner_communicator.cc',
996             'test/spawned_test_server/spawner_communicator.h',
997           ],
998         }],
999         [ 'use_v8_in_net==1', {
1000             'dependencies': [
1001               'net_with_v8',
1002             ],
1003           },
1004         ],
1005         [ 'enable_mdns != 1', {
1006             'sources!' : [
1007               'dns/mock_mdns_socket_factory.cc',
1008               'dns/mock_mdns_socket_factory.h'
1009             ]
1010         }],
1011         [ 'use_nss != 1', {
1012             'sources!': [
1013               'test/cert_test_util_nss.cc',
1014             ],
1015         }],
1016       ],
1017       # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1018       'msvs_disabled_warnings': [4267, ],
1019     },
1020     {
1021       'target_name': 'net_resources',
1022       'type': 'none',
1023       'variables': {
1024         'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/net',
1025       },
1026       'actions': [
1027         {
1028           'action_name': 'net_resources',
1029           'variables': {
1030             'grit_grd_file': 'base/net_resources.grd',
1031           },
1032           'includes': [ '../build/grit_action.gypi' ],
1033         },
1034       ],
1035     },
1036     {
1037       'target_name': 'net_extras',
1038       'type': 'static_library',
1039       'variables': { 'enable_wexit_time_destructors': 1, },
1040       'dependencies': [
1041         '../base/base.gyp:base',
1042         '../sql/sql.gyp:sql',
1043         'net',
1044       ],
1045       'sources': [
1046         '<@(net_extras_sources)',
1047       ],
1048     },
1049     {
1050       'target_name': 'http_server',
1051       'type': 'static_library',
1052       'variables': { 'enable_wexit_time_destructors': 1, },
1053       'dependencies': [
1054         '../base/base.gyp:base',
1055         'net',
1056       ],
1057       'sources': [
1058         'server/http_connection.cc',
1059         'server/http_connection.h',
1060         'server/http_server.cc',
1061         'server/http_server.h',
1062         'server/http_server_request_info.cc',
1063         'server/http_server_request_info.h',
1064         'server/http_server_response_info.cc',
1065         'server/http_server_response_info.h',
1066         'server/web_socket.cc',
1067         'server/web_socket.h',
1068       ],
1069       # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1070       'msvs_disabled_warnings': [4267, ],
1071     },
1072     {
1073       'target_name': 'balsa',
1074       'type': 'static_library',
1075       'dependencies': [
1076         '../base/base.gyp:base',
1077         'net',
1078       ],
1079       'sources': [
1080         'tools/balsa/balsa_enums.h',
1081         'tools/balsa/balsa_frame.cc',
1082         'tools/balsa/balsa_frame.h',
1083         'tools/balsa/balsa_headers.cc',
1084         'tools/balsa/balsa_headers.h',
1085         'tools/balsa/balsa_headers_token_utils.cc',
1086         'tools/balsa/balsa_headers_token_utils.h',
1087         'tools/balsa/balsa_visitor_interface.h',
1088         'tools/balsa/http_message_constants.cc',
1089         'tools/balsa/http_message_constants.h',
1090         'tools/balsa/noop_balsa_visitor.h',
1091         'tools/balsa/simple_buffer.cc',
1092         'tools/balsa/simple_buffer.h',
1093         'tools/balsa/split.cc',
1094         'tools/balsa/split.h',
1095         'tools/balsa/string_piece_utils.h',
1096         'tools/quic/spdy_utils.cc',
1097         'tools/quic/spdy_utils.h',
1098       ],
1099     },
1100     {
1101       'target_name': 'dump_cache',
1102       'type': 'executable',
1103       'dependencies': [
1104         '../base/base.gyp:base',
1105         'net',
1106         'net_test_support',
1107       ],
1108       'sources': [
1109         'tools/dump_cache/cache_dumper.cc',
1110         'tools/dump_cache/cache_dumper.h',
1111         'tools/dump_cache/dump_cache.cc',
1112         'tools/dump_cache/dump_files.cc',
1113         'tools/dump_cache/dump_files.h',
1114         'tools/dump_cache/simple_cache_dumper.cc',
1115         'tools/dump_cache/simple_cache_dumper.h',
1116         'tools/dump_cache/url_to_filename_encoder.cc',
1117         'tools/dump_cache/url_to_filename_encoder.h',
1118         'tools/dump_cache/url_utilities.h',
1119         'tools/dump_cache/url_utilities.cc',
1120       ],
1121       # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1122       'msvs_disabled_warnings': [4267, ],
1123     },
1124     {
1125       # This is a temporary target which will be merged into 'net' once the
1126       # dependency on balsa is eliminated and the classes are actually used.
1127       'target_name': 'quic_tools',
1128       'type': 'static_library',
1129       'dependencies': [
1130         '../base/base.gyp:base',
1131         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
1132         '../url/url.gyp:url_lib',
1133         'net',
1134       ],
1135       'sources': [
1136         'quic/quic_dispatcher.cc',
1137         'quic/quic_dispatcher.h',
1138         'quic/quic_in_memory_cache.cc',
1139         'quic/quic_in_memory_cache.h',
1140         'quic/quic_per_connection_packet_writer.cc',
1141         'quic/quic_per_connection_packet_writer.h',
1142         'quic/quic_server.cc',
1143         'quic/quic_server.h',
1144         'quic/quic_server_packet_writer.cc',
1145         'quic/quic_server_packet_writer.h',
1146         'quic/quic_server_session.cc',
1147         'quic/quic_server_session.h',
1148         'quic/quic_spdy_server_stream.cc',
1149         'quic/quic_spdy_server_stream.h',
1150         'quic/quic_time_wait_list_manager.cc',
1151         'quic/quic_time_wait_list_manager.h',
1152       ],
1153     },
1154   ],
1155   'conditions': [
1156     ['use_v8_in_net == 1', {
1157       'targets': [
1158         {
1159           'target_name': 'net_with_v8',
1160           'type': '<(component)',
1161           'variables': { 'enable_wexit_time_destructors': 1, },
1162           'dependencies': [
1163             '../base/base.gyp:base',
1164             '../gin/gin.gyp:gin',
1165             '../url/url.gyp:url_lib',
1166             '../v8/tools/gyp/v8.gyp:v8',
1167             'net'
1168           ],
1169           'defines': [
1170             'NET_IMPLEMENTATION',
1171           ],
1172           'sources': [
1173             'proxy/proxy_resolver_v8.cc',
1174             'proxy/proxy_resolver_v8.h',
1175             'proxy/proxy_resolver_v8_tracing.cc',
1176             'proxy/proxy_resolver_v8_tracing.h',
1177             'proxy/proxy_service_v8.cc',
1178             'proxy/proxy_service_v8.h',
1179           ],
1180           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1181           'msvs_disabled_warnings': [4267, ],
1182         },
1183       ],
1184     }],
1185     ['OS != "ios" and OS != "android"', {
1186       'targets': [
1187         # iOS doesn't have the concept of simple executables, these targets
1188         # can't be compiled on the platform.
1189         {
1190           'target_name': 'crash_cache',
1191           'type': 'executable',
1192           'dependencies': [
1193             '../base/base.gyp:base',
1194             'net',
1195             'net_test_support',
1196           ],
1197           'sources': [
1198             'tools/crash_cache/crash_cache.cc',
1199           ],
1200           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1201           'msvs_disabled_warnings': [4267, ],
1202         },
1203         {
1204           'target_name': 'crl_set_dump',
1205           'type': 'executable',
1206           'dependencies': [
1207             '../base/base.gyp:base',
1208             'net',
1209           ],
1210           'sources': [
1211             'tools/crl_set_dump/crl_set_dump.cc',
1212           ],
1213           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1214           'msvs_disabled_warnings': [4267, ],
1215         },
1216         {
1217           'target_name': 'dns_fuzz_stub',
1218           'type': 'executable',
1219           'dependencies': [
1220             '../base/base.gyp:base',
1221             'net',
1222           ],
1223           'sources': [
1224             'tools/dns_fuzz_stub/dns_fuzz_stub.cc',
1225           ],
1226           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1227           'msvs_disabled_warnings': [4267, ],
1228         },
1229         {
1230           'target_name': 'gdig',
1231           'type': 'executable',
1232           'dependencies': [
1233             '../base/base.gyp:base',
1234             'net',
1235           ],
1236           'sources': [
1237             'tools/gdig/file_net_log.cc',
1238             'tools/gdig/gdig.cc',
1239           ],
1240         },
1241         {
1242           'target_name': 'get_server_time',
1243           'type': 'executable',
1244           'dependencies': [
1245             '../base/base.gyp:base',
1246             '../base/base.gyp:base_i18n',
1247             '../url/url.gyp:url_lib',
1248             'net',
1249           ],
1250           'sources': [
1251             'tools/get_server_time/get_server_time.cc',
1252           ],
1253           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1254           'msvs_disabled_warnings': [4267, ],
1255         },
1256         {
1257           'target_name': 'hpack_example_generator',
1258           'type': 'executable',
1259           'dependencies': [
1260             '../base/base.gyp:base',
1261             'net',
1262           ],
1263           'sources': [
1264             'spdy/fuzzing/hpack_example_generator.cc',
1265           ],
1266           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1267           'msvs_disabled_warnings': [4267, ],
1268         },
1269         {
1270           'target_name': 'hpack_fuzz_mutator',
1271           'type': 'executable',
1272           'dependencies': [
1273             '../base/base.gyp:base',
1274             'net',
1275           ],
1276           'sources': [
1277             'spdy/fuzzing/hpack_fuzz_mutator.cc',
1278           ],
1279           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1280           'msvs_disabled_warnings': [4267, ],
1281         },
1282         {
1283           'target_name': 'hpack_fuzz_wrapper',
1284           'type': 'executable',
1285           'dependencies': [
1286             '../base/base.gyp:base',
1287             'net',
1288           ],
1289           'sources': [
1290             'spdy/fuzzing/hpack_fuzz_wrapper.cc',
1291           ],
1292           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1293           'msvs_disabled_warnings': [4267, ],
1294         },
1295         {
1296           'target_name': 'net_watcher',
1297           'type': 'executable',
1298           'dependencies': [
1299             '../base/base.gyp:base',
1300             'net',
1301             'net_with_v8',
1302           ],
1303           'conditions': [
1304             [ 'use_glib == 1', {
1305                 'dependencies': [
1306                   '../build/linux/system.gyp:gconf',
1307                   '../build/linux/system.gyp:gio',
1308                 ],
1309               },
1310             ],
1311           ],
1312           'sources': [
1313             'tools/net_watcher/net_watcher.cc',
1314           ],
1315         },
1316         {
1317           'target_name': 'run_testserver',
1318           'type': 'executable',
1319           'dependencies': [
1320             '../base/base.gyp:base',
1321             '../base/base.gyp:test_support_base',
1322             '../testing/gtest.gyp:gtest',
1323             'net_test_support',
1324           ],
1325           'sources': [
1326             'tools/testserver/run_testserver.cc',
1327           ],
1328         },
1329         {
1330           'target_name': 'stress_cache',
1331           'type': 'executable',
1332           'dependencies': [
1333             '../base/base.gyp:base',
1334             'net',
1335             'net_test_support',
1336           ],
1337           'sources': [
1338             'disk_cache/blockfile/stress_cache.cc',
1339           ],
1340           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1341           'msvs_disabled_warnings': [4267, ],
1342         },
1343         {
1344           'target_name': 'tld_cleanup',
1345           'type': 'executable',
1346           'dependencies': [
1347             '../base/base.gyp:base',
1348             '../base/base.gyp:base_i18n',
1349             '../net/tools/tld_cleanup/tld_cleanup.gyp:tld_cleanup_util',
1350           ],
1351           'sources': [
1352             'tools/tld_cleanup/tld_cleanup.cc',
1353           ],
1354           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1355           'msvs_disabled_warnings': [4267, ],
1356         },
1357       ],
1358     }],
1359     ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android"', {
1360       'targets': [
1361         {
1362           'target_name': 'epoll_server',
1363           'type': 'static_library',
1364           'dependencies': [
1365             '../base/base.gyp:base',
1366             'net',
1367           ],
1368           'sources': [
1369             'tools/epoll_server/epoll_server.cc',
1370             'tools/epoll_server/epoll_server.h',
1371           ],
1372         },
1373         {
1374           'target_name': 'flip_in_mem_edsm_server_base',
1375           'type': 'static_library',
1376           'cflags': [
1377             '-Wno-deprecated',
1378           ],
1379           'dependencies': [
1380             '../base/base.gyp:base',
1381             '../third_party/boringssl/boringssl.gyp:boringssl',
1382             'balsa',
1383             'epoll_server',
1384             'net',
1385           ],
1386           'sources': [
1387             'tools/dump_cache/url_to_filename_encoder.cc',
1388             'tools/dump_cache/url_to_filename_encoder.h',
1389             'tools/dump_cache/url_utilities.h',
1390             'tools/dump_cache/url_utilities.cc',
1391             'tools/flip_server/acceptor_thread.h',
1392             'tools/flip_server/acceptor_thread.cc',
1393             'tools/flip_server/create_listener.cc',
1394             'tools/flip_server/create_listener.h',
1395             'tools/flip_server/constants.h',
1396             'tools/flip_server/flip_config.cc',
1397             'tools/flip_server/flip_config.h',
1398             'tools/flip_server/http_interface.cc',
1399             'tools/flip_server/http_interface.h',
1400             'tools/flip_server/loadtime_measurement.h',
1401             'tools/flip_server/mem_cache.h',
1402             'tools/flip_server/mem_cache.cc',
1403             'tools/flip_server/output_ordering.cc',
1404             'tools/flip_server/output_ordering.h',
1405             'tools/flip_server/ring_buffer.cc',
1406             'tools/flip_server/ring_buffer.h',
1407             'tools/flip_server/sm_connection.cc',
1408             'tools/flip_server/sm_connection.h',
1409             'tools/flip_server/sm_interface.h',
1410             'tools/flip_server/spdy_ssl.cc',
1411             'tools/flip_server/spdy_ssl.h',
1412             'tools/flip_server/spdy_interface.cc',
1413             'tools/flip_server/spdy_interface.h',
1414             'tools/flip_server/spdy_util.cc',
1415             'tools/flip_server/spdy_util.h',
1416             'tools/flip_server/streamer_interface.cc',
1417             'tools/flip_server/streamer_interface.h',
1418           ],
1419         },
1420         {
1421           'target_name': 'flip_in_mem_edsm_server_unittests',
1422           'type': 'executable',
1423           'dependencies': [
1424               '../testing/gtest.gyp:gtest',
1425               '../testing/gmock.gyp:gmock',
1426               '../third_party/boringssl/boringssl.gyp:boringssl',
1427               'flip_in_mem_edsm_server_base',
1428               'net',
1429               'net_test_support',
1430           ],
1431           'sources': [
1432             'tools/flip_server/flip_test_utils.cc',
1433             'tools/flip_server/flip_test_utils.h',
1434             'tools/flip_server/http_interface_test.cc',
1435             'tools/flip_server/mem_cache_test.cc',
1436             'tools/flip_server/run_all_tests.cc',
1437             'tools/flip_server/spdy_interface_test.cc',
1438           ],
1439         },
1440         {
1441           'target_name': 'flip_in_mem_edsm_server',
1442           'type': 'executable',
1443           'cflags': [
1444             '-Wno-deprecated',
1445           ],
1446           'dependencies': [
1447             '../base/base.gyp:base',
1448             'flip_in_mem_edsm_server_base',
1449             'net',
1450           ],
1451           'sources': [
1452             'tools/flip_server/flip_in_mem_edsm_server.cc',
1453           ],
1454         },
1455         {
1456           'target_name': 'quic_base',
1457           'type': 'static_library',
1458           'dependencies': [
1459             '../base/base.gyp:base',
1460             '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
1461             '../url/url.gyp:url_lib',
1462             'balsa',
1463             'epoll_server',
1464             'net',
1465           ],
1466           'sources': [
1467             'tools/quic/quic_client.cc',
1468             'tools/quic/quic_client.h',
1469             'tools/quic/quic_client_session.cc',
1470             'tools/quic/quic_client_session.h',
1471             'tools/quic/quic_default_packet_writer.cc',
1472             'tools/quic/quic_default_packet_writer.h',
1473             'tools/quic/quic_dispatcher.h',
1474             'tools/quic/quic_dispatcher.cc',
1475             'tools/quic/quic_epoll_clock.cc',
1476             'tools/quic/quic_epoll_clock.h',
1477             'tools/quic/quic_epoll_connection_helper.cc',
1478             'tools/quic/quic_epoll_connection_helper.h',
1479             'tools/quic/quic_in_memory_cache.cc',
1480             'tools/quic/quic_in_memory_cache.h',
1481             'tools/quic/quic_packet_writer_wrapper.cc',
1482             'tools/quic/quic_packet_writer_wrapper.h',
1483             'tools/quic/quic_per_connection_packet_writer.cc',
1484             'tools/quic/quic_per_connection_packet_writer.h',
1485             'tools/quic/quic_server.cc',
1486             'tools/quic/quic_server.h',
1487             'tools/quic/quic_server_session.cc',
1488             'tools/quic/quic_server_session.h',
1489             'tools/quic/quic_socket_utils.cc',
1490             'tools/quic/quic_socket_utils.h',
1491             'tools/quic/quic_spdy_client_stream.cc',
1492             'tools/quic/quic_spdy_client_stream.h',
1493             'tools/quic/quic_spdy_server_stream.cc',
1494             'tools/quic/quic_spdy_server_stream.h',
1495             'tools/quic/quic_time_wait_list_manager.h',
1496             'tools/quic/quic_time_wait_list_manager.cc',
1497           ],
1498         },
1499         {
1500           'target_name': 'quic_client',
1501           'type': 'executable',
1502           'dependencies': [
1503             '../base/base.gyp:base',
1504             'net',
1505             'quic_base',
1506           ],
1507           'sources': [
1508             'tools/quic/quic_client_bin.cc',
1509           ],
1510         },
1511         {
1512           'target_name': 'quic_server',
1513           'type': 'executable',
1514           'dependencies': [
1515             '../base/base.gyp:base',
1516             'net',
1517             'quic_tools',
1518           ],
1519           'sources': [
1520             'quic/quic_server_bin.cc',
1521           ],
1522         },
1523       ]
1524     }],
1525     ['OS=="android"', {
1526       'targets': [
1527         {
1528           'target_name': 'net_jni_headers',
1529           'type': 'none',
1530           'sources': [
1531             'android/java/src/org/chromium/net/AndroidCertVerifyResult.java',
1532             'android/java/src/org/chromium/net/AndroidKeyStore.java',
1533             'android/java/src/org/chromium/net/AndroidNetworkLibrary.java',
1534             'android/java/src/org/chromium/net/AndroidPrivateKey.java',
1535             'android/java/src/org/chromium/net/GURLUtils.java',
1536             'android/java/src/org/chromium/net/NetworkChangeNotifier.java',
1537             'android/java/src/org/chromium/net/ProxyChangeListener.java',
1538             'android/java/src/org/chromium/net/X509Util.java',
1539           ],
1540           'variables': {
1541             'jni_gen_package': 'net',
1542           },
1543           'includes': [ '../build/jni_generator.gypi' ],
1545           'conditions': [
1546             ['use_icu_alternatives_on_android==1', {
1547               'sources': [
1548                 'android/java/src/org/chromium/net/NetStringUtil.java',
1549               ],
1550             }],
1551           ],
1552         },
1553         {
1554           'target_name': 'net_test_jni_headers',
1555           'type': 'none',
1556           'sources': [
1557             'android/javatests/src/org/chromium/net/AndroidKeyStoreTestUtil.java',
1558           ],
1559           'variables': {
1560             'jni_gen_package': 'net',
1561           },
1562           'includes': [ '../build/jni_generator.gypi' ],
1563         },
1564         {
1565           'target_name': 'net_java',
1566           'type': 'none',
1567           'variables': {
1568             'java_in_dir': '../net/android/java',
1569           },
1570           'dependencies': [
1571             '../base/base.gyp:base',
1572             'cert_verify_status_android_java',
1573             'certificate_mime_types_java',
1574             'net_errors_java',
1575             'private_key_types_java',
1576             'remote_android_keystore_aidl',
1577           ],
1578           'includes': [ '../build/java.gypi' ],
1579         },
1580         {
1581           # Processes the interface files for communication with an Android KeyStore
1582           # running in a separate process.
1583           'target_name': 'remote_android_keystore_aidl',
1584           'type': 'none',
1585           'variables': {
1586             'aidl_interface_file': '../net/android/java/src/org/chromium/net/IRemoteAndroidKeyStoreInterface.aidl',
1587           },
1588           'sources': [
1589             '../net/android/java/src/org/chromium/net/IRemoteAndroidKeyStore.aidl',
1590             '../net/android/java/src/org/chromium/net/IRemoteAndroidKeyStoreCallbacks.aidl',
1591           ],
1592           'includes': [ '../build/java_aidl.gypi' ],
1593         },
1594         {
1595           'target_name': 'net_java_test_support',
1596           'type': 'none',
1597           'variables': {
1598             'java_in_dir': '../net/test/android/javatests',
1599           },
1600           'includes': [ '../build/java.gypi' ],
1601         },
1602         {
1603           'target_name': 'net_javatests',
1604           'type': 'none',
1605           'variables': {
1606             'java_in_dir': '../net/android/javatests',
1607           },
1608           'dependencies': [
1609             '../base/base.gyp:base',
1610             '../base/base.gyp:base_java_test_support',
1611             'net_java',
1612           ],
1613           'includes': [ '../build/java.gypi' ],
1614         },
1615         {
1616           'target_name': 'net_errors_java',
1617           'type': 'none',
1618           'sources': [
1619             'android/java/NetError.template',
1620           ],
1621           'variables': {
1622             'package_name': 'org/chromium/net',
1623             'template_deps': ['base/net_error_list.h'],
1624           },
1625           'includes': [ '../build/android/java_cpp_template.gypi' ],
1626         },
1627         {
1628           'target_name': 'certificate_mime_types_java',
1629           'type': 'none',
1630           'variables': {
1631             'source_file': 'base/mime_util.h',
1632           },
1633           'includes': [ '../build/android/java_cpp_enum.gypi' ],
1634         },
1635         {
1636           'target_name': 'cert_verify_status_android_java',
1637           'type': 'none',
1638           'variables': {
1639             'source_file': 'android/cert_verify_result_android.h',
1640           },
1641           'includes': [ '../build/android/java_cpp_enum.gypi' ],
1642         },
1643         {
1644           'target_name': 'private_key_types_java',
1645           'type': 'none',
1646           'variables': {
1647             'source_file': 'android/keystore.h',
1648           },
1649           'includes': [ '../build/android/java_cpp_enum.gypi' ],
1650         },
1651         {
1652           'target_name': 'net_unittests_apk',
1653           'type': 'none',
1654           'dependencies': [
1655             'net_java',
1656             'net_javatests',
1657             'net_unittests',
1658           ],
1659           'variables': {
1660             'test_suite_name': 'net_unittests',
1661             'conditions': [
1662               ['v8_use_external_startup_data==1', {
1663                 'additional_input_paths': [
1664                   '<(PRODUCT_DIR)/natives_blob.bin',
1665                   '<(PRODUCT_DIR)/snapshot_blob.bin',
1666                 ],
1667                 'copies': [
1668                   {
1669                   'destination': '<(PRODUCT_DIR)/net_unittests_apk/assets',
1670                     'files': [
1671                       '<(PRODUCT_DIR)/natives_blob.bin',
1672                       '<(PRODUCT_DIR)/snapshot_blob.bin',
1673                     ],
1674                   },
1675                 ],
1676               }],
1677             ],
1678           },
1679           'includes': [ '../build/apk_test.gypi' ],
1680         },
1681       ],
1682     }],
1683     ['OS == "android" or OS == "linux"', {
1684       'targets': [
1685         {
1686           'target_name': 'disk_cache_memory_test',
1687           'type': 'executable',
1688           'dependencies': [
1689             '../base/base.gyp:base',
1690             'net',
1691           ],
1692           'sources': [
1693             'tools/disk_cache_memory_test/disk_cache_memory_test.cc',
1694           ],
1695         },
1696       ],
1697     }],
1698     ['test_isolation_mode != "noop"', {
1699       'targets': [
1700         {
1701           'target_name': 'net_unittests_run',
1702           'type': 'none',
1703           'dependencies': [
1704             'net_unittests',
1705           ],
1706           'includes': [
1707             '../build/isolate.gypi',
1708           ],
1709           'sources': [
1710             'net_unittests.isolate',
1711           ],
1712         },
1713       ],
1714     }],
1715   ],