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

Unified Diff: minidump/minidump_string_writer.cc

Issue 707003002: Add MinidumpStringListWriter and test (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@minidump_rva_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_string_writer.h ('k') | minidump/minidump_string_writer_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: minidump/minidump_string_writer.cc
diff --git a/minidump/minidump_string_writer.cc b/minidump/minidump_string_writer.cc
index 8bcb7028aa25edc05e96a2ef75d725c0037b21b2..effc0183694999a41730468b530c7e878e001fde 100644
--- a/minidump/minidump_string_writer.cc
+++ b/minidump/minidump_string_writer.cc
@@ -95,5 +95,43 @@ void MinidumpUTF16StringWriter::SetUTF8(const std::string& string_utf8) {
MinidumpUTF8StringWriter::~MinidumpUTF8StringWriter() {
}
+template <typename Traits>
+MinidumpStringListWriter<Traits>::MinidumpStringListWriter()
+ : MinidumpRVAListWriter() {
+}
+
+template <typename Traits>
+MinidumpStringListWriter<Traits>::~MinidumpStringListWriter() {
+}
+
+template <typename Traits>
+void MinidumpStringListWriter<Traits>::InitializeFromVector(
+ const std::vector<std::string>& vector) {
+ DCHECK_EQ(state(), kStateMutable);
+ DCHECK(IsEmpty());
+
+ for (const std::string& string : vector) {
+ AddStringUTF8(string);
+ }
+}
+
+template <typename Traits>
+void MinidumpStringListWriter<Traits>::AddStringUTF8(
+ const std::string& string_utf8) {
+ auto string_writer = make_scoped_ptr(new MinidumpStringWriterType());
+ string_writer->SetUTF8(string_utf8);
+ AddChild(string_writer.Pass());
+}
+
+template <typename Traits>
+bool MinidumpStringListWriter<Traits>::IsUseful() const {
+ return !IsEmpty();
+}
+
+// Explicit template instantiation of the forms of MinidumpStringListWriter<>
+// used as type aliases.
+template class MinidumpStringListWriter<MinidumpStringListWriterUTF16Traits>;
+template class MinidumpStringListWriter<MinidumpStringListWriterUTF8Traits>;
+
} // namespace internal
} // namespace crashpad
« no previous file with comments | « minidump/minidump_string_writer.h ('k') | minidump/minidump_string_writer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698