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

Unified Diff: minidump/minidump_memory_writer.cc

Issue 674153002: minidump: Change the ownership model (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Address review feedback Created 6 years, 2 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 | « minidump/minidump_memory_writer.h ('k') | minidump/minidump_memory_writer_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: minidump/minidump_memory_writer.cc
diff --git a/minidump/minidump_memory_writer.cc b/minidump/minidump_memory_writer.cc
index 536cd1486597e564c0e20d245538ca56c87c70f7..d79ca7b2acfe58f765d945fee904dce53c05360c 100644
--- a/minidump/minidump_memory_writer.cc
+++ b/minidump/minidump_memory_writer.cc
@@ -20,6 +20,9 @@
namespace crashpad {
+MinidumpMemoryWriter::~MinidumpMemoryWriter() {
+}
+
const MINIDUMP_MEMORY_DESCRIPTOR*
MinidumpMemoryWriter::MinidumpMemoryDescriptor() const {
DCHECK_EQ(state(), kStateWritable);
@@ -106,11 +109,12 @@ MinidumpMemoryListWriter::MinidumpMemoryListWriter()
MinidumpMemoryListWriter::~MinidumpMemoryListWriter() {
}
-void MinidumpMemoryListWriter::AddMemory(MinidumpMemoryWriter* memory_writer) {
+void MinidumpMemoryListWriter::AddMemory(
+ scoped_ptr<MinidumpMemoryWriter> memory_writer) {
DCHECK_EQ(state(), kStateMutable);
- children_.push_back(memory_writer);
- AddExtraMemory(memory_writer);
+ AddExtraMemory(memory_writer.get());
+ children_.push_back(memory_writer.release());
}
void MinidumpMemoryListWriter::AddExtraMemory(
@@ -152,7 +156,12 @@ std::vector<internal::MinidumpWritable*> MinidumpMemoryListWriter::Children() {
DCHECK_GE(state(), kStateFrozen);
DCHECK_LE(children_.size(), memory_writers_.size());
- return children_;
+ std::vector<MinidumpWritable*> children;
+ for (MinidumpMemoryWriter* child : children_) {
+ children.push_back(child);
+ }
+
+ return children;
}
bool MinidumpMemoryListWriter::WriteObject(FileWriterInterface* file_writer) {
« no previous file with comments | « minidump/minidump_memory_writer.h ('k') | minidump/minidump_memory_writer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698