Crashpad
|
A thread that processes pending crash reports in a CrashReportDatabase by uploading them or marking them as completed without upload, as desired. More...
#include "handler/crash_report_upload_thread.h"
Public Member Functions | |
CrashReportUploadThread (CrashReportDatabase *database, const std::string &url, bool watch_pending_reports, bool rate_limit, bool upload_gzip) | |
Constructs a new object. More... | |
void | Start () |
Starts a dedicated upload thread, which executes ThreadMain(). More... | |
void | Stop () |
Stops the upload thread. More... | |
void | ReportPending (const UUID &report_uuid) |
Informs the upload thread that a new pending report has been added to the database. More... | |
A thread that processes pending crash reports in a CrashReportDatabase by uploading them or marking them as completed without upload, as desired.
A producer of crash reports should notify an object of this class that a new report has been added to the database by calling ReportPending().
Independently of being triggered by ReportPending(), objects of this class can periodically examine the database for pending reports. This allows failed upload attempts for reports left in the pending state to be retried. It also catches reports that are added without a ReportPending() signal being caught. This may happen if crash reports are added to the database by other processes.
crashpad::CrashReportUploadThread::CrashReportUploadThread | ( | CrashReportDatabase * | database, |
const std::string & | url, | ||
bool | watch_pending_reports, | ||
bool | rate_limit, | ||
bool | upload_gzip | ||
) |
Constructs a new object.
[in] | database | The database to upload crash reports from. |
[in] | url | The URL of the server to upload crash reports to. |
[in] | watch_pending_reports | Whether to periodically check for new pending reports not already known to exist. When false , only an initial upload attempt will be made for reports known to exist by having been added by the ReportPending() method. No scans for new pending reports will be conducted. |
[in] | rate_limit | Whether uploads should be throttled to a (currently hardcoded) rate. |
[in] | upload_gzip | Whether uploads should use gzip compression. |
void crashpad::CrashReportUploadThread::ReportPending | ( | const UUID & | report_uuid | ) |
Informs the upload thread that a new pending report has been added to the database.
[in] | report_uuid | The unique identifier of the newly added pending report. |
This method may be called from any thread.
void crashpad::CrashReportUploadThread::Start | ( | ) |
Starts a dedicated upload thread, which executes ThreadMain().
This method may only be be called on a newly-constructed object or after a call to Stop().
void crashpad::CrashReportUploadThread::Stop | ( | ) |
Stops the upload thread.
The upload thread will terminate after completing whatever task it is performing. If it is not performing any task, it will terminate immediately. This method blocks while waiting for the upload thread to terminate.
This method must only be called after Start(). If Start() has been called, this method must be called before destroying an object of this class.
This method may be called from any thread other than the upload thread. It is expected to only be called from the same thread that called Start().