| 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, |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 } | 195 } |
| 196 | 196 |
| 197 std::vector<const MemoryMapRegionSnapshot*> ProcessSnapshotWin::MemoryMap() | 197 std::vector<const MemoryMapRegionSnapshot*> ProcessSnapshotWin::MemoryMap() |
| 198 const { | 198 const { |
| 199 std::vector<const MemoryMapRegionSnapshot*> memory_map; | 199 std::vector<const MemoryMapRegionSnapshot*> memory_map; |
| 200 for (const auto& item : memory_map_) | 200 for (const auto& item : memory_map_) |
| 201 memory_map.push_back(item); | 201 memory_map.push_back(item); |
| 202 return memory_map; | 202 return memory_map; |
| 203 } | 203 } |
| 204 | 204 |
| 205 std::vector<HandleSnapshot> ProcessSnapshotWin::Handles() const { |
| 206 std::vector<HandleSnapshot> result; |
| 207 for (const auto& handle : process_reader_.GetProcessInfo().Handles()) { |
| 208 HandleSnapshot snapshot; |
| 209 snapshot.type_name = handle.type_name; |
| 210 snapshot.handle = handle.handle; |
| 211 snapshot.attributes = handle.attributes; |
| 212 snapshot.granted_access = handle.granted_access; |
| 213 snapshot.pointer_count = handle.pointer_count; |
| 214 snapshot.handle_count = handle.handle_count; |
| 215 result.push_back(snapshot); |
| 216 } |
| 217 return result; |
| 218 } |
| 219 |
| 205 std::vector<const MemorySnapshot*> ProcessSnapshotWin::ExtraMemory() const { | 220 std::vector<const MemorySnapshot*> ProcessSnapshotWin::ExtraMemory() const { |
| 206 INITIALIZATION_STATE_DCHECK_VALID(initialized_); | 221 INITIALIZATION_STATE_DCHECK_VALID(initialized_); |
| 207 std::vector<const MemorySnapshot*> extra_memory; | 222 std::vector<const MemorySnapshot*> extra_memory; |
| 208 for (const auto& peb_memory : peb_memory_) | 223 for (const auto& peb_memory : peb_memory_) |
| 209 extra_memory.push_back(peb_memory); | 224 extra_memory.push_back(peb_memory); |
| 210 return extra_memory; | 225 return extra_memory; |
| 211 } | 226 } |
| 212 | 227 |
| 213 void ProcessSnapshotWin::InitializeThreads() { | 228 void ProcessSnapshotWin::InitializeThreads() { |
| 214 const std::vector<ProcessReaderWin::Thread>& process_reader_threads = | 229 const std::vector<ProcessReaderWin::Thread>& process_reader_threads = |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 static_cast<unsigned int>(bytes_read / sizeof(env_block[0]))); | 408 static_cast<unsigned int>(bytes_read / sizeof(env_block[0]))); |
| 394 const wchar_t terminator[] = { 0, 0 }; | 409 const wchar_t terminator[] = { 0, 0 }; |
| 395 size_t at = env_block.find(std::wstring(terminator, arraysize(terminator))); | 410 size_t at = env_block.find(std::wstring(terminator, arraysize(terminator))); |
| 396 if (at != std::wstring::npos) | 411 if (at != std::wstring::npos) |
| 397 env_block.resize(at + arraysize(terminator)); | 412 env_block.resize(at + arraysize(terminator)); |
| 398 | 413 |
| 399 return env_block.size() * sizeof(env_block[0]); | 414 return env_block.size() * sizeof(env_block[0]); |
| 400 } | 415 } |
| 401 | 416 |
| 402 } // namespace crashpad | 417 } // namespace crashpad |
| OLD | NEW |