OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 // called. | 34 // called. |
35 ~HostResolver(); | 35 ~HostResolver(); |
36 | 36 |
37 // Resolves the given hostname (or IP address literal), filling out the | 37 // Resolves the given hostname (or IP address literal), filling out the |
38 // |addresses| object upon success. The |port| parameter will be set as the | 38 // |addresses| object upon success. The |port| parameter will be set as the |
39 // sin(6)_port field of the sockaddr_in{6} struct. Returns OK if successful | 39 // sin(6)_port field of the sockaddr_in{6} struct. Returns OK if successful |
40 // or an error code upon failure. | 40 // or an error code upon failure. |
41 // | 41 // |
42 // When callback is null, the operation completes synchronously. | 42 // When callback is null, the operation completes synchronously. |
43 // | 43 // |
44 // When callback is non-null, ERR_IO_PENDING is returned if the operation | 44 // When callback is non-null, the operation will be performed asynchronously. |
45 // could not be completed synchronously, in which case the result code will | 45 // ERR_IO_PENDING is returned if it has been scheduled successfully. Real |
46 // be passed to the callback when available. | 46 // result code will be passed to the completion callback. |
47 // | |
48 int Resolve(const std::string& hostname, int port, | 47 int Resolve(const std::string& hostname, int port, |
49 AddressList* addresses, CompletionCallback* callback); | 48 AddressList* addresses, CompletionCallback* callback); |
50 | 49 |
51 private: | 50 private: |
52 class Request; | 51 class Request; |
53 friend class Request; | 52 friend class Request; |
54 scoped_refptr<Request> request_; | 53 scoped_refptr<Request> request_; |
55 DISALLOW_COPY_AND_ASSIGN(HostResolver); | 54 DISALLOW_COPY_AND_ASSIGN(HostResolver); |
56 }; | 55 }; |
57 | 56 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 // | 88 // |
90 // NOTE: In most cases, you should use ScopedHostMapper instead, which is | 89 // NOTE: In most cases, you should use ScopedHostMapper instead, which is |
91 // defined in host_resolver_unittest.h | 90 // defined in host_resolver_unittest.h |
92 // | 91 // |
93 HostMapper* SetHostMapper(HostMapper* host_mapper); | 92 HostMapper* SetHostMapper(HostMapper* host_mapper); |
94 #endif | 93 #endif |
95 | 94 |
96 } // namespace net | 95 } // namespace net |
97 | 96 |
98 #endif // NET_BASE_HOST_RESOLVER_H_ | 97 #endif // NET_BASE_HOST_RESOLVER_H_ |
OLD | NEW |