blob: 9ce2a22b2938bd1b326036d99ecebf4d6c3378a8 [file] [log] [blame]
# Copyright 2021 The Cobalt Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//cobalt/network/certs.gni")
static_library("network") {
has_pedantic_warnings = true
sources = [
"cookie_jar_impl.cc",
"cookie_jar_impl.h",
"disk_cache/cobalt_backend_factory.cc",
"disk_cache/cobalt_backend_factory.h",
"disk_cache/cobalt_backend_impl.cc",
"disk_cache/cobalt_backend_impl.h",
"disk_cache/cobalt_disk_cache.cc",
"disk_cache/cobalt_disk_cache.h",
"disk_cache/resource_type.cc",
"disk_cache/resource_type.h",
"job_factory_config.h",
"local_network.cc",
"local_network.h",
"net_poster.cc",
"net_poster.h",
"network_delegate.cc",
"network_delegate.h",
"network_module.cc",
"network_module.h",
"network_system.h",
"persistent_cookie_store.cc",
"persistent_cookie_store.h",
"proxy_config_service.h",
"socket_address_parser.cc",
"socket_address_parser.h",
"starboard/network_system.cc",
"starboard/proxy_config_service.cc",
"switches.cc",
"switches.h",
"url_request_context.cc",
"url_request_context.h",
"url_request_context_getter.cc",
"url_request_context_getter.h",
]
public_deps = [ "//net" ]
deps = [
":copy_ssl_certificates",
"//cobalt/base",
"//cobalt/build:cobalt_build_id",
"//cobalt/configuration",
"//cobalt/network_bridge",
"//cobalt/persistent_storage:persistent_settings",
"//cobalt/storage",
"//starboard/common",
"//third_party/protobuf:protobuf_lite",
"//url",
]
if (!is_gold) {
deps += [ "//cobalt/debug:console_command_manager" ]
}
if (enable_in_app_dial) {
deps += [ ":cobalt_dial_server" ]
}
# Enable network logging on all but gold builds.
if (!is_gold) {
sources += [
"cobalt_net_log.cc",
"cobalt_net_log.h",
"net_log_constants.cc",
"net_log_constants.h",
]
defines = [ "ENABLE_NETWORK_LOGGING" ]
}
if (!sb_is_modular) {
deps += cobalt_platform_dependencies
}
}
copy("copy_ssl_certificates") {
install_content = true
sources = network_certs
outputs =
[ "$sb_static_contents_output_data_dir/ssl/certs/{{source_file_part}}" ]
}
target(gtest_target_type, "network_test") {
testonly = true
has_pedantic_warnings = true
sources = [
"local_network_test.cc",
"persistent_cookie_store_test.cc",
]
deps = [
":network",
"//cobalt/base",
"//cobalt/storage",
"//cobalt/test:run_all_unittests",
"//testing/gmock",
"//testing/gtest",
"//url",
]
if (enable_in_app_dial) {
sources += [
"dial/dial_http_server_unittest.cc",
"dial/dial_service_unittest.cc",
"dial/dial_test_helpers.h",
"dial/dial_udp_server_unittests.cc",
]
deps += [
":cobalt_dial_server",
"//net",
"//net:http_server",
"//net:test_support",
]
}
}
if (enable_in_app_dial) {
static_library("cobalt_dial_server") {
sources = [
"dial/dial_http_server.cc",
"dial/dial_http_server.h",
"dial/dial_service.cc",
"dial/dial_service.h",
"dial/dial_service_handler.h",
"dial/dial_system_config.cc",
"dial/dial_system_config.h",
"dial/dial_system_config_starboard.cc",
"dial/dial_udp_server.cc",
"dial/dial_udp_server.h",
"dial/dial_udp_socket_factory.cc",
"dial/dial_udp_socket_factory.h",
]
deps = [
"//base:base",
"//net",
"//net:http_server",
"//starboard/common",
]
}
}