aboutsummaryrefslogtreecommitdiff
path: root/src/client/windows/crash_generation/crash_generation_server.cc
diff options
context:
space:
mode:
authordoshimun <doshimun@4c0a9323-5329-0410-9bdc-e9ce6186880e>2008-04-03 21:46:58 +0000
committerdoshimun <doshimun@4c0a9323-5329-0410-9bdc-e9ce6186880e>2008-04-03 21:46:58 +0000
commitfc816a3b3ae4f5606fc5bad14007e57420df96f2 (patch)
tree4c38b71624c4992dda2ba6405214121d17052b27 /src/client/windows/crash_generation/crash_generation_server.cc
parentissue 223 - Fixes for SOlaris handler during integration with Firefox. patch ... (diff)
downloadbreakpad-fc816a3b3ae4f5606fc5bad14007e57420df96f2.tar.xz
Minor style changes to comply with Google style guidelines.
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@252 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/client/windows/crash_generation/crash_generation_server.cc')
-rw-r--r--src/client/windows/crash_generation/crash_generation_server.cc50
1 files changed, 24 insertions, 26 deletions
diff --git a/src/client/windows/crash_generation/crash_generation_server.cc b/src/client/windows/crash_generation/crash_generation_server.cc
index 31e0b4ea..5409cc5a 100644
--- a/src/client/windows/crash_generation/crash_generation_server.cc
+++ b/src/client/windows/crash_generation/crash_generation_server.cc
@@ -28,7 +28,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "client/windows/crash_generation/crash_generation_server.h"
-#include <Windows.h>
+#include <windows.h>
#include <cassert>
#include "client/windows/common/auto_critical_section.h"
#include "processor/scoped_ptr.h"
@@ -80,7 +80,7 @@ const int kShutdownDelayMs = 10000;
// Interval for each sleep during server shutdown.
const int kShutdownSleepIntervalMs = 5;
-static bool ValidateClientRequest(const ProtocolMessage& msg) {
+static bool IsClientRequestValid(const ProtocolMessage& msg) {
return msg.tag == MESSAGE_TAG_REGISTRATION_REQUEST &&
msg.pid != 0 &&
msg.thread_id != NULL &&
@@ -89,7 +89,7 @@ static bool ValidateClientRequest(const ProtocolMessage& msg) {
}
CrashGenerationServer::CrashGenerationServer(
- const wchar_t* pipe_name,
+ const std::wstring& pipe_name,
OnClientConnectedCallback connect_callback,
void* connect_context,
OnClientDumpRequestCallback dump_callback,
@@ -98,23 +98,23 @@ CrashGenerationServer::CrashGenerationServer(
void* exit_context,
bool generate_dumps,
const std::wstring* dump_path)
- : pipe_name_(pipe_name),
- pipe_(NULL),
- pipe_wait_handle_(NULL),
- server_alive_handle_(NULL),
- connect_callback_(connect_callback),
- connect_context_(connect_context),
- dump_callback_(dump_callback),
- dump_context_(dump_context),
- exit_callback_(exit_callback),
- exit_context_(exit_context),
- generate_dumps_(generate_dumps),
- dump_generator_(NULL),
- server_state_(IPC_SERVER_STATE_INITIAL),
- shutting_down_(false),
- overlapped_(),
- client_info_(NULL),
- cleanup_item_count_(0) {
+ : pipe_name_(pipe_name),
+ pipe_(NULL),
+ pipe_wait_handle_(NULL),
+ server_alive_handle_(NULL),
+ connect_callback_(connect_callback),
+ connect_context_(connect_context),
+ dump_callback_(dump_callback),
+ dump_context_(dump_context),
+ exit_callback_(exit_callback),
+ exit_context_(exit_context),
+ generate_dumps_(generate_dumps),
+ dump_generator_(NULL),
+ server_state_(IPC_SERVER_STATE_INITIAL),
+ shutting_down_(false),
+ overlapped_(),
+ client_info_(NULL),
+ cleanup_item_count_(0) {
InitializeCriticalSection(&clients_sync_);
if (dump_path) {
@@ -269,8 +269,7 @@ void CrashGenerationServer::HandleInitialState() {
return;
}
- bool success;
- success = ConnectNamedPipe(pipe_, &overlapped_) != FALSE;
+ bool success = ConnectNamedPipe(pipe_, &overlapped_) != FALSE;
// From MSDN, it is not clear that when ConnectNamedPipe is used
// in an overlapped mode, will it ever return non-zero value, and
@@ -362,7 +361,7 @@ void CrashGenerationServer::HandleReadingState() {
&bytes_count,
FALSE) != FALSE;
- if (success && bytes_count == sizeof(ProtocolMessage)){
+ if (success && bytes_count == sizeof(ProtocolMessage)) {
server_state_ = IPC_SERVER_STATE_READ_DONE;
return;
}
@@ -387,7 +386,7 @@ void CrashGenerationServer::HandleReadingState() {
void CrashGenerationServer::HandleReadDoneState() {
assert(server_state_ == IPC_SERVER_STATE_READ_DONE);
- if (!ValidateClientRequest(msg_)) {
+ if (!IsClientRequestValid(msg_)) {
server_state_ = IPC_SERVER_STATE_DISCONNECTING;
return;
}
@@ -743,8 +742,7 @@ void CALLBACK CrashGenerationServer::OnClientEnd(void* context, BOOLEAN) {
InterlockedIncrement(&crash_server->cleanup_item_count_);
- if (!QueueUserWorkItem(CleanupClient, context, WT_EXECUTEDEFAULT))
- {
+ if (!QueueUserWorkItem(CleanupClient, context, WT_EXECUTEDEFAULT)) {
InterlockedDecrement(&crash_server->cleanup_item_count_);
}
}