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