Chromium Code Reviews| Index: 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 e88c2adf4c2c4ad07ad0c5a5167f101ff798e6d7..53fca606c904ec787d30cafd2a203a0d21097af3 100644 |
| --- a/chrome/browser/chrome_content_browser_client.cc |
| +++ b/chrome/browser/chrome_content_browser_client.cc |
| @@ -120,6 +120,7 @@ |
| #elif defined(OS_LINUX) |
| #include "chrome/browser/chrome_browser_main_linux.h" |
| #elif defined(OS_ANDROID) |
| +#include "chrome/browser/android/crash_dump_manager.h" |
| #include "chrome/browser/chrome_browser_main_android.h" |
| #include "chrome/common/descriptors_android.h" |
| #elif defined(OS_POSIX) |
| @@ -571,6 +572,10 @@ 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 |
| } |
| void ChromeContentBrowserClient::BrowserChildProcessHostCreated( |
| @@ -1757,12 +1762,6 @@ FilePath ChromeContentBrowserClient::GetHyphenDictionaryDirectory() { |
| void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess( |
| const CommandLine& command_line, |
| std::vector<FileDescriptorInfo>* mappings) { |
| - int crash_signal_fd = GetCrashSignalFD(command_line); |
| - if (crash_signal_fd >= 0) { |
| - mappings->push_back(FileDescriptorInfo(kCrashDumpSignal, |
| - FileDescriptor(crash_signal_fd, |
| - false))); |
| - } |
| #if defined(OS_ANDROID) |
| FilePath data_path; |
| PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &data_path); |
| @@ -1790,6 +1789,25 @@ void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess( |
| DCHECK(f != base::kInvalidPlatformFileValue); |
| mappings->push_back(FileDescriptorInfo(kAndroidLocalePakDescriptor, |
| FileDescriptor(f, true))); |
| + |
| +#if defined(USE_LINUX_BREAKPAD) |
| + f = crash_dump_manager_->CreateMinidumpFile(); |
| + if (f == base::kInvalidPlatformFileValue) { |
| + LOG(ERROR) << "Failed to create file for minidump, crash reporting will be " |
| + "disabled for this process."; |
| + } else { |
| + mappings->push_back(FileDescriptorInfo(kAndroidMinidumpDescriptor, |
| + FileDescriptor(f, true))); |
| + } |
| +#endif |
|
Lei Zhang
2012/10/19 23:22:34
nit: #endif //defined(USE_LINUX_BREAKPAD)
Jay Civelli
2012/10/22 22:09:48
Done.
|
| + |
| +#else |
| + int crash_signal_fd = GetCrashSignalFD(command_line); |
| + if (crash_signal_fd >= 0) { |
| + mappings->push_back(FileDescriptorInfo(kCrashDumpSignal, |
| + FileDescriptor(crash_signal_fd, |
| + false))); |
| + } |
| #endif // defined(OS_ANDROID) |
| } |
| #endif // defined(OS_POSIX) && !defined(OS_MACOSX) |
| @@ -1800,6 +1818,13 @@ 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( |