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