Fix Windows release build error due to unreferenced variables.

BUG=544
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/874002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1249 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
thestig@chromium.org 2013-12-09 21:59:48 +00:00
parent 0348c801bd
commit 8d22ec9227

View File

@ -85,6 +85,15 @@ static bool IsClientRequestValid(const ProtocolMessage& msg) {
msg.assert_info != NULL); msg.assert_info != NULL);
} }
#ifdef _DEBUG
static bool CheckForIOIncomplete(bool success) {
// We should never get an I/O incomplete since we should not execute this
// unless the operation has finished and the overlapped event is signaled. If
// we do get INCOMPLETE, we have a bug in our code.
return success ? false : (GetLastError() == ERROR_IO_INCOMPLETE);
}
#endif
CrashGenerationServer::CrashGenerationServer( CrashGenerationServer::CrashGenerationServer(
const std::wstring& pipe_name, const std::wstring& pipe_name,
SECURITY_ATTRIBUTES* pipe_sec_attrs, SECURITY_ATTRIBUTES* pipe_sec_attrs,
@ -388,18 +397,13 @@ void CrashGenerationServer::HandleReadingState() {
&overlapped_, &overlapped_,
&bytes_count, &bytes_count,
FALSE) != FALSE; FALSE) != FALSE;
DWORD error_code = success ? ERROR_SUCCESS : GetLastError();
if (success && bytes_count == sizeof(ProtocolMessage)) { if (success && bytes_count == sizeof(ProtocolMessage)) {
EnterStateImmediately(IPC_SERVER_STATE_READ_DONE); EnterStateImmediately(IPC_SERVER_STATE_READ_DONE);
} else { return;
// We should never get an I/O incomplete since we should not execute this
// unless the Read has finished and the overlapped event is signaled. If
// we do get INCOMPLETE, we have a bug in our code.
assert(error_code != ERROR_IO_INCOMPLETE);
EnterStateImmediately(IPC_SERVER_STATE_DISCONNECTING);
} }
assert(!CheckForIOIncomplete(success));
EnterStateImmediately(IPC_SERVER_STATE_DISCONNECTING);
} }
// When the server thread serving the client is in the READ_DONE state, // When the server thread serving the client is in the READ_DONE state,
@ -468,18 +472,12 @@ void CrashGenerationServer::HandleWritingState() {
&overlapped_, &overlapped_,
&bytes_count, &bytes_count,
FALSE) != FALSE; FALSE) != FALSE;
DWORD error_code = success ? ERROR_SUCCESS : GetLastError();
if (success) { if (success) {
EnterStateImmediately(IPC_SERVER_STATE_WRITE_DONE); EnterStateImmediately(IPC_SERVER_STATE_WRITE_DONE);
return; return;
} }
// We should never get an I/O incomplete since we should not execute this assert(!CheckForIOIncomplete(success));
// unless the Write has finished and the overlapped event is signaled. If
// we do get INCOMPLETE, we have a bug in our code.
assert(error_code != ERROR_IO_INCOMPLETE);
EnterStateImmediately(IPC_SERVER_STATE_DISCONNECTING); EnterStateImmediately(IPC_SERVER_STATE_DISCONNECTING);
} }
@ -517,8 +515,6 @@ void CrashGenerationServer::HandleReadingAckState() {
&overlapped_, &overlapped_,
&bytes_count, &bytes_count,
FALSE) != FALSE; FALSE) != FALSE;
DWORD error_code = success ? ERROR_SUCCESS : GetLastError();
if (success) { if (success) {
// The connection handshake with the client is now complete; perform // The connection handshake with the client is now complete; perform
// the callback. // the callback.
@ -551,10 +547,7 @@ void CrashGenerationServer::HandleReadingAckState() {
} }
} }
} else { } else {
// We should never get an I/O incomplete since we should not execute this assert(!CheckForIOIncomplete(success));
// unless the Read has finished and the overlapped event is signaled. If
// we do get INCOMPLETE, we have a bug in our code.
assert(error_code != ERROR_IO_INCOMPLETE);
} }
EnterStateImmediately(IPC_SERVER_STATE_DISCONNECTING); EnterStateImmediately(IPC_SERVER_STATE_DISCONNECTING);