Index: net/dns/mock_host_resolver.cc |
diff --git a/net/dns/mock_host_resolver.cc b/net/dns/mock_host_resolver.cc |
index ff5ffbc2f75082cbd83aae9a512cd7096d895b26..ab4c0a8f0a49829a2072ab36496d0e60cb43ff65 100644 |
--- a/net/dns/mock_host_resolver.cc |
+++ b/net/dns/mock_host_resolver.cc |
@@ -117,7 +117,7 @@ void MockHostResolverBase::CancelRequest(RequestHandle handle) { |
requests_.erase(it); |
} else { |
NOTREACHED() << "CancelRequest must NOT be called after request is " |
- "complete or canceled."; |
+ "complete or canceled."; |
} |
} |
@@ -161,9 +161,8 @@ int MockHostResolverBase::ResolveFromIPLiteralOrCache(const RequestInfo& info, |
} |
int rv = ERR_DNS_CACHE_MISS; |
if (cache_.get() && info.allow_cached_response()) { |
- HostCache::Key key(info.hostname(), |
- info.address_family(), |
- info.host_resolver_flags()); |
+ HostCache::Key key( |
+ info.hostname(), info.address_family(), info.host_resolver_flags()); |
const HostCache::Entry* entry = cache_->Lookup(key, base::TimeTicks::Now()); |
if (entry) { |
rv = entry->error; |
@@ -184,9 +183,8 @@ int MockHostResolverBase::ResolveProc(size_t id, |
&addr, |
NULL); |
if (cache_.get()) { |
- HostCache::Key key(info.hostname(), |
- info.address_family(), |
- info.host_resolver_flags()); |
+ HostCache::Key key( |
+ info.hostname(), info.address_family(), info.host_resolver_flags()); |
// Storing a failure with TTL 0 so that it overwrites previous value. |
base::TimeDelta ttl; |
if (rv == OK) |
@@ -249,8 +247,8 @@ RuleBasedHostResolverProc::RuleBasedHostResolverProc(HostResolverProc* previous) |
void RuleBasedHostResolverProc::AddRule(const std::string& host_pattern, |
const std::string& replacement) { |
- AddRuleForAddressFamily(host_pattern, ADDRESS_FAMILY_UNSPECIFIED, |
- replacement); |
+ AddRuleForAddressFamily( |
+ host_pattern, ADDRESS_FAMILY_UNSPECIFIED, replacement); |
} |
void RuleBasedHostResolverProc::AddRuleForAddressFamily( |
@@ -259,7 +257,7 @@ void RuleBasedHostResolverProc::AddRuleForAddressFamily( |
const std::string& replacement) { |
DCHECK(!replacement.empty()); |
HostResolverFlags flags = HOST_RESOLVER_LOOPBACK_ONLY | |
- HOST_RESOLVER_DEFAULT_FAMILY_SET_DUE_TO_NO_IPV6; |
+ HOST_RESOLVER_DEFAULT_FAMILY_SET_DUE_TO_NO_IPV6; |
Rule rule(Rule::kResolverTypeSystem, |
host_pattern, |
address_family, |
@@ -279,11 +277,15 @@ void RuleBasedHostResolverProc::AddIPLiteralRule( |
IPAddressNumber ip_number; |
DCHECK(!ParseIPLiteralToNumber(host_pattern, &ip_number)); |
HostResolverFlags flags = HOST_RESOLVER_LOOPBACK_ONLY | |
- HOST_RESOLVER_DEFAULT_FAMILY_SET_DUE_TO_NO_IPV6; |
+ HOST_RESOLVER_DEFAULT_FAMILY_SET_DUE_TO_NO_IPV6; |
if (!canonical_name.empty()) |
flags |= HOST_RESOLVER_CANONNAME; |
- Rule rule(Rule::kResolverTypeIPLiteral, host_pattern, |
- ADDRESS_FAMILY_UNSPECIFIED, flags, ip_literal, canonical_name, |
+ Rule rule(Rule::kResolverTypeIPLiteral, |
+ host_pattern, |
+ ADDRESS_FAMILY_UNSPECIFIED, |
+ flags, |
+ ip_literal, |
+ canonical_name, |
0); |
rules_.push_back(rule); |
} |
@@ -294,7 +296,7 @@ void RuleBasedHostResolverProc::AddRuleWithLatency( |
int latency_ms) { |
DCHECK(!replacement.empty()); |
HostResolverFlags flags = HOST_RESOLVER_LOOPBACK_ONLY | |
- HOST_RESOLVER_DEFAULT_FAMILY_SET_DUE_TO_NO_IPV6; |
+ HOST_RESOLVER_DEFAULT_FAMILY_SET_DUE_TO_NO_IPV6; |
Rule rule(Rule::kResolverTypeSystem, |
host_pattern, |
ADDRESS_FAMILY_UNSPECIFIED, |
@@ -308,7 +310,7 @@ void RuleBasedHostResolverProc::AddRuleWithLatency( |
void RuleBasedHostResolverProc::AllowDirectLookup( |
const std::string& host_pattern) { |
HostResolverFlags flags = HOST_RESOLVER_LOOPBACK_ONLY | |
- HOST_RESOLVER_DEFAULT_FAMILY_SET_DUE_TO_NO_IPV6; |
+ HOST_RESOLVER_DEFAULT_FAMILY_SET_DUE_TO_NO_IPV6; |
Rule rule(Rule::kResolverTypeSystem, |
host_pattern, |
ADDRESS_FAMILY_UNSPECIFIED, |
@@ -322,7 +324,7 @@ void RuleBasedHostResolverProc::AllowDirectLookup( |
void RuleBasedHostResolverProc::AddSimulatedFailure( |
const std::string& host_pattern) { |
HostResolverFlags flags = HOST_RESOLVER_LOOPBACK_ONLY | |
- HOST_RESOLVER_DEFAULT_FAMILY_SET_DUE_TO_NO_IPV6; |
+ HOST_RESOLVER_DEFAULT_FAMILY_SET_DUE_TO_NO_IPV6; |
Rule rule(Rule::kResolverTypeFail, |
host_pattern, |
ADDRESS_FAMILY_UNSPECIFIED, |
@@ -377,19 +379,18 @@ int RuleBasedHostResolverProc::Resolve(const std::string& host, |
return SystemHostResolverCall(effective_host, |
address_family, |
host_resolver_flags, |
- addrlist, os_error); |
+ addrlist, |
+ os_error); |
case Rule::kResolverTypeIPLiteral: |
- return ParseAddressList(effective_host, |
- r->canonical_name, |
- addrlist); |
+ return ParseAddressList(effective_host, r->canonical_name, addrlist); |
default: |
NOTREACHED(); |
return ERR_UNEXPECTED; |
} |
} |
} |
- return ResolveUsingPrevious(host, address_family, |
- host_resolver_flags, addrlist, os_error); |
+ return ResolveUsingPrevious( |
+ host, address_family, host_resolver_flags, addrlist, os_error); |
} |
RuleBasedHostResolverProc::~RuleBasedHostResolverProc() { |
@@ -422,7 +423,8 @@ int HangingHostResolver::ResolveFromCache(const RequestInfo& info, |
//----------------------------------------------------------------------------- |
-ScopedDefaultHostResolverProc::ScopedDefaultHostResolverProc() {} |
+ScopedDefaultHostResolverProc::ScopedDefaultHostResolverProc() { |
+} |
ScopedDefaultHostResolverProc::ScopedDefaultHostResolverProc( |
HostResolverProc* proc) { |