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

Unified Diff: net/dns/mock_host_resolver.cc

Issue 23181010: Fast-fail WPAD detection. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Re-fix MockHostResolver Created 7 years, 3 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/dns/host_resolver_impl_unittest.cc ('k') | net/proxy/proxy_script_decider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/mock_host_resolver.cc
diff --git a/net/dns/mock_host_resolver.cc b/net/dns/mock_host_resolver.cc
index a1d46d06d3417adb2e970ea1e061553a3ee28c5a..ff5ffbc2f75082cbd83aae9a512cd7096d895b26 100644
--- a/net/dns/mock_host_resolver.cc
+++ b/net/dns/mock_host_resolver.cc
@@ -347,12 +347,14 @@ int RuleBasedHostResolverProc::Resolve(const std::string& host,
bool matches_address_family =
r->address_family == ADDRESS_FAMILY_UNSPECIFIED ||
r->address_family == address_family;
+ // Ignore HOST_RESOLVER_SYSTEM_ONLY, since it should have no impact on
+ // whether a rule matches.
+ HostResolverFlags flags = host_resolver_flags & ~HOST_RESOLVER_SYSTEM_ONLY;
// Flags match if all of the bitflags in host_resolver_flags are enabled
// in the rule's host_resolver_flags. However, the rule may have additional
// flags specified, in which case the flags should still be considered a
// match.
- bool matches_flags = (r->host_resolver_flags & host_resolver_flags) ==
- host_resolver_flags;
+ bool matches_flags = (r->host_resolver_flags & flags) == flags;
if (matches_flags && matches_address_family &&
MatchPattern(host, r->host_pattern)) {
if (r->latency_ms != 0) {
« no previous file with comments | « net/dns/host_resolver_impl_unittest.cc ('k') | net/proxy/proxy_script_decider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698