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

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: Added MockDnsClient. 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..9dd7acef498e1acb17764a7034eb69a250bf5ba4 100644
--- a/net/base/host_resolver_impl.h
+++ b/net/base/host_resolver_impl.h
@@ -27,7 +27,7 @@
namespace net {
-class DnsTransactionFactory;
+class DnsClient;
// For each hostname that is requested, HostResolver creates a
// HostResolverImpl::Job. When this job gets dispatched it creates a ProcTask
@@ -184,10 +184,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 +217,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;
@@ -221,6 +229,9 @@ class NET_EXPORT HostResolverImpl
// DnsConfigService::Observer:
virtual void OnConfigChanged(const DnsConfig& dns_config) OVERRIDE;
+ // True if have fully configured DNS client.
+ bool HaveDnsConfig() const;
+
// Cache of host resolution results.
scoped_ptr<HostCache> cache_;
@@ -236,11 +247,10 @@ class NET_EXPORT HostResolverImpl
// Parameters for ProcTask.
ProcTaskParams proc_params_;
- scoped_ptr<DnsTransactionFactory> dns_transaction_factory_;
-
// Address family to use when the request doesn't specify one.
AddressFamily default_address_family_;
+ scoped_ptr<DnsClient> dns_client_;
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