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

Unified Diff: extensions/browser/computed_hashes.cc

Issue 2323993004: Remove use of deprecated base::ListValue::Append(Value*) overload in extensions. (Closed)
Patch Set: ... I hate C++ Created 4 years, 3 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 | « extensions/browser/app_window/app_window_contents.cc ('k') | extensions/browser/event_router.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « extensions/browser/app_window/app_window_contents.cc ('k') | extensions/browser/event_router.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698