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

Unified Diff: minidump/minidump_file_writer.h

Issue 703223003: Add MinidumpFileWriter::InitializeFromSnapshot() and its tests (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@minidump_crashpad_info_init_from_snapshot
Patch Set: Address review feedback Created 6 years, 1 month 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_exception_writer_test.cc ('k') | minidump/minidump_file_writer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: minidump/minidump_file_writer.h
diff --git a/minidump/minidump_file_writer.h b/minidump/minidump_file_writer.h
index 22b65fc44ea75cdf05fa143770e7eb71060981e6..ccaaa8868680da5cc9cea93c415b47efde1849fe 100644
--- a/minidump/minidump_file_writer.h
+++ b/minidump/minidump_file_writer.h
@@ -30,6 +30,8 @@
namespace crashpad {
+class ProcessSnapshot;
+
//! \brief The root-level object in a minidump file.
//!
//! This object writes a MINIDUMP_HEADER and list of MINIDUMP_DIRECTORY entries
@@ -39,6 +41,34 @@ class MinidumpFileWriter final : public internal::MinidumpWritable {
MinidumpFileWriter();
~MinidumpFileWriter() override;
+ //! \brief Initializes the MinidumpFileWriter and populates it with
+ //! appropriate child streams based on \a process_snapshot.
+ //!
+ //! This method will add additional streams to the minidump file as children
+ //! of the MinidumpFileWriter object and as pointees of the top-level
+ //! MINIDUMP_DIRECTORY. To do so, it will obtain other snapshot information
+ //! from \a process_snapshot, such as a SystemSnapshot, lists of
+ //! ThreadSnapshot and ModuleSnapshot objects, and, if available, an
+ //! ExceptionSnapshot.
+ //!
+ //! The streams are added in the order that they are expected to be most
+ //! useful to minidump readers, to improve data locality and minimize seeking.
+ //! The streams are added in this order:
+ //! - kMinidumpStreamTypeSystemInfo
+ //! - kMinidumpStreamTypeMiscInfo
+ //! - kMinidumpStreamTypeThreadList
+ //! - kMinidumpStreamTypeException (if present)
+ //! - kMinidumpStreamTypeModuleList
+ //! - kMinidumpStreamTypeCrashpadInfo (if present)
+ //! - kMinidumpStreamTypeMemoryList
+ //!
+ //! \param[in] process_snapshot The process snapshot to use as source data.
+ //!
+ //! \note Valid in #kStateMutable. No mutator methods may be called before
+ //! this method, and it is not normally necessary to call any mutator
+ //! methods after this method.
+ void InitializeFromSnapshot(const ProcessSnapshot* process_snapshot);
+
//! \brief Sets MINIDUMP_HEADER::Timestamp.
//!
//! \note Valid in #kStateMutable.
« no previous file with comments | « minidump/minidump_exception_writer_test.cc ('k') | minidump/minidump_file_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698