Chromium Code Reviews| 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(); |