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 <map> | 8 #include <map> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 AddressList* addresses); | 193 AddressList* addresses); |
194 | 194 |
195 // Callback from HaveOnlyLoopbackAddresses probe. | 195 // Callback from HaveOnlyLoopbackAddresses probe. |
196 void SetHaveOnlyLoopbackAddresses(bool result); | 196 void SetHaveOnlyLoopbackAddresses(bool result); |
197 | 197 |
198 // Returns the (hostname, address_family) key to use for |info|, choosing an | 198 // Returns the (hostname, address_family) key to use for |info|, choosing an |
199 // "effective" address family by inheriting the resolver's default address | 199 // "effective" address family by inheriting the resolver's default address |
200 // family when the request leaves it unspecified. | 200 // family when the request leaves it unspecified. |
201 Key GetEffectiveKeyForRequest(const RequestInfo& info, | 201 Key GetEffectiveKeyForRequest(const RequestInfo& info, |
202 const IPAddressNumber* ip_number, | 202 const IPAddressNumber* ip_number, |
203 const BoundNetLog& net_log) const; | 203 const BoundNetLog& net_log); |
| 204 |
| 205 // Probes IPv6 support and returns true if IPv6 support is enabled. |
| 206 // Results are cached, i.e. when called repeatedly this method returns result |
| 207 // from the first probe for some time before probing again. |
| 208 bool IsIPv6Reachable(const BoundNetLog& net_log); |
204 | 209 |
205 // Records the result in cache if cache is present. | 210 // Records the result in cache if cache is present. |
206 void CacheResult(const Key& key, | 211 void CacheResult(const Key& key, |
207 const HostCache::Entry& entry, | 212 const HostCache::Entry& entry, |
208 base::TimeDelta ttl); | 213 base::TimeDelta ttl); |
209 | 214 |
210 // Removes |job| from |jobs_|, only if it exists. | 215 // Removes |job| from |jobs_|, only if it exists. |
211 void RemoveJob(Job* job); | 216 void RemoveJob(Job* job); |
212 | 217 |
213 // Aborts all in progress jobs with ERR_NETWORK_CHANGED and notifies their | 218 // Aborts all in progress jobs with ERR_NETWORK_CHANGED and notifies their |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 unsigned num_dns_failures_; | 282 unsigned num_dns_failures_; |
278 | 283 |
279 // True if probing is done for each Request to set address family. When false, | 284 // True if probing is done for each Request to set address family. When false, |
280 // explicit setting in |default_address_family_| is used. | 285 // explicit setting in |default_address_family_| is used. |
281 bool probe_ipv6_support_; | 286 bool probe_ipv6_support_; |
282 | 287 |
283 // True if DnsConfigService detected that system configuration depends on | 288 // True if DnsConfigService detected that system configuration depends on |
284 // local IPv6 connectivity. Disables probing. | 289 // local IPv6 connectivity. Disables probing. |
285 bool use_local_ipv6_; | 290 bool use_local_ipv6_; |
286 | 291 |
| 292 base::TimeTicks last_ipv6_probe_time_; |
| 293 bool last_ipv6_probe_result_; |
| 294 |
287 // True iff ProcTask has successfully resolved a hostname known to have IPv6 | 295 // True iff ProcTask has successfully resolved a hostname known to have IPv6 |
288 // addresses using ADDRESS_FAMILY_UNSPECIFIED. Reset on IP address change. | 296 // addresses using ADDRESS_FAMILY_UNSPECIFIED. Reset on IP address change. |
289 bool resolved_known_ipv6_hostname_; | 297 bool resolved_known_ipv6_hostname_; |
290 | 298 |
291 // Any resolver flags that should be added to a request by default. | 299 // Any resolver flags that should be added to a request by default. |
292 HostResolverFlags additional_resolver_flags_; | 300 HostResolverFlags additional_resolver_flags_; |
293 | 301 |
294 // Allow fallback to ProcTask if DnsTask fails. | 302 // Allow fallback to ProcTask if DnsTask fails. |
295 bool fallback_to_proctask_; | 303 bool fallback_to_proctask_; |
296 | 304 |
297 base::WeakPtrFactory<HostResolverImpl> weak_ptr_factory_; | 305 base::WeakPtrFactory<HostResolverImpl> weak_ptr_factory_; |
298 | 306 |
299 base::WeakPtrFactory<HostResolverImpl> probe_weak_ptr_factory_; | 307 base::WeakPtrFactory<HostResolverImpl> probe_weak_ptr_factory_; |
300 | 308 |
301 DISALLOW_COPY_AND_ASSIGN(HostResolverImpl); | 309 DISALLOW_COPY_AND_ASSIGN(HostResolverImpl); |
302 }; | 310 }; |
303 | 311 |
304 } // namespace net | 312 } // namespace net |
305 | 313 |
306 #endif // NET_DNS_HOST_RESOLVER_IMPL_H_ | 314 #endif // NET_DNS_HOST_RESOLVER_IMPL_H_ |
OLD | NEW |