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

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

Issue 1176003005: Chromecast: Android crash startup can't read path from /data/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/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 d914767e8501f8bd13c02325218f198b1aec24cf..3212174364d2cc34c2b99ea7cf07bab9c3fd4f82 100644
--- a/chromecast/crash/android/cast_crash_reporter_client_android.cc
+++ b/chromecast/crash/android/cast_crash_reporter_client_android.cc
@@ -16,7 +16,8 @@
namespace chromecast {
-CastCrashReporterClientAndroid::CastCrashReporterClientAndroid() {
+CastCrashReporterClientAndroid::CastCrashReporterClientAndroid(bool privileged)
+ : privileged_(privileged) {
lcwu1 2015/06/12 01:42:01 I feel like it is not very clear what 'privileged_
}
CastCrashReporterClientAndroid::~CastCrashReporterClientAndroid() {
@@ -45,9 +46,13 @@ bool CastCrashReporterClientAndroid::GetCrashDumpLocation(
}
crash_dir_local = crash_dir_local.Append("crashes");
- if (!base::DirectoryExists(crash_dir_local)) {
- if (!base::CreateDirectory(crash_dir_local)) {
- return false;
+ // Only try to create the directory in a privileged process. For other
+ // processes, assume the directory exists.
halliwell 2015/06/10 21:23:16 Do we need to make that assumption? Wouldn't it b
gunsch 2015/06/10 21:30:16 Renderer process is not allowed to check if file e
gunsch 2015/06/12 20:07:52 I was hoping to abstract over the "process type" c
+ if (privileged_) {
+ if (!base::DirectoryExists(crash_dir_local)) {
+ if (!base::CreateDirectory(crash_dir_local)) {
+ return false;
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698