diff options
author | mad@chromium.org <mad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-03 20:20:40 +0000 |
---|---|---|
committer | mad@chromium.org <mad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-03 20:20:40 +0000 |
commit | 1f20f1f024da631bdfec1de196e91d8c0837c02b (patch) | |
tree | 993a7b711fc3992cc70446662036751baeef59bc /chrome/browser/memory_details.cc | |
parent | e9d14e7c99f19756cdb91b78bdaa2d001ecf550e (diff) | |
download | chromium_src-1f20f1f024da631bdfec1de196e91d8c0837c02b.zip chromium_src-1f20f1f024da631bdfec1de196e91d8c0837c02b.tar.gz chromium_src-1f20f1f024da631bdfec1de196e91d8c0837c02b.tar.bz2 |
Don't try to collect memory details during shutdown.
There seems to be cases where the asynchronous task of collecting memory details is executed during shutdown.
This causes an attempt at using the profile object set in the RenderProcessHost after the profile was destroyed.
To avoid the crash, we simply interrupt the memory details collection if we identify that we are trying to shutdown.
BUG=112383
TEST=Make sure we still properly collect memory details.
Review URL: http://codereview.chromium.org/9317058
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120387 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/memory_details.cc')
-rw-r--r-- | chrome/browser/memory_details.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/chrome/browser/memory_details.cc b/chrome/browser/memory_details.cc index b93b79c..82c7836 100644 --- a/chrome/browser/memory_details.cc +++ b/chrome/browser/memory_details.cc @@ -13,6 +13,7 @@ #include "chrome/browser/extensions/extension_process_manager.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/browser/browser_shutdown.h" #include "chrome/common/chrome_view_type.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/url_constants.h" @@ -156,6 +157,12 @@ void MemoryDetails::CollectChildInfoOnIOThread() { void MemoryDetails::CollectChildInfoOnUIThread() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + // As identified in http://crbug.com/112383, we seem to get here after the + // profile has been deleted. The only way this can happen is if we get + // called during shutdown. If it's the case, just abandon ship. + if (browser_shutdown::IsTryingToQuit()) + return; + #if defined(OS_POSIX) && !defined(OS_MACOSX) const pid_t zygote_pid = ZygoteHost::GetInstance()->pid(); const pid_t sandbox_helper_pid = RenderSandboxHostLinux::GetInstance()->pid(); |