| OLD | NEW |
| 1 // Copyright 2014 The Crashpad Authors. All rights reserved. | 1 // Copyright 2014 The Crashpad Authors. All rights reserved. |
| 2 // | 2 // |
| 3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
| 5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
| 6 // | 6 // |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 // | 8 // |
| 9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 return true; | 92 return true; |
| 93 } | 93 } |
| 94 | 94 |
| 95 MinidumpSimpleStringDictionaryWriter::MinidumpSimpleStringDictionaryWriter() | 95 MinidumpSimpleStringDictionaryWriter::MinidumpSimpleStringDictionaryWriter() |
| 96 : MinidumpWritable(), | 96 : MinidumpWritable(), |
| 97 entries_(), | 97 entries_(), |
| 98 simple_string_dictionary_base_(new MinidumpSimpleStringDictionary()) { | 98 simple_string_dictionary_base_(new MinidumpSimpleStringDictionary()) { |
| 99 } | 99 } |
| 100 | 100 |
| 101 MinidumpSimpleStringDictionaryWriter::~MinidumpSimpleStringDictionaryWriter() { | 101 MinidumpSimpleStringDictionaryWriter::~MinidumpSimpleStringDictionaryWriter() { |
| 102 STLDeleteContainerPairSecondPointers(entries_.begin(), entries_.end()); | 102 base::STLDeleteContainerPairSecondPointers(entries_.begin(), entries_.end()); |
| 103 } | 103 } |
| 104 | 104 |
| 105 void MinidumpSimpleStringDictionaryWriter::InitializeFromMap( | 105 void MinidumpSimpleStringDictionaryWriter::InitializeFromMap( |
| 106 const std::map<std::string, std::string>& map) { | 106 const std::map<std::string, std::string>& map) { |
| 107 DCHECK_EQ(state(), kStateMutable); | 107 DCHECK_EQ(state(), kStateMutable); |
| 108 DCHECK(entries_.empty()); | 108 DCHECK(entries_.empty()); |
| 109 | 109 |
| 110 for (const auto& iterator : map) { | 110 for (const auto& iterator : map) { |
| 111 auto entry = | 111 auto entry = |
| 112 base::WrapUnique(new MinidumpSimpleStringDictionaryEntryWriter()); | 112 base::WrapUnique(new MinidumpSimpleStringDictionaryEntryWriter()); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 for (const auto& key_entry : entries_) { | 180 for (const auto& key_entry : entries_) { |
| 181 iov.iov_base = key_entry.second->MinidumpSimpleStringDictionaryEntry(); | 181 iov.iov_base = key_entry.second->MinidumpSimpleStringDictionaryEntry(); |
| 182 iov.iov_len = sizeof(MinidumpSimpleStringDictionaryEntry); | 182 iov.iov_len = sizeof(MinidumpSimpleStringDictionaryEntry); |
| 183 iovecs.push_back(iov); | 183 iovecs.push_back(iov); |
| 184 } | 184 } |
| 185 | 185 |
| 186 return file_writer->WriteIoVec(&iovecs); | 186 return file_writer->WriteIoVec(&iovecs); |
| 187 } | 187 } |
| 188 | 188 |
| 189 } // namespace crashpad | 189 } // namespace crashpad |
| OLD | NEW |