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

Unified Diff: minidump/minidump_module_crashpad_info_writer.cc

Issue 705153002: Add list_annotations to MinidumpModuleCrashpadInfo (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@minidump_string_list_writer
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
Index: minidump/minidump_module_crashpad_info_writer.cc
diff --git a/minidump/minidump_module_crashpad_info_writer.cc b/minidump/minidump_module_crashpad_info_writer.cc
index 0c5cfc4ec7f8f4a95ea35d7f03e50f88e4dd3cb1..93da6f0f6a7b7401300672d4104a1041c3d89507 100644
--- a/minidump/minidump_module_crashpad_info_writer.cc
+++ b/minidump/minidump_module_crashpad_info_writer.cc
@@ -25,7 +25,10 @@
namespace crashpad {
MinidumpModuleCrashpadInfoWriter::MinidumpModuleCrashpadInfoWriter()
- : MinidumpWritable(), module_(), simple_annotations_() {
+ : MinidumpWritable(),
+ module_(),
+ list_annotations_(),
+ simple_annotations_() {
module_.version = MinidumpModuleCrashpadInfo::kVersion;
}
@@ -35,6 +38,7 @@ MinidumpModuleCrashpadInfoWriter::~MinidumpModuleCrashpadInfoWriter() {
void MinidumpModuleCrashpadInfoWriter::InitializeFromSnapshot(
const ModuleSnapshot* module_snapshot, size_t module_list_index) {
DCHECK_EQ(state(), kStateMutable);
+ DCHECK(!list_annotations_);
DCHECK(!simple_annotations_);
uint32_t module_list_index_u32;
@@ -44,6 +48,13 @@ void MinidumpModuleCrashpadInfoWriter::InitializeFromSnapshot(
}
SetMinidumpModuleListIndex(module_list_index_u32);
+ auto list_annotations =
+ make_scoped_ptr(new internal::MinidumpUTF8StringListWriter());
+ list_annotations->InitializeFromVector(module_snapshot->AnnotationsVector());
+ if (list_annotations->IsUseful()) {
+ SetListAnnotations(list_annotations.Pass());
+ }
+
auto simple_annotations =
make_scoped_ptr(new MinidumpSimpleStringDictionaryWriter());
simple_annotations->InitializeFromMap(
@@ -53,6 +64,13 @@ void MinidumpModuleCrashpadInfoWriter::InitializeFromSnapshot(
}
}
+void MinidumpModuleCrashpadInfoWriter::SetListAnnotations(
+ scoped_ptr<internal::MinidumpUTF8StringListWriter> list_annotations) {
+ DCHECK_EQ(state(), kStateMutable);
+
+ list_annotations_ = list_annotations.Pass();
+}
+
void MinidumpModuleCrashpadInfoWriter::SetSimpleAnnotations(
scoped_ptr<MinidumpSimpleStringDictionaryWriter> simple_annotations) {
DCHECK_EQ(state(), kStateMutable);
@@ -61,7 +79,7 @@ void MinidumpModuleCrashpadInfoWriter::SetSimpleAnnotations(
}
bool MinidumpModuleCrashpadInfoWriter::IsUseful() const {
- return simple_annotations_;
+ return list_annotations_ || simple_annotations_;
}
bool MinidumpModuleCrashpadInfoWriter::Freeze() {
@@ -71,6 +89,10 @@ bool MinidumpModuleCrashpadInfoWriter::Freeze() {
return false;
}
+ if (list_annotations_) {
+ list_annotations_->RegisterLocationDescriptor(&module_.list_annotations);
+ }
+
if (simple_annotations_) {
simple_annotations_->RegisterLocationDescriptor(
&module_.simple_annotations);
@@ -90,6 +112,9 @@ MinidumpModuleCrashpadInfoWriter::Children() {
DCHECK_GE(state(), kStateFrozen);
std::vector<MinidumpWritable*> children;
+ if (list_annotations_) {
+ children.push_back(list_annotations_.get());
+ }
if (simple_annotations_) {
children.push_back(simple_annotations_.get());
}
« no previous file with comments | « minidump/minidump_module_crashpad_info_writer.h ('k') | minidump/minidump_module_crashpad_info_writer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698