xref: /aosp_15_r20/external/cronet/net/BUILD.gn (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1# Copyright 2013 The Chromium Authors
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5import("//build/buildflag_header.gni")
6import("//build/config/cast.gni")
7import("//build/config/chromeos/ui_mode.gni")
8import("//build/config/compiler/compiler.gni")
9import("//build/config/cronet/config.gni")
10import("//build/config/features.gni")
11import("//crypto/features.gni")
12import("//net/features.gni")
13import("//testing/libfuzzer/fuzzer_test.gni")
14import("//testing/test.gni")
15import("//third_party/icu/config.gni")
16import("//third_party/protobuf/proto_library.gni")
17import("//tools/grit/grit_rule.gni")
18import("//url/features.gni")
19
20if (is_android) {
21  import("//build/config/android/config.gni")
22  import("//build/config/android/rules.gni")
23  import("//third_party/jni_zero/jni_zero.gni")
24} else if (is_mac) {
25  import("//build/config/mac/mac_sdk.gni")
26} else if (is_ios) {
27  import("//build/config/ios/bundle_data_from_filelist.gni")
28}
29
30# Android:
31# The way the cache uses mmap() is inefficient on some Android devices. If
32# this flag is set, we hackily avoid using mmap() in the disk cache. We are
33# pretty confident that mmap-ing the index would not hurt any existing x86
34# android devices, but we cannot be so sure about the variety of ARM devices.
35# So enable it for x86 only for now.
36# Fuchsia:
37# Writable mmap isn't supported on Fuchsia, so it should be bypassed.
38posix_bypass_mmap = (is_android && current_cpu != "x86") || is_fuchsia
39
40enable_built_in_dns = use_blink
41
42# TODO(droger): Support client auth on iOS. See http://crbug.com/145954).
43#
44# Historically this was disabled because client auth required
45# platform-specific code deep in //net. Nowadays, this is abstracted away and
46# we could enable the interfaces on iOS for platform-independence. However,
47# merely enabling them changes our behavior from automatically proceeding
48# with no client certificate to raising
49# `URLRequest::Delegate::OnCertificateRequested`. Callers would need to be
50# updated to apply that behavior manually.
51#
52# If fixing this, re-enable the tests in ssl_client_socket_unittest.cc and
53# ssl_server_socket_unittest.cc which are disabled on iOS.
54enable_client_certificates = !is_ios || (use_blink && !is_cronet_build)
55
56# Unix sockets are not supported on iOS.
57enable_unix_sockets = is_posix && !is_ios
58
59# x86/x64 cast_shell builds run on regular trybots and can use python runtime
60# and remote test server. ARM cast_shell builds don't have python runtime.
61is_arm_cast_shell_build = (is_castos || is_cast_android) &&
62                          (current_cpu == "arm" || current_cpu == "arm64")
63
64# Python works only on Linux, MacOS and Windows so exclude the others,
65# chromecast, android, fuchsia, ios.
66enable_python_utils =
67    !is_arm_cast_shell_build && !is_android && !is_fuchsia && !is_ios
68
69# Platforms that cannot use python_utils (like Android but see full
70# list above) will instead use a remote server.
71use_remote_test_server =
72    !enable_python_utils && (enable_websockets || (is_cronet_build && !is_ios))
73
74# Whether //net should use an external GSSAPI library for implementing HTTP
75# Negotiate authentication. All platforms for which use_kerberos is true should
76# have some external implementation since //net doesn't have intrinsic support
77# for Kerberos. This implementation is an external GSSAPI library on all
78# platforms except on:
79#
80#    Windows : Uses SSPI for Negotiate authentication.
81#
82#    Android : Uses an external authenticator. See
83#              https://www.chromium.org/developers/design-documents/http-authentication/writing-a-spnego-authenticator-for-chrome-on-android
84use_external_gssapi = use_kerberos && !is_android && !is_win
85
86config("net_test_config") {
87  if (use_remote_test_server) {
88    defines = [ "USE_REMOTE_TEST_SERVER" ]
89  }
90}
91
92buildflag_header("buildflags") {
93  header = "net_buildflags.h"
94  flags = [
95    "POSIX_BYPASS_MMAP=$posix_bypass_mmap",
96    "DISABLE_FILE_SUPPORT=$disable_file_support",
97    "ENABLE_MDNS=$enable_mdns",
98    "ENABLE_REPORTING=$enable_reporting",
99    "ENABLE_WEBSOCKETS=$enable_websockets",
100    "ENABLE_CLIENT_CERTIFICATES=$enable_client_certificates",
101    "INCLUDE_TRANSPORT_SECURITY_STATE_PRELOAD_LIST=$include_transport_security_state_preload_list",
102    "USE_KERBEROS=$use_kerberos",
103    "USE_EXTERNAL_GSSAPI=$use_external_gssapi",
104    "CHROME_ROOT_STORE_OPTIONAL=$chrome_root_store_optional",
105    "CHROME_ROOT_STORE_ONLY=$chrome_root_store_only",
106    "CHROME_ROOT_STORE_SUPPORTED=$chrome_root_store_supported",
107    "ENABLE_DEVICE_BOUND_SESSIONS=$enable_device_bound_sessions",
108  ]
109}
110
111config("net_internal_config") {
112  defines = [ "NET_IMPLEMENTATION" ]
113
114  if (enable_built_in_dns) {
115    defines += [ "ENABLE_BUILT_IN_DNS" ]
116  }
117}
118
119net_configs = [
120  ":net_internal_config",
121  "//build/config:precompiled_headers",
122
123  "//build/config/compiler:wexit_time_destructors",
124]
125
126if (is_linux || is_chromeos) {
127  net_configs += [ "//build/config/linux:libresolv" ]
128}
129
130source_set("constants") {
131  sources = [ "base/trace_constants.h" ]
132  deps = [ "//base" ]
133}
134
135buildflag_header("cronet_buildflags") {
136  header = "cronet_buildflags.h"
137  header_dir = "net/base"
138  flags = [ "CRONET_BUILD=$is_cronet_build" ]
139}
140
141component("net") {
142  sources = [
143    "base/address_family.cc",
144    "base/address_family.h",
145    "base/address_list.cc",
146    "base/address_list.h",
147    "base/auth.cc",
148    "base/auth.h",
149    "base/backoff_entry.cc",
150    "base/backoff_entry.h",
151    "base/backoff_entry_serializer.cc",
152    "base/backoff_entry_serializer.h",
153    "base/cache_type.h",
154    "base/chunked_upload_data_stream.cc",
155    "base/chunked_upload_data_stream.h",
156    "base/completion_once_callback.h",
157    "base/completion_repeating_callback.h",
158    "base/connection_endpoint_metadata.cc",
159    "base/connection_endpoint_metadata.h",
160    "base/data_url.cc",
161    "base/data_url.h",
162    "base/datagram_buffer.cc",
163    "base/datagram_buffer.h",
164    "base/elements_upload_data_stream.cc",
165    "base/elements_upload_data_stream.h",
166    "base/expiring_cache.h",
167    "base/features.cc",
168    "base/features.h",
169    "base/file_stream.cc",
170    "base/file_stream.h",
171    "base/file_stream_context.cc",
172    "base/file_stream_context.h",
173    "base/filename_util.cc",
174    "base/filename_util.h",
175    "base/filename_util_internal.cc",
176    "base/filename_util_internal.h",
177    "base/hash_value.cc",
178    "base/hash_value.h",
179    "base/hex_utils.cc",
180    "base/hex_utils.h",
181    "base/host_mapping_rules.cc",
182    "base/host_mapping_rules.h",
183    "base/host_port_pair.cc",
184    "base/host_port_pair.h",
185    "base/http_user_agent_settings.h",
186    "base/idempotency.h",
187    "base/interval.h",
188    "base/io_buffer.cc",
189    "base/io_buffer.h",
190    "base/ip_address.cc",
191    "base/ip_address.h",
192    "base/ip_endpoint.cc",
193    "base/ip_endpoint.h",
194    "base/isolation_info.cc",
195    "base/isolation_info.h",
196    "base/load_flags.h",
197    "base/load_flags_list.h",
198    "base/load_states.h",
199    "base/load_states_list.h",
200    "base/load_timing_info.cc",
201    "base/load_timing_info.h",
202    "base/logging_network_change_observer.cc",
203    "base/logging_network_change_observer.h",
204    "base/lookup_string_in_fixed_set.cc",
205    "base/lookup_string_in_fixed_set.h",
206    "base/mime_sniffer.cc",
207    "base/mime_sniffer.h",
208    "base/mime_util.cc",
209    "base/mime_util.h",
210    "base/net_error_details.h",
211    "base/net_error_list.h",
212    "base/net_errors.cc",
213    "base/net_errors.h",
214    "base/net_info_source_list.h",
215    "base/net_module.cc",
216    "base/net_module.h",
217    "base/net_string_util.h",
218    "base/network_activity_monitor.cc",
219    "base/network_activity_monitor.h",
220    "base/network_anonymization_key.cc",
221    "base/network_anonymization_key.h",
222    "base/network_change_notifier.cc",
223    "base/network_change_notifier.h",
224    "base/network_change_notifier_factory.h",
225    "base/network_delegate.cc",
226    "base/network_delegate.h",
227    "base/network_delegate_impl.cc",
228    "base/network_delegate_impl.h",
229    "base/network_handle.h",
230    "base/network_interfaces.cc",
231    "base/network_interfaces.h",
232    "base/network_isolation_key.cc",
233    "base/network_isolation_key.h",
234    "base/parse_number.cc",
235    "base/parse_number.h",
236    "base/platform_mime_util.h",
237    "base/port_util.cc",
238    "base/port_util.h",
239    "base/prioritized_dispatcher.cc",
240    "base/prioritized_dispatcher.h",
241    "base/prioritized_task_runner.cc",
242    "base/prioritized_task_runner.h",
243    "base/priority_queue.h",
244    "base/privacy_mode.cc",
245    "base/privacy_mode.h",
246    "base/proxy_chain.cc",
247    "base/proxy_chain.h",
248    "base/proxy_delegate.h",
249    "base/proxy_server.cc",
250    "base/proxy_server.h",
251    "base/proxy_string_util.cc",
252    "base/proxy_string_util.h",
253    "base/rand_callback.h",
254    "base/registry_controlled_domains/registry_controlled_domain.cc",
255    "base/registry_controlled_domains/registry_controlled_domain.h",
256    "base/request_priority.cc",
257    "base/request_priority.h",
258    "base/scheme_host_port_matcher.cc",
259    "base/scheme_host_port_matcher.h",
260    "base/scheme_host_port_matcher_result.h",
261    "base/scheme_host_port_matcher_rule.cc",
262    "base/scheme_host_port_matcher_rule.h",
263    "base/schemeful_site.cc",
264    "base/schemeful_site.h",
265    "base/session_usage.h",
266    "base/sockaddr_storage.cc",
267    "base/sockaddr_storage.h",
268    "base/sys_addrinfo.h",
269    "base/trace_event_stub.h",
270    "base/tracing.h",
271    "base/transport_info.cc",
272    "base/transport_info.h",
273    "base/upload_bytes_element_reader.cc",
274    "base/upload_bytes_element_reader.h",
275    "base/upload_data_stream.cc",
276    "base/upload_data_stream.h",
277    "base/upload_element_reader.cc",
278    "base/upload_element_reader.h",
279    "base/upload_file_element_reader.cc",
280    "base/upload_file_element_reader.h",
281    "base/upload_progress.h",
282    "base/url_search_params.cc",
283    "base/url_search_params.h",
284    "base/url_util.cc",
285    "base/url_util.h",
286    "cert/asn1_util.cc",
287    "cert/asn1_util.h",
288    "cert/caching_cert_verifier.cc",
289    "cert/caching_cert_verifier.h",
290    "cert/cert_database.cc",
291    "cert/cert_database.h",
292    "cert/cert_net_fetcher.h",
293    "cert/cert_status_flags.cc",
294    "cert/cert_status_flags.h",
295    "cert/cert_status_flags_list.h",
296    "cert/cert_verifier.cc",
297    "cert/cert_verifier.h",
298    "cert/cert_verify_proc.cc",
299    "cert/cert_verify_proc.h",
300    "cert/cert_verify_proc_blocklist.inc",
301    "cert/cert_verify_proc_builtin.cc",
302    "cert/cert_verify_proc_builtin.h",
303    "cert/cert_verify_result.cc",
304    "cert/cert_verify_result.h",
305    "cert/client_cert_verifier.h",
306    "cert/coalescing_cert_verifier.cc",
307    "cert/coalescing_cert_verifier.h",
308    "cert/crl_set.cc",
309    "cert/crl_set.h",
310    "cert/ct_log_response_parser.cc",
311    "cert/ct_log_response_parser.h",
312    "cert/ct_log_verifier.cc",
313    "cert/ct_log_verifier.h",
314    "cert/ct_log_verifier_util.cc",
315    "cert/ct_log_verifier_util.h",
316    "cert/ct_objects_extractor.cc",
317    "cert/ct_objects_extractor.h",
318    "cert/ct_policy_enforcer.cc",
319    "cert/ct_policy_enforcer.h",
320    "cert/ct_policy_status.cc",
321    "cert/ct_policy_status.h",
322    "cert/ct_sct_to_string.cc",
323    "cert/ct_sct_to_string.h",
324    "cert/ct_serialization.cc",
325    "cert/ct_serialization.h",
326    "cert/ct_signed_certificate_timestamp_log_param.cc",
327    "cert/ct_signed_certificate_timestamp_log_param.h",
328    "cert/ct_verifier.h",
329    "cert/do_nothing_ct_verifier.cc",
330    "cert/do_nothing_ct_verifier.h",
331    "cert/ev_root_ca_metadata.cc",
332    "cert/ev_root_ca_metadata.h",
333    "cert/internal/cert_issuer_source_aia.cc",
334    "cert/internal/cert_issuer_source_aia.h",
335    "cert/internal/revocation_checker.cc",
336    "cert/internal/revocation_checker.h",
337    "cert/internal/system_trust_store.cc",
338    "cert/internal/system_trust_store.h",
339    "cert/internal/trust_store_features.cc",
340    "cert/internal/trust_store_features.h",
341    "cert/known_roots.cc",
342    "cert/known_roots.h",
343    "cert/merkle_audit_proof.cc",
344    "cert/merkle_audit_proof.h",
345    "cert/merkle_consistency_proof.cc",
346    "cert/merkle_consistency_proof.h",
347    "cert/merkle_tree_leaf.cc",
348    "cert/merkle_tree_leaf.h",
349    "cert/multi_log_ct_verifier.cc",
350    "cert/multi_log_ct_verifier.h",
351    "cert/multi_threaded_cert_verifier.cc",
352    "cert/multi_threaded_cert_verifier.h",
353    "cert/root_cert_list_generated.h",
354    "cert/sct_auditing_delegate.h",
355    "cert/sct_status_flags.cc",
356    "cert/sct_status_flags.h",
357    "cert/signed_certificate_timestamp.cc",
358    "cert/signed_certificate_timestamp.h",
359    "cert/signed_certificate_timestamp_and_status.cc",
360    "cert/signed_certificate_timestamp_and_status.h",
361    "cert/signed_tree_head.cc",
362    "cert/signed_tree_head.h",
363    "cert/symantec_certs.cc",
364    "cert/symantec_certs.h",
365    "cert/test_root_certs.cc",
366    "cert/test_root_certs.h",
367    "cert/time_conversions.cc",
368    "cert/time_conversions.h",
369    "cert/x509_cert_types.cc",
370    "cert/x509_cert_types.h",
371    "cert/x509_certificate.cc",
372    "cert/x509_certificate.h",
373    "cert/x509_certificate_net_log_param.cc",
374    "cert/x509_certificate_net_log_param.h",
375    "cert/x509_util.cc",
376    "cert/x509_util.h",
377    "cert_net/cert_net_fetcher_url_request.cc",
378    "cert_net/cert_net_fetcher_url_request.h",
379    "cookies/canonical_cookie.cc",
380    "cookies/canonical_cookie.h",
381    "cookies/cookie_access_delegate.cc",
382    "cookies/cookie_access_delegate.h",
383    "cookies/cookie_access_params.h",
384    "cookies/cookie_access_result.cc",
385    "cookies/cookie_access_result.h",
386    "cookies/cookie_base.cc",
387    "cookies/cookie_base.h",
388    "cookies/cookie_change_dispatcher.cc",
389    "cookies/cookie_change_dispatcher.h",
390    "cookies/cookie_constants.cc",
391    "cookies/cookie_constants.h",
392    "cookies/cookie_deletion_info.cc",
393    "cookies/cookie_deletion_info.h",
394    "cookies/cookie_inclusion_status.cc",
395    "cookies/cookie_inclusion_status.h",
396    "cookies/cookie_monster.cc",
397    "cookies/cookie_monster.h",
398    "cookies/cookie_monster_change_dispatcher.cc",
399    "cookies/cookie_monster_change_dispatcher.h",
400    "cookies/cookie_monster_netlog_params.cc",
401    "cookies/cookie_monster_netlog_params.h",
402    "cookies/cookie_options.cc",
403    "cookies/cookie_options.h",
404    "cookies/cookie_partition_key.cc",
405    "cookies/cookie_partition_key.h",
406    "cookies/cookie_partition_key_collection.cc",
407    "cookies/cookie_partition_key_collection.h",
408    "cookies/cookie_setting_override.h",
409    "cookies/cookie_store.cc",
410    "cookies/cookie_store.h",
411    "cookies/cookie_util.cc",
412    "cookies/cookie_util.h",
413    "cookies/parsed_cookie.cc",
414    "cookies/parsed_cookie.h",
415    "cookies/site_for_cookies.cc",
416    "cookies/site_for_cookies.h",
417    "cookies/static_cookie_policy.cc",
418    "cookies/static_cookie_policy.h",
419    "disk_cache/backend_cleanup_tracker.cc",
420    "disk_cache/backend_cleanup_tracker.h",
421    "disk_cache/blockfile/addr.cc",
422    "disk_cache/blockfile/addr.h",
423    "disk_cache/blockfile/backend_impl.cc",
424    "disk_cache/blockfile/backend_impl.h",
425    "disk_cache/blockfile/bitmap.cc",
426    "disk_cache/blockfile/bitmap.h",
427    "disk_cache/blockfile/block_files.cc",
428    "disk_cache/blockfile/block_files.h",
429    "disk_cache/blockfile/disk_format.cc",
430    "disk_cache/blockfile/disk_format.h",
431    "disk_cache/blockfile/disk_format_base.h",
432    "disk_cache/blockfile/entry_impl.cc",
433    "disk_cache/blockfile/entry_impl.h",
434    "disk_cache/blockfile/errors.h",
435    "disk_cache/blockfile/eviction.cc",
436    "disk_cache/blockfile/eviction.h",
437    "disk_cache/blockfile/experiments.h",
438    "disk_cache/blockfile/file.cc",
439    "disk_cache/blockfile/file.h",
440    "disk_cache/blockfile/file_block.h",
441    "disk_cache/blockfile/file_lock.cc",
442    "disk_cache/blockfile/file_lock.h",
443    "disk_cache/blockfile/in_flight_backend_io.cc",
444    "disk_cache/blockfile/in_flight_backend_io.h",
445    "disk_cache/blockfile/in_flight_io.cc",
446    "disk_cache/blockfile/in_flight_io.h",
447    "disk_cache/blockfile/mapped_file.cc",
448    "disk_cache/blockfile/mapped_file.h",
449    "disk_cache/blockfile/rankings.cc",
450    "disk_cache/blockfile/rankings.h",
451    "disk_cache/blockfile/sparse_control.cc",
452    "disk_cache/blockfile/sparse_control.h",
453    "disk_cache/blockfile/stats.cc",
454    "disk_cache/blockfile/stats.h",
455    "disk_cache/blockfile/storage_block-inl.h",
456    "disk_cache/blockfile/storage_block.h",
457    "disk_cache/blockfile/stress_support.h",
458    "disk_cache/cache_util.cc",
459    "disk_cache/cache_util.h",
460    "disk_cache/disk_cache.cc",
461    "disk_cache/disk_cache.h",
462    "disk_cache/memory/mem_backend_impl.cc",
463    "disk_cache/memory/mem_backend_impl.h",
464    "disk_cache/memory/mem_entry_impl.cc",
465    "disk_cache/memory/mem_entry_impl.h",
466    "disk_cache/net_log_parameters.cc",
467    "disk_cache/net_log_parameters.h",
468    "disk_cache/simple/post_operation_waiter.cc",
469    "disk_cache/simple/post_operation_waiter.h",
470    "disk_cache/simple/simple_backend_impl.cc",
471    "disk_cache/simple/simple_backend_impl.h",
472    "disk_cache/simple/simple_backend_version.h",
473    "disk_cache/simple/simple_entry_format.cc",
474    "disk_cache/simple/simple_entry_format.h",
475    "disk_cache/simple/simple_entry_format_history.h",
476    "disk_cache/simple/simple_entry_impl.cc",
477    "disk_cache/simple/simple_entry_impl.h",
478    "disk_cache/simple/simple_entry_operation.cc",
479    "disk_cache/simple/simple_entry_operation.h",
480    "disk_cache/simple/simple_file_enumerator.cc",
481    "disk_cache/simple/simple_file_enumerator.h",
482    "disk_cache/simple/simple_file_tracker.cc",
483    "disk_cache/simple/simple_file_tracker.h",
484    "disk_cache/simple/simple_histogram_macros.h",
485    "disk_cache/simple/simple_index.cc",
486    "disk_cache/simple/simple_index.h",
487    "disk_cache/simple/simple_index_delegate.h",
488    "disk_cache/simple/simple_index_file.cc",
489    "disk_cache/simple/simple_index_file.h",
490    "disk_cache/simple/simple_net_log_parameters.cc",
491    "disk_cache/simple/simple_net_log_parameters.h",
492    "disk_cache/simple/simple_synchronous_entry.cc",
493    "disk_cache/simple/simple_synchronous_entry.h",
494    "disk_cache/simple/simple_util.cc",
495    "disk_cache/simple/simple_util.h",
496    "disk_cache/simple/simple_version_upgrade.cc",
497    "disk_cache/simple/simple_version_upgrade.h",
498    "filter/filter_source_stream.cc",
499    "filter/filter_source_stream.h",
500    "filter/gzip_header.cc",
501    "filter/gzip_header.h",
502    "filter/gzip_source_stream.cc",
503    "filter/gzip_source_stream.h",
504    "filter/source_stream.cc",
505    "filter/source_stream.h",
506    "first_party_sets/addition_overlaps_union_find.cc",
507    "first_party_sets/addition_overlaps_union_find.h",
508    "first_party_sets/first_party_set_entry.cc",
509    "first_party_sets/first_party_set_entry.h",
510    "first_party_sets/first_party_set_entry_override.cc",
511    "first_party_sets/first_party_set_entry_override.h",
512    "first_party_sets/first_party_set_metadata.cc",
513    "first_party_sets/first_party_set_metadata.h",
514    "first_party_sets/first_party_sets_cache_filter.cc",
515    "first_party_sets/first_party_sets_cache_filter.h",
516    "first_party_sets/first_party_sets_context_config.cc",
517    "first_party_sets/first_party_sets_context_config.h",
518    "first_party_sets/global_first_party_sets.cc",
519    "first_party_sets/global_first_party_sets.h",
520    "first_party_sets/local_set_declaration.cc",
521    "first_party_sets/local_set_declaration.h",
522    "first_party_sets/sets_mutation.cc",
523    "first_party_sets/sets_mutation.h",
524    "http/alternative_service.cc",
525    "http/alternative_service.h",
526    "http/bidirectional_stream.cc",
527    "http/bidirectional_stream.h",
528    "http/bidirectional_stream_impl.cc",
529    "http/bidirectional_stream_impl.h",
530    "http/bidirectional_stream_request_info.cc",
531    "http/bidirectional_stream_request_info.h",
532    "http/broken_alternative_services.cc",
533    "http/broken_alternative_services.h",
534    "http/http_auth.cc",
535    "http/http_auth.h",
536    "http/http_auth_cache.cc",
537    "http/http_auth_cache.h",
538    "http/http_auth_challenge_tokenizer.cc",
539    "http/http_auth_challenge_tokenizer.h",
540    "http/http_auth_controller.cc",
541    "http/http_auth_controller.h",
542    "http/http_auth_filter.cc",
543    "http/http_auth_filter.h",
544    "http/http_auth_handler.cc",
545    "http/http_auth_handler.h",
546    "http/http_auth_handler_basic.cc",
547    "http/http_auth_handler_basic.h",
548    "http/http_auth_handler_digest.cc",
549    "http/http_auth_handler_digest.h",
550    "http/http_auth_handler_factory.cc",
551    "http/http_auth_handler_factory.h",
552    "http/http_auth_handler_ntlm.cc",
553    "http/http_auth_handler_ntlm.h",
554    "http/http_auth_mechanism.h",
555    "http/http_auth_multi_round_parse.cc",
556    "http/http_auth_multi_round_parse.h",
557    "http/http_auth_preferences.cc",
558    "http/http_auth_preferences.h",
559    "http/http_auth_scheme.cc",
560    "http/http_auth_scheme.h",
561    "http/http_basic_state.cc",
562    "http/http_basic_state.h",
563    "http/http_basic_stream.cc",
564    "http/http_basic_stream.h",
565    "http/http_byte_range.cc",
566    "http/http_byte_range.h",
567    "http/http_cache.cc",
568    "http/http_cache.h",
569    "http/http_cache_transaction.cc",
570    "http/http_cache_transaction.h",
571    "http/http_cache_writers.cc",
572    "http/http_cache_writers.h",
573    "http/http_chunked_decoder.cc",
574    "http/http_chunked_decoder.h",
575    "http/http_connection_info.cc",
576    "http/http_connection_info.h",
577    "http/http_content_disposition.cc",
578    "http/http_content_disposition.h",
579    "http/http_cookie_indices.cc",
580    "http/http_cookie_indices.h",
581    "http/http_log_util.cc",
582    "http/http_log_util.h",
583    "http/http_network_layer.cc",
584    "http/http_network_layer.h",
585    "http/http_network_session.cc",
586    "http/http_network_session.h",
587    "http/http_network_session_peer.cc",
588    "http/http_network_session_peer.h",
589    "http/http_network_transaction.cc",
590    "http/http_network_transaction.h",
591    "http/http_no_vary_search_data.cc",
592    "http/http_no_vary_search_data.h",
593    "http/http_proxy_client_socket.cc",
594    "http/http_proxy_client_socket.h",
595    "http/http_proxy_connect_job.cc",
596    "http/http_proxy_connect_job.h",
597    "http/http_raw_request_headers.cc",
598    "http/http_raw_request_headers.h",
599    "http/http_request_headers.cc",
600    "http/http_request_headers.h",
601    "http/http_request_info.cc",
602    "http/http_request_info.h",
603    "http/http_response_body_drainer.cc",
604    "http/http_response_body_drainer.h",
605    "http/http_response_headers.cc",
606    "http/http_response_headers.h",
607    "http/http_response_info.cc",
608    "http/http_response_info.h",
609    "http/http_security_headers.cc",
610    "http/http_security_headers.h",
611    "http/http_server_properties.cc",
612    "http/http_server_properties.h",
613    "http/http_server_properties_manager.cc",
614    "http/http_server_properties_manager.h",
615    "http/http_status_code.cc",
616    "http/http_status_code.h",
617    "http/http_status_code_list.h",
618    "http/http_stream.cc",
619    "http/http_stream.h",
620    "http/http_stream_factory.cc",
621    "http/http_stream_factory.h",
622    "http/http_stream_factory_job.cc",
623    "http/http_stream_factory_job.h",
624    "http/http_stream_factory_job_controller.cc",
625    "http/http_stream_factory_job_controller.h",
626    "http/http_stream_parser.cc",
627    "http/http_stream_parser.h",
628    "http/http_stream_request.cc",
629    "http/http_stream_request.h",
630    "http/http_transaction.h",
631    "http/http_transaction_factory.h",
632    "http/http_util.cc",
633    "http/http_util.h",
634    "http/http_vary_data.cc",
635    "http/http_vary_data.h",
636    "http/http_version.h",
637    "http/partial_data.cc",
638    "http/partial_data.h",
639    "http/proxy_client_socket.cc",
640    "http/proxy_client_socket.h",
641    "http/proxy_fallback.cc",
642    "http/proxy_fallback.h",
643    "http/structured_headers.h",
644    "http/transport_security_persister.cc",
645    "http/transport_security_persister.h",
646    "http/transport_security_state.h",
647    "http/transport_security_state_source.cc",
648    "http/transport_security_state_source.h",
649    "http/url_security_manager.cc",
650    "http/url_security_manager.h",
651    "log/file_net_log_observer.cc",
652    "log/file_net_log_observer.h",
653    "log/net_log.cc",
654    "log/net_log.h",
655    "log/net_log_capture_mode.cc",
656    "log/net_log_capture_mode.h",
657    "log/net_log_entry.cc",
658    "log/net_log_entry.h",
659    "log/net_log_event_type.cc",
660    "log/net_log_event_type.h",
661    "log/net_log_event_type_list.h",
662    "log/net_log_source.cc",
663    "log/net_log_source.h",
664    "log/net_log_source_type.h",
665    "log/net_log_source_type_list.h",
666    "log/net_log_util.cc",
667    "log/net_log_util.h",
668    "log/net_log_values.cc",
669    "log/net_log_values.h",
670    "log/net_log_with_source.cc",
671    "log/net_log_with_source.h",
672    "log/trace_net_log_observer.cc",
673    "log/trace_net_log_observer.h",
674    "nqe/cached_network_quality.cc",
675    "nqe/cached_network_quality.h",
676    "nqe/effective_connection_type.cc",
677    "nqe/effective_connection_type.h",
678    "nqe/effective_connection_type_observer.h",
679    "nqe/event_creator.cc",
680    "nqe/event_creator.h",
681    "nqe/network_id.cc",
682    "nqe/network_id.h",
683    "nqe/network_qualities_prefs_manager.cc",
684    "nqe/network_qualities_prefs_manager.h",
685    "nqe/network_quality.cc",
686    "nqe/network_quality.h",
687    "nqe/network_quality_estimator.cc",
688    "nqe/network_quality_estimator.h",
689    "nqe/network_quality_estimator_params.cc",
690    "nqe/network_quality_estimator_params.h",
691    "nqe/network_quality_estimator_util.cc",
692    "nqe/network_quality_estimator_util.h",
693    "nqe/network_quality_observation.cc",
694    "nqe/network_quality_observation.h",
695    "nqe/network_quality_observation_source.h",
696    "nqe/network_quality_store.cc",
697    "nqe/network_quality_store.h",
698    "nqe/observation_buffer.cc",
699    "nqe/observation_buffer.h",
700    "nqe/peer_to_peer_connections_count_observer.h",
701    "nqe/pref_names.cc",
702    "nqe/pref_names.h",
703    "nqe/rtt_throughput_estimates_observer.h",
704    "nqe/socket_watcher.cc",
705    "nqe/socket_watcher.h",
706    "nqe/socket_watcher_factory.cc",
707    "nqe/socket_watcher_factory.h",
708    "nqe/throughput_analyzer.cc",
709    "nqe/throughput_analyzer.h",
710    "nqe/weighted_observation.h",
711    "proxy_resolution/configured_proxy_resolution_request.cc",
712    "proxy_resolution/configured_proxy_resolution_request.h",
713    "proxy_resolution/configured_proxy_resolution_service.cc",
714    "proxy_resolution/configured_proxy_resolution_service.h",
715    "proxy_resolution/dhcp_pac_file_fetcher.cc",
716    "proxy_resolution/dhcp_pac_file_fetcher.h",
717    "proxy_resolution/multi_threaded_proxy_resolver.cc",
718    "proxy_resolution/multi_threaded_proxy_resolver.h",
719    "proxy_resolution/network_delegate_error_observer.cc",
720    "proxy_resolution/network_delegate_error_observer.h",
721    "proxy_resolution/pac_file_data.cc",
722    "proxy_resolution/pac_file_data.h",
723    "proxy_resolution/pac_file_decider.cc",
724    "proxy_resolution/pac_file_decider.h",
725    "proxy_resolution/pac_file_fetcher.cc",
726    "proxy_resolution/pac_file_fetcher.h",
727    "proxy_resolution/pac_file_fetcher_impl.cc",
728    "proxy_resolution/pac_file_fetcher_impl.h",
729    "proxy_resolution/polling_proxy_config_service.cc",
730    "proxy_resolution/polling_proxy_config_service.h",
731    "proxy_resolution/proxy_bypass_rules.cc",
732    "proxy_resolution/proxy_bypass_rules.h",
733    "proxy_resolution/proxy_config.cc",
734    "proxy_resolution/proxy_config.h",
735    "proxy_resolution/proxy_config_service.cc",
736    "proxy_resolution/proxy_config_service.h",
737    "proxy_resolution/proxy_config_service_fixed.cc",
738    "proxy_resolution/proxy_config_service_fixed.h",
739    "proxy_resolution/proxy_config_with_annotation.cc",
740    "proxy_resolution/proxy_config_with_annotation.h",
741    "proxy_resolution/proxy_info.cc",
742    "proxy_resolution/proxy_info.h",
743    "proxy_resolution/proxy_list.cc",
744    "proxy_resolution/proxy_list.h",
745    "proxy_resolution/proxy_resolution_request.h",
746    "proxy_resolution/proxy_resolution_service.h",
747    "proxy_resolution/proxy_resolve_dns_operation.h",
748    "proxy_resolution/proxy_resolver.h",
749    "proxy_resolution/proxy_resolver_error_observer.h",
750    "proxy_resolution/proxy_resolver_factory.cc",
751    "proxy_resolution/proxy_resolver_factory.h",
752    "proxy_resolution/proxy_retry_info.h",
753    "quic/address_utils.h",
754    "quic/bidirectional_stream_quic_impl.cc",
755    "quic/bidirectional_stream_quic_impl.h",
756    "quic/crypto/proof_source_chromium.cc",
757    "quic/crypto/proof_source_chromium.h",
758    "quic/crypto/proof_verifier_chromium.cc",
759    "quic/crypto/proof_verifier_chromium.h",
760    "quic/dedicated_web_transport_http3_client.cc",
761    "quic/dedicated_web_transport_http3_client.h",
762    "quic/network_connection.cc",
763    "quic/network_connection.h",
764    "quic/platform/impl/quic_chromium_clock.cc",
765    "quic/platform/impl/quic_chromium_clock.h",
766    "quic/properties_based_quic_server_info.cc",
767    "quic/properties_based_quic_server_info.h",
768    "quic/quic_address_mismatch.cc",
769    "quic/quic_address_mismatch.h",
770    "quic/quic_chromium_alarm_factory.cc",
771    "quic/quic_chromium_alarm_factory.h",
772    "quic/quic_chromium_client_session.cc",
773    "quic/quic_chromium_client_session.h",
774    "quic/quic_chromium_client_stream.cc",
775    "quic/quic_chromium_client_stream.h",
776    "quic/quic_chromium_connection_helper.cc",
777    "quic/quic_chromium_connection_helper.h",
778    "quic/quic_chromium_packet_reader.cc",
779    "quic/quic_chromium_packet_reader.h",
780    "quic/quic_chromium_packet_writer.cc",
781    "quic/quic_chromium_packet_writer.h",
782    "quic/quic_clock_skew_detector.cc",
783    "quic/quic_clock_skew_detector.h",
784    "quic/quic_connection_logger.cc",
785    "quic/quic_connection_logger.h",
786    "quic/quic_connectivity_monitor.cc",
787    "quic/quic_connectivity_monitor.h",
788    "quic/quic_context.cc",
789    "quic/quic_context.h",
790    "quic/quic_crypto_client_config_handle.cc",
791    "quic/quic_crypto_client_config_handle.h",
792    "quic/quic_crypto_client_stream_factory.cc",
793    "quic/quic_crypto_client_stream_factory.h",
794    "quic/quic_event_logger.cc",
795    "quic/quic_event_logger.h",
796    "quic/quic_http3_logger.cc",
797    "quic/quic_http3_logger.h",
798    "quic/quic_http_stream.cc",
799    "quic/quic_http_stream.h",
800    "quic/quic_http_utils.cc",
801    "quic/quic_http_utils.h",
802    "quic/quic_proxy_client_socket.cc",
803    "quic/quic_proxy_client_socket.h",
804    "quic/quic_proxy_datagram_client_socket.cc",
805    "quic/quic_proxy_datagram_client_socket.h",
806    "quic/quic_server_info.cc",
807    "quic/quic_server_info.h",
808    "quic/quic_session_key.cc",
809    "quic/quic_session_key.h",
810    "quic/quic_session_pool.cc",
811    "quic/quic_session_pool.h",
812    "quic/quic_session_pool_direct_job.cc",
813    "quic/quic_session_pool_direct_job.h",
814    "quic/quic_session_pool_job.cc",
815    "quic/quic_session_pool_job.h",
816    "quic/quic_session_pool_proxy_job.cc",
817    "quic/quic_session_pool_proxy_job.h",
818    "quic/quic_session_pool_session_attempt.cc",
819    "quic/quic_session_pool_session_attempt.h",
820    "quic/set_quic_flag.cc",
821    "quic/set_quic_flag.h",
822    "quic/web_transport_client.cc",
823    "quic/web_transport_client.h",
824    "quic/web_transport_error.cc",
825    "quic/web_transport_error.h",
826    "socket/client_socket_factory.cc",
827    "socket/client_socket_factory.h",
828    "socket/client_socket_handle.cc",
829    "socket/client_socket_handle.h",
830    "socket/client_socket_pool.cc",
831    "socket/client_socket_pool.h",
832    "socket/client_socket_pool_manager.cc",
833    "socket/client_socket_pool_manager.h",
834    "socket/client_socket_pool_manager_impl.cc",
835    "socket/client_socket_pool_manager_impl.h",
836    "socket/connect_job.cc",
837    "socket/connect_job.h",
838    "socket/connect_job_factory.cc",
839    "socket/connect_job_factory.h",
840    "socket/connect_job_params.cc",
841    "socket/connect_job_params.h",
842    "socket/connect_job_params_factory.cc",
843    "socket/connect_job_params_factory.h",
844    "socket/connection_attempts.h",
845    "socket/datagram_client_socket.h",
846    "socket/datagram_server_socket.h",
847    "socket/datagram_socket.h",
848    "socket/diff_serv_code_point.h",
849    "socket/network_binding_client_socket_factory.cc",
850    "socket/network_binding_client_socket_factory.h",
851    "socket/next_proto.cc",
852    "socket/next_proto.h",
853    "socket/server_socket.cc",
854    "socket/server_socket.h",
855    "socket/socket.cc",
856    "socket/socket.h",
857    "socket/socket_bio_adapter.cc",
858    "socket/socket_bio_adapter.h",
859    "socket/socket_descriptor.cc",
860    "socket/socket_descriptor.h",
861    "socket/socket_net_log_params.cc",
862    "socket/socket_net_log_params.h",
863    "socket/socket_options.cc",
864    "socket/socket_options.h",
865    "socket/socket_performance_watcher.h",
866    "socket/socket_performance_watcher_factory.h",
867    "socket/socket_tag.cc",
868    "socket/socket_tag.h",
869    "socket/socks5_client_socket.cc",
870    "socket/socks5_client_socket.h",
871    "socket/socks_client_socket.cc",
872    "socket/socks_client_socket.h",
873    "socket/socks_connect_job.cc",
874    "socket/socks_connect_job.h",
875    "socket/ssl_client_socket.cc",
876    "socket/ssl_client_socket.h",
877    "socket/ssl_client_socket_impl.cc",
878    "socket/ssl_client_socket_impl.h",
879    "socket/ssl_connect_job.cc",
880    "socket/ssl_connect_job.h",
881    "socket/ssl_server_socket.h",
882    "socket/ssl_server_socket_impl.cc",
883    "socket/ssl_server_socket_impl.h",
884    "socket/ssl_socket.h",
885    "socket/stream_socket.cc",
886    "socket/stream_socket.h",
887    "socket/tcp_client_socket.cc",
888    "socket/tcp_client_socket.h",
889    "socket/tcp_server_socket.cc",
890    "socket/tcp_server_socket.h",
891    "socket/tcp_socket.h",
892    "socket/transport_client_socket.cc",
893    "socket/transport_client_socket.h",
894    "socket/transport_client_socket_pool.cc",
895    "socket/transport_client_socket_pool.h",
896    "socket/transport_connect_job.cc",
897    "socket/transport_connect_job.h",
898    "socket/transport_connect_sub_job.cc",
899    "socket/transport_connect_sub_job.h",
900    "socket/udp_client_socket.cc",
901    "socket/udp_client_socket.h",
902    "socket/udp_net_log_parameters.cc",
903    "socket/udp_net_log_parameters.h",
904    "socket/udp_server_socket.cc",
905    "socket/udp_server_socket.h",
906    "socket/udp_socket.h",
907    "socket/udp_socket_global_limits.cc",
908    "socket/udp_socket_global_limits.h",
909    "socket/websocket_endpoint_lock_manager.cc",
910    "socket/websocket_endpoint_lock_manager.h",
911    "socket/websocket_transport_client_socket_pool.cc",
912    "socket/websocket_transport_client_socket_pool.h",
913    "spdy/alps_decoder.cc",
914    "spdy/alps_decoder.h",
915    "spdy/bidirectional_stream_spdy_impl.cc",
916    "spdy/bidirectional_stream_spdy_impl.h",
917    "spdy/buffered_spdy_framer.cc",
918    "spdy/buffered_spdy_framer.h",
919    "spdy/header_coalescer.cc",
920    "spdy/header_coalescer.h",
921    "spdy/http2_priority_dependencies.cc",
922    "spdy/http2_priority_dependencies.h",
923    "spdy/multiplexed_http_stream.cc",
924    "spdy/multiplexed_http_stream.h",
925    "spdy/multiplexed_session.cc",
926    "spdy/multiplexed_session.h",
927    "spdy/spdy_buffer.cc",
928    "spdy/spdy_buffer.h",
929    "spdy/spdy_buffer_producer.cc",
930    "spdy/spdy_buffer_producer.h",
931    "spdy/spdy_http_stream.cc",
932    "spdy/spdy_http_stream.h",
933    "spdy/spdy_http_utils.cc",
934    "spdy/spdy_http_utils.h",
935    "spdy/spdy_log_util.cc",
936    "spdy/spdy_log_util.h",
937    "spdy/spdy_proxy_client_socket.cc",
938    "spdy/spdy_proxy_client_socket.h",
939    "spdy/spdy_read_queue.cc",
940    "spdy/spdy_read_queue.h",
941    "spdy/spdy_session.cc",
942    "spdy/spdy_session.h",
943    "spdy/spdy_session_key.cc",
944    "spdy/spdy_session_key.h",
945    "spdy/spdy_session_pool.cc",
946    "spdy/spdy_session_pool.h",
947    "spdy/spdy_stream.cc",
948    "spdy/spdy_stream.h",
949    "spdy/spdy_write_queue.cc",
950    "spdy/spdy_write_queue.h",
951    "ssl/cert_compression.cc",
952    "ssl/cert_compression.h",
953    "ssl/client_cert_identity.cc",
954    "ssl/client_cert_identity.h",
955    "ssl/client_cert_store.h",
956    "ssl/openssl_private_key.cc",
957    "ssl/openssl_private_key.h",
958    "ssl/openssl_ssl_util.cc",
959    "ssl/openssl_ssl_util.h",
960    "ssl/ssl_cert_request_info.cc",
961    "ssl/ssl_cert_request_info.h",
962    "ssl/ssl_cipher_suite_names.cc",
963    "ssl/ssl_cipher_suite_names.h",
964    "ssl/ssl_client_auth_cache.cc",
965    "ssl/ssl_client_auth_cache.h",
966    "ssl/ssl_client_session_cache.cc",
967    "ssl/ssl_client_session_cache.h",
968    "ssl/ssl_config.cc",
969    "ssl/ssl_config.h",
970    "ssl/ssl_config_service.cc",
971    "ssl/ssl_config_service.h",
972    "ssl/ssl_config_service_defaults.cc",
973    "ssl/ssl_config_service_defaults.h",
974    "ssl/ssl_connection_status_flags.h",
975    "ssl/ssl_handshake_details.h",
976    "ssl/ssl_info.cc",
977    "ssl/ssl_info.h",
978    "ssl/ssl_key_logger.cc",
979    "ssl/ssl_key_logger.h",
980    "ssl/ssl_key_logger_impl.cc",
981    "ssl/ssl_key_logger_impl.h",
982    "ssl/ssl_platform_key_util.cc",
983    "ssl/ssl_platform_key_util.h",
984    "ssl/ssl_private_key.cc",
985    "ssl/ssl_private_key.h",
986    "ssl/ssl_server_config.cc",
987    "ssl/ssl_server_config.h",
988    "ssl/threaded_ssl_private_key.cc",
989    "ssl/threaded_ssl_private_key.h",
990    "url_request/clear_site_data.cc",
991    "url_request/clear_site_data.h",
992    "url_request/redirect_info.cc",
993    "url_request/redirect_info.h",
994    "url_request/redirect_util.cc",
995    "url_request/redirect_util.h",
996    "url_request/referrer_policy.h",
997    "url_request/static_http_user_agent_settings.cc",
998    "url_request/static_http_user_agent_settings.h",
999    "url_request/url_request.cc",
1000    "url_request/url_request.h",
1001    "url_request/url_request_context.cc",
1002    "url_request/url_request_context.h",
1003    "url_request/url_request_context_builder.cc",
1004    "url_request/url_request_context_builder.h",
1005    "url_request/url_request_context_getter.cc",
1006    "url_request/url_request_context_getter.h",
1007    "url_request/url_request_context_getter_observer.h",
1008    "url_request/url_request_error_job.cc",
1009    "url_request/url_request_error_job.h",
1010    "url_request/url_request_filter.cc",
1011    "url_request/url_request_filter.h",
1012    "url_request/url_request_http_job.cc",
1013    "url_request/url_request_http_job.h",
1014    "url_request/url_request_interceptor.cc",
1015    "url_request/url_request_interceptor.h",
1016    "url_request/url_request_job.cc",
1017    "url_request/url_request_job.h",
1018    "url_request/url_request_job_factory.cc",
1019    "url_request/url_request_job_factory.h",
1020    "url_request/url_request_netlog_params.cc",
1021    "url_request/url_request_netlog_params.h",
1022    "url_request/url_request_redirect_job.cc",
1023    "url_request/url_request_redirect_job.h",
1024    "url_request/view_cache_helper.cc",
1025    "url_request/view_cache_helper.h",
1026    "url_request/websocket_handshake_userdata_key.cc",
1027    "url_request/websocket_handshake_userdata_key.h",
1028  ]
1029
1030  if (is_posix || is_fuchsia) {
1031    sources += [ "base/net_errors_posix.cc" ]
1032  }
1033
1034  defines = []
1035  if (disable_brotli_filter) {
1036    defines += [ "NET_DISABLE_BROTLI" ]
1037  }
1038  if (disable_zstd_filter) {
1039    defines += [ "NET_DISABLE_ZSTD" ]
1040  }
1041
1042  deps = [
1043    ":cronet_buildflags",
1044    ":net_deps",
1045    "//build:chromeos_buildflags",
1046    "//components/miracle_parameter/common",
1047    "//net/http:transport_security_state_generated_files",
1048  ]
1049
1050  public_deps = [
1051    ":net_export_header",
1052    ":net_public_deps",
1053    "//base",
1054    "//net/dns",
1055    "//net/dns:dns_client",
1056    "//net/dns:host_resolver",
1057    "//net/dns:host_resolver_manager",
1058    "//net/dns:mdns_client",
1059    "//net/dns/public",
1060    "//net/third_party/quiche",
1061  ]
1062
1063  allow_circular_includes_from = [
1064    "//net/dns",
1065    "//net/dns:dns_client",
1066    "//net/dns:host_resolver",
1067    "//net/dns:host_resolver_manager",
1068    "//net/dns:mdns_client",
1069    "//net/dns/public",
1070    "//net/http:transport_security_state_generated_files",
1071  ]
1072
1073  if (enable_reporting) {
1074    sources += [
1075      "network_error_logging/network_error_logging_service.cc",
1076      "network_error_logging/network_error_logging_service.h",
1077      "network_error_logging/persistent_reporting_and_nel_store.h",
1078      "reporting/reporting_browsing_data_remover.cc",
1079      "reporting/reporting_browsing_data_remover.h",
1080      "reporting/reporting_cache.cc",
1081      "reporting/reporting_cache.h",
1082      "reporting/reporting_cache_impl.cc",
1083      "reporting/reporting_cache_impl.h",
1084      "reporting/reporting_cache_observer.cc",
1085      "reporting/reporting_cache_observer.h",
1086      "reporting/reporting_context.cc",
1087      "reporting/reporting_context.h",
1088      "reporting/reporting_delegate.cc",
1089      "reporting/reporting_delegate.h",
1090      "reporting/reporting_delivery_agent.cc",
1091      "reporting/reporting_delivery_agent.h",
1092      "reporting/reporting_endpoint.cc",
1093      "reporting/reporting_endpoint.h",
1094      "reporting/reporting_endpoint_manager.cc",
1095      "reporting/reporting_endpoint_manager.h",
1096      "reporting/reporting_garbage_collector.cc",
1097      "reporting/reporting_garbage_collector.h",
1098      "reporting/reporting_header_parser.cc",
1099      "reporting/reporting_header_parser.h",
1100      "reporting/reporting_network_change_observer.cc",
1101      "reporting/reporting_network_change_observer.h",
1102      "reporting/reporting_policy.cc",
1103      "reporting/reporting_policy.h",
1104      "reporting/reporting_report.cc",
1105      "reporting/reporting_report.h",
1106      "reporting/reporting_service.cc",
1107      "reporting/reporting_service.h",
1108      "reporting/reporting_uploader.cc",
1109      "reporting/reporting_uploader.h",
1110    ]
1111  }
1112
1113  if (enable_device_bound_sessions) {
1114    sources += [
1115      "device_bound_sessions/device_bound_session_registration_fetcher_param.cc",
1116      "device_bound_sessions/device_bound_session_registration_fetcher_param.h",
1117      "device_bound_sessions/device_bound_session_service.cc",
1118      "device_bound_sessions/device_bound_session_service.h",
1119    ]
1120  }
1121
1122  if (is_android) {
1123    sources += [
1124      "android/android_http_util.cc",
1125      "android/cert_verify_result_android.cc",
1126      "android/cert_verify_result_android.h",
1127      "android/gurl_utils.cc",
1128      "android/http_auth_negotiate_android.cc",
1129      "android/http_auth_negotiate_android.h",
1130      "android/keystore.cc",
1131      "android/keystore.h",
1132      "android/network_change_notifier_android.cc",
1133      "android/network_change_notifier_android.h",
1134      "android/network_change_notifier_delegate_android.cc",
1135      "android/network_change_notifier_delegate_android.h",
1136      "android/network_change_notifier_factory_android.cc",
1137      "android/network_change_notifier_factory_android.h",
1138      "android/network_library.cc",
1139      "android/network_library.h",
1140      "android/traffic_stats.cc",
1141      "android/traffic_stats.h",
1142      "cert/cert_verify_proc_android.cc",
1143      "cert/cert_verify_proc_android.h",
1144      "cert/test_root_certs_android.cc",
1145      "cert/x509_util_android.cc",
1146      "proxy_resolution/proxy_config_service_android.cc",
1147      "proxy_resolution/proxy_config_service_android.h",
1148      "ssl/ssl_platform_key_android.cc",
1149      "ssl/ssl_platform_key_android.h",
1150    ]
1151  }
1152
1153  if (is_chromeos && use_nss_certs) {
1154    sources += [
1155      "cert/nss_cert_database_chromeos.cc",
1156      "cert/nss_cert_database_chromeos.h",
1157      "cert/nss_profile_filter_chromeos.cc",
1158      "cert/nss_profile_filter_chromeos.h",
1159    ]
1160  }
1161
1162  if (is_ios) {
1163    sources += [
1164      "cert/cert_verify_proc_ios.cc",
1165      "cert/cert_verify_proc_ios.h",
1166      "cert/test_root_certs_ios.cc",
1167      "disk_cache/blockfile/file_ios.cc",
1168      "proxy_resolution/proxy_config_service_ios.cc",
1169      "proxy_resolution/proxy_config_service_ios.h",
1170    ]
1171  }
1172
1173  if (is_linux) {
1174    sources += [
1175      "base/network_change_notifier_linux.cc",
1176      "base/network_change_notifier_linux.h",
1177      "proxy_resolution/proxy_config_service_linux.cc",
1178      "proxy_resolution/proxy_config_service_linux.h",
1179    ]
1180  }
1181
1182  if (is_linux || is_chromeos || is_android) {
1183    sources += [
1184      "base/address_map_linux.cc",
1185      "base/address_map_linux.h",
1186      "base/address_tracker_linux.cc",
1187      "base/address_tracker_linux.h",
1188      "base/network_interfaces_linux.cc",
1189      "base/network_interfaces_linux.h",
1190      "base/platform_mime_util_linux.cc",
1191    ]
1192  }
1193
1194  if (is_linux) {
1195    sources += [
1196      "base/address_map_cache_linux.cc",
1197      "base/address_map_cache_linux.h",
1198    ]
1199  }
1200
1201  if (is_mac) {
1202    sources += [
1203      "base/network_notification_thread_mac.cc",
1204      "base/network_notification_thread_mac.h",
1205      "cert/cert_database_mac.cc",
1206      "cert/internal/trust_store_mac.cc",
1207      "cert/internal/trust_store_mac.h",
1208      "cert/test_keychain_search_list_mac.cc",
1209      "cert/test_keychain_search_list_mac.h",
1210      "cert/test_root_certs_builtin.cc",
1211      "proxy_resolution/proxy_config_service_mac.cc",
1212      "proxy_resolution/proxy_config_service_mac.h",
1213      "ssl/client_cert_identity_mac.cc",
1214      "ssl/client_cert_identity_mac.h",
1215      "ssl/client_cert_store_mac.cc",
1216      "ssl/client_cert_store_mac.h",
1217      "ssl/ssl_platform_key_mac.cc",
1218      "ssl/ssl_platform_key_mac.h",
1219    ]
1220  }
1221
1222  if (is_apple) {
1223    sources += [
1224      "base/apple/url_conversions.h",
1225      "base/apple/url_conversions.mm",
1226      "base/network_change_notifier_apple.h",
1227      "base/network_change_notifier_apple.mm",
1228      "base/network_config_watcher_apple.cc",
1229      "base/network_config_watcher_apple.h",
1230      "base/platform_mime_util_apple.mm",
1231      "cert/x509_util_apple.cc",
1232      "cert/x509_util_apple.h",
1233      "proxy_resolution/proxy_chain_util_apple.cc",
1234      "proxy_resolution/proxy_chain_util_apple.h",
1235      "proxy_resolution/proxy_resolver_apple.cc",
1236      "proxy_resolution/proxy_resolver_apple.h",
1237    ]
1238  }
1239
1240  if (is_win) {
1241    sources += [
1242      "base/file_stream_context_win.cc",
1243      "base/net_errors_win.cc",
1244      "base/network_change_notifier_win.cc",
1245      "base/network_change_notifier_win.h",
1246      "base/network_interfaces_win.cc",
1247      "base/network_interfaces_win.h",
1248      "base/platform_mime_util_win.cc",
1249      "base/winsock_init.cc",
1250      "base/winsock_init.h",
1251      "base/winsock_util.cc",
1252      "base/winsock_util.h",
1253      "cert/test_root_certs_builtin.cc",
1254      "cert/x509_util_win.cc",
1255      "cert/x509_util_win.h",
1256      "disk_cache/blockfile/file_win.cc",
1257      "disk_cache/blockfile/mapped_file_win.cc",
1258      "disk_cache/cache_util_win.cc",
1259      "disk_cache/simple/simple_util_win.cc",
1260      "http/http_auth_handler_ntlm_win.cc",
1261      "http/http_auth_sspi_win.cc",
1262      "http/http_auth_sspi_win.h",
1263      "http/url_security_manager_win.cc",
1264      "proxy_resolution/win/dhcp_pac_file_adapter_fetcher_win.cc",
1265      "proxy_resolution/win/dhcp_pac_file_adapter_fetcher_win.h",
1266      "proxy_resolution/win/dhcp_pac_file_fetcher_win.cc",
1267      "proxy_resolution/win/dhcp_pac_file_fetcher_win.h",
1268      "proxy_resolution/win/dhcpcsvc_init_win.cc",
1269      "proxy_resolution/win/dhcpcsvc_init_win.h",
1270      "proxy_resolution/win/proxy_config_service_win.cc",
1271      "proxy_resolution/win/proxy_config_service_win.h",
1272      "proxy_resolution/win/proxy_resolver_winhttp.cc",
1273      "proxy_resolution/win/proxy_resolver_winhttp.h",
1274      "proxy_resolution/win/windows_system_proxy_resolution_request.cc",
1275      "proxy_resolution/win/windows_system_proxy_resolution_request.h",
1276      "proxy_resolution/win/windows_system_proxy_resolution_service.cc",
1277      "proxy_resolution/win/windows_system_proxy_resolution_service.h",
1278      "proxy_resolution/win/windows_system_proxy_resolver.h",
1279      "proxy_resolution/win/winhttp_status.h",
1280      "socket/tcp_socket_win.cc",
1281      "socket/tcp_socket_win.h",
1282      "socket/udp_socket_win.cc",
1283      "socket/udp_socket_win.h",
1284      "ssl/client_cert_store_win.cc",
1285      "ssl/client_cert_store_win.h",
1286      "ssl/ssl_platform_key_win.cc",
1287    ]
1288  }
1289
1290  if (use_kerberos) {
1291    sources += [
1292      "http/http_auth_handler_negotiate.cc",
1293      "http/http_auth_handler_negotiate.h",
1294    ]
1295  }
1296
1297  if (is_posix || is_fuchsia) {
1298    sources += [
1299      "base/file_stream_context_posix.cc",
1300      "base/network_interfaces_posix.cc",
1301      "base/network_interfaces_posix.h",
1302      "base/sockaddr_util_posix.cc",
1303      "base/sockaddr_util_posix.h",
1304      "disk_cache/cache_util_posix.cc",
1305      "disk_cache/simple/simple_util_posix.cc",
1306      "http/url_security_manager_posix.cc",
1307      "socket/socket_posix.cc",
1308      "socket/socket_posix.h",
1309      "socket/tcp_socket_posix.cc",
1310      "socket/tcp_socket_posix.h",
1311      "socket/udp_socket_posix.cc",
1312      "socket/udp_socket_posix.h",
1313    ]
1314    if (!is_ios) {
1315      sources += [ "disk_cache/blockfile/file_posix.cc" ]
1316    }
1317    if (posix_bypass_mmap) {
1318      sources += [ "disk_cache/blockfile/mapped_file_bypass_mmap_posix.cc" ]
1319    } else {
1320      sources += [ "disk_cache/blockfile/mapped_file_posix.cc" ]
1321    }
1322  }
1323
1324  if (is_android || is_chromeos || is_linux) {
1325    sources += [
1326      "base/network_change_notifier_passive.cc",
1327      "base/network_change_notifier_passive.h",
1328    ]
1329  }
1330
1331  if (!is_win) {
1332    sources += [
1333      "http/http_auth_handler_ntlm_portable.cc",
1334      "http/http_auth_ntlm_mechanism.cc",
1335      "http/http_auth_ntlm_mechanism.h",
1336      "ntlm/ntlm.cc",
1337      "ntlm/ntlm.h",
1338      "ntlm/ntlm_buffer_reader.cc",
1339      "ntlm/ntlm_buffer_reader.h",
1340      "ntlm/ntlm_buffer_writer.cc",
1341      "ntlm/ntlm_buffer_writer.h",
1342      "ntlm/ntlm_client.cc",
1343      "ntlm/ntlm_client.h",
1344      "ntlm/ntlm_constants.cc",
1345      "ntlm/ntlm_constants.h",
1346    ]
1347  }
1348
1349  if (use_external_gssapi) {
1350    sources += [
1351      "http/http_auth_gssapi_posix.cc",
1352      "http/http_auth_gssapi_posix.h",
1353    ]
1354  }
1355
1356  # Use getifaddrs() on POSIX platforms, except Linux.
1357  if (is_posix && !is_linux && !is_chromeos) {
1358    sources += [
1359      "base/network_interfaces_getifaddrs.cc",
1360      "base/network_interfaces_getifaddrs.h",
1361    ]
1362    if (is_android) {
1363      sources += [
1364        "base/network_interfaces_getifaddrs_android.cc",
1365        "base/network_interfaces_getifaddrs_android.h",
1366      ]
1367    }
1368  }
1369
1370  if (chrome_root_store_supported) {
1371    sources += [
1372      "cert/internal/trust_store_chrome.cc",
1373      "cert/internal/trust_store_chrome.h",
1374    ]
1375    deps += [
1376      "//base/version_info",
1377      "//net/cert:root_store_proto_lite",
1378      "//net/data/ssl/chrome_root_store:gen_root_store_inc",
1379    ]
1380    if (is_win) {
1381      sources += [
1382        "cert/internal/trust_store_win.cc",
1383        "cert/internal/trust_store_win.h",
1384        "third_party/mozilla_win/cert/win_util.cc",
1385        "third_party/mozilla_win/cert/win_util.h",
1386      ]
1387    }
1388    if (is_android) {
1389      sources += [
1390        "cert/internal/trust_store_android.cc",
1391        "cert/internal/trust_store_android.h",
1392      ]
1393    }
1394  }
1395
1396  if (use_nss_certs) {
1397    sources += [
1398      "cert/internal/system_trust_store_nss.h",
1399      "cert/internal/trust_store_nss.cc",
1400      "cert/internal/trust_store_nss.h",
1401      "cert/nss_cert_database.cc",
1402      "cert/nss_cert_database.h",
1403      "cert/test_root_certs_builtin.cc",
1404      "cert/x509_util_nss.cc",
1405      "cert/x509_util_nss.h",
1406      "third_party/mozilla_security_manager/nsNSSCertificateDB.cpp",
1407      "third_party/mozilla_security_manager/nsNSSCertificateDB.h",
1408      "third_party/mozilla_security_manager/nsPKCS12Blob.cpp",
1409      "third_party/mozilla_security_manager/nsPKCS12Blob.h",
1410      "third_party/nss/ssl/cmpcert.cc",
1411      "third_party/nss/ssl/cmpcert.h",
1412    ]
1413    if (!is_castos) {
1414      sources += [
1415        "ssl/client_cert_store_nss.cc",
1416        "ssl/client_cert_store_nss.h",
1417        "ssl/ssl_platform_key_nss.cc",
1418        "ssl/ssl_platform_key_nss.h",
1419      ]
1420    }
1421
1422    # TODO(https://crbug.com/978854): This is a public config because
1423    # multi_threaded_cert_verifier.h depends on NSS. When the linked bug is
1424    # fixed, switch this to a non-public config, so NSS usage must be explicit
1425    # in the build.
1426    public_configs = [ "//build/config/linux/nss" ]
1427  }
1428
1429  if (is_fuchsia) {
1430    deps += [
1431      "//net/data/ssl/chrome_root_store:gen_root_store_inc",
1432      "//third_party/fuchsia-sdk/sdk/pkg/async-loop-cpp",
1433    ]
1434    public_deps += [ "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.net.interfaces:fuchsia.net.interfaces_hlcpp" ]
1435    sources += [
1436      "base/fuchsia/network_interface_cache.cc",
1437      "base/fuchsia/network_interface_cache.h",
1438      "base/network_change_notifier_fuchsia.cc",
1439      "base/network_change_notifier_fuchsia.h",
1440      "base/network_interfaces_fuchsia.cc",
1441      "base/network_interfaces_fuchsia.h",
1442      "base/platform_mime_util_fuchsia.cc",
1443      "cert/test_root_certs_builtin.cc",
1444    ]
1445  }
1446
1447  if (enable_unix_sockets) {
1448    sources += [
1449      "socket/unix_domain_client_socket_posix.cc",
1450      "socket/unix_domain_client_socket_posix.h",
1451      "socket/unix_domain_server_socket_posix.cc",
1452      "socket/unix_domain_server_socket_posix.h",
1453    ]
1454  }
1455
1456  cflags = []
1457
1458  if (is_mac) {
1459    libs = [ "resolv" ]
1460    frameworks = [
1461      "CFNetwork.framework",
1462      "CoreServices.framework",
1463      "Foundation.framework",
1464      "Security.framework",
1465      "SystemConfiguration.framework",
1466      "UniformTypeIdentifiers.framework",
1467    ]
1468  }
1469
1470  if (is_ios) {
1471    libs = [ "resolv" ]
1472    frameworks = [
1473      "CFNetwork.framework",
1474      "CoreTelephony.framework",
1475      "MobileCoreServices.framework",
1476      "Security.framework",
1477      "SystemConfiguration.framework",
1478      "UniformTypeIdentifiers.framework",
1479    ]
1480  }
1481
1482  if (is_win) {
1483    libs = [
1484      "crypt32.lib",
1485      "dhcpcsvc.lib",
1486      "iphlpapi.lib",
1487      "ncrypt.lib",
1488      "rpcrt4.lib",
1489      "secur32.lib",
1490      "urlmon.lib",
1491      "winhttp.lib",
1492    ]
1493
1494    ldflags = [ "/DELAYLOAD:urlmon.dll" ]
1495  }
1496
1497  if (!disable_file_support) {
1498    sources += [
1499      "base/directory_lister.cc",
1500      "base/directory_lister.h",
1501      "base/directory_listing.cc",
1502      "base/directory_listing.h",
1503    ]
1504  }
1505
1506  if (enable_websockets) {
1507    sources += [
1508      "websockets/websocket_basic_handshake_stream.cc",
1509      "websockets/websocket_basic_handshake_stream.h",
1510      "websockets/websocket_basic_stream.cc",
1511      "websockets/websocket_basic_stream.h",
1512      "websockets/websocket_basic_stream_adapters.cc",
1513      "websockets/websocket_basic_stream_adapters.h",
1514      "websockets/websocket_channel.cc",
1515      "websockets/websocket_channel.h",
1516      "websockets/websocket_deflate_parameters.cc",
1517      "websockets/websocket_deflate_parameters.h",
1518      "websockets/websocket_deflate_predictor.h",
1519      "websockets/websocket_deflate_predictor_impl.cc",
1520      "websockets/websocket_deflate_predictor_impl.h",
1521      "websockets/websocket_deflate_stream.cc",
1522      "websockets/websocket_deflate_stream.h",
1523      "websockets/websocket_deflater.cc",
1524      "websockets/websocket_deflater.h",
1525      "websockets/websocket_errors.cc",
1526      "websockets/websocket_errors.h",
1527      "websockets/websocket_event_interface.h",
1528      "websockets/websocket_extension.cc",
1529      "websockets/websocket_extension.h",
1530      "websockets/websocket_extension_parser.cc",
1531      "websockets/websocket_extension_parser.h",
1532      "websockets/websocket_frame.cc",
1533      "websockets/websocket_frame.h",
1534      "websockets/websocket_frame_parser.cc",
1535      "websockets/websocket_frame_parser.h",
1536      "websockets/websocket_handshake_challenge.cc",
1537      "websockets/websocket_handshake_challenge.h",
1538      "websockets/websocket_handshake_constants.cc",
1539      "websockets/websocket_handshake_constants.h",
1540      "websockets/websocket_handshake_request_info.cc",
1541      "websockets/websocket_handshake_request_info.h",
1542      "websockets/websocket_handshake_response_info.cc",
1543      "websockets/websocket_handshake_response_info.h",
1544      "websockets/websocket_handshake_stream_base.cc",
1545      "websockets/websocket_handshake_stream_base.h",
1546      "websockets/websocket_handshake_stream_create_helper.cc",
1547      "websockets/websocket_handshake_stream_create_helper.h",
1548      "websockets/websocket_http2_handshake_stream.cc",
1549      "websockets/websocket_http2_handshake_stream.h",
1550      "websockets/websocket_http3_handshake_stream.cc",
1551      "websockets/websocket_http3_handshake_stream.h",
1552      "websockets/websocket_inflater.cc",
1553      "websockets/websocket_inflater.h",
1554      "websockets/websocket_quic_spdy_stream.cc",
1555      "websockets/websocket_quic_spdy_stream.h",
1556      "websockets/websocket_stream.cc",
1557      "websockets/websocket_stream.h",
1558    ]
1559  }
1560
1561  # ICU support.
1562  if (use_platform_icu_alternatives) {
1563    if (is_android) {
1564      # Use ICU alternative on Android.
1565      sources += [ "base/net_string_util_icu_alternatives_android.cc" ]
1566    } else if (is_ios) {
1567      # Use ICU alternative on iOS.
1568      sources += [ "base/net_string_util_icu_alternatives_ios.mm" ]
1569    } else {
1570      assert(false,
1571             "ICU alternative is not implemented for platform: " + target_os)
1572    }
1573  } else {
1574    # Use ICU.
1575    sources += [
1576      "base/filename_util_icu.cc",
1577      "base/net_string_util_icu.cc",
1578    ]
1579  }
1580
1581  # Brotli support.
1582  if (!disable_brotli_filter) {
1583    sources += [
1584      "filter/brotli_source_stream.cc",
1585      "filter/brotli_source_stream.h",
1586    ]
1587  } else {
1588    sources += [ "filter/brotli_source_stream_disabled.cc" ]
1589  }
1590
1591  # Zstd support.
1592  if (!disable_zstd_filter) {
1593    sources += [
1594      "filter/zstd_source_stream.cc",
1595      "filter/zstd_source_stream.h",
1596    ]
1597  } else {
1598    sources += [
1599      "filter/zstd_source_stream.h",
1600      "filter/zstd_source_stream_disabled.cc",
1601    ]
1602  }
1603
1604  if (!is_debug && !optimize_for_size) {
1605    configs -= [ "//build/config/compiler:default_optimization" ]
1606    configs += [ "//build/config/compiler:optimize_max" ]
1607  }
1608
1609  if (!is_cronet_build) {
1610    deps += [ "//mojo/public/cpp/bindings:default_construct_tag" ]
1611  }
1612}
1613
1614# net_export.h has its own build target so that code (eg
1615# net_nqe_proto) can use it without depending on the whole of //net.
1616source_set("net_export_header") {
1617  sources = [ "base/net_export.h" ]
1618}
1619
1620# Private dependencies for the //net component and for any build targets (e.g.
1621# source sets with circular dependencies with //net) that need to share the same
1622# dependencies.
1623source_set("net_deps") {
1624  visibility = [
1625    ":net",
1626    "//net/dns",
1627    "//net/dns:dns_client",
1628    "//net/dns:host_resolver",
1629    "//net/dns:host_resolver_manager",
1630    "//net/dns:mdns_client",
1631    "//net/dns/public",
1632    "//net/http:transport_security_state_generated_files",
1633    "//net/third_party/quiche",
1634  ]
1635
1636  public_deps = [
1637    ":constants",
1638    ":cronet_buildflags",
1639    ":isolation_info_proto",
1640    ":net_export_header",
1641    ":preload_decoder",
1642    "//base",
1643    "//net/base/registry_controlled_domains",
1644    "//third_party/protobuf:protobuf_lite",
1645    "//third_party/zlib",
1646    "//url:buildflags",
1647  ]
1648
1649  if (!disable_file_support) {
1650    public_deps += [ ":net_resources" ]
1651  }
1652
1653  public_configs = net_configs
1654
1655  if (use_gio) {
1656    public_configs += [ "//build/linux:gio_config" ]
1657  }
1658
1659  if (is_android) {
1660    public_deps += [ ":net_jni_headers" ]
1661  }
1662
1663  if (is_fuchsia) {
1664    public_deps += [
1665      "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.hardware.network:fuchsia.hardware.network_hlcpp",
1666      "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.net.interfaces:fuchsia.net.interfaces_hlcpp",
1667      "//third_party/fuchsia-sdk/sdk/pkg/sys_cpp",
1668    ]
1669  }
1670
1671  if (use_platform_icu_alternatives) {
1672    if (is_android) {
1673      public_deps += [ ":net_jni_headers" ]
1674    }
1675  } else {
1676    public_deps += [
1677      "//base:i18n",
1678      "//third_party/icu",
1679    ]
1680  }
1681
1682  if (!disable_brotli_filter) {
1683    public_deps += [ "//third_party/brotli:dec" ]
1684  } else {
1685    public_deps += [ "//third_party/brotli:headers" ]
1686  }
1687
1688  if (!disable_zstd_filter) {
1689    public_deps += [ "//third_party/zstd:decompress" ]
1690  } else {
1691    public_deps += [ "//third_party/zstd:headers" ]
1692  }
1693}
1694
1695# Public dependencies for the //net component and for any build targets (e.g.
1696# source sets with circular dependencies with //net) that need to share the same
1697# dependencies.
1698source_set("net_public_deps") {
1699  visibility = [
1700    ":net",
1701    "//net/dns",
1702    "//net/dns:dns_client",
1703    "//net/dns:host_resolver",
1704    "//net/dns:host_resolver_manager",
1705    "//net/dns:mdns_client",
1706    "//net/dns/public",
1707    "//net/http:transport_security_state_generated_files",
1708    "//net/third_party/quiche",
1709  ]
1710
1711  public_deps = [
1712    ":buildflags",
1713    ":net_nqe_proto",
1714    ":uri_template",
1715    "//base",
1716    "//crypto",
1717    "//net/third_party/quiche",
1718    "//net/third_party/quiche:net_quic_test_tools_proto",
1719    "//net/traffic_annotation",
1720    "//third_party/boringssl",
1721    "//url",
1722  ]
1723
1724  if (chrome_root_store_supported) {
1725    public_deps += [ "//net/cert:root_store_proto_lite" ]
1726  }
1727}
1728
1729if (is_android) {
1730  java_cpp_enum("effective_connection_type_java") {
1731    sources = [ "//net/nqe/effective_connection_type.h" ]
1732  }
1733}
1734
1735component("uri_template") {
1736  sources = [
1737    "third_party/uri_template/uri_template.cc",
1738    "third_party/uri_template/uri_template.h",
1739  ]
1740  visibility = [
1741    ":net_public_deps",
1742    "//net/third_party/quiche",
1743  ]
1744  defines = [ "IS_URI_TEMPLATE_IMPL" ]
1745  public_deps = [ "//base" ]
1746}
1747
1748grit("net_resources") {
1749  source = "base/net_resources.grd"
1750  outputs = [
1751    "grit/net_resources.h",
1752    "net_resources.pak",
1753  ]
1754}
1755
1756proto_library("net_nqe_proto") {
1757  visibility = [ ":net_public_deps" ]
1758
1759  sources = [ "nqe/proto/network_id_proto.proto" ]
1760  cc_generator_options = "dllexport_decl=NET_EXPORT_PRIVATE:"
1761  cc_include = "net/base/net_export.h"
1762  component_build_force_source_set = true
1763
1764  deps = [ ":net_export_header" ]
1765
1766  defines = [ "NET_IMPLEMENTATION" ]
1767
1768  extra_configs = [ "//build/config/compiler:wexit_time_destructors" ]
1769}
1770
1771proto_library("isolation_info_proto") {
1772  sources = [ "base/isolation_info.proto" ]
1773}
1774
1775component("extras") {
1776  sources = [
1777    "extras/sqlite/cookie_crypto_delegate.h",
1778    "extras/sqlite/sqlite_persistent_cookie_store.cc",
1779    "extras/sqlite/sqlite_persistent_cookie_store.h",
1780    "extras/sqlite/sqlite_persistent_shared_dictionary_store.cc",
1781    "extras/sqlite/sqlite_persistent_shared_dictionary_store.h",
1782    "extras/sqlite/sqlite_persistent_store_backend_base.cc",
1783    "extras/sqlite/sqlite_persistent_store_backend_base.h",
1784  ]
1785  defines = [ "IS_NET_EXTRAS_IMPL" ]
1786  configs += [ "//build/config/compiler:wexit_time_destructors" ]
1787  deps = [
1788    ":net",
1789    "//base",
1790    "//sql:sql",
1791  ]
1792  public_deps = [ ":shared_dictionary" ]
1793
1794  if (enable_reporting) {
1795    sources += [
1796      "extras/sqlite/sqlite_persistent_reporting_and_nel_store.cc",
1797      "extras/sqlite/sqlite_persistent_reporting_and_nel_store.h",
1798    ]
1799  }
1800}
1801
1802component("shared_dictionary") {
1803  sources = [
1804    "extras/shared_dictionary/shared_dictionary_info.cc",
1805    "extras/shared_dictionary/shared_dictionary_info.h",
1806    "extras/shared_dictionary/shared_dictionary_isolation_key.cc",
1807    "extras/shared_dictionary/shared_dictionary_isolation_key.h",
1808    "extras/shared_dictionary/shared_dictionary_usage_info.h",
1809  ]
1810  defines = [ "IS_NET_SHARED_DICTIONARY_IMPL" ]
1811  configs += [ "//build/config/compiler:wexit_time_destructors" ]
1812  deps = [
1813    ":net",
1814    "//base",
1815  ]
1816}
1817
1818static_library("preload_decoder") {
1819  sources = [
1820    "extras/preload_data/decoder.cc",
1821    "extras/preload_data/decoder.h",
1822  ]
1823  deps = [ "//base" ]
1824}
1825
1826if (!is_ios) {
1827  executable("dump_cache") {
1828    testonly = true
1829    sources = [
1830      "tools/dump_cache/dump_cache.cc",
1831      "tools/dump_cache/dump_files.cc",
1832      "tools/dump_cache/dump_files.h",
1833    ]
1834
1835    deps = [
1836      ":net",
1837      ":test_support",
1838      "//base",
1839      "//build/win:default_exe_manifest",
1840    ]
1841  }
1842}
1843
1844if (is_ios) {
1845  bundle_data_from_filelist("test_support_bundle_data") {
1846    visibility = [ ":test_support" ]
1847    testonly = true
1848    filelist_name = "data/test_support_bundle_data.filelist"
1849  }
1850}
1851
1852static_library("gtest_util") {
1853  testonly = true
1854  sources = [
1855    "test/gtest_util.h",
1856    "test/scoped_disable_exit_on_dfatal.cc",
1857    "test/scoped_disable_exit_on_dfatal.h",
1858  ]
1859  public_deps = [
1860    "//base",
1861    "//base/test:test_support",
1862    "//net",
1863    "//testing/gmock",
1864    "//testing/gtest",
1865  ]
1866}
1867
1868static_library("test_support") {
1869  testonly = true
1870  sources = [
1871    "base/connection_endpoint_metadata_test_util.cc",
1872    "base/connection_endpoint_metadata_test_util.h",
1873    "base/load_timing_info_test_util.cc",
1874    "base/load_timing_info_test_util.h",
1875    "base/mock_file_stream.cc",
1876    "base/mock_file_stream.h",
1877    "base/mock_network_change_notifier.cc",
1878    "base/mock_network_change_notifier.h",
1879    "base/test_completion_callback.cc",
1880    "base/test_completion_callback.h",
1881    "base/test_data_stream.cc",
1882    "base/test_data_stream.h",
1883    "cert/internal/cert_issuer_source_sync_unittest.h",
1884    "cert/internal/test_helpers.cc",
1885    "cert/internal/test_helpers.h",
1886    "cert/mock_cert_net_fetcher.cc",
1887    "cert/mock_cert_net_fetcher.h",
1888    "cert/mock_cert_verifier.cc",
1889    "cert/mock_cert_verifier.h",
1890    "cert/mock_client_cert_verifier.cc",
1891    "cert/mock_client_cert_verifier.h",
1892    "cookies/canonical_cookie_test_helpers.h",
1893    "cookies/cookie_change_dispatcher_test_helpers.cc",
1894    "cookies/cookie_change_dispatcher_test_helpers.h",
1895    "cookies/cookie_monster_store_test.cc",
1896    "cookies/cookie_monster_store_test.h",
1897    "cookies/cookie_store_change_unittest.h",
1898    "cookies/cookie_store_test_callbacks.cc",
1899    "cookies/cookie_store_test_callbacks.h",
1900    "cookies/cookie_store_test_helpers.cc",
1901    "cookies/cookie_store_test_helpers.h",
1902    "cookies/cookie_store_unittest.h",
1903    "cookies/test_cookie_access_delegate.cc",
1904    "cookies/test_cookie_access_delegate.h",
1905    "disk_cache/disk_cache_test_base.cc",
1906    "disk_cache/disk_cache_test_base.h",
1907    "disk_cache/disk_cache_test_util.cc",
1908    "disk_cache/disk_cache_test_util.h",
1909    "disk_cache/mock/mock_backend_impl.cc",
1910    "disk_cache/mock/mock_backend_impl.h",
1911    "disk_cache/mock/mock_entry_impl.cc",
1912    "disk_cache/mock/mock_entry_impl.h",
1913    "filter/filter_source_stream_test_util.cc",
1914    "filter/filter_source_stream_test_util.h",
1915    "filter/mock_source_stream.cc",
1916    "filter/mock_source_stream.h",
1917    "http/http_response_headers_test_util.cc",
1918    "http/http_response_headers_test_util.h",
1919    "http/http_stream_factory_test_util.cc",
1920    "http/http_stream_factory_test_util.h",
1921    "http/http_transaction_test_util.cc",
1922    "http/http_transaction_test_util.h",
1923    "http/mock_http_cache.cc",
1924    "http/mock_http_cache.h",
1925    "http/transport_security_state_test_util.cc",
1926    "http/transport_security_state_test_util.h",
1927    "log/test_net_log.cc",
1928    "log/test_net_log.h",
1929    "log/test_net_log_util.cc",
1930    "log/test_net_log_util.h",
1931    "nqe/network_quality_estimator_test_util.cc",
1932    "nqe/network_quality_estimator_test_util.h",
1933    "proxy_resolution/mock_pac_file_fetcher.cc",
1934    "proxy_resolution/mock_pac_file_fetcher.h",
1935    "proxy_resolution/mock_proxy_resolver.cc",
1936    "proxy_resolution/mock_proxy_resolver.h",
1937    "proxy_resolution/proxy_config_service_common_unittest.cc",
1938    "proxy_resolution/proxy_config_service_common_unittest.h",
1939    "socket/read_buffering_stream_socket.cc",
1940    "socket/read_buffering_stream_socket.h",
1941    "socket/socket_test_util.cc",
1942    "socket/socket_test_util.h",
1943    "socket/transport_client_socket_test_util.cc",
1944    "socket/transport_client_socket_test_util.h",
1945    "spdy/spdy_test_util_common.cc",
1946    "spdy/spdy_test_util_common.h",
1947    "ssl/client_cert_identity_test_util.cc",
1948    "ssl/client_cert_identity_test_util.h",
1949    "ssl/ssl_private_key_test_util.cc",
1950    "ssl/ssl_private_key_test_util.h",
1951    "ssl/test_ssl_config_service.cc",
1952    "ssl/test_ssl_config_service.h",
1953    "ssl/test_ssl_private_key.cc",
1954    "ssl/test_ssl_private_key.h",
1955    "test/cert_builder.cc",
1956    "test/cert_builder.h",
1957    "test/cert_test_util.cc",
1958    "test/cert_test_util.h",
1959    "test/ct_test_util.cc",
1960    "test/ct_test_util.h",
1961    "test/embedded_test_server/connection_tracker.cc",
1962    "test/embedded_test_server/connection_tracker.h",
1963    "test/embedded_test_server/controllable_http_response.cc",
1964    "test/embedded_test_server/controllable_http_response.h",
1965    "test/embedded_test_server/default_handlers.cc",
1966    "test/embedded_test_server/default_handlers.h",
1967    "test/embedded_test_server/embedded_test_server.cc",
1968    "test/embedded_test_server/embedded_test_server.h",
1969    "test/embedded_test_server/embedded_test_server_connection_listener.cc",
1970    "test/embedded_test_server/embedded_test_server_connection_listener.h",
1971    "test/embedded_test_server/http1_connection.cc",
1972    "test/embedded_test_server/http1_connection.h",
1973    "test/embedded_test_server/http2_connection.cc",
1974    "test/embedded_test_server/http2_connection.h",
1975    "test/embedded_test_server/http_connection.cc",
1976    "test/embedded_test_server/http_connection.h",
1977    "test/embedded_test_server/http_request.cc",
1978    "test/embedded_test_server/http_request.h",
1979    "test/embedded_test_server/http_response.cc",
1980    "test/embedded_test_server/http_response.h",
1981    "test/embedded_test_server/request_handler_util.cc",
1982    "test/embedded_test_server/request_handler_util.h",
1983    "test/embedded_test_server/simple_connection_listener.cc",
1984    "test/embedded_test_server/simple_connection_listener.h",
1985    "test/event_waiter.h",
1986    "test/key_util.cc",
1987    "test/key_util.h",
1988    "test/net_test_suite.cc",
1989    "test/net_test_suite.h",
1990    "test/quic_simple_test_server.cc",
1991    "test/quic_simple_test_server.h",
1992    "test/revocation_builder.cc",
1993    "test/revocation_builder.h",
1994    "test/ssl_test_util.cc",
1995    "test/ssl_test_util.h",
1996    "test/test_certificate_data.h",
1997    "test/test_data_directory.cc",
1998    "test/test_data_directory.h",
1999    "test/test_doh_server.cc",
2000    "test/test_doh_server.h",
2001    "test/test_with_task_environment.h",
2002    "test/url_request/ssl_certificate_error_job.cc",
2003    "test/url_request/ssl_certificate_error_job.h",
2004    "test/url_request/url_request_failed_job.cc",
2005    "test/url_request/url_request_failed_job.h",
2006    "test/url_request/url_request_hanging_read_job.cc",
2007    "test/url_request/url_request_hanging_read_job.h",
2008    "test/url_request/url_request_mock_data_job.cc",
2009    "test/url_request/url_request_mock_data_job.h",
2010    "url_request/url_request_test_job.cc",
2011    "url_request/url_request_test_job.h",
2012    "url_request/url_request_test_util.cc",
2013    "url_request/url_request_test_util.h",
2014  ]
2015
2016  if (is_linux || is_chromeos || is_android) {
2017    sources += [
2018      "base/address_tracker_linux_test_util.cc",
2019      "base/address_tracker_linux_test_util.h",
2020    ]
2021  }
2022
2023  configs += [ "//build/config:precompiled_headers" ]
2024
2025  public_deps = [
2026    ":cronet_buildflags",
2027    ":gtest_util",
2028    "//base",
2029    "//base/test:test_support",
2030    "//crypto",
2031    "//net",
2032    "//net/dns:test_support",
2033    "//net/tools/tld_cleanup",
2034    "//net/traffic_annotation:test_support",
2035    "//testing/gmock",
2036    "//testing/gtest",
2037    "//url",
2038  ]
2039
2040  deps = [
2041    ":quic_test_flags_utils",
2042    ":simple_quic_tools",
2043    "//net/http:transport_security_state_unittest_data_default",
2044    "//third_party/zlib",
2045  ]
2046
2047  allow_circular_includes_from = [ "//net/dns:test_support" ]
2048
2049  # Data dependencies shared with suites other than net_unittests.
2050  data = [
2051    "data/cert_net_fetcher_impl_unittest/",
2052    "data/dns/",
2053    "data/ov_name_constraints/",
2054    "data/parse_certificate_unittest/",
2055    "data/ssl/",
2056    "data/url_request_unittest/",
2057    "data/websocket/",
2058  ]
2059
2060  if (is_mac) {
2061    frameworks = [ "Security.framework" ]
2062  }
2063
2064  if (is_ios) {
2065    deps += [ ":test_support_bundle_data" ]
2066  }
2067
2068  if (use_nss_certs) {
2069    configs += [ "//build/config/linux/nss" ]
2070  }
2071
2072  if (enable_websockets || (is_cronet_build && !is_ios)) {
2073    sources += [
2074      "test/spawned_test_server/base_test_server.cc",
2075      "test/spawned_test_server/base_test_server.h",
2076      "test/spawned_test_server/spawned_test_server.h",
2077    ]
2078  }
2079
2080  public_configs = [ ":net_test_config" ]
2081
2082  if (use_remote_test_server) {
2083    sources += [
2084      "test/spawned_test_server/remote_test_server.cc",
2085      "test/spawned_test_server/remote_test_server.h",
2086      "test/spawned_test_server/remote_test_server_spawner_request.cc",
2087      "test/spawned_test_server/remote_test_server_spawner_request.h",
2088    ]
2089  } else if (!is_ios) {
2090    sources += [
2091      "test/spawned_test_server/local_test_server.cc",
2092      "test/spawned_test_server/local_test_server.h",
2093    ]
2094    if (is_win) {
2095      sources += [ "test/spawned_test_server/local_test_server_win.cc" ]
2096    } else if (is_posix || is_fuchsia) {
2097      sources += [ "test/spawned_test_server/local_test_server_posix.cc" ]
2098    }
2099  }
2100
2101  if (enable_python_utils) {
2102    sources += [
2103      "test/python_utils.cc",
2104      "test/python_utils.h",
2105    ]
2106  }
2107
2108  if (use_nss_certs) {
2109    sources += [ "test/cert_test_util_nss.cc" ]
2110  }
2111
2112  if (!disable_file_support) {
2113    sources += [
2114      "test/url_request/url_request_mock_http_job.cc",
2115      "test/url_request/url_request_mock_http_job.h",
2116      "test/url_request/url_request_test_job_backed_by_file.cc",
2117      "test/url_request/url_request_test_job_backed_by_file.h",
2118    ]
2119  }
2120
2121  if (enable_reporting) {
2122    sources += [
2123      "network_error_logging/mock_persistent_nel_store.cc",
2124      "network_error_logging/mock_persistent_nel_store.h",
2125      "network_error_logging/network_error_logging_test_util.cc",
2126      "network_error_logging/network_error_logging_test_util.h",
2127      "reporting/mock_persistent_reporting_store.cc",
2128      "reporting/mock_persistent_reporting_store.h",
2129      "reporting/reporting_test_util.cc",
2130      "reporting/reporting_test_util.h",
2131    ]
2132  }
2133}
2134
2135if (!is_ios && !is_android) {
2136  executable("cert_verify_tool") {
2137    testonly = true
2138    sources = [
2139      "tools/cert_verify_tool/cert_verify_tool.cc",
2140      "tools/cert_verify_tool/cert_verify_tool_util.cc",
2141      "tools/cert_verify_tool/cert_verify_tool_util.h",
2142      "tools/cert_verify_tool/verify_using_cert_verify_proc.cc",
2143      "tools/cert_verify_tool/verify_using_cert_verify_proc.h",
2144      "tools/cert_verify_tool/verify_using_path_builder.cc",
2145      "tools/cert_verify_tool/verify_using_path_builder.h",
2146    ]
2147
2148    deps = [
2149      ":net",
2150      ":test_support",
2151      "//base",
2152      "//build/win:default_exe_manifest",
2153    ]
2154
2155    if (is_mac) {
2156      frameworks = [ "Security.framework" ]
2157    }
2158  }
2159
2160  proto_library("cert_verify_comparison_tool_proto") {
2161    sources = [ "tools/cert_verify_tool/dumper.proto" ]
2162
2163    visibility = [ ":cert_verify_comparison_tool" ]
2164  }
2165
2166  executable("cert_verify_comparison_tool") {
2167    testonly = true
2168    sources = [
2169      "tools/cert_verify_tool/cert_verify_comparision_tool.cc",
2170      "tools/cert_verify_tool/cert_verify_tool_util.cc",
2171      "tools/cert_verify_tool/cert_verify_tool_util.h",
2172      "tools/cert_verify_tool/verify_using_cert_verify_proc.cc",
2173      "tools/cert_verify_tool/verify_using_cert_verify_proc.h",
2174    ]
2175
2176    deps = [
2177      ":cert_verify_comparison_tool_proto",
2178      ":net",
2179      ":test_support",
2180      "//base",
2181      "//build/win:default_exe_manifest",
2182    ]
2183
2184    if (is_mac) {
2185      frameworks = [ "Security.framework" ]
2186    }
2187  }
2188
2189  executable("crash_cache") {
2190    testonly = true
2191    sources = [ "tools/crash_cache/crash_cache.cc" ]
2192
2193    deps = [
2194      ":net",
2195      ":test_support",
2196      "//base",
2197      "//build/win:default_exe_manifest",
2198    ]
2199  }
2200
2201  executable("hpack_example_generator") {
2202    testonly = true
2203    sources = [ "spdy/fuzzing/hpack_example_generator.cc" ]
2204
2205    deps = [
2206      ":net",
2207      ":spdy_test_tools",
2208      "//base",
2209      "//build/win:default_exe_manifest",
2210    ]
2211  }
2212
2213  executable("net_watcher") {
2214    testonly = true
2215    sources = [ "tools/net_watcher/net_watcher.cc" ]
2216    deps = [
2217      ":net",
2218      "//base",
2219      "//build:chromeos_buildflags",
2220      "//build/win:default_exe_manifest",
2221    ]
2222  }
2223
2224  executable("run_testserver") {
2225    testonly = true
2226    sources = [ "tools/testserver/run_testserver.cc" ]
2227    deps = [
2228      ":test_support",
2229      "//base",
2230      "//base/test:test_support",
2231      "//build/win:default_exe_manifest",
2232      "//testing/gtest",
2233    ]
2234  }
2235
2236  executable("stress_cache") {
2237    testonly = true
2238    sources = [ "tools/stress_cache/stress_cache.cc" ]
2239
2240    deps = [
2241      ":net",
2242      ":test_support",
2243      "//base",
2244      "//build/win:default_exe_manifest",
2245    ]
2246  }
2247
2248  executable("tld_cleanup") {
2249    sources = [ "tools/tld_cleanup/tld_cleanup.cc" ]
2250
2251    deps = [
2252      "//base",
2253      "//base:i18n",
2254      "//build/win:default_exe_manifest",
2255      "//net/tools/tld_cleanup",
2256    ]
2257  }
2258}
2259
2260if (use_external_gssapi) {
2261  # In order for the tests to be reliable, these two targets cannot depend on a
2262  # valid GSSAPI library. This is easy to achieve on most platforms. But on
2263  # macOS care must be taken to not depend directly or indirectly on
2264  # GSS.framework. This is suprisingly easy to get wrong since
2265  # Security.framework is such a common dependency and it indirectly depends on
2266  # GSS.
2267  shared_library("test_gssapi") {
2268    testonly = true
2269    sources = [
2270      "tools/gssapi/gss_import_name.cc",
2271      "tools/gssapi/gss_methods.cc",
2272      "tools/gssapi/gss_types.h",
2273    ]
2274  }
2275
2276  shared_library("test_badgssapi") {
2277    testonly = true
2278    sources = [
2279      "tools/gssapi/gss_methods.cc",
2280      "tools/gssapi/gss_types.h",
2281    ]
2282  }
2283}
2284
2285if (is_linux || is_chromeos || is_mac) {
2286  executable("cachetool") {
2287    testonly = true
2288    sources = [ "tools/cachetool/cachetool.cc" ]
2289    deps = [
2290      ":net",
2291      ":test_support",
2292      "//base",
2293    ]
2294  }
2295
2296  executable("content_decoder_tool") {
2297    testonly = true
2298    sources = [
2299      "tools/content_decoder_tool/content_decoder_tool.cc",
2300      "tools/content_decoder_tool/content_decoder_tool.h",
2301      "tools/content_decoder_tool/content_decoder_tool_bin.cc",
2302    ]
2303    deps = [
2304      ":net",
2305      ":test_support",
2306      "//base",
2307      "//url",
2308    ]
2309  }
2310}
2311
2312if (is_android) {
2313  generate_jni("net_jni_headers") {
2314    sources = [
2315      "android/java/src/org/chromium/net/AndroidCertVerifyResult.java",
2316      "android/java/src/org/chromium/net/AndroidKeyStore.java",
2317      "android/java/src/org/chromium/net/AndroidNetworkLibrary.java",
2318      "android/java/src/org/chromium/net/AndroidTrafficStats.java",
2319      "android/java/src/org/chromium/net/DnsStatus.java",
2320      "android/java/src/org/chromium/net/GURLUtils.java",
2321      "android/java/src/org/chromium/net/HttpNegotiateAuthenticator.java",
2322      "android/java/src/org/chromium/net/HttpUtil.java",
2323      "android/java/src/org/chromium/net/NetStringUtil.java",
2324      "android/java/src/org/chromium/net/NetworkActiveNotifier.java",
2325      "android/java/src/org/chromium/net/NetworkChangeNotifier.java",
2326      "android/java/src/org/chromium/net/ProxyChangeListener.java",
2327      "android/java/src/org/chromium/net/X509Util.java",
2328    ]
2329  }
2330}
2331
2332if (is_android || is_linux || is_chromeos) {
2333  executable("disk_cache_memory_test") {
2334    testonly = true
2335    sources = [ "tools/disk_cache_memory_test/disk_cache_memory_test.cc" ]
2336    deps = [
2337      ":net",
2338      "//base",
2339    ]
2340  }
2341}
2342
2343source_set("spdy_test_tools") {
2344  testonly = true
2345  sources = [
2346    "spdy/fuzzing/hpack_fuzz_util.cc",
2347    "spdy/fuzzing/hpack_fuzz_util.h",
2348  ]
2349  deps = [
2350    ":net",
2351    "//base",
2352    "//testing/gmock",
2353    "//testing/gtest",
2354  ]
2355}
2356
2357source_set("quic_test_flags_utils") {
2358  testonly = true
2359  sources = [
2360    "quic/platform/impl/quic_test_flags_utils.cc",
2361    "quic/platform/impl/quic_test_flags_utils.h",
2362  ]
2363  deps = [ ":net" ]
2364}
2365
2366source_set("quic_test_tools") {
2367  testonly = true
2368  sources = [
2369    "quic/crypto_test_utils_chromium.cc",
2370    "quic/crypto_test_utils_chromium.h",
2371    "quic/mock_crypto_client_stream.cc",
2372    "quic/mock_crypto_client_stream.h",
2373    "quic/mock_crypto_client_stream_factory.cc",
2374    "quic/mock_crypto_client_stream_factory.h",
2375    "quic/mock_decrypter.cc",
2376    "quic/mock_decrypter.h",
2377    "quic/mock_encrypter.cc",
2378    "quic/mock_encrypter.h",
2379    "quic/mock_quic_context.cc",
2380    "quic/mock_quic_context.h",
2381    "quic/test_task_runner.cc",
2382    "quic/test_task_runner.h",
2383  ]
2384  deps = [
2385    ":net",
2386    ":simple_quic_tools",
2387    ":test_support",
2388    "//base",
2389    "//crypto:test_support",
2390    "//testing/gmock",
2391    "//testing/gtest",
2392    "//third_party/boringssl",
2393    "//third_party/protobuf:protobuf_lite",
2394    "//third_party/quic_trace:quic_trace_proto",
2395  ]
2396  public_deps = [
2397    ":quic_test_flags_utils",
2398    "//net/third_party/quiche:quiche_test_support",
2399  ]
2400}
2401
2402source_set("simple_quic_tools") {
2403  testonly = true
2404  sources = [
2405    "tools/quic/quic_client_message_loop_network_helper.cc",
2406    "tools/quic/quic_client_message_loop_network_helper.h",
2407    "tools/quic/quic_simple_client.cc",
2408    "tools/quic/quic_simple_client.h",
2409    "tools/quic/quic_simple_server.cc",
2410    "tools/quic/quic_simple_server.h",
2411    "tools/quic/quic_simple_server_packet_writer.cc",
2412    "tools/quic/quic_simple_server_packet_writer.h",
2413    "tools/quic/quic_simple_server_session_helper.cc",
2414    "tools/quic/quic_simple_server_session_helper.h",
2415    "tools/quic/quic_simple_server_socket.cc",
2416    "tools/quic/quic_simple_server_socket.h",
2417    "tools/quic/synchronous_host_resolver.cc",
2418    "tools/quic/synchronous_host_resolver.h",
2419  ]
2420  deps = [
2421    ":net",
2422    "//base",
2423    "//net/third_party/quiche:quiche_tool_support",
2424    "//third_party/protobuf:protobuf_lite",
2425    "//url",
2426  ]
2427  public_deps = [ "//net/third_party/quiche:quiche_tool_support" ]
2428}
2429
2430if (!is_ios) {
2431  executable("quic_client") {
2432    testonly = true
2433    sources = [ "tools/quic/quic_simple_client_bin.cc" ]
2434    deps = [
2435      ":net",
2436      ":simple_quic_tools",
2437      "//base",
2438      "//build/win:default_exe_manifest",
2439      "//net/third_party/quiche:quic_client_core",
2440      "//url",
2441    ]
2442  }
2443  executable("quic_server") {
2444    testonly = true
2445    sources = [
2446      "tools/quic/quic_simple_server_backend_factory.cc",
2447      "tools/quic/quic_simple_server_backend_factory.h",
2448      "tools/quic/quic_simple_server_bin.cc",
2449    ]
2450    deps = [
2451      ":net",
2452      ":simple_quic_tools",
2453      "//base",
2454      "//build/win:default_exe_manifest",
2455      "//net/third_party/quiche:quic_server_core",
2456      "//third_party/boringssl",
2457      "//third_party/protobuf:protobuf_lite",
2458    ]
2459  }
2460  executable("crypto_message_printer") {
2461    testonly = true
2462    sources = [ "tools/quic/crypto_message_printer_bin.cc" ]
2463    deps = [
2464      ":net",
2465      "//base",
2466      "//build/win:default_exe_manifest",
2467    ]
2468  }
2469}
2470
2471if (is_ios) {
2472  bundle_data_from_filelist("net_test_bundle_data") {
2473    testonly = true
2474    filelist_name = "data/test_bundle_data.filelist"
2475  }
2476}
2477
2478if (!is_cronet_build) {
2479  test("net_fuzztests") {
2480    sources = [
2481      "cert/x509_certificate_fuzztest.cc",
2482      "http/http_cookie_indices_fuzztest.cc",
2483    ]
2484
2485    fuzztests = [
2486      "CookieIndicesFuzzTest.FuzzParseFromHeader",
2487      "X509CertificateFuzzTest.FuzzCreateFromDERCertChain",
2488    ]
2489
2490    deps = [
2491      ":net",
2492      "//third_party/fuzztest:fuzztest_gtest_main",
2493    ]
2494  }
2495}
2496
2497test("net_unittests") {
2498  sources = [
2499    "base/address_family_unittest.cc",
2500    "base/address_list_unittest.cc",
2501    "base/backoff_entry_serializer_unittest.cc",
2502    "base/backoff_entry_unittest.cc",
2503    "base/chunked_upload_data_stream_unittest.cc",
2504    "base/data_url_unittest.cc",
2505    "base/datagram_buffer_unittest.cc",
2506    "base/elements_upload_data_stream_unittest.cc",
2507    "base/expiring_cache_unittest.cc",
2508    "base/file_stream_unittest.cc",
2509    "base/filename_util_unittest.cc",
2510    "base/host_mapping_rules_unittest.cc",
2511    "base/host_port_pair_unittest.cc",
2512    "base/interval_test.cc",
2513    "base/ip_address_unittest.cc",
2514    "base/ip_endpoint_unittest.cc",
2515    "base/isolation_info_unittest.cc",
2516    "base/lookup_string_in_fixed_set_unittest.cc",
2517    "base/mime_sniffer_unittest.cc",
2518    "base/mime_util_unittest.cc",
2519    "base/net_errors_unittest.cc",
2520    "base/net_string_util_unittest.cc",
2521    "base/network_activity_monitor_unittest.cc",
2522    "base/network_anonymization_key_unittest.cc",
2523    "base/network_change_notifier_unittest.cc",
2524    "base/network_delegate_unittest.cc",
2525    "base/network_interfaces_unittest.cc",
2526    "base/network_isolation_key_unittest.cc",
2527    "base/parse_number_unittest.cc",
2528    "base/port_util_unittest.cc",
2529    "base/prioritized_dispatcher_unittest.cc",
2530    "base/prioritized_task_runner_unittest.cc",
2531    "base/priority_queue_unittest.cc",
2532    "base/proxy_chain_unittest.cc",
2533    "base/proxy_server_unittest.cc",
2534    "base/proxy_string_util_unittest.cc",
2535    "base/registry_controlled_domains/registry_controlled_domain_unittest.cc",
2536    "base/scheme_host_port_matcher_rule_unittest.cc",
2537    "base/scheme_host_port_matcher_unittest.cc",
2538    "base/schemeful_site_unittest.cc",
2539    "base/test_completion_callback_unittest.cc",
2540    "base/test_proxy_delegate.cc",
2541    "base/test_proxy_delegate.h",
2542    "base/upload_bytes_element_reader_unittest.cc",
2543    "base/upload_file_element_reader_unittest.cc",
2544    "base/url_search_params_unittest.cc",
2545    "base/url_util_unittest.cc",
2546    "cert/caching_cert_verifier_unittest.cc",
2547    "cert/cert_database_unittest.cc",
2548    "cert/cert_verifier_unittest.cc",
2549    "cert/cert_verify_proc_builtin_unittest.cc",
2550    "cert/cert_verify_proc_unittest.cc",
2551    "cert/coalescing_cert_verifier_unittest.cc",
2552    "cert/crl_set_unittest.cc",
2553    "cert/ct_log_response_parser_unittest.cc",
2554    "cert/ct_log_verifier_unittest.cc",
2555    "cert/ct_objects_extractor_unittest.cc",
2556    "cert/ct_serialization_unittest.cc",
2557    "cert/ev_root_ca_metadata_unittest.cc",
2558    "cert/internal/cert_issuer_source_aia_unittest.cc",
2559    "cert/internal/cert_issuer_source_sync_unittest.cc",
2560    "cert/internal/revocation_checker_unittest.cc",
2561    "cert/internal/system_trust_store_unittest.cc",
2562    "cert/known_roots_unittest.cc",
2563    "cert/merkle_audit_proof_unittest.cc",
2564    "cert/merkle_tree_leaf_unittest.cc",
2565    "cert/multi_log_ct_verifier_unittest.cc",
2566    "cert/multi_threaded_cert_verifier_unittest.cc",
2567    "cert/signed_certificate_timestamp_unittest.cc",
2568    "cert/symantec_certs_unittest.cc",
2569    "cert/test_root_certs_unittest.cc",
2570    "cert/time_conversions_unittest.cc",
2571    "cert/x509_cert_types_unittest.cc",
2572    "cert/x509_certificate_unittest.cc",
2573    "cert/x509_util_unittest.cc",
2574    "cert_net/cert_net_fetcher_url_request_unittest.cc",
2575    "cookies/canonical_cookie_unittest.cc",
2576    "cookies/cookie_constants_unittest.cc",
2577    "cookies/cookie_deletion_info_unittest.cc",
2578    "cookies/cookie_inclusion_status_unittest.cc",
2579    "cookies/cookie_monster_unittest.cc",
2580    "cookies/cookie_options_unittest.cc",
2581    "cookies/cookie_partition_key_collection_unittest.cc",
2582    "cookies/cookie_partition_key_unittest.cc",
2583    "cookies/cookie_util_unittest.cc",
2584    "cookies/parsed_cookie_unittest.cc",
2585    "cookies/site_for_cookies_unittest.cc",
2586    "cookies/static_cookie_policy_unittest.cc",
2587    "disk_cache/backend_cleanup_tracker_unittest.cc",
2588    "disk_cache/backend_unittest.cc",
2589    "disk_cache/blockfile/addr_unittest.cc",
2590    "disk_cache/blockfile/bitmap_unittest.cc",
2591    "disk_cache/blockfile/block_files_unittest.cc",
2592    "disk_cache/blockfile/mapped_file_unittest.cc",
2593    "disk_cache/blockfile/stats_unittest.cc",
2594    "disk_cache/blockfile/storage_block_unittest.cc",
2595    "disk_cache/cache_util_unittest.cc",
2596    "disk_cache/entry_unittest.cc",
2597    "disk_cache/simple/simple_file_enumerator_unittest.cc",
2598    "disk_cache/simple/simple_file_tracker_unittest.cc",
2599    "disk_cache/simple/simple_index_file_unittest.cc",
2600    "disk_cache/simple/simple_index_unittest.cc",
2601    "disk_cache/simple/simple_test_util.cc",
2602    "disk_cache/simple/simple_test_util.h",
2603    "disk_cache/simple/simple_util_unittest.cc",
2604    "disk_cache/simple/simple_version_upgrade_unittest.cc",
2605    "filter/filter_source_stream_unittest.cc",
2606    "filter/gzip_source_stream_unittest.cc",
2607    "first_party_sets/addition_overlaps_union_find_unittest.cc",
2608    "first_party_sets/first_party_set_entry_override_unittest.cc",
2609    "first_party_sets/first_party_sets_cache_filter_unittest.cc",
2610    "first_party_sets/first_party_sets_context_config_unittest.cc",
2611    "first_party_sets/global_first_party_sets_unittest.cc",
2612    "first_party_sets/local_set_declaration_unittest.cc",
2613    "first_party_sets/sets_mutation_unittest.cc",
2614    "http/alternative_service_unittest.cc",
2615    "http/bidirectional_stream_unittest.cc",
2616    "http/broken_alternative_services_unittest.cc",
2617    "http/http_auth_cache_unittest.cc",
2618    "http/http_auth_challenge_tokenizer_unittest.cc",
2619    "http/http_auth_controller_unittest.cc",
2620    "http/http_auth_filter_unittest.cc",
2621    "http/http_auth_handler_basic_unittest.cc",
2622    "http/http_auth_handler_digest_unittest.cc",
2623    "http/http_auth_handler_factory_unittest.cc",
2624    "http/http_auth_handler_mock.cc",
2625    "http/http_auth_handler_mock.h",
2626    "http/http_auth_handler_unittest.cc",
2627    "http/http_auth_multi_round_parse_unittest.cc",
2628    "http/http_auth_preferences_unittest.cc",
2629    "http/http_auth_unittest.cc",
2630    "http/http_basic_state_unittest.cc",
2631    "http/http_byte_range_unittest.cc",
2632    "http/http_cache_unittest.cc",
2633    "http/http_cache_writers_unittest.cc",
2634    "http/http_chunked_decoder_unittest.cc",
2635    "http/http_content_disposition_unittest.cc",
2636    "http/http_cookie_indices_unittest.cc",
2637    "http/http_log_util_unittest.cc",
2638    "http/http_network_layer_unittest.cc",
2639    "http/http_network_transaction_unittest.cc",
2640    "http/http_no_vary_search_data_unittest.cc",
2641    "http/http_proxy_client_socket_unittest.cc",
2642    "http/http_proxy_connect_job_unittest.cc",
2643    "http/http_request_headers_unittest.cc",
2644    "http/http_request_info_unittest.cc",
2645    "http/http_response_body_drainer_unittest.cc",
2646    "http/http_response_headers_unittest.cc",
2647    "http/http_response_info_unittest.cc",
2648    "http/http_security_headers_unittest.cc",
2649    "http/http_server_properties_manager_unittest.cc",
2650    "http/http_server_properties_unittest.cc",
2651    "http/http_status_code_unittest.cc",
2652    "http/http_stream_factory_job_controller_unittest.cc",
2653    "http/http_stream_factory_unittest.cc",
2654    "http/http_stream_parser_unittest.cc",
2655    "http/http_stream_request_unittest.cc",
2656    "http/http_transaction_test_util_unittest.cc",
2657    "http/http_util_unittest.cc",
2658    "http/http_vary_data_unittest.cc",
2659    "http/mock_allow_http_auth_preferences.cc",
2660    "http/mock_allow_http_auth_preferences.h",
2661    "http/test_upload_data_stream_not_allow_http1.cc",
2662    "http/test_upload_data_stream_not_allow_http1.h",
2663    "http/transport_security_persister_unittest.cc",
2664    "http/transport_security_state_unittest.cc",
2665    "http/url_security_manager_unittest.cc",
2666    "log/file_net_log_observer_unittest.cc",
2667    "log/net_log_capture_mode_unittest.cc",
2668    "log/net_log_unittest.cc",
2669    "log/net_log_util_unittest.cc",
2670    "log/net_log_values_unittest.cc",
2671    "nqe/effective_connection_type_unittest.cc",
2672    "nqe/event_creator_unittest.cc",
2673    "nqe/network_id_unittest.cc",
2674    "nqe/network_qualities_prefs_manager_unittest.cc",
2675    "nqe/network_quality_estimator_params_unittest.cc",
2676    "nqe/network_quality_estimator_unittest.cc",
2677    "nqe/network_quality_estimator_util_unittest.cc",
2678    "nqe/network_quality_store_unittest.cc",
2679    "nqe/observation_buffer_unittest.cc",
2680    "nqe/socket_watcher_unittest.cc",
2681    "nqe/throughput_analyzer_unittest.cc",
2682    "proxy_resolution/configured_proxy_resolution_service_unittest.cc",
2683    "proxy_resolution/multi_threaded_proxy_resolver_unittest.cc",
2684    "proxy_resolution/network_delegate_error_observer_unittest.cc",
2685    "proxy_resolution/pac_file_decider_unittest.cc",
2686    "proxy_resolution/pac_file_fetcher_impl_unittest.cc",
2687    "proxy_resolution/proxy_bypass_rules_unittest.cc",
2688    "proxy_resolution/proxy_config_unittest.cc",
2689    "proxy_resolution/proxy_info_unittest.cc",
2690    "proxy_resolution/proxy_list_unittest.cc",
2691    "quic/bidirectional_stream_quic_impl_unittest.cc",
2692    "quic/crypto/proof_test_chromium.cc",
2693    "quic/crypto/proof_verifier_chromium_test.cc",
2694    "quic/dedicated_web_transport_http3_client_test.cc",
2695    "quic/mock_quic_data.cc",
2696    "quic/mock_quic_data.h",
2697    "quic/network_connection_unittest.cc",
2698    "quic/platform/impl/quic_chromium_clock_test.cc",
2699    "quic/properties_based_quic_server_info_test.cc",
2700    "quic/quic_address_mismatch_test.cc",
2701    "quic/quic_chromium_alarm_factory_test.cc",
2702    "quic/quic_chromium_client_session_peer.cc",
2703    "quic/quic_chromium_client_session_peer.h",
2704    "quic/quic_chromium_client_session_test.cc",
2705    "quic/quic_chromium_client_stream_test.cc",
2706    "quic/quic_chromium_connection_helper_test.cc",
2707    "quic/quic_clock_skew_detector_test.cc",
2708    "quic/quic_end_to_end_unittest.cc",
2709    "quic/quic_http_stream_test.cc",
2710    "quic/quic_http_utils_test.cc",
2711    "quic/quic_network_transaction_unittest.cc",
2712    "quic/quic_proxy_client_socket_test_base.cc",
2713    "quic/quic_proxy_client_socket_test_base.h",
2714    "quic/quic_proxy_client_socket_unittest.cc",
2715    "quic/quic_proxy_datagram_client_socket_unittest.cc",
2716    "quic/quic_session_key_unittest.cc",
2717    "quic/quic_session_pool_peer.cc",
2718    "quic/quic_session_pool_peer.h",
2719    "quic/quic_session_pool_proxy_job_unittest.cc",
2720    "quic/quic_session_pool_test.cc",
2721    "quic/quic_session_pool_test_base.cc",
2722    "quic/quic_session_pool_test_base.h",
2723    "quic/quic_test_packet_maker.cc",
2724    "quic/quic_test_packet_maker.h",
2725    "quic/quic_test_packet_printer.cc",
2726    "quic/quic_test_packet_printer.h",
2727    "quic/set_quic_flag_test.cc",
2728    "quic/test_quic_crypto_client_config_handle.cc",
2729    "quic/test_quic_crypto_client_config_handle.h",
2730    "socket/client_socket_pool_base_unittest.cc",
2731    "socket/client_socket_pool_unittest.cc",
2732    "socket/connect_job_factory_unittest.cc",
2733    "socket/connect_job_params_factory_unittest.cc",
2734    "socket/connect_job_test_util.cc",
2735    "socket/connect_job_test_util.h",
2736    "socket/connect_job_unittest.cc",
2737    "socket/mock_client_socket_pool_manager.cc",
2738    "socket/mock_client_socket_pool_manager.h",
2739    "socket/sequenced_socket_data_unittest.cc",
2740    "socket/socket_bio_adapter_unittest.cc",
2741    "socket/socket_tag_unittest.cc",
2742    "socket/socks5_client_socket_unittest.cc",
2743    "socket/socks_client_socket_unittest.cc",
2744    "socket/socks_connect_job_unittest.cc",
2745    "socket/ssl_client_socket_unittest.cc",
2746    "socket/ssl_connect_job_unittest.cc",
2747    "socket/ssl_server_socket_unittest.cc",
2748    "socket/tcp_client_socket_unittest.cc",
2749    "socket/tcp_server_socket_unittest.cc",
2750    "socket/tcp_socket_unittest.cc",
2751    "socket/transport_client_socket_pool_test_util.cc",
2752    "socket/transport_client_socket_pool_test_util.h",
2753    "socket/transport_client_socket_pool_unittest.cc",
2754    "socket/transport_client_socket_unittest.cc",
2755    "socket/transport_connect_job_unittest.cc",
2756    "socket/udp_socket_unittest.cc",
2757    "socket/websocket_endpoint_lock_manager_unittest.cc",
2758    "socket/websocket_transport_client_socket_pool_unittest.cc",
2759    "spdy/alps_decoder_test.cc",
2760    "spdy/bidirectional_stream_spdy_impl_unittest.cc",
2761    "spdy/buffered_spdy_framer_unittest.cc",
2762    "spdy/fuzzing/hpack_fuzz_util_test.cc",
2763    "spdy/header_coalescer_test.cc",
2764    "spdy/http2_priority_dependencies_unittest.cc",
2765    "spdy/spdy_buffer_unittest.cc",
2766    "spdy/spdy_http_stream_unittest.cc",
2767    "spdy/spdy_http_utils_unittest.cc",
2768    "spdy/spdy_log_util_unittest.cc",
2769    "spdy/spdy_network_transaction_unittest.cc",
2770    "spdy/spdy_proxy_client_socket_unittest.cc",
2771    "spdy/spdy_read_queue_unittest.cc",
2772    "spdy/spdy_session_key_unittest.cc",
2773    "spdy/spdy_session_pool_unittest.cc",
2774    "spdy/spdy_session_test_util.cc",
2775    "spdy/spdy_session_test_util.h",
2776    "spdy/spdy_session_unittest.cc",
2777    "spdy/spdy_stream_test_util.cc",
2778    "spdy/spdy_stream_test_util.h",
2779    "spdy/spdy_stream_unittest.cc",
2780    "spdy/spdy_write_queue_unittest.cc",
2781    "ssl/client_cert_identity_unittest.cc",
2782    "ssl/client_cert_store_unittest-inl.h",
2783    "ssl/openssl_private_key_unittest.cc",
2784    "ssl/ssl_cipher_suite_names_unittest.cc",
2785    "ssl/ssl_client_auth_cache_unittest.cc",
2786    "ssl/ssl_client_session_cache_unittest.cc",
2787    "ssl/ssl_config_service_unittest.cc",
2788    "ssl/ssl_config_unittest.cc",
2789    "ssl/ssl_connection_status_flags_unittest.cc",
2790    "ssl/ssl_platform_key_util_unittest.cc",
2791    "test/embedded_test_server/embedded_test_server_unittest.cc",
2792    "test/embedded_test_server/http_request_unittest.cc",
2793    "test/embedded_test_server/http_response_unittest.cc",
2794    "test/run_all_unittests.cc",
2795    "third_party/uri_template/uri_template_test.cc",
2796    "tools/content_decoder_tool/content_decoder_tool.cc",
2797    "tools/content_decoder_tool/content_decoder_tool.h",
2798    "tools/content_decoder_tool/content_decoder_tool_unittest.cc",
2799    "tools/quic/quic_simple_client_test.cc",
2800    "tools/tld_cleanup/tld_cleanup_util_unittest.cc",
2801    "url_request/redirect_info_unittest.cc",
2802    "url_request/redirect_util_unittest.cc",
2803    "url_request/url_request_context_builder_unittest.cc",
2804    "url_request/url_request_filter_unittest.cc",
2805    "url_request/url_request_http_job_unittest.cc",
2806    "url_request/url_request_job_factory_unittest.cc",
2807    "url_request/url_request_job_unittest.cc",
2808    "url_request/url_request_quic_unittest.cc",
2809    "url_request/url_request_unittest.cc",
2810    "url_request/view_cache_helper_unittest.cc",
2811  ]
2812
2813  if (is_android) {
2814    sources += [
2815      "android/dummy_spnego_authenticator.cc",
2816      "android/dummy_spnego_authenticator.h",
2817      "android/http_auth_negotiate_android_unittest.cc",
2818      "android/network_change_notifier_android_unittest.cc",
2819      "android/network_library_unittest.cc",
2820      "android/traffic_stats_unittest.cc",
2821      "cert/cert_verify_proc_android_unittest.cc",
2822      "proxy_resolution/proxy_config_service_android_unittest.cc",
2823      "ssl/ssl_platform_key_android_unittest.cc",
2824    ]
2825  }
2826
2827  if (is_chromeos_ash && use_nss_certs) {
2828    sources += [
2829      "cert/nss_cert_database_chromeos_unittest.cc",
2830      "cert/nss_profile_filter_chromeos_unittest.cc",
2831    ]
2832  }
2833
2834  if (is_linux) {
2835    sources += [
2836      "base/network_change_notifier_linux_unittest.cc",
2837      "proxy_resolution/proxy_config_service_linux_unittest.cc",
2838    ]
2839  }
2840
2841  if (is_linux || is_chromeos) {
2842    sources += [
2843      "base/address_tracker_linux_unittest.cc",
2844      "base/network_interfaces_linux_unittest.cc",
2845    ]
2846  }
2847
2848  if (is_mac) {
2849    sources += [
2850      "cert/internal/trust_store_mac_unittest.cc",
2851      "ssl/client_cert_store_mac_unittest.cc",
2852      "ssl/ssl_platform_key_mac_unittest.cc",
2853    ]
2854  }
2855
2856  if (is_apple) {
2857    sources += [
2858      "cert/x509_util_apple_unittest.cc",
2859      "proxy_resolution/proxy_chain_util_apple_unittest.cc",
2860    ]
2861  }
2862
2863  if (is_win) {
2864    sources += [
2865      "base/network_change_notifier_win_unittest.cc",
2866      "base/network_interfaces_win_unittest.cc",
2867      "http/http_auth_sspi_win_unittest.cc",
2868      "http/mock_sspi_library_win.cc",
2869      "http/mock_sspi_library_win.h",
2870      "proxy_resolution/win/dhcp_pac_file_adapter_fetcher_win_unittest.cc",
2871      "proxy_resolution/win/dhcp_pac_file_fetcher_win_unittest.cc",
2872      "proxy_resolution/win/proxy_config_service_win_unittest.cc",
2873      "proxy_resolution/win/windows_system_proxy_resolution_service_unittest.cc",
2874      "ssl/client_cert_store_win_unittest.cc",
2875      "ssl/ssl_platform_key_win_unittest.cc",
2876    ]
2877  }
2878
2879  configs += [ "//build/config:precompiled_headers" ]
2880  defines = []
2881
2882  deps = [
2883    ":cronet_buildflags",
2884    ":net",
2885    ":preload_decoder",
2886    ":quic_test_tools",
2887    ":simple_quic_tools",
2888    ":spdy_test_tools",
2889    ":test_support",
2890    "//base",
2891    "//base:i18n",
2892    "//build:chromeos_buildflags",
2893    "//crypto",
2894    "//crypto:test_support",
2895    "//net/base/registry_controlled_domains",
2896    "//net/base/registry_controlled_domains:lookup_strings_test_sets",
2897    "//net/dns:tests",
2898    "//net/dns/public:tests",
2899    "//net/http:transport_security_state_unittest_data",
2900    "//net/http:transport_security_state_unittest_data_default",
2901    "//net/third_party/quiche:quiche_tests",
2902    "//net/tools/huffman_trie:huffman_trie_generator_sources",
2903    "//testing/gmock",
2904    "//testing/gtest",
2905    "//third_party/abseil-cpp:absl",
2906    "//third_party/anonymous_tokens:anonymous_tokens_tests",
2907    "//third_party/protobuf:protobuf_lite",
2908    "//third_party/zlib",
2909    "//url",
2910    "//url:buildflags",
2911  ]
2912
2913  if (!is_cronet_build) {
2914    sources += [
2915      "extras/shared_dictionary/shared_dictionary_isolation_key_unittest.cc",
2916      "extras/sqlite/sqlite_persistent_cookie_store_unittest.cc",
2917      "extras/sqlite/sqlite_persistent_shared_dictionary_store_unittest.cc",
2918      "log/trace_net_log_observer_unittest.cc",
2919    ]
2920
2921    deps += [
2922      ":extras",
2923      "//components/sqlite_proto",
2924      "//sql",
2925      "//sql:test_support",
2926    ]
2927  }
2928
2929  if (enable_websockets) {
2930    deps += [ "//net/server:tests" ]
2931  }
2932
2933  if (is_posix) {
2934    sources += [ "base/sockaddr_util_posix_unittest.cc" ]
2935  }
2936
2937  if (is_android || is_chromeos_ash) {
2938    sources += [ "base/network_change_notifier_passive_unittest.cc" ]
2939  }
2940
2941  if (enable_reporting) {
2942    sources += [
2943      "network_error_logging/mock_persistent_nel_store_unittest.cc",
2944      "network_error_logging/network_error_logging_service_unittest.cc",
2945      "reporting/mock_persistent_reporting_store_unittest.cc",
2946      "reporting/reporting_browsing_data_remover_unittest.cc",
2947      "reporting/reporting_cache_unittest.cc",
2948      "reporting/reporting_delivery_agent_unittest.cc",
2949      "reporting/reporting_endpoint_manager_unittest.cc",
2950      "reporting/reporting_garbage_collector_unittest.cc",
2951      "reporting/reporting_header_parser_unittest.cc",
2952      "reporting/reporting_network_change_observer_unittest.cc",
2953      "reporting/reporting_service_unittest.cc",
2954      "reporting/reporting_uploader_unittest.cc",
2955    ]
2956    if (!is_cronet_build) {
2957      sources += [
2958        "extras/sqlite/sqlite_persistent_reporting_and_nel_store_unittest.cc",
2959      ]
2960    }
2961  }
2962
2963  data = [
2964    "data/cache_tests/",
2965    "data/cert_issuer_source_aia_unittest/",
2966    "data/cert_issuer_source_static_unittest/",
2967    "data/embedded_test_server/",
2968    "data/file_stream_unittest/",
2969    "data/filter_unittests/",
2970    "data/gencerts/",
2971    "data/pac_file_fetcher_unittest/",
2972    "data/quic_http_response_cache_data/",
2973    "data/quic_http_response_cache_data_with_push/",
2974    "data/spdy_tests/",
2975    "data/test.html",
2976    "data/verify_certificate_chain_unittest/",
2977  ]
2978  data_deps = [ "//testing/buildbot/filters:net_unittests_filters" ]
2979
2980  if (is_linux || is_chromeos || is_mac || is_win || is_fuchsia) {
2981    deps += [ "//third_party/pywebsocket3/" ]
2982    data_deps += [ "//third_party/pywebsocket3/" ]
2983    data += [
2984      "tools/testserver/",
2985      "//third_party/pywebsocket3/src/mod_pywebsocket/",
2986    ]
2987  }
2988
2989  if (is_linux || is_chromeos) {
2990    sources += [ "tools/quic/quic_simple_server_test.cc" ]
2991  }
2992
2993  if (is_apple) {
2994    sources += [ "base/apple/url_conversions_unittest.mm" ]
2995  }
2996
2997  if (is_mac) {
2998    sources += [ "base/network_change_notifier_apple_unittest.cc" ]
2999    frameworks = [
3000      "Security.framework",
3001      "SystemConfiguration.framework",
3002    ]
3003  }
3004
3005  if (!is_win) {
3006    sources += [
3007      "http/http_auth_handler_ntlm_portable_unittest.cc",
3008      "ntlm/ntlm_buffer_reader_unittest.cc",
3009      "ntlm/ntlm_buffer_writer_unittest.cc",
3010      "ntlm/ntlm_client_unittest.cc",
3011      "ntlm/ntlm_test_data.h",
3012      "ntlm/ntlm_unittest.cc",
3013    ]
3014  }
3015
3016  if (enable_python_utils) {
3017    sources += [ "test/python_utils_unittest.cc" ]
3018  }
3019
3020  if (is_fuchsia) {
3021    use_test_server = true
3022    deps += [
3023      "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.net.interfaces:fuchsia.net.interfaces_hlcpp",
3024      "//third_party/fuchsia-sdk/sdk/pkg/fidl_cpp",
3025    ]
3026    sources += [
3027      "base/fuchsia/network_interface_cache_unittest.cc",
3028      "base/network_change_notifier_fuchsia_unittest.cc",
3029    ]
3030    additional_manifest_fragments =
3031        [ "//build/config/fuchsia/test/network.shard.test-cml" ]
3032  }
3033
3034  if (use_nss_certs) {
3035    sources += [
3036      "cert/internal/system_trust_store_nss_unittest.cc",
3037      "cert/internal/trust_store_nss_unittest.cc",
3038      "cert/nss_cert_database_unittest.cc",
3039      "cert/x509_util_nss_unittest.cc",
3040    ]
3041    if (!is_castos) {
3042      sources += [
3043        "ssl/client_cert_store_nss_unittest.cc",
3044        "ssl/ssl_platform_key_nss_unittest.cc",
3045      ]
3046    }
3047    configs += [ "//build/config/linux/nss" ]
3048  }
3049
3050  if (use_external_gssapi) {
3051    sources += [
3052      "http/http_auth_gssapi_posix_unittest.cc",
3053      "http/mock_gssapi_library_posix.cc",
3054      "http/mock_gssapi_library_posix.h",
3055    ]
3056    data_deps += [
3057      ":test_badgssapi",
3058      ":test_gssapi",
3059    ]
3060  }
3061
3062  if (use_kerberos) {
3063    sources += [ "http/http_auth_handler_negotiate_unittest.cc" ]
3064  }
3065
3066  if (enable_websockets) {
3067    sources += [
3068      "websockets/websocket_basic_handshake_stream_test.cc",
3069      "websockets/websocket_basic_stream_adapters_test.cc",
3070      "websockets/websocket_basic_stream_test.cc",
3071      "websockets/websocket_channel_test.cc",
3072      "websockets/websocket_deflate_parameters_test.cc",
3073      "websockets/websocket_deflate_predictor_impl_test.cc",
3074      "websockets/websocket_deflate_stream_test.cc",
3075      "websockets/websocket_deflater_test.cc",
3076      "websockets/websocket_errors_test.cc",
3077      "websockets/websocket_extension_parser_test.cc",
3078      "websockets/websocket_extension_test.cc",
3079      "websockets/websocket_frame_parser_test.cc",
3080      "websockets/websocket_frame_test.cc",
3081      "websockets/websocket_handshake_challenge_test.cc",
3082      "websockets/websocket_handshake_stream_create_helper_test.cc",
3083      "websockets/websocket_inflater_test.cc",
3084      "websockets/websocket_stream_cookie_test.cc",
3085      "websockets/websocket_stream_create_test_base.cc",
3086      "websockets/websocket_stream_create_test_base.h",
3087      "websockets/websocket_stream_test.cc",
3088      "websockets/websocket_test_util.cc",
3089      "websockets/websocket_test_util.h",
3090    ]
3091
3092    if (!is_ios) {
3093      # TODO(crbug.com/1281277): iOS does not have support for the spawned test
3094      # server, which is used by this test. The long term plan is to add
3095      # websocket support to the embedded test server and when that happens,
3096      # this test could be enabled.
3097      sources += [ "websockets/websocket_end_to_end_test.cc" ]
3098    }
3099  }
3100
3101  if (!disable_file_support) {
3102    sources += [
3103      "base/directory_lister_unittest.cc",
3104      "base/directory_listing_unittest.cc",
3105      "test/url_request/url_request_test_job_backed_by_file_unittest.cc",
3106    ]
3107  }
3108
3109  if (enable_built_in_dns) {
3110    sources += [ "url_request/http_with_dns_over_https_unittest.cc" ]
3111  }
3112
3113  if (is_ios) {
3114    bundle_deps = [ ":net_test_bundle_data" ]
3115  }
3116
3117  if (enable_unix_sockets) {
3118    sources += [
3119      "socket/unix_domain_client_socket_posix_unittest.cc",
3120      "socket/unix_domain_server_socket_posix_unittest.cc",
3121    ]
3122  }
3123
3124  # Use getifaddrs() on POSIX platforms, except Linux.
3125  if (is_posix && !is_linux && !is_chromeos) {
3126    sources += [ "base/network_interfaces_getifaddrs_unittest.cc" ]
3127  }
3128
3129  # Unit tests that aren't supported by the current ICU alternatives on Android.
3130  if (is_android && use_platform_icu_alternatives) {
3131    sources -= [
3132      "base/filename_util_unittest.cc",
3133      "base/url_util_unittest.cc",
3134      "cert/x509_certificate_unittest.cc",
3135      "url_request/url_request_job_unittest.cc",
3136    ]
3137    deps += [ "//url:url_java" ]
3138  }
3139
3140  # Unit tests that are not supported by the current ICU alternatives on iOS.
3141  if (is_ios && use_platform_icu_alternatives) {
3142    sources -= [
3143      "base/filename_util_unittest.cc",
3144      "base/url_util_unittest.cc",
3145      "cert/x509_certificate_unittest.cc",
3146      "http/http_auth_handler_basic_unittest.cc",
3147      "http/http_auth_handler_digest_unittest.cc",
3148      "http/http_auth_handler_factory_unittest.cc",
3149      "http/http_auth_unittest.cc",
3150      "http/http_content_disposition_unittest.cc",
3151      "http/http_network_transaction_unittest.cc",
3152      "spdy/spdy_network_transaction_unittest.cc",
3153      "spdy/spdy_proxy_client_socket_unittest.cc",
3154      "url_request/url_request_job_unittest.cc",
3155      "url_request/url_request_unittest.cc",
3156    ]
3157  }
3158
3159  if (!disable_brotli_filter) {
3160    sources += [ "filter/brotli_source_stream_unittest.cc" ]
3161  }
3162
3163  if (!disable_zstd_filter) {
3164    sources += [ "filter/zstd_source_stream_unittest.cc" ]
3165  }
3166
3167  if (is_android) {
3168    data_deps += [ "//net/tools/testserver:testserver_py" ]
3169    deps += [
3170      ":net_jni_headers",
3171      "//base:base_unittest_support_java",
3172      "//net/android:net_java",
3173      "//net/android:net_java_test_support",
3174      "//net/android:net_test_support_jni",
3175      "//net/android:net_test_support_provider_java",
3176      "//net/android:net_test_support_provider_jni",
3177      "//net/android:net_tests_java",
3178      "//net/android:net_tests_jni",
3179      "//net/android:net_unittests_apk_resources",
3180
3181      # TODO(mmenke):  This depends on test_support_base, which depends on
3182      #                icu.  Figure out a way to remove that dependency.
3183      "//testing/android/native_test:native_test_native_code",
3184    ]
3185    android_manifest = "//net/android/unittest_support/AndroidManifest.xml"
3186
3187    sources += [
3188      "base/address_tracker_linux_unittest.cc",
3189      "base/network_interfaces_linux_unittest.cc",
3190    ]
3191    shard_timeout = 300
3192
3193    if (enable_chrome_android_internal) {
3194      data_deps += [ "//clank/build/bot/filters:net_unittests_filters" ]
3195    }
3196  }
3197
3198  if (is_win) {
3199    libs = [
3200      "iphlpapi.lib",
3201      "ncrypt.lib",
3202    ]
3203  }
3204
3205  if (chrome_root_store_supported) {
3206    sources += [ "cert/internal/trust_store_chrome_unittest.cc" ]
3207    deps += [
3208      "//base/version_info",
3209      "//net/data/ssl/chrome_root_store:gen_root_store_test_inc",
3210    ]
3211
3212    if (is_win) {
3213      sources += [ "cert/internal/trust_store_win_unittest.cc" ]
3214      sources += [ "cert/internal/path_builder_trust_store_win_unittest.cc" ]
3215      libs += [ "crypt32.lib" ]
3216    }
3217  }
3218
3219  # Include transport_security_state_generator tests.
3220  if (host_toolchain == current_toolchain) {
3221    deps += [
3222      "//net/tools/huffman_trie:huffman_trie_generator_test_sources",
3223      "//net/tools/transport_security_state_generator:transport_security_state_generator_test_sources",
3224    ]
3225  }
3226
3227  if (enable_device_bound_sessions) {
3228    sources += [
3229      "device_bound_sessions/device_bound_session_registration_fetcher_param_unittest.cc",
3230      "device_bound_sessions/test_util.cc",
3231      "device_bound_sessions/test_util.h",
3232    ]
3233  }
3234}
3235
3236# !is_android && !is_win && !is_mac
3237if (!is_ios) {
3238  # TODO(crbug.com/594965): this should be converted to "app" template and
3239  # enabled on iOS too.
3240  test("net_perftests") {
3241    sources = [
3242      "base/mime_sniffer_perftest.cc",
3243      "cookies/cookie_monster_perftest.cc",
3244      "disk_cache/disk_cache_perftest.cc",
3245      "extras/sqlite/sqlite_persistent_cookie_store_perftest.cc",
3246      "socket/udp_socket_perftest.cc",
3247      "spdy/spdy_http_utils_perftest.cc",
3248      "url_request/url_request_quic_perftest.cc",
3249    ]
3250
3251    deps = [
3252      ":extras",
3253      ":net",
3254      ":quic_test_tools",
3255      ":simple_quic_tools",
3256      ":test_support",
3257      "//base",
3258      "//base:i18n",
3259      "//base/test:test_support_perf",
3260      "//testing/gtest",
3261      "//testing/perf",
3262      "//third_party/google_benchmark:google_benchmark",
3263      "//url",
3264    ]
3265    data_deps = [
3266      # Needed for isolate script to execute.
3267      "//testing:run_perf_test",
3268    ]
3269    if (enable_websockets) {
3270      sources += [ "websockets/websocket_frame_perftest.cc" ]
3271    }
3272    if (is_win) {
3273      deps += [ "//build/win:default_exe_manifest" ]
3274    }
3275  }
3276}
3277
3278# Fuzzers
3279
3280# This has a global (InitGlobals) that must always be linked in, so
3281# must be a source set instead of a static library.
3282if (use_fuzzing_engine) {
3283  # fuzzer_test targets are no-op when |use_fuzzing_engine| is false. Fuzzer
3284  # support targets should be disabled too.
3285  source_set("net_fuzzer_test_support") {
3286    testonly = true
3287
3288    sources = [
3289      "base/fuzzer_test_support.cc",
3290      "filter/fuzzed_source_stream.cc",
3291      "filter/fuzzed_source_stream.h",
3292      "socket/fuzzed_datagram_client_socket.cc",
3293      "socket/fuzzed_datagram_client_socket.h",
3294      "socket/fuzzed_server_socket.cc",
3295      "socket/fuzzed_server_socket.h",
3296      "socket/fuzzed_socket.cc",
3297      "socket/fuzzed_socket.h",
3298      "socket/fuzzed_socket_factory.cc",
3299      "socket/fuzzed_socket_factory.h",
3300    ]
3301    public_deps = [
3302      "//base/test:test_support",
3303      "//net/dns:fuzzer_test_support",
3304    ]
3305    deps = [
3306      "//base",
3307      "//base:i18n",
3308      "//net",
3309    ]
3310    data = [
3311      "data/fuzzer_data",
3312      "data/fuzzer_dictionaries",
3313    ]
3314    allow_circular_includes_from = [ "//net/dns:fuzzer_test_support" ]
3315  }
3316}
3317
3318fuzzer_test("host_port_pair_fuzzer") {
3319  sources = [ "base/host_port_pair_fuzzer.cc" ]
3320  deps = [ "//net" ]
3321}
3322
3323proto_library("disk_cache_lpm_fuzzer_proto") {
3324  sources = [ "disk_cache/disk_cache_fuzzer.proto" ]
3325}
3326
3327fuzzer_test("disk_cache_lpm_fuzzer") {
3328  sources = [ "disk_cache/disk_cache_fuzzer.cc" ]
3329  deps = [
3330    ":disk_cache_lpm_fuzzer_proto",
3331    ":test_support",
3332    "//base",
3333    "//net",
3334    "//third_party/libprotobuf-mutator",
3335  ]
3336}
3337
3338proto_library("backoff_entry_serializer_fuzzer_input") {
3339  proto_in_dir = "//"
3340  sources = [ "base/backoff_entry_serializer_fuzzer_input.proto" ]
3341  link_deps = [ "//testing/libfuzzer/proto:json_proto" ]
3342}
3343
3344fuzzer_test("net_backoff_entry_serializer_fuzzer") {
3345  sources = [ "base/backoff_entry_serializer_fuzzer.cc" ]
3346  deps = [
3347    ":backoff_entry_serializer_fuzzer_input",
3348    ":net_fuzzer_test_support",
3349    ":test_support",
3350    "//base",
3351    "//net",
3352    "//testing/libfuzzer/proto:json_proto",
3353    "//testing/libfuzzer/proto:json_proto_converter",
3354    "//third_party/libprotobuf-mutator",
3355  ]
3356}
3357
3358fuzzer_test("net_data_url_fuzzer") {
3359  sources = [ "base/data_url_fuzzer.cc" ]
3360  deps = [
3361    ":net_fuzzer_test_support",
3362    ":test_support",
3363    "//base",
3364    "//net",
3365  ]
3366  dict = "data/fuzzer_dictionaries/net_data_url_fuzzer.dict"
3367
3368  # IsTokenChar() and ToLowerASCII() are surprisingly slow in instrumented builds.
3369  libfuzzer_options = [ "max_len=100000" ]
3370}
3371
3372fuzzer_test("net_mime_sniffer_fuzzer") {
3373  sources = [ "base/mime_sniffer_fuzzer.cc" ]
3374  deps = [
3375    ":net_fuzzer_test_support",
3376    "//base",
3377    "//net",
3378  ]
3379  dict = "data/fuzzer_dictionaries/net_mime_sniffer_fuzzer.dict"
3380}
3381
3382fuzzer_test("net_parse_proxy_list_pac_fuzzer") {
3383  sources = [ "proxy_resolution/parse_proxy_list_pac_fuzzer.cc" ]
3384  deps = [
3385    ":net_fuzzer_test_support",
3386    "//net",
3387  ]
3388}
3389
3390fuzzer_test("net_parse_proxy_list_fuzzer") {
3391  sources = [ "proxy_resolution/parse_proxy_list_fuzzer.cc" ]
3392  deps = [
3393    ":net_fuzzer_test_support",
3394    "//net",
3395  ]
3396}
3397
3398fuzzer_test("net_parse_proxy_bypass_rules_fuzzer") {
3399  sources = [ "proxy_resolution/parse_proxy_bypass_rules_fuzzer.cc" ]
3400
3401  libfuzzer_options = [
3402    # The proxy bypass rules aren't very complicated, so this is more than
3403    # enough to explore the grammar. Allowing the length to become too large
3404    # can result in test timeouts (https://crbug.com/813619).
3405    "max_len=512",
3406  ]
3407
3408  deps = [
3409    ":net_fuzzer_test_support",
3410    "//net",
3411  ]
3412}
3413
3414fuzzer_test("net_parse_proxy_rules_fuzzer") {
3415  sources = [ "proxy_resolution/parse_proxy_rules_fuzzer.cc" ]
3416  deps = [
3417    ":net_fuzzer_test_support",
3418    "//net",
3419  ]
3420  dict = "data/fuzzer_dictionaries/net_parse_proxy_bypass_rules_fuzzer.dict"
3421}
3422
3423fuzzer_test("net_get_domain_and_registry_fuzzer") {
3424  sources =
3425      [ "base/registry_controlled_domains/get_domain_and_registry_fuzzer.cc" ]
3426  deps = [
3427    ":net_fuzzer_test_support",
3428    "//base",
3429    "//net",
3430  ]
3431  dict = "data/fuzzer_dictionaries/net_get_domain_and_registry_fuzzer.dict"
3432}
3433
3434fuzzer_test("net_lookup_string_in_fixed_set_fuzzer") {
3435  sources = [ "base/lookup_string_in_fixed_set_fuzzer.cc" ]
3436  deps = [
3437    ":net_fuzzer_test_support",
3438    "//base",
3439    "//net",
3440    "//net/base/registry_controlled_domains:lookup_strings_test_sets",
3441  ]
3442  dict = "data/fuzzer_dictionaries/net_get_domain_and_registry_fuzzer.dict"
3443}
3444
3445fuzzer_test("net_base_schemeful_site_fuzzer") {
3446  sources = [ "base/schemeful_site_fuzzer.cc" ]
3447  deps = [
3448    ":net_fuzzer_test_support",
3449    "//base",
3450    "//net",
3451    "//testing/libfuzzer/proto:url_proto",
3452    "//testing/libfuzzer/proto:url_proto_converter",
3453    "//third_party/libprotobuf-mutator",
3454  ]
3455}
3456
3457fuzzer_test("net_cert_ct_decode_signed_certificate_timestamp_fuzzer") {
3458  sources = [ "cert/decode_signed_certificate_timestamp_fuzzer.cc" ]
3459  deps = [
3460    ":net_fuzzer_test_support",
3461    "//base",
3462    "//net",
3463  ]
3464}
3465
3466fuzzer_test("net_canonical_cookie_fuzzer") {
3467  sources = [ "cookies/canonical_cookie_fuzzer.cc" ]
3468  deps = [
3469    ":net_fuzzer_test_support",
3470    "//net",
3471  ]
3472  dict = "data/fuzzer_dictionaries/net_cookies_fuzzer.dict"
3473  seed_corpus = "data/fuzzer_data/cookies/"
3474}
3475
3476fuzzer_test("net_cookie_partition_key_fuzzer") {
3477  sources = [ "cookies/cookie_partition_key_fuzzer.cc" ]
3478  deps = [
3479    ":net_fuzzer_test_support",
3480    "//net",
3481  ]
3482}
3483
3484fuzzer_test("net_cookie_util_parsing_fuzzer") {
3485  sources = [ "cookies/cookie_util_parsing_fuzzer.cc" ]
3486  deps = [
3487    ":net_fuzzer_test_support",
3488    "//net",
3489  ]
3490  dict = "data/fuzzer_dictionaries/net_cookies_fuzzer.dict"
3491  libfuzzer_options = [ "max_len=8192" ]
3492  seed_corpus = "data/fuzzer_data/cookies/"
3493}
3494
3495fuzzer_test("net_parse_cookie_line_fuzzer") {
3496  sources = [ "cookies/parse_cookie_line_fuzzer.cc" ]
3497  deps = [
3498    ":net_fuzzer_test_support",
3499    "//net",
3500  ]
3501  dict = "data/fuzzer_dictionaries/net_cookies_fuzzer.dict"
3502  seed_corpus = "data/fuzzer_data/cookies/"
3503}
3504
3505fuzzer_test("net_http_stream_parser_fuzzer") {
3506  sources = [ "http/http_stream_parser_fuzzer.cc" ]
3507  deps = [
3508    ":net_fuzzer_test_support",
3509    ":test_support",
3510    "//base",
3511    "//net",
3512  ]
3513  dict = "data/fuzzer_dictionaries/net_http_stream_parser_fuzzer.dict"
3514}
3515
3516fuzzer_test("canonicalize_host_fuzzer") {
3517  sources = [ "base/canonicalize_host_fuzzer.cc" ]
3518  deps = [
3519    "//net",
3520    "//third_party/icu/fuzzers:fuzzer_support",
3521  ]
3522  dict = "base/canonicalize_host_fuzzer.dict"
3523}
3524
3525if (!is_win) {
3526  fuzzer_test("net_ntlm_ntlm_client_fuzzer") {
3527    sources = [
3528      "ntlm/ntlm_client_fuzzer.cc",
3529      "ntlm/ntlm_test_data.h",
3530    ]
3531    deps = [
3532      ":net_fuzzer_test_support",
3533      ":test_support",
3534      "//base",
3535      "//net",
3536    ]
3537    dict = "data/fuzzer_dictionaries/net_ntlm_ntlm_client_fuzzer.dict"
3538    seed_corpus = "data/fuzzer_data/ntlm_client_fuzzer/"
3539  }
3540}
3541
3542if (!disable_brotli_filter) {
3543  fuzzer_test("net_brotli_source_stream_fuzzer") {
3544    sources = [ "filter/brotli_source_stream_fuzzer.cc" ]
3545    deps = [
3546      ":net_fuzzer_test_support",
3547      ":test_support",
3548      "//base",
3549      "//net",
3550    ]
3551  }
3552}
3553
3554if (!disable_zstd_filter) {
3555  fuzzer_test("net_zstd_source_stream_fuzzer") {
3556    sources = [ "filter/zstd_source_stream_fuzzer.cc" ]
3557    deps = [
3558      ":net_fuzzer_test_support",
3559      ":test_support",
3560      "//base",
3561      "//net",
3562    ]
3563  }
3564}
3565
3566fuzzer_test("net_gzip_source_stream_fuzzer") {
3567  sources = [ "filter/gzip_source_stream_fuzzer.cc" ]
3568  deps = [
3569    ":net_fuzzer_test_support",
3570    ":test_support",
3571    "//base",
3572    "//net",
3573  ]
3574}
3575
3576fuzzer_test("net_crl_set_fuzzer") {
3577  sources = [ "cert/crl_set_fuzzer.cc" ]
3578  deps = [
3579    ":net_fuzzer_test_support",
3580    ":test_support",
3581    "//base",
3582    "//net",
3583  ]
3584  seed_corpus = "data/fuzzer_data/net_crl_set_fuzzer/"
3585}
3586
3587fuzzer_test("net_spdy_headers_to_http_response_headers_fuzzer") {
3588  sources = [ "spdy/spdy_headers_to_http_response_headers_fuzzer.cc" ]
3589  deps = [
3590    ":net_fuzzer_test_support",
3591    "//base",
3592    "//net",
3593  ]
3594  dict = "data/fuzzer_dictionaries/net_http_stream_parser_fuzzer.dict"
3595  libfuzzer_options = [ "max_len = 512" ]
3596}
3597
3598fuzzer_test("net_unescape_url_component_fuzzer") {
3599  sources = [ "base/unescape_url_component_fuzzer.cc" ]
3600  deps = [
3601    ":net_fuzzer_test_support",
3602    "//base",
3603    "//net",
3604  ]
3605  dict = "data/fuzzer_dictionaries/unescape_url_component_fuzzer.dict"
3606  libfuzzer_options = [ "max_len = 2048" ]
3607}
3608
3609fuzzer_test("net_websocket_deflate_stream_fuzzer") {
3610  sources = [ "websockets/websocket_deflate_stream_fuzzer.cc" ]
3611  deps = [
3612    ":net_fuzzer_test_support",
3613    "//net",
3614  ]
3615  dict = "data/fuzzer_dictionaries/net_websocket_frame_parser_fuzzer.dict"
3616  libfuzzer_options = [ "max_len=512" ]
3617}
3618
3619fuzzer_test("net_websocket_extension_parser_fuzzer") {
3620  sources = [ "websockets/websocket_extension_parser_fuzzer.cc" ]
3621  deps = [
3622    ":net_fuzzer_test_support",
3623    "//net",
3624  ]
3625  dict = "data/fuzzer_dictionaries/net_websocket_extension_parser_fuzzer.dict"
3626  libfuzzer_options = [ "max_len = 256" ]
3627}
3628
3629fuzzer_test("net_websocket_frame_parser_fuzzer") {
3630  sources = [ "websockets/websocket_frame_parser_fuzzer.cc" ]
3631  deps = [
3632    ":net_fuzzer_test_support",
3633    "//net",
3634  ]
3635  dict = "data/fuzzer_dictionaries/net_websocket_frame_parser_fuzzer.dict"
3636  libfuzzer_options = [ "max_len=256" ]
3637}
3638
3639if (use_fuzzing_engine) {
3640  # This is a separate target because //net/server:http_server
3641  # wants to limit its visibility to a select number of target, but the
3642  # "fuzzer_test" template expands on iOS to many targets that need to
3643  # have the "deps" information propagated in order to support "fat"
3644  # binaries.
3645  source_set("net_web_socket_encoder_fuzzer_deps") {
3646    testonly = true
3647    visibility = [
3648      ":net_web_socket_encoder_fuzzer",
3649      ":net_web_socket_encoder_fuzzer_executable",
3650      ":run_net_web_socket_encoder_fuzzer",
3651    ]
3652    public_deps = [
3653      ":net_fuzzer_test_support",
3654      "//net",
3655      "//net/server:http_server",
3656    ]
3657  }
3658
3659  fuzzer_test("net_web_socket_encoder_fuzzer") {
3660    sources = [ "server/web_socket_encoder_fuzzer.cc" ]
3661    deps = [ ":net_web_socket_encoder_fuzzer_deps" ]
3662    libfuzzer_options = [ "max_len=256" ]
3663  }
3664}
3665
3666fuzzer_test("net_http_chunked_decoder_fuzzer") {
3667  sources = [ "http/http_chunked_decoder_fuzzer.cc" ]
3668  deps = [
3669    ":net_fuzzer_test_support",
3670    "//net",
3671  ]
3672  dict = "data/fuzzer_dictionaries/http_chunked_decoder_fuzzer.dict"
3673}
3674
3675fuzzer_test("net_http_auth_handler_basic_fuzzer") {
3676  sources = [ "http/http_auth_handler_basic_fuzzer.cc" ]
3677  dict = "data/fuzzer_dictionaries/net_http_auth_handler_basic_fuzzer.dict"
3678  deps = [
3679    ":net_fuzzer_test_support",
3680    ":test_support",
3681    "//net",
3682  ]
3683}
3684
3685fuzzer_test("net_http_auth_handler_digest_fuzzer") {
3686  sources = [ "http/http_auth_handler_digest_fuzzer.cc" ]
3687  dict = "data/fuzzer_dictionaries/net_http_auth_handler_digest_fuzzer.dict"
3688  deps = [
3689    ":net_fuzzer_test_support",
3690    ":test_support",
3691    "//net",
3692  ]
3693}
3694
3695fuzzer_test("net_http_auth_handler_fuzzer") {
3696  sources = [ "http/http_auth_handler_fuzzer.cc" ]
3697  deps = [
3698    ":net_fuzzer_test_support",
3699    ":test_support",
3700    "//base",
3701    "//net",
3702  ]
3703}
3704
3705fuzzer_test("net_http_content_disposition_fuzzer") {
3706  sources = [ "http/http_content_disposition_fuzzer.cc" ]
3707  dict = "data/fuzzer_dictionaries/net_http_content_disposition_fuzzer.dict"
3708  deps = [
3709    ":net_fuzzer_test_support",
3710    "//net",
3711  ]
3712}
3713
3714fuzzer_test("net_http_proxy_client_socket_fuzzer") {
3715  sources = [ "http/http_proxy_client_socket_fuzzer.cc" ]
3716  deps = [
3717    ":net_fuzzer_test_support",
3718    ":test_support",
3719    "//base",
3720    "//net",
3721  ]
3722  dict = "data/fuzzer_dictionaries/net_http_proxy_client_socket_fuzzer.dict"
3723}
3724
3725fuzzer_test("net_structured_headers_fuzzer") {
3726  sources = [ "http/structured_headers_fuzzer.cc" ]
3727  deps = [
3728    ":net_fuzzer_test_support",
3729    ":test_support",
3730    "//base",
3731    "//net",
3732  ]
3733  seed_corpus = "data/fuzzer_data/structured_headers_corpus"
3734}
3735
3736fuzzer_test("net_parse_url_hostname_to_address_fuzzer") {
3737  sources = [ "base/parse_url_hostname_to_address_fuzzer.cc" ]
3738  deps = [
3739    ":net_fuzzer_test_support",
3740    "//base",
3741    "//net",
3742  ]
3743  libfuzzer_options = [ "max_len=512" ]
3744  seed_corpus = "data/fuzzer_data/hostnames/"
3745}
3746
3747fuzzer_test("net_quic_crypto_framer_parse_message_fuzzer") {
3748  sources = [ "quic/quic_crypto_framer_parse_message_fuzzer.cc" ]
3749  deps = [
3750    ":net_fuzzer_test_support",
3751    "//base",
3752    "//net",
3753  ]
3754}
3755
3756fuzzer_test("net_quic_transport_parameters_fuzzer") {
3757  sources = [ "quic/quic_transport_parameters_fuzzer.cc" ]
3758  deps = [
3759    ":net_fuzzer_test_support",
3760    "//base",
3761    "//net",
3762  ]
3763}
3764
3765fuzzer_test("net_socks_client_socket_fuzzer") {
3766  sources = [ "socket/socks_client_socket_fuzzer.cc" ]
3767  deps = [
3768    ":net_fuzzer_test_support",
3769    ":test_support",
3770    "//base",
3771    "//net",
3772  ]
3773}
3774
3775fuzzer_test("net_socks5_client_socket_fuzzer") {
3776  sources = [ "socket/socks5_client_socket_fuzzer.cc" ]
3777  deps = [
3778    ":net_fuzzer_test_support",
3779    ":test_support",
3780    "//base",
3781    "//net",
3782  ]
3783}
3784
3785fuzzer_test("net_url_request_fuzzer") {
3786  sources = [ "url_request/url_request_fuzzer.cc" ]
3787  deps = [
3788    ":net_fuzzer_test_support",
3789    ":test_support",
3790    "//base",
3791    "//net",
3792  ]
3793  dict = "data/fuzzer_dictionaries/net_url_request_fuzzer.dict"
3794}
3795
3796fuzzer_test("net_auth_challenge_tokenizer_fuzzer") {
3797  sources = [ "http/http_auth_challenge_tokenizer_fuzzer.cc" ]
3798  deps = [
3799    ":net_fuzzer_test_support",
3800    ":test_support",
3801    "//base",
3802    "//net",
3803  ]
3804}
3805
3806fuzzer_test("net_http_security_headers_hsts_fuzzer") {
3807  sources = [ "http/http_security_headers_hsts_fuzzer.cc" ]
3808  deps = [
3809    "//base",
3810    "//net",
3811  ]
3812  dict = "data/fuzzer_dictionaries/net_http_security_headers_fuzzer.dict"
3813  seed_corpus = "data/fuzzer_data/http_security_headers/"
3814}
3815
3816fuzzer_test("net_http_transport_security_state_static_fuzzer") {
3817  sources = [ "http/transport_security_state_static_fuzzer.cc" ]
3818  deps = [
3819    ":net_fuzzer_test_support",
3820    "//net",
3821  ]
3822  dict =
3823      "data/fuzzer_dictionaries/net_http_transport_security_state_fuzzer.dict"
3824}
3825
3826fuzzer_test("net_spdy_session_fuzzer") {
3827  sources = [ "spdy/spdy_session_fuzzer.cc" ]
3828  deps = [
3829    ":net_fuzzer_test_support",
3830    ":test_support",
3831    "//base",
3832    "//net",
3833    "//net/data/ssl/certificates:generate_fuzzer_cert_includes",
3834  ]
3835  dict = "data/fuzzer_dictionaries/net_spdy_session_fuzzer.dict"
3836  seed_corpus = "data/fuzzer_data/net_spdy_session_fuzzer/"
3837}
3838
3839fuzzer_test("net_http2_frame_decoder_fuzzer") {
3840  sources = [ "spdy/fuzzing/http2_frame_decoder_fuzzer.cc" ]
3841  deps = [
3842    ":net_fuzzer_test_support",
3843    ":test_support",
3844    "//base",
3845    "//net",
3846  ]
3847}
3848
3849fuzzer_test("net_hpack_decoder_fuzzer") {
3850  sources = [ "spdy/fuzzing/hpack_decoder_fuzzer.cc" ]
3851  deps = [
3852    ":net_fuzzer_test_support",
3853    ":test_support",
3854    "//base",
3855    "//net",
3856  ]
3857}
3858
3859proto_library("reporting_policy_proto") {
3860  proto_in_dir = "//"
3861  sources = [ "reporting/reporting_policy.proto" ]
3862  link_deps = [ "//testing/libfuzzer/proto:json_proto" ]
3863}
3864
3865fuzzer_test("net_reporting_header_parser_fuzzer") {
3866  sources = [ "reporting/reporting_header_parser_fuzzer.cc" ]
3867
3868  deps = [
3869    ":net_fuzzer_test_support",
3870    ":reporting_policy_proto",
3871    ":test_support",
3872    "//base",
3873    "//net",
3874    "//testing/libfuzzer/proto:json_proto",
3875    "//testing/libfuzzer/proto:json_proto_converter",
3876    "//third_party/libprotobuf-mutator",
3877  ]
3878}
3879
3880fuzzer_test("net_quic_session_pool_fuzzer") {
3881  sources = [ "quic/quic_session_pool_fuzzer.cc" ]
3882
3883  deps = [
3884    ":net_fuzzer_test_support",
3885    ":quic_test_tools",
3886    ":test_support",
3887    "//net",
3888    "//net/data/ssl/certificates:generate_fuzzer_cert_includes",
3889  ]
3890}
3891
3892fuzzer_test("net_uri_template_fuzzer") {
3893  sources = [ "third_party/uri_template/uri_template_fuzzer.cc" ]
3894  deps = [
3895    ":net_fuzzer_test_support",
3896    "//base",
3897    "//net",
3898  ]
3899  dict = "data/fuzzer_dictionaries/net_uri_template_fuzzer.dict"
3900}
3901
3902if (is_linux || is_chromeos) {
3903  fuzzer_test("net_base_address_tracker_linux_fuzzer") {
3904    sources = [ "base/address_tracker_linux_fuzzer.cc" ]
3905    deps = [
3906      ":net_fuzzer_test_support",
3907      ":test_support",
3908      "//base",
3909      "//net",
3910    ]
3911  }
3912}
3913