OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_APP_CHROME_CRASH_REPORTER_CLIENT_H_ | 5 #ifndef CHROME_APP_CHROME_CRASH_REPORTER_CLIENT_H_ |
6 #define CHROME_APP_CHROME_CRASH_REPORTER_CLIENT_H_ | 6 #define CHROME_APP_CHROME_CRASH_REPORTER_CLIENT_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
15 #include "components/crash/content/app/crash_reporter_client.h" | 15 #include "components/crash/content/app/crash_reporter_client.h" |
16 | 16 |
17 namespace browser_watcher { | 17 namespace browser_watcher { |
18 class CrashReportingMetrics; | 18 class CrashReportingMetrics; |
19 } // namespace browser_watcher | 19 } // namespace browser_watcher |
20 | 20 |
21 class ChromeCrashReporterClient : public crash_reporter::CrashReporterClient { | 21 class ChromeCrashReporterClient : public crash_reporter::CrashReporterClient { |
22 public: | 22 public: |
23 ChromeCrashReporterClient(); | 23 ChromeCrashReporterClient(); |
24 ~ChromeCrashReporterClient() override; | 24 ~ChromeCrashReporterClient() override; |
25 | 25 |
26 // crash_reporter::CrashReporterClient implementation. | 26 // crash_reporter::CrashReporterClient implementation. |
27 #if !defined(OS_MACOSX) && !defined(OS_WIN) | 27 #if !defined(OS_MACOSX) |
28 void SetCrashReporterClientIdFromGUID( | 28 void SetCrashReporterClientIdFromGUID( |
29 const std::string& client_guid) override; | 29 const std::string& client_guid) override; |
30 #endif | 30 #endif |
31 #if defined(OS_WIN) | |
32 bool GetAlternativeCrashDumpLocation(base::FilePath* crash_dir) override; | |
33 void GetProductNameAndVersion(const base::FilePath& exe_path, | |
34 base::string16* product_name, | |
35 base::string16* version, | |
36 base::string16* special_build, | |
37 base::string16* channel_name) override; | |
38 bool ShouldShowRestartDialog(base::string16* title, | |
39 base::string16* message, | |
40 bool* is_rtl_locale) override; | |
41 bool AboutToRestart() override; | |
42 bool GetDeferredUploadsSupported(bool is_per_user_install) override; | |
43 bool GetIsPerUserInstall(const base::FilePath& exe_path) override; | |
44 bool GetShouldDumpLargerDumps(bool is_per_user_install) override; | |
45 int GetResultCodeRespawnFailed() override; | |
46 void InitBrowserCrashDumpsRegKey() override; | |
47 void RecordCrashDumpAttempt(bool is_real_crash) override; | |
48 void RecordCrashDumpAttemptResult(bool is_real_crash, | |
49 bool succeeded) override; | |
50 #endif | |
51 | 31 |
52 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 32 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
53 void GetProductNameAndVersion(const char** product_name, | 33 void GetProductNameAndVersion(const char** product_name, |
54 const char** version) override; | 34 const char** version) override; |
55 base::FilePath GetReporterLogFilename() override; | 35 base::FilePath GetReporterLogFilename() override; |
56 #endif | 36 #endif |
57 | 37 |
58 bool GetCrashDumpLocation(base::FilePath* crash_dir) override; | 38 bool GetCrashDumpLocation(base::FilePath* crash_dir) override; |
59 | 39 |
60 size_t RegisterCrashKeys() override; | 40 size_t RegisterCrashKeys() override; |
61 | 41 |
62 bool IsRunningUnattended() override; | 42 bool IsRunningUnattended() override; |
63 | 43 |
64 bool GetCollectStatsConsent() override; | 44 bool GetCollectStatsConsent() override; |
65 | 45 |
66 #if defined(OS_WIN) || defined(OS_MACOSX) | 46 #if defined(OS_MACOSX) |
67 bool ReportingIsEnforcedByPolicy(bool* breakpad_enabled) override; | 47 bool ReportingIsEnforcedByPolicy(bool* breakpad_enabled) override; |
68 #endif | 48 #endif |
69 | 49 |
70 #if defined(OS_ANDROID) | 50 #if defined(OS_ANDROID) |
71 int GetAndroidMinidumpDescriptor() override; | 51 int GetAndroidMinidumpDescriptor() override; |
72 #endif | 52 #endif |
73 | 53 |
74 bool EnableBreakpadForProcess(const std::string& process_type) override; | 54 bool EnableBreakpadForProcess(const std::string& process_type) override; |
75 | 55 |
76 private: | 56 private: |
77 #if defined(OS_WIN) | |
78 std::unique_ptr<browser_watcher::CrashReportingMetrics> | |
79 crash_reporting_metrics_; | |
80 #endif | |
81 | |
82 DISALLOW_COPY_AND_ASSIGN(ChromeCrashReporterClient); | 57 DISALLOW_COPY_AND_ASSIGN(ChromeCrashReporterClient); |
83 }; | 58 }; |
84 | 59 |
85 #endif // CHROME_APP_CHROME_CRASH_REPORTER_CLIENT_H_ | 60 #endif // CHROME_APP_CHROME_CRASH_REPORTER_CLIENT_H_ |
OLD | NEW |