Chromium Code Reviews| Index: snapshot/win/memory_map_region_snapshot_win.cc |
| diff --git a/snapshot/minidump/minidump_string_reader.h b/snapshot/win/memory_map_region_snapshot_win.cc |
| similarity index 51% |
| copy from snapshot/minidump/minidump_string_reader.h |
| copy to snapshot/win/memory_map_region_snapshot_win.cc |
| index e5667ec242bc8f53d570179f4eddfeb2f8cb90f7..e0a45640281a7ff698b2f9aace7e4d4830b9b057 100644 |
| --- a/snapshot/minidump/minidump_string_reader.h |
| +++ b/snapshot/win/memory_map_region_snapshot_win.cc |
| @@ -12,29 +12,29 @@ |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| -#ifndef CRASHPAD_SNAPSHOT_MINIDUMP_MINIDUMP_STRING_READER_H_ |
| -#define CRASHPAD_SNAPSHOT_MINIDUMP_MINIDUMP_STRING_READER_H_ |
| - |
| -#include <windows.h> |
| -#include <dbghelp.h> |
| - |
| -#include <string> |
| - |
| -#include "util/file/file_reader.h" |
| +#include "snapshot/win/memory_map_region_snapshot_win.h" |
| namespace crashpad { |
| namespace internal { |
| -//! \brief Reads a MinidumpUTF8String from a minidump file at offset \a rva in |
| -//! \a file_reader, and returns it in \a string. |
| -//! |
| -//! \return `true` on success, with \a string set. `false` on failure, with a |
| -//! message logged. |
| -bool ReadMinidumpUTF8String(FileReaderInterface* file_reader, |
| - RVA rva, |
| - std::string* string); |
| +MemoryMapRegionSnapshotWin::MemoryMapRegionSnapshotWin( |
| + const MEMORY_BASIC_INFORMATION64& mbi) { |
| + memset(&memory_info_, 0, sizeof(memory_info_)); |
|
Mark Mentovai
2015/10/12 13:47:52
: memory_info_() instead of an explicit memset() t
scottmg
2015/10/13 19:33:31
Oops, I always feel like that's going to do nothin
|
| + memory_info_.BaseAddress = mbi.BaseAddress; |
| + memory_info_.AllocationBase = mbi.AllocationBase; |
| + memory_info_.AllocationProtect = mbi.AllocationProtect; |
| + memory_info_.RegionSize = mbi.RegionSize; |
| + memory_info_.State = mbi.State; |
| + memory_info_.Protect = mbi.Protect; |
| + memory_info_.Type = mbi.Type; |
| +} |
| + |
| +MemoryMapRegionSnapshotWin::~MemoryMapRegionSnapshotWin() { |
| +} |
| + |
| +MINIDUMP_MEMORY_INFO MemoryMapRegionSnapshotWin::AsMinidumpMemoryInfo() const { |
| + return memory_info_; |
| +} |
| } // namespace internal |
| } // namespace crashpad |
| - |
| -#endif // CRASHPAD_SNAPSHOT_MINIDUMP_MINIDUMP_STRING_READER_H_ |