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

Unified Diff: minidump/minidump_simple_string_dictionary_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_module_writer_test.cc ('k') | minidump/minidump_simple_string_dictionary_writer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: minidump/minidump_simple_string_dictionary_writer.h
diff --git a/minidump/minidump_simple_string_dictionary_writer.h b/minidump/minidump_simple_string_dictionary_writer.h
index 8a6c31dba1e526f37b38aec426386e1996068cf4..17075fe1835fbf4da72512f8bb136eb9d32ac897 100644
--- a/minidump/minidump_simple_string_dictionary_writer.h
+++ b/minidump/minidump_simple_string_dictionary_writer.h
@@ -22,6 +22,7 @@
#include <vector>
#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
#include "minidump/minidump_extensions.h"
#include "minidump/minidump_string_writer.h"
#include "minidump/minidump_writable.h"
@@ -40,7 +41,7 @@ class MinidumpSimpleStringDictionaryEntryWriter final
: public internal::MinidumpWritable {
public:
MinidumpSimpleStringDictionaryEntryWriter();
- ~MinidumpSimpleStringDictionaryEntryWriter();
+ ~MinidumpSimpleStringDictionaryEntryWriter() override;
//! \brief Returns a MinidumpSimpleStringDictionaryEntry referencing this
//! object’s data.
@@ -88,20 +89,20 @@ class MinidumpSimpleStringDictionaryWriter final
: public internal::MinidumpWritable {
public:
MinidumpSimpleStringDictionaryWriter();
- ~MinidumpSimpleStringDictionaryWriter();
+ ~MinidumpSimpleStringDictionaryWriter() override;
//! \brief Adds a MinidumpSimpleStringDictionaryEntryWriter to the
//! MinidumpSimpleStringDictionary.
//!
- //! \a entry will become a child of this object in the overall tree of
- //! internal::MinidumpWritable objects.
+ //! This object takes ownership of \a entry and becomes its parent in the
+ //! overall tree of internal::MinidumpWritable objects.
//!
//! If the key contained in \a entry duplicates the key of an entry already
//! present in the MinidumpSimpleStringDictionary, the new \a entry will
//! replace the previous one.
//!
//! \note Valid in #kStateMutable.
- void AddEntry(MinidumpSimpleStringDictionaryEntryWriter* entry);
+ void AddEntry(scoped_ptr<MinidumpSimpleStringDictionaryEntryWriter> entry);
protected:
// MinidumpWritable:
@@ -113,8 +114,9 @@ class MinidumpSimpleStringDictionaryWriter final
private:
MinidumpSimpleStringDictionary simple_string_dictionary_base_;
- std::map<std::string, MinidumpSimpleStringDictionaryEntryWriter*>
- entries_; // weak
+
+ // This object owns the MinidumpSimpleStringDictionaryEntryWriter objects.
+ std::map<std::string, MinidumpSimpleStringDictionaryEntryWriter*> entries_;
DISALLOW_COPY_AND_ASSIGN(MinidumpSimpleStringDictionaryWriter);
};
« no previous file with comments | « minidump/minidump_module_writer_test.cc ('k') | minidump/minidump_simple_string_dictionary_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698