summaryrefslogtreecommitdiffstats
path: root/chrome/browser/io_thread.cc
diff options
context:
space:
mode:
authoreroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-27 00:01:41 +0000
committereroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-27 00:01:41 +0000
commit2a92cd9469247921bda75f3d5a00a67f7bfd78eb (patch)
treecc54fa4a3805a540398f0b23c4f3597ec99b58f5 /chrome/browser/io_thread.cc
parent032dea757076b465d613314736095ce82c542c1b (diff)
downloadchromium_src-2a92cd9469247921bda75f3d5a00a67f7bfd78eb.zip
chromium_src-2a92cd9469247921bda75f3d5a00a67f7bfd78eb.tar.gz
chromium_src-2a92cd9469247921bda75f3d5a00a67f7bfd78eb.tar.bz2
Make sure the "cancel leaked host resolver requests shutdown hack" gets run before the message loop is destroyed.
BUG=41966 Review URL: http://codereview.chromium.org/1798001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45644 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/io_thread.cc')
-rw-r--r--chrome/browser/io_thread.cc15
1 files changed, 14 insertions, 1 deletions
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
index 887d470..28824b5 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -144,7 +144,7 @@ void IOThread::Init() {
globals_->http_auth_handler_factory.reset(CreateDefaultAuthHandlerFactory());
}
-void IOThread::CleanUpAfterMessageLoopDestruction() {
+void IOThread::CleanUp() {
// Not initialized in Init(). May not be initialized.
if (dns_master_) {
DCHECK(prefetch_observer_);
@@ -170,6 +170,10 @@ void IOThread::CleanUpAfterMessageLoopDestruction() {
globals_->host_resolver.get()->GetAsHostResolverImpl()->Shutdown();
}
+ // We will delete the NetLog as part of CleanUpAfterMessageLoopDestruction()
+ // in case any of the message loop destruction observers try to access it.
+ deferred_net_log_to_delete_.reset(globals_->net_log.release());
+
delete globals_;
globals_ = NULL;
@@ -186,6 +190,15 @@ void IOThread::CleanUpAfterMessageLoopDestruction() {
base::LeakTracker<URLFetcher>::CheckForLeaks();
base::LeakTracker<URLRequest>::CheckForLeaks();
+ BrowserProcessSubThread::CleanUp();
+}
+
+void IOThread::CleanUpAfterMessageLoopDestruction() {
+ // TODO(eroman): get rid of this special case for 39723. If we could instead
+ // have a method that runs after the message loop destruction obsevers have
+ // run, but before the message loop itself is destroyed, we could safely
+ // combine the two cleanups.
+ deferred_net_log_to_delete_.reset();
BrowserProcessSubThread::CleanUpAfterMessageLoopDestruction();
}