Allow the externalfile scheme to be whitelisted as an allowed scheme for component...
[chromium-blink-merge.git] / components / crash / app / crash_reporter_client.cc
blobbdf3d90ec0e09f8636d51ccac0ee949b56f60615
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 {
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 void CrashReporterClient::SetCrashReporterClientIdFromGUID(
31 const std::string& client_guid) {
34 #if defined(OS_WIN)
35 bool CrashReporterClient::GetAlternativeCrashDumpLocation(
36 base::FilePath* crash_dir) {
37 return false;
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) {
51 return false;
54 bool CrashReporterClient::AboutToRestart() {
55 return false;
58 bool CrashReporterClient::GetDeferredUploadsSupported(bool is_per_usr_install) {
59 return false;
62 bool CrashReporterClient::GetIsPerUserInstall(const base::FilePath& exe_path) {
63 return true;
66 bool CrashReporterClient::GetShouldDumpLargerDumps(bool is_per_user_install) {
67 return false;
70 int CrashReporterClient::GetResultCodeRespawnFailed() {
71 return 0;
74 void CrashReporterClient::InitBrowserCrashDumpsRegKey() {
77 void CrashReporterClient::RecordCrashDumpAttempt(bool is_real_crash) {
79 #endif
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) {
91 return false;
93 #endif
95 bool CrashReporterClient::GetCrashDumpLocation(base::FilePath* crash_dir) {
96 return false;
99 size_t CrashReporterClient::RegisterCrashKeys() {
100 return 0;
103 bool CrashReporterClient::IsRunningUnattended() {
104 return true;
107 bool CrashReporterClient::GetCollectStatsConsent() {
108 return false;
111 #if defined(OS_WIN) || defined(OS_MACOSX)
112 bool CrashReporterClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) {
113 return false;
115 #endif
117 #if defined(OS_ANDROID)
118 int CrashReporterClient::GetAndroidMinidumpDescriptor() {
119 return 0;
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)
130 return true;
131 #else
132 return false;
133 #endif
135 #endif
137 #if defined(OS_MACOSX)
138 void CrashReporterClient::InstallAdditionalFilters(BreakpadRef breakpad) {
140 #endif
142 bool CrashReporterClient::EnableBreakpadForProcess(
143 const std::string& process_type) {
144 return false;
147 } // namespace crash_reporter