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

Unified Diff: chromecast/crash/cast_crash_reporter_client_uploader.cc

Issue 1154383006: Adding crash utilities to chromecast/crash. (Closed) Base URL: https://eureka-internal.googlesource.com/chromium/src@master
Patch Set: Corrected version hack in breakpad_util. 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_uploader.cc
diff --git a/chromecast/crash/cast_crash_reporter_client_uploader.cc b/chromecast/crash/cast_crash_reporter_client_uploader.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5943293bc9e6becc0aebabf3089bc69bafd07b0a
--- /dev/null
+++ b/chromecast/crash/cast_crash_reporter_client_uploader.cc
@@ -0,0 +1,30 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chromecast/crash/cast_crash_reporter_client.h"
+
+#include "chromecast/base/error_codes.h"
+#include "chromecast/crash/breakpad_util.h"
+
+namespace chromecast {
+
+bool CastCrashReporterClient::HandleCrashDump(const char* crashdump_filename) {
gunsch 2015/06/09 18:46:19 This can just get inlined into cast_crash_reporter
slan 2015/06/10 01:49:13 Done.
+ // 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 BreakpadUtil::RequestUploadCrashDump() does nothing.
+ BreakpadUtil::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