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

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: comment 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
« no previous file with comments | « snapshot/win/memory_snapshot_win.h ('k') | snapshot/win/process_reader_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 69%
copy from snapshot/mac/memory_snapshot_mac.cc
copy to snapshot/win/memory_snapshot_win.cc
index b0cce244a385366ee6b1ba3574b2fbd79e32b950..1861a885324dab10a6a637c22152d31744080e59 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,32 @@ 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;
+ DLOG_IF(WARNING, size >= std::numeric_limits<size_t>::max())
+ << "size overflow";
+ size_ = static_cast<size_t>(size);
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 +60,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_);
« no previous file with comments | « snapshot/win/memory_snapshot_win.h ('k') | snapshot/win/process_reader_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698