Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(986)

Side by Side Diff: net/dns/host_resolver.h

Issue 1898873006: Cronet: Use stale DNS cache entries experimentally. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dns_stale2
Patch Set: Make requested changes. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 10 matching lines...) Expand all
21 #include "net/dns/host_cache.h" 21 #include "net/dns/host_cache.h"
22 22
23 namespace base { 23 namespace base {
24 class Value; 24 class Value;
25 } 25 }
26 26
27 namespace net { 27 namespace net {
28 28
29 class AddressList; 29 class AddressList;
30 class BoundNetLog; 30 class BoundNetLog;
31 class HostResolverImpl;
31 class HostResolverProc; 32 class HostResolverProc;
32 class NetLog; 33 class NetLog;
33 34
34 // This class represents the task of resolving hostnames (or IP address 35 // This class represents the task of resolving hostnames (or IP address
35 // literal) to an AddressList object. 36 // literal) to an AddressList object.
36 // 37 //
37 // HostResolver can handle multiple requests at a time, so when cancelling a 38 // HostResolver can handle multiple requests at a time, so when cancelling a
38 // request the RequestHandle that was returned by Resolve() needs to be 39 // request the RequestHandle that was returned by Resolve() needs to be
39 // given. A simpler alternative for consumers that only have 1 outstanding 40 // given. A simpler alternative for consumers that only have 1 outstanding
40 // request at a time is to create a SingleRequestHostResolver wrapper around 41 // request at a time is to create a SingleRequestHostResolver wrapper around
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 // Used primarily to clear the cache and for getting debug information. 183 // Used primarily to clear the cache and for getting debug information.
183 virtual HostCache* GetHostCache(); 184 virtual HostCache* GetHostCache();
184 185
185 // Returns the current DNS configuration |this| is using, as a Value, or 186 // 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. 187 // nullptr if it's configured to always use the system host resolver.
187 virtual std::unique_ptr<base::Value> GetDnsConfigAsValue() const; 188 virtual std::unique_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).
193 static std::unique_ptr<HostResolverImpl> CreateSystemResolverImpl(
194 const Options& options,
195 NetLog* net_log);
Ryan Sleevi 2016/06/21 01:25:53 Strictly speaking, this should be below the *Resol
Julia Tuttle 2016/07/18 18:43:32 Done.
192 static std::unique_ptr<HostResolver> CreateSystemResolver( 196 static std::unique_ptr<HostResolver> CreateSystemResolver(
193 const Options& options, 197 const Options& options,
194 NetLog* net_log); 198 NetLog* net_log);
195 199
196 // As above, but uses default parameters. 200 // As above, but uses default parameters.
201 static std::unique_ptr<HostResolverImpl> CreateDefaultResolverImpl(
202 NetLog* net_log);
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698