blob: e03c70fb231a38636f76c1ac5b18c1960705017e [file] [log] [blame]
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/jumbo.gni")
import("//mojo/public/tools/bindings/mojom.gni")
import("//net/features.gni")
import("//services/network/public/cpp/features.gni")
import("//testing/libfuzzer/fuzzer_test.gni")
jumbo_component("network_service") {
sources = [
"chunked_data_pipe_upload_data_stream.cc",
"chunked_data_pipe_upload_data_stream.h",
"conditional_cache_deletion_helper.cc",
"conditional_cache_deletion_helper.h",
"cookie_access_delegate_impl.cc",
"cookie_access_delegate_impl.h",
"cookie_manager.cc",
"cookie_manager.h",
"cookie_settings.cc",
"cookie_settings.h",
"cors/cors_url_loader.cc",
"cors/cors_url_loader.h",
"cors/cors_url_loader_factory.cc",
"cors/cors_url_loader_factory.h",
"cors/preflight_controller.cc",
"cors/preflight_controller.h",
"crl_set_distributor.cc",
"crl_set_distributor.h",
"cross_origin_read_blocking.cc",
"cross_origin_read_blocking.h",
"cross_origin_resource_policy.cc",
"cross_origin_resource_policy.h",
"data_pipe_element_reader.cc",
"data_pipe_element_reader.h",
"dns_config_change_manager.cc",
"dns_config_change_manager.h",
"empty_url_loader_client.cc",
"empty_url_loader_client.h",
"host_resolver.cc",
"host_resolver.h",
"host_resolver_mdns_listener.cc",
"host_resolver_mdns_listener.h",
"http_auth_cache_copier.cc",
"http_auth_cache_copier.h",
"http_cache_data_counter.cc",
"http_cache_data_counter.h",
"http_cache_data_remover.cc",
"http_cache_data_remover.h",
"http_server_properties_pref_delegate.cc",
"http_server_properties_pref_delegate.h",
"ignore_errors_cert_verifier.cc",
"ignore_errors_cert_verifier.h",
"initiator_lock_compatibility.cc",
"initiator_lock_compatibility.h",
"keepalive_statistics_recorder.cc",
"keepalive_statistics_recorder.h",
"loader_util.cc",
"loader_util.h",
"mojo_host_resolver_impl.cc",
"mojo_host_resolver_impl.h",
"net_log_exporter.cc",
"net_log_exporter.h",
"network_change_manager.cc",
"network_change_manager.h",
"network_context.cc",
"network_context.h",
"network_qualities_pref_delegate.cc",
"network_qualities_pref_delegate.h",
"network_quality_estimator_manager.cc",
"network_quality_estimator_manager.h",
"network_sandbox_hook_linux.cc",
"network_sandbox_hook_linux.h",
"network_sandbox_win.cc",
"network_sandbox_win.h",
"network_service.cc",
"network_service.h",
"network_service_network_delegate.cc",
"network_service_network_delegate.h",
"network_service_proxy_delegate.cc",
"network_service_proxy_delegate.h",
"network_usage_accumulator.cc",
"network_usage_accumulator.h",
"origin_policy/origin_policy_constants.h",
"origin_policy/origin_policy_fetcher.cc",
"origin_policy/origin_policy_fetcher.h",
"origin_policy/origin_policy_header_values.h",
"origin_policy/origin_policy_manager.cc",
"origin_policy/origin_policy_manager.h",
"origin_policy/origin_policy_parser.cc",
"origin_policy/origin_policy_parser.h",
"p2p/socket.cc",
"p2p/socket.h",
"p2p/socket_manager.cc",
"p2p/socket_manager.h",
"p2p/socket_tcp.cc",
"p2p/socket_tcp.h",
"p2p/socket_tcp_server.cc",
"p2p/socket_tcp_server.h",
"p2p/socket_throttler.cc",
"p2p/socket_throttler.h",
"p2p/socket_udp.cc",
"p2p/socket_udp.h",
"pending_callback_chain.cc",
"pending_callback_chain.h",
"proxy_config_service_mojo.cc",
"proxy_config_service_mojo.h",
"proxy_lookup_request.cc",
"proxy_lookup_request.h",
"proxy_resolver_factory_mojo.cc",
"proxy_resolver_factory_mojo.h",
"proxy_resolving_client_socket.cc",
"proxy_resolving_client_socket.h",
"proxy_resolving_client_socket_factory.cc",
"proxy_resolving_client_socket_factory.h",
"proxy_resolving_socket_factory_mojo.cc",
"proxy_resolving_socket_factory_mojo.h",
"proxy_resolving_socket_mojo.cc",
"proxy_resolving_socket_mojo.h",
"proxy_service_mojo.cc",
"proxy_service_mojo.h",
"resolve_host_request.cc",
"resolve_host_request.h",
"resource_scheduler/resource_scheduler.cc",
"resource_scheduler/resource_scheduler.h",
"resource_scheduler/resource_scheduler_client.cc",
"resource_scheduler/resource_scheduler_client.h",
"resource_scheduler/resource_scheduler_params_manager.cc",
"resource_scheduler/resource_scheduler_params_manager.h",
"restricted_cookie_manager.cc",
"restricted_cookie_manager.h",
"sec_header_helpers.cc",
"sec_header_helpers.h",
"session_cleanup_cookie_store.cc",
"session_cleanup_cookie_store.h",
"socket_data_pump.cc",
"socket_data_pump.h",
"socket_factory.cc",
"socket_factory.h",
"ssl_config_service_mojo.cc",
"ssl_config_service_mojo.h",
"ssl_config_type_converter.cc",
"ssl_config_type_converter.h",
"tcp_bound_socket.cc",
"tcp_bound_socket.h",
"tcp_connected_socket.cc",
"tcp_connected_socket.h",
"tcp_server_socket.cc",
"tcp_server_socket.h",
"throttling/network_conditions.cc",
"throttling/network_conditions.h",
"throttling/scoped_throttling_token.cc",
"throttling/scoped_throttling_token.h",
"throttling/throttling_controller.cc",
"throttling/throttling_controller.h",
"throttling/throttling_network_interceptor.cc",
"throttling/throttling_network_interceptor.h",
"throttling/throttling_network_transaction.cc",
"throttling/throttling_network_transaction.h",
"throttling/throttling_network_transaction_factory.cc",
"throttling/throttling_network_transaction_factory.h",
"throttling/throttling_upload_data_stream.cc",
"throttling/throttling_upload_data_stream.h",
"tls_client_socket.cc",
"tls_client_socket.h",
"tls_socket_factory.cc",
"tls_socket_factory.h",
"transitional_url_loader_factory_owner.cc",
"transitional_url_loader_factory_owner.h",
"udp_socket.cc",
"udp_socket.h",
"upload_progress_tracker.cc",
"upload_progress_tracker.h",
"url_loader.cc",
"url_loader.h",
"url_loader_factory.cc",
"url_loader_factory.h",
"url_request_context_builder_mojo.cc",
"url_request_context_builder_mojo.h",
"url_request_context_owner.cc",
"url_request_context_owner.h",
]
if (enable_mdns) {
sources += [
"mdns_responder.cc",
"mdns_responder.h",
]
}
if (!is_ios) {
sources += [
"websocket.cc",
"websocket.h",
"websocket_factory.cc",
"websocket_factory.h",
"websocket_throttler.cc",
"websocket_throttler.h",
]
}
if (is_chromeos) {
sources += [
"cert_verifier_with_trust_anchors.cc",
"cert_verifier_with_trust_anchors.h",
"cert_verify_proc_chromeos.cc",
"cert_verify_proc_chromeos.h",
"dhcp_pac_file_fetcher_mojo.cc",
"dhcp_pac_file_fetcher_mojo.h",
"nss_temp_certs_cache_chromeos.cc",
"nss_temp_certs_cache_chromeos.h",
"system_trust_store_provider_chromeos.cc",
"system_trust_store_provider_chromeos.h",
]
}
configs += [ "//build/config/compiler:wexit_time_destructors" ]
deps = [
"//base",
"//components/content_settings/core/common",
"//components/cookie_config",
"//components/domain_reliability",
"//components/network_session_configurator/browser",
"//components/network_session_configurator/common",
"//components/os_crypt",
"//components/prefs",
"//jingle:fake_ssl_socket",
"//mojo/core/embedder",
"//mojo/public/cpp/bindings",
"//mojo/public/cpp/system",
"//net",
"//net:extras",
"//services/network/public/cpp",
"//services/network/public/mojom",
"//services/service_manager/public/cpp",
"//services/service_manager/public/mojom",
"//services/service_manager/sandbox:sandbox",
"//third_party/webrtc/media:rtc_media_base",
"//third_party/webrtc/rtc_base",
"//third_party/webrtc/rtc_base:timeutils",
"//third_party/webrtc_overrides",
"//third_party/webrtc_overrides:init_webrtc",
"//url",
]
public_deps = [
"//services/network/public/cpp:buildflags",
]
if (is_ct_supported) {
sources += [
"expect_ct_reporter.cc",
"expect_ct_reporter.h",
]
deps += [ "//components/certificate_transparency" ]
}
if (is_linux) {
deps += [
"//sandbox/linux:sandbox_services",
"//services/service_manager/sandbox:sandbox",
]
}
if (is_android) {
deps += [
"//crypto",
"//third_party/boringssl",
]
}
if (is_win) {
deps += [ "//sandbox/win:sandbox" ]
}
defines = [ "IS_NETWORK_SERVICE_IMPL" ]
if (is_chromecast) {
defines += [ "IS_CHROMECAST" ]
}
if (trial_comparison_cert_verifier_supported) {
sources += [
"trial_comparison_cert_verifier_mojo.cc",
"trial_comparison_cert_verifier_mojo.h",
]
}
}
source_set("tests") {
testonly = true
sources = [
"chunked_data_pipe_upload_data_stream_unittest.cc",
"cookie_manager_unittest.cc",
"cookie_settings_unittest.cc",
"cors/cors_url_loader_factory_unittest.cc",
"cors/cors_url_loader_unittest.cc",
"cors/preflight_controller_unittest.cc",
"cross_origin_read_blocking_unittest.cc",
"cross_origin_resource_policy_unittest.cc",
"data_pipe_element_reader_unittest.cc",
"dns_config_change_manager_unittest.cc",
"host_resolver_unittest.cc",
"http_cache_data_counter_unittest.cc",
"http_cache_data_remover_unittest.cc",
"ignore_errors_cert_verifier_unittest.cc",
"initiator_lock_compatibility_unittest.cc",
"keepalive_statistics_recorder_unittest.cc",
"mojo_host_resolver_impl_unittest.cc",
"network_change_manager_unittest.cc",
"network_context_unittest.cc",
"network_qualities_pref_delegate_unittest.cc",
"network_quality_estimator_manager_unittest.cc",
"network_service_proxy_delegate_unittest.cc",
"network_service_unittest.cc",
"network_usage_accumulator_unittest.cc",
"origin_policy/origin_policy_fetcher_unittest.cc",
"origin_policy/origin_policy_manager_unittest.cc",
"origin_policy/origin_policy_parser_unittest.cc",
"p2p/socket_tcp_server_unittest.cc",
"p2p/socket_tcp_unittest.cc",
"p2p/socket_test_utils.cc",
"p2p/socket_test_utils.h",
"p2p/socket_udp_unittest.cc",
"pending_callback_chain_unittest.cc",
"proxy_config_service_mojo_unittest.cc",
"proxy_resolving_client_socket_unittest.cc",
"proxy_resolving_socket_mojo_unittest.cc",
"resource_scheduler/resource_scheduler_params_manager_unittest.cc",
"resource_scheduler/resource_scheduler_unittest.cc",
"restricted_cookie_manager_unittest.cc",
"sec_header_helpers_unittest.cc",
"session_cleanup_cookie_store_unittest.cc",
"socket_data_pump_unittest.cc",
"ssl_config_service_mojo_unittest.cc",
"tcp_bound_socket_unittest.cc",
"tcp_socket_unittest.cc",
"test/test_url_loader_factory_unittest.cc",
"test_chunked_data_pipe_getter.cc",
"test_chunked_data_pipe_getter.h",
"throttling/throttling_controller_unittest.cc",
"tls_client_socket_unittest.cc",
"transitional_url_loader_factory_owner_unittest.cc",
"udp_socket_unittest.cc",
"upload_progress_tracker_unittest.cc",
"url_loader_unittest.cc",
]
if (enable_mdns) {
sources += [ "mdns_responder_unittest.cc" ]
}
if (!is_ios) {
sources += [
"proxy_resolver_factory_mojo_unittest.cc",
"websocket_throttler_unittest.cc",
]
data = [
"//net/tools/testserver/",
"//services/test/data",
"//third_party/pywebsocket/src/mod_pywebsocket/",
"//third_party/tlslite/",
]
}
if (is_chromeos) {
sources += [
"cert_verifier_with_trust_anchors_unittest.cc",
"cert_verify_proc_chromeos_unittest.cc",
"dhcp_pac_file_fetcher_mojo_unittest.cc",
"nss_temp_certs_cache_chromeos_unittest.cc",
]
}
deps = [
":network_service",
":test_support",
"//base",
"//components/network_session_configurator/browser",
"//components/prefs:test_support",
"//components/variations:test_support",
"//crypto:test_support",
"//jingle:fake_ssl_socket",
"//mojo/core/embedder",
"//mojo/public/cpp/bindings",
"//mojo/public/cpp/system",
"//net",
"//net:extras",
"//net:test_support",
"//net/http:transport_security_state_unittest_data_default",
"//services/network/public/cpp",
"//services/network/public/cpp:buildflags",
"//services/network/public/mojom",
"//services/service_manager/public/cpp",
"//services/service_manager/public/cpp/test:test_support",
"//testing/gtest",
]
if (is_ct_supported) {
sources += [ "expect_ct_reporter_unittest.cc" ]
deps += [ "//components/certificate_transparency" ]
}
if (trial_comparison_cert_verifier_supported) {
sources += [ "trial_comparison_cert_verifier_mojo_unittest.cc" ]
}
}
jumbo_source_set("test_support") {
testonly = true
sources = [
"mojo_socket_test_util.cc",
"mojo_socket_test_util.h",
"test/test_cookie_manager.cc",
"test/test_cookie_manager.h",
"test/test_data_pipe_getter.cc",
"test/test_data_pipe_getter.h",
"test/test_network_connection_tracker.cc",
"test/test_network_connection_tracker.h",
"test/test_network_context.h",
"test/test_network_context_client.cc",
"test/test_network_context_client.h",
"test/test_network_quality_tracker.cc",
"test/test_network_quality_tracker.h",
"test/test_network_service_client.cc",
"test/test_network_service_client.h",
"test/test_shared_url_loader_factory.cc",
"test/test_shared_url_loader_factory.h",
"test/test_url_loader_client.cc",
"test/test_url_loader_client.h",
"test/test_url_loader_factory.cc",
"test/test_url_loader_factory.h",
"test/test_utils.cc",
"test/test_utils.h",
"udp_socket_test_util.cc",
"udp_socket_test_util.h",
]
if (is_chromeos) {
sources += [
"mock_mojo_dhcp_wpad_url_client.cc",
"mock_mojo_dhcp_wpad_url_client.h",
]
}
public_deps = [
"//services/network/public/cpp",
"//services/network/public/cpp:buildflags",
"//services/network/public/mojom",
]
deps = [
"//base",
"//mojo/public/cpp/bindings",
"//net",
"//net:test_support",
"//services/network:network_service",
"//testing/gtest",
]
}
fuzzer_test("network_content_security_policy_fuzzer") {
sources = [
"content_security_policy_fuzzer.cc",
]
deps = [
"//base",
"//net",
"//services/network:network_service",
"//services/network/public/cpp",
"//services/network/public/mojom",
]
dict = "//testing/libfuzzer/fuzzers/dicts/content_security_policy.dict"
seed_corpus = "//testing/libfuzzer/fuzzers/content_security_policy_corpus"
}