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

Unified Diff: minidump/minidump_simple_string_dictionary_writer.cc

Issue 895313004: win: convert MinidumpSimpleStringDictionaryWriter to scoped_ptr (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: remove mistaken addition Created 5 years, 10 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
« no previous file with comments | « minidump/minidump_simple_string_dictionary_writer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: minidump/minidump_simple_string_dictionary_writer.cc
diff --git a/minidump/minidump_simple_string_dictionary_writer.cc b/minidump/minidump_simple_string_dictionary_writer.cc
index 445ab3fa3cf6a20850ed1a20d0df160ada16871c..c7d81e2fde472ed10e8747239e00f8d737019be1 100644
--- a/minidump/minidump_simple_string_dictionary_writer.cc
+++ b/minidump/minidump_simple_string_dictionary_writer.cc
@@ -91,7 +91,9 @@ bool MinidumpSimpleStringDictionaryEntryWriter::WriteObject(
}
MinidumpSimpleStringDictionaryWriter::MinidumpSimpleStringDictionaryWriter()
- : MinidumpWritable(), entries_(), simple_string_dictionary_base_() {
+ : MinidumpWritable(),
+ entries_(),
+ simple_string_dictionary_base_(new MinidumpSimpleStringDictionary()) {
}
MinidumpSimpleStringDictionaryWriter::~MinidumpSimpleStringDictionaryWriter() {
@@ -137,7 +139,7 @@ bool MinidumpSimpleStringDictionaryWriter::Freeze() {
}
size_t entry_count = entries_.size();
- if (!AssignIfInRange(&simple_string_dictionary_base_.count, entry_count)) {
+ if (!AssignIfInRange(&simple_string_dictionary_base_->count, entry_count)) {
LOG(ERROR) << "entry_count " << entry_count << " out of range";
return false;
}
@@ -148,7 +150,7 @@ bool MinidumpSimpleStringDictionaryWriter::Freeze() {
size_t MinidumpSimpleStringDictionaryWriter::SizeOfObject() {
DCHECK_GE(state(), kStateFrozen);
- return sizeof(simple_string_dictionary_base_) +
+ return sizeof(*simple_string_dictionary_base_) +
entries_.size() * sizeof(MinidumpSimpleStringDictionaryEntry);
}
@@ -169,8 +171,8 @@ bool MinidumpSimpleStringDictionaryWriter::WriteObject(
DCHECK_GE(state(), kStateWritable);
WritableIoVec iov;
- iov.iov_base = &simple_string_dictionary_base_;
- iov.iov_len = sizeof(simple_string_dictionary_base_);
+ iov.iov_base = simple_string_dictionary_base_.get();
+ iov.iov_len = sizeof(*simple_string_dictionary_base_);
std::vector<WritableIoVec> iovecs(1, iov);
for (const auto& key_entry : entries_) {
« no previous file with comments | « minidump/minidump_simple_string_dictionary_writer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698