Pepper: Initialize PP_ImageDataDesc when creating ImageData.
[chromium-blink-merge.git] / net / net.gyp
blob62b80cc6d60f2f75869bdb2d63df30dea90c8dd3
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/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
91         '../crypto/crypto.gyp:crypto',
92         '../sdch/sdch.gyp:sdch',
93         '../third_party/icu/icu.gyp:icui18n',
94         '../third_party/icu/icu.gyp:icuuc',
95         '../third_party/zlib/zlib.gyp:zlib',
96         '../url/url.gyp:url_lib',
97         'net_derived_sources',
98         'net_resources',
99       ],
100       'sources': [
101         '<@(net_nacl_common_sources)',
102         '<@(net_non_nacl_sources)',
103       ],
104       'defines': [
105         'NET_IMPLEMENTATION',
106       ],
107       'export_dependent_settings': [
108         '../base/base.gyp:base',
109       ],
110       'conditions': [
111         ['chromeos==1', {
112           'sources!': [
113              'base/network_change_notifier_linux.cc',
114              'base/network_change_notifier_linux.h',
115              'base/network_change_notifier_netlink_linux.cc',
116              'base/network_change_notifier_netlink_linux.h',
117              'proxy/proxy_config_service_linux.cc',
118              'proxy/proxy_config_service_linux.h',
119           ],
120         }],
121         ['use_kerberos==1', {
122           'defines': [
123             'USE_KERBEROS',
124           ],
125           'conditions': [
126             ['OS=="openbsd"', {
127               'include_dirs': [
128                 '/usr/include/kerberosV'
129               ],
130             }],
131             ['linux_link_kerberos==1', {
132               'link_settings': {
133                 'ldflags': [
134                   '<!@(krb5-config --libs gssapi)',
135                 ],
136               },
137             }, { # linux_link_kerberos==0
138               'defines': [
139                 'DLOPEN_KERBEROS',
140               ],
141             }],
142           ],
143         }, { # use_kerberos == 0
144           'sources!': [
145             'http/http_auth_gssapi_posix.cc',
146             'http/http_auth_gssapi_posix.h',
147             'http/http_auth_handler_negotiate.h',
148             'http/http_auth_handler_negotiate.cc',
149           ],
150         }],
151         ['posix_avoid_mmap==1', {
152           'defines': [
153             'POSIX_AVOID_MMAP',
154           ],
155           'direct_dependent_settings': {
156             'defines': [
157               'POSIX_AVOID_MMAP',
158             ],
159           },
160           'sources!': [
161             'disk_cache/blockfile/mapped_file_posix.cc',
162           ],
163         }, { # else
164           'sources!': [
165             'disk_cache/blockfile/mapped_file_avoid_mmap_posix.cc',
166           ],
167         }],
168         ['disable_file_support==1', {
169           # TODO(mmenke):  Should probably get rid of the dependency on
170           # net_resources in this case (It's used in net_util, to format
171           # directory listings.  Also used outside of net/).
172           'sources!': [
173             'base/directory_lister.cc',
174             'base/directory_lister.h',
175             'url_request/url_request_file_dir_job.cc',
176             'url_request/url_request_file_dir_job.h',
177             'url_request/url_request_file_job.cc',
178             'url_request/url_request_file_job.h',
179             'url_request/file_protocol_handler.cc',
180             'url_request/file_protocol_handler.h',
181           ],
182         }],
183         ['disable_ftp_support==1', {
184           'sources/': [
185             ['exclude', '^ftp/'],
186           ],
187           'sources!': [
188             'url_request/ftp_protocol_handler.cc',
189             'url_request/ftp_protocol_handler.h',
190             'url_request/url_request_ftp_job.cc',
191             'url_request/url_request_ftp_job.h',
192           ],
193         }],
194         ['enable_built_in_dns==1', {
195           'defines': [
196             'ENABLE_BUILT_IN_DNS',
197           ]
198         }, { # else
199           'sources!': [
200             'dns/address_sorter_posix.cc',
201             'dns/address_sorter_posix.h',
202             'dns/dns_client.cc',
203           ],
204         }],
205         ['use_tracing_cache_backend==1', {
206           'defines': [
207             'USE_TRACING_CACHE_BACKEND'
208           ],
209          }],
210         ['use_openssl==1', {
211             'sources!': [
212               'base/crypto_module_nss.cc',
213               'base/keygen_handler_nss.cc',
214               'base/nss_memio.c',
215               'base/nss_memio.h',
216               'cert/cert_database_nss.cc',
217               'cert/cert_verify_proc_nss.cc',
218               'cert/cert_verify_proc_nss.h',
219               'cert/ct_log_verifier_nss.cc',
220               'cert/ct_objects_extractor_nss.cc',
221               'cert/jwk_serializer_nss.cc',
222               'cert/nss_cert_database.cc',
223               'cert/nss_cert_database.h',
224               'cert/nss_cert_database_chromeos.cc',
225               'cert/nss_cert_database_chromeos.h',
226               'cert/nss_profile_filter_chromeos.cc',
227               'cert/nss_profile_filter_chromeos.h',
228               'cert/scoped_nss_types.h',
229               'cert/test_root_certs_nss.cc',
230               'cert/x509_certificate_nss.cc',
231               'cert/x509_util_nss.cc',
232               'cert/x509_util_nss.h',
233               'ocsp/nss_ocsp.cc',
234               'ocsp/nss_ocsp.h',
235               'quic/crypto/aead_base_decrypter_nss.cc',
236               'quic/crypto/aead_base_encrypter_nss.cc',
237               'quic/crypto/aes_128_gcm_12_decrypter_nss.cc',
238               'quic/crypto/aes_128_gcm_12_encrypter_nss.cc',
239               'quic/crypto/chacha20_poly1305_decrypter_nss.cc',
240               'quic/crypto/chacha20_poly1305_encrypter_nss.cc',
241               'quic/crypto/channel_id_nss.cc',
242               'quic/crypto/p256_key_exchange_nss.cc',
243               'socket/nss_ssl_util.cc',
244               'socket/nss_ssl_util.h',
245               'socket/ssl_client_socket_nss.cc',
246               'socket/ssl_client_socket_nss.h',
247               'socket/ssl_server_socket_nss.cc',
248               'socket/ssl_server_socket_nss.h',
249               'third_party/mozilla_security_manager/nsKeygenHandler.cpp',
250               'third_party/mozilla_security_manager/nsKeygenHandler.h',
251               'third_party/mozilla_security_manager/nsNSSCertificateDB.cpp',
252               'third_party/mozilla_security_manager/nsNSSCertificateDB.h',
253               'third_party/mozilla_security_manager/nsPKCS12Blob.cpp',
254               'third_party/mozilla_security_manager/nsPKCS12Blob.h',
255             ],
256             'dependencies': [
257               '../third_party/openssl/openssl.gyp:openssl',
258             ],
259           },
260           {  # else !use_openssl: remove the unneeded files
261             'sources!': [
262               'base/crypto_module_openssl.cc',
263               'cert/ct_log_verifier_openssl.cc',
264               'cert/ct_objects_extractor_openssl.cc',
265               'cert/jwk_serializer_openssl.cc',
266               'cert/x509_util_openssl.cc',
267               'cert/x509_util_openssl.h',
268               'quic/crypto/aead_base_decrypter_openssl.cc',
269               'quic/crypto/aead_base_encrypter_openssl.cc',
270               'quic/crypto/aes_128_gcm_12_decrypter_openssl.cc',
271               'quic/crypto/aes_128_gcm_12_encrypter_openssl.cc',
272               'quic/crypto/chacha20_poly1305_decrypter_openssl.cc',
273               'quic/crypto/chacha20_poly1305_encrypter_openssl.cc',
274               'quic/crypto/channel_id_openssl.cc',
275               'quic/crypto/p256_key_exchange_openssl.cc',
276               'quic/crypto/scoped_evp_aead_ctx.cc',
277               'quic/crypto/scoped_evp_aead_ctx.h',
278               'socket/openssl_ssl_util.cc',
279               'socket/openssl_ssl_util.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             ],
287           },
288         ],
289         [ 'use_openssl_certs == 0', {
290             'sources!': [
291               'base/keygen_handler_openssl.cc',
292               'base/openssl_private_key_store.h',
293               'base/openssl_private_key_store_android.cc',
294               'base/openssl_private_key_store_memory.cc',
295               'cert/cert_database_openssl.cc',
296               'cert/cert_verify_proc_openssl.cc',
297               'cert/cert_verify_proc_openssl.h',
298               'cert/test_root_certs_openssl.cc',
299               'cert/x509_certificate_openssl.cc',
300               'ssl/openssl_client_key_store.cc',
301               'ssl/openssl_client_key_store.h',
302             ],
303         }],
304         [ 'use_glib == 1', {
305             'dependencies': [
306               '../build/linux/system.gyp:gconf',
307               '../build/linux/system.gyp:gio',
308             ],
309         }],
310         [ 'desktop_linux == 1 or chromeos == 1', {
311             'conditions': [
312               ['use_openssl == 0', {
313                  # use NSS
314                 'dependencies': [
315                   '../build/linux/system.gyp:ssl',
316                 ],
317               }],
318               ['os_bsd==1', {
319                 'sources!': [
320                   'base/network_change_notifier_linux.cc',
321                   'base/network_change_notifier_netlink_linux.cc',
322                   'proxy/proxy_config_service_linux.cc',
323                 ],
324               },{
325                 'dependencies': [
326                   '../build/linux/system.gyp:libresolv',
327                 ],
328               }],
329               ['OS=="solaris"', {
330                 'link_settings': {
331                   'ldflags': [
332                     '-R/usr/lib/mps',
333                   ],
334                 },
335               }],
336             ],
337           },
338           {  # else: OS is not in the above list
339             'sources!': [
340               'base/crypto_module_nss.cc',
341               'base/keygen_handler_nss.cc',
342               'cert/cert_database_nss.cc',
343               'cert/nss_cert_database.cc',
344               'cert/nss_cert_database.h',
345               'cert/test_root_certs_nss.cc',
346               'cert/x509_certificate_nss.cc',
347               'ocsp/nss_ocsp.cc',
348               'ocsp/nss_ocsp.h',
349               'third_party/mozilla_security_manager/nsKeygenHandler.cpp',
350               'third_party/mozilla_security_manager/nsKeygenHandler.h',
351               'third_party/mozilla_security_manager/nsNSSCertificateDB.cpp',
352               'third_party/mozilla_security_manager/nsNSSCertificateDB.h',
353               'third_party/mozilla_security_manager/nsPKCS12Blob.cpp',
354               'third_party/mozilla_security_manager/nsPKCS12Blob.h',
355             ],
356           },
357         ],
358         [ 'use_nss != 1', {
359             'sources!': [
360               'cert/cert_verify_proc_nss.cc',
361               'cert/cert_verify_proc_nss.h',
362               'ssl/client_cert_store_nss.cc',
363               'ssl/client_cert_store_nss.h',
364               'ssl/client_cert_store_chromeos.cc',
365               'ssl/client_cert_store_chromeos.h',
366             ],
367         }],
368         [ 'enable_websockets != 1', {
369             'sources/': [
370               ['exclude', '^socket_stream/'],
371               ['exclude', '^websockets/'],
372             ],
373             'sources!': [
374               'spdy/spdy_websocket_stream.cc',
375               'spdy/spdy_websocket_stream.h',
376             ],
377         }],
378         [ 'enable_mdns != 1', {
379             'sources!' : [
380               'dns/mdns_cache.cc',
381               'dns/mdns_cache.h',
382               'dns/mdns_client.cc',
383               'dns/mdns_client.h',
384               'dns/mdns_client_impl.cc',
385               'dns/mdns_client_impl.h',
386               'dns/record_parsed.cc',
387               'dns/record_parsed.h',
388               'dns/record_rdata.cc',
389               'dns/record_rdata.h',
390             ]
391         }],
392         [ 'OS == "win"', {
393             'sources!': [
394               'http/http_auth_handler_ntlm_portable.cc',
395               'socket/socket_libevent.cc',
396               'socket/socket_libevent.h',
397               'socket/tcp_socket_libevent.cc',
398               'socket/tcp_socket_libevent.h',
399               'udp/udp_socket_libevent.cc',
400               'udp/udp_socket_libevent.h',
401             ],
402             'dependencies': [
403               '../third_party/nss/nss.gyp:nspr',
404               '../third_party/nss/nss.gyp:nss',
405               'third_party/nss/ssl.gyp:libssl',
406             ],
407             # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
408             'msvs_disabled_warnings': [4267, ],
409           }, { # else: OS != "win"
410             'sources!': [
411               'base/winsock_init.cc',
412               'base/winsock_init.h',
413               'base/winsock_util.cc',
414               'base/winsock_util.h',
415               'proxy/proxy_resolver_winhttp.cc',
416               'proxy/proxy_resolver_winhttp.h',
417             ],
418           },
419         ],
420         [ 'OS == "mac"', {
421             'conditions': [
422               [ 'use_openssl == 0', {
423                 'dependencies': [
424                   # defaults to nss
425                   '../third_party/nss/nss.gyp:nspr',
426                   '../third_party/nss/nss.gyp:nss',
427                   'third_party/nss/ssl.gyp:libssl',
428                 ],
429               }],
430             ],
431             'link_settings': {
432               'libraries': [
433                 '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
434                 '$(SDKROOT)/System/Library/Frameworks/Security.framework',
435                 '$(SDKROOT)/System/Library/Frameworks/SystemConfiguration.framework',
436                 '$(SDKROOT)/usr/lib/libresolv.dylib',
437               ]
438             },
439           },
440         ],
441         [ 'OS == "ios"', {
442             'dependencies': [
443               '../third_party/nss/nss.gyp:nss',
444               'third_party/nss/ssl.gyp:libssl',
445             ],
446             'sources!': [
447               'disk_cache/blockfile/file_posix.cc',
448             ],
449             'link_settings': {
450               'libraries': [
451                 '$(SDKROOT)/System/Library/Frameworks/CFNetwork.framework',
452                 '$(SDKROOT)/System/Library/Frameworks/MobileCoreServices.framework',
453                 '$(SDKROOT)/System/Library/Frameworks/Security.framework',
454                 '$(SDKROOT)/System/Library/Frameworks/SystemConfiguration.framework',
455                 '$(SDKROOT)/usr/lib/libresolv.dylib',
456               ],
457             },
458           },
459         ],
460         ['OS=="android" and _toolset=="target" and android_webview_build == 0', {
461           'dependencies': [
462              'net_java',
463           ],
464         }],
465         [ 'OS == "android"', {
466             'dependencies': [
467               '../third_party/openssl/openssl.gyp:openssl',
468               'net_jni_headers',
469             ],
470             'sources!': [
471               'base/openssl_private_key_store_memory.cc',
472               'cert/cert_database_openssl.cc',
473               'cert/cert_verify_proc_openssl.cc',
474               'cert/test_root_certs_openssl.cc',
475             ],
476             # The net/android/keystore_openssl.cc source file needs to
477             # access an OpenSSL-internal header.
478             'include_dirs': [
479               '../third_party/openssl',
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/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
541         '../crypto/crypto.gyp:crypto',
542         '../testing/gmock.gyp:gmock',
543         '../testing/gtest.gyp:gtest',
544         '../third_party/zlib/zlib.gyp:zlib',
545         '../url/url.gyp:url_lib',
546         'balsa',
547         'http_server',
548         'net',
549         'net_derived_sources',
550         'net_test_support',
551         'quic_ported_server',
552       ],
553       'sources': [
554         '<@(net_test_sources)',
555       ],
556       'conditions': [
557         ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android"', {
558           'dependencies': [
559             'epoll_server',
560             'flip_in_mem_edsm_server_base',
561             'quic_base',
562           ],
563           'sources': [
564             '<@(net_linux_test_sources)',
565           ],
566         }],
567         ['chromeos==1', {
568           'sources!': [
569             'base/network_change_notifier_linux_unittest.cc',
570             'proxy/proxy_config_service_linux_unittest.cc',
571           ],
572         }],
573         [ 'OS == "android"', {
574           'sources!': [
575             # See bug http://crbug.com/344533.
576             'disk_cache/blockfile/index_table_v3_unittest.cc',
577             # No res_ninit() et al on Android, so this doesn't make a lot of
578             # sense.
579             'dns/dns_config_service_posix_unittest.cc',
580           ],
581           'dependencies': [
582             'net_javatests',
583             'net_test_jni_headers',
584           ],
585         }],
586         [ 'use_nss != 1', {
587           'sources!': [
588             'ssl/client_cert_store_nss_unittest.cc',
589             'ssl/client_cert_store_chromeos_unittest.cc',
590           ],
591         }],
592         [ 'use_openssl == 1', {
593           # Avoid compiling/linking with the system library.
594           'dependencies': [
595             '../third_party/openssl/openssl.gyp:openssl',
596           ],
597         }, {  # use_openssl == 0
598           'conditions': [
599             [ 'desktop_linux == 1 or chromeos == 1', {
600               'dependencies': [
601                 '../build/linux/system.gyp:ssl',
602               ],
603             }, {  # desktop_linux == 0 and chromeos == 0
604               'sources!': [
605                 'cert/nss_cert_database_unittest.cc',
606               ],
607             }],
608           ],
609         }],
610         [ 'os_posix == 1 and OS != "mac" and OS != "android" and OS != "ios"', {
611           'conditions': [
612             ['use_allocator!="none"', {
613               'dependencies': [
614                 '../base/allocator/allocator.gyp:allocator',
615               ],
616             }],
617           ],
618         }],
619         [ 'use_kerberos==1', {
620           'defines': [
621             'USE_KERBEROS',
622           ],
623         }, { # use_kerberos == 0
624           'sources!': [
625             'http/http_auth_gssapi_posix_unittest.cc',
626             'http/http_auth_handler_negotiate_unittest.cc',
627             'http/mock_gssapi_library_posix.cc',
628             'http/mock_gssapi_library_posix.h',
629           ],
630         }],
631         [ 'use_openssl == 1 or (desktop_linux == 0 and chromeos == 0 and OS != "ios")', {
632           # Only include this test when on Posix and using NSS for
633           # cert verification or on iOS (which also uses NSS for certs).
634           'sources!': [
635             'ocsp/nss_ocsp_unittest.cc',
636           ],
637         }],
638         [ 'use_openssl==1', {
639             # When building for OpenSSL, we need to exclude NSS specific tests
640             # or functionality not supported by OpenSSL yet.
641             # TODO(bulach): Add equivalent tests when the underlying
642             #               functionality is ported to OpenSSL.
643             'sources!': [
644               'cert/ct_objects_extractor_unittest.cc',
645               'cert/multi_log_ct_verifier_unittest.cc',
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_socket_posix_unittest.cc',
792               # See bug http://crbug.com/344533.
793               'disk_cache/blockfile/index_table_v3_unittest.cc',
794             ],
795         }],
796         [ 'OS == "android"', {
797             'dependencies': [
798               '../third_party/openssl/openssl.gyp:openssl',
799             ],
800             'sources!': [
801               'dns/dns_config_service_posix_unittest.cc',
802             ],
803           },
804         ],
805         ['OS == "android"', {
806           # TODO(mmenke):  This depends on test_support_base, which depends on
807           #                icu.  Figure out a way to remove that dependency.
808           'dependencies': [
809             '../testing/android/native_test.gyp:native_test_native_code',
810           ]
811         }],
812         [ 'use_icu_alternatives_on_android == 1', {
813             'dependencies!': [
814               '../base/base.gyp:base_i18n',
815             ],
816             'sources!': [
817               'base/filename_util_unittest.cc',
818               'base/net_util_icu_unittest.cc',
819             ],
820           },
821         ],
822       ],
823       'target_conditions': [
824         # These source files are excluded by default platform rules, but they
825         # are needed in specific cases on other platforms. Re-including them can
826         # only be done in target_conditions as it is evaluated after the
827         # platform rules.
828         ['OS == "android"', {
829           'sources/': [
830             ['include', '^base/address_tracker_linux_unittest\\.cc$'],
831           ],
832         }],
833       ],
834     },
835     {
836       'target_name': 'net_perftests',
837       'type': 'executable',
838       'dependencies': [
839         '../base/base.gyp:base',
840         '../base/base.gyp:base_i18n',
841         '../base/base.gyp:test_support_perf',
842         '../testing/gtest.gyp:gtest',
843         '../url/url.gyp:url_lib',
844         'net',
845         'net_test_support',
846       ],
847       'sources': [
848         'cookies/cookie_monster_perftest.cc',
849         'disk_cache/blockfile/disk_cache_perftest.cc',
850         'proxy/proxy_resolver_perftest.cc',
851       ],
852       'conditions': [
853         [ 'use_v8_in_net==1', {
854             'dependencies': [
855               'net_with_v8',
856             ],
857           }, {  # else: !use_v8_in_net
858             'sources!': [
859               'proxy/proxy_resolver_perftest.cc',
860             ],
861           },
862         ],
863         [ 'OS == "win"', {
864             'conditions': [
865               [ 'icu_use_data_file_flag == 0', {
866                 # This is needed to trigger the dll copy step on windows.
867                 # TODO(mark): Specifying this here shouldn't be necessary.
868                 'dependencies': [
869                   '../third_party/icu/icu.gyp:icudata',
870                 ],
871               }],
872             ],
873             # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
874             'msvs_disabled_warnings': [4267, ],
875         }],
876       ],
877     },
878     {
879       'target_name': 'net_test_support',
880       'type': 'static_library',
881       'dependencies': [
882         '../base/base.gyp:base',
883         '../base/base.gyp:test_support_base',
884         '../net/tools/tld_cleanup/tld_cleanup.gyp:tld_cleanup_util',
885         '../testing/gtest.gyp:gtest',
886         '../testing/gmock.gyp:gmock',
887         '../url/url.gyp:url_lib',
888         'net',
889       ],
890       'export_dependent_settings': [
891         '../base/base.gyp:base',
892         # TODO(mmenke):  This depends on icu, figure out a way to build tests
893         #                without icu.
894         '../base/base.gyp:test_support_base',
895         '../testing/gtest.gyp:gtest',
896         '../testing/gmock.gyp:gmock',
897       ],
898       'sources': [
899         'base/capturing_net_log.cc',
900         'base/capturing_net_log.h',
901         'base/load_timing_info_test_util.cc',
902         'base/load_timing_info_test_util.h',
903         'base/mock_file_stream.cc',
904         'base/mock_file_stream.h',
905         'base/test_completion_callback.cc',
906         'base/test_completion_callback.h',
907         'base/test_data_directory.cc',
908         'base/test_data_directory.h',
909         'cert/mock_cert_verifier.cc',
910         'cert/mock_cert_verifier.h',
911         'cookies/cookie_monster_store_test.cc',
912         'cookies/cookie_monster_store_test.h',
913         'cookies/cookie_store_test_callbacks.cc',
914         'cookies/cookie_store_test_callbacks.h',
915         'cookies/cookie_store_test_helpers.cc',
916         'cookies/cookie_store_test_helpers.h',
917         'disk_cache/disk_cache_test_base.cc',
918         'disk_cache/disk_cache_test_base.h',
919         'disk_cache/disk_cache_test_util.cc',
920         'disk_cache/disk_cache_test_util.h',
921         'dns/dns_test_util.cc',
922         'dns/dns_test_util.h',
923         'dns/mock_host_resolver.cc',
924         'dns/mock_host_resolver.h',
925         'dns/mock_mdns_socket_factory.cc',
926         'dns/mock_mdns_socket_factory.h',
927         'http/http_transaction_test_util.cc',
928         'http/http_transaction_test_util.h',
929         'proxy/mock_proxy_resolver.cc',
930         'proxy/mock_proxy_resolver.h',
931         'proxy/mock_proxy_script_fetcher.cc',
932         'proxy/mock_proxy_script_fetcher.h',
933         'proxy/proxy_config_service_common_unittest.cc',
934         'proxy/proxy_config_service_common_unittest.h',
935         'socket/socket_test_util.cc',
936         'socket/socket_test_util.h',
937         'test/cert_test_util.cc',
938         'test/cert_test_util.h',
939         'test/ct_test_util.cc',
940         'test/ct_test_util.h',
941         'test/embedded_test_server/embedded_test_server.cc',
942         'test/embedded_test_server/embedded_test_server.h',
943         'test/embedded_test_server/http_connection.cc',
944         'test/embedded_test_server/http_connection.h',
945         'test/embedded_test_server/http_request.cc',
946         'test/embedded_test_server/http_request.h',
947         'test/embedded_test_server/http_response.cc',
948         'test/embedded_test_server/http_response.h',
949         'test/net_test_suite.cc',
950         'test/net_test_suite.h',
951         'test/python_utils.cc',
952         'test/python_utils.h',
953         'test/spawned_test_server/base_test_server.cc',
954         'test/spawned_test_server/base_test_server.h',
955         'test/spawned_test_server/local_test_server_posix.cc',
956         'test/spawned_test_server/local_test_server_win.cc',
957         'test/spawned_test_server/local_test_server.cc',
958         'test/spawned_test_server/local_test_server.h',
959         'test/spawned_test_server/remote_test_server.cc',
960         'test/spawned_test_server/remote_test_server.h',
961         'test/spawned_test_server/spawned_test_server.h',
962         'test/spawned_test_server/spawner_communicator.cc',
963         'test/spawned_test_server/spawner_communicator.h',
964         'url_request/test_url_fetcher_factory.cc',
965         'url_request/test_url_fetcher_factory.h',
966         'url_request/url_request_test_util.cc',
967         'url_request/url_request_test_util.h',
968       ],
969       'conditions': [
970         ['OS != "ios"', {
971           'dependencies': [
972             '../third_party/protobuf/protobuf.gyp:py_proto',
973           ],
974         }],
975         ['os_posix == 1 and OS != "mac" and OS != "android" and OS != "ios"', {
976           'conditions': [
977             ['use_openssl==1', {
978               'dependencies': [
979                 '../third_party/openssl/openssl.gyp:openssl',
980               ],
981             }, {
982               'dependencies': [
983                 '../build/linux/system.gyp:ssl',
984               ],
985             }],
986           ],
987         }],
988         ['os_posix == 1 and OS != "mac" and OS != "android" and OS != "ios"', {
989           'conditions': [
990             ['use_allocator!="none"', {
991               'dependencies': [
992                 '../base/allocator/allocator.gyp:allocator',
993               ],
994             }],
995           ],
996         }],
997         ['OS != "android"', {
998           'sources!': [
999             'test/spawned_test_server/remote_test_server.cc',
1000             'test/spawned_test_server/remote_test_server.h',
1001             'test/spawned_test_server/spawner_communicator.cc',
1002             'test/spawned_test_server/spawner_communicator.h',
1003           ],
1004         }],
1005         ['OS == "ios"', {
1006           'dependencies': [
1007             '../third_party/nss/nss.gyp:nss',
1008           ],
1009         }],
1010         [ 'use_v8_in_net==1', {
1011             'dependencies': [
1012               'net_with_v8',
1013             ],
1014           },
1015         ],
1016         [ 'enable_mdns != 1', {
1017             'sources!' : [
1018               'dns/mock_mdns_socket_factory.cc',
1019               'dns/mock_mdns_socket_factory.h'
1020             ]
1021         }],
1022       ],
1023       # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1024       'msvs_disabled_warnings': [4267, ],
1025     },
1026     {
1027       'target_name': 'net_resources',
1028       'type': 'none',
1029       'variables': {
1030         'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/net',
1031       },
1032       'actions': [
1033         {
1034           'action_name': 'net_resources',
1035           'variables': {
1036             'grit_grd_file': 'base/net_resources.grd',
1037           },
1038           'includes': [ '../build/grit_action.gypi' ],
1039         },
1040       ],
1041       'includes': [ '../build/grit_target.gypi' ],
1042     },
1043     {
1044       'target_name': 'http_server',
1045       'type': 'static_library',
1046       'variables': { 'enable_wexit_time_destructors': 1, },
1047       'dependencies': [
1048         '../base/base.gyp:base',
1049         'net',
1050       ],
1051       'sources': [
1052         'server/http_connection.cc',
1053         'server/http_connection.h',
1054         'server/http_server.cc',
1055         'server/http_server.h',
1056         'server/http_server_request_info.cc',
1057         'server/http_server_request_info.h',
1058         'server/http_server_response_info.cc',
1059         'server/http_server_response_info.h',
1060         'server/web_socket.cc',
1061         'server/web_socket.h',
1062       ],
1063       # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1064       'msvs_disabled_warnings': [4267, ],
1065     },
1066     {
1067       'target_name': 'balsa',
1068       'type': 'static_library',
1069       'dependencies': [
1070         '../base/base.gyp:base',
1071         'net',
1072       ],
1073       'sources': [
1074         'tools/balsa/balsa_enums.h',
1075         'tools/balsa/balsa_frame.cc',
1076         'tools/balsa/balsa_frame.h',
1077         'tools/balsa/balsa_headers.cc',
1078         'tools/balsa/balsa_headers.h',
1079         'tools/balsa/balsa_headers_token_utils.cc',
1080         'tools/balsa/balsa_headers_token_utils.h',
1081         'tools/balsa/balsa_visitor_interface.h',
1082         'tools/balsa/http_message_constants.cc',
1083         'tools/balsa/http_message_constants.h',
1084         'tools/balsa/noop_balsa_visitor.h',
1085         'tools/balsa/simple_buffer.cc',
1086         'tools/balsa/simple_buffer.h',
1087         'tools/balsa/split.cc',
1088         'tools/balsa/split.h',
1089         'tools/balsa/string_piece_utils.h',
1090         'tools/quic/spdy_utils.cc',
1091         'tools/quic/spdy_utils.h',
1092       ],
1093     },
1094     {
1095       'target_name': 'dump_cache',
1096       'type': 'executable',
1097       'dependencies': [
1098         '../base/base.gyp:base',
1099         'net',
1100         'net_test_support',
1101       ],
1102       'sources': [
1103         'tools/dump_cache/cache_dumper.cc',
1104         'tools/dump_cache/cache_dumper.h',
1105         'tools/dump_cache/dump_cache.cc',
1106         'tools/dump_cache/dump_files.cc',
1107         'tools/dump_cache/dump_files.h',
1108         'tools/dump_cache/simple_cache_dumper.cc',
1109         'tools/dump_cache/simple_cache_dumper.h',
1110         'tools/dump_cache/upgrade_win.cc',
1111         'tools/dump_cache/upgrade_win.h',
1112         'tools/dump_cache/url_to_filename_encoder.cc',
1113         'tools/dump_cache/url_to_filename_encoder.h',
1114         'tools/dump_cache/url_utilities.h',
1115         'tools/dump_cache/url_utilities.cc',
1116       ],
1117       # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1118       'msvs_disabled_warnings': [4267, ],
1119     },
1120     {
1121       # This is a temporary target which will be merged into 'net' once the
1122       # dependency on balsa is eliminated and the classes are actually used.
1123       'target_name': 'quic_ported_server',
1124       'type': 'static_library',
1125       'dependencies': [
1126         '../base/base.gyp:base',
1127         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
1128         '../url/url.gyp:url_lib',
1129         'net',
1130       ],
1131       'sources': [
1132         'quic/quic_dispatcher.cc',
1133         'quic/quic_dispatcher.h',
1134         'quic/quic_in_memory_cache.cc',
1135         'quic/quic_in_memory_cache.h',
1136         'quic/quic_per_connection_packet_writer.cc',
1137         'quic/quic_per_connection_packet_writer.h',
1138         'quic/quic_server.cc',
1139         'quic/quic_server.h',
1140         'quic/quic_server_packet_writer.cc',
1141         'quic/quic_server_packet_writer.h',
1142         'quic/quic_server_session.cc',
1143         'quic/quic_server_session.h',
1144         'quic/quic_spdy_server_stream.cc',
1145         'quic/quic_spdy_server_stream.h',
1146         'quic/quic_time_wait_list_manager.cc',
1147         'quic/quic_time_wait_list_manager.h',
1148       ],
1149     },
1150   ],
1151   'conditions': [
1152     ['use_v8_in_net == 1', {
1153       'targets': [
1154         {
1155           'target_name': 'net_with_v8',
1156           'type': '<(component)',
1157           'variables': { 'enable_wexit_time_destructors': 1, },
1158           'dependencies': [
1159             '../base/base.gyp:base',
1160             '../gin/gin.gyp:gin',
1161             '../url/url.gyp:url_lib',
1162             '../v8/tools/gyp/v8.gyp:v8',
1163             'net'
1164           ],
1165           'defines': [
1166             'NET_IMPLEMENTATION',
1167           ],
1168           'sources': [
1169             'proxy/proxy_resolver_v8.cc',
1170             'proxy/proxy_resolver_v8.h',
1171             'proxy/proxy_resolver_v8_tracing.cc',
1172             'proxy/proxy_resolver_v8_tracing.h',
1173             'proxy/proxy_service_v8.cc',
1174             'proxy/proxy_service_v8.h',
1175           ],
1176           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1177           'msvs_disabled_warnings': [4267, ],
1178         },
1179       ],
1180     }],
1181     ['OS != "ios" and OS != "android"', {
1182       'targets': [
1183         # iOS doesn't have the concept of simple executables, these targets
1184         # can't be compiled on the platform.
1185         {
1186           'target_name': 'crash_cache',
1187           'type': 'executable',
1188           'dependencies': [
1189             '../base/base.gyp:base',
1190             'net',
1191             'net_test_support',
1192           ],
1193           'sources': [
1194             'tools/crash_cache/crash_cache.cc',
1195           ],
1196           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1197           'msvs_disabled_warnings': [4267, ],
1198         },
1199         {
1200           'target_name': 'crl_set_dump',
1201           'type': 'executable',
1202           'dependencies': [
1203             '../base/base.gyp:base',
1204             'net',
1205           ],
1206           'sources': [
1207             'tools/crl_set_dump/crl_set_dump.cc',
1208           ],
1209           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1210           'msvs_disabled_warnings': [4267, ],
1211         },
1212         {
1213           'target_name': 'dns_fuzz_stub',
1214           'type': 'executable',
1215           'dependencies': [
1216             '../base/base.gyp:base',
1217             'net',
1218           ],
1219           'sources': [
1220             'tools/dns_fuzz_stub/dns_fuzz_stub.cc',
1221           ],
1222           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1223           'msvs_disabled_warnings': [4267, ],
1224         },
1225         {
1226           'target_name': 'gdig',
1227           'type': 'executable',
1228           'dependencies': [
1229             '../base/base.gyp:base',
1230             'net',
1231           ],
1232           'sources': [
1233             'tools/gdig/file_net_log.cc',
1234             'tools/gdig/gdig.cc',
1235           ],
1236         },
1237         {
1238           'target_name': 'get_server_time',
1239           'type': 'executable',
1240           'dependencies': [
1241             '../base/base.gyp:base',
1242             '../base/base.gyp:base_i18n',
1243             '../url/url.gyp:url_lib',
1244             'net',
1245           ],
1246           'sources': [
1247             'tools/get_server_time/get_server_time.cc',
1248           ],
1249           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1250           'msvs_disabled_warnings': [4267, ],
1251         },
1252         {
1253           'target_name': 'hpack_example_generator',
1254           'type': 'executable',
1255           'dependencies': [
1256             '../base/base.gyp:base',
1257             'net',
1258           ],
1259           'sources': [
1260             'spdy/fuzzing/hpack_example_generator.cc',
1261           ],
1262           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1263           'msvs_disabled_warnings': [4267, ],
1264         },
1265         {
1266           'target_name': 'hpack_fuzz_mutator',
1267           'type': 'executable',
1268           'dependencies': [
1269             '../base/base.gyp:base',
1270             'net',
1271           ],
1272           'sources': [
1273             'spdy/fuzzing/hpack_fuzz_mutator.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_fuzz_wrapper',
1280           'type': 'executable',
1281           'dependencies': [
1282             '../base/base.gyp:base',
1283             'net',
1284           ],
1285           'sources': [
1286             'spdy/fuzzing/hpack_fuzz_wrapper.cc',
1287           ],
1288           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1289           'msvs_disabled_warnings': [4267, ],
1290         },
1291         {
1292           'target_name': 'net_watcher',
1293           'type': 'executable',
1294           'dependencies': [
1295             '../base/base.gyp:base',
1296             'net',
1297             'net_with_v8',
1298           ],
1299           'conditions': [
1300             [ 'use_glib == 1', {
1301                 'dependencies': [
1302                   '../build/linux/system.gyp:gconf',
1303                   '../build/linux/system.gyp:gio',
1304                 ],
1305               },
1306             ],
1307           ],
1308           'sources': [
1309             'tools/net_watcher/net_watcher.cc',
1310           ],
1311         },
1312         {
1313           'target_name': 'run_testserver',
1314           'type': 'executable',
1315           'dependencies': [
1316             '../base/base.gyp:base',
1317             '../base/base.gyp:test_support_base',
1318             '../testing/gtest.gyp:gtest',
1319             'net_test_support',
1320           ],
1321           'sources': [
1322             'tools/testserver/run_testserver.cc',
1323           ],
1324         },
1325         {
1326           'target_name': 'stress_cache',
1327           'type': 'executable',
1328           'dependencies': [
1329             '../base/base.gyp:base',
1330             'net',
1331             'net_test_support',
1332           ],
1333           'sources': [
1334             'disk_cache/blockfile/stress_cache.cc',
1335           ],
1336           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1337           'msvs_disabled_warnings': [4267, ],
1338         },
1339         {
1340           'target_name': 'tld_cleanup',
1341           'type': 'executable',
1342           'dependencies': [
1343             '../base/base.gyp:base',
1344             '../base/base.gyp:base_i18n',
1345             '../net/tools/tld_cleanup/tld_cleanup.gyp:tld_cleanup_util',
1346           ],
1347           'sources': [
1348             'tools/tld_cleanup/tld_cleanup.cc',
1349           ],
1350           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1351           'msvs_disabled_warnings': [4267, ],
1352         },
1353       ],
1354     }],
1355     ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android"', {
1356       'targets': [
1357         {
1358           'target_name': 'epoll_server',
1359           'type': 'static_library',
1360           'dependencies': [
1361             '../base/base.gyp:base',
1362             'net',
1363           ],
1364           'sources': [
1365             'tools/epoll_server/epoll_server.cc',
1366             'tools/epoll_server/epoll_server.h',
1367           ],
1368         },
1369         {
1370           'target_name': 'flip_in_mem_edsm_server_base',
1371           'type': 'static_library',
1372           'cflags': [
1373             '-Wno-deprecated',
1374           ],
1375           'dependencies': [
1376             '../base/base.gyp:base',
1377             '../third_party/openssl/openssl.gyp:openssl',
1378             'balsa',
1379             'epoll_server',
1380             'net',
1381           ],
1382           'sources': [
1383             'tools/dump_cache/url_to_filename_encoder.cc',
1384             'tools/dump_cache/url_to_filename_encoder.h',
1385             'tools/dump_cache/url_utilities.h',
1386             'tools/dump_cache/url_utilities.cc',
1387             'tools/flip_server/acceptor_thread.h',
1388             'tools/flip_server/acceptor_thread.cc',
1389             'tools/flip_server/create_listener.cc',
1390             'tools/flip_server/create_listener.h',
1391             'tools/flip_server/constants.h',
1392             'tools/flip_server/flip_config.cc',
1393             'tools/flip_server/flip_config.h',
1394             'tools/flip_server/http_interface.cc',
1395             'tools/flip_server/http_interface.h',
1396             'tools/flip_server/loadtime_measurement.h',
1397             'tools/flip_server/mem_cache.h',
1398             'tools/flip_server/mem_cache.cc',
1399             'tools/flip_server/output_ordering.cc',
1400             'tools/flip_server/output_ordering.h',
1401             'tools/flip_server/ring_buffer.cc',
1402             'tools/flip_server/ring_buffer.h',
1403             'tools/flip_server/sm_connection.cc',
1404             'tools/flip_server/sm_connection.h',
1405             'tools/flip_server/sm_interface.h',
1406             'tools/flip_server/spdy_ssl.cc',
1407             'tools/flip_server/spdy_ssl.h',
1408             'tools/flip_server/spdy_interface.cc',
1409             'tools/flip_server/spdy_interface.h',
1410             'tools/flip_server/spdy_util.cc',
1411             'tools/flip_server/spdy_util.h',
1412             'tools/flip_server/streamer_interface.cc',
1413             'tools/flip_server/streamer_interface.h',
1414           ],
1415         },
1416         {
1417           'target_name': 'flip_in_mem_edsm_server_unittests',
1418           'type': 'executable',
1419           'dependencies': [
1420               '../testing/gtest.gyp:gtest',
1421               '../testing/gmock.gyp:gmock',
1422               '../third_party/openssl/openssl.gyp:openssl',
1423               'flip_in_mem_edsm_server_base',
1424               'net',
1425               'net_test_support',
1426           ],
1427           'sources': [
1428             'tools/flip_server/flip_test_utils.cc',
1429             'tools/flip_server/flip_test_utils.h',
1430             'tools/flip_server/http_interface_test.cc',
1431             'tools/flip_server/mem_cache_test.cc',
1432             'tools/flip_server/run_all_tests.cc',
1433             'tools/flip_server/spdy_interface_test.cc',
1434           ],
1435         },
1436         {
1437           'target_name': 'flip_in_mem_edsm_server',
1438           'type': 'executable',
1439           'cflags': [
1440             '-Wno-deprecated',
1441           ],
1442           'dependencies': [
1443             '../base/base.gyp:base',
1444             'flip_in_mem_edsm_server_base',
1445             'net',
1446           ],
1447           'sources': [
1448             'tools/flip_server/flip_in_mem_edsm_server.cc',
1449           ],
1450         },
1451         {
1452           'target_name': 'quic_base',
1453           'type': 'static_library',
1454           'dependencies': [
1455             '../base/base.gyp:base',
1456             '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
1457             '../url/url.gyp:url_lib',
1458             'balsa',
1459             'epoll_server',
1460             'net',
1461           ],
1462           'sources': [
1463             'tools/quic/quic_client.cc',
1464             'tools/quic/quic_client.h',
1465             'tools/quic/quic_client_session.cc',
1466             'tools/quic/quic_client_session.h',
1467             'tools/quic/quic_default_packet_writer.cc',
1468             'tools/quic/quic_default_packet_writer.h',
1469             'tools/quic/quic_dispatcher.h',
1470             'tools/quic/quic_dispatcher.cc',
1471             'tools/quic/quic_epoll_clock.cc',
1472             'tools/quic/quic_epoll_clock.h',
1473             'tools/quic/quic_epoll_connection_helper.cc',
1474             'tools/quic/quic_epoll_connection_helper.h',
1475             'tools/quic/quic_in_memory_cache.cc',
1476             'tools/quic/quic_in_memory_cache.h',
1477             'tools/quic/quic_packet_writer_wrapper.cc',
1478             'tools/quic/quic_packet_writer_wrapper.h',
1479             'tools/quic/quic_server.cc',
1480             'tools/quic/quic_server.h',
1481             'tools/quic/quic_server_session.cc',
1482             'tools/quic/quic_server_session.h',
1483             'tools/quic/quic_socket_utils.cc',
1484             'tools/quic/quic_socket_utils.h',
1485             'tools/quic/quic_spdy_client_stream.cc',
1486             'tools/quic/quic_spdy_client_stream.h',
1487             'tools/quic/quic_spdy_server_stream.cc',
1488             'tools/quic/quic_spdy_server_stream.h',
1489             'tools/quic/quic_time_wait_list_manager.h',
1490             'tools/quic/quic_time_wait_list_manager.cc',
1491           ],
1492         },
1493         {
1494           'target_name': 'quic_client',
1495           'type': 'executable',
1496           'dependencies': [
1497             '../base/base.gyp:base',
1498             'net',
1499             'quic_base',
1500           ],
1501           'sources': [
1502             'tools/quic/quic_client_bin.cc',
1503           ],
1504         },
1505         {
1506           'target_name': 'quic_server',
1507           'type': 'executable',
1508           'dependencies': [
1509             '../base/base.gyp:base',
1510             'net',
1511             'quic_ported_server',
1512           ],
1513           'sources': [
1514             'quic/quic_server_bin.cc',
1515           ],
1516         },
1517       ]
1518     }],
1519     ['OS=="android"', {
1520       'targets': [
1521         {
1522           'target_name': 'net_jni_headers',
1523           'type': 'none',
1524           'sources': [
1525             'android/java/src/org/chromium/net/AndroidCertVerifyResult.java',
1526             'android/java/src/org/chromium/net/AndroidKeyStore.java',
1527             'android/java/src/org/chromium/net/AndroidNetworkLibrary.java',
1528             'android/java/src/org/chromium/net/AndroidPrivateKey.java',
1529             'android/java/src/org/chromium/net/GURLUtils.java',
1530             'android/java/src/org/chromium/net/NetworkChangeNotifier.java',
1531             'android/java/src/org/chromium/net/ProxyChangeListener.java',
1532             'android/java/src/org/chromium/net/X509Util.java',
1533           ],
1534           'variables': {
1535             'jni_gen_package': 'net',
1536           },
1537           'includes': [ '../build/jni_generator.gypi' ],
1539           'conditions': [
1540             ['use_icu_alternatives_on_android==1', {
1541               'sources': [
1542                 'android/java/src/org/chromium/net/NetStringUtil.java',
1543               ],
1544             }],
1545           ],
1546         },
1547         {
1548           'target_name': 'net_test_jni_headers',
1549           'type': 'none',
1550           'sources': [
1551             'android/javatests/src/org/chromium/net/AndroidKeyStoreTestUtil.java',
1552           ],
1553           'variables': {
1554             'jni_gen_package': 'net',
1555           },
1556           'includes': [ '../build/jni_generator.gypi' ],
1557         },
1558         {
1559           'target_name': 'net_java',
1560           'type': 'none',
1561           'variables': {
1562             'java_in_dir': '../net/android/java',
1563           },
1564           'dependencies': [
1565             '../base/base.gyp:base',
1566             'cert_verify_status_android_java',
1567             'certificate_mime_types_java',
1568             'net_errors_java',
1569             'private_key_types_java',
1570             'remote_android_keystore_aidl',
1571           ],
1572           'includes': [ '../build/java.gypi' ],
1573         },
1574         {
1575           # Processes the interface files for communication with an Android KeyStore
1576           # running in a separate process.
1577           'target_name': 'remote_android_keystore_aidl',
1578           'type': 'none',
1579           'variables': {
1580             'aidl_interface_file': '../net/android/java/src/org/chromium/net/IRemoteAndroidKeyStoreInterface.aidl',
1581           },
1582           'sources': [
1583             '../net/android/java/src/org/chromium/net/IRemoteAndroidKeyStore.aidl',
1584             '../net/android/java/src/org/chromium/net/IRemoteAndroidKeyStoreCallbacks.aidl',
1585           ],
1586           'includes': [ '../build/java_aidl.gypi' ],
1587         },
1588         {
1589           'target_name': 'net_java_test_support',
1590           'type': 'none',
1591           'variables': {
1592             'java_in_dir': '../net/test/android/javatests',
1593           },
1594           'includes': [ '../build/java.gypi' ],
1595         },
1596         {
1597           'target_name': 'net_javatests',
1598           'type': 'none',
1599           'variables': {
1600             'java_in_dir': '../net/android/javatests',
1601           },
1602           'dependencies': [
1603             '../base/base.gyp:base',
1604             '../base/base.gyp:base_java_test_support',
1605             'net_java',
1606           ],
1607           'includes': [ '../build/java.gypi' ],
1608         },
1609         {
1610           'target_name': 'net_errors_java',
1611           'type': 'none',
1612           'sources': [
1613             'android/java/NetError.template',
1614           ],
1615           'variables': {
1616             'package_name': 'org/chromium/net',
1617             'template_deps': ['base/net_error_list.h'],
1618           },
1619           'includes': [ '../build/android/java_cpp_template.gypi' ],
1620         },
1621         {
1622           'target_name': 'certificate_mime_types_java',
1623           'type': 'none',
1624           'sources': [
1625             'android/java/CertificateMimeType.template',
1626           ],
1627           'variables': {
1628             'package_name': 'org/chromium/net',
1629             'template_deps': ['base/mime_util_certificate_type_list.h'],
1630           },
1631           'includes': [ '../build/android/java_cpp_template.gypi' ],
1632         },
1633         {
1634           'target_name': 'cert_verify_status_android_java',
1635           'type': 'none',
1636           'sources': [
1637             'android/java/CertVerifyStatusAndroid.template',
1638           ],
1639           'variables': {
1640             'package_name': 'org/chromium/net',
1641             'template_deps': ['android/cert_verify_status_android_list.h'],
1642           },
1643           'includes': [ '../build/android/java_cpp_template.gypi' ],
1644         },
1645         {
1646           'target_name': 'private_key_types_java',
1647           'type': 'none',
1648           'sources': [
1649             'android/java/PrivateKeyType.template',
1650           ],
1651           'variables': {
1652             'package_name': 'org/chromium/net',
1653             'template_deps': ['android/private_key_type_list.h'],
1654           },
1655           'includes': [ '../build/android/java_cpp_template.gypi' ],
1656         },
1657       ],
1658     }],
1659     ['OS == "android"', {
1660       'targets': [
1661         {
1662           'target_name': 'net_unittests_apk',
1663           'type': 'none',
1664           'dependencies': [
1665             'net_java',
1666             'net_javatests',
1667             'net_unittests',
1668           ],
1669           'variables': {
1670             'test_suite_name': 'net_unittests',
1671           },
1672           'includes': [ '../build/apk_test.gypi' ],
1673         },
1674       ],
1675     }],
1676     ['OS == "android" or OS == "linux"', {
1677       'targets': [
1678         {
1679           'target_name': 'disk_cache_memory_test',
1680           'type': 'executable',
1681           'dependencies': [
1682             '../base/base.gyp:base',
1683             'net',
1684           ],
1685           'sources': [
1686             'tools/disk_cache_memory_test/disk_cache_memory_test.cc',
1687           ],
1688         },
1689       ],
1690     }],
1691     ['test_isolation_mode != "noop"', {
1692       'targets': [
1693         {
1694           'target_name': 'net_unittests_run',
1695           'type': 'none',
1696           'dependencies': [
1697             'net_unittests',
1698           ],
1699           'includes': [
1700             '../build/isolate.gypi',
1701             'net_unittests.isolate',
1702           ],
1703           'sources': [
1704             'net_unittests.isolate',
1705           ],
1706         },
1707       ],
1708     }],
1709   ],