Crashpad
Classes | Public Member Functions | List of all members
crashpad::CrashReportUploadThread Class Reference

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"

Inheritance diagram for crashpad::CrashReportUploadThread:
crashpad::WorkerThread::Delegate crashpad::Stoppable

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ CrashReportUploadThread()

crashpad::CrashReportUploadThread::CrashReportUploadThread ( CrashReportDatabase database,
const std::string &  url,
const Options options 
)

Constructs a new object.

Parameters
[in]databaseThe database to upload crash reports from.
[in]urlThe URL of the server to upload crash reports to.
[in]optionsOptions for the report uploads.

Member Function Documentation

◆ ReportPending()

void crashpad::CrashReportUploadThread::ReportPending ( const UUID report_uuid)

Informs the upload thread that a new pending report has been added to the database.

Parameters
[in]report_uuidThe unique identifier of the newly added pending report.

This method may be called from any thread.

◆ Start()

void crashpad::CrashReportUploadThread::Start ( )
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.

◆ Stop()

void crashpad::CrashReportUploadThread::Stop ( )
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.


The documentation for this class was generated from the following files: