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

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

Issue 2709393007: Add back "default address family" to HostResolver (Closed)
Patch Set: another link to bug 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
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. This is used
353 // only to disable IPv6 in Cronet, and can be removed when support for the
xunjieli 2017/02/27 15:41:38 same here.
mgersh 2017/02/28 16:49:06 Done.
354 // option is no longer needed. See http://crbug.com/696569.
355 AddressFamily default_address_family_;
356
349 // True if DnsConfigService detected that system configuration depends on 357 // True if DnsConfigService detected that system configuration depends on
350 // local IPv6 connectivity. Disables probing. 358 // local IPv6 connectivity. Disables probing.
351 bool use_local_ipv6_; 359 bool use_local_ipv6_;
352 360
353 base::TimeTicks last_ipv6_probe_time_; 361 base::TimeTicks last_ipv6_probe_time_;
354 bool last_ipv6_probe_result_; 362 bool last_ipv6_probe_result_;
355 363
356 // True iff ProcTask has successfully resolved a hostname known to have IPv6 364 // True iff ProcTask has successfully resolved a hostname known to have IPv6
357 // addresses using ADDRESS_FAMILY_UNSPECIFIED. Reset on IP address change. 365 // addresses using ADDRESS_FAMILY_UNSPECIFIED. Reset on IP address change.
358 bool resolved_known_ipv6_hostname_; 366 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. 398 // 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 399 // TODO(tfarina): It would be better to change the tests so this function
392 // gets exercised indirectly through HostResolverImpl. 400 // gets exercised indirectly through HostResolverImpl.
393 NET_EXPORT_PRIVATE bool ResolveLocalHostname(base::StringPiece host, 401 NET_EXPORT_PRIVATE bool ResolveLocalHostname(base::StringPiece host,
394 uint16_t port, 402 uint16_t port,
395 AddressList* address_list); 403 AddressList* address_list);
396 404
397 } // namespace net 405 } // namespace net
398 406
399 #endif // NET_DNS_HOST_RESOLVER_IMPL_H_ 407 #endif // NET_DNS_HOST_RESOLVER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698