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 |
new file mode 100644 |
index 0000000000000000000000000000000000000000..279ff50037a6e262248c2d388999e58657338b30 |
--- /dev/null |
+++ b/chromecast/crash/android/cast_crash_reporter_client_android.cc |
@@ -0,0 +1,70 @@ |
+// Copyright 2014 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/android/cast_crash_reporter_client_android.h" |
+ |
+#include "base/base_paths.h" |
+#include "base/command_line.h" |
Lei Zhang
2014/10/06 22:44:25
nit: not used.
gunsch
2014/10/09 00:20:55
Done.
|
+#include "base/file_util.h" |
+#include "base/files/file_path.h" |
+#include "base/path_service.h" |
+#include "base/strings/string16.h" |
Lei Zhang
2014/10/06 22:44:24
not used?
gunsch
2014/10/09 00:20:55
Done.
|
+#include "base/strings/utf_string_conversions.h" |
Lei Zhang
2014/10/06 22:44:24
nit: not used.
gunsch
2014/10/09 00:20:55
Done.
|
+#include "chromecast/android/chromecast_config_android.h" |
+#include "chromecast/common/chromecast_switches.h" |
Lei Zhang
2014/10/06 22:44:24
also not needed?
gunsch
2014/10/09 00:20:55
Done.
|
+#include "chromecast/common/global_descriptors.h" |
+#include "chromecast/common/version.h" |
+#include "content/public/common/content_switches.h" |
+ |
+namespace chromecast { |
+ |
+CastCrashReporterClientAndroid::CastCrashReporterClientAndroid() { |
+} |
+ |
+CastCrashReporterClientAndroid::~CastCrashReporterClientAndroid() { |
+} |
+ |
+void CastCrashReporterClientAndroid::GetProductNameAndVersion( |
+ std::string* product_name, |
+ std::string* version) { |
+ *product_name = "media_shell"; |
+ *version = PRODUCT_VERSION |
+#if CAST_IS_DEBUG_BUILD |
+ ".debug" |
+#endif |
+ "." CAST_BUILD_REVISION; |
+} |
+ |
+base::FilePath CastCrashReporterClientAndroid::GetReporterLogFilename() { |
+ return base::FilePath(FILE_PATH_LITERAL("uploads.log")); |
+} |
+ |
+bool CastCrashReporterClientAndroid::GetCrashDumpLocation( |
+ base::FilePath* crash_dir) { |
+ PathService::Get(base::DIR_ANDROID_APP_DATA, crash_dir); |
Lei Zhang
2014/10/06 22:44:25
Can't this or CreateDirectory() below fail?
gunsch
2014/10/09 00:20:55
Done.
|
+ *crash_dir = crash_dir->Append("crashes"); |
+ |
+ if (!base::DirectoryExists(*crash_dir)) { |
+ base::CreateDirectory(*crash_dir); |
+ } |
+ |
+ return true; |
+} |
+ |
+bool CastCrashReporterClientAndroid::GetCollectStatsConsent() { |
+ return android::ChromecastConfigAndroid::GetInstance()->CanSendUsageStats(); |
+} |
+ |
+int CastCrashReporterClientAndroid::GetAndroidMinidumpDescriptor() { |
+ return kAndroidMinidumpDescriptor; |
+} |
+ |
+bool CastCrashReporterClientAndroid::EnableBreakpadForProcess( |
+ const std::string& process_type) { |
+ return process_type == switches::kRendererProcess || |
+ process_type == switches::kZygoteProcess || |
Lei Zhang
2014/10/06 22:44:24
You're saying yes to the zygote process here, but
gunsch
2014/10/09 00:20:55
Done.
|
+ process_type == switches::kGpuProcess; |
+} |
+ |
+} // namespace chromecast |