Roll src/third_party/WebKit c63b89c:29324ab (svn 202546:202547)
[chromium-blink-merge.git] / components / crash / content / app / crash_reporter_client.cc
blob66388e22660258af3ac0522a7e297d49a23b30c8
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 {
12 namespace {
14 CrashReporterClient* g_client = NULL;
16 } // namespace
18 void SetCrashReporterClient(CrashReporterClient* client) {
19 g_client = client;
22 CrashReporterClient* GetCrashReporterClient() {
23 DCHECK(g_client);
24 return g_client;
27 CrashReporterClient::CrashReporterClient() {}
28 CrashReporterClient::~CrashReporterClient() {}
30 #if !defined(OS_MACOSX)
31 void CrashReporterClient::SetCrashReporterClientIdFromGUID(
32 const std::string& client_guid) {
34 #endif
36 #if defined(OS_WIN)
37 bool CrashReporterClient::GetAlternativeCrashDumpLocation(
38 base::FilePath* crash_dir) {
39 return false;
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) {
53 return false;
56 bool CrashReporterClient::AboutToRestart() {
57 return false;
60 bool CrashReporterClient::GetDeferredUploadsSupported(bool is_per_usr_install) {
61 return false;
64 bool CrashReporterClient::GetIsPerUserInstall(const base::FilePath& exe_path) {
65 return true;
68 bool CrashReporterClient::GetShouldDumpLargerDumps(bool is_per_user_install) {
69 return false;
72 int CrashReporterClient::GetResultCodeRespawnFailed() {
73 return 0;
76 void CrashReporterClient::InitBrowserCrashDumpsRegKey() {
79 void CrashReporterClient::RecordCrashDumpAttempt(bool is_real_crash) {
82 void CrashReporterClient::RecordCrashDumpAttemptResult(bool is_real_crash,
83 bool succeeded) {
85 #endif
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) {
97 return false;
99 #endif
101 bool CrashReporterClient::GetCrashDumpLocation(base::FilePath* crash_dir) {
102 return false;
105 size_t CrashReporterClient::RegisterCrashKeys() {
106 return 0;
109 bool CrashReporterClient::IsRunningUnattended() {
110 return true;
113 bool CrashReporterClient::GetCollectStatsConsent() {
114 return false;
117 #if defined(OS_WIN) || defined(OS_MACOSX)
118 bool CrashReporterClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) {
119 return false;
121 #endif
123 #if defined(OS_ANDROID)
124 int CrashReporterClient::GetAndroidMinidumpDescriptor() {
125 return 0;
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
141 #endif
143 bool CrashReporterClient::EnableBreakpadForProcess(
144 const std::string& process_type) {
145 return false;
148 } // namespace crash_reporter