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

Unified Diff: minidump/minidump_thread_writer.h

Issue 693933002: Add MinidumpThreadListWriter::InitializeFromSnapshot() (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@minidump_init_from_snapshot_context_new
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_thread_id_map_test.cc ('k') | minidump/minidump_thread_writer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: minidump/minidump_thread_writer.h
diff --git a/minidump/minidump_thread_writer.h b/minidump/minidump_thread_writer.h
index 5ce048160fa79a44025d14f65d4ae1abf84f298c..e9bd114d89a24e0be26ed0dfbf00c9754898dca7 100644
--- a/minidump/minidump_thread_writer.h
+++ b/minidump/minidump_thread_writer.h
@@ -23,6 +23,7 @@
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "minidump/minidump_stream_writer.h"
+#include "minidump/minidump_thread_id_map.h"
#include "minidump/minidump_writable.h"
#include "util/stdlib/pointer_container.h"
@@ -31,6 +32,7 @@ namespace crashpad {
class MinidumpContextWriter;
class MinidumpMemoryListWriter;
class MinidumpMemoryWriter;
+class ThreadSnapshot;
//! \brief The writer for a MINIDUMP_THREAD object in a minidump file.
//!
@@ -43,6 +45,18 @@ class MinidumpThreadWriter final : public internal::MinidumpWritable {
MinidumpThreadWriter();
~MinidumpThreadWriter() override;
+ //! \brief Initializes the MINIDUMP_THREAD based on \a thread_snapshot.
+ //!
+ //! \param[in] thread_snapshot The thread snapshot to use as source data.
+ //! \param[in] thread_id_map A MinidumpThreadIDMap to be consulted to
+ //! determine the 32-bit minidump thread ID to use for \a thread_snapshot.
+ //!
+ //! \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 ThreadSnapshot* thread_snapshot,
+ const MinidumpThreadIDMap* thread_id_map);
+
//! \brief Returns a MINIDUMP_THREAD referencing this object’s data.
//!
//! This method is expected to be called by a MinidumpThreadListWriter in
@@ -127,6 +141,20 @@ class MinidumpThreadListWriter final : public internal::MinidumpStreamWriter {
MinidumpThreadListWriter();
~MinidumpThreadListWriter() override;
+ //! \brief Adds an initialized MINIDUMP_THREAD for each thread in \a
+ //! thread_snapshots to the MINIDUMP_THREAD_LIST.
+ //!
+ //! \param[in] thread_snapshots The thread snapshots to use as source data.
+ //! \param[out] thread_id_map A MinidumpThreadIDMap to be built by this
+ //! method. This map must be empty when this method is called.
+ //!
+ //! \note Valid in #kStateMutable. AddThread() may not be called before this
+ //! method, and it is not normally necessary to call AddThread() after
+ //! this method.
+ void InitializeFromSnapshot(
+ const std::vector<const ThreadSnapshot*>& thread_snapshots,
+ MinidumpThreadIDMap* thread_id_map);
+
//! \brief Sets the MinidumpMemoryListWriter that each thread’s stack memory
//! region should be added to as extra memory.
//!
« no previous file with comments | « minidump/minidump_thread_id_map_test.cc ('k') | minidump/minidump_thread_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698