summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorszym@chromium.org <szym@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-24 09:02:01 +0000
committerszym@chromium.org <szym@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-24 09:02:01 +0000
commit7b5db7694c0183c9892b5d5b11ebe8e25718f9ef (patch)
tree8f8292648cefc11f3417ca58b11c8d5f17b489b0 /net
parent5c99490613db903848a3a130ecad17b198581816 (diff)
downloadchromium_src-7b5db7694c0183c9892b5d5b11ebe8e25718f9ef.zip
chromium_src-7b5db7694c0183c9892b5d5b11ebe8e25718f9ef.tar.gz
chromium_src-7b5db7694c0183c9892b5d5b11ebe8e25718f9ef.tar.bz2
[net/dns] Don't abort Jobs on hosts-only change.
BUG=119604 Review URL: http://codereview.chromium.org/9839027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128720 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/base/host_resolver_impl.cc17
1 files changed, 11 insertions, 6 deletions
diff --git a/net/base/host_resolver_impl.cc b/net/base/host_resolver_impl.cc
index 696617e..5c202ed 100644
--- a/net/base/host_resolver_impl.cc
+++ b/net/base/host_resolver_impl.cc
@@ -1932,20 +1932,25 @@ void HostResolverImpl::OnDnsConfigChanged(const DnsConfig& dns_config) {
make_scoped_refptr(new DnsConfigParameters(dns_config)));
}
- // We want a new factory in place, before we Abort running Jobs, so that the
- // newly started jobs use the new factory.
DCHECK(dns_client_.get());
// Life check to bail once |this| is deleted.
base::WeakPtr<HostResolverImpl> self = AsWeakPtr();
- bool had_factory = (dns_client_->GetConfig() != NULL);
+ bool config_changed = (dns_client_->GetConfig() != NULL) &&
+ !dns_config.EqualsIgnoreHosts(*dns_client_->GetConfig());
+
+ // We want a new factory in place, before we Abort running Jobs, so that the
+ // newly started jobs use the new factory.
dns_client_->SetConfig(dns_config);
- // Don't Abort running Jobs unless they were running on DnsTransaction.
- // TODO(szym): This will change once http://crbug.com/114827 is fixed.
- if (had_factory)
+ // Don't Abort running Jobs unless they were running on DnsTransaction and
+ // DnsConfig changed beyond DnsHosts. HOSTS-only change will be resolved by
+ // TryServingAllJobsFromHosts below.
+ if (config_changed) {
+ // TODO(szym): This will change once http://crbug.com/114827 is fixed.
OnDNSChanged(NetworkChangeNotifier::CHANGE_DNS_SETTINGS);
+ }
if (self && dns_config.IsValid())
TryServingAllJobsFromHosts();