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

Unified Diff: minidump/minidump_exception_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_crashpad_info_writer_test.cc ('k') | minidump/minidump_exception_writer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: minidump/minidump_exception_writer.h
diff --git a/minidump/minidump_exception_writer.h b/minidump/minidump_exception_writer.h
index b76b1ff11e66267717a329a3b0e14aa5961d99da..33e877c59dc681e5445923fc1ccd215a8ec6c5f4 100644
--- a/minidump/minidump_exception_writer.h
+++ b/minidump/minidump_exception_writer.h
@@ -21,6 +21,7 @@
#include <vector>
#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
#include "minidump/minidump_stream_writer.h"
namespace crashpad {
@@ -31,18 +32,18 @@ class MinidumpContextWriter;
class MinidumpExceptionWriter final : public internal::MinidumpStreamWriter {
public:
MinidumpExceptionWriter();
- ~MinidumpExceptionWriter() {}
+ ~MinidumpExceptionWriter() override;
//! \brief Arranges for MINIDUMP_EXCEPTION_STREAM::ThreadContext to point to
//! the CPU context to be written by \a context.
//!
//! A context is required in all MINIDUMP_EXCEPTION_STREAM objects.
//!
- //! \a context will become a child of this object in the overall tree of
- //! internal::MinidumpWritable objects.
+ //! This object takes ownership of \a context and becomes its parent in the
+ //! overall tree of internal::MinidumpWritable objects.
//!
//! \note Valid in #kStateMutable.
- void SetContext(MinidumpContextWriter* context);
+ void SetContext(scoped_ptr<MinidumpContextWriter> context);
//! \brief Sets MINIDUMP_EXCEPTION_STREAM::ThreadId.
void SetThreadID(uint32_t thread_id) { exception_.ThreadId = thread_id; }
@@ -95,7 +96,7 @@ class MinidumpExceptionWriter final : public internal::MinidumpStreamWriter {
private:
MINIDUMP_EXCEPTION_STREAM exception_;
- MinidumpContextWriter* context_; // weak
+ scoped_ptr<MinidumpContextWriter> context_;
DISALLOW_COPY_AND_ASSIGN(MinidumpExceptionWriter);
};
« no previous file with comments | « minidump/minidump_crashpad_info_writer_test.cc ('k') | minidump/minidump_exception_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698