OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_SINGLE_REQUEST_HOST_RESOLVER_H_ | 5 #ifndef NET_BASE_SINGLE_REQUEST_HOST_RESOLVER_H_ |
6 #define NET_BASE_SINGLE_REQUEST_HOST_RESOLVER_H_ | 6 #define NET_BASE_SINGLE_REQUEST_HOST_RESOLVER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "net/base/host_resolver.h" | 9 #include "net/base/host_resolver.h" |
10 | 10 |
11 namespace net { | 11 namespace net { |
12 | 12 |
13 // This class represents the task of resolving a hostname (or IP address | 13 // This class represents the task of resolving a hostname (or IP address |
14 // literal) to an AddressList object. It wraps HostResolver to resolve only a | 14 // literal) to an AddressList object. It wraps HostResolver to resolve only a |
15 // single hostname at a time and cancels this request when going out of scope. | 15 // single hostname at a time and cancels this request when going out of scope. |
16 class NET_API SingleRequestHostResolver { | 16 class NET_EXPORT SingleRequestHostResolver { |
17 public: | 17 public: |
18 // |resolver| must remain valid for the lifetime of |this|. | 18 // |resolver| must remain valid for the lifetime of |this|. |
19 explicit SingleRequestHostResolver(HostResolver* resolver); | 19 explicit SingleRequestHostResolver(HostResolver* resolver); |
20 | 20 |
21 // If a completion callback is pending when the resolver is destroyed, the | 21 // If a completion callback is pending when the resolver is destroyed, the |
22 // host resolution is cancelled, and the completion callback will not be | 22 // host resolution is cancelled, and the completion callback will not be |
23 // called. | 23 // called. |
24 ~SingleRequestHostResolver(); | 24 ~SingleRequestHostResolver(); |
25 | 25 |
26 // Resolves the given hostname (or IP address literal), filling out the | 26 // Resolves the given hostname (or IP address literal), filling out the |
(...skipping 21 matching lines...) Expand all Loading... |
48 | 48 |
49 // Completion callback for when request to |resolver_| completes. | 49 // Completion callback for when request to |resolver_| completes. |
50 CompletionCallbackImpl<SingleRequestHostResolver> callback_; | 50 CompletionCallbackImpl<SingleRequestHostResolver> callback_; |
51 | 51 |
52 DISALLOW_COPY_AND_ASSIGN(SingleRequestHostResolver); | 52 DISALLOW_COPY_AND_ASSIGN(SingleRequestHostResolver); |
53 }; | 53 }; |
54 | 54 |
55 } // namespace net | 55 } // namespace net |
56 | 56 |
57 #endif // NET_BASE_SINGLE_REQUEST_HOST_RESOLVER_H_ | 57 #endif // NET_BASE_SINGLE_REQUEST_HOST_RESOLVER_H_ |
OLD | NEW |