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_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 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 virtual ~HostResolver(); | 138 virtual ~HostResolver(); |
139 | 139 |
140 // Resolves the given hostname (or IP address literal), filling out the | 140 // Resolves the given hostname (or IP address literal), filling out the |
141 // |addresses| object upon success. The |info.port| parameter will be set as | 141 // |addresses| object upon success. The |info.port| parameter will be set as |
142 // the sin(6)_port field of the sockaddr_in{6} struct. Returns OK if | 142 // the sin(6)_port field of the sockaddr_in{6} struct. Returns OK if |
143 // successful or an error code upon failure. Returns | 143 // successful or an error code upon failure. Returns |
144 // ERR_NAME_NOT_RESOLVED if hostname is invalid, or if it is an | 144 // ERR_NAME_NOT_RESOLVED if hostname is invalid, or if it is an |
145 // incompatible IP literal (e.g. IPv6 is disabled and it is an IPv6 | 145 // incompatible IP literal (e.g. IPv6 is disabled and it is an IPv6 |
146 // literal). | 146 // literal). |
147 // | 147 // |
148 // If the operation cannnot be completed synchronously, ERR_IO_PENDING will | 148 // If the operation cannot be completed synchronously, ERR_IO_PENDING will |
149 // be returned and the real result code will be passed to the completion | 149 // be returned and the real result code will be passed to the completion |
150 // callback. Otherwise the result code is returned immediately from this | 150 // callback. Otherwise the result code is returned immediately from this |
151 // call. | 151 // call. |
152 // | 152 // |
153 // If |out_req| is non-NULL, then |*out_req| will be filled with a handle to | 153 // If |out_req| is non-NULL, then |*out_req| will be filled with a handle to |
154 // the async request. This handle is not valid after the request has | 154 // the async request. This handle is not valid after the request has |
155 // completed. | 155 // completed. |
156 // | 156 // |
157 // Profiling information for the request is saved to |net_log| if non-NULL. | 157 // Profiling information for the request is saved to |net_log| if non-NULL. |
158 virtual int Resolve(const RequestInfo& info, | 158 virtual int Resolve(const RequestInfo& info, |
159 AddressList* addresses, | 159 AddressList* addresses, |
160 OldCompletionCallback* callback, | 160 const CompletionCallback& callback, |
161 RequestHandle* out_req, | 161 RequestHandle* out_req, |
162 const BoundNetLog& net_log) = 0; | 162 const BoundNetLog& net_log) = 0; |
163 | 163 |
164 // Resolves the given hostname (or IP address literal) out of cache | 164 // Resolves the given hostname (or IP address literal) out of cache |
165 // only. This is guaranteed to complete synchronously. This acts like | 165 // only. This is guaranteed to complete synchronously. This acts like |
166 // |Resolve()| if the hostname is IP literal or cached value exists. | 166 // |Resolve()| if the hostname is IP literal or cached value exists. |
167 // Otherwise, ERR_DNS_CACHE_MISS is returned. | 167 // Otherwise, ERR_DNS_CACHE_MISS is returned. |
168 virtual int ResolveFromCache(const RequestInfo& info, | 168 virtual int ResolveFromCache(const RequestInfo& info, |
169 AddressList* addresses, | 169 AddressList* addresses, |
170 const BoundNetLog& net_log) = 0; | 170 const BoundNetLog& net_log) = 0; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 NetLog* net_log); | 218 NetLog* net_log); |
219 | 219 |
220 // Creates a HostResolver implementation that sends actual DNS queries to | 220 // Creates a HostResolver implementation that sends actual DNS queries to |
221 // the specified DNS server and parses response and returns results. | 221 // the specified DNS server and parses response and returns results. |
222 NET_EXPORT HostResolver* CreateAsyncHostResolver(size_t max_concurrent_resolves, | 222 NET_EXPORT HostResolver* CreateAsyncHostResolver(size_t max_concurrent_resolves, |
223 const IPAddressNumber& dns_ip, | 223 const IPAddressNumber& dns_ip, |
224 NetLog* net_log); | 224 NetLog* net_log); |
225 } // namespace net | 225 } // namespace net |
226 | 226 |
227 #endif // NET_BASE_HOST_RESOLVER_H_ | 227 #endif // NET_BASE_HOST_RESOLVER_H_ |
OLD | NEW |