aboutsummaryrefslogtreecommitdiff
path: root/src/client/windows
diff options
context:
space:
mode:
authorRafal Chlodnicki <rchlodnicki@opera.com>2016-08-25 23:33:31 +0200
committerMark Mentovai <mark@chromium.org>2016-08-25 21:43:05 +0000
commita2196179cc626de67ee4e4121246bcc8002d4bad (patch)
treebd23be4029d7c98abee8849cc7adcbddcd1fe707 /src/client/windows
parentUpdate MDRawMiscInfo to support version 5 of the MINIDUMP_MISC_INFO_N structure. (diff)
downloadbreakpad-a2196179cc626de67ee4e4121246bcc8002d4bad.tar.xz
Fix breakpad compilation issue with clang on Windows
Fix unused variable error. Code that uses the kWaitForHandlerThreadMs constant is inside and ifdef so in some compile configurations constant was unused. Move it where it's used. And do the same with other constants as requested during review. BUG= Change-Id: I4f4c8f36c982092d53438ed6d2a0a97772402d69 Reviewed-on: https://chromium-review.googlesource.com/374378 Reviewed-by: Mark Mentovai <mark@chromium.org>
Diffstat (limited to 'src/client/windows')
-rw-r--r--src/client/windows/handler/exception_handler.cc10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/client/windows/handler/exception_handler.cc b/src/client/windows/handler/exception_handler.cc
index ef581dd3..1f7b19f9 100644
--- a/src/client/windows/handler/exception_handler.cc
+++ b/src/client/windows/handler/exception_handler.cc
@@ -41,12 +41,6 @@
namespace google_breakpad {
-static const int kWaitForHandlerThreadMs = 60000;
-static const int kExceptionHandlerThreadInitialStackSize = 64 * 1024;
-
-// As documented on MSDN, on failure SuspendThread returns (DWORD) -1
-static const DWORD kFailedToSuspendThread = static_cast<DWORD>(-1);
-
// This is passed as the context to the MinidumpWriteDump callback.
typedef struct {
AppMemoryList::const_iterator iter;
@@ -217,6 +211,7 @@ void ExceptionHandler::Initialize(
// Don't attempt to create the thread if we could not create the semaphores.
if (handler_finish_semaphore_ != NULL && handler_start_semaphore_ != NULL) {
DWORD thread_id;
+ const int kExceptionHandlerThreadInitialStackSize = 64 * 1024;
handler_thread_ = CreateThread(NULL, // lpThreadAttributes
kExceptionHandlerThreadInitialStackSize,
ExceptionHandlerThreadMain,
@@ -353,6 +348,7 @@ ExceptionHandler::~ExceptionHandler() {
// inside DllMain.
is_shutdown_ = true;
ReleaseSemaphore(handler_start_semaphore_, 1, NULL);
+ const int kWaitForHandlerThreadMs = 60000;
WaitForSingleObject(handler_thread_, kWaitForHandlerThreadMs);
#else
TerminateThread(handler_thread_, 1);
@@ -781,6 +777,8 @@ bool ExceptionHandler::WriteMinidumpForChild(HANDLE child,
EXCEPTION_RECORD ex;
CONTEXT ctx;
EXCEPTION_POINTERS exinfo = { NULL, NULL };
+ // As documented on MSDN, on failure SuspendThread returns (DWORD) -1
+ const DWORD kFailedToSuspendThread = static_cast<DWORD>(-1);
DWORD last_suspend_count = kFailedToSuspendThread;
HANDLE child_thread_handle = OpenThread(THREAD_GET_CONTEXT |
THREAD_QUERY_INFORMATION |