# 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("//mojo/public/tools/bindings/mojom.gni") import("//services/catalog/public/tools/catalog.gni") import("//services/service_manager/public/cpp/service.gni") import("//services/service_manager/public/service_manifest.gni") import("//services/service_manager/public/tools/test/service_test.gni") 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_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", "cross_origin_read_blocking.cc", "cross_origin_read_blocking.h", "data_pipe_element_reader.cc", "data_pipe_element_reader.h", "empty_url_loader_client.cc", "empty_url_loader_client.h", "expect_ct_reporter.cc", "expect_ct_reporter.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", "keepalive_statistics_recorder.cc", "keepalive_statistics_recorder.h", "loader_util.cc", "loader_util.h", "mojo_net_log.cc", "mojo_net_log.h", "network_change_manager.cc", "network_change_manager.h", "network_context.cc", "network_context.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_usage_accumulator.cc", "network_usage_accumulator.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", "proxy_config_service_mojo.cc", "proxy_config_service_mojo.h", "proxy_lookup_request.cc", "proxy_lookup_request.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", "resolve_host_request.cc", "resolve_host_request.h", "resource_scheduler.cc", "resource_scheduler.h", "resource_scheduler_client.cc", "resource_scheduler_client.h", "resource_scheduler_params_manager.cc", "resource_scheduler_params_manager.h", "restricted_cookie_manager.cc", "restricted_cookie_manager.h", "session_cleanup_channel_id_store.cc", "session_cleanup_channel_id_store.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_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", "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 (!is_ios) { sources += [ "websocket.cc", "websocket.h", "websocket_factory.cc", "websocket_factory.h", "websocket_throttler.cc", "websocket_throttler.h", ] } deps = [ "//base", "//components/certificate_transparency", "//components/content_settings/core/common", "//components/cookie_config", "//components/network_session_configurator/browser", "//components/network_session_configurator/common", "//components/os_crypt", "//components/prefs", "//jingle:jingle_fake_socket", "//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_overrides", "//third_party/webrtc_overrides:init_webrtc", "//url", ] 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" ] } # TODO(sdefresne): This depends on net's enable_net_mojo getting turned on for # iOS, which depends on net_with_v8 as well. http://crbug.com/803149 if (!is_ios) { sources += [ "proxy_resolver_factory_mojo.cc", "proxy_resolver_factory_mojo.h", "proxy_service_mojo.cc", "proxy_service_mojo.h", ] deps += [ "//net/dns:mojo_service" ] } defines = [ "IS_NETWORK_SERVICE_IMPL" ] if (is_chromecast) { defines += [ "IS_CHROMECAST" ] } } 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_unittest.cc", "cors/preflight_controller_unittest.cc", "cross_origin_read_blocking_unittest.cc", "data_pipe_element_reader_unittest.cc", "expect_ct_reporter_unittest.cc", "http_cache_data_counter_unittest.cc", "http_cache_data_remover_unittest.cc", "ignore_errors_cert_verifier_unittest.cc", "keepalive_statistics_recorder_unittest.cc", "network_change_manager_unittest.cc", "network_context_unittest.cc", "network_quality_estimator_manager_unittest.cc", "network_service_unittest.cc", "network_usage_accumulator_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", "proxy_config_service_mojo_unittest.cc", "proxy_resolving_client_socket_unittest.cc", "proxy_resolving_socket_mojo_unittest.cc", "resource_scheduler_params_manager_unittest.cc", "resource_scheduler_unittest.cc", "restricted_cookie_manager_unittest.cc", "session_cleanup_channel_id_store_unittest.cc", "session_cleanup_cookie_store_unittest.cc", "socket_data_pump_unittest.cc", "ssl_config_service_mojo_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", "udp_socket_unittest.cc", "upload_progress_tracker_unittest.cc", "url_loader_unittest.cc", ] if (!is_ios) { sources += [ "network_context_cert_transparency_unittest.cc", "proxy_resolver_factory_mojo_unittest.cc", "websocket_throttler_unittest.cc", ] data = [ "//net/tools/testserver/", "//services/test/data", "//third_party/pyftpdlib/", "//third_party/pywebsocket/src/mod_pywebsocket/", "//third_party/tlslite/", ] } deps = [ ":network_service", ":test_support", "//base", "//components/certificate_transparency", "//components/network_session_configurator/browser", "//jingle:jingle_fake_socket", "//mojo/core/embedder", "//mojo/public/cpp/bindings", "//mojo/public/cpp/system", "//net", "//net:extras", "//net:test_support", "//services/network/public/cpp", "//services/network/public/mojom", "//services/service_manager/public/cpp", "//services/service_manager/public/cpp:service_test_support", "//testing/gtest", ] } source_set("test_support") { testonly = true sources = [ "mojo_socket_test_util.cc", "mojo_socket_test_util.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_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", ] public_deps = [ "//services/network/public/cpp", "//services/network/public/mojom", ] deps = [ "//base", "//mojo/public/cpp/bindings", "//net", "//net:test_support", "//services/network:network_service", "//testing/gtest", ] } service_manifest("manifest") { name = "network" source = "manifest.json" } service_manifest("unittest_manifest") { name = "network_unittests" source = "test/service_unittest_manifest.json" packaged_services = [ ":manifest" ] } catalog("tests_catalog") { testonly = true embedded_services = [ ":unittest_manifest" ] }