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

Unified Diff: minidump/minidump_crashpad_info_writer.cc

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 | « minidump/minidump_crashpad_info_writer.h ('k') | minidump/minidump_crashpad_info_writer_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: minidump/minidump_crashpad_info_writer.cc
diff --git a/minidump/minidump_crashpad_info_writer.cc b/minidump/minidump_crashpad_info_writer.cc
index 22be59773c83811d914dab003d2fb1dc2739005b..b77796eabe515ce87cd490d8f0b637333e1fe24a 100644
--- a/minidump/minidump_crashpad_info_writer.cc
+++ b/minidump/minidump_crashpad_info_writer.cc
@@ -16,6 +16,7 @@
#include "base/logging.h"
#include "minidump/minidump_module_crashpad_info_writer.h"
+#include "snapshot/process_snapshot.h"
#include "util/file/file_writer.h"
namespace crashpad {
@@ -28,6 +29,19 @@ MinidumpCrashpadInfoWriter::MinidumpCrashpadInfoWriter()
MinidumpCrashpadInfoWriter::~MinidumpCrashpadInfoWriter() {
}
+void MinidumpCrashpadInfoWriter::InitializeFromSnapshot(
+ const ProcessSnapshot* process_snapshot) {
+ DCHECK_EQ(state(), kStateMutable);
+ DCHECK(!module_list_);
+
+ auto modules = make_scoped_ptr(new MinidumpModuleCrashpadInfoListWriter());
+ modules->InitializeFromSnapshot(process_snapshot->Modules());
+
+ if (modules->IsUseful()) {
+ SetModuleList(modules.Pass());
+ }
+}
+
void MinidumpCrashpadInfoWriter::SetModuleList(
scoped_ptr<MinidumpModuleCrashpadInfoListWriter> module_list) {
DCHECK_EQ(state(), kStateMutable);
@@ -77,4 +91,8 @@ MinidumpStreamType MinidumpCrashpadInfoWriter::StreamType() const {
return kMinidumpStreamTypeCrashpadInfo;
}
+bool MinidumpCrashpadInfoWriter::IsUseful() const {
+ return module_list_;
+}
+
} // namespace crashpad
« no previous file with comments | « minidump/minidump_crashpad_info_writer.h ('k') | minidump/minidump_crashpad_info_writer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698