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