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

Unified Diff: chromecast/crash/android/crash_handler.cc

Issue 1180633002: Chromecast: don't try to upload crash immediately. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: rebase Created 5 years, 6 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 | « chromecast/crash/android/crash_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/crash/android/crash_handler.cc
diff --git a/chromecast/crash/android/crash_handler.cc b/chromecast/crash/android/crash_handler.cc
index 4324b71d7c4fff92fd0d2d62b2f446a3a1305222..12b1acd78d18fc25a1efa72f76e79c8848c47166 100644
--- a/chromecast/crash/android/crash_handler.cc
+++ b/chromecast/crash/android/crash_handler.cc
@@ -26,16 +26,6 @@ namespace {
chromecast::CrashHandler* g_crash_handler = NULL;
-bool HandleCrash(void* /* crash_context */) {
- DCHECK(g_crash_handler);
- g_crash_handler->UploadCrashDumps();
-
- // TODO(gunsch): clean up the ATV crash handling code.
- // Don't write another minidump. Chrome's default ExceptionHandler has already
- // written a minidump by this point in the crash handling sequence.
- return false;
-}
-
// Debug builds: always to crash-staging
// Release builds: only to crash-staging for local/invalid build numbers
bool UploadCrashToStaging() {
@@ -92,18 +82,7 @@ CrashHandler::~CrashHandler() {
void CrashHandler::Initialize() {
if (process_type_.empty()) {
InitializeUploader();
-
- // ExceptionHandlers are called on crash in reverse order of
- // instantiation. This ExceptionHandler will attempt to upload crashes
- // and the log file written out by the main process.
-
- // Dummy MinidumpDescriptor just to start up another ExceptionHandler.
- google_breakpad::MinidumpDescriptor dummy(crash_dump_path_.value());
- crash_uploader_.reset(new google_breakpad::ExceptionHandler(
- dummy, &HandleCrash, NULL, NULL, true, -1));
-
breakpad::InitCrashReporter(process_type_);
-
return;
}
@@ -118,28 +97,8 @@ void CrashHandler::InitializeUploader() {
base::android::ConvertUTF8ToJavaString(env,
crash_dump_path_.value());
Java_CastCrashHandler_initializeUploader(
- env, crash_dump_path_java.obj(), UploadCrashToStaging());
-}
-
-bool CrashHandler::CanUploadCrashDump() {
- DCHECK(crash_reporter_client_);
- return crash_reporter_client_->GetCollectStatsConsent();
-}
-
-void CrashHandler::UploadCrashDumps() {
- VLOG(1) << "Attempting to upload current process crash";
-
- if (CanUploadCrashDump()) {
- JNIEnv* env = base::android::AttachCurrentThread();
- // Current log file location
- base::android::ScopedJavaLocalRef<jstring> log_file_path_java =
- base::android::ConvertUTF8ToJavaString(env, log_file_path_.value());
- Java_CastCrashHandler_uploadCrashDumps(env, log_file_path_java.obj());
- } else {
- VLOG(1) << "Removing crash dumps instead of uploading";
- JNIEnv* env = base::android::AttachCurrentThread();
- Java_CastCrashHandler_removeCrashDumps(env);
- }
+ env, base::android::GetApplicationContext(),
+ crash_dump_path_java.obj(), UploadCrashToStaging());
}
} // namespace chromecast
« no previous file with comments | « chromecast/crash/android/crash_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698