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 |