| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 virtual void AddObserver(Observer* observer) = 0; | 163 virtual void AddObserver(Observer* observer) = 0; |
| 164 | 164 |
| 165 // Unregisters an observer previously added by AddObserver(). | 165 // Unregisters an observer previously added by AddObserver(). |
| 166 virtual void RemoveObserver(Observer* observer) = 0; | 166 virtual void RemoveObserver(Observer* observer) = 0; |
| 167 | 167 |
| 168 // Sets the default AddressFamily to use when requests have left it | 168 // Sets the default AddressFamily to use when requests have left it |
| 169 // unspecified. For example, this could be used to restrict resolution | 169 // unspecified. For example, this could be used to restrict resolution |
| 170 // results to AF_INET by passing in ADDRESS_FAMILY_IPV4, or to | 170 // results to AF_INET by passing in ADDRESS_FAMILY_IPV4, or to |
| 171 // AF_INET6 by passing in ADDRESS_FAMILY_IPV6. | 171 // AF_INET6 by passing in ADDRESS_FAMILY_IPV6. |
| 172 virtual void SetDefaultAddressFamily(AddressFamily address_family) {} | 172 virtual void SetDefaultAddressFamily(AddressFamily address_family) {} |
| 173 virtual AddressFamily GetDefaultAddressFamily() const { | 173 virtual AddressFamily GetDefaultAddressFamily() const; |
| 174 return net::ADDRESS_FAMILY_UNSPECIFIED; | |
| 175 } | |
| 176 | 174 |
| 177 // Returns |this| cast to a HostResolverImpl*, or NULL if the subclass | 175 // Returns |this| cast to a HostResolverImpl*, or NULL if the subclass |
| 178 // is not compatible with HostResolverImpl. Used primarily to expose | 176 // is not compatible with HostResolverImpl. Used primarily to expose |
| 179 // additional functionality on the about:net-internals page. | 177 // additional functionality on the about:net-internals page. |
| 180 virtual HostResolverImpl* GetAsHostResolverImpl() { return NULL; } | 178 virtual HostResolverImpl* GetAsHostResolverImpl(); |
| 181 | 179 |
| 182 // Does additional cleanup prior to destruction. | 180 // Does additional cleanup prior to destruction. |
| 183 virtual void Shutdown() {} | 181 virtual void Shutdown() {} |
| 184 | 182 |
| 185 protected: | 183 protected: |
| 186 HostResolver(); | 184 HostResolver(); |
| 187 | 185 |
| 188 private: | 186 private: |
| 189 DISALLOW_COPY_AND_ASSIGN(HostResolver); | 187 DISALLOW_COPY_AND_ASSIGN(HostResolver); |
| 190 }; | 188 }; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 // underlying system, |max_concurrent_resolves| is how many resolve | 234 // underlying system, |max_concurrent_resolves| is how many resolve |
| 237 // requests will be allowed to run in parallel. Pass | 235 // requests will be allowed to run in parallel. Pass |
| 238 // HostResolver::kDefaultParallelism to choose a default value. | 236 // HostResolver::kDefaultParallelism to choose a default value. |
| 239 HostResolver* CreateSystemHostResolver(size_t max_concurrent_resolves, | 237 HostResolver* CreateSystemHostResolver(size_t max_concurrent_resolves, |
| 240 HostResolverProc* resolver_proc, | 238 HostResolverProc* resolver_proc, |
| 241 NetLog* net_log); | 239 NetLog* net_log); |
| 242 | 240 |
| 243 } // namespace net | 241 } // namespace net |
| 244 | 242 |
| 245 #endif // NET_BASE_HOST_RESOLVER_H_ | 243 #endif // NET_BASE_HOST_RESOLVER_H_ |
| OLD | NEW |