Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(613)

Unified Diff: snapshot/win/memory_snapshot_win.cc

Issue 1131473005: win: Add thread snapshot and memory snapshot for stacks (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: . Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: snapshot/win/memory_snapshot_win.cc
diff --git a/snapshot/mac/memory_snapshot_mac.cc b/snapshot/win/memory_snapshot_win.cc
similarity index 73%
copy from snapshot/mac/memory_snapshot_mac.cc
copy to snapshot/win/memory_snapshot_win.cc
index b0cce244a385366ee6b1ba3574b2fbd79e32b950..84ca3994879fec50b5ee32c36a30294420ae7ef1 100644
--- a/snapshot/mac/memory_snapshot_mac.cc
+++ b/snapshot/win/memory_snapshot_win.cc
@@ -1,4 +1,4 @@
-// Copyright 2014 The Crashpad Authors. All rights reserved.
+// Copyright 2015 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -12,14 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "snapshot/mac/memory_snapshot_mac.h"
+#include "snapshot/win/memory_snapshot_win.h"
-#include "util/mach/task_memory.h"
+#include "base/memory/scoped_ptr.h"
namespace crashpad {
namespace internal {
-MemorySnapshotMac::MemorySnapshotMac()
+MemorySnapshotWin::MemorySnapshotWin()
: MemorySnapshot(),
process_reader_(nullptr),
address_(0),
@@ -27,30 +27,30 @@ MemorySnapshotMac::MemorySnapshotMac()
initialized_() {
}
-MemorySnapshotMac::~MemorySnapshotMac() {
+MemorySnapshotWin::~MemorySnapshotWin() {
}
-void MemorySnapshotMac::Initialize(ProcessReader* process_reader,
+void MemorySnapshotWin::Initialize(ProcessReaderWin* process_reader,
uint64_t address,
uint64_t size) {
INITIALIZATION_STATE_SET_INITIALIZING(initialized_);
process_reader_ = process_reader;
address_ = address;
- size_ = size;
+ size_ = static_cast<size_t>(size);
Mark Mentovai 2015/05/08 16:54:19 Oh, I see. Can you DLOG_IF size can’t fit into siz
scottmg 2015/05/08 18:24:01 Done.
INITIALIZATION_STATE_SET_VALID(initialized_);
}
-uint64_t MemorySnapshotMac::Address() const {
+uint64_t MemorySnapshotWin::Address() const {
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
return address_;
}
-size_t MemorySnapshotMac::Size() const {
+size_t MemorySnapshotWin::Size() const {
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
return size_;
}
-bool MemorySnapshotMac::Read(Delegate* delegate) const {
+bool MemorySnapshotWin::Read(Delegate* delegate) const {
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
if (size_ == 0) {
@@ -58,7 +58,7 @@ bool MemorySnapshotMac::Read(Delegate* delegate) const {
}
scoped_ptr<uint8_t[]> buffer(new uint8_t[size_]);
- if (!process_reader_->Memory()->Read(address_, size_, buffer.get())) {
+ if (!process_reader_->ReadMemory(address_, size_, buffer.get())) {
return false;
}
return delegate->MemorySnapshotDelegateRead(buffer.get(), size_);

Powered by Google App Engine
This is Rietveld 408576698