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

Unified Diff: third_party/crashpad/crashpad/minidump/minidump_user_stream_writer.h

Issue 2773813002: Update Crashpad to 8e37886d418dd042c3c7bfadac99214739ee4d98 (Closed)
Patch Set: Update Crashpad to 8e37886d418dd042c3c7bfadac99214739ee4d98 Created 3 years, 9 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
Index: third_party/crashpad/crashpad/minidump/minidump_user_stream_writer.h
diff --git a/third_party/crashpad/crashpad/minidump/minidump_user_stream_writer.h b/third_party/crashpad/crashpad/minidump/minidump_user_stream_writer.h
index b31247a380a44fbb4a7c1a16f3ea9c911d1a9aad..838ed0deeccbad53b3604a7b9d0d543ab3832853 100644
--- a/third_party/crashpad/crashpad/minidump/minidump_user_stream_writer.h
+++ b/third_party/crashpad/crashpad/minidump/minidump_user_stream_writer.h
@@ -22,6 +22,7 @@
#include <vector>
#include "base/macros.h"
+#include "minidump/minidump_extensions.h"
#include "minidump/minidump_stream_writer.h"
#include "minidump/minidump_writable.h"
#include "snapshot/module_snapshot.h"
@@ -41,6 +42,18 @@ class MinidumpUserStreamWriter final : public internal::MinidumpStreamWriter {
//! \note Valid in #kStateMutable.
void InitializeFromSnapshot(const UserMinidumpStream* stream);
+ //! \brief Initializes a MINIDUMP_USER_STREAM based on \a stream_type,
+ //! \a buffer and \a buffer_size.
+ //!
+ //! \param[in] stream_type The type of the stream.
+ //! \param[in] buffer The data for the stream.
+ //! \param[in] buffer_size The length of \a buffer, and the resulting stream.
+ //!
+ //! \note Valid in #kStateMutable.
+ void InitializeFromBuffer(MinidumpStreamType stream_type,
+ const void* buffer,
+ size_t buffer_size);
+
protected:
// MinidumpWritable:
bool Freeze() override;
@@ -52,22 +65,13 @@ class MinidumpUserStreamWriter final : public internal::MinidumpStreamWriter {
MinidumpStreamType StreamType() const override;
private:
- class MemoryReader : public MemorySnapshot::Delegate {
- public:
- ~MemoryReader() override;
- bool MemorySnapshotDelegateRead(void* data, size_t size) override;
-
- const void* data() const {
- return reinterpret_cast<const void*>(data_.data());
- }
- size_t size() const { return data_.size(); }
-
- private:
- std::vector<uint8_t> data_;
- };
-
- uint32_t stream_type_;
- MemoryReader reader_;
+ class ContentsWriter;
+ class SnapshotContentsWriter;
+ class BufferContentsWriter;
+
+ std::unique_ptr<ContentsWriter> contents_writer_;
+
+ MinidumpStreamType stream_type_;
DISALLOW_COPY_AND_ASSIGN(MinidumpUserStreamWriter);
};

Powered by Google App Engine
This is Rietveld 408576698