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