summaryrefslogtreecommitdiffstats
path: root/components/crash/content/app/crash_reporter_client.cc
blob: 66388e22660258af3ac0522a7e297d49a23b30c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/crash/content/app/crash_reporter_client.h"

#include "base/files/file_path.h"
#include "base/logging.h"

namespace crash_reporter {

namespace {

CrashReporterClient* g_client = NULL;

}  // namespace

void SetCrashReporterClient(CrashReporterClient* client) {
  g_client = client;
}

CrashReporterClient* GetCrashReporterClient() {
  DCHECK(g_client);
  return g_client;
}

CrashReporterClient::CrashReporterClient() {}
CrashReporterClient::~CrashReporterClient() {}

#if !defined(OS_MACOSX)
void CrashReporterClient::SetCrashReporterClientIdFromGUID(
    const std::string& client_guid) {
}
#endif

#if defined(OS_WIN)
bool CrashReporterClient::GetAlternativeCrashDumpLocation(
    base::FilePath* crash_dir) {
  return false;
}

void CrashReporterClient::GetProductNameAndVersion(
    const base::FilePath& exe_path,
    base::string16* product_name,
    base::string16* version,
    base::string16* special_build,
    base::string16* channel_name) {
}

bool CrashReporterClient::ShouldShowRestartDialog(base::string16* title,
                                                  base::string16* message,
                                                  bool* is_rtl_locale) {
  return false;
}

bool CrashReporterClient::AboutToRestart() {
  return false;
}

bool CrashReporterClient::GetDeferredUploadsSupported(bool is_per_usr_install) {
  return false;
}

bool CrashReporterClient::GetIsPerUserInstall(const base::FilePath& exe_path) {
  return true;
}

bool CrashReporterClient::GetShouldDumpLargerDumps(bool is_per_user_install) {
  return false;
}

int CrashReporterClient::GetResultCodeRespawnFailed() {
  return 0;
}

void CrashReporterClient::InitBrowserCrashDumpsRegKey() {
}

void CrashReporterClient::RecordCrashDumpAttempt(bool is_real_crash) {
}

void CrashReporterClient::RecordCrashDumpAttemptResult(bool is_real_crash,
                                                       bool succeeded) {
}
#endif

#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_IOS)
void CrashReporterClient::GetProductNameAndVersion(const char** product_name,
                                                   const char** version) {
}

base::FilePath CrashReporterClient::GetReporterLogFilename() {
  return base::FilePath();
}

bool CrashReporterClient::HandleCrashDump(const char* crashdump_filename) {
  return false;
}
#endif

bool CrashReporterClient::GetCrashDumpLocation(base::FilePath* crash_dir) {
  return false;
}

size_t CrashReporterClient::RegisterCrashKeys() {
  return 0;
}

bool CrashReporterClient::IsRunningUnattended() {
  return true;
}

bool CrashReporterClient::GetCollectStatsConsent() {
  return false;
}

#if defined(OS_WIN) || defined(OS_MACOSX)
bool CrashReporterClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) {
  return false;
}
#endif

#if defined(OS_ANDROID)
int CrashReporterClient::GetAndroidMinidumpDescriptor() {
  return 0;
}

bool CrashReporterClient::ShouldEnableBreakpadMicrodumps() {
// Always enable microdumps on Android when stripping unwind tables. Rationale:
// when unwind tables are stripped out (to save binary size) the stack traces
// produced locally in the case of a crash / CHECK are meaningless. In order to
// provide meaningful development diagnostics (and keep the binary size savings)
// on Android we attach a secondary crash handler which serializes a reduced
// form of logcat on the console.
#if defined(NO_UNWIND_TABLES)
  return true;
#else
  return false;
#endif
}
#endif

bool CrashReporterClient::EnableBreakpadForProcess(
    const std::string& process_type) {
  return false;
}

}  // namespace crash_reporter