• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
4 
5 #include "components/crash/app/crash_reporter_client.h"
6 
7 #include "base/files/file_path.h"
8 #include "base/logging.h"
9 
10 namespace crash_reporter {
11 
12 namespace {
13 
14 CrashReporterClient* g_client = NULL;
15 
16 }  // namespace
17 
SetCrashReporterClient(CrashReporterClient * client)18 void SetCrashReporterClient(CrashReporterClient* client) {
19   g_client = client;
20 }
21 
GetCrashReporterClient()22 CrashReporterClient* GetCrashReporterClient() {
23   DCHECK(g_client);
24   return g_client;
25 }
26 
CrashReporterClient()27 CrashReporterClient::CrashReporterClient() {}
~CrashReporterClient()28 CrashReporterClient::~CrashReporterClient() {}
29 
SetCrashReporterClientIdFromGUID(const std::string & client_guid)30 void CrashReporterClient::SetCrashReporterClientIdFromGUID(
31     const std::string& client_guid) {
32 }
33 
34 #if defined(OS_WIN)
GetAlternativeCrashDumpLocation(base::FilePath * crash_dir)35 bool CrashReporterClient::GetAlternativeCrashDumpLocation(
36     base::FilePath* crash_dir) {
37   return false;
38 }
39 
GetProductNameAndVersion(const base::FilePath & exe_path,base::string16 * product_name,base::string16 * version,base::string16 * special_build,base::string16 * channel_name)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) {
46 }
47 
ShouldShowRestartDialog(base::string16 * title,base::string16 * message,bool * is_rtl_locale)48 bool CrashReporterClient::ShouldShowRestartDialog(base::string16* title,
49                                                   base::string16* message,
50                                                   bool* is_rtl_locale) {
51   return false;
52 }
53 
AboutToRestart()54 bool CrashReporterClient::AboutToRestart() {
55   return false;
56 }
57 
GetDeferredUploadsSupported(bool is_per_usr_install)58 bool CrashReporterClient::GetDeferredUploadsSupported(bool is_per_usr_install) {
59   return false;
60 }
61 
GetIsPerUserInstall(const base::FilePath & exe_path)62 bool CrashReporterClient::GetIsPerUserInstall(const base::FilePath& exe_path) {
63   return true;
64 }
65 
GetShouldDumpLargerDumps(bool is_per_user_install)66 bool CrashReporterClient::GetShouldDumpLargerDumps(bool is_per_user_install) {
67   return false;
68 }
69 
GetResultCodeRespawnFailed()70 int CrashReporterClient::GetResultCodeRespawnFailed() {
71   return 0;
72 }
73 
InitBrowserCrashDumpsRegKey()74 void CrashReporterClient::InitBrowserCrashDumpsRegKey() {
75 }
76 
RecordCrashDumpAttempt(bool is_real_crash)77 void CrashReporterClient::RecordCrashDumpAttempt(bool is_real_crash) {
78 }
79 #endif
80 
81 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_IOS)
GetProductNameAndVersion(std::string * product_name,std::string * version)82 void CrashReporterClient::GetProductNameAndVersion(std::string* product_name,
83                                                    std::string* version) {
84 }
85 
GetReporterLogFilename()86 base::FilePath CrashReporterClient::GetReporterLogFilename() {
87   return base::FilePath();
88 }
89 #endif
90 
GetCrashDumpLocation(base::FilePath * crash_dir)91 bool CrashReporterClient::GetCrashDumpLocation(base::FilePath* crash_dir) {
92   return false;
93 }
94 
RegisterCrashKeys()95 size_t CrashReporterClient::RegisterCrashKeys() {
96   return 0;
97 }
98 
IsRunningUnattended()99 bool CrashReporterClient::IsRunningUnattended() {
100   return true;
101 }
102 
GetCollectStatsConsent()103 bool CrashReporterClient::GetCollectStatsConsent() {
104   return false;
105 }
106 
107 #if defined(OS_WIN) || defined(OS_MACOSX)
ReportingIsEnforcedByPolicy(bool * breakpad_enabled)108 bool CrashReporterClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) {
109   return false;
110 }
111 #endif
112 
113 #if defined(OS_ANDROID)
GetAndroidMinidumpDescriptor()114 int CrashReporterClient::GetAndroidMinidumpDescriptor() {
115   return 0;
116 }
117 #endif
118 
119 #if defined(OS_MACOSX)
InstallAdditionalFilters(BreakpadRef breakpad)120 void CrashReporterClient::InstallAdditionalFilters(BreakpadRef breakpad) {
121 }
122 #endif
123 
EnableBreakpadForProcess(const std::string & process_type)124 bool CrashReporterClient::EnableBreakpadForProcess(
125     const std::string& process_type) {
126   return false;
127 }
128 
129 }  // namespace crash_reporter
130