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, |
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 // See the License for the specific language governing permissions and | 12 // See the License for the specific language governing permissions and |
13 // limitations under the License. | 13 // limitations under the License. |
14 | 14 |
15 #include "util/win/exception_handler_server.h" | 15 #include "util/win/exception_handler_server.h" |
16 | 16 |
17 #include <sddl.h> | 17 #include <sddl.h> |
18 #include <string.h> | 18 #include <string.h> |
19 | 19 |
20 #include "base/logging.h" | 20 #include "base/logging.h" |
21 #include "base/numerics/safe_conversions.h" | 21 #include "base/numerics/safe_conversions.h" |
22 #include "base/rand_util.h" | 22 #include "base/rand_util.h" |
23 #include "base/strings/stringprintf.h" | 23 #include "base/strings/stringprintf.h" |
24 #include "base/strings/utf_string_conversions.h" | 24 #include "base/strings/utf_string_conversions.h" |
25 #include "minidump/minidump_file_writer.h" | 25 #include "minidump/minidump_file_writer.h" |
26 #include "snapshot/crashpad_info_client_options.h" | 26 #include "snapshot/crashpad_info_client_options.h" |
27 #include "snapshot/win/process_snapshot_win.h" | 27 #include "snapshot/win/process_snapshot_win.h" |
28 #include "util/file/file_writer.h" | 28 #include "util/file/file_writer.h" |
| 29 #include "util/stdlib/move.h" |
29 #include "util/misc/random_string.h" | 30 #include "util/misc/random_string.h" |
30 #include "util/misc/tri_state.h" | 31 #include "util/misc/tri_state.h" |
31 #include "util/misc/uuid.h" | 32 #include "util/misc/uuid.h" |
32 #include "util/win/get_function.h" | 33 #include "util/win/get_function.h" |
33 #include "util/win/handle.h" | 34 #include "util/win/handle.h" |
34 #include "util/win/registration_protocol_win.h" | 35 #include "util/win/registration_protocol_win.h" |
35 #include "util/win/scoped_local_alloc.h" | 36 #include "util/win/scoped_local_alloc.h" |
36 #include "util/win/xp_compat.h" | 37 #include "util/win/xp_compat.h" |
37 | 38 |
38 namespace crashpad { | 39 namespace crashpad { |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 process_end_thread_pool_wait_(INVALID_HANDLE_VALUE), | 173 process_end_thread_pool_wait_(INVALID_HANDLE_VALUE), |
173 lock_(), | 174 lock_(), |
174 port_(port), | 175 port_(port), |
175 delegate_(delegate), | 176 delegate_(delegate), |
176 crash_dump_requested_event_( | 177 crash_dump_requested_event_( |
177 CreateEvent(nullptr, false /* auto reset */, false, nullptr)), | 178 CreateEvent(nullptr, false /* auto reset */, false, nullptr)), |
178 non_crash_dump_requested_event_( | 179 non_crash_dump_requested_event_( |
179 CreateEvent(nullptr, false /* auto reset */, false, nullptr)), | 180 CreateEvent(nullptr, false /* auto reset */, false, nullptr)), |
180 non_crash_dump_completed_event_( | 181 non_crash_dump_completed_event_( |
181 CreateEvent(nullptr, false /* auto reset */, false, nullptr)), | 182 CreateEvent(nullptr, false /* auto reset */, false, nullptr)), |
182 process_(process.Pass()), | 183 process_(crashpad::move(process)), |
183 crash_exception_information_address_( | 184 crash_exception_information_address_( |
184 crash_exception_information_address), | 185 crash_exception_information_address), |
185 non_crash_exception_information_address_( | 186 non_crash_exception_information_address_( |
186 non_crash_exception_information_address), | 187 non_crash_exception_information_address), |
187 debug_critical_section_address_(debug_critical_section_address) { | 188 debug_critical_section_address_(debug_critical_section_address) { |
188 RegisterThreadPoolWaits(crash_dump_request_callback, | 189 RegisterThreadPoolWaits(crash_dump_request_callback, |
189 non_crash_dump_request_callback, | 190 non_crash_dump_request_callback, |
190 process_end_callback); | 191 process_end_callback); |
191 } | 192 } |
192 | 193 |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 void __stdcall ExceptionHandlerServer::OnProcessEnd(void* ctx, BOOLEAN) { | 593 void __stdcall ExceptionHandlerServer::OnProcessEnd(void* ctx, BOOLEAN) { |
593 // This function is executed on the thread pool. | 594 // This function is executed on the thread pool. |
594 internal::ClientData* client = reinterpret_cast<internal::ClientData*>(ctx); | 595 internal::ClientData* client = reinterpret_cast<internal::ClientData*>(ctx); |
595 base::AutoLock lock(*client->lock()); | 596 base::AutoLock lock(*client->lock()); |
596 | 597 |
597 // Post back to the main thread to have it delete this client record. | 598 // Post back to the main thread to have it delete this client record. |
598 PostQueuedCompletionStatus(client->port(), 0, ULONG_PTR(client), nullptr); | 599 PostQueuedCompletionStatus(client->port(), 0, ULONG_PTR(client), nullptr); |
599 } | 600 } |
600 | 601 |
601 } // namespace crashpad | 602 } // namespace crashpad |
OLD | NEW |