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

Unified Diff: minidump/minidump_module_crashpad_info_writer.h

Issue 683143003: minidump: Add InitializeFromSnapshot() for MinidumpModuleCrashpadInfoListWriter and downstream (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.gyp ('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 1292917080149d1d9425bfd0f9cabc706f87d38a..e9bc27921b1797df31f0186c0f23d4badc8c5ce6 100644
--- a/minidump/minidump_module_crashpad_info_writer.h
+++ b/minidump/minidump_module_crashpad_info_writer.h
@@ -16,6 +16,7 @@
#define CRASHPAD_MINIDUMP_MINIDUMP_MODULE_CRASHPAD_INFO_WRITER_H_
#include <stdint.h>
+#include <sys/types.h>
#include <vector>
@@ -28,6 +29,7 @@
namespace crashpad {
class MinidumpSimpleStringDictionaryWriter;
+class ModuleSnapshot;
//! \brief The writer for a MinidumpModuleCrashpadInfo object in a minidump
//! file.
@@ -37,6 +39,24 @@ class MinidumpModuleCrashpadInfoWriter final
MinidumpModuleCrashpadInfoWriter();
~MinidumpModuleCrashpadInfoWriter() override;
+ //! \brief Initializes the MinidumpModuleCrashpadInfo based on \a
+ //! module_snapshot.
+ //!
+ //! Only data in \a module_snapshot that is considered useful will be
+ //! included. For simple annotations, usefulness is determined by
+ //! MinidumpSimpleStringDictionaryWriter::IsUseful().
+ //!
+ //! \param[in] module_snapshot The module snapshot to use as source data.
+ //! \param[in] module_list_index The index of the MINIDUMP_MODULE initialized
+ //! from \a module_snapshot in the minidump file’s MINIDUMP_MODULE_LIST
+ //! stream.
+ //!
+ //! \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 ModuleSnapshot* module_snapshot,
+ size_t module_list_index);
+
//! \brief Sets MinidumpModuleCrashpadInfo::minidump_module_list_index.
void SetMinidumpModuleListIndex(uint32_t minidump_module_list_index) {
module_.minidump_module_list_index = minidump_module_list_index;
@@ -53,6 +73,15 @@ class MinidumpModuleCrashpadInfoWriter final
void SetSimpleAnnotations(
scoped_ptr<MinidumpSimpleStringDictionaryWriter> simple_annotations);
+ //! \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 simple annotations
+ //! would be considered useful.
+ //!
+ //! \return `true` if the object is useful, `false` otherwise.
+ bool IsUseful() const;
+
protected:
// MinidumpWritable:
bool Freeze() override;
@@ -75,6 +104,21 @@ class MinidumpModuleCrashpadInfoListWriter final
MinidumpModuleCrashpadInfoListWriter();
~MinidumpModuleCrashpadInfoListWriter() override;
+ //! \brief Adds an initialized MinidumpModuleCrashpadInfo for modules in \a
+ //! module_snapshots to the MinidumpModuleCrashpadInfoList.
+ //!
+ //! Only modules in \a module_snapshots that would produce a useful
+ //! MinidumpModuleCrashpadInfo structure are included. Usefulness is
+ //! determined by MinidumpModuleCrashpadInfoWriter::IsUseful().
+ //!
+ //! \param[in] module_snapshots The module snapshots 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 std::vector<const ModuleSnapshot*>& module_snapshots);
+
//! \brief Adds a MinidumpModuleCrashpadInfo to the
//! MinidumpModuleCrashpadInfoList.
//!
« no previous file with comments | « minidump/minidump.gyp ('k') | minidump/minidump_module_crashpad_info_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698