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