OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chromecast/crash/android/cast_crash_reporter_client_android.h" | |
6 | |
7 #include "base/base_paths.h" | |
8 #include "base/command_line.h" | |
Lei Zhang
2014/10/06 22:44:25
nit: not used.
gunsch
2014/10/09 00:20:55
Done.
| |
9 #include "base/file_util.h" | |
10 #include "base/files/file_path.h" | |
11 #include "base/path_service.h" | |
12 #include "base/strings/string16.h" | |
Lei Zhang
2014/10/06 22:44:24
not used?
gunsch
2014/10/09 00:20:55
Done.
| |
13 #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.
| |
14 #include "chromecast/android/chromecast_config_android.h" | |
15 #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.
| |
16 #include "chromecast/common/global_descriptors.h" | |
17 #include "chromecast/common/version.h" | |
18 #include "content/public/common/content_switches.h" | |
19 | |
20 namespace chromecast { | |
21 | |
22 CastCrashReporterClientAndroid::CastCrashReporterClientAndroid() { | |
23 } | |
24 | |
25 CastCrashReporterClientAndroid::~CastCrashReporterClientAndroid() { | |
26 } | |
27 | |
28 void CastCrashReporterClientAndroid::GetProductNameAndVersion( | |
29 std::string* product_name, | |
30 std::string* version) { | |
31 *product_name = "media_shell"; | |
32 *version = PRODUCT_VERSION | |
33 #if CAST_IS_DEBUG_BUILD | |
34 ".debug" | |
35 #endif | |
36 "." CAST_BUILD_REVISION; | |
37 } | |
38 | |
39 base::FilePath CastCrashReporterClientAndroid::GetReporterLogFilename() { | |
40 return base::FilePath(FILE_PATH_LITERAL("uploads.log")); | |
41 } | |
42 | |
43 bool CastCrashReporterClientAndroid::GetCrashDumpLocation( | |
44 base::FilePath* crash_dir) { | |
45 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.
| |
46 *crash_dir = crash_dir->Append("crashes"); | |
47 | |
48 if (!base::DirectoryExists(*crash_dir)) { | |
49 base::CreateDirectory(*crash_dir); | |
50 } | |
51 | |
52 return true; | |
53 } | |
54 | |
55 bool CastCrashReporterClientAndroid::GetCollectStatsConsent() { | |
56 return android::ChromecastConfigAndroid::GetInstance()->CanSendUsageStats(); | |
57 } | |
58 | |
59 int CastCrashReporterClientAndroid::GetAndroidMinidumpDescriptor() { | |
60 return kAndroidMinidumpDescriptor; | |
61 } | |
62 | |
63 bool CastCrashReporterClientAndroid::EnableBreakpadForProcess( | |
64 const std::string& process_type) { | |
65 return process_type == switches::kRendererProcess || | |
66 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.
| |
67 process_type == switches::kGpuProcess; | |
68 } | |
69 | |
70 } // namespace chromecast | |
OLD | NEW |