OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chromecast/crash/android/cast_crash_reporter_client_android.h" | 5 #include "chromecast/crash/android/cast_crash_reporter_client_android.h" |
6 | 6 |
7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
| 8 #include "base/command_line.h" |
8 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
9 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
10 #include "base/path_service.h" | 11 #include "base/path_service.h" |
11 #include "chromecast/android/chromecast_config_android.h" | 12 #include "chromecast/android/chromecast_config_android.h" |
| 13 #include "chromecast/common/chromecast_switches.h" |
12 #include "chromecast/common/global_descriptors.h" | 14 #include "chromecast/common/global_descriptors.h" |
13 #include "chromecast/common/version.h" | 15 #include "chromecast/common/version.h" |
14 #include "chromecast/crash/cast_crash_keys.h" | 16 #include "chromecast/crash/cast_crash_keys.h" |
15 #include "content/public/common/content_switches.h" | 17 #include "content/public/common/content_switches.h" |
16 | 18 |
17 namespace chromecast { | 19 namespace chromecast { |
18 | 20 |
19 CastCrashReporterClientAndroid::CastCrashReporterClientAndroid() { | 21 CastCrashReporterClientAndroid::CastCrashReporterClientAndroid() { |
20 } | 22 } |
21 | 23 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 int CastCrashReporterClientAndroid::GetAndroidMinidumpDescriptor() { | 69 int CastCrashReporterClientAndroid::GetAndroidMinidumpDescriptor() { |
68 return kAndroidMinidumpDescriptor; | 70 return kAndroidMinidumpDescriptor; |
69 } | 71 } |
70 | 72 |
71 bool CastCrashReporterClientAndroid::EnableBreakpadForProcess( | 73 bool CastCrashReporterClientAndroid::EnableBreakpadForProcess( |
72 const std::string& process_type) { | 74 const std::string& process_type) { |
73 return process_type == switches::kRendererProcess || | 75 return process_type == switches::kRendererProcess || |
74 process_type == switches::kGpuProcess; | 76 process_type == switches::kGpuProcess; |
75 } | 77 } |
76 | 78 |
| 79 bool CastCrashReporterClientAndroid::HandleCrashDump( |
| 80 const char* crashdump_filename) { |
| 81 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 82 if (command_line->GetSwitchValueNative(switches::kProcessType) == |
| 83 switches::kRendererProcess) { |
| 84 std::string last_launched_app = |
| 85 command_line->GetSwitchValueNative(switches::kLastLaunchedAppId); |
| 86 if (!last_launched_app.empty()) |
| 87 base::debug::SetCrashKeyValue(crash_keys::kLastApp, last_launched_app); |
| 88 } |
| 89 |
| 90 // Now that we've registered crash metadata, return false to use default |
| 91 // breakpad dump writer |
| 92 return false; |
| 93 } |
| 94 |
77 } // namespace chromecast | 95 } // namespace chromecast |
OLD | NEW |