Index: chromecast/crash/android/crash_handler.cc |
diff --git a/chromecast/crash/android/crash_handler.cc b/chromecast/crash/android/crash_handler.cc |
index 8bd580b64d97ada1a74ff95a0bd6447da721fb67..e5eb0c2fa850f174f2ed1c9e71312475a4fb0d4b 100644 |
--- a/chromecast/crash/android/crash_handler.cc |
+++ b/chromecast/crash/android/crash_handler.cc |
@@ -57,8 +57,8 @@ namespace chromecast { |
void CrashHandler::Initialize(const std::string& process_type, |
const base::FilePath& log_file_path) { |
DCHECK(!g_crash_handler); |
- g_crash_handler = new CrashHandler(log_file_path); |
- g_crash_handler->Initialize(process_type); |
+ g_crash_handler = new CrashHandler(process_type, log_file_path); |
+ g_crash_handler->Initialize(); |
} |
// static |
@@ -73,9 +73,12 @@ bool CrashHandler::RegisterCastCrashJni(JNIEnv* env) { |
return RegisterNativesImpl(env); |
} |
-CrashHandler::CrashHandler(const base::FilePath& log_file_path) |
+CrashHandler::CrashHandler(const std::string& process_type, |
+ const base::FilePath& log_file_path) |
: log_file_path_(log_file_path), |
- crash_reporter_client_(new CastCrashReporterClientAndroid) { |
+ process_type_(process_type), |
+ crash_reporter_client_( |
+ new CastCrashReporterClientAndroid(process_type.empty())) { |
slan
2015/06/10 18:20:54
It's unclear to me why process_type.empty() implie
gunsch
2015/06/10 18:29:05
It's not specific to us, but rather a convention t
|
if (!crash_reporter_client_->GetCrashDumpLocation(&crash_dump_path_)) { |
LOG(ERROR) << "Could not get crash dump location"; |
} |
@@ -87,8 +90,8 @@ CrashHandler::~CrashHandler() { |
g_crash_handler = NULL; |
} |
-void CrashHandler::Initialize(const std::string& process_type) { |
- if (process_type.empty()) { |
+void CrashHandler::Initialize() { |
+ if (process_type_.empty()) { |
InitializeUploader(); |
// ExceptionHandlers are called on crash in reverse order of |
@@ -100,13 +103,13 @@ void CrashHandler::Initialize(const std::string& process_type) { |
crash_uploader_.reset(new google_breakpad::ExceptionHandler( |
dummy, &HandleCrash, NULL, NULL, true, -1)); |
- breakpad::InitCrashReporter(process_type); |
+ breakpad::InitCrashReporter(process_type_); |
return; |
} |
- if (process_type != switches::kZygoteProcess) { |
- breakpad::InitNonBrowserCrashReporterForAndroid(process_type); |
+ if (process_type_ != switches::kZygoteProcess) { |
+ breakpad::InitNonBrowserCrashReporterForAndroid(process_type_); |
} |
} |