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