Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1220)

Side by Side Diff: net/dns/host_resolver_impl.h

Issue 2709393007: Add back "default address family" to HostResolver (Closed)
Patch Set: comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/dns/host_resolver.cc ('k') | net/dns/host_resolver_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
161 void set_proc_params_for_test(const ProcTaskParams& proc_params) { 164 void set_proc_params_for_test(const ProcTaskParams& proc_params) {
162 proc_params_ = proc_params; 165 proc_params_ = proc_params;
163 } 166 }
164 167
165 protected: 168 protected:
166 // 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
167 // blocking tasks to be specified. Intended for testing only. 170 // blocking tasks to be specified. Intended for testing only.
168 HostResolverImpl(const Options& options, 171 HostResolverImpl(const Options& options,
169 NetLog* net_log, 172 NetLog* net_log,
170 scoped_refptr<base::TaskRunner> worker_task_runner); 173 scoped_refptr<base::TaskRunner> worker_task_runner);
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 // If present, used by DnsTask and ServeFromHosts to resolve requests. 342 // If present, used by DnsTask and ServeFromHosts to resolve requests.
340 std::unique_ptr<DnsClient> dns_client_; 343 std::unique_ptr<DnsClient> dns_client_;
341 344
342 // True if received valid config from |dns_config_service_|. Temporary, used 345 // True if received valid config from |dns_config_service_|. Temporary, used
343 // to measure performance of DnsConfigService: http://crbug.com/125599 346 // to measure performance of DnsConfigService: http://crbug.com/125599
344 bool received_dns_config_; 347 bool received_dns_config_;
345 348
346 // Number of consecutive failures of DnsTask, counted when fallback succeeds. 349 // Number of consecutive failures of DnsTask, counted when fallback succeeds.
347 unsigned num_dns_failures_; 350 unsigned num_dns_failures_;
348 351
352 // Address family to use when the request doesn't specify one. See
353 // http://crbug.com/696569 for why the option is needed.
354 AddressFamily default_address_family_;
355
349 // True if DnsConfigService detected that system configuration depends on 356 // True if DnsConfigService detected that system configuration depends on
350 // local IPv6 connectivity. Disables probing. 357 // local IPv6 connectivity. Disables probing.
351 bool use_local_ipv6_; 358 bool use_local_ipv6_;
352 359
353 base::TimeTicks last_ipv6_probe_time_; 360 base::TimeTicks last_ipv6_probe_time_;
354 bool last_ipv6_probe_result_; 361 bool last_ipv6_probe_result_;
355 362
356 // True iff ProcTask has successfully resolved a hostname known to have IPv6 363 // True iff ProcTask has successfully resolved a hostname known to have IPv6
357 // addresses using ADDRESS_FAMILY_UNSPECIFIED. Reset on IP address change. 364 // addresses using ADDRESS_FAMILY_UNSPECIFIED. Reset on IP address change.
358 bool resolved_known_ipv6_hostname_; 365 bool resolved_known_ipv6_hostname_;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 // This function is only exposed so it can be unit-tested. 397 // This function is only exposed so it can be unit-tested.
391 // TODO(tfarina): It would be better to change the tests so this function 398 // TODO(tfarina): It would be better to change the tests so this function
392 // gets exercised indirectly through HostResolverImpl. 399 // gets exercised indirectly through HostResolverImpl.
393 NET_EXPORT_PRIVATE bool ResolveLocalHostname(base::StringPiece host, 400 NET_EXPORT_PRIVATE bool ResolveLocalHostname(base::StringPiece host,
394 uint16_t port, 401 uint16_t port,
395 AddressList* address_list); 402 AddressList* address_list);
396 403
397 } // namespace net 404 } // namespace net
398 405
399 #endif // NET_DNS_HOST_RESOLVER_IMPL_H_ 406 #endif // NET_DNS_HOST_RESOLVER_IMPL_H_
OLDNEW
« no previous file with comments | « net/dns/host_resolver.cc ('k') | net/dns/host_resolver_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698