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 // TODO(eroman): temp hack for http://crbug.com/15513 | |
92 virtual void Shutdown(); | |
93 | |
94 virtual void SetDefaultAddressFamily(AddressFamily address_family) { | 91 virtual void SetDefaultAddressFamily(AddressFamily address_family) { |
95 default_address_family_ = address_family; | 92 default_address_family_ = address_family; |
96 } | 93 } |
97 | 94 |
98 virtual bool IsHostResolverImpl() { return true; } | 95 virtual bool IsHostResolverImpl() { return true; } |
99 | 96 |
| 97 // TODO(eroman): hack for http://crbug.com/15513 |
| 98 void Shutdown(); |
| 99 |
100 // 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. |
101 HostCache* cache() { return cache_.get(); } | 101 HostCache* cache() { return cache_.get(); } |
102 | 102 |
103 // Clears the request trace log. | 103 // Clears the request trace log. |
104 void ClearRequestsTrace(); | 104 void ClearRequestsTrace(); |
105 | 105 |
106 // Starts/ends capturing requests to a trace log. | 106 // Starts/ends capturing requests to a trace log. |
107 void EnableRequestsTracing(bool enable); | 107 void EnableRequestsTracing(bool enable); |
108 | 108 |
109 bool IsRequestsTracingEnabled() const; | 109 bool IsRequestsTracingEnabled() const; |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 // The only consumer of this ID is the requests tracing code. | 232 // The only consumer of this ID is the requests tracing code. |
233 int next_job_id_; | 233 int next_job_id_; |
234 | 234 |
235 // The procedure to use for resolving host names. This will be NULL, except | 235 // The procedure to use for resolving host names. This will be NULL, except |
236 // in the case of unit-tests which inject custom host resolving behaviors. | 236 // in the case of unit-tests which inject custom host resolving behaviors. |
237 scoped_refptr<HostResolverProc> resolver_proc_; | 237 scoped_refptr<HostResolverProc> resolver_proc_; |
238 | 238 |
239 // Address family to use when the request doesn't specify one. | 239 // Address family to use when the request doesn't specify one. |
240 AddressFamily default_address_family_; | 240 AddressFamily default_address_family_; |
241 | 241 |
242 // TODO(eroman): temp hack for http://crbug.com/15513 | 242 // TODO(eroman): hack for http://crbug.com/15513 |
243 bool shutdown_; | 243 bool shutdown_; |
244 | 244 |
245 NetworkChangeNotifier* const network_change_notifier_; | 245 NetworkChangeNotifier* const network_change_notifier_; |
246 | 246 |
247 scoped_refptr<RequestsTrace> requests_trace_; | 247 scoped_refptr<RequestsTrace> requests_trace_; |
248 | 248 |
249 DISALLOW_COPY_AND_ASSIGN(HostResolverImpl); | 249 DISALLOW_COPY_AND_ASSIGN(HostResolverImpl); |
250 }; | 250 }; |
251 | 251 |
252 } // namespace net | 252 } // namespace net |
253 | 253 |
254 #endif // NET_BASE_HOST_RESOLVER_IMPL_H_ | 254 #endif // NET_BASE_HOST_RESOLVER_IMPL_H_ |
OLD | NEW |