Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(78)

Side by Side Diff: src/client/windows/handler/exception_handler.cc

Issue 601002: Fixing level 4 warnings (Closed) Base URL: http://google-breakpad.googlecode.com/svn/trunk/
Patch Set: Created 11 years, 10 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2006, Google Inc. 1 // Copyright (c) 2006, Google Inc.
2 // All rights reserved. 2 // All rights reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // * Redistributions of source code must retain the above copyright 8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer. 9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above 10 // * Redistributions in binary form must reproduce the above
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 Initialize(dump_path, 89 Initialize(dump_path,
90 filter, 90 filter,
91 callback, 91 callback,
92 callback_context, 92 callback_context,
93 handler_types, 93 handler_types,
94 dump_type, 94 dump_type,
95 NULL, // pipe_name 95 NULL, // pipe_name
96 pipe_handle, 96 pipe_handle,
97 NULL, // crash_generation_client 97 NULL, // crash_generation_client
98 custom_info); 98 custom_info);
99 } 99 }
100 100
101 ExceptionHandler::ExceptionHandler( 101 ExceptionHandler::ExceptionHandler(
102 const wstring& dump_path, 102 const wstring& dump_path,
103 FilterCallback filter, 103 FilterCallback filter,
104 MinidumpCallback callback, 104 MinidumpCallback callback,
105 void* callback_context, 105 void* callback_context,
106 int handler_types, 106 int handler_types,
107 MINIDUMP_TYPE dump_type, 107 CrashGenerationClient* crash_generation_client) {
108 CrashGenerationClient* crash_generation_client, 108 // The dump_type, pipe_name and custom_info that are passed in to Initialize()
109 const CustomClientInfo* custom_info) { 109 // are not used. The ones set in crash_generation_client are used instead.
110 Initialize(dump_path, 110 Initialize(dump_path,
111 filter, 111 filter,
112 callback, 112 callback,
113 callback_context, 113 callback_context,
114 handler_types, 114 handler_types,
115 MiniDumpNormal, 115 MiniDumpNormal, // dump_type - not used
116 NULL, // pipe_name 116 NULL, // pipe_name - not used
117 NULL, // pipe_handle 117 NULL, // pipe_handle
118 crash_generation_client, 118 crash_generation_client,
119 custom_info); 119 NULL); // custom_info - not used
120 } 120 }
121 121
122 ExceptionHandler::ExceptionHandler(const wstring &dump_path, 122 ExceptionHandler::ExceptionHandler(const wstring &dump_path,
123 FilterCallback filter, 123 FilterCallback filter,
124 MinidumpCallback callback, 124 MinidumpCallback callback,
125 void* callback_context, 125 void* callback_context,
126 int handler_types) { 126 int handler_types) {
127 Initialize(dump_path, 127 Initialize(dump_path,
128 filter, 128 filter,
129 callback, 129 callback,
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 return crash_generation_client_->RequestUpload(crash_id); 379 return crash_generation_client_->RequestUpload(crash_id);
380 } 380 }
381 381
382 // static 382 // static
383 DWORD ExceptionHandler::ExceptionHandlerThreadMain(void* lpParameter) { 383 DWORD ExceptionHandler::ExceptionHandlerThreadMain(void* lpParameter) {
384 ExceptionHandler* self = reinterpret_cast<ExceptionHandler *>(lpParameter); 384 ExceptionHandler* self = reinterpret_cast<ExceptionHandler *>(lpParameter);
385 assert(self); 385 assert(self);
386 assert(self->handler_start_semaphore_ != NULL); 386 assert(self->handler_start_semaphore_ != NULL);
387 assert(self->handler_finish_semaphore_ != NULL); 387 assert(self->handler_finish_semaphore_ != NULL);
388 388
389 while (true) { 389 for (;;) {
Mark Mentovai 2013/05/30 19:06:44 Leave this as while (true).
Ivan Penkov 2013/05/30 22:40:54 Bummer. I did fix those, but I did the change thr
390 if (WaitForSingleObject(self->handler_start_semaphore_, INFINITE) == 390 if (WaitForSingleObject(self->handler_start_semaphore_, INFINITE) ==
391 WAIT_OBJECT_0) { 391 WAIT_OBJECT_0) {
392 // Perform the requested action. 392 // Perform the requested action.
393 if (self->is_shutdown_) { 393 if (self->is_shutdown_) {
394 // The instance of the exception handler is being destroyed. 394 // The instance of the exception handler is being destroyed.
395 break; 395 break;
396 } else { 396 } else {
397 self->handler_return_value_ = 397 self->handler_return_value_ =
398 self->WriteMinidumpWithException(self->requesting_thread_id_, 398 self->WriteMinidumpWithException(self->requesting_thread_id_,
399 self->exception_info_, 399 self->exception_info_,
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
868 reinterpret_cast<MinidumpCallbackContext*>(context); 868 reinterpret_cast<MinidumpCallbackContext*>(context);
869 if (callback_context->iter == callback_context->end) 869 if (callback_context->iter == callback_context->end)
870 return FALSE; 870 return FALSE;
871 871
872 // Include the specified memory region. 872 // Include the specified memory region.
873 callback_output->MemoryBase = callback_context->iter->ptr; 873 callback_output->MemoryBase = callback_context->iter->ptr;
874 callback_output->MemorySize = callback_context->iter->length; 874 callback_output->MemorySize = callback_context->iter->length;
875 callback_context->iter++; 875 callback_context->iter++;
876 return TRUE; 876 return TRUE;
877 } 877 }
878 878
879 // Include all modules. 879 // Include all modules.
880 case IncludeModuleCallback: 880 case IncludeModuleCallback:
881 case ModuleCallback: 881 case ModuleCallback:
882 return TRUE; 882 return TRUE;
883 883
884 // Include all threads. 884 // Include all threads.
885 case IncludeThreadCallback: 885 case IncludeThreadCallback:
886 case ThreadCallback: 886 case ThreadCallback:
887 return TRUE; 887 return TRUE;
888 888
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
1058 1058
1059 void ExceptionHandler::UnregisterAppMemory(void* ptr) { 1059 void ExceptionHandler::UnregisterAppMemory(void* ptr) {
1060 AppMemoryList::iterator iter = 1060 AppMemoryList::iterator iter =
1061 std::find(app_memory_info_.begin(), app_memory_info_.end(), ptr); 1061 std::find(app_memory_info_.begin(), app_memory_info_.end(), ptr);
1062 if (iter != app_memory_info_.end()) { 1062 if (iter != app_memory_info_.end()) {
1063 app_memory_info_.erase(iter); 1063 app_memory_info_.erase(iter);
1064 } 1064 }
1065 } 1065 }
1066 1066
1067 } // namespace google_breakpad 1067 } // namespace google_breakpad
OLDNEW

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 1004:630ec63f810e-tainted