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