Index: net/proxy/proxy_service.cc |
diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc |
index a81d3f66bc7547e22e813ff62ec94e9c0dd72e7d..a57557b58e25aab34ba9090c75442afeb27a64b1 100644 |
--- a/net/proxy/proxy_service.cc |
+++ b/net/proxy/proxy_service.cc |
@@ -456,6 +456,12 @@ class ProxyService::InitProxyResolver { |
return LOAD_STATE_RESOLVING_PROXY_FOR_URL; |
} |
+ // This must be called before the HostResolver is torn down. |
+ void OnShutdown() { |
+ if (decider_) |
+ decider_->OnShutdown(); |
+ } |
+ |
void set_quick_check_enabled(bool enabled) { quick_check_enabled_ = enabled; } |
bool quick_check_enabled() const { return quick_check_enabled_; } |
@@ -1458,6 +1464,17 @@ void ProxyService::SetProxyScriptFetchers( |
ApplyProxyConfigIfAvailable(); |
} |
+void ProxyService::OnShutdown() { |
+ // Order here does not matter for correctness. |init_proxy_resolver_| is first |
+ // because shutting it down also cancels its requests using the fetcher. |
+ if (init_proxy_resolver_) |
+ init_proxy_resolver_->OnShutdown(); |
+ if (proxy_script_fetcher_) |
+ proxy_script_fetcher_->OnShutdown(); |
+ if (dhcp_proxy_script_fetcher_) |
+ dhcp_proxy_script_fetcher_->OnShutdown(); |
+} |
+ |
ProxyScriptFetcher* ProxyService::GetProxyScriptFetcher() const { |
DCHECK(CalledOnValidThread()); |
return proxy_script_fetcher_.get(); |