OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_H_ | 5 #ifndef NET_BASE_HOST_RESOLVER_H_ |
6 #define NET_BASE_HOST_RESOLVER_H_ | 6 #define NET_BASE_HOST_RESOLVER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 // unspecified. For example, this could be used to restrict resolution | 170 // unspecified. For example, this could be used to restrict resolution |
171 // results to AF_INET by passing in ADDRESS_FAMILY_IPV4, or to | 171 // results to AF_INET by passing in ADDRESS_FAMILY_IPV4, or to |
172 // AF_INET6 by passing in ADDRESS_FAMILY_IPV6. | 172 // AF_INET6 by passing in ADDRESS_FAMILY_IPV6. |
173 virtual void SetDefaultAddressFamily(AddressFamily address_family) {} | 173 virtual void SetDefaultAddressFamily(AddressFamily address_family) {} |
174 | 174 |
175 // Returns |this| cast to a HostResolverImpl*, or NULL if the subclass | 175 // Returns |this| cast to a HostResolverImpl*, or NULL if the subclass |
176 // is not compatible with HostResolverImpl. Used primarily to expose | 176 // is not compatible with HostResolverImpl. Used primarily to expose |
177 // additional functionality on the about:net-internals page. | 177 // additional functionality on the about:net-internals page. |
178 virtual HostResolverImpl* GetAsHostResolverImpl() { return NULL; } | 178 virtual HostResolverImpl* GetAsHostResolverImpl() { return NULL; } |
179 | 179 |
| 180 // Does additional cleanup prior to destruction. |
| 181 virtual void Shutdown() {} |
| 182 |
180 protected: | 183 protected: |
181 friend class base::RefCounted<HostResolver>; | 184 friend class base::RefCounted<HostResolver>; |
182 | 185 |
183 HostResolver() { } | 186 HostResolver() { } |
184 | 187 |
185 // If any completion callbacks are pending when the resolver is destroyed, | 188 // If any completion callbacks are pending when the resolver is destroyed, |
186 // the host resolutions are cancelled, and the completion callbacks will not | 189 // the host resolutions are cancelled, and the completion callbacks will not |
187 // be called. | 190 // be called. |
188 virtual ~HostResolver() {} | 191 virtual ~HostResolver() {} |
189 | 192 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 }; | 236 }; |
234 | 237 |
235 // Creates a HostResolver implementation that queries the underlying system. | 238 // Creates a HostResolver implementation that queries the underlying system. |
236 // (Except if a unit-test has changed the global HostResolverProc using | 239 // (Except if a unit-test has changed the global HostResolverProc using |
237 // ScopedHostResolverProc to intercept requests to the system). | 240 // ScopedHostResolverProc to intercept requests to the system). |
238 HostResolver* CreateSystemHostResolver(); | 241 HostResolver* CreateSystemHostResolver(); |
239 | 242 |
240 } // namespace net | 243 } // namespace net |
241 | 244 |
242 #endif // NET_BASE_HOST_RESOLVER_H_ | 245 #endif // NET_BASE_HOST_RESOLVER_H_ |
OLD | NEW |