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

Unified Diff: minidump/minidump_crashpad_info_writer.h

Issue 703353002: Add MinidumpCrashpadInfoWriter::InitializeFromSnapshot() and its test (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@minidump_module_annotations_list
Patch Set: Rebase 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 | « no previous file | minidump/minidump_crashpad_info_writer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: minidump/minidump_crashpad_info_writer.h
diff --git a/minidump/minidump_crashpad_info_writer.h b/minidump/minidump_crashpad_info_writer.h
index 43f6d5512c251f65457b56360b271c109a249f97..22c60747af7271fa4785b91ea14dfc8fe2a81b93 100644
--- a/minidump/minidump_crashpad_info_writer.h
+++ b/minidump/minidump_crashpad_info_writer.h
@@ -25,6 +25,7 @@
namespace crashpad {
class MinidumpModuleCrashpadInfoListWriter;
+class ProcessSnapshot;
//! \brief The writer for a MinidumpCrashpadInfo stream in a minidump file.
class MinidumpCrashpadInfoWriter final : public internal::MinidumpStreamWriter {
@@ -32,6 +33,23 @@ class MinidumpCrashpadInfoWriter final : public internal::MinidumpStreamWriter {
MinidumpCrashpadInfoWriter();
~MinidumpCrashpadInfoWriter() override;
+ //! \brief Initializes MinidumpCrashpadInfo based on \a process_snapshot.
+ //!
+ //! This method may add additional structures to the minidump file as children
+ //! of the MinidumpCrashpadInfo stream. To do so, it may obtain other
+ //! snapshot information from \a process_snapshot, such as a list of
+ //! ModuleSnapshot objects used to initialize
+ //! MinidumpCrashpadInfo::module_list. Only data that is considered useful
+ //! will be included. For module information, usefulness is determined by
+ //! MinidumpModuleCrashpadInfoListWriter::IsUseful().
+ //!
+ //! \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 Arranges for MinidumpCrashpadInfo::module_list to point to the
//! MinidumpModuleCrashpadInfoList object to be written by \a
//! module_list.
@@ -43,6 +61,15 @@ class MinidumpCrashpadInfoWriter final : public internal::MinidumpStreamWriter {
void SetModuleList(
scoped_ptr<MinidumpModuleCrashpadInfoListWriter> module_list);
+ //! \brief Determines whether the object is useful.
+ //!
+ //! A useful object is one that carries data that makes a meaningful
+ //! contribution to a minidump file. An object carrying children would be
+ //! considered useful.
+ //!
+ //! \return `true` if the object is useful, `false` otherwise.
+ bool IsUseful() const;
+
protected:
// MinidumpWritable:
bool Freeze() override;
« no previous file with comments | « no previous file | minidump/minidump_crashpad_info_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698