summaryrefslogtreecommitdiffstats
path: root/chrome/browser/net/dns_global.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/net/dns_global.cc')
-rw-r--r--chrome/browser/net/dns_global.cc16
1 files changed, 6 insertions, 10 deletions
diff --git a/chrome/browser/net/dns_global.cc b/chrome/browser/net/dns_global.cc
index 9e4c8f6..4b821c6 100644
--- a/chrome/browser/net/dns_global.cc
+++ b/chrome/browser/net/dns_global.cc
@@ -435,9 +435,13 @@ void InitDnsPrefetch(size_t max_concurrent, PrefService* user_prefs) {
}
void EnsureDnsPrefetchShutdown() {
- if (NULL != dns_master)
+ if (NULL != dns_master) {
dns_master->Shutdown();
- FreeGlobalHostResolver();
+
+ // Stop observing DNS resolutions. Note that dns_master holds a reference
+ // to the global host resolver, so is guaranteed to be live.
+ GetGlobalHostResolver()->RemoveObserver(&dns_resolution_observer);
+ }
}
void FreeDnsPrefetchResources() {
@@ -469,14 +473,6 @@ net::HostResolver* GetGlobalHostResolver() {
return global_host_resolver;
}
-void FreeGlobalHostResolver() {
- if (global_host_resolver) {
- // Called from IO thread.
- delete global_host_resolver;
- global_host_resolver = NULL;
- }
-}
-
//------------------------------------------------------------------------------
// Functions to handle saving of hostnames from one session to the next, to
// expedite startup times.