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

Unified Diff: net/base/host_resolver_impl.cc

Issue 10479005: [net/dns] Only record HaveDnsChanged if the nameserver is not INADDR_ANY. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add bug number. Created 8 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/host_resolver_impl.cc
diff --git a/net/base/host_resolver_impl.cc b/net/base/host_resolver_impl.cc
index a66f950e5fa8d9d6c477ebc49e1aaac329df6f6d..1458e3ad7db451241ab78a8594eca3dd98fd6da9 100644
--- a/net/base/host_resolver_impl.cc
+++ b/net/base/host_resolver_impl.cc
@@ -1433,9 +1433,8 @@ class HostResolverImpl::Job : public PrioritizedDispatcher::Job {
SetPortOnAddressList(requests_->front()->info().port(), &list);
// Record this histogram here, when we know the system has a valid DNS
// configuration.
- UMA_HISTOGRAM_ENUMERATION("AsyncDNS.HaveDnsConfig",
- resolver_->received_dns_config_ ? 1 : 0,
- 2);
+ UMA_HISTOGRAM_BOOLEAN("AsyncDNS.HaveDnsConfig",
+ resolver_->received_dns_config_);
}
if ((net_error != ERR_ABORTED) &&
@@ -1966,7 +1965,14 @@ void HostResolverImpl::OnDnsConfigChanged(const DnsConfig& dns_config) {
}
// TODO(szym): Remove once http://crbug.com/125599 is resolved.
- received_dns_config_ = dns_config.IsValid();
+ received_dns_config_ = false;
+ if (dns_config.IsValid()) {
+ // Quick check if the address is not INADDR_ANY, which is the default value
+ // in absence of network connection. http://crbug.com/130808
+ if (dns_config.nameservers[0].address()[0]) {
mmenke 2012/06/01 22:20:27 Is it possible that we'd have INADDR_ANY, followed
+ received_dns_config_ = true;
+ }
mmenke 2012/06/01 22:20:27 nit: No brackets for single-line ifs.
mmenke 2012/06/01 22:21:20 Actually, I'm never sure if that is optional or no
mmenke 2012/06/01 22:24:14 Ahh, chromium style guide: Other formatting "rule
+ }
// Life check to bail once |this| is deleted.
base::WeakPtr<HostResolverImpl> self = AsWeakPtr();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698