| 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 |
| 11 #include "base/ref_counted.h" | 11 #include "base/ref_counted.h" |
| 12 #include "googleurl/src/gurl.h" | 12 #include "googleurl/src/gurl.h" |
| 13 #include "net/base/address_family.h" | 13 #include "net/base/address_family.h" |
| 14 #include "net/base/completion_callback.h" | 14 #include "net/base/completion_callback.h" |
| 15 #include "net/base/request_priority.h" | 15 #include "net/base/request_priority.h" |
| 16 | 16 |
| 17 namespace net { | 17 namespace net { |
| 18 | 18 |
| 19 class AddressList; | 19 class AddressList; |
| 20 class BoundNetLog; | 20 class BoundNetLog; |
| 21 class HostResolverImpl; | 21 class HostResolverImpl; |
| 22 class NetLog; |
| 22 | 23 |
| 23 // This class represents the task of resolving hostnames (or IP address | 24 // This class represents the task of resolving hostnames (or IP address |
| 24 // literal) to an AddressList object. | 25 // literal) to an AddressList object. |
| 25 // | 26 // |
| 26 // HostResolver can handle multiple requests at a time, so when cancelling a | 27 // HostResolver can handle multiple requests at a time, so when cancelling a |
| 27 // request the RequestHandle that was returned by Resolve() needs to be | 28 // request the RequestHandle that was returned by Resolve() needs to be |
| 28 // given. A simpler alternative for consumers that only have 1 outstanding | 29 // given. A simpler alternative for consumers that only have 1 outstanding |
| 29 // request at a time is to create a SingleRequestHostResolver wrapper around | 30 // request at a time is to create a SingleRequestHostResolver wrapper around |
| 30 // HostResolver (which will automatically cancel the single request when it | 31 // HostResolver (which will automatically cancel the single request when it |
| 31 // goes out of scope). | 32 // goes out of scope). |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 | 238 |
| 238 DISALLOW_COPY_AND_ASSIGN(SingleRequestHostResolver); | 239 DISALLOW_COPY_AND_ASSIGN(SingleRequestHostResolver); |
| 239 }; | 240 }; |
| 240 | 241 |
| 241 // Creates a HostResolver implementation that queries the underlying system. | 242 // Creates a HostResolver implementation that queries the underlying system. |
| 242 // (Except if a unit-test has changed the global HostResolverProc using | 243 // (Except if a unit-test has changed the global HostResolverProc using |
| 243 // ScopedHostResolverProc to intercept requests to the system). | 244 // ScopedHostResolverProc to intercept requests to the system). |
| 244 // |max_concurrent_resolves| is how many resolve requests will be allowed to | 245 // |max_concurrent_resolves| is how many resolve requests will be allowed to |
| 245 // run in parallel. Pass HostResolver::kDefaultParallelism to choose a | 246 // run in parallel. Pass HostResolver::kDefaultParallelism to choose a |
| 246 // default value. | 247 // default value. |
| 247 HostResolver* CreateSystemHostResolver(size_t max_concurrent_resolves); | 248 HostResolver* CreateSystemHostResolver(size_t max_concurrent_resolves, |
| 249 NetLog* net_log); |
| 248 | 250 |
| 249 } // namespace net | 251 } // namespace net |
| 250 | 252 |
| 251 #endif // NET_BASE_HOST_RESOLVER_H_ | 253 #endif // NET_BASE_HOST_RESOLVER_H_ |
| OLD | NEW |