OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |