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