wires up the crash client side so that the deferred upload callback can be used.

TEST=N/A 
Review URL: https://breakpad.appspot.com/384001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@961 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
cdn@chromium.org 2012-05-03 18:15:11 +00:00
parent d1118d6e14
commit fa31053b42
5 changed files with 33 additions and 4 deletions

View file

@ -167,6 +167,23 @@ bool CrashGenerationClient::Register() {
return success; return success;
} }
bool CrashGenerationClient::RequestUpload(DWORD crash_id) {
HANDLE pipe = ConnectToServer();
if (!pipe) {
return false;
}
CustomClientInfo custom_info;
ProtocolMessage msg(MESSAGE_TAG_UPLOAD_REQUEST, crash_id,
static_cast<MINIDUMP_TYPE>(NULL), NULL, NULL, NULL,
custom_info, NULL, NULL, NULL);
DWORD bytes_count = 0;
bool success = WriteFile(pipe, &msg, sizeof(msg), &bytes_count, NULL);
CloseHandle(pipe);
return success;
}
HANDLE CrashGenerationClient::ConnectToServer() { HANDLE CrashGenerationClient::ConnectToServer() {
HANDLE pipe = ConnectToPipe(pipe_name_.c_str(), HANDLE pipe = ConnectToPipe(pipe_name_.c_str(),
kPipeDesiredAccess, kPipeDesiredAccess,

View file

@ -73,6 +73,10 @@ class CrashGenerationClient {
// Returns true if the registration is successful; false otherwise. // Returns true if the registration is successful; false otherwise.
bool Register(); bool Register();
// Requests the crash server to upload a previous dump with the
// given crash id.
bool RequestUpload(DWORD crash_id);
bool RequestDump(EXCEPTION_POINTERS* ex_info, bool RequestDump(EXCEPTION_POINTERS* ex_info,
MDRawAssertionInfo* assert_info); MDRawAssertionInfo* assert_info);

View file

@ -424,6 +424,7 @@ void CrashGenerationServer::HandleReadDoneState() {
if (msg_.tag == MESSAGE_TAG_UPLOAD_REQUEST) { if (msg_.tag == MESSAGE_TAG_UPLOAD_REQUEST) {
if (upload_request_callback_) if (upload_request_callback_)
upload_request_callback_(upload_context_, msg_.id); upload_request_callback_(upload_context_, msg_.id);
EnterStateImmediately(IPC_SERVER_STATE_DISCONNECTING);
return; return;
} }

View file

@ -312,6 +312,10 @@ ExceptionHandler::~ExceptionHandler() {
} }
} }
bool ExceptionHandler::RequestUpload(DWORD crash_id) {
return crash_generation_client_->RequestUpload(crash_id);
}
// static // static
DWORD ExceptionHandler::ExceptionHandlerThreadMain(void* lpParameter) { DWORD ExceptionHandler::ExceptionHandlerThreadMain(void* lpParameter) {
ExceptionHandler* self = reinterpret_cast<ExceptionHandler *>(lpParameter); ExceptionHandler* self = reinterpret_cast<ExceptionHandler *>(lpParameter);

View file

@ -88,9 +88,9 @@ class ExceptionHandler {
// if any. // if any.
// //
// If a FilterCallback returns true, Breakpad will continue processing, // If a FilterCallback returns true, Breakpad will continue processing,
// attempting to write a minidump. If a FilterCallback returns false, Breakpad // attempting to write a minidump. If a FilterCallback returns false,
// will immediately report the exception as unhandled without writing a // Breakpad will immediately report the exception as unhandled without
// minidump, allowing another handler the opportunity to handle it. // writing a minidump, allowing another handler the opportunity to handle it.
typedef bool (*FilterCallback)(void* context, EXCEPTION_POINTERS* exinfo, typedef bool (*FilterCallback)(void* context, EXCEPTION_POINTERS* exinfo,
MDRawAssertionInfo* assertion); MDRawAssertionInfo* assertion);
@ -177,6 +177,9 @@ class ExceptionHandler {
UpdateNextID(); // Necessary to put dump_path_ in next_minidump_path_. UpdateNextID(); // Necessary to put dump_path_ in next_minidump_path_.
} }
// Requests that a previously reported crash be uploaded.
bool RequestUpload(DWORD crash_id);
// Writes a minidump immediately. This can be used to capture the // Writes a minidump immediately. This can be used to capture the
// execution state independently of a crash. Returns true on success. // execution state independently of a crash. Returns true on success.
bool WriteMinidump(); bool WriteMinidump();