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

Unified Diff: net/dns/host_resolver_impl.h

Issue 1177933002: Resolve RFC 6761 localhost names to loopback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rsleevi nit Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/net_util_unittest.cc ('k') | net/dns/host_resolver_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/host_resolver_impl.h
diff --git a/net/dns/host_resolver_impl.h b/net/dns/host_resolver_impl.h
index e3b8ed7685ea5b935287a4a405e9769b45938ddf..b35281f079461b98d0cd169c0b0371baa9518b05 100644
--- a/net/dns/host_resolver_impl.h
+++ b/net/dns/host_resolver_impl.h
@@ -161,7 +161,8 @@ class NET_EXPORT HostResolverImpl
// Helper used by |Resolve()| and |ResolveFromCache()|. Performs IP
// literal, cache and HOSTS lookup (if enabled), returns OK if successful,
// ERR_NAME_NOT_RESOLVED if either hostname is invalid or IP literal is
- // incompatible, ERR_DNS_CACHE_MISS if entry was not found in cache and HOSTS.
+ // incompatible, ERR_DNS_CACHE_MISS if entry was not found in cache and
+ // HOSTS and is not localhost.
int ResolveHelper(const Key& key,
const RequestInfo& info,
const IPAddressNumber* ip_address,
@@ -190,6 +191,12 @@ class NET_EXPORT HostResolverImpl
const RequestInfo& info,
AddressList* addresses);
+ // If |key| is for a localhost name (RFC 6761), returns true and fills
+ // |addresses| with the loopback IP. Otherwise returns false.
+ bool ServeLocalhost(const Key& key,
+ const RequestInfo& info,
+ AddressList* addresses);
+
// Callback from HaveOnlyLoopbackAddresses probe.
void SetHaveOnlyLoopbackAddresses(bool result);
« no previous file with comments | « net/base/net_util_unittest.cc ('k') | net/dns/host_resolver_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698