OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef NET_DNS_STALE_HOST_RESOLVER_H_ | |
6 #define NET_DNS_STALE_HOST_RESOLVER_H_ | |
7 | |
8 #include "net/dns/host_resolver.h" | |
9 | |
10 namespace net { | |
11 | |
12 class NET_EXPORT StaleHostResolver : public HostResolver { | |
Ryan Sleevi
2016/04/26 02:25:36
Document (throughout this file; methods & class)
Julia Tuttle
2016/04/27 14:50:26
Done.
| |
13 public: | |
14 struct NET_EXPORT StaleOptions { | |
15 base::TimeDelta delay; | |
16 base::TimeDelta max_expired_time; | |
17 bool allow_other_network; | |
18 unsigned max_stale_uses; | |
19 }; | |
20 | |
21 StaleHostResolver(std::unique_ptr<HostResolver> inner_resolver, | |
22 const StaleOptions& stale_options); | |
23 | |
24 ~StaleHostResolver() override; | |
25 | |
26 int Resolve(const RequestInfo& info, | |
27 RequestPriority priority, | |
28 AddressList* addresses, | |
29 const CompletionCallback& callback, | |
30 RequestHandle* out_req, | |
31 const BoundNetLog& net_log) override; | |
32 | |
33 void CancelRequest(RequestHandle req) override; | |
34 | |
35 // Pass through to the inner resolver: | |
36 int ResolveFromCache(const RequestInfo& info, | |
37 AddressList* addresses, | |
38 const BoundNetLog& net_log) override; | |
39 int ResolveStaleFromCache(const RequestInfo& info, | |
40 AddressList* addresses, | |
41 HostCache::StaleEntryInfo* stale_info, | |
42 const BoundNetLog& net_log) override; | |
43 void SetDnsClientEnabled(bool enabled) override; | |
44 HostCache* GetHostCache() override; | |
45 std::unique_ptr<base::Value> GetDnsConfigAsValue() const override; | |
46 | |
47 private: | |
48 class Request; | |
49 | |
50 std::unique_ptr<HostResolver> resolver_; | |
51 StaleOptions options_; | |
52 }; | |
53 | |
54 } // namespace net | |
55 | |
56 #endif // NET_DNS_STALE_HOST_RESOLVER_H_ | |
OLD | NEW |