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

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: Resolve merge conflict. Created 4 years, 4 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
« no previous file with comments | « components/cronet/url_request_context_config_unittest.cc ('k') | net/dns/host_resolver.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 virtual void InitializePersistence( 212 virtual void InitializePersistence(
212 const PersistCallback& persist_callback, 213 const PersistCallback& persist_callback,
213 std::unique_ptr<const base::Value> old_data); 214 std::unique_ptr<const base::Value> old_data);
214 215
215 // Creates a HostResolver implementation that queries the underlying system. 216 // Creates a HostResolver implementation that queries the underlying system.
216 // (Except if a unit-test has changed the global HostResolverProc using 217 // (Except if a unit-test has changed the global HostResolverProc using
217 // ScopedHostResolverProc to intercept requests to the system). 218 // ScopedHostResolverProc to intercept requests to the system).
218 static std::unique_ptr<HostResolver> CreateSystemResolver( 219 static std::unique_ptr<HostResolver> CreateSystemResolver(
219 const Options& options, 220 const Options& options,
220 NetLog* net_log); 221 NetLog* net_log);
222 // Same, but explicitly returns the HostResolverImpl. Only used by
223 // StaleHostResolver in cronet.
224 static std::unique_ptr<HostResolverImpl> CreateSystemResolverImpl(
225 const Options& options,
226 NetLog* net_log);
221 227
222 // As above, but uses default parameters. 228 // As above, but uses default parameters.
223 static std::unique_ptr<HostResolver> CreateDefaultResolver(NetLog* net_log); 229 static std::unique_ptr<HostResolver> CreateDefaultResolver(NetLog* net_log);
230 // Same, but explicitly returns the HostResolverImpl. Only used by
231 // StaleHostResolver in cronet.
232 static std::unique_ptr<HostResolverImpl> CreateDefaultResolverImpl(
233 NetLog* net_log);
224 234
225 protected: 235 protected:
226 HostResolver(); 236 HostResolver();
227 237
228 private: 238 private:
229 DISALLOW_COPY_AND_ASSIGN(HostResolver); 239 DISALLOW_COPY_AND_ASSIGN(HostResolver);
230 }; 240 };
231 241
232 } // namespace net 242 } // namespace net
233 243
234 #endif // NET_DNS_HOST_RESOLVER_H_ 244 #endif // NET_DNS_HOST_RESOLVER_H_
OLDNEW
« no previous file with comments | « components/cronet/url_request_context_config_unittest.cc ('k') | net/dns/host_resolver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698