| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 virtual void SetDnsClientEnabled(bool enabled); | 179 virtual void SetDnsClientEnabled(bool enabled); |
| 180 | 180 |
| 181 // 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. |
| 182 // Used primarily to clear the cache and for getting debug information. | 182 // Used primarily to clear the cache and for getting debug information. |
| 183 virtual HostCache* GetHostCache(); | 183 virtual HostCache* GetHostCache(); |
| 184 | 184 |
| 185 // Returns the current DNS configuration |this| is using, as a Value, or | 185 // Returns the current DNS configuration |this| is using, as a Value, or |
| 186 // nullptr if it's configured to always use the system host resolver. | 186 // nullptr if it's configured to always use the system host resolver. |
| 187 virtual std::unique_ptr<base::Value> GetDnsConfigAsValue() const; | 187 virtual std::unique_ptr<base::Value> GetDnsConfigAsValue() const; |
| 188 | 188 |
| 189 typedef base::Callback<void(std::unique_ptr<const base::Value>)> |
| 190 PersistCallback; |
| 191 virtual void InitializePersistence( |
| 192 const PersistCallback& persist_callback, |
| 193 std::unique_ptr<const base::Value> old_data); |
| 194 |
| 189 // Creates a HostResolver implementation that queries the underlying system. | 195 // Creates a HostResolver implementation that queries the underlying system. |
| 190 // (Except if a unit-test has changed the global HostResolverProc using | 196 // (Except if a unit-test has changed the global HostResolverProc using |
| 191 // ScopedHostResolverProc to intercept requests to the system). | 197 // ScopedHostResolverProc to intercept requests to the system). |
| 192 static std::unique_ptr<HostResolver> CreateSystemResolver( | 198 static std::unique_ptr<HostResolver> CreateSystemResolver( |
| 193 const Options& options, | 199 const Options& options, |
| 194 NetLog* net_log); | 200 NetLog* net_log); |
| 195 | 201 |
| 196 // As above, but uses default parameters. | 202 // As above, but uses default parameters. |
| 197 static std::unique_ptr<HostResolver> CreateDefaultResolver(NetLog* net_log); | 203 static std::unique_ptr<HostResolver> CreateDefaultResolver(NetLog* net_log); |
| 198 | 204 |
| 199 protected: | 205 protected: |
| 200 HostResolver(); | 206 HostResolver(); |
| 201 | 207 |
| 202 private: | 208 private: |
| 203 DISALLOW_COPY_AND_ASSIGN(HostResolver); | 209 DISALLOW_COPY_AND_ASSIGN(HostResolver); |
| 204 }; | 210 }; |
| 205 | 211 |
| 206 } // namespace net | 212 } // namespace net |
| 207 | 213 |
| 208 #endif // NET_DNS_HOST_RESOLVER_H_ | 214 #endif // NET_DNS_HOST_RESOLVER_H_ |
| OLD | NEW |