Index: extensions/browser/computed_hashes.cc |
diff --git a/extensions/browser/computed_hashes.cc b/extensions/browser/computed_hashes.cc |
index bf0cf985a2867eb7aac582f5002087c50b797b41..0758506bfc30a12694187fb001de60784b69ad71 100644 |
--- a/extensions/browser/computed_hashes.cc |
+++ b/extensions/browser/computed_hashes.cc |
@@ -4,6 +4,9 @@ |
#include "extensions/browser/computed_hashes.h" |
+#include <memory> |
+#include <utility> |
+ |
#include "base/base64.h" |
#include "base/files/file_path.h" |
#include "base/files/file_util.h" |
@@ -133,13 +136,13 @@ ComputedHashes::Writer::~Writer() { |
void ComputedHashes::Writer::AddHashes(const base::FilePath& relative_path, |
int block_size, |
const std::vector<std::string>& hashes) { |
- base::DictionaryValue* dict = new base::DictionaryValue(); |
+ std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
base::ListValue* block_hashes = new base::ListValue(); |
- file_list_->Append(dict); |
dict->SetString(kPathKey, |
relative_path.NormalizePathSeparatorsTo('/').AsUTF8Unsafe()); |
dict->SetInteger(kBlockSizeKey, block_size); |
dict->Set(kBlockHashesKey, block_hashes); |
+ file_list_->Append(std::move(dict)); |
for (std::vector<std::string>::const_iterator i = hashes.begin(); |
i != hashes.end(); |