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/content/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 #if !defined(OS_MACOSX)
31 void CrashReporterClient::SetCrashReporterClientIdFromGUID(
32 const std::string
& client_guid
) {
37 bool CrashReporterClient::GetAlternativeCrashDumpLocation(
38 base::FilePath
* crash_dir
) {
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
) {
50 bool CrashReporterClient::ShouldShowRestartDialog(base::string16
* title
,
51 base::string16
* message
,
52 bool* is_rtl_locale
) {
56 bool CrashReporterClient::AboutToRestart() {
60 bool CrashReporterClient::GetDeferredUploadsSupported(bool is_per_usr_install
) {
64 bool CrashReporterClient::GetIsPerUserInstall(const base::FilePath
& exe_path
) {
68 bool CrashReporterClient::GetShouldDumpLargerDumps(bool is_per_user_install
) {
72 int CrashReporterClient::GetResultCodeRespawnFailed() {
76 void CrashReporterClient::InitBrowserCrashDumpsRegKey() {
79 void CrashReporterClient::RecordCrashDumpAttempt(bool is_real_crash
) {
82 void CrashReporterClient::RecordCrashDumpAttemptResult(bool is_real_crash
,
87 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_IOS)
88 void CrashReporterClient::GetProductNameAndVersion(const char** product_name
,
89 const char** version
) {
92 base::FilePath
CrashReporterClient::GetReporterLogFilename() {
93 return base::FilePath();
96 bool CrashReporterClient::HandleCrashDump(const char* crashdump_filename
) {
101 bool CrashReporterClient::GetCrashDumpLocation(base::FilePath
* crash_dir
) {
105 size_t CrashReporterClient::RegisterCrashKeys() {
109 bool CrashReporterClient::IsRunningUnattended() {
113 bool CrashReporterClient::GetCollectStatsConsent() {
117 #if defined(OS_WIN) || defined(OS_MACOSX)
118 bool CrashReporterClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled
) {
123 #if defined(OS_ANDROID)
124 int CrashReporterClient::GetAndroidMinidumpDescriptor() {
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)
143 bool CrashReporterClient::EnableBreakpadForProcess(
144 const std::string
& process_type
) {
148 } // namespace crash_reporter