Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: util/win/exception_handler_server.cc

Issue 1408123006: Tidy up to enable C4800 on Windows (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: . Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « util/win/critical_section_with_debug_info.cc ('k') | util/win/process_info.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Crashpad Authors. All rights reserved. 1 // Copyright 2015 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 return false; 443 return false;
444 } 444 }
445 445
446 // static 446 // static
447 DWORD __stdcall ExceptionHandlerServer::PipeServiceProc(void* ctx) { 447 DWORD __stdcall ExceptionHandlerServer::PipeServiceProc(void* ctx) {
448 internal::PipeServiceContext* service_context = 448 internal::PipeServiceContext* service_context =
449 reinterpret_cast<internal::PipeServiceContext*>(ctx); 449 reinterpret_cast<internal::PipeServiceContext*>(ctx);
450 DCHECK(service_context); 450 DCHECK(service_context);
451 451
452 for (;;) { 452 for (;;) {
453 bool ret = ConnectNamedPipe(service_context->pipe(), nullptr); 453 bool ret = !!ConnectNamedPipe(service_context->pipe(), nullptr);
454 if (!ret && GetLastError() != ERROR_PIPE_CONNECTED) { 454 if (!ret && GetLastError() != ERROR_PIPE_CONNECTED) {
455 PLOG(ERROR) << "ConnectNamedPipe"; 455 PLOG(ERROR) << "ConnectNamedPipe";
456 } else if (ServiceClientConnection(*service_context)) { 456 } else if (ServiceClientConnection(*service_context)) {
457 break; 457 break;
458 } 458 }
459 DisconnectNamedPipe(service_context->pipe()); 459 DisconnectNamedPipe(service_context->pipe());
460 } 460 }
461 461
462 delete service_context; 462 delete service_context;
463 463
(...skipping 20 matching lines...) Expand all
484 // This function is executed on the thread pool. 484 // This function is executed on the thread pool.
485 internal::ClientData* client = reinterpret_cast<internal::ClientData*>(ctx); 485 internal::ClientData* client = reinterpret_cast<internal::ClientData*>(ctx);
486 base::AutoLock lock(*client->lock()); 486 base::AutoLock lock(*client->lock());
487 487
488 // Capture the exception. 488 // Capture the exception.
489 client->delegate()->ExceptionHandlerServerException( 489 client->delegate()->ExceptionHandlerServerException(
490 client->process(), 490 client->process(),
491 client->non_crash_exception_information_address(), 491 client->non_crash_exception_information_address(),
492 client->debug_critical_section_address()); 492 client->debug_critical_section_address());
493 493
494 bool result = SetEvent(client->non_crash_dump_completed_event()); 494 bool result = !!SetEvent(client->non_crash_dump_completed_event());
495 PLOG_IF(ERROR, !result) << "SetEvent"; 495 PLOG_IF(ERROR, !result) << "SetEvent";
496 } 496 }
497 497
498 // static 498 // static
499 void __stdcall ExceptionHandlerServer::OnProcessEnd(void* ctx, BOOLEAN) { 499 void __stdcall ExceptionHandlerServer::OnProcessEnd(void* ctx, BOOLEAN) {
500 // This function is executed on the thread pool. 500 // This function is executed on the thread pool.
501 internal::ClientData* client = reinterpret_cast<internal::ClientData*>(ctx); 501 internal::ClientData* client = reinterpret_cast<internal::ClientData*>(ctx);
502 base::AutoLock lock(*client->lock()); 502 base::AutoLock lock(*client->lock());
503 503
504 // Post back to the main thread to have it delete this client record. 504 // Post back to the main thread to have it delete this client record.
505 PostQueuedCompletionStatus(client->port(), 0, ULONG_PTR(client), nullptr); 505 PostQueuedCompletionStatus(client->port(), 0, ULONG_PTR(client), nullptr);
506 } 506 }
507 507
508 } // namespace crashpad 508 } // namespace crashpad
OLDNEW
« no previous file with comments | « util/win/critical_section_with_debug_info.cc ('k') | util/win/process_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698