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

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

Issue 944733003: Add flag to communicate last casted app to renderer process (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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/android/cast_crash_reporter_client_android.cc
diff --git a/chromecast/crash/android/cast_crash_reporter_client_android.cc b/chromecast/crash/android/cast_crash_reporter_client_android.cc
index 41717f892f8addde369c70fc0e0f8cb04b330ebf..134b07309ceb6fa44675a4d61a399aec7179409b 100644
--- a/chromecast/crash/android/cast_crash_reporter_client_android.cc
+++ b/chromecast/crash/android/cast_crash_reporter_client_android.cc
@@ -5,10 +5,12 @@
#include "chromecast/crash/android/cast_crash_reporter_client_android.h"
#include "base/base_paths.h"
+#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/path_service.h"
#include "chromecast/android/chromecast_config_android.h"
+#include "chromecast/common/chromecast_switches.h"
#include "chromecast/common/global_descriptors.h"
#include "chromecast/common/version.h"
#include "chromecast/crash/cast_crash_keys.h"
@@ -74,4 +76,20 @@ bool CastCrashReporterClientAndroid::EnableBreakpadForProcess(
process_type == switches::kGpuProcess;
}
+bool CastCrashReporterClientAndroid::HandleCrashDump(
+ const char* crashdump_filename) {
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+ if (command_line->GetSwitchValueNative(switches::kProcessType) ==
+ switches::kRendererProcess) {
+ std::string last_launched_app =
+ command_line->GetSwitchValueNative(switches::kLastLaunchedAppId);
+ if (!last_launched_app.empty())
+ base::debug::SetCrashKeyValue(crash_keys::kLastApp, last_launched_app);
+ }
+
+ // Now that we've registered crash metadata, return false to use default
+ // breakpad dump writer
+ return false;
+}
+
} // namespace chromecast

Powered by Google App Engine
This is Rietveld 408576698