OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 // the async request. This handle is not valid after the request has | 125 // the async request. This handle is not valid after the request has |
126 // completed. | 126 // completed. |
127 // | 127 // |
128 // Profiling information for the request is saved to |net_log| if non-NULL. | 128 // Profiling information for the request is saved to |net_log| if non-NULL. |
129 virtual int Resolve(const RequestInfo& info, | 129 virtual int Resolve(const RequestInfo& info, |
130 AddressList* addresses, | 130 AddressList* addresses, |
131 const CompletionCallback& callback, | 131 const CompletionCallback& callback, |
132 RequestHandle* out_req, | 132 RequestHandle* out_req, |
133 const BoundNetLog& net_log) = 0; | 133 const BoundNetLog& net_log) = 0; |
134 | 134 |
135 // Resolves the given hostname (or IP address literal) out of cache | 135 // Resolves the given hostname (or IP address literal) out of cache or HOSTS |
136 // only. This is guaranteed to complete synchronously. This acts like | 136 // file (if enabled) only. This is guaranteed to complete synchronously. |
137 // |Resolve()| if the hostname is IP literal or cached value exists. | 137 // This acts like |Resolve()| if the hostname is IP literal, or cached value |
138 // Otherwise, ERR_DNS_CACHE_MISS is returned. | 138 // or HOSTS entry exists. Otherwise, ERR_DNS_CACHE_MISS is returned. |
139 virtual int ResolveFromCache(const RequestInfo& info, | 139 virtual int ResolveFromCache(const RequestInfo& info, |
140 AddressList* addresses, | 140 AddressList* addresses, |
141 const BoundNetLog& net_log) = 0; | 141 const BoundNetLog& net_log) = 0; |
142 | 142 |
143 // Cancels the specified request. |req| is the handle returned by Resolve(). | 143 // Cancels the specified request. |req| is the handle returned by Resolve(). |
144 // After a request is canceled, its completion callback will not be called. | 144 // After a request is canceled, its completion callback will not be called. |
145 // CancelRequest must NOT be called after the request's completion callback | 145 // CancelRequest must NOT be called after the request's completion callback |
146 // has already run or the request was canceled. | 146 // has already run or the request was canceled. |
147 virtual void CancelRequest(RequestHandle req) = 0; | 147 virtual void CancelRequest(RequestHandle req) = 0; |
148 | 148 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 // As above, but the HostResolver will use the asynchronous DNS client in | 191 // As above, but the HostResolver will use the asynchronous DNS client in |
192 // DnsTransaction, which will be configured using DnsConfigService to match | 192 // DnsTransaction, which will be configured using DnsConfigService to match |
193 // the system DNS settings. If the client fails, the resolver falls back to | 193 // the system DNS settings. If the client fails, the resolver falls back to |
194 // the global HostResolverProc. | 194 // the global HostResolverProc. |
195 NET_EXPORT HostResolver* CreateAsyncHostResolver(size_t max_concurrent_resolves, | 195 NET_EXPORT HostResolver* CreateAsyncHostResolver(size_t max_concurrent_resolves, |
196 size_t max_retry_attempts, | 196 size_t max_retry_attempts, |
197 NetLog* net_log); | 197 NetLog* net_log); |
198 } // namespace net | 198 } // namespace net |
199 | 199 |
200 #endif // NET_BASE_HOST_RESOLVER_H_ | 200 #endif // NET_BASE_HOST_RESOLVER_H_ |
OLD | NEW |