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

Unified Diff: minidump/minidump_memory_writer.h

Issue 641603006: Add MinidumpMemoryListWriter::AddFromSnapshot(), everything downstream and its test (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Correctly look for the last memory range at EOF 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 | « no previous file | 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 369fafd90b27fd7f374bc6e6361c7512fec7ba1b..9cc4a060dccada0e237c256cae0691b681a1b0b9 100644
--- a/minidump/minidump_memory_writer.h
+++ b/minidump/minidump_memory_writer.h
@@ -29,6 +29,8 @@
namespace crashpad {
+class MemorySnapshot;
+
//! \brief The base class for writers of memory ranges pointed to by
//! MINIDUMP_MEMORY_DESCRIPTOR objects in a minidump file.
//!
@@ -41,6 +43,16 @@ class MinidumpMemoryWriter : public internal::MinidumpWritable {
public:
~MinidumpMemoryWriter() override;
+ //! \brief Creates a concrete initialized MinidumpMemoryWriter based on \a
+ //! memory_snapshot.
+ //!
+ //! \param[in] memory_snapshot The memory snapshot to use as source data.
+ //!
+ //! \return An object of a MinidumpMemoryWriter subclass initialized using the
+ //! source data in \a memory_snapshot.
+ static scoped_ptr<MinidumpMemoryWriter> CreateFromSnapshot(
+ const MemorySnapshot* memory_snapshot);
+
//! \brief Returns a MINIDUMP_MEMORY_DESCRIPTOR referencing the data that this
//! object writes.
//!
@@ -121,6 +133,17 @@ class MinidumpMemoryListWriter final : public internal::MinidumpStreamWriter {
MinidumpMemoryListWriter();
~MinidumpMemoryListWriter() override;
+ //! \brief Adds a concrete initialized MinidumpMemoryWriter for each memory
+ //! snapshot in \a memory_snapshots to the MINIDUMP_MEMORY_LIST.
+ //!
+ //! Memory snapshots are added in the fashion of AddMemory().
+ //!
+ //! \param[in] memory_snapshots The memory snapshots to use as source data.
+ //!
+ //! \note Valid in #kStateMutable.
+ void AddFromSnapshot(
+ const std::vector<const MemorySnapshot*>& memory_snapshots);
+
//! \brief Adds a MinidumpMemoryWriter to the MINIDUMP_MEMORY_LIST.
//!
//! This object takes ownership of \a memory_writer and becomes its parent in
« no previous file with comments | « no previous file | minidump/minidump_memory_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698