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

Unified Diff: minidump/minidump_thread_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_thread_writer.h ('k') | minidump/minidump_thread_writer_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: minidump/minidump_thread_writer.cc
diff --git a/minidump/minidump_thread_writer.cc b/minidump/minidump_thread_writer.cc
index 1dc3bc2812844668de1a370fed1c7b4d1030a7c3..efca1bda3e49512b36f7b772784b59de8ae3ac5b 100644
--- a/minidump/minidump_thread_writer.cc
+++ b/minidump/minidump_thread_writer.cc
@@ -28,22 +28,26 @@ MinidumpThreadWriter::MinidumpThreadWriter()
: MinidumpWritable(), thread_(), stack_(nullptr), context_(nullptr) {
}
+MinidumpThreadWriter::~MinidumpThreadWriter() {
+}
+
const MINIDUMP_THREAD* MinidumpThreadWriter::MinidumpThread() const {
DCHECK_EQ(state(), kStateWritable);
return &thread_;
}
-void MinidumpThreadWriter::SetStack(MinidumpMemoryWriter* stack) {
+void MinidumpThreadWriter::SetStack(scoped_ptr<MinidumpMemoryWriter> stack) {
DCHECK_EQ(state(), kStateMutable);
- stack_ = stack;
+ stack_ = stack.Pass();
}
-void MinidumpThreadWriter::SetContext(MinidumpContextWriter* context) {
+void MinidumpThreadWriter::SetContext(
+ scoped_ptr<MinidumpContextWriter> context) {
DCHECK_EQ(state(), kStateMutable);
- context_ = context;
+ context_ = context.Pass();
}
bool MinidumpThreadWriter::Freeze() {
@@ -78,9 +82,9 @@ std::vector<internal::MinidumpWritable*> MinidumpThreadWriter::Children() {
std::vector<MinidumpWritable*> children;
if (stack_) {
- children.push_back(stack_);
+ children.push_back(stack_.get());
}
- children.push_back(context_);
+ children.push_back(context_.get());
return children;
}
@@ -112,17 +116,18 @@ void MinidumpThreadListWriter::SetMemoryListWriter(
memory_list_writer_ = memory_list_writer;
}
-void MinidumpThreadListWriter::AddThread(MinidumpThreadWriter* thread) {
+void MinidumpThreadListWriter::AddThread(
+ scoped_ptr<MinidumpThreadWriter> thread) {
DCHECK_EQ(state(), kStateMutable);
- threads_.push_back(thread);
-
if (memory_list_writer_) {
MinidumpMemoryWriter* stack = thread->Stack();
if (stack) {
memory_list_writer_->AddExtraMemory(stack);
}
}
+
+ threads_.push_back(thread.release());
}
bool MinidumpThreadListWriter::Freeze() {
« no previous file with comments | « minidump/minidump_thread_writer.h ('k') | minidump/minidump_thread_writer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698