| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_BASE_HOST_RESOLVER_IMPL_H_ | 5 #ifndef NET_BASE_HOST_RESOLVER_IMPL_H_ |
| 6 #define NET_BASE_HOST_RESOLVER_IMPL_H_ | 6 #define NET_BASE_HOST_RESOLVER_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 // HostResolver methods: | 81 // HostResolver methods: |
| 82 virtual int Resolve(const RequestInfo& info, | 82 virtual int Resolve(const RequestInfo& info, |
| 83 AddressList* addresses, | 83 AddressList* addresses, |
| 84 CompletionCallback* callback, | 84 CompletionCallback* callback, |
| 85 RequestHandle* out_req, | 85 RequestHandle* out_req, |
| 86 LoadLog* load_log); | 86 LoadLog* load_log); |
| 87 virtual void CancelRequest(RequestHandle req); | 87 virtual void CancelRequest(RequestHandle req); |
| 88 virtual void AddObserver(HostResolver::Observer* observer); | 88 virtual void AddObserver(HostResolver::Observer* observer); |
| 89 virtual void RemoveObserver(HostResolver::Observer* observer); | 89 virtual void RemoveObserver(HostResolver::Observer* observer); |
| 90 | 90 |
| 91 // Set address family, and disable IPv6 probe support. | 91 virtual void SetDefaultAddressFamily(AddressFamily address_family) { |
| 92 virtual void SetDefaultAddressFamily(AddressFamily address_family); | 92 default_address_family_ = address_family; |
| 93 | 93 } |
| 94 // Continuously observe whether IPv6 is supported, and set the allowable | |
| 95 // address family to IPv4 iff IPv6 is not supported. | |
| 96 void ProbeIPv6Support(); | |
| 97 | 94 |
| 98 virtual HostResolverImpl* GetAsHostResolverImpl() { return this; } | 95 virtual HostResolverImpl* GetAsHostResolverImpl() { return this; } |
| 99 | 96 |
| 100 // TODO(eroman): hack for http://crbug.com/15513 | 97 // TODO(eroman): hack for http://crbug.com/15513 |
| 101 void Shutdown(); | 98 void Shutdown(); |
| 102 | 99 |
| 103 // Returns the cache this resolver uses, or NULL if caching is disabled. | 100 // Returns the cache this resolver uses, or NULL if caching is disabled. |
| 104 HostCache* cache() { return cache_.get(); } | 101 HostCache* cache() { return cache_.get(); } |
| 105 | 102 |
| 106 // Clears the request trace log. | 103 // Clears the request trace log. |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 scoped_refptr<HostResolverProc> resolver_proc_; | 237 scoped_refptr<HostResolverProc> resolver_proc_; |
| 241 | 238 |
| 242 // Address family to use when the request doesn't specify one. | 239 // Address family to use when the request doesn't specify one. |
| 243 AddressFamily default_address_family_; | 240 AddressFamily default_address_family_; |
| 244 | 241 |
| 245 // TODO(eroman): hack for http://crbug.com/15513 | 242 // TODO(eroman): hack for http://crbug.com/15513 |
| 246 bool shutdown_; | 243 bool shutdown_; |
| 247 | 244 |
| 248 NetworkChangeNotifier* const network_change_notifier_; | 245 NetworkChangeNotifier* const network_change_notifier_; |
| 249 | 246 |
| 250 // Indicate if probing is done after each network change event to set address | |
| 251 // family. | |
| 252 // When false, explicit setting of address family is used. | |
| 253 bool ipv6_probe_monitoring_; | |
| 254 | |
| 255 scoped_refptr<RequestsTrace> requests_trace_; | 247 scoped_refptr<RequestsTrace> requests_trace_; |
| 256 | 248 |
| 257 DISALLOW_COPY_AND_ASSIGN(HostResolverImpl); | 249 DISALLOW_COPY_AND_ASSIGN(HostResolverImpl); |
| 258 }; | 250 }; |
| 259 | 251 |
| 260 } // namespace net | 252 } // namespace net |
| 261 | 253 |
| 262 #endif // NET_BASE_HOST_RESOLVER_IMPL_H_ | 254 #endif // NET_BASE_HOST_RESOLVER_IMPL_H_ |
| OLD | NEW |