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

Unified Diff: extensions/browser/value_store/value_store_change.cc

Issue 2370633002: replace deprecated version of SetWithoutPathExpansion (Closed)
Patch Set: use MakeUnique 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/value_store/leveldb_value_store.cc ('k') | extensions/common/value_builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/value_store/value_store_change.cc
diff --git a/extensions/browser/value_store/value_store_change.cc b/extensions/browser/value_store/value_store_change.cc
index 5341209fd2082db7af23a450b2b68a2a1b43c06a..023a2f371f477923d0687f4040b02a8c298dbddf 100644
--- a/extensions/browser/value_store/value_store_change.cc
+++ b/extensions/browser/value_store/value_store_change.cc
@@ -16,14 +16,15 @@ std::string ValueStoreChange::ToJson(
base::DictionaryValue changes_value;
for (ValueStoreChangeList::const_iterator it = changes.begin();
it != changes.end(); ++it) {
- base::DictionaryValue* change_value = new base::DictionaryValue();
+ std::unique_ptr<base::DictionaryValue> change_value =
+ base::MakeUnique<base::DictionaryValue>();
if (it->old_value()) {
change_value->Set("oldValue", it->old_value()->DeepCopy());
}
if (it->new_value()) {
change_value->Set("newValue", it->new_value()->DeepCopy());
}
- changes_value.SetWithoutPathExpansion(it->key(), change_value);
+ changes_value.SetWithoutPathExpansion(it->key(), std::move(change_value));
}
std::string json;
bool success = base::JSONWriter::Write(changes_value, &json);
« no previous file with comments | « extensions/browser/value_store/leveldb_value_store.cc ('k') | extensions/common/value_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698