Chromium Code Reviews| Index: content/shell/browser/shell_browser_main_parts.cc |
| diff --git a/content/shell/browser/shell_browser_main_parts.cc b/content/shell/browser/shell_browser_main_parts.cc |
| index 2b7726d0660d378d12dcbc28131c0cfb8cd60607..215267cacfc781a7996fcbfe4741ea2002b49682 100644 |
| --- a/content/shell/browser/shell_browser_main_parts.cc |
| +++ b/content/shell/browser/shell_browser_main_parts.cc |
| @@ -18,6 +18,7 @@ |
| #include "content/public/common/content_switches.h" |
| #include "content/public/common/main_function_params.h" |
| #include "content/public/common/url_constants.h" |
| +#include "content/shell/android/shell_descriptors.h" |
| #include "content/shell/browser/shell.h" |
| #include "content/shell/browser/shell_access_token_store.h" |
| #include "content/shell/browser/shell_browser_context.h" |
| @@ -37,6 +38,7 @@ |
| #if defined(OS_ANDROID) |
| #include "base/message_loop/message_loop.h" |
| #include "components/crash/content/browser/crash_dump_manager_android.h" |
| +#include "components/crash/content/browser/crash_dump_observer_android.h" |
| #include "net/android/network_change_notifier_factory_android.h" |
| #include "net/base/network_change_notifier.h" |
| #endif |
| @@ -114,6 +116,10 @@ ShellBrowserMainParts::ShellBrowserMainParts( |
| } |
| ShellBrowserMainParts::~ShellBrowserMainParts() { |
| +#if defined(OS_ANDROID) |
| + breakpad::CrashDumpObserver::GetInstance()->UnregisterClient( |
| + crash_dump_manager_); |
| +#endif |
| } |
| #if !defined(OS_MACOSX) |
| @@ -165,12 +171,15 @@ void ShellBrowserMainParts::InitializeMessageLoopContext() { |
| #if defined(OS_ANDROID) |
| int ShellBrowserMainParts::PreCreateThreads() { |
| + breakpad::CrashDumpObserver::Create(); |
| if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| switches::kEnableCrashReporter)) { |
| base::FilePath crash_dumps_dir = |
| base::CommandLine::ForCurrentProcess()->GetSwitchValuePath( |
| switches::kCrashDumpsDir); |
| - crash_dump_manager_.reset(new breakpad::CrashDumpManager(crash_dumps_dir)); |
| + breakpad::CrashDumpObserver::GetInstance()->RegisterClient( |
| + crash_dump_manager_ = new breakpad::CrashDumpManager( |
|
boliu
2016/10/13 21:07:19
ditto
Tobias Sargeant
2016/12/08 16:41:42
Done.
|
| + crash_dumps_dir, kAndroidMinidumpDescriptor)); |
| } |
| return 0; |