| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_CRASH_APP_CRASHPAD_MAC_H_ | |
| 6 #define COMPONENTS_CRASH_APP_CRASHPAD_MAC_H_ | |
| 7 | |
| 8 #include <time.h> | |
| 9 | |
| 10 #include <string> | |
| 11 #include <vector> | |
| 12 | |
| 13 namespace crash_reporter { | |
| 14 | |
| 15 // Initializes Crashpad in a way that is appropriate for process_type. If | |
| 16 // process_type is empty, initializes Crashpad for the browser process, which | |
| 17 // starts crashpad_handler and sets it as the exception handler. Other process | |
| 18 // types inherit this exception handler from the browser, but still need to | |
| 19 // perform additional initialization. | |
| 20 void InitializeCrashpad(const std::string& process_type); | |
| 21 | |
| 22 // Enables or disables crash report upload. This is a property of the Crashpad | |
| 23 // database. In a newly-created database, uploads will be disabled. This | |
| 24 // function only has an effect when called in the browser process. Its effect is | |
| 25 // immediate and applies to all other process types, including processes that | |
| 26 // are already running. | |
| 27 void SetUploadsEnabled(bool enabled); | |
| 28 | |
| 29 // Determines whether uploads are enabled or disabled. This information is only | |
| 30 // available in the browser process. | |
| 31 bool GetUploadsEnabled(); | |
| 32 | |
| 33 struct UploadedReport { | |
| 34 std::string local_id; | |
| 35 std::string remote_id; | |
| 36 time_t creation_time; | |
| 37 }; | |
| 38 | |
| 39 // Obtains a list of reports uploaded to the collection server. This function | |
| 40 // only operates when called in the browser process. All reports in the Crashpad | |
| 41 // database that have been successfully uploaded will be included in this list. | |
| 42 // The list will be sorted in descending order by report creation time (newest | |
| 43 // reports first). | |
| 44 // | |
| 45 // TODO(mark): The about:crashes UI expects to show only uploaded reports. If it | |
| 46 // is ever enhanced to work well with un-uploaded reports, those should be | |
| 47 // returned as well. Un-uploaded reports may have a pending upload, may have | |
| 48 // experienced upload failure, or may have been collected while uploads were | |
| 49 // disabled. | |
| 50 void GetUploadedReports(std::vector<UploadedReport>* uploaded_reports); | |
| 51 | |
| 52 } // namespace crash_reporter | |
| 53 | |
| 54 #endif // COMPONENTS_CRASH_APP_CRASHPAD_MAC_H_ | |
| OLD | NEW |