# Copyright 2018 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("//net/features.gni") enable_built_in_dns = !is_ios source_set("dns") { # Due to circular dependencies, should only be depended on through //net. visibility = [ "//net", "//net/http:transport_security_state_generated_files", ] # Internals only intended for use inside network stack (and tests). friend = [ "//net/*", ] public = [] sources = [ "address_info.cc", "address_info.h", "address_sorter.h", "context_host_resolver.cc", "context_host_resolver.h", "dns_alias_utility.cc", "dns_alias_utility.h", "dns_config.cc", "dns_config_service.cc", "dns_config_service.h", "dns_hosts.cc", "dns_hosts.h", "dns_query.cc", "dns_query.h", "dns_reloader.cc", "dns_reloader.h", "dns_response.cc", "dns_response_result_extractor.cc", "dns_response_result_extractor.h", "dns_server_iterator.cc", "dns_server_iterator.h", "dns_session.cc", "dns_session.h", "dns_transaction.cc", "dns_udp_tracker.cc", "dns_udp_tracker.h", "dns_util.cc", "dns_util.h", "host_cache.cc", "host_resolver.cc", "host_resolver_manager.cc", "host_resolver_mdns_listener_impl.cc", "host_resolver_mdns_listener_impl.h", "host_resolver_mdns_task.cc", "host_resolver_mdns_task.h", "host_resolver_proc.cc", "host_resolver_proc.h", "host_resolver_results.cc", "https_record_rdata.cc", "httpssvc_metrics.cc", "httpssvc_metrics.h", "mapped_host_resolver.cc", "nsswitch_reader.cc", "nsswitch_reader.h", "record_parsed.cc", "record_rdata.cc", "resolve_context.cc", "resolve_context.h", "serial_worker.cc", "serial_worker.h", "system_dns_config_change_notifier.cc", "system_dns_config_change_notifier.h", "test_dns_config_service.cc", "test_dns_config_service.h", ] if (is_win) { sources += [ "address_sorter_win.cc", "dns_config_service_win.cc", "dns_config_service_win.h", ] } if (is_mac) { sources += [ "dns_config_watcher_mac.cc", "dns_config_watcher_mac.h", "notify_watcher_mac.cc", "notify_watcher_mac.h", ] } if (is_fuchsia) { sources += [ "dns_config_service_fuchsia.cc", "dns_config_service_fuchsia.h", ] } if (is_android) { sources += [ "dns_config_service_android.cc", "dns_config_service_android.h", ] } else if (is_linux) { sources += [ "dns_config_service_linux.cc", "dns_config_service_linux.h", ] } else if (is_posix) { sources += [ "dns_config_service_posix.cc", "dns_config_service_posix.h", ] } if (enable_built_in_dns) { sources += [ "dns_client.cc" ] if (is_posix || is_fuchsia) { sources += [ "address_sorter_posix.cc", "address_sorter_posix.h", ] } } if (enable_mdns) { sources += [ "mdns_cache.cc", "mdns_cache.h", "mdns_client.cc", "mdns_client_impl.cc", "mdns_client_impl.h", ] } deps = [ "//net:net_deps" ] public_deps = [ ":dns_client", ":host_resolver", ":host_resolver_manager", ":mdns_client", "//net:net_public_deps", ] allow_circular_includes_from = [ ":dns_client", ":host_resolver", ":host_resolver_manager", ":mdns_client", ] } # The standard API of net/dns. # # Should typically only be used within the network service. Usage external to # the network service should instead use network service Mojo IPCs for host # resolution. See ResolveHost() in # /services/network/public/mojom/network_context.mojom and # /services/network/public/mojom/host_resolver.mojom. source_set("host_resolver") { # Due to circular dependencies, should only be depended on through //net. # Limit visibility to //net and other source_sets with the same access # restriction. visibility = [ ":dns", ":dns_client", ":host_resolver_manager", ":mdns_client", "//net", ] # Restricted access so we can keep track of all usage external to the # network stack and network service. friend = [ "//net/*", ] sources = [ "dns_config.h", "host_cache.h", "host_resolver.h", "host_resolver_results.h", "mapped_host_resolver.h", ] public = [] deps = [ "//net:net_deps", "//net/dns/public", ] public_deps = [ "//net:net_public_deps" ] allow_circular_includes_from = [ "//net/dns/public" ] } # Shared mostly-global handler of HostResolver requests. # # Typically should only be directly interacted with by NetworkService (or other # mostly-global creators of request contexts), standalone tools, and tests. Host # resolution should generally instead go through HostResolvers received from # URLRequestContext or network service Mojo IPCs. source_set("host_resolver_manager") { # Due to circular dependencies, should only be depended on through //net. # Limit visibility to //net and other source_sets with the same access # restriction. visibility = [ ":dns", ":host_resolver", "//net", ] # Restricted access so we can keep track of all usage external to the # network stack and network service. friend = [ "//net/*", ] sources = [ "host_resolver_manager.h" ] public = [] deps = [ ":host_resolver", "//net:net_deps", "//net/dns/public", ] public_deps = [ "//net:net_public_deps" ] } # DnsClient interfaces. Primarily intended as part of the implementation of the # standard HostResolver interface, but can be used as an alternative external # interface for advanced usage. source_set("dns_client") { # Due to circular dependencies, should only be depended on through //net. # Limit visibility to //net and other source_sets with the same access # restriction. visibility = [ ":dns", ":mdns_client", "//net", ] # Restricted access so we can keep track of all usage external to the # network stack. friend = [ "//net/*", ] sources = [ "dns_client.h", "dns_response.h", "dns_transaction.h", "https_record_rdata.h", "record_parsed.h", "record_rdata.h", ] public = [] deps = [ ":host_resolver", "//net:net_deps", ] public_deps = [ "//net:net_public_deps", "//net/dns/public", ] } # MdnsClient interfaces. source_set("mdns_client") { # Due to circular dependencies, should only be depended on through //net. # Limit visibility to //net and other source_sets with the same access # restriction. visibility = [ ":dns", "//net", ] # Restricted access so we can keep track of all usage external to the # network stack. friend = [ "//net/*", ] public = [] sources = [] if (enable_mdns) { sources += [ "mdns_client.h" ] } deps = [ ":dns_client", ":host_resolver", "//net:net_deps", ] public_deps = [ "//net:net_public_deps" ] }