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

Unified Diff: minidump/minidump_memory_writer.h

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_file_writer_test.cc ('k') | minidump/minidump_memory_writer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: minidump/minidump_memory_writer.h
diff --git a/minidump/minidump_memory_writer.h b/minidump/minidump_memory_writer.h
index 24625e218ddc6f8a23e125fff1c2383690a73ea5..369fafd90b27fd7f374bc6e6361c7512fec7ba1b 100644
--- a/minidump/minidump_memory_writer.h
+++ b/minidump/minidump_memory_writer.h
@@ -22,8 +22,10 @@
#include <vector>
#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
#include "minidump/minidump_stream_writer.h"
#include "minidump/minidump_writable.h"
+#include "util/stdlib/pointer_container.h"
namespace crashpad {
@@ -37,6 +39,8 @@ namespace crashpad {
//! to be held in memory simultaneously while a minidump file is being written.
class MinidumpMemoryWriter : public internal::MinidumpWritable {
public:
+ ~MinidumpMemoryWriter() override;
+
//! \brief Returns a MINIDUMP_MEMORY_DESCRIPTOR referencing the data that this
//! object writes.
//!
@@ -60,7 +64,6 @@ class MinidumpMemoryWriter : public internal::MinidumpWritable {
protected:
MinidumpMemoryWriter();
- ~MinidumpMemoryWriter() {}
//! \brief Returns the base address of the memory region in the address space
//! of the process that the snapshot describes.
@@ -116,15 +119,15 @@ class MinidumpMemoryWriter : public internal::MinidumpWritable {
class MinidumpMemoryListWriter final : public internal::MinidumpStreamWriter {
public:
MinidumpMemoryListWriter();
- ~MinidumpMemoryListWriter();
+ ~MinidumpMemoryListWriter() override;
//! \brief Adds a MinidumpMemoryWriter to the MINIDUMP_MEMORY_LIST.
//!
- //! \a memory_writer will become a child of this object in the overall tree of
- //! internal::MinidumpWritable objects.
+ //! This object takes ownership of \a memory_writer and becomes its parent in
+ //! the overall tree of internal::MinidumpWritable objects.
//!
//! \note Valid in #kStateMutable.
- void AddMemory(MinidumpMemoryWriter* memory_writer);
+ void AddMemory(scoped_ptr<MinidumpMemoryWriter> memory_writer);
//! \brief Adds a MinidumpMemoryWriter that’s a child of another
//! internal::MinidumpWritable object to the MINIDUMP_MEMORY_LIST.
@@ -155,7 +158,7 @@ class MinidumpMemoryListWriter final : public internal::MinidumpStreamWriter {
private:
MINIDUMP_MEMORY_LIST memory_list_base_;
std::vector<MinidumpMemoryWriter*> memory_writers_; // weak
- std::vector<MinidumpWritable*> children_; // weak
+ PointerVector<MinidumpMemoryWriter> children_;
DISALLOW_COPY_AND_ASSIGN(MinidumpMemoryListWriter);
};
« no previous file with comments | « minidump/minidump_file_writer_test.cc ('k') | minidump/minidump_memory_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698