| 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/ref_counted.h" | 10 #include "base/ref_counted.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 // be called. | 109 // be called. |
| 110 virtual ~HostResolver() {} | 110 virtual ~HostResolver() {} |
| 111 | 111 |
| 112 // Resolves the given hostname (or IP address literal), filling out the | 112 // Resolves the given hostname (or IP address literal), filling out the |
| 113 // |addresses| object upon success. The |info.port| parameter will be set as | 113 // |addresses| object upon success. The |info.port| parameter will be set as |
| 114 // the sin(6)_port field of the sockaddr_in{6} struct. Returns OK if | 114 // the sin(6)_port field of the sockaddr_in{6} struct. Returns OK if |
| 115 // successful or an error code upon failure. | 115 // successful or an error code upon failure. |
| 116 // | 116 // |
| 117 // When callback is null, the operation completes synchronously. | 117 // When callback is null, the operation completes synchronously. |
| 118 // | 118 // |
| 119 // When callback is non-null, the operation will be performed asynchronously. | 119 // When callback is non-null, the operation may be performed asynchronously. |
| 120 // ERR_IO_PENDING is returned if it has been scheduled successfully. Real | 120 // If the operation cannnot be completed synchronously, ERR_IO_PENDING will |
| 121 // result code will be passed to the completion callback. If |req| is | 121 // be returned and the real result code will be passed to the completion |
| 122 // non-NULL, then |*req| will be filled with a handle to the async request. | 122 // callback. Otherwise the result code is returned immediately from this |
| 123 // This handle is not valid after the request has completed. | 123 // call. |
| 124 // If |req| is non-NULL, then |*req| will be filled with a handle to the |
| 125 // async request. This handle is not valid after the request has completed. |
| 124 // | 126 // |
| 125 // Profiling information for the request is saved to |load_log| if non-NULL. | 127 // Profiling information for the request is saved to |load_log| if non-NULL. |
| 126 virtual int Resolve(const RequestInfo& info, | 128 virtual int Resolve(const RequestInfo& info, |
| 127 AddressList* addresses, | 129 AddressList* addresses, |
| 128 CompletionCallback* callback, | 130 CompletionCallback* callback, |
| 129 RequestHandle* out_req, | 131 RequestHandle* out_req, |
| 130 LoadLog* load_log) = 0; | 132 LoadLog* load_log) = 0; |
| 131 | 133 |
| 132 // Cancels the specified request. |req| is the handle returned by Resolve(). | 134 // Cancels the specified request. |req| is the handle returned by Resolve(). |
| 133 // After a request is cancelled, its completion callback will not be called. | 135 // After a request is cancelled, its completion callback will not be called. |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 }; | 201 }; |
| 200 | 202 |
| 201 // Creates a HostResolver implementation that queries the underlying system. | 203 // Creates a HostResolver implementation that queries the underlying system. |
| 202 // (Except if a unit-test has changed the global HostResolverProc using | 204 // (Except if a unit-test has changed the global HostResolverProc using |
| 203 // ScopedHostResolverProc to intercept requests to the system). | 205 // ScopedHostResolverProc to intercept requests to the system). |
| 204 HostResolver* CreateSystemHostResolver(); | 206 HostResolver* CreateSystemHostResolver(); |
| 205 | 207 |
| 206 } // namespace net | 208 } // namespace net |
| 207 | 209 |
| 208 #endif // NET_BASE_HOST_RESOLVER_H_ | 210 #endif // NET_BASE_HOST_RESOLVER_H_ |
| OLD | NEW |