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_DNS_HOST_RESOLVER_H_ | 5 #ifndef NET_DNS_HOST_RESOLVER_H_ |
6 #define NET_DNS_HOST_RESOLVER_H_ | 6 #define NET_DNS_HOST_RESOLVER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 virtual int ResolveFromCache(const RequestInfo& info, | 160 virtual int ResolveFromCache(const RequestInfo& info, |
161 AddressList* addresses, | 161 AddressList* addresses, |
162 const BoundNetLog& net_log) = 0; | 162 const BoundNetLog& net_log) = 0; |
163 | 163 |
164 // Cancels the specified request. |req| is the handle returned by Resolve(). | 164 // Cancels the specified request. |req| is the handle returned by Resolve(). |
165 // After a request is canceled, its completion callback will not be called. | 165 // After a request is canceled, its completion callback will not be called. |
166 // CancelRequest must NOT be called after the request's completion callback | 166 // CancelRequest must NOT be called after the request's completion callback |
167 // has already run or the request was canceled. | 167 // has already run or the request was canceled. |
168 virtual void CancelRequest(RequestHandle req) = 0; | 168 virtual void CancelRequest(RequestHandle req) = 0; |
169 | 169 |
170 // Sets the default AddressFamily to use when requests have left it | |
171 // unspecified. For example, this could be used to restrict resolution | |
172 // results to AF_INET by passing in ADDRESS_FAMILY_IPV4, or to | |
173 // AF_INET6 by passing in ADDRESS_FAMILY_IPV6. | |
174 virtual void SetDefaultAddressFamily(AddressFamily address_family) {} | |
175 virtual AddressFamily GetDefaultAddressFamily() const; | |
176 | |
177 // Enable or disable the built-in asynchronous DnsClient. | 170 // Enable or disable the built-in asynchronous DnsClient. |
178 virtual void SetDnsClientEnabled(bool enabled); | 171 virtual void SetDnsClientEnabled(bool enabled); |
179 | 172 |
180 // Returns the HostResolverCache |this| uses, or NULL if there isn't one. | 173 // Returns the HostResolverCache |this| uses, or NULL if there isn't one. |
181 // Used primarily to clear the cache and for getting debug information. | 174 // Used primarily to clear the cache and for getting debug information. |
182 virtual HostCache* GetHostCache(); | 175 virtual HostCache* GetHostCache(); |
183 | 176 |
184 // Returns the current DNS configuration |this| is using, as a Value, or NULL | 177 // Returns the current DNS configuration |this| is using, as a Value, or NULL |
185 // if it's configured to always use the system host resolver. Caller takes | 178 // if it's configured to always use the system host resolver. Caller takes |
186 // ownership of the returned Value. | 179 // ownership of the returned Value. |
(...skipping 12 matching lines...) Expand all Loading... |
199 protected: | 192 protected: |
200 HostResolver(); | 193 HostResolver(); |
201 | 194 |
202 private: | 195 private: |
203 DISALLOW_COPY_AND_ASSIGN(HostResolver); | 196 DISALLOW_COPY_AND_ASSIGN(HostResolver); |
204 }; | 197 }; |
205 | 198 |
206 } // namespace net | 199 } // namespace net |
207 | 200 |
208 #endif // NET_DNS_HOST_RESOLVER_H_ | 201 #endif // NET_DNS_HOST_RESOLVER_H_ |
OLD | NEW |