From 49373c988b59de09ce3cc432f6465c1bf7d3da50 Mon Sep 17 00:00:00 2001 From: "jcivelli@chromium.org" Date: Wed, 16 Jan 2013 09:02:52 +0000 Subject: Fix for a crasher when starting a renderer. A crash dump from the field reports that the CrashDumpManager in ChromeContentBrowserClient is not initialized when GetAdditionalMappedFilesForChildProcess is called. This is because the CrashDumpManager is initialized when a RenderProcessHost is created, but it could be the case that a BrowserChildProcessHost gets created first and calls GetAdditionalMappedFilesForChildProcess before any RenderProcessHost was created. Making the CrashDumpManager a singleton initialized early on to prevent this crasher. BUG=163456 TEST=None Review URL: https://chromiumcodereview.appspot.com/11884042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177110 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/chrome_content_browser_client.cc | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'chrome/browser/chrome_content_browser_client.cc') diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index 53ab0ed..ddcc370 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc @@ -619,10 +619,6 @@ void ChromeContentBrowserClient::RenderProcessHostCreated( RendererContentSettingRules rules; GetRendererContentSettingRules(profile->GetHostContentSettingsMap(), &rules); host->Send(new ChromeViewMsg_SetContentSettingRules(rules)); - -#if defined(OS_ANDROID) && defined(USE_LINUX_BREAKPAD) - InitCrashDumpManager(); -#endif } content::WebUIControllerFactory* @@ -1846,7 +1842,7 @@ void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess( FileDescriptor(f, true))); #if defined(USE_LINUX_BREAKPAD) - f = crash_dump_manager_->CreateMinidumpFile(child_process_id); + f = CrashDumpManager::GetInstance()->CreateMinidumpFile(child_process_id); if (f == base::kInvalidPlatformFileValue) { LOG(ERROR) << "Failed to create file for minidump, crash reporting will be " "disabled for this process."; @@ -1873,13 +1869,6 @@ const wchar_t* ChromeContentBrowserClient::GetResourceDllName() { } #endif -#if defined(OS_ANDROID) -void ChromeContentBrowserClient::InitCrashDumpManager() { - if (!crash_dump_manager_.get()) - crash_dump_manager_.reset(new CrashDumpManager()); -} -#endif - #if defined(USE_NSS) crypto::CryptoModuleBlockingPasswordDelegate* ChromeContentBrowserClient::GetCryptoPasswordDelegate( -- cgit v1.1