| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 COMPONENTS_CRASH_CONTENT_APP_CRASHPAD_H_ | 5 #ifndef COMPONENTS_CRASH_CONTENT_APP_CRASHPAD_H_ |
| 6 #define COMPONENTS_CRASH_CONTENT_APP_CRASHPAD_H_ | 6 #define COMPONENTS_CRASH_CONTENT_APP_CRASHPAD_H_ |
| 7 | 7 |
| 8 #include <time.h> | 8 #include <time.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 // database. In a newly-created database, uploads will be disabled. This | 65 // database. In a newly-created database, uploads will be disabled. This |
| 66 // function only has an effect when called in the browser process. Its effect is | 66 // function only has an effect when called in the browser process. Its effect is |
| 67 // immediate and applies to all other process types, including processes that | 67 // immediate and applies to all other process types, including processes that |
| 68 // are already running. | 68 // are already running. |
| 69 void SetUploadsEnabled(bool enabled); | 69 void SetUploadsEnabled(bool enabled); |
| 70 | 70 |
| 71 // Determines whether uploads are enabled or disabled. This information is only | 71 // Determines whether uploads are enabled or disabled. This information is only |
| 72 // available in the browser process. | 72 // available in the browser process. |
| 73 bool GetUploadsEnabled(); | 73 bool GetUploadsEnabled(); |
| 74 | 74 |
| 75 struct UploadedReport { | 75 enum class ReportUploadState { |
| 76 NotUploaded, |
| 77 Pending, |
| 78 Uploaded, |
| 79 }; |
| 80 |
| 81 struct Report { |
| 76 std::string local_id; | 82 std::string local_id; |
| 83 time_t capture_time; |
| 77 std::string remote_id; | 84 std::string remote_id; |
| 78 time_t creation_time; | 85 time_t upload_time; |
| 86 ReportUploadState state; |
| 79 }; | 87 }; |
| 80 | 88 |
| 81 // Obtains a list of reports uploaded to the collection server. This function | 89 // Obtains a list of reports uploaded to the collection server. This function |
| 82 // only operates when called in the browser process. All reports in the Crashpad | 90 // only operates when called in the browser process. All reports in the Crashpad |
| 83 // database that have been successfully uploaded will be included in this list. | 91 // database that have been successfully uploaded will be included in this list. |
| 84 // The list will be sorted in descending order by report creation time (newest | 92 // The list will be sorted in descending order by report creation time (newest |
| 85 // reports first). | 93 // reports first). |
| 86 // | 94 void GetReports(std::vector<Report>* reports); |
| 87 // TODO(mark): The about:crashes UI expects to show only uploaded reports. If it | |
| 88 // is ever enhanced to work well with un-uploaded reports, those should be | |
| 89 // returned as well. Un-uploaded reports may have a pending upload, may have | |
| 90 // experienced upload failure, or may have been collected while uploads were | |
| 91 // disabled. | |
| 92 void GetUploadedReports(std::vector<UploadedReport>* uploaded_reports); | |
| 93 | 95 |
| 94 #if BUILDFLAG(ENABLE_KASKO) | 96 #if BUILDFLAG(ENABLE_KASKO) |
| 95 // Returns a copy of the current crash keys for Kasko. | 97 // Returns a copy of the current crash keys for Kasko. |
| 96 void GetCrashKeysForKasko(std::vector<kasko::api::CrashKey>* crash_keys); | 98 void GetCrashKeysForKasko(std::vector<kasko::api::CrashKey>* crash_keys); |
| 97 | 99 |
| 98 // Reads the annotations for the executable module for |process| and puts them | 100 // Reads the annotations for the executable module for |process| and puts them |
| 99 // into |crash_keys|. | 101 // into |crash_keys|. |
| 100 void ReadMainModuleAnnotationsForKasko( | 102 void ReadMainModuleAnnotationsForKasko( |
| 101 const base::Process& process, | 103 const base::Process& process, |
| 102 std::vector<kasko::api::CrashKey>* crash_keys); | 104 std::vector<kasko::api::CrashKey>* crash_keys); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 115 // Returns the database path, if initializing in the browser process. | 117 // Returns the database path, if initializing in the browser process. |
| 116 base::FilePath PlatformCrashpadInitialization(bool initial_client, | 118 base::FilePath PlatformCrashpadInitialization(bool initial_client, |
| 117 bool browser_process, | 119 bool browser_process, |
| 118 bool embedded_handler); | 120 bool embedded_handler); |
| 119 | 121 |
| 120 } // namespace internal | 122 } // namespace internal |
| 121 | 123 |
| 122 } // namespace crash_reporter | 124 } // namespace crash_reporter |
| 123 | 125 |
| 124 #endif // COMPONENTS_CRASH_CONTENT_APP_CRASHPAD_H_ | 126 #endif // COMPONENTS_CRASH_CONTENT_APP_CRASHPAD_H_ |
| OLD | NEW |