| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NET_DNS_HOST_RESOLVER_IMPL_H_ | 5 #ifndef NET_DNS_HOST_RESOLVER_IMPL_H_ |
| 6 #define NET_DNS_HOST_RESOLVER_IMPL_H_ | 6 #define NET_DNS_HOST_RESOLVER_IMPL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 // returned to indicate how stale (or not) it is. | 151 // returned to indicate how stale (or not) it is. |
| 152 int ResolveStaleFromCache(const RequestInfo& info, | 152 int ResolveStaleFromCache(const RequestInfo& info, |
| 153 AddressList* addresses, | 153 AddressList* addresses, |
| 154 HostCache::EntryStaleness* stale_info, | 154 HostCache::EntryStaleness* stale_info, |
| 155 const NetLogWithSource& source_net_log); | 155 const NetLogWithSource& source_net_log); |
| 156 | 156 |
| 157 void InitializePersistence( | 157 void InitializePersistence( |
| 158 const PersistCallback& persist_callback, | 158 const PersistCallback& persist_callback, |
| 159 std::unique_ptr<const base::Value> old_data) override; | 159 std::unique_ptr<const base::Value> old_data) override; |
| 160 | 160 |
| 161 void SetDefaultAddressFamily(AddressFamily address_family) override; | |
| 162 AddressFamily GetDefaultAddressFamily() const override; | |
| 163 | |
| 164 void SetNoIPv6OnWifi(bool no_ipv6_on_wifi) override; | 161 void SetNoIPv6OnWifi(bool no_ipv6_on_wifi) override; |
| 165 bool GetNoIPv6OnWifi() override; | 162 bool GetNoIPv6OnWifi() override; |
| 166 | 163 |
| 167 void set_proc_params_for_test(const ProcTaskParams& proc_params) { | 164 void set_proc_params_for_test(const ProcTaskParams& proc_params) { |
| 168 proc_params_ = proc_params; | 165 proc_params_ = proc_params; |
| 169 } | 166 } |
| 170 | 167 |
| 171 protected: | 168 protected: |
| 172 // Just like the public constructor, but allows the task runner used for | 169 // Just like the public constructor, but allows the task runner used for |
| 173 // blocking tasks to be specified. Intended for testing only. | 170 // blocking tasks to be specified. Intended for testing only. |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 // If present, used by DnsTask and ServeFromHosts to resolve requests. | 346 // If present, used by DnsTask and ServeFromHosts to resolve requests. |
| 350 std::unique_ptr<DnsClient> dns_client_; | 347 std::unique_ptr<DnsClient> dns_client_; |
| 351 | 348 |
| 352 // True if received valid config from |dns_config_service_|. Temporary, used | 349 // True if received valid config from |dns_config_service_|. Temporary, used |
| 353 // to measure performance of DnsConfigService: http://crbug.com/125599 | 350 // to measure performance of DnsConfigService: http://crbug.com/125599 |
| 354 bool received_dns_config_; | 351 bool received_dns_config_; |
| 355 | 352 |
| 356 // Number of consecutive failures of DnsTask, counted when fallback succeeds. | 353 // Number of consecutive failures of DnsTask, counted when fallback succeeds. |
| 357 unsigned num_dns_failures_; | 354 unsigned num_dns_failures_; |
| 358 | 355 |
| 359 // Address family to use when the request doesn't specify one. See | |
| 360 // http://crbug.com/696569 for why the option is needed. | |
| 361 AddressFamily default_address_family_; | |
| 362 | |
| 363 // True if IPv6 should not be attempted when on a WiFi connection. See | 356 // True if IPv6 should not be attempted when on a WiFi connection. See |
| 364 // https://crbug.com/696569 for further context. | 357 // https://crbug.com/696569 for further context. |
| 365 bool assume_ipv6_failure_on_wifi_; | 358 bool assume_ipv6_failure_on_wifi_; |
| 366 | 359 |
| 367 // True if DnsConfigService detected that system configuration depends on | 360 // True if DnsConfigService detected that system configuration depends on |
| 368 // local IPv6 connectivity. Disables probing. | 361 // local IPv6 connectivity. Disables probing. |
| 369 bool use_local_ipv6_; | 362 bool use_local_ipv6_; |
| 370 | 363 |
| 371 base::TimeTicks last_ipv6_probe_time_; | 364 base::TimeTicks last_ipv6_probe_time_; |
| 372 bool last_ipv6_probe_result_; | 365 bool last_ipv6_probe_result_; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 // This function is only exposed so it can be unit-tested. | 401 // This function is only exposed so it can be unit-tested. |
| 409 // TODO(tfarina): It would be better to change the tests so this function | 402 // TODO(tfarina): It would be better to change the tests so this function |
| 410 // gets exercised indirectly through HostResolverImpl. | 403 // gets exercised indirectly through HostResolverImpl. |
| 411 NET_EXPORT_PRIVATE bool ResolveLocalHostname(base::StringPiece host, | 404 NET_EXPORT_PRIVATE bool ResolveLocalHostname(base::StringPiece host, |
| 412 uint16_t port, | 405 uint16_t port, |
| 413 AddressList* address_list); | 406 AddressList* address_list); |
| 414 | 407 |
| 415 } // namespace net | 408 } // namespace net |
| 416 | 409 |
| 417 #endif // NET_DNS_HOST_RESOLVER_IMPL_H_ | 410 #endif // NET_DNS_HOST_RESOLVER_IMPL_H_ |
| OLD | NEW |