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
This commit is contained in:
doshimun 2008-04-03 21:46:58 +00:00
parent dd2ff4a21c
commit fc816a3b3a
4 changed files with 39 additions and 34 deletions

View File

@ -30,6 +30,8 @@
#ifndef CLIENT_WINDOWS_CRASH_GENERATION_CRASH_GENERATION_CLIENT_H__
#define CLIENT_WINDOWS_CRASH_GENERATION_CRASH_GENERATION_CLIENT_H__
#include <windows.h>
#include <dbghelp.h>
#include <string>
#include "client/windows/common/ipc_protocol.h"

View File

@ -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,
@ -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
@ -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_);
}
}

View File

@ -40,8 +40,13 @@
namespace google_breakpad {
// Abstraction for server side implementation of out-of-process crash
// generation protocol. It generates minidumps (Windows platform) for
// client processes that request dump generation.
// generation protocol for Windows platform only. It generates Windows
// minidump files for client processes that request dump generation. When
// the server is requested to start listening for clients (by calling the
// Start method), it creates a named pipe and waits for the clients to
// register. In response, it hands them event handles that the client can
// signal to request dump generation. When the clients request dump
// generation in this way, the server generates Windows minidump files.
class CrashGenerationServer {
public:
typedef void (*OnClientConnectedCallback)(void* context,
@ -55,20 +60,20 @@ class CrashGenerationServer {
// Creates an instance with the given parameters.
//
// Parameter pipe_name: Name of the pipe
// Parameter pipe_name: Name of the Windows Named pipe
// Parameter connect_callback: Callback for a new client connection.
// Parameter connect_context: Context for client connection callback.
// Parameter crash_callback: Callback for a client crash dump request.
// Parameter crash_context: Context for client crash dump request callback.
// Parameter exit_callback: Callback for client process exit.
// Parameter exit_context: Context for client exit callback.
// Parameter generate_dumps: Whether to automatically generate dumps or not.
// Parameter generate_dumps: Whether to automatically generate dumps.
// Client code of this class might want to generate dumps explicitly in the
// crash dump request callback. In that case, false can be passed for this
// parameter.
// Parameter dump_path: Path for generating dumps; required only if true is
// passed for generateDumps parameter; NULL can be passed otherwise.
CrashGenerationServer(const wchar_t* pipe_name,
CrashGenerationServer(const std::wstring& pipe_name,
OnClientConnectedCallback connect_callback,
void* connect_context,
OnClientDumpRequestCallback dump_callback,
@ -217,7 +222,7 @@ class CrashGenerationServer {
// Context for client process exit callback.
void* exit_context_;
// Whether to generate dumps or not.
// Whether to generate dumps.
bool generate_dumps_;
// Instance of a mini dump generator.

View File

@ -30,8 +30,8 @@
#ifndef CLIENT_WINDOWS_CRASH_GENERATION_MINIDUMP_GENERATION_H__
#define CLIENT_WINDOWS_CRASH_GENERATION_MINIDUMP_GENERATION_H__
#include <Windows.h>
#include <DbgHelp.h>
#include <windows.h>
#include <dbghelp.h>
#include <list>
#include "google_breakpad/common/minidump_format.h"