OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 virtual void CancelRequest(RequestHandle req) = 0; | 160 virtual void CancelRequest(RequestHandle req) = 0; |
161 | 161 |
162 // Adds an observer to this resolver. The observer will be notified of the | 162 // Adds an observer to this resolver. The observer will be notified of the |
163 // start and completion of all requests (excluding cancellation). |observer| | 163 // start and completion of all requests (excluding cancellation). |observer| |
164 // must remain valid for the duration of this HostResolver's lifetime. | 164 // must remain valid for the duration of this HostResolver's lifetime. |
165 virtual void AddObserver(Observer* observer) = 0; | 165 virtual void AddObserver(Observer* observer) = 0; |
166 | 166 |
167 // Unregisters an observer previously added by AddObserver(). | 167 // Unregisters an observer previously added by AddObserver(). |
168 virtual void RemoveObserver(Observer* observer) = 0; | 168 virtual void RemoveObserver(Observer* observer) = 0; |
169 | 169 |
170 // Gives the HostResolver an opportunity to flush state. | |
171 virtual void Flush() {} | |
172 | |
173 // Sets the default AddressFamily to use when requests have left it | 170 // Sets the default AddressFamily to use when requests have left it |
174 // unspecified. For example, this could be used to restrict resolution | 171 // unspecified. For example, this could be used to restrict resolution |
175 // results to AF_INET by passing in ADDRESS_FAMILY_IPV4, or to | 172 // results to AF_INET by passing in ADDRESS_FAMILY_IPV4, or to |
176 // AF_INET6 by passing in ADDRESS_FAMILY_IPV6. | 173 // AF_INET6 by passing in ADDRESS_FAMILY_IPV6. |
177 virtual void SetDefaultAddressFamily(AddressFamily address_family) {} | 174 virtual void SetDefaultAddressFamily(AddressFamily address_family) {} |
178 | 175 |
179 // Returns |this| cast to a HostResolverImpl*, or NULL if the subclass | 176 // Returns |this| cast to a HostResolverImpl*, or NULL if the subclass |
180 // is not compatible with HostResolverImpl. Used primarily to expose | 177 // is not compatible with HostResolverImpl. Used primarily to expose |
181 // additional functionality on the about:net-internals page. | 178 // additional functionality on the about:net-internals page. |
182 virtual HostResolverImpl* GetAsHostResolverImpl() { return NULL; } | 179 virtual HostResolverImpl* GetAsHostResolverImpl() { return NULL; } |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 // (Except if a unit-test has changed the global HostResolverProc using | 237 // (Except if a unit-test has changed the global HostResolverProc using |
241 // ScopedHostResolverProc to intercept requests to the system). | 238 // ScopedHostResolverProc to intercept requests to the system). |
242 // |network_change_notifier| must outlive HostResolver. It can optionally be | 239 // |network_change_notifier| must outlive HostResolver. It can optionally be |
243 // NULL, in which case HostResolver will not respond to network changes. | 240 // NULL, in which case HostResolver will not respond to network changes. |
244 HostResolver* CreateSystemHostResolver( | 241 HostResolver* CreateSystemHostResolver( |
245 NetworkChangeNotifier* network_change_notifier); | 242 NetworkChangeNotifier* network_change_notifier); |
246 | 243 |
247 } // namespace net | 244 } // namespace net |
248 | 245 |
249 #endif // NET_BASE_HOST_RESOLVER_H_ | 246 #endif // NET_BASE_HOST_RESOLVER_H_ |
OLD | NEW |