| 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 // is not compatible with HostResolverImpl. Used primarily to expose | 169 // is not compatible with HostResolverImpl. Used primarily to expose |
| 170 // additional functionality on the about:net-internals page. | 170 // additional functionality on the about:net-internals page. |
| 171 virtual HostResolverImpl* GetAsHostResolverImpl() { return NULL; } | 171 virtual HostResolverImpl* GetAsHostResolverImpl() { return NULL; } |
| 172 | 172 |
| 173 // Does additional cleanup prior to destruction. | 173 // Does additional cleanup prior to destruction. |
| 174 virtual void Shutdown() {} | 174 virtual void Shutdown() {} |
| 175 | 175 |
| 176 protected: | 176 protected: |
| 177 friend class base::RefCounted<HostResolver>; | 177 friend class base::RefCounted<HostResolver>; |
| 178 | 178 |
| 179 HostResolver() { } | 179 HostResolver(); |
| 180 | 180 |
| 181 // If any completion callbacks are pending when the resolver is destroyed, | 181 // If any completion callbacks are pending when the resolver is destroyed, |
| 182 // the host resolutions are cancelled, and the completion callbacks will not | 182 // the host resolutions are cancelled, and the completion callbacks will not |
| 183 // be called. | 183 // be called. |
| 184 virtual ~HostResolver() {} | 184 virtual ~HostResolver(); |
| 185 | 185 |
| 186 private: | 186 private: |
| 187 DISALLOW_COPY_AND_ASSIGN(HostResolver); | 187 DISALLOW_COPY_AND_ASSIGN(HostResolver); |
| 188 }; | 188 }; |
| 189 | 189 |
| 190 // This class represents the task of resolving a hostname (or IP address | 190 // This class represents the task of resolving a hostname (or IP address |
| 191 // literal) to an AddressList object. It wraps HostResolver to resolve only a | 191 // literal) to an AddressList object. It wraps HostResolver to resolve only a |
| 192 // single hostname at a time and cancels this request when going out of scope. | 192 // single hostname at a time and cancels this request when going out of scope. |
| 193 class SingleRequestHostResolver { | 193 class SingleRequestHostResolver { |
| 194 public: | 194 public: |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 // ScopedHostResolverProc to intercept requests to the system). | 233 // ScopedHostResolverProc to intercept requests to the system). |
| 234 // |max_concurrent_resolves| is how many resolve requests will be allowed to | 234 // |max_concurrent_resolves| is how many resolve requests will be allowed to |
| 235 // run in parallel. Pass HostResolver::kDefaultParallelism to choose a | 235 // run in parallel. Pass HostResolver::kDefaultParallelism to choose a |
| 236 // default value. | 236 // default value. |
| 237 HostResolver* CreateSystemHostResolver(size_t max_concurrent_resolves, | 237 HostResolver* CreateSystemHostResolver(size_t max_concurrent_resolves, |
| 238 NetLog* net_log); | 238 NetLog* net_log); |
| 239 | 239 |
| 240 } // namespace net | 240 } // namespace net |
| 241 | 241 |
| 242 #endif // NET_BASE_HOST_RESOLVER_H_ | 242 #endif // NET_BASE_HOST_RESOLVER_H_ |
| OLD | NEW |