Crashpad
|
A CrashReportDatabase that uses HFS+ extended attributes to store report metadata. More...
Public Member Functions | |
CrashReportDatabaseMac (const base::FilePath &path) | |
bool | Initialize (bool may_create) |
Settings * | GetSettings () override |
Returns the Settings object for this database. More... | |
OperationStatus | PrepareNewCrashReport (std::unique_ptr< NewReport > *report) override |
Creates a record of a new crash report. More... | |
OperationStatus | FinishedWritingCrashReport (std::unique_ptr< NewReport > report, UUID *uuid) override |
Informs the database that a crash report has been successfully written. More... | |
OperationStatus | LookUpCrashReport (const UUID &uuid, Report *report) override |
Returns the crash report record for the unique identifier. More... | |
OperationStatus | GetPendingReports (std::vector< Report > *reports) override |
Returns a list of crash report records that have not been uploaded. More... | |
OperationStatus | GetCompletedReports (std::vector< Report > *reports) override |
Returns a list of crash report records that have been completed, either by being uploaded or by skipping upload. More... | |
OperationStatus | GetReportForUploading (const UUID &uuid, std::unique_ptr< const UploadReport > *report, bool report_metrics) override |
Obtains and locks a report object for uploading to a collection server. More... | |
OperationStatus | SkipReportUpload (const UUID &uuid, Metrics::CrashSkippedReason reason) override |
Moves a report from the pending state to the completed state, but without the report being uploaded. More... | |
OperationStatus | DeleteReport (const UUID &uuid) override |
Deletes a crash report file and its associated metadata. More... | |
OperationStatus | RequestUpload (const UUID &uuid) override |
Marks a crash report as explicitly requested to be uploaded by the user and moves it to 'pending' state. More... | |
Public Member Functions inherited from crashpad::CrashReportDatabase | |
OperationStatus | RecordUploadComplete (std::unique_ptr< const UploadReport > report, const std::string &id) |
Records a successful upload for a report and updates the last upload attempt time as returned by Settings::GetLastUploadAttemptTime(). More... | |
virtual int | CleanDatabase (time_t lockfile_ttl) |
Cleans the database of expired lockfiles, metadata without report files, and report files without metadata. More... | |
Additional Inherited Members | |
Public Types inherited from crashpad::CrashReportDatabase | |
enum | OperationStatus |
The result code for operations performed on a database. More... | |
Static Public Member Functions inherited from crashpad::CrashReportDatabase | |
static std::unique_ptr< CrashReportDatabase > | Initialize (const base::FilePath &path) |
Opens a database of crash reports, possibly creating it. More... | |
static std::unique_ptr< CrashReportDatabase > | InitializeWithoutCreating (const base::FilePath &path) |
Opens an existing database of crash reports. More... | |
A CrashReportDatabase that uses HFS+ extended attributes to store report metadata.
The database maintains three directories of reports: "new"
to hold crash reports that are in the process of being written, "completed"
to hold reports that have been written and are awaiting upload, and "uploaded"
to hold reports successfully uploaded to a collection server. If the user has opted out of report collection, reports will still be written and moved to the completed directory, but they just will not be uploaded.
The database stores its metadata in extended filesystem attributes. To ensure safe access, the report file is locked using O_EXLOCK
during all extended attribute operations. The lock should be obtained using ObtainReportLock().
|
overridevirtual |
Deletes a crash report file and its associated metadata.
[in] | uuid | The UUID of the report to delete. |
Implements crashpad::CrashReportDatabase.
|
overridevirtual |
Informs the database that a crash report has been successfully written.
[in] | report | A NewReport obtained with PrepareNewCrashReport(). The NewReport object will be invalidated as part of this call. |
[out] | uuid | The UUID of this crash report. |
Implements crashpad::CrashReportDatabase.
|
overridevirtual |
Returns a list of crash report records that have been completed, either by being uploaded or by skipping upload.
[out] | reports | A list of crash report record objects. This must be empty on entry. Only valid if this returns kNoError. |
Implements crashpad::CrashReportDatabase.
|
overridevirtual |
Returns a list of crash report records that have not been uploaded.
[out] | reports | A list of crash report record objects. This must be empty on entry. Only valid if this returns kNoError. |
Implements crashpad::CrashReportDatabase.
|
overridevirtual |
Obtains and locks a report object for uploading to a collection server.
Callers should upload the crash report using the FileReader provided. Callers should then call RecordUploadComplete() to record a successful upload. If RecordUploadComplete() is not called, the upload attempt will be recorded as unsuccessful and the report lock released when report is destroyed.
[in] | uuid | The unique identifier for the crash report record. |
[out] | report | A crash report record for the report to be uploaded. Only valid if this returns kNoError. |
[in] | report_metrics | If false , metrics will not be recorded for this upload attempt when RecordUploadComplete() is called or report is destroyed. Metadata for the upload attempt will still be recorded in the database. |
Implements crashpad::CrashReportDatabase.
|
overridevirtual |
Returns the Settings object for this database.
Implements crashpad::CrashReportDatabase.
|
overridevirtual |
Returns the crash report record for the unique identifier.
[in] | uuid | The crash report record unique identifier. |
[out] | report | A crash report record. Only valid if this returns kNoError. |
Implements crashpad::CrashReportDatabase.
|
overridevirtual |
Creates a record of a new crash report.
Callers should write the crash report using the FileWriter provided. Callers should then call FinishedWritingCrashReport() to complete report creation. If an error is encountered while writing the crash report, no special action needs to be taken. If FinishedWritingCrashReport() is not called, the report will be removed from the database when report is destroyed.
[out] | report | A NewReport object containing a FileWriter with which to write the report data. Only valid if this returns kNoError. |
Implements crashpad::CrashReportDatabase.
|
overridevirtual |
Marks a crash report as explicitly requested to be uploaded by the user and moves it to 'pending' state.
[in] | uuid | The unique identifier for the crash report record. |
Implements crashpad::CrashReportDatabase.
|
overridevirtual |
Moves a report from the pending state to the completed state, but without the report being uploaded.
This can be used if the user has disabled crash report collection, but crash generation is still enabled in the product.
[in] | uuid | The unique identifier for the crash report record. |
[in] | reason | The reason the report upload is being skipped for metrics tracking purposes. |
Implements crashpad::CrashReportDatabase.