Revision: 1186
Author:
ivan....@gmail.com
Date: Mon May 20 11:55:54 2013
Log: Submitting this on behalf of Xiaoling Bao.
Make custom info population before dump generation as an optional
operation. This is part of a security change to move the crash generation
and upload out of Google updater process.
Review URL:
https://breakpad.appspot.com/586003
http://code.google.com/p/google-breakpad/source/detail?r=1186
Modified:
/trunk/src/client/windows/crash_generation/client_info.cc
/trunk/src/client/windows/crash_generation/client_info.h
/trunk/src/client/windows/crash_generation/crash_generation_server.cc
/trunk/src/client/windows/crash_generation/crash_generation_server.h
=======================================
--- /trunk/src/client/windows/crash_generation/client_info.cc Wed Aug 15
15:09:42 2012
+++ /trunk/src/client/windows/crash_generation/client_info.cc Mon May 20
11:55:54 2013
@@ -206,7 +206,7 @@
}
SetProcessUptime();
- return (bytes_count != read_count);
+ return (bytes_count == read_count);
}
CustomClientInfo ClientInfo::GetCustomInfo() const {
=======================================
--- /trunk/src/client/windows/crash_generation/client_info.h Tue Jan 22
09:20:42 2013
+++ /trunk/src/client/windows/crash_generation/client_info.h Mon May 20
11:55:54 2013
@@ -66,6 +66,9 @@
HANDLE dump_requested_handle() const { return dump_requested_handle_; }
HANDLE dump_generated_handle() const { return dump_generated_handle_; }
DWORD crash_id() const { return crash_id_; }
+ const CustomClientInfo& custom_client_info() const {
+ return custom_client_info_;
+ }
void set_dump_request_wait_handle(HANDLE value) {
dump_request_wait_handle_ = value;
=======================================
--- /trunk/src/client/windows/crash_generation/crash_generation_server.cc
Tue Jan 22 09:20:42 2013
+++ /trunk/src/client/windows/crash_generation/crash_generation_server.cc
Mon May 20 11:55:54 2013
@@ -116,7 +116,8 @@
server_state_(IPC_SERVER_STATE_UNINITIALIZED),
shutting_down_(false),
overlapped_(),
- client_info_(NULL) {
+ client_info_(NULL),
+ pre_fetch_custom_info_(true) {
InitializeCriticalSection(&sync_);
if (dump_path) {
@@ -198,7 +199,7 @@
if (overlapped_.hEvent) {
CloseHandle(overlapped_.hEvent);
}
-
+
DeleteCriticalSection(&sync_);
}
@@ -831,10 +832,12 @@
void CALLBACK CrashGenerationServer::OnDumpRequest(void* context, BOOLEAN)
{
assert(context);
ClientInfo* client_info = reinterpret_cast<ClientInfo*>(context);
- client_info->PopulateCustomInfo();
CrashGenerationServer* crash_server = client_info->crash_server();
assert(crash_server);
+ if (crash_server->pre_fetch_custom_info_) {
+ client_info->PopulateCustomInfo();
+ }
crash_server->HandleDumpRequest(*client_info);
ResetEvent(client_info->dump_requested_handle());
=======================================
--- /trunk/src/client/windows/crash_generation/crash_generation_server.h
Tue Jan 22 10:49:58 2013
+++ /trunk/src/client/windows/crash_generation/crash_generation_server.h
Mon May 20 11:55:54 2013
@@ -102,6 +102,10 @@
// Returns true if initialization is successful; false otherwise.
bool Start();
+ void pre_fetch_custom_info(bool do_pre_fetch) {
+ pre_fetch_custom_info_ = do_pre_fetch;
+ }
+
private:
// Various states the client can be in during the handshake with
// the server.
@@ -261,6 +265,9 @@
// Whether to generate dumps.
bool generate_dumps_;
+ // Wether to populate custom information up-front.
+ bool pre_fetch_custom_info_;
+
// Instance of a mini dump generator.
scoped_ptr<MinidumpGenerator> dump_generator_;