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; |
+ } |
} |
} |