| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 COMPONENTS_CRONET_STALE_HOST_RESOLVER_H_ | 5 #ifndef COMPONENTS_CRONET_STALE_HOST_RESOLVER_H_ |
| 6 #define COMPONENTS_CRONET_STALE_HOST_RESOLVER_H_ | 6 #define COMPONENTS_CRONET_STALE_HOST_RESOLVER_H_ |
| 7 | 7 |
| 8 #include <unordered_set> | 8 #include <unordered_set> |
| 9 | 9 |
| 10 #include "net/dns/host_resolver.h" | 10 #include "net/dns/host_resolver.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 const net::NetLogWithSource& net_log) override; | 66 const net::NetLogWithSource& net_log) override; |
| 67 | 67 |
| 68 // The remaining public methods pass through to the inner resolver: | 68 // The remaining public methods pass through to the inner resolver: |
| 69 | 69 |
| 70 int ResolveFromCache(const RequestInfo& info, | 70 int ResolveFromCache(const RequestInfo& info, |
| 71 net::AddressList* addresses, | 71 net::AddressList* addresses, |
| 72 const net::NetLogWithSource& net_log) override; | 72 const net::NetLogWithSource& net_log) override; |
| 73 void SetDnsClientEnabled(bool enabled) override; | 73 void SetDnsClientEnabled(bool enabled) override; |
| 74 net::HostCache* GetHostCache() override; | 74 net::HostCache* GetHostCache() override; |
| 75 std::unique_ptr<base::Value> GetDnsConfigAsValue() const override; | 75 std::unique_ptr<base::Value> GetDnsConfigAsValue() const override; |
| 76 void SetDefaultAddressFamily(net::AddressFamily address_family) override; |
| 77 net::AddressFamily GetDefaultAddressFamily() const override; |
| 76 | 78 |
| 77 private: | 79 private: |
| 78 class RequestImpl; | 80 class RequestImpl; |
| 79 | 81 |
| 80 // Called from |Request| when a request is complete and can be destroyed. | 82 // Called from |Request| when a request is complete and can be destroyed. |
| 81 void OnRequestComplete(Request* request); | 83 void OnRequestComplete(Request* request); |
| 82 | 84 |
| 83 // The underlying HostResolverImpl that will be used to make cache and network | 85 // The underlying HostResolverImpl that will be used to make cache and network |
| 84 // requests. | 86 // requests. |
| 85 std::unique_ptr<net::HostResolverImpl> inner_resolver_; | 87 std::unique_ptr<net::HostResolverImpl> inner_resolver_; |
| 86 | 88 |
| 87 // Options that govern when a stale response can or can't be returned. | 89 // Options that govern when a stale response can or can't be returned. |
| 88 StaleOptions options_; | 90 StaleOptions options_; |
| 89 | 91 |
| 90 DISALLOW_COPY_AND_ASSIGN(StaleHostResolver); | 92 DISALLOW_COPY_AND_ASSIGN(StaleHostResolver); |
| 91 }; | 93 }; |
| 92 | 94 |
| 93 } // namespace cronet | 95 } // namespace cronet |
| 94 | 96 |
| 95 #endif // COMPONENTS_CRONET_STALE_HOST_RESOLVER_H_ | 97 #endif // COMPONENTS_CRONET_STALE_HOST_RESOLVER_H_ |
| OLD | NEW |