#include <CrashReportUploader.h>
Public Slots | |
void | cancel () |
Signals | |
void | uploadProgress (int done, int total) |
void | statusChanged (const QString &status) |
void | uploadFinished () |
void | uploadFailed (const QString &error) |
Public Member Functions | |
CrashReportUploader (QObject *parent=0) | |
void | uploadMinidump (const QUrl &serverUrl, const QString &minidumpId, const QByteArray &minidump, const QMap< QString, QString > ¶meters) |
Private Slots | |
void | httpStateChanged (int state) |
void | httpRequestFinished (int id, bool error) |
Private Member Functions | |
QString | generateBoundaryMarker () const |
Private Attributes | |
int | _requestId |
QHttp * | _http |
Definition at line 30 of file CrashReportUploader.h.
CrashReportUploader::CrashReportUploader | ( | QObject * | parent = 0 |
) |
Default constructor.
Definition at line 30 of file CrashReportUploader.cpp.
References _http, httpRequestFinished(), httpStateChanged(), and uploadProgress().
void CrashReportUploader::cancel | ( | ) | [slot] |
Cancels a pending minidump upload.
Definition at line 109 of file CrashReportUploader.cpp.
References _http.
Referenced by CrashReportDialog::submitCrashReport().
QString CrashReportUploader::generateBoundaryMarker | ( | ) | const [private] |
Generates a "random" 8-byte multipart boundary marker encoded into 16 hex characters.
Definition at line 102 of file CrashReportUploader.cpp.
Referenced by uploadMinidump().
void CrashReportUploader::httpRequestFinished | ( | int | id, | |
bool | error | |||
) | [private, slot] |
Called when the underlying QHttp object used to upload the minidump completes. error is set to false if the upload was successful, or true if the upload failed. If id does not match the request ID previously returned by QHttp::get(), then the signal is ignored since it is the result of a close() or abort() request.
Definition at line 136 of file CrashReportUploader.cpp.
References _http, _requestId, uploadFailed(), and uploadFinished().
Referenced by CrashReportUploader().
void CrashReportUploader::httpStateChanged | ( | int | state | ) | [private, slot] |
Called when the state of the underlying QHttp object changes. A statusChanged() signal is emitted with the appropriate text describing the new state of the POST request.
Definition at line 115 of file CrashReportUploader.cpp.
References statusChanged().
Referenced by CrashReportUploader().
void CrashReportUploader::statusChanged | ( | const QString & | status | ) | [signal] |
Emitted when the status of the POST request changes. status describes the new current state of the request.
Referenced by httpStateChanged().
void CrashReportUploader::uploadFailed | ( | const QString & | error | ) | [signal] |
Emitted when the previous crash report upload fails. The QString error is a human-readable string describing the error encountered.
Referenced by httpRequestFinished().
void CrashReportUploader::uploadFinished | ( | ) | [signal] |
Emitted when the previous minidump upload completes successfully.
Referenced by httpRequestFinished().
void CrashReportUploader::uploadMinidump | ( | const QUrl & | serverUrl, | |
const QString & | minidumpId, | |||
const QByteArray & | minidump, | |||
const QMap< QString, QString > & | parameters | |||
) |
Starts uploading minidump to serverUrl and returns immediately. minidumpId is the minidump GUID generated by the exception handler and used for the minidump's filename. The optional parameters can be used to pass additional form fields to the crash reporting server.
Definition at line 52 of file CrashReportUploader.cpp.
References _http, _requestId, and generateBoundaryMarker().
Referenced by CrashReportDialog::submitCrashReport().
void CrashReportUploader::uploadProgress | ( | int | done, | |
int | total | |||
) | [signal] |
Emitted when the underlying QHttp object posts data to the server. done indicates how many bytes out of total have been sent so far.
Referenced by CrashReportUploader().
QHttp* CrashReportUploader::_http [private] |
Object used to POST a minidump to the crash server and read the response.
Definition at line 106 of file CrashReportUploader.h.
Referenced by cancel(), CrashReportUploader(), httpRequestFinished(), and uploadMinidump().
int CrashReportUploader::_requestId [private] |
Unique numeric identifier of the current minidump upload POST request.
Definition at line 101 of file CrashReportUploader.h.
Referenced by httpRequestFinished(), and uploadMinidump().