summaryrefslogtreecommitdiffstats
path: root/chrome/browser/net
diff options
context:
space:
mode:
authorericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-25 21:36:23 +0000
committerericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-25 21:36:23 +0000
commit7040fe137cccf5c85ac755ba56ae4e2f36d968bf (patch)
tree4f72571e6c6aed8dadab877c1f4d869b028d98a6 /chrome/browser/net
parent711b9060583aff856efb62b20dfb4c559e1aa423 (diff)
downloadchromium_src-7040fe137cccf5c85ac755ba56ae4e2f36d968bf.zip
chromium_src-7040fe137cccf5c85ac755ba56ae4e2f36d968bf.tar.gz
chromium_src-7040fe137cccf5c85ac755ba56ae4e2f36d968bf.tar.bz2
Reverting 19271.
Revert 19271, since it caused crash in reliability test. (dns prefetcher may still cancel requests on the host resolver during shutdown). Review URL: http://codereview.chromium.org/149026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19289 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net')
-rw-r--r--chrome/browser/net/chrome_url_request_context.cc7
-rw-r--r--chrome/browser/net/dns_global.cc14
2 files changed, 9 insertions, 12 deletions
diff --git a/chrome/browser/net/chrome_url_request_context.cc b/chrome/browser/net/chrome_url_request_context.cc
index 19b35e4..1e01821 100644
--- a/chrome/browser/net/chrome_url_request_context.cc
+++ b/chrome/browser/net/chrome_url_request_context.cc
@@ -460,8 +460,9 @@ ChromeURLRequestContext::~ChromeURLRequestContext() {
// Do not delete the proxy service in the case of OTR or media contexts, as
// it is owned by the original URLRequestContext.
- if (!is_off_the_record_ && !is_media_) {
+ if (!is_off_the_record_ && !is_media_)
delete proxy_service_;
- chrome_browser_net::FreeGlobalHostResolver();
- }
+
+ // Do not delete host_resolver_; it will be freed by FreeGlobalHostResolver()
+ // during the teardown of DNS prefetching.
}
diff --git a/chrome/browser/net/dns_global.cc b/chrome/browser/net/dns_global.cc
index f3b4c0e..9e4c8f6 100644
--- a/chrome/browser/net/dns_global.cc
+++ b/chrome/browser/net/dns_global.cc
@@ -38,9 +38,6 @@ static void DnsPrefetchMotivatedList(
// static
const size_t DnsPrefetcherInit::kMaxConcurrentLookups = 8;
-// Host resolver shared by DNS prefetcher, and the main URLRequestContext.
-static net::HostResolver* global_host_resolver = NULL;
-
//------------------------------------------------------------------------------
// This section contains all the globally accessable API entry points for the
// DNS Prefetching feature.
@@ -438,13 +435,9 @@ void InitDnsPrefetch(size_t max_concurrent, PrefService* user_prefs) {
}
void EnsureDnsPrefetchShutdown() {
- if (NULL != dns_master) {
+ if (NULL != dns_master)
dns_master->Shutdown();
-
- // Unregister the resolution observer added by InitDnsPrefetch()
- if (global_host_resolver)
- global_host_resolver->RemoveObserver(&dns_resolution_observer);
- }
+ FreeGlobalHostResolver();
}
void FreeDnsPrefetchResources() {
@@ -461,6 +454,9 @@ static void DiscardAllPrefetchState() {
//------------------------------------------------------------------------------
+// Host resolver shared by DNS prefetcher, and the main URLRequestContext.
+static net::HostResolver* global_host_resolver = NULL;
+
net::HostResolver* GetGlobalHostResolver() {
// Called from UI thread.
if (!global_host_resolver) {