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

Unified Diff: net/base/host_resolver_impl.h

Issue 9667025: [net/dns] Serve requests from HOSTS file if possible. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/base/host_resolver_impl.cc » ('j') | net/base/host_resolver_impl.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/host_resolver_impl.h
diff --git a/net/base/host_resolver_impl.h b/net/base/host_resolver_impl.h
index dd8c70e334c285d75ff72691e1a5e0c51b9e10b4..348e6ef949419e9586c2d75845bfd5deb8210115 100644
--- a/net/base/host_resolver_impl.h
+++ b/net/base/host_resolver_impl.h
@@ -27,6 +27,7 @@
namespace net {
+class DnsSession;
class DnsTransactionFactory;
// For each hostname that is requested, HostResolver creates a
@@ -184,10 +185,15 @@ class NET_EXPORT HostResolverImpl
// if it is a positive entry.
bool ServeFromCache(const Key& key,
const RequestInfo& info,
- const BoundNetLog& request_net_log,
int* net_error,
AddressList* addresses);
+ // If |key| is not found in the HOSTS file or no HOSTS file known, returns
+ // false, otherwise returns true and fills |addresses|.
+ bool ServeFromHosts(const Key& key,
+ const RequestInfo& info,
+ AddressList* addresses);
+
// Notifies IPv6ProbeJob not to call back, and discard reference to the job.
void DiscardIPv6ProbeJob();
@@ -212,6 +218,9 @@ class NET_EXPORT HostResolverImpl
// Might start new jobs.
void AbortAllInProgressJobs();
+ // Attempts to serve each Job in |jobs_| from the HOSTS file.
+ void TryServingAllJobsFromHosts();
+
// NetworkChangeNotifier::IPAddressObserver:
virtual void OnIPAddressChanged() OVERRIDE;
@@ -241,6 +250,7 @@ class NET_EXPORT HostResolverImpl
// Address family to use when the request doesn't specify one.
AddressFamily default_address_family_;
+ scoped_refptr<DnsSession> dns_session_;
scoped_ptr<DnsConfigService> dns_config_service_;
// Indicate if probing is done after each network change event to set address
« no previous file with comments | « no previous file | net/base/host_resolver_impl.cc » ('j') | net/base/host_resolver_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698