aboutsummaryrefslogtreecommitdiff
path: root/src/client/windows/crash_generation/crash_generation_server.h
diff options
context:
space:
mode:
authorerikwright@chromium.org <erikwright@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e>2010-09-20 21:35:24 +0000
committererikwright@chromium.org <erikwright@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e>2010-09-20 21:35:24 +0000
commitb6ee7dcb220db5c396d12ddf12e071c8ec48dfd3 (patch)
tree24d02957a9c2dc5a4b0231b3f73e8de3f094f079 /src/client/windows/crash_generation/crash_generation_server.h
parentAdd StaticMap implementation and unittest to breakpad. (diff)
downloadbreakpad-b6ee7dcb220db5c396d12ddf12e071c8ec48dfd3.tar.xz
Fix CrashGenerationServer to recover from protocol errors and a test for same.
R=siggi at http://breakpad.appspot.com/196001/show git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@695 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/client/windows/crash_generation/crash_generation_server.h')
-rw-r--r--src/client/windows/crash_generation/crash_generation_server.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/client/windows/crash_generation/crash_generation_server.h b/src/client/windows/crash_generation/crash_generation_server.h
index cacb639a..31a353bf 100644
--- a/src/client/windows/crash_generation/crash_generation_server.h
+++ b/src/client/windows/crash_generation/crash_generation_server.h
@@ -33,11 +33,11 @@
#include <list>
#include <string>
#include "client/windows/common/ipc_protocol.h"
-#include "client/windows/crash_generation/client_info.h"
#include "client/windows/crash_generation/minidump_generator.h"
#include "processor/scoped_ptr.h"
namespace google_breakpad {
+class ClientInfo;
// Abstraction for server side implementation of out-of-process crash
// generation protocol for Windows platform only. It generates Windows
@@ -91,7 +91,8 @@ class CrashGenerationServer {
~CrashGenerationServer();
- // Performs initialization steps needed to start listening to clients.
+ // Performs initialization steps needed to start listening to clients. Upon
+ // successful return clients may connect to this server's pipe.
//
// Returns true if initialization is successful; false otherwise.
bool Start();
@@ -100,6 +101,9 @@ class CrashGenerationServer {
// Various states the client can be in during the handshake with
// the server.
enum IPCServerState {
+ // Server starts in this state.
+ IPC_SERVER_STATE_UNINITIALIZED,
+
// Server is in error state and it cannot serve any clients.
IPC_SERVER_STATE_ERROR,
@@ -192,6 +196,21 @@ class CrashGenerationServer {
// Generates dump for the given client.
bool GenerateDump(const ClientInfo& client, std::wstring* dump_path);
+ // Puts the server in a permanent error state and sets a signal such that
+ // the state will be immediately entered after the current state transition
+ // is complete.
+ void EnterErrorState();
+
+ // Puts the server in the specified state and sets a signal such that the
+ // state is immediately entered after the current state transition is
+ // complete.
+ void EnterStateImmediately(IPCServerState state);
+
+ // Puts the server in the specified state. No signal will be set, so the state
+ // transition will only occur when signaled manually or by completion of an
+ // asynchronous IO operation.
+ void EnterStateWhenSignaled(IPCServerState state);
+
// Sync object for thread-safe access to the shared list of clients.
CRITICAL_SECTION clients_sync_;