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 class MessageLoop; | |
18 | |
19 namespace net { | 17 namespace net { |
20 | 18 |
21 class AddressList; | 19 class AddressList; |
22 class BoundNetLog; | 20 class BoundNetLog; |
23 class HostCache; | |
24 class HostResolverImpl; | 21 class HostResolverImpl; |
25 | 22 |
26 // This class represents the task of resolving hostnames (or IP address | 23 // This class represents the task of resolving hostnames (or IP address |
27 // literal) to an AddressList object. | 24 // literal) to an AddressList object. |
28 // | 25 // |
29 // HostResolver can handle multiple requests at a time, so when cancelling a | 26 // HostResolver can handle multiple requests at a time, so when cancelling a |
30 // request the RequestHandle that was returned by Resolve() needs to be | 27 // request the RequestHandle that was returned by Resolve() needs to be |
31 // given. A simpler alternative for consumers that only have 1 outstanding | 28 // given. A simpler alternative for consumers that only have 1 outstanding |
32 // request at a time is to create a SingleRequestHostResolver wrapper around | 29 // request at a time is to create a SingleRequestHostResolver wrapper around |
33 // HostResolver (which will automatically cancel the single request when it | 30 // HostResolver (which will automatically cancel the single request when it |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 // (Except if a unit-test has changed the global HostResolverProc using | 242 // (Except if a unit-test has changed the global HostResolverProc using |
246 // ScopedHostResolverProc to intercept requests to the system). | 243 // ScopedHostResolverProc to intercept requests to the system). |
247 // |max_concurrent_resolves| is how many resolve requests will be allowed to | 244 // |max_concurrent_resolves| is how many resolve requests will be allowed to |
248 // run in parallel. Pass HostResolver::kDefaultParallelism to choose a | 245 // run in parallel. Pass HostResolver::kDefaultParallelism to choose a |
249 // default value. | 246 // default value. |
250 HostResolver* CreateSystemHostResolver(size_t max_concurrent_resolves); | 247 HostResolver* CreateSystemHostResolver(size_t max_concurrent_resolves); |
251 | 248 |
252 } // namespace net | 249 } // namespace net |
253 | 250 |
254 #endif // NET_BASE_HOST_RESOLVER_H_ | 251 #endif // NET_BASE_HOST_RESOLVER_H_ |
OLD | NEW |