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.
5 #include "components/crash/app/crash_reporter_client.h"
7 #include "base/files/file_path.h"
8 #include "base/logging.h"
10 namespace crash_reporter
{
14 CrashReporterClient
* g_client
= NULL
;
18 void SetCrashReporterClient(CrashReporterClient
* client
) {
22 CrashReporterClient
* GetCrashReporterClient() {
27 CrashReporterClient::CrashReporterClient() {}
28 CrashReporterClient::~CrashReporterClient() {}
30 void CrashReporterClient::SetCrashReporterClientIdFromGUID(
31 const std::string
& client_guid
) {
35 bool CrashReporterClient::GetAlternativeCrashDumpLocation(
36 base::FilePath
* crash_dir
) {
40 void CrashReporterClient::GetProductNameAndVersion(
41 const base::FilePath
& exe_path
,
42 base::string16
* product_name
,
43 base::string16
* version
,
44 base::string16
* special_build
,
45 base::string16
* channel_name
) {
48 bool CrashReporterClient::ShouldShowRestartDialog(base::string16
* title
,
49 base::string16
* message
,
50 bool* is_rtl_locale
) {
54 bool CrashReporterClient::AboutToRestart() {
58 bool CrashReporterClient::GetDeferredUploadsSupported(bool is_per_usr_install
) {
62 bool CrashReporterClient::GetIsPerUserInstall(const base::FilePath
& exe_path
) {
66 bool CrashReporterClient::GetShouldDumpLargerDumps(bool is_per_user_install
) {
70 int CrashReporterClient::GetResultCodeRespawnFailed() {
74 void CrashReporterClient::InitBrowserCrashDumpsRegKey() {
77 void CrashReporterClient::RecordCrashDumpAttempt(bool is_real_crash
) {
81 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_IOS)
82 void CrashReporterClient::GetProductNameAndVersion(const char** product_name
,
83 const char** version
) {
86 base::FilePath
CrashReporterClient::GetReporterLogFilename() {
87 return base::FilePath();
90 bool CrashReporterClient::HandleCrashDump(const char* crashdump_filename
) {
95 bool CrashReporterClient::GetCrashDumpLocation(base::FilePath
* crash_dir
) {
99 size_t CrashReporterClient::RegisterCrashKeys() {
103 bool CrashReporterClient::IsRunningUnattended() {
107 bool CrashReporterClient::GetCollectStatsConsent() {
111 #if defined(OS_WIN) || defined(OS_MACOSX)
112 bool CrashReporterClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled
) {
117 #if defined(OS_ANDROID)
118 int CrashReporterClient::GetAndroidMinidumpDescriptor() {
122 bool CrashReporterClient::ShouldEnableBreakpadMicrodumps() {
123 // Always enable microdumps on Android when stripping unwind tables. Rationale:
124 // when unwind tables are stripped out (to save binary size) the stack traces
125 // produced locally in the case of a crash / CHECK are meaningless. In order to
126 // provide meaningful development diagnostics (and keep the binary size savings)
127 // on Android we attach a secondary crash handler which serializes a reduced
128 // form of logcat on the console.
129 #if defined(NO_UNWIND_TABLES)
137 #if defined(OS_MACOSX)
138 void CrashReporterClient::InstallAdditionalFilters(BreakpadRef breakpad
) {
142 bool CrashReporterClient::EnableBreakpadForProcess(
143 const std::string
& process_type
) {
147 } // namespace crash_reporter