# Crashpad: crashpad::CrashReportUploadThread Class Reference

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:

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

## 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,
|  | bool | watch_pending_reports,
|  | bool | rate_limit,
|  | bool | upload_gzip
| ) |  |

Constructs a new object.

Parameters

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

## 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_uuid | The unique identifier of the newly added pending report.

This method may be called from any thread.

## Start()

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

## 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().

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

- handler/crash_report_upload_thread.h
- handler/crash_report_upload_thread.cc