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"
Classes | |
struct | Options |
Options to be passed to the CrashReportUploadThread constructor. More... | |
Public Member Functions | |
CrashReportUploadThread (CrashReportDatabase *database, const std::string &url, const Options &options) | |
Constructs a new object. More... | |
void | ReportPending (const UUID &report_uuid) |
Informs the upload thread that a new pending report has been added to the database. More... | |
void | Start () override |
Starts a dedicated upload thread, which executes ThreadMain(). More... | |
void | Stop () override |
Stops the upload thread. 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, | ||
const Options & | options | ||
) |
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] | options | Options for the report uploads. |
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.
|
overridevirtual |
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().
Implements crashpad::Stoppable.
|
overridevirtual |
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().
Implements crashpad::Stoppable.