Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(705)

Unified Diff: chrome/browser/chrome_browser_main_android.cc

Issue 2393853002: Refactor CrashDump*Manager to use a shared CrashDumpObserver singleton. (Closed)
Patch Set: Rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chrome_browser_main_android.h ('k') | chrome/browser/chrome_content_browser_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_main_android.cc
diff --git a/chrome/browser/chrome_browser_main_android.cc b/chrome/browser/chrome_browser_main_android.cc
index 2266442d162c1285f6d5861536b76f248d014db8..edd82db3c237ff2ffc0541d9bd27b64a90014baf 100644
--- a/chrome/browser/chrome_browser_main_android.cc
+++ b/chrome/browser/chrome_browser_main_android.cc
@@ -14,6 +14,7 @@
#include "chrome/browser/android/seccomp_support_detector.h"
#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/common/chrome_paths.h"
+#include "chrome/common/descriptors_android.h"
#include "components/crash/content/app/breakpad_linux.h"
#include "components/crash/content/browser/crash_dump_manager_android.h"
#include "components/signin/core/browser/signin_manager.h"
@@ -46,10 +47,13 @@ ChromeBrowserMainPartsAndroid::~ChromeBrowserMainPartsAndroid() {
int ChromeBrowserMainPartsAndroid::PreCreateThreads() {
TRACE_EVENT0("startup", "ChromeBrowserMainPartsAndroid::PreCreateThreads")
- // The CrashDumpManager must be initialized before any child process is
- // created (as they need to access it during creation). Such processes
- // are created on the PROCESS_LAUNCHER thread, and so the manager is
- // initialized before that thread is created.
+ // The CrashDumpManager must be registered before any child process is
+ // created (as it needs to be notified during child process
+ // creation). Such processes are created on the PROCESS_LAUNCHER
+ // thread, and so the observer is initialized and the manager
+ // registered before that thread is created.
+ breakpad::CrashDumpObserver::Create();
+
#if defined(GOOGLE_CHROME_BUILD)
// TODO(jcivelli): we should not initialize the crash-reporter when it was not
// enabled. Right now if it is disabled we still generate the minidumps but we
@@ -67,7 +71,9 @@ int ChromeBrowserMainPartsAndroid::PreCreateThreads() {
if (breakpad_enabled) {
base::FilePath crash_dump_dir;
PathService::Get(chrome::DIR_CRASH_DUMPS, &crash_dump_dir);
- crash_dump_manager_.reset(new breakpad::CrashDumpManager(crash_dump_dir));
+ breakpad::CrashDumpObserver::GetInstance()->RegisterClient(
+ base::MakeUnique<breakpad::CrashDumpManager>(
+ crash_dump_dir, kAndroidMinidumpDescriptor));
}
// Auto-detect based on en-US whether locale .pak files are store uncompressed
« no previous file with comments | « chrome/browser/chrome_browser_main_android.h ('k') | chrome/browser/chrome_content_browser_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698