OLD | NEW |
(Empty) | |
| 1 // Copyright 2013 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 "components/crash/app/crash_reporter_client.h" |
| 6 |
| 7 #include "base/files/file_path.h" |
| 8 #include "base/logging.h" |
| 9 |
| 10 namespace crash_reporter { |
| 11 |
| 12 namespace { |
| 13 |
| 14 CrashReporterClient* g_client = NULL; |
| 15 |
| 16 } // namespace |
| 17 |
| 18 void SetCrashReporterClient(CrashReporterClient* client) { |
| 19 g_client = client; |
| 20 } |
| 21 |
| 22 CrashReporterClient* GetCrashReporterClient() { |
| 23 DCHECK(g_client); |
| 24 return g_client; |
| 25 } |
| 26 |
| 27 CrashReporterClient::CrashReporterClient() {} |
| 28 CrashReporterClient::~CrashReporterClient() {} |
| 29 |
| 30 #if !defined(OS_MACOSX) |
| 31 void CrashReporterClient::SetCrashReporterClientIdFromGUID( |
| 32 const std::string& client_guid) { |
| 33 } |
| 34 #endif |
| 35 |
| 36 #if defined(OS_WIN) |
| 37 bool CrashReporterClient::GetAlternativeCrashDumpLocation( |
| 38 base::FilePath* crash_dir) { |
| 39 return false; |
| 40 } |
| 41 |
| 42 void CrashReporterClient::GetProductNameAndVersion( |
| 43 const base::FilePath& exe_path, |
| 44 base::string16* product_name, |
| 45 base::string16* version, |
| 46 base::string16* special_build, |
| 47 base::string16* channel_name) { |
| 48 } |
| 49 |
| 50 bool CrashReporterClient::ShouldShowRestartDialog(base::string16* title, |
| 51 base::string16* message, |
| 52 bool* is_rtl_locale) { |
| 53 return false; |
| 54 } |
| 55 |
| 56 bool CrashReporterClient::AboutToRestart() { |
| 57 return false; |
| 58 } |
| 59 |
| 60 bool CrashReporterClient::GetDeferredUploadsSupported(bool is_per_usr_install) { |
| 61 return false; |
| 62 } |
| 63 |
| 64 bool CrashReporterClient::GetIsPerUserInstall(const base::FilePath& exe_path) { |
| 65 return true; |
| 66 } |
| 67 |
| 68 bool CrashReporterClient::GetShouldDumpLargerDumps(bool is_per_user_install) { |
| 69 return false; |
| 70 } |
| 71 |
| 72 int CrashReporterClient::GetResultCodeRespawnFailed() { |
| 73 return 0; |
| 74 } |
| 75 |
| 76 void CrashReporterClient::InitBrowserCrashDumpsRegKey() { |
| 77 } |
| 78 |
| 79 void CrashReporterClient::RecordCrashDumpAttempt(bool is_real_crash) { |
| 80 } |
| 81 |
| 82 void CrashReporterClient::RecordCrashDumpAttemptResult(bool is_real_crash, |
| 83 bool succeeded) { |
| 84 } |
| 85 #endif |
| 86 |
| 87 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_IOS) |
| 88 void CrashReporterClient::GetProductNameAndVersion(const char** product_name, |
| 89 const char** version) { |
| 90 } |
| 91 |
| 92 base::FilePath CrashReporterClient::GetReporterLogFilename() { |
| 93 return base::FilePath(); |
| 94 } |
| 95 |
| 96 bool CrashReporterClient::HandleCrashDump(const char* crashdump_filename) { |
| 97 return false; |
| 98 } |
| 99 #endif |
| 100 |
| 101 bool CrashReporterClient::GetCrashDumpLocation(base::FilePath* crash_dir) { |
| 102 return false; |
| 103 } |
| 104 |
| 105 size_t CrashReporterClient::RegisterCrashKeys() { |
| 106 return 0; |
| 107 } |
| 108 |
| 109 bool CrashReporterClient::IsRunningUnattended() { |
| 110 return true; |
| 111 } |
| 112 |
| 113 bool CrashReporterClient::GetCollectStatsConsent() { |
| 114 return false; |
| 115 } |
| 116 |
| 117 #if defined(OS_WIN) || defined(OS_MACOSX) |
| 118 bool CrashReporterClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) { |
| 119 return false; |
| 120 } |
| 121 #endif |
| 122 |
| 123 #if defined(OS_ANDROID) |
| 124 int CrashReporterClient::GetAndroidMinidumpDescriptor() { |
| 125 return 0; |
| 126 } |
| 127 |
| 128 bool CrashReporterClient::ShouldEnableBreakpadMicrodumps() { |
| 129 // Always enable microdumps on Android when stripping unwind tables. Rationale: |
| 130 // when unwind tables are stripped out (to save binary size) the stack traces |
| 131 // produced locally in the case of a crash / CHECK are meaningless. In order to |
| 132 // provide meaningful development diagnostics (and keep the binary size savings) |
| 133 // on Android we attach a secondary crash handler which serializes a reduced |
| 134 // form of logcat on the console. |
| 135 #if defined(NO_UNWIND_TABLES) |
| 136 return true; |
| 137 #else |
| 138 return false; |
| 139 #endif |
| 140 } |
| 141 #endif |
| 142 |
| 143 bool CrashReporterClient::EnableBreakpadForProcess( |
| 144 const std::string& process_type) { |
| 145 return false; |
| 146 } |
| 147 |
| 148 } // namespace crash_reporter |
OLD | NEW |