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

Unified Diff: chromecast/crash/cast_crash_reporter_client.cc

Issue 1154383006: Adding crash utilities to chromecast/crash. (Closed) Base URL: https://eureka-internal.googlesource.com/chromium/src@master
Patch Set: Lots of formatting changes and BUILD.gn updates. 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
Index: chromecast/crash/cast_crash_reporter_client.cc
diff --git a/chromecast/crash/cast_crash_reporter_client.cc b/chromecast/crash/cast_crash_reporter_client.cc
index 8edbfa6b7b26eb91df051b3801d596a90944609b..ef619fe38defeb7c71178a59242f76e71667d930 100644
--- a/chromecast/crash/cast_crash_reporter_client.cc
+++ b/chromecast/crash/cast_crash_reporter_client.cc
@@ -5,6 +5,8 @@
#include "chromecast/crash/cast_crash_reporter_client.h"
#include "base/time/time.h"
+#include "chromecast/base/error_codes.h"
+#include "chromecast/crash/crash_util.h"
gunsch 2015/06/10 16:33:30 ordering (how did this get through git cl upload c
slan 2015/06/11 02:34:48 chromecast < components :)
gunsch 2015/06/12 00:37:09 Ha, I can't read. Carry on.
#include "components/crash/app/breakpad_linux.h"
#include "content/public/common/content_switches.h"
@@ -55,4 +57,22 @@ bool CastCrashReporterClient::EnableBreakpadForProcess(
process_type == switches::kGpuProcess;
}
+bool CastCrashReporterClient::HandleCrashDump(const char* crashdump_filename) {
+ // Set the initial error code to ERROR_WEB_CONTENT_RENDER_VIEW_GONE to show
+ // an error message on next cast_shell run. Though the error code is for
+ // renderer process crash, the actual messages can be used for browser process
+ // as well.
+ if (!GetProcessType() || !strcmp(GetProcessType(), "browser"))
+ SetInitialErrorCode(ERROR_WEB_CONTENT_RENDER_VIEW_GONE);
+
+ // Upload crash dump. If user didn't opt-in crash report, minidump writer
+ // instantiated within CrashUtil::RequestUploadCrashDump() does nothing.
+ CrashUtil::RequestUploadCrashDump(
+ crashdump_filename, GetProcessType(), GetProcessStartTime());
+
+ // Always return true to indicate that this crash dump has been processed,
+ // so that it won't fallback to use chrome's default uploader.
+ return true;
+}
+
} // namespace chromecast

Powered by Google App Engine
This is Rietveld 408576698