Makes it so an embed root can call Embed() on any descendant
[chromium-blink-merge.git] / net / net.gyp
blob12521d92f162af7d6e335c290ab9cd7a5c91a0a8
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,
8     # Defines an extra set of libs with an alternate copy of org.apache.http.
9     # TODO(yfriedman): Remove this when crbug.com/488192 is fixed.
10     'net_test_extra_libs': [],
11     'linux_link_kerberos%': 0,
12     'conditions': [
13       ['chromeos==1 or embedded==1 or OS=="ios"', {
14         # Disable Kerberos on ChromeOS and iOS, at least for now.
15         # It needs configuration (krb5.conf and so on).
16         'use_kerberos%': 0,
17       }, {  # chromeos == 0 and embedded==0 and OS!="ios"
18         'use_kerberos%': 1,
19       }],
20       ['OS=="android" and target_arch != "ia32"', {
21         # The way the cache uses mmap() is inefficient on some Android devices.
22         # If this flag is set, we hackily avoid using mmap() in the disk cache.
23         # We are pretty confident that mmap-ing the index would not hurt any
24         # existing x86 android devices, but we cannot be so sure about the
25         # variety of ARM devices. So enable it for x86 only for now.
26         'posix_avoid_mmap%': 1,
27       }, {
28         'posix_avoid_mmap%': 0,
29       }],
30       ['OS=="ios"', {
31         # Websockets and socket stream are not used on iOS.
32         'enable_websockets%': 0,
33         # iOS does not use V8.
34         'use_v8_in_net%': 0,
35         'enable_built_in_dns%': 0,
36       }, {
37         'enable_websockets%': 1,
38         'use_v8_in_net%': 1,
39         'enable_built_in_dns%': 1,
40       }],
41     ],
42   },
43   'includes': [
44     '../build/win_precompile.gypi',
45     'net.gypi',
46   ],
47   'targets': [
48     {
49       'target_name': 'net_derived_sources',
50       'type': 'none',
51       'sources': [
52         'base/registry_controlled_domains/effective_tld_names.gperf',
53         'base/registry_controlled_domains/effective_tld_names_unittest1.gperf',
54         'base/registry_controlled_domains/effective_tld_names_unittest2.gperf',
55         'base/registry_controlled_domains/effective_tld_names_unittest3.gperf',
56         'base/registry_controlled_domains/effective_tld_names_unittest4.gperf',
57         'base/registry_controlled_domains/effective_tld_names_unittest5.gperf',
58         'base/registry_controlled_domains/effective_tld_names_unittest6.gperf',
59       ],
60       'rules': [
61         {
62           'rule_name': 'dafsa',
63           'extension': 'gperf',
64           'outputs': [
65             '<(SHARED_INTERMEDIATE_DIR)/net/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT)-inc.cc',
66           ],
67           'inputs': [
68             'tools/tld_cleanup/make_dafsa.py',
69           ],
70           'action': [
71             'python',
72             'tools/tld_cleanup/make_dafsa.py',
73             '<(RULE_INPUT_PATH)',
74             '<(SHARED_INTERMEDIATE_DIR)/net/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT)-inc.cc',
75           ],
76         },
77       ],
78       'direct_dependent_settings': {
79         'include_dirs': [
80           '<(SHARED_INTERMEDIATE_DIR)'
81         ],
82       },
83     },
84     {
85       # Protobuf compiler / generator for QUIC crypto protocol buffer.
86       # GN version: //net/quic/proto
87       'target_name': 'net_quic_proto',
88       'type': 'static_library',
89       'sources': [
90         'quic/proto/cached_network_parameters.proto',
91         'quic/proto/source_address_token.proto',
92       ],
93       'variables': {
94         'enable_wexit_time_destructors': 1,
95         'proto_in_dir': 'quic/proto',
96         'proto_out_dir': 'net/quic/proto',
97         'cc_generator_options': 'dllexport_decl=NET_EXPORT_PRIVATE:',
98         'cc_include': 'net/base/net_export.h',
99       },
100       'includes': [
101         '../build/protoc.gypi',
102       ],
103       'defines': [
104         'NET_IMPLEMENTATION',
105       ],
106     },
107     {
108       # GN version: //net
109       'target_name': 'net',
110       'dependencies': [
111         '../base/base.gyp:base_i18n',
112         '../third_party/icu/icu.gyp:icui18n',
113         '../third_party/icu/icu.gyp:icuuc',
114         '../third_party/protobuf/protobuf.gyp:protobuf_lite',
115         '../url/url.gyp:url_lib',
116         'net_quic_proto',
117       ],
118       'sources': [
119         'base/filename_util_icu.cc',
120         'base/net_string_util_icu.cc',
121         'base/net_util_icu.cc',
122       ],
123       'includes': [ 'net_common.gypi' ],
124     },
125     {
126       # GN version: //net:net_unittests
127       'target_name': 'net_unittests',
128       'type': '<(gtest_target_type)',
129       'dependencies': [
130         '../base/base.gyp:base',
131         '../base/base.gyp:base_i18n',
132         '../base/base.gyp:base_prefs_test_support',
133         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
134         '../crypto/crypto.gyp:crypto',
135         '../crypto/crypto.gyp:crypto_test_support',
136         '../testing/gmock.gyp:gmock',
137         '../testing/gtest.gyp:gtest',
138         '../third_party/zlib/zlib.gyp:zlib',
139         '../url/url.gyp:url_lib',
140         'balsa',
141         'http_server',
142         'net',
143         'net_quic_proto',
144         'net_derived_sources',
145         'net_extras',
146         'net_test_support',
147         'simple_quic_tools',
148       ],
149       'sources': [
150         '<@(net_test_sources)',
151       ],
152       'conditions': [
153         ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android"', {
154           'dependencies': [
155             'epoll_quic_tools',
156             'epoll_server',
157             'flip_in_mem_edsm_server_base',
158           ],
159           'sources': [
160             '<@(net_linux_test_sources)',
161           ],
162         }],
163         ['OS == "mac" or OS == "ios"', {
164           'sources': [
165             '<@(net_base_test_mac_ios_sources)',
166           ],
167         }],
168         ['chromeos==1', {
169           'sources!': [
170             'proxy/proxy_config_service_linux_unittest.cc',
171           ],
172         }],
173         [ 'OS == "android"', {
174           'sources!': [
175             # See bug http://crbug.com/344533.
176             'disk_cache/blockfile/index_table_v3_unittest.cc',
177           ],
178           'dependencies': [
179             'net_javatests',
180           ],
181         }],
182         [ 'use_nss_certs != 1', {
183           'sources!': [
184             'cert/nss_cert_database_unittest.cc',
185             'cert/nss_cert_database_chromeos_unittest.cc',
186             'cert/nss_profile_filter_chromeos_unittest.cc',
187             'ssl/client_cert_store_nss_unittest.cc',
188           ],
189         }],
190         [ 'use_openssl == 1', {
191           # Avoid compiling/linking with the system library.
192           'dependencies': [
193             '../third_party/boringssl/boringssl.gyp:boringssl',
194           ],
195         }],
196         [ 'use_nss_certs == 1 or OS == "ios" or use_openssl == 0', {
197           'conditions': [
198             [ 'desktop_linux == 1 or chromeos == 1', {
199               'dependencies': [
200                 '../build/linux/system.gyp:ssl',
201               ],
202             }, {  # desktop_linux == 0 and chromeos == 0
203               'dependencies': [
204                 '../third_party/nss/nss.gyp:nspr',
205                 '../third_party/nss/nss.gyp:nss',
206                 'third_party/nss/ssl.gyp:libssl',
207               ],
208             }],
209           ],
210         }],
211         [ 'os_posix == 1 and OS != "mac" and OS != "android" and OS != "ios"', {
212           'conditions': [
213             ['use_allocator!="none"', {
214               'dependencies': [
215                 '../base/allocator/allocator.gyp:allocator',
216               ],
217             }],
218           ],
219         }],
220         [ 'use_kerberos==1', {
221           'defines': [
222             'USE_KERBEROS',
223           ],
224         }],
225         [ 'use_kerberos==0 or OS == "android"', {
226           # These are excluded on Android, because the actual Kerberos support,
227           # which these test, is in a separate app on Android.
228           'sources!': [
229             'http/http_auth_gssapi_posix_unittest.cc',
230             'http/mock_gssapi_library_posix.cc',
231             'http/mock_gssapi_library_posix.h',
232           ],
233         }],
234        [ 'use_kerberos==0', {
235           'sources!': [
236             'http/http_auth_handler_negotiate_unittest.cc',
237           ],
238         }],
239         [ 'use_openssl == 1 or (desktop_linux == 0 and chromeos == 0 and OS != "ios")', {
240           # Only include this test when on Posix and using NSS for
241           # cert verification or on iOS (which also uses NSS for certs).
242           'sources!': [
243             'cert_net/nss_ocsp_unittest.cc',
244           ],
245         }],
246         [ 'use_openssl==1', {
247             # When building for OpenSSL, we need to exclude NSS specific tests
248             # or functionality not supported by OpenSSL yet.
249             # TODO(bulach): Add equivalent tests when the underlying
250             #               functionality is ported to OpenSSL.
251             'sources!': [
252               'cert/x509_util_nss_unittest.cc',
253               'quic/test_tools/crypto_test_utils_nss.cc',
254             ],
255           }, {  # else !use_openssl: remove the unneeded files and pull in NSS.
256             'sources!': [
257               'cert/x509_util_openssl_unittest.cc',
258               'quic/test_tools/crypto_test_utils_openssl.cc',
259               'socket/ssl_client_socket_openssl_unittest.cc',
260               'ssl/ssl_client_session_cache_openssl_unittest.cc',
261             ],
262           },
263         ],
264         [ 'use_openssl_certs == 0', {
265             'sources!': [
266               'ssl/openssl_client_key_store_unittest.cc',
267             ],
268         }],
269         [ 'enable_websockets != 1', {
270             'sources/': [
271               ['exclude', '^websockets/'],
272               ['exclude', '^server/'],
273             ],
274             'dependencies!': [
275               'http_server',
276             ],
277         }],
278         ['disable_file_support==1', {
279           'sources!': [
280             'base/directory_lister_unittest.cc',
281             'url_request/url_request_file_job_unittest.cc',
282           ],
283         }],
284         [ 'disable_ftp_support==1', {
285             'sources/': [
286               ['exclude', '^ftp/'],
287             ],
288             'sources!': [
289               'url_request/url_request_ftp_job_unittest.cc',
290             ],
291           },
292         ],
293         [ 'enable_built_in_dns!=1', {
294             'sources!': [
295               'dns/address_sorter_posix_unittest.cc',
296               'dns/address_sorter_unittest.cc',
297             ],
298           },
299         ],
300         # Always need use_v8_in_net to be 1 to run gyp on Android, so just
301         # remove net_unittest's dependency on v8 when using icu alternatives
302         # instead of setting use_v8_in_net to 0.
303         [ 'use_v8_in_net==1 and use_icu_alternatives_on_android==0', {
304             'dependencies': [
305               'net_with_v8',
306             ],
307           }, {  # else: !use_v8_in_net
308             'sources!': [
309               'proxy/proxy_resolver_v8_tracing_unittest.cc',
310               'proxy/proxy_resolver_v8_tracing_wrapper_unittest.cc',
311               'proxy/proxy_resolver_v8_unittest.cc',
312             ],
313           },
314         ],
316         [ 'use_v8_in_net==1 and OS != "android"', {
317             'dependencies': [
318               'net_with_v8',
319               'net_browser_services',
320               'net_utility_services',
321               '../third_party/mojo/mojo_edk.gyp:mojo_system_impl',
322             ],
323           }, {  # else
324             'sources!': [
325               'dns/host_resolver_mojo_unittest.cc',
326               'dns/mojo_host_resolver_impl_unittest.cc',
327               'proxy/mojo_proxy_resolver_factory_impl_unittest.cc',
328               'proxy/mojo_proxy_resolver_impl_unittest.cc',
329               'proxy/mojo_proxy_resolver_v8_tracing_bindings_unittest.cc',
330               'proxy/proxy_resolver_factory_mojo_unittest.cc',
331               'proxy/proxy_service_mojo_unittest.cc',
332             ],
333           },
334         ],
336         [ 'enable_mdns != 1', {
337             'sources!' : [
338               'dns/mdns_cache_unittest.cc',
339               'dns/mdns_client_unittest.cc',
340               'dns/mdns_query_unittest.cc',
341               'dns/record_parsed_unittest.cc',
342               'dns/record_rdata_unittest.cc',
343             ],
344         }],
345         [ 'OS == "win"', {
346             'sources!': [
347               'dns/dns_config_service_posix_unittest.cc',
348               'http/http_auth_gssapi_posix_unittest.cc',
349             ],
350             # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
351             'msvs_disabled_warnings': [4267, ],
352             'conditions': [
353               [ 'icu_use_data_file_flag == 0', {
354                 # This is needed to trigger the dll copy step on windows.
355                 # TODO(mark): Specifying this here shouldn't be necessary.
356                 'dependencies': [
357                   '../third_party/icu/icu.gyp:icudata',
358                 ],
359               }],
360             ],
361           },
362         ],
363         [ 'OS == "ios"', {
364             'actions': [
365               {
366                 'action_name': 'copy_test_data',
367                 'variables': {
368                   'test_data_files': [
369                     'data/ssl/certificates/',
370                     'data/test.html',
371                     'data/url_request_unittest/',
372                     'data/verify_name_match_unittest/names/',
373                     'data/parse_certificate_unittest/',
374                   ],
375                   'test_data_prefix': 'net',
376                 },
377                 'includes': [ '../build/copy_test_data_ios.gypi' ],
378               },
379             ],
380             'sources!': [
381               # TODO(droger): The following tests are disabled because the
382               # implementation is missing or incomplete.
383               # KeygenHandler::GenKeyAndSignChallenge() is not ported to iOS.
384               'base/keygen_handler_unittest.cc',
385               'disk_cache/backend_unittest.cc',
386               'disk_cache/blockfile/block_files_unittest.cc',
387               # Need to read input data files.
388               'filter/gzip_filter_unittest.cc',
389               # Need TestServer.
390               "cert_net/cert_net_fetcher_impl_unittest.cc",
391               'proxy/proxy_script_fetcher_impl_unittest.cc',
392               'socket/ssl_client_socket_unittest.cc',
393               'socket/ssl_server_socket_unittest.cc',
394               'spdy/fuzzing/hpack_fuzz_util_test.cc',
395               # Needs GetAppOutput().
396               'test/python_utils_unittest.cc',
397               'url_request/url_fetcher_impl_unittest.cc',
398               'url_request/url_request_context_builder_unittest.cc',
400               # The following tests are disabled because they don't apply to
401               # iOS.
402               # OS is not "linux" or "freebsd" or "openbsd".
403               'socket/unix_domain_client_socket_posix_unittest.cc',
404               'socket/unix_domain_server_socket_posix_unittest.cc',
406               # See bug http://crbug.com/344533.
407               'disk_cache/blockfile/index_table_v3_unittest.cc',
408             ],
409         }],
410         ['OS == "android"', {
411           # TODO(mmenke):  This depends on test_support_base, which depends on
412           #                icu.  Figure out a way to remove that dependency.
413           'dependencies': [
414             '../testing/android/native_test.gyp:native_test_native_code',
415           ]
416         }],
417         [ 'use_icu_alternatives_on_android == 1', {
418             'dependencies!': [
419               '../base/base.gyp:base_i18n',
420             ],
421             'sources!': [
422               'base/filename_util_unittest.cc',
423               'base/net_util_icu_unittest.cc',
424             ],
425           },
426         ],
427         ['use_v8_in_net==1 and v8_use_external_startup_data==1', {
428           'dependencies': [
429             '../gin/gin.gyp:gin',
430           ]
431         }],
432       ],
433       'target_conditions': [
434         # These source files are excluded by default platform rules, but they
435         # are needed in specific cases on other platforms. Re-including them can
436         # only be done in target_conditions as it is evaluated after the
437         # platform rules.
438         ['OS == "android"', {
439           'sources/': [
440             ['include', '^base/address_tracker_linux_unittest\\.cc$'],
441           ],
442         }],
443         ['OS == "ios"', {
444           'sources/': [
445             ['include', '^base/mac/url_conversions_unittest\\.mm$'],
446           ],
447         }],
448       ],
449     },
450     {
451       'target_name': 'net_perftests',
452       'type': 'executable',
453       'dependencies': [
454         '../base/base.gyp:base',
455         '../base/base.gyp:base_i18n',
456         '../base/base.gyp:test_support_perf',
457         '../testing/gtest.gyp:gtest',
458         '../url/url.gyp:url_lib',
459         'net',
460         'net_extras',
461         'net_test_support',
462       ],
463       'sources': [
464         'base/mime_sniffer_perftest.cc',
465         'cookies/cookie_monster_perftest.cc',
466         'disk_cache/blockfile/disk_cache_perftest.cc',
467         'extras/sqlite/sqlite_persistent_cookie_store_perftest.cc',
468         'proxy/proxy_resolver_perftest.cc',
469         'udp/udp_socket_perftest.cc',
470         'websockets/websocket_frame_perftest.cc',
471       ],
472       'conditions': [
473         [ 'use_v8_in_net==1', {
474             'dependencies': [
475               'net_with_v8',
476             ],
477           }, {  # else: !use_v8_in_net
478             'sources!': [
479               'proxy/proxy_resolver_perftest.cc',
480             ],
481           },
482         ],
483         [ 'OS == "win"', {
484             'conditions': [
485               [ 'icu_use_data_file_flag == 0', {
486                 # This is needed to trigger the dll copy step on windows.
487                 # TODO(mark): Specifying this here shouldn't be necessary.
488                 'dependencies': [
489                   '../third_party/icu/icu.gyp:icudata',
490                 ],
491               }],
492             ],
493             # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
494             'msvs_disabled_warnings': [4267, ],
495         }],
496         [ 'enable_websockets != 1', {
497           'sources!': [
498             'websockets/websocket_frame_perftest.cc',
499           ],
500         }],
501       ],
502     },
503     {
504       'target_name': 'net_test_support',
505       'type': 'static_library',
506       'dependencies': [
507         '../base/base.gyp:base',
508         '../base/base.gyp:test_support_base',
509         '../crypto/crypto.gyp:crypto',
510         '../net/tools/tld_cleanup/tld_cleanup.gyp:tld_cleanup_util',
511         '../testing/gtest.gyp:gtest',
512         '../testing/gmock.gyp:gmock',
513         '../url/url.gyp:url_lib',
514         'net',
515       ],
516       'export_dependent_settings': [
517         '../base/base.gyp:base',
518         # TODO(mmenke):  This depends on icu, figure out a way to build tests
519         #                without icu.
520         '../base/base.gyp:test_support_base',
521         '../crypto/crypto.gyp:crypto',
522         '../testing/gtest.gyp:gtest',
523         '../testing/gmock.gyp:gmock',
524       ],
525       'sources': [
526         'base/load_timing_info_test_util.cc',
527         'base/load_timing_info_test_util.h',
528         'base/mock_file_stream.cc',
529         'base/mock_file_stream.h',
530         'base/test_completion_callback.cc',
531         'base/test_completion_callback.h',
532         'base/test_data_directory.cc',
533         'base/test_data_directory.h',
534         'cert/mock_cert_verifier.cc',
535         'cert/mock_cert_verifier.h',
536         'cookies/cookie_monster_store_test.cc',
537         'cookies/cookie_monster_store_test.h',
538         'cookies/cookie_store_test_callbacks.cc',
539         'cookies/cookie_store_test_callbacks.h',
540         'cookies/cookie_store_test_helpers.cc',
541         'cookies/cookie_store_test_helpers.h',
542         'disk_cache/disk_cache_test_base.cc',
543         'disk_cache/disk_cache_test_base.h',
544         'disk_cache/disk_cache_test_util.cc',
545         'disk_cache/disk_cache_test_util.h',
546         'dns/dns_test_util.cc',
547         'dns/dns_test_util.h',
548         'dns/mock_host_resolver.cc',
549         'dns/mock_host_resolver.h',
550         'dns/mock_mdns_socket_factory.cc',
551         'dns/mock_mdns_socket_factory.h',
552         'http/http_transaction_test_util.cc',
553         'http/http_transaction_test_util.h',
554         'log/test_net_log.cc',
555         'log/test_net_log.h',
556         'log/test_net_log_entry.cc',
557         'log/test_net_log_entry.h',
558         'log/test_net_log_util.cc',
559         'log/test_net_log_util.h',
560         'proxy/mock_proxy_resolver.cc',
561         'proxy/mock_proxy_resolver.h',
562         'proxy/mock_proxy_script_fetcher.cc',
563         'proxy/mock_proxy_script_fetcher.h',
564         'proxy/proxy_config_service_common_unittest.cc',
565         'proxy/proxy_config_service_common_unittest.h',
566         'socket/socket_test_util.cc',
567         'socket/socket_test_util.h',
568         'test/cert_test_util.cc',
569         'test/cert_test_util.h',
570         'test/cert_test_util_nss.cc',
571         'test/channel_id_test_util.cc',
572         'test/channel_id_test_util.h',
573         'test/ct_test_util.cc',
574         'test/ct_test_util.h',
575         'test/embedded_test_server/embedded_test_server.cc',
576         'test/embedded_test_server/embedded_test_server.h',
577         'test/embedded_test_server/http_connection.cc',
578         'test/embedded_test_server/http_connection.h',
579         'test/embedded_test_server/http_request.cc',
580         'test/embedded_test_server/http_request.h',
581         'test/embedded_test_server/http_response.cc',
582         'test/embedded_test_server/http_response.h',
583         'test/embedded_test_server/stream_listen_socket.cc',
584         'test/embedded_test_server/stream_listen_socket.h',
585         'test/embedded_test_server/tcp_listen_socket.cc',
586         'test/embedded_test_server/tcp_listen_socket.h',
587         'test/event_waiter.h',
588         'test/net_test_suite.cc',
589         'test/net_test_suite.h',
590         'test/python_utils.cc',
591         'test/python_utils.h',
592         'test/spawned_test_server/base_test_server.cc',
593         'test/spawned_test_server/base_test_server.h',
594         'test/spawned_test_server/local_test_server.cc',
595         'test/spawned_test_server/local_test_server.h',
596         'test/spawned_test_server/local_test_server_posix.cc',
597         'test/spawned_test_server/local_test_server_win.cc',
598         'test/spawned_test_server/spawned_test_server.h',
599         'test/url_request/ssl_certificate_error_job.cc',
600         'test/url_request/ssl_certificate_error_job.h',
601         'test/url_request/url_request_failed_job.cc',
602         'test/url_request/url_request_failed_job.h',
603         'test/url_request/url_request_mock_data_job.cc',
604         'test/url_request/url_request_mock_data_job.h',
605         'test/url_request/url_request_slow_download_job.cc',
606         'test/url_request/url_request_slow_download_job.h',
607         'url_request/test_url_fetcher_factory.cc',
608         'url_request/test_url_fetcher_factory.h',
609         'url_request/url_request_test_util.cc',
610         'url_request/url_request_test_util.h',
611       ],
612       'conditions': [
613         ['OS != "ios"', {
614           'dependencies': [
615             '../third_party/protobuf/protobuf.gyp:py_proto',
616           ],
617         }],
618         ['use_nss_certs == 1 or OS == "ios"', {
619           'conditions': [
620             [ 'desktop_linux == 1 or chromeos == 1', {
621               'dependencies': [
622                 '../build/linux/system.gyp:ssl',
623               ],
624             }, {  # desktop_linux == 0 and chromeos == 0
625               'dependencies': [
626                 '../third_party/nss/nss.gyp:nspr',
627                 '../third_party/nss/nss.gyp:nss',
628                 'third_party/nss/ssl.gyp:libssl',
629               ],
630             }],
631           ],
632         }],
633         ['os_posix == 1 and OS != "mac" and OS != "android" and OS != "ios"', {
634           'conditions': [
635             ['use_allocator!="none"', {
636               'dependencies': [
637                 '../base/allocator/allocator.gyp:allocator',
638               ],
639             }],
640           ],
641         }],
642         ['OS == "android"', {
643           'dependencies': [
644             'net_test_jni_headers',
645           ],
646           'sources': [
647             'test/android/net_test_jni_onload.cc',
648             'test/android/net_test_jni_onload.h',
649             'test/embedded_test_server/android/embedded_test_server_android.cc',
650             'test/embedded_test_server/android/embedded_test_server_android.h',
651             'test/spawned_test_server/remote_test_server.cc',
652             'test/spawned_test_server/remote_test_server.h',
653             'test/spawned_test_server/spawner_communicator.cc',
654             'test/spawned_test_server/spawner_communicator.h',
655           ],
656         }],
657         [ 'use_v8_in_net==1', {
658             'dependencies': [
659               'net_with_v8',
660             ],
661           },
662         ],
663         [ 'enable_mdns != 1', {
664             'sources!' : [
665               'dns/mock_mdns_socket_factory.cc',
666               'dns/mock_mdns_socket_factory.h'
667             ]
668         }],
669         [ 'use_nss_certs != 1', {
670             'sources!': [
671               'test/cert_test_util_nss.cc',
672             ],
673         }],
674         ['disable_file_support != 1', {
675           'sources': [
676             'test/url_request/url_request_mock_http_job.cc',
677             'test/url_request/url_request_mock_http_job.h',
678             'url_request/test_url_request_interceptor.cc',
679             'url_request/test_url_request_interceptor.h',
680           ],
681         }],
682       ],
683       # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
684       'msvs_disabled_warnings': [4267, ],
685     },
686     {
687       'target_name': 'net_resources',
688       'type': 'none',
689       'variables': {
690         'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/net',
691       },
692       'actions': [
693         {
694           'action_name': 'net_resources',
695           'variables': {
696             'grit_grd_file': 'base/net_resources.grd',
697           },
698           'includes': [ '../build/grit_action.gypi' ],
699         },
700       ],
701     },
702     {
703       'target_name': 'net_extras',
704       'type': 'static_library',
705       'variables': { 'enable_wexit_time_destructors': 1, },
706       'dependencies': [
707         '../base/base.gyp:base',
708         '../sql/sql.gyp:sql',
709         'net',
710       ],
711       'sources': [
712         '<@(net_extras_sources)',
713       ],
714     },
715     {
716       'target_name': 'net_docs',
717       'type': 'none',
718       'actions': [
719         {
720           'action_name': 'net_docs',
721           'variables': {
722             'net_docs_input_dir': '.',
723           },
724           'inputs': [
725             '<@(net_docs_sources)',
726           ],
727           'outputs': [
728             '<(net_docs_output_dir)',
729           ],
730           'action': [
731             'python',
732             '<(net_docs_script)',
733             '--input_path',
734             '<(net_docs_input_dir)',
735             '--output_path',
736             '<(net_docs_output_dir)',
737             '<@(net_docs_sources)',
738           ],
739           'message': 'Rendering network stack documentation',
740         }
741       ],
742     },
743     {
744       'target_name': 'http_server',
745       'type': 'static_library',
746       'variables': { 'enable_wexit_time_destructors': 1, },
747       'dependencies': [
748         '../base/base.gyp:base',
749         'net',
750       ],
751       'sources': [
752         'server/http_connection.cc',
753         'server/http_connection.h',
754         'server/http_server.cc',
755         'server/http_server.h',
756         'server/http_server_request_info.cc',
757         'server/http_server_request_info.h',
758         'server/http_server_response_info.cc',
759         'server/http_server_response_info.h',
760         'server/web_socket.cc',
761         'server/web_socket.h',
762         'server/web_socket_encoder.cc',
763         'server/web_socket_encoder.h',
764       ],
765       # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
766       'msvs_disabled_warnings': [4267, ],
767     },
768     { # GN version: //net:balsa
769       'target_name': 'balsa',
770       'type': 'static_library',
771       'dependencies': [
772         '../base/base.gyp:base',
773         'net',
774       ],
775       'sources': [
776         'tools/balsa/balsa_enums.h',
777         'tools/balsa/balsa_frame.cc',
778         'tools/balsa/balsa_frame.h',
779         'tools/balsa/balsa_headers.cc',
780         'tools/balsa/balsa_headers.h',
781         'tools/balsa/balsa_headers_token_utils.cc',
782         'tools/balsa/balsa_headers_token_utils.h',
783         'tools/balsa/balsa_visitor_interface.h',
784         'tools/balsa/http_message_constants.cc',
785         'tools/balsa/http_message_constants.h',
786         'tools/balsa/noop_balsa_visitor.h',
787         'tools/balsa/simple_buffer.cc',
788         'tools/balsa/simple_buffer.h',
789         'tools/balsa/split.cc',
790         'tools/balsa/split.h',
791         'tools/balsa/string_piece_utils.h',
792         'tools/quic/spdy_balsa_utils.cc',
793         'tools/quic/spdy_balsa_utils.h',
794       ],
795     },
796     {
797       'target_name': 'dump_cache',
798       'type': 'executable',
799       'dependencies': [
800         '../base/base.gyp:base',
801         'net',
802         'net_test_support',
803       ],
804       'sources': [
805         'tools/dump_cache/dump_cache.cc',
806         'tools/dump_cache/dump_files.cc',
807         'tools/dump_cache/dump_files.h',
808       ],
809       # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
810       'msvs_disabled_warnings': [4267, ],
811     },
812     {
813       'target_name': 'simple_quic_tools',
814       'type': 'static_library',
815       'dependencies': [
816         '../base/base.gyp:base',
817         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
818         '../url/url.gyp:url_lib',
819         'net',
820         'net_quic_proto',
821       ],
822       'sources': [
823         'tools/quic/quic_client_base.cc',
824         'tools/quic/quic_client_base.h',
825         'tools/quic/quic_client_session.cc',
826         'tools/quic/quic_client_session.h',
827         'tools/quic/quic_dispatcher.cc',
828         'tools/quic/quic_dispatcher.h',
829         'tools/quic/quic_in_memory_cache.cc',
830         'tools/quic/quic_in_memory_cache.h',
831         'tools/quic/quic_per_connection_packet_writer.cc',
832         'tools/quic/quic_per_connection_packet_writer.h',
833         'tools/quic/quic_server_session.cc',
834         'tools/quic/quic_server_session.h',
835         'tools/quic/quic_simple_client.cc',
836         'tools/quic/quic_simple_client.h',
837         'tools/quic/quic_simple_per_connection_packet_writer.cc',
838         'tools/quic/quic_simple_per_connection_packet_writer.h',
839         'tools/quic/quic_simple_server.cc',
840         'tools/quic/quic_simple_server.h',
841         'tools/quic/quic_simple_server_packet_writer.cc',
842         'tools/quic/quic_simple_server_packet_writer.h',
843         'tools/quic/quic_spdy_client_stream.cc',
844         'tools/quic/quic_spdy_client_stream.h',
845         'tools/quic/quic_spdy_server_stream.cc',
846         'tools/quic/quic_spdy_server_stream.h',
847         'tools/quic/quic_time_wait_list_manager.cc',
848         'tools/quic/quic_time_wait_list_manager.h',
849         'tools/quic/synchronous_host_resolver.cc',
850         'tools/quic/synchronous_host_resolver.h',
851       ],
852     },
853   ],
854   'conditions': [
855     ['use_v8_in_net == 1', {
856       'targets': [
857         {
858           'target_name': 'net_with_v8',
859           'type': '<(component)',
860           'variables': { 'enable_wexit_time_destructors': 1, },
861           'dependencies': [
862             '../base/base.gyp:base',
863             '../gin/gin.gyp:gin',
864             '../url/url.gyp:url_lib',
865             '../v8/tools/gyp/v8.gyp:v8',
866             'net'
867           ],
868           'defines': [
869             'NET_IMPLEMENTATION',
870           ],
871           'sources': [
872             'proxy/proxy_resolver_v8.cc',
873             'proxy/proxy_resolver_v8.h',
874             'proxy/proxy_resolver_v8_tracing.cc',
875             'proxy/proxy_resolver_v8_tracing.h',
876             'proxy/proxy_resolver_v8_tracing_wrapper.cc',
877             'proxy/proxy_resolver_v8_tracing_wrapper.h',
878             'proxy/proxy_service_v8.cc',
879             'proxy/proxy_service_v8.h',
880           ],
881           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
882           'msvs_disabled_warnings': [4267, ],
883         },
884       ],
885     }],
886     ['use_v8_in_net == 1 and OS != "android"', {
887       'targets': [
888         {
889           # GN version: //net/interfaces
890           'target_name': 'net_interfaces',
891           'type': 'static_library',
892           'sources': [
893             'interfaces/host_resolver_service.mojom',
894             'interfaces/proxy_resolver_service.mojom',
895           ],
896           'includes': [
897             '../third_party/mojo/mojom_bindings_generator.gypi',
898           ],
899         },
900         {
901           # GN version: //net:net_browser_services
902           'target_name': 'net_browser_services',
903           'type': 'static_library',
904           'sources': [
905             'dns/mojo_host_resolver_impl.cc',
906             'dns/mojo_host_resolver_impl.h',
907             'proxy/in_process_mojo_proxy_resolver_factory.cc',
908             'proxy/in_process_mojo_proxy_resolver_factory.h',
909             'proxy/mojo_proxy_resolver_factory.h',
910             'proxy/proxy_resolver_factory_mojo.cc',
911             'proxy/proxy_resolver_factory_mojo.h',
912             'proxy/proxy_service_mojo.cc',
913             'proxy/proxy_service_mojo.h',
914           ],
915           'dependencies': [
916             'mojo_type_converters',
917             'net',
918             'net_interfaces',
919             '../mojo/mojo_base.gyp:mojo_common_lib',
920             '../mojo/mojo_base.gyp:mojo_environment_chromium',
921             '../mojo/mojo_base.gyp:mojo_url_type_converters',
922             '../third_party/mojo/mojo_public.gyp:mojo_cpp_bindings',
924             # NOTE(amistry): As long as we support in-process Mojo v8 PAC, we
925             # need this dependency since in_process_mojo_proxy_resolver_factory
926             # creates the utility process side Mojo services in the browser
927             # process.  Ultimately, this will go away when we only support
928             # out-of-process.
929             'net_utility_services',
930           ],
931         },
932         {
933           # GN version: //net:net_utility_services
934           'target_name': 'net_utility_services',
935           'type': 'static_library',
936           'sources': [
937             'dns/host_resolver_mojo.cc',
938             'dns/host_resolver_mojo.h',
939             'proxy/mojo_proxy_resolver_factory_impl.cc',
940             'proxy/mojo_proxy_resolver_factory_impl.h',
941             'proxy/mojo_proxy_resolver_impl.cc',
942             'proxy/mojo_proxy_resolver_impl.h',
943             'proxy/mojo_proxy_resolver_v8_tracing_bindings.h',
944           ],
945           'dependencies': [
946             'mojo_type_converters',
947             'net_interfaces',
948             'net_with_v8',
949             '../mojo/mojo_base.gyp:mojo_url_type_converters',
950             '../third_party/mojo/mojo_public.gyp:mojo_cpp_bindings',
951           ],
952         },
953         {
954           # GN version: //net:mojo_type_converters
955           'target_name': 'mojo_type_converters',
956           'type': 'static_library',
957           'sources': [
958             'dns/mojo_host_type_converters.cc',
959             'dns/mojo_host_type_converters.h',
960             'proxy/mojo_proxy_type_converters.cc',
961             'proxy/mojo_proxy_type_converters.h',
962           ],
963           'dependencies': [
964             'net',
965             'net_interfaces',
966             '../third_party/mojo/mojo_public.gyp:mojo_cpp_bindings',
967           ],
968         },
969       ],
970     }],
971     ['OS != "ios" and OS != "android"', {
972       'targets': [
973         # iOS doesn't have the concept of simple executables, these targets
974         # can't be compiled on the platform.
975         {
976           'target_name': 'crash_cache',
977           'type': 'executable',
978           'dependencies': [
979             '../base/base.gyp:base',
980             'net',
981             'net_test_support',
982           ],
983           'sources': [
984             'tools/crash_cache/crash_cache.cc',
985           ],
986           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
987           'msvs_disabled_warnings': [4267, ],
988         },
989         {
990           'target_name': 'crl_set_dump',
991           'type': 'executable',
992           'dependencies': [
993             '../base/base.gyp:base',
994             'net',
995           ],
996           'sources': [
997             'tools/crl_set_dump/crl_set_dump.cc',
998           ],
999           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1000           'msvs_disabled_warnings': [4267, ],
1001         },
1002         {
1003           'target_name': 'dns_fuzz_stub',
1004           'type': 'executable',
1005           'dependencies': [
1006             '../base/base.gyp:base',
1007             'net',
1008           ],
1009           'sources': [
1010             'tools/dns_fuzz_stub/dns_fuzz_stub.cc',
1011           ],
1012           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1013           'msvs_disabled_warnings': [4267, ],
1014         },
1015         {
1016           'target_name': 'gdig',
1017           'type': 'executable',
1018           'dependencies': [
1019             '../base/base.gyp:base',
1020             'net',
1021           ],
1022           'sources': [
1023             'tools/gdig/file_net_log.cc',
1024             'tools/gdig/gdig.cc',
1025           ],
1026         },
1027         {
1028           'target_name': 'get_server_time',
1029           'type': 'executable',
1030           'dependencies': [
1031             '../base/base.gyp:base',
1032             '../base/base.gyp:base_i18n',
1033             '../url/url.gyp:url_lib',
1034             'net',
1035           ],
1036           'sources': [
1037             'tools/get_server_time/get_server_time.cc',
1038           ],
1039           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1040           'msvs_disabled_warnings': [4267, ],
1041         },
1042         {
1043           'target_name': 'hpack_example_generator',
1044           'type': 'executable',
1045           'dependencies': [
1046             '../base/base.gyp:base',
1047             'net',
1048           ],
1049           'sources': [
1050             'spdy/fuzzing/hpack_example_generator.cc',
1051           ],
1052           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1053           'msvs_disabled_warnings': [4267, ],
1054         },
1055         {
1056           'target_name': 'hpack_fuzz_mutator',
1057           'type': 'executable',
1058           'dependencies': [
1059             '../base/base.gyp:base',
1060             'net',
1061           ],
1062           'sources': [
1063             'spdy/fuzzing/hpack_fuzz_mutator.cc',
1064           ],
1065           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1066           'msvs_disabled_warnings': [4267, ],
1067         },
1068         {
1069           'target_name': 'hpack_fuzz_wrapper',
1070           'type': 'executable',
1071           'dependencies': [
1072             '../base/base.gyp:base',
1073             'net',
1074           ],
1075           'sources': [
1076             'spdy/fuzzing/hpack_fuzz_wrapper.cc',
1077           ],
1078           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1079           'msvs_disabled_warnings': [4267, ],
1080         },
1081         {
1082           'target_name': 'net_watcher',
1083           'type': 'executable',
1084           'dependencies': [
1085             '../base/base.gyp:base',
1086             'net',
1087             'net_with_v8',
1088           ],
1089           'conditions': [
1090             [ 'use_glib == 1', {
1091                 'dependencies': [
1092                   '../build/linux/system.gyp:gconf',
1093                   '../build/linux/system.gyp:gio',
1094                 ],
1095               },
1096             ],
1097           ],
1098           'sources': [
1099             'tools/net_watcher/net_watcher.cc',
1100           ],
1101         },
1102         {
1103           'target_name': 'run_testserver',
1104           'type': 'executable',
1105           'dependencies': [
1106             '../base/base.gyp:base',
1107             '../base/base.gyp:test_support_base',
1108             '../testing/gtest.gyp:gtest',
1109             'net_test_support',
1110           ],
1111           'sources': [
1112             'tools/testserver/run_testserver.cc',
1113           ],
1114         },
1115         {
1116           'target_name': 'quic_client',
1117           'type': 'executable',
1118           'dependencies': [
1119             '../base/base.gyp:base',
1120             '../url/url.gyp:url_lib',
1121             'net',
1122             'simple_quic_tools',
1123           ],
1124           'sources': [
1125             'tools/quic/quic_simple_client_bin.cc',
1126           ],
1127         },
1128         {
1129           'target_name': 'quic_server',
1130           'type': 'executable',
1131           'dependencies': [
1132             '../base/base.gyp:base',
1133             'net',
1134             'net_quic_proto',
1135             'simple_quic_tools',
1136           ],
1137           'sources': [
1138             'tools/quic/quic_simple_server_bin.cc',
1139           ],
1140         },
1141         {
1142           'target_name': 'stress_cache',
1143           'type': 'executable',
1144           'dependencies': [
1145             '../base/base.gyp:base',
1146             'net',
1147             'net_test_support',
1148           ],
1149           'sources': [
1150             'tools/stress_cache/stress_cache.cc',
1151           ],
1152           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1153           'msvs_disabled_warnings': [4267, ],
1154         },
1155         {
1156           'target_name': 'tld_cleanup',
1157           'type': 'executable',
1158           'dependencies': [
1159             '../base/base.gyp:base',
1160             '../base/base.gyp:base_i18n',
1161             '../net/tools/tld_cleanup/tld_cleanup.gyp:tld_cleanup_util',
1162           ],
1163           'sources': [
1164             'tools/tld_cleanup/tld_cleanup.cc',
1165           ],
1166           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1167           'msvs_disabled_warnings': [4267, ],
1168         },
1169       ],
1170     }],
1171     ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android"', {
1172       'targets': [
1173         {
1174           'target_name': 'epoll_server',
1175           'type': 'static_library',
1176           'dependencies': [
1177             '../base/base.gyp:base',
1178             'net',
1179           ],
1180           'sources': [
1181             'tools/epoll_server/epoll_server.cc',
1182             'tools/epoll_server/epoll_server.h',
1183           ],
1184         },
1185         {
1186           'target_name': 'flip_in_mem_edsm_server_base',
1187           'type': 'static_library',
1188           'cflags': [
1189             '-Wno-deprecated',
1190           ],
1191           'dependencies': [
1192             '../base/base.gyp:base',
1193             '../third_party/boringssl/boringssl.gyp:boringssl',
1194             'balsa',
1195             'epoll_server',
1196             'net',
1197           ],
1198           'sources': [
1199             'tools/flip_server/acceptor_thread.cc',
1200             'tools/flip_server/acceptor_thread.h',
1201             'tools/flip_server/constants.h',
1202             'tools/flip_server/create_listener.cc',
1203             'tools/flip_server/create_listener.h',
1204             'tools/flip_server/flip_config.cc',
1205             'tools/flip_server/flip_config.h',
1206             'tools/flip_server/http_interface.cc',
1207             'tools/flip_server/http_interface.h',
1208             'tools/flip_server/loadtime_measurement.h',
1209             'tools/flip_server/mem_cache.cc',
1210             'tools/flip_server/mem_cache.h',
1211             'tools/flip_server/output_ordering.cc',
1212             'tools/flip_server/output_ordering.h',
1213             'tools/flip_server/ring_buffer.cc',
1214             'tools/flip_server/ring_buffer.h',
1215             'tools/flip_server/sm_connection.cc',
1216             'tools/flip_server/sm_connection.h',
1217             'tools/flip_server/sm_interface.h',
1218             'tools/flip_server/spdy_interface.cc',
1219             'tools/flip_server/spdy_interface.h',
1220             'tools/flip_server/spdy_ssl.cc',
1221             'tools/flip_server/spdy_ssl.h',
1222             'tools/flip_server/spdy_util.cc',
1223             'tools/flip_server/spdy_util.h',
1224             'tools/flip_server/streamer_interface.cc',
1225             'tools/flip_server/streamer_interface.h',
1226             'tools/flip_server/url_to_filename_encoder.cc',
1227             'tools/flip_server/url_to_filename_encoder.h',
1228             'tools/flip_server/url_utilities.cc',
1229             'tools/flip_server/url_utilities.h',
1230           ],
1231         },
1232         {
1233           'target_name': 'flip_in_mem_edsm_server_unittests',
1234           'type': 'executable',
1235           'dependencies': [
1236               '../testing/gtest.gyp:gtest',
1237               '../testing/gmock.gyp:gmock',
1238               '../third_party/boringssl/boringssl.gyp:boringssl',
1239               'flip_in_mem_edsm_server_base',
1240               'net',
1241               'net_test_support',
1242           ],
1243           'sources': [
1244             'tools/flip_server/flip_test_utils.cc',
1245             'tools/flip_server/flip_test_utils.h',
1246             'tools/flip_server/http_interface_test.cc',
1247             'tools/flip_server/mem_cache_test.cc',
1248             'tools/flip_server/run_all_tests.cc',
1249             'tools/flip_server/spdy_interface_test.cc',
1250             'tools/flip_server/url_to_filename_encoder_unittest.cc',
1251             'tools/flip_server/url_utilities_unittest.cc',
1252           ],
1253         },
1254         {
1255           'target_name': 'flip_in_mem_edsm_server',
1256           'type': 'executable',
1257           'cflags': [
1258             '-Wno-deprecated',
1259           ],
1260           'dependencies': [
1261             '../base/base.gyp:base',
1262             'flip_in_mem_edsm_server_base',
1263             'net',
1264           ],
1265           'sources': [
1266             'tools/flip_server/flip_in_mem_edsm_server.cc',
1267           ],
1268         },
1269         {
1270           'target_name': 'epoll_quic_tools',
1271           'type': 'static_library',
1272           'dependencies': [
1273             '../base/base.gyp:base',
1274             '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
1275             '../url/url.gyp:url_lib',
1276             'balsa',
1277             'epoll_server',
1278             'net',
1279             'net_quic_proto',
1280           ],
1281           'sources': [
1282             'tools/quic/quic_client.cc',
1283             'tools/quic/quic_client.h',
1284             'tools/quic/quic_default_packet_writer.cc',
1285             'tools/quic/quic_default_packet_writer.h',
1286             'tools/quic/quic_epoll_clock.cc',
1287             'tools/quic/quic_epoll_clock.h',
1288             'tools/quic/quic_epoll_connection_helper.cc',
1289             'tools/quic/quic_epoll_connection_helper.h',
1290             'tools/quic/quic_packet_reader.cc',
1291             'tools/quic/quic_packet_reader.h',
1292             'tools/quic/quic_packet_writer_wrapper.cc',
1293             'tools/quic/quic_packet_writer_wrapper.h',
1294             'tools/quic/quic_server.cc',
1295             'tools/quic/quic_server.h',
1296             'tools/quic/quic_socket_utils.cc',
1297             'tools/quic/quic_socket_utils.h',
1298           ],
1299         },
1300         {
1301           'target_name': 'epoll_quic_client',
1302           'type': 'executable',
1303           'dependencies': [
1304             '../base/base.gyp:base',
1305             'net',
1306             'epoll_quic_tools',
1307             'simple_quic_tools',
1308           ],
1309           'sources': [
1310             'tools/quic/quic_client_bin.cc',
1311           ],
1312         },
1313         {
1314           'target_name': 'epoll_quic_server',
1315           'type': 'executable',
1316           'dependencies': [
1317             '../base/base.gyp:base',
1318             'net',
1319             'net_quic_proto',
1320             'epoll_quic_tools',
1321             'simple_quic_tools',
1322           ],
1323           'sources': [
1324             'tools/quic/quic_server_bin.cc',
1325           ],
1326         },
1327       ]
1328     }],
1329     ['OS=="android"', {
1330       'targets': [
1331         { # The same target as 'net', but with smaller binary size due to
1332           # exclusion of ICU, FTP, FILE and WebSockets support.
1333           'target_name': 'net_small',
1334           'variables': {
1335             'disable_ftp_support': 1,
1336             'disable_file_support': 1,
1337             'enable_websockets': 0,
1338             'use_icu_alternatives_on_android': 1,
1339           },
1340           'dependencies': [
1341             '../url/url.gyp:url_lib_use_icu_alternatives_on_android',
1342           ],
1343           'defines': [
1344             'USE_ICU_ALTERNATIVES_ON_ANDROID=1',
1345             'DISABLE_FILE_SUPPORT=1',
1346             'DISABLE_FTP_SUPPORT=1',
1347           ],
1348           'sources': [
1349             'base/net_string_util_icu_alternatives_android.cc',
1350             'base/net_string_util_icu_alternatives_android.h',
1351           ],
1352           'includes': [ 'net_common.gypi' ],
1353         },
1354         {
1355           'target_name': 'net_jni_headers',
1356           'type': 'none',
1357           'sources': [
1358             'android/java/src/org/chromium/net/AndroidCertVerifyResult.java',
1359             'android/java/src/org/chromium/net/AndroidKeyStore.java',
1360             'android/java/src/org/chromium/net/AndroidNetworkLibrary.java',
1361             'android/java/src/org/chromium/net/AndroidPrivateKey.java',
1362             'android/java/src/org/chromium/net/GURLUtils.java',
1363             'android/java/src/org/chromium/net/HttpNegotiateAuthenticator.java',
1364             'android/java/src/org/chromium/net/NetStringUtil.java',
1365             'android/java/src/org/chromium/net/NetworkChangeNotifier.java',
1366             'android/java/src/org/chromium/net/ProxyChangeListener.java',
1367             'android/java/src/org/chromium/net/X509Util.java',
1368           ],
1369           'variables': {
1370             'jni_gen_package': 'net',
1371           },
1372           'includes': [ '../build/jni_generator.gypi' ],
1373         },
1374         {
1375           'target_name': 'net_test_jni_headers',
1376           'type': 'none',
1377           'sources': [
1378             'android/javatests/src/org/chromium/net/AndroidKeyStoreTestUtil.java',
1379             'test/android/javatests/src/org/chromium/net/test/EmbeddedTestServer.java',
1380             'test/android/javatests/src/org/chromium/net/test/DummySpnegoAuthenticator.java',
1381           ],
1382           'variables': {
1383             'jni_gen_package': 'net/test',
1384           },
1385           'includes': [ '../build/jni_generator.gypi' ],
1386         },
1387         {
1388           'target_name': 'net_java',
1389           'type': 'none',
1390           'variables': {
1391             'java_in_dir': '../net/android/java',
1392           },
1393           'dependencies': [
1394             '../base/base.gyp:base',
1395             'cert_verify_status_android_java',
1396             'certificate_mime_types_java',
1397             'network_change_notifier_types_java',
1398             'net_errors_java',
1399             'private_key_types_java',
1400             'remote_android_keystore_aidl',
1401           ],
1402           'includes': [ '../build/java.gypi' ],
1403         },
1404         {
1405           # Processes the interface files for communication with an Android KeyStore
1406           # running in a separate process.
1407           'target_name': 'remote_android_keystore_aidl',
1408           'type': 'none',
1409           'variables': {
1410             'aidl_interface_file': '../net/android/java/src/org/chromium/net/IRemoteAndroidKeyStoreInterface.aidl',
1411           },
1412           'sources': [
1413             '../net/android/java/src/org/chromium/net/IRemoteAndroidKeyStore.aidl',
1414             '../net/android/java/src/org/chromium/net/IRemoteAndroidKeyStoreCallbacks.aidl',
1415           ],
1416           'includes': [ '../build/java_aidl.gypi' ],
1417         },
1418         {
1419           'target_name': 'net_java_test_support',
1420           'type': 'none',
1421           'variables': {
1422             'java_in_dir': '../net/test/android/javatests',
1423           },
1424           'dependencies': [
1425             'net_test_support',
1426             'url_request_failed_job_java',
1427             '../base/base.gyp:base_java',
1428             'net_java',
1429             '<@(net_test_extra_libs)',
1430           ],
1431           'includes': [ '../build/java.gypi' ],
1432         },
1433         {
1434           'target_name': 'url_request_failed_job_java',
1435           'type': 'none',
1436           'variables': {
1437             'source_file': 'test/url_request/url_request_failed_job.h',
1438           },
1439           'includes': [ '../build/android/java_cpp_enum.gypi' ],
1440         },
1441         {
1442           'target_name': 'net_javatests',
1443           'type': 'none',
1444           'variables': {
1445             'java_in_dir': '../net/android/javatests',
1446           },
1447           'dependencies': [
1448             '../base/base.gyp:base',
1449             '../base/base.gyp:base_java_test_support',
1450             'net_java',
1451           ],
1452           'includes': [ '../build/java.gypi' ],
1453         },
1454         {
1455           'target_name': 'net_errors_java',
1456           'type': 'none',
1457           'sources': [
1458             'android/java/NetError.template',
1459           ],
1460           'variables': {
1461             'package_name': 'org/chromium/net',
1462             'template_deps': ['base/net_error_list.h'],
1463           },
1464           'includes': [ '../build/android/java_cpp_template.gypi' ],
1465         },
1466         {
1467           'target_name': 'certificate_mime_types_java',
1468           'type': 'none',
1469           'variables': {
1470             'source_file': 'base/mime_util.h',
1471           },
1472           'includes': [ '../build/android/java_cpp_enum.gypi' ],
1473         },
1474         {
1475           'target_name': 'cert_verify_status_android_java',
1476           'type': 'none',
1477           'variables': {
1478             'source_file': 'android/cert_verify_result_android.h',
1479           },
1480           'includes': [ '../build/android/java_cpp_enum.gypi' ],
1481         },
1482         {
1483           'target_name': 'network_change_notifier_types_java',
1484           'type': 'none',
1485           'variables': {
1486             'source_file': 'base/network_change_notifier.h',
1487           },
1488           'includes': [ '../build/android/java_cpp_enum.gypi' ],
1489         },
1490         {
1491           'target_name': 'private_key_types_java',
1492           'type': 'none',
1493           'variables': {
1494             'source_file': 'android/keystore.h',
1495           },
1496           'includes': [ '../build/android/java_cpp_enum.gypi' ],
1497         },
1498         {
1499           'target_name': 'net_unittests_apk',
1500           'type': 'none',
1501           'dependencies': [
1502             'net_java',
1503             'net_javatests',
1504             'net_java_test_support',
1505             'net_unittests',
1506           ],
1507           'conditions': [
1508             ['v8_use_external_startup_data==1', {
1509               'dependencies': [
1510                 '../v8/tools/gyp/v8.gyp:v8_external_snapshot',
1511               ],
1512               'copies': [
1513                 {
1514                 'destination': '<(asset_location)',
1515                   'files': [
1516                     '<(PRODUCT_DIR)/natives_blob.bin',
1517                     '<(PRODUCT_DIR)/snapshot_blob.bin',
1518                   ],
1519                 },
1520               ],
1521             }],
1522           ],
1523           'variables': {
1524             'test_suite_name': 'net_unittests',
1525             'isolate_file': 'net_unittests.isolate',
1526             'android_manifest_path': 'android/unittest_support/AndroidManifest.xml',
1527             'resource_dir': 'android/unittest_support/res',
1528             'conditions': [
1529               ['v8_use_external_startup_data==1', {
1530                 'asset_location': '<(PRODUCT_DIR)/net_unittests_apk/assets',
1531                 'additional_input_paths': [
1532                   '<(PRODUCT_DIR)/net_unittests_apk/assets/natives_blob.bin',
1533                   '<(PRODUCT_DIR)/net_unittests_apk/assets/snapshot_blob.bin',
1534                 ],
1535                 'inputs': [
1536                   '<(PRODUCT_DIR)/natives_blob.bin',
1537                   '<(PRODUCT_DIR)/snapshot_blob.bin',
1538                 ],
1539               }],
1540             ],
1541           },
1542           'includes': [ '../build/apk_test.gypi' ],
1543         },
1544         {
1545           'target_name': 'net_junit_tests',
1546           'type': 'none',
1547           'dependencies': [
1548             'net_java',
1549             '../base/base.gyp:base',
1550             '../base/base.gyp:base_java_test_support',
1551             '../testing/android/junit/junit_test.gyp:junit_test_support',
1552           ],
1553           'variables': {
1554             'main_class': 'org.chromium.testing.local.JunitTestMain',
1555             'src_paths': [
1556               'android/junit/',
1557             ],
1558           },
1559           'includes': [
1560             '../build/host_jar.gypi',
1561           ],
1562         },
1563   
1564       ],
1565     }],
1566     ['OS == "android" or OS == "linux"', {
1567       'targets': [
1568         {
1569           'target_name': 'disk_cache_memory_test',
1570           'type': 'executable',
1571           'dependencies': [
1572             '../base/base.gyp:base',
1573             'net',
1574           ],
1575           'sources': [
1576             'tools/disk_cache_memory_test/disk_cache_memory_test.cc',
1577           ],
1578         },
1579       ],
1580     }],
1581     ['test_isolation_mode != "noop"', {
1582       'targets': [
1583         {
1584           'target_name': 'net_unittests_run',
1585           'type': 'none',
1586           'dependencies': [
1587             'net_unittests',
1588           ],
1589           'includes': [
1590             '../build/isolate.gypi',
1591           ],
1592           'sources': [
1593             'net_unittests.isolate',
1594           ],
1595         },
1596       ],
1597     }],
1598   ],