Chromium Code Reviews| 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 "snapshot/win/process_snapshot_win.h" | 15 #include "snapshot/win/process_snapshot_win.h" |
| 16 | 16 |
| 17 #include <algorithm> | 17 #include <algorithm> |
| 18 | 18 |
| 19 #include "base/logging.h" | 19 #include "base/logging.h" |
| 20 #include "base/strings/stringprintf.h" | 20 #include "base/strings/stringprintf.h" |
| 21 #include "base/strings/utf_string_conversions.h" | |
| 21 #include "snapshot/win/memory_snapshot_win.h" | 22 #include "snapshot/win/memory_snapshot_win.h" |
| 22 #include "snapshot/win/module_snapshot_win.h" | 23 #include "snapshot/win/module_snapshot_win.h" |
| 23 #include "util/win/registration_protocol_win.h" | 24 #include "util/win/registration_protocol_win.h" |
| 24 #include "util/win/time.h" | 25 #include "util/win/time.h" |
| 25 | 26 |
| 26 namespace crashpad { | 27 namespace crashpad { |
| 27 | 28 |
| 28 ProcessSnapshotWin::ProcessSnapshotWin() | 29 ProcessSnapshotWin::ProcessSnapshotWin() |
| 29 : ProcessSnapshot(), | 30 : ProcessSnapshot(), |
| 30 system_(), | 31 system_(), |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 204 std::vector<const MemoryMapRegionSnapshot*> memory_map; | 205 std::vector<const MemoryMapRegionSnapshot*> memory_map; |
| 205 for (const auto& item : memory_map_) | 206 for (const auto& item : memory_map_) |
| 206 memory_map.push_back(item); | 207 memory_map.push_back(item); |
| 207 return memory_map; | 208 return memory_map; |
| 208 } | 209 } |
| 209 | 210 |
| 210 std::vector<HandleSnapshot> ProcessSnapshotWin::Handles() const { | 211 std::vector<HandleSnapshot> ProcessSnapshotWin::Handles() const { |
| 211 std::vector<HandleSnapshot> result; | 212 std::vector<HandleSnapshot> result; |
| 212 for (const auto& handle : process_reader_.GetProcessInfo().Handles()) { | 213 for (const auto& handle : process_reader_.GetProcessInfo().Handles()) { |
| 213 HandleSnapshot snapshot; | 214 HandleSnapshot snapshot; |
| 214 snapshot.type_name = handle.type_name; | 215 // This is probably not strictly correct, but these are not localized so we |
| 216 // expect them all to be in ASCII range anyway. This will need to be more | |
| 217 // carefully done if the object name is added. | |
|
Mark Mentovai
2015/10/21 18:31:28
As long as the only consumer is the minidump write
| |
| 218 snapshot.type_name = base::UTF16ToUTF8(handle.type_name); | |
| 215 snapshot.handle = handle.handle; | 219 snapshot.handle = handle.handle; |
| 216 snapshot.attributes = handle.attributes; | 220 snapshot.attributes = handle.attributes; |
| 217 snapshot.granted_access = handle.granted_access; | 221 snapshot.granted_access = handle.granted_access; |
| 218 snapshot.pointer_count = handle.pointer_count; | 222 snapshot.pointer_count = handle.pointer_count; |
| 219 snapshot.handle_count = handle.handle_count; | 223 snapshot.handle_count = handle.handle_count; |
| 220 result.push_back(snapshot); | 224 result.push_back(snapshot); |
| 221 } | 225 } |
| 222 return result; | 226 return result; |
| 223 } | 227 } |
| 224 | 228 |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 518 // ProcessLocksList.Flink. | 522 // ProcessLocksList.Flink. |
| 519 current_address = | 523 current_address = |
| 520 critical_section_debug.ProcessLocksList.Flink - | 524 critical_section_debug.ProcessLocksList.Flink - |
| 521 offsetof(process_types::RTL_CRITICAL_SECTION_DEBUG<Traits>, | 525 offsetof(process_types::RTL_CRITICAL_SECTION_DEBUG<Traits>, |
| 522 ProcessLocksList); | 526 ProcessLocksList); |
| 523 } while (current_address != start_address_forward && | 527 } while (current_address != start_address_forward && |
| 524 current_address != kInvalid); | 528 current_address != kInvalid); |
| 525 } | 529 } |
| 526 | 530 |
| 527 } // namespace crashpad | 531 } // namespace crashpad |
| OLD | NEW |