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

Unified Diff: minidump/minidump_module_crashpad_info_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_misc_info_writer_test.cc ('k') | minidump/minidump_module_crashpad_info_writer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: minidump/minidump_module_crashpad_info_writer.h
diff --git a/minidump/minidump_module_crashpad_info_writer.h b/minidump/minidump_module_crashpad_info_writer.h
index 7c84fa0cd3b9fab182b9d5c8aae499c2cfee58cb..1292917080149d1d9425bfd0f9cabc706f87d38a 100644
--- a/minidump/minidump_module_crashpad_info_writer.h
+++ b/minidump/minidump_module_crashpad_info_writer.h
@@ -20,8 +20,10 @@
#include <vector>
#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
#include "minidump/minidump_extensions.h"
#include "minidump/minidump_writable.h"
+#include "util/stdlib/pointer_container.h"
namespace crashpad {
@@ -33,7 +35,7 @@ class MinidumpModuleCrashpadInfoWriter final
: public internal::MinidumpWritable {
public:
MinidumpModuleCrashpadInfoWriter();
- ~MinidumpModuleCrashpadInfoWriter();
+ ~MinidumpModuleCrashpadInfoWriter() override;
//! \brief Sets MinidumpModuleCrashpadInfo::minidump_module_list_index.
void SetMinidumpModuleListIndex(uint32_t minidump_module_list_index) {
@@ -44,12 +46,12 @@ class MinidumpModuleCrashpadInfoWriter final
//! point to the MinidumpSimpleStringDictionaryWriter object to be written
//! by \a simple_annotations.
//!
- //! \a simple_annotations will become a child of this object in the overall
- //! tree of internal::MinidumpWritable objects.
+ //! This object takes ownership of \a simple_annotations and becomes its
+ //! parent in the overall tree of internal::MinidumpWritable objects.
//!
//! \note Valid in #kStateMutable.
void SetSimpleAnnotations(
- MinidumpSimpleStringDictionaryWriter* simple_annotations);
+ scoped_ptr<MinidumpSimpleStringDictionaryWriter> simple_annotations);
protected:
// MinidumpWritable:
@@ -60,7 +62,7 @@ class MinidumpModuleCrashpadInfoWriter final
private:
MinidumpModuleCrashpadInfo module_;
- MinidumpSimpleStringDictionaryWriter* simple_annotations_; // weak
+ scoped_ptr<MinidumpSimpleStringDictionaryWriter> simple_annotations_;
DISALLOW_COPY_AND_ASSIGN(MinidumpModuleCrashpadInfoWriter);
};
@@ -71,16 +73,16 @@ class MinidumpModuleCrashpadInfoListWriter final
: public internal::MinidumpWritable {
public:
MinidumpModuleCrashpadInfoListWriter();
- ~MinidumpModuleCrashpadInfoListWriter();
+ ~MinidumpModuleCrashpadInfoListWriter() override;
//! \brief Adds a MinidumpModuleCrashpadInfo to the
//! MinidumpModuleCrashpadInfoList.
//!
- //! \a module will become a child of this object in the overall tree of
- //! internal::MinidumpWritable objects.
+ //! This object takes ownership of \a module and becomes its parent in the
+ //! overall tree of internal::MinidumpWritable objects.
//!
//! \note Valid in #kStateMutable.
- void AddModule(MinidumpModuleCrashpadInfoWriter* module);
+ void AddModule(scoped_ptr<MinidumpModuleCrashpadInfoWriter> module);
protected:
// MinidumpWritable:
@@ -91,7 +93,7 @@ class MinidumpModuleCrashpadInfoListWriter final
private:
MinidumpModuleCrashpadInfoList module_list_base_;
- std::vector<MinidumpModuleCrashpadInfoWriter*> modules_; // weak
+ PointerVector<MinidumpModuleCrashpadInfoWriter> modules_;
std::vector<MINIDUMP_LOCATION_DESCRIPTOR> module_location_descriptors_;
DISALLOW_COPY_AND_ASSIGN(MinidumpModuleCrashpadInfoListWriter);
« no previous file with comments | « minidump/minidump_misc_info_writer_test.cc ('k') | minidump/minidump_module_crashpad_info_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698