| Index: net/base/host_resolver_impl.cc
|
| diff --git a/net/base/host_resolver_impl.cc b/net/base/host_resolver_impl.cc
|
| index 1f43c606b2b329115e19ead6a447bcc548525e89..df5bc7905b2f8acb3ef67c8fb5d70a416795fdbc 100644
|
| --- a/net/base/host_resolver_impl.cc
|
| +++ b/net/base/host_resolver_impl.cc
|
| @@ -683,6 +683,8 @@ HostResolverImpl::HostResolverImpl(
|
| #if defined(OS_WIN)
|
| EnsureWinsockInit();
|
| #endif
|
| + if (network_change_notifier_)
|
| + network_change_notifier_->AddObserver(this);
|
| }
|
|
|
| HostResolverImpl::~HostResolverImpl() {
|
| @@ -697,6 +699,9 @@ HostResolverImpl::~HostResolverImpl() {
|
| if (cur_completing_job_)
|
| cur_completing_job_->Cancel();
|
|
|
| + if (network_change_notifier_)
|
| + network_change_notifier_->RemoveObserver(this);
|
| +
|
| // Delete the job pools.
|
| for (size_t i = 0u; i < arraysize(job_pools_); ++i)
|
| delete job_pools_[i];
|
| @@ -841,7 +846,7 @@ void HostResolverImpl::SetDefaultAddressFamily(AddressFamily address_family) {
|
| void HostResolverImpl::ProbeIPv6Support() {
|
| DCHECK(!ipv6_probe_monitoring_);
|
| ipv6_probe_monitoring_ = true;
|
| - Flush(); // Give initial setup call.
|
| + OnIPAddressChanged(); // Give initial setup call.
|
| }
|
|
|
| void HostResolverImpl::Shutdown() {
|
| @@ -1074,7 +1079,7 @@ void HostResolverImpl::OnCancelRequest(const BoundNetLog& net_log,
|
| net_log.EndEvent(NetLog::TYPE_HOST_RESOLVER_IMPL);
|
| }
|
|
|
| -void HostResolverImpl::Flush() {
|
| +void HostResolverImpl::OnIPAddressChanged() {
|
| if (cache_.get())
|
| cache_->clear();
|
| if (ipv6_probe_monitoring_) {
|
|
|