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" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/values.h" |
12 #include "net/base/address_family.h" | 13 #include "net/base/address_family.h" |
13 #include "net/base/completion_callback.h" | 14 #include "net/base/completion_callback.h" |
14 #include "net/base/host_port_pair.h" | 15 #include "net/base/host_port_pair.h" |
15 #include "net/base/net_export.h" | 16 #include "net/base/net_export.h" |
16 #include "net/base/net_util.h" | 17 #include "net/base/net_util.h" |
17 #include "net/base/prioritized_dispatcher.h" | 18 #include "net/base/prioritized_dispatcher.h" |
18 #include "net/base/request_priority.h" | 19 #include "net/base/request_priority.h" |
19 | 20 |
20 namespace base { | 21 namespace base { |
21 class Value; | 22 class Value; |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 // Enable or disable the built-in asynchronous DnsClient. | 178 // Enable or disable the built-in asynchronous DnsClient. |
178 virtual void SetDnsClientEnabled(bool enabled); | 179 virtual void SetDnsClientEnabled(bool enabled); |
179 | 180 |
180 // Returns the HostResolverCache |this| uses, or NULL if there isn't one. | 181 // Returns the HostResolverCache |this| uses, or NULL if there isn't one. |
181 // Used primarily to clear the cache and for getting debug information. | 182 // Used primarily to clear the cache and for getting debug information. |
182 virtual HostCache* GetHostCache(); | 183 virtual HostCache* GetHostCache(); |
183 | 184 |
184 // Returns the current DNS configuration |this| is using, as a Value, or NULL | 185 // 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 | 186 // if it's configured to always use the system host resolver. Caller takes |
186 // ownership of the returned Value. | 187 // ownership of the returned Value. |
187 virtual base::Value* GetDnsConfigAsValue() const; | 188 virtual scoped_ptr<base::Value> GetDnsConfigAsValue() const; |
188 | 189 |
189 // Creates a HostResolver implementation that queries the underlying system. | 190 // Creates a HostResolver implementation that queries the underlying system. |
190 // (Except if a unit-test has changed the global HostResolverProc using | 191 // (Except if a unit-test has changed the global HostResolverProc using |
191 // ScopedHostResolverProc to intercept requests to the system). | 192 // ScopedHostResolverProc to intercept requests to the system). |
192 static scoped_ptr<HostResolver> CreateSystemResolver( | 193 static scoped_ptr<HostResolver> CreateSystemResolver( |
193 const Options& options, | 194 const Options& options, |
194 NetLog* net_log); | 195 NetLog* net_log); |
195 | 196 |
196 // As above, but uses default parameters. | 197 // As above, but uses default parameters. |
197 static scoped_ptr<HostResolver> CreateDefaultResolver(NetLog* net_log); | 198 static scoped_ptr<HostResolver> CreateDefaultResolver(NetLog* net_log); |
198 | 199 |
199 protected: | 200 protected: |
200 HostResolver(); | 201 HostResolver(); |
201 | 202 |
202 private: | 203 private: |
203 DISALLOW_COPY_AND_ASSIGN(HostResolver); | 204 DISALLOW_COPY_AND_ASSIGN(HostResolver); |
204 }; | 205 }; |
205 | 206 |
206 } // namespace net | 207 } // namespace net |
207 | 208 |
208 #endif // NET_DNS_HOST_RESOLVER_H_ | 209 #endif // NET_DNS_HOST_RESOLVER_H_ |
OLD | NEW |