| 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 #if !defined(OS_WIN) |
| 9 |
| 8 #include <stddef.h> | 10 #include <stddef.h> |
| 9 | 11 |
| 10 #include <memory> | 12 #include <memory> |
| 11 | 13 |
| 12 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 13 #include "base/macros.h" | 15 #include "base/macros.h" |
| 14 #include "build/build_config.h" | 16 #include "build/build_config.h" |
| 15 #include "components/crash/content/app/crash_reporter_client.h" | 17 #include "components/crash/content/app/crash_reporter_client.h" |
| 16 | 18 |
| 17 namespace browser_watcher { | 19 namespace browser_watcher { |
| 18 class CrashReportingMetrics; | 20 class CrashReportingMetrics; |
| 19 } // namespace browser_watcher | 21 } // namespace browser_watcher |
| 20 | 22 |
| 21 class ChromeCrashReporterClient : public crash_reporter::CrashReporterClient { | 23 class ChromeCrashReporterClient : public crash_reporter::CrashReporterClient { |
| 22 public: | 24 public: |
| 23 ChromeCrashReporterClient(); | 25 ChromeCrashReporterClient(); |
| 24 ~ChromeCrashReporterClient() override; | 26 ~ChromeCrashReporterClient() override; |
| 25 | 27 |
| 26 // crash_reporter::CrashReporterClient implementation. | 28 // crash_reporter::CrashReporterClient implementation. |
| 27 #if !defined(OS_MACOSX) && !defined(OS_WIN) | 29 #if !defined(OS_MACOSX) |
| 28 void SetCrashReporterClientIdFromGUID( | 30 void SetCrashReporterClientIdFromGUID( |
| 29 const std::string& client_guid) override; | 31 const std::string& client_guid) override; |
| 30 #endif | 32 #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 | 33 |
| 52 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 34 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 53 void GetProductNameAndVersion(const char** product_name, | 35 void GetProductNameAndVersion(const char** product_name, |
| 54 const char** version) override; | 36 const char** version) override; |
| 55 base::FilePath GetReporterLogFilename() override; | 37 base::FilePath GetReporterLogFilename() override; |
| 56 #endif | 38 #endif |
| 57 | 39 |
| 58 bool GetCrashDumpLocation(base::FilePath* crash_dir) override; | 40 bool GetCrashDumpLocation(base::FilePath* crash_dir) override; |
| 59 | 41 |
| 60 size_t RegisterCrashKeys() override; | 42 size_t RegisterCrashKeys() override; |
| 61 | 43 |
| 62 bool IsRunningUnattended() override; | 44 bool IsRunningUnattended() override; |
| 63 | 45 |
| 64 bool GetCollectStatsConsent() override; | 46 bool GetCollectStatsConsent() override; |
| 65 | 47 |
| 66 #if defined(OS_WIN) || defined(OS_MACOSX) | 48 #if defined(OS_MACOSX) |
| 67 bool ReportingIsEnforcedByPolicy(bool* breakpad_enabled) override; | 49 bool ReportingIsEnforcedByPolicy(bool* breakpad_enabled) override; |
| 68 #endif | 50 #endif |
| 69 | 51 |
| 70 #if defined(OS_ANDROID) | 52 #if defined(OS_ANDROID) |
| 71 int GetAndroidMinidumpDescriptor() override; | 53 int GetAndroidMinidumpDescriptor() override; |
| 72 #endif | 54 #endif |
| 73 | 55 |
| 74 bool EnableBreakpadForProcess(const std::string& process_type) override; | 56 bool EnableBreakpadForProcess(const std::string& process_type) override; |
| 75 | 57 |
| 76 private: | 58 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); | 59 DISALLOW_COPY_AND_ASSIGN(ChromeCrashReporterClient); |
| 83 }; | 60 }; |
| 84 | 61 |
| 62 #endif // OS_WIN |
| 63 |
| 85 #endif // CHROME_APP_CHROME_CRASH_REPORTER_CLIENT_H_ | 64 #endif // CHROME_APP_CHROME_CRASH_REPORTER_CLIENT_H_ |
| OLD | NEW |