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

Unified Diff: components/sync/syncable/entry_kernel.cc

Issue 2287733002: Switch //components away from base::ListValue::Append(Value*) overload. (Closed)
Patch Set: Test fix Created 4 years, 4 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
Index: components/sync/syncable/entry_kernel.cc
diff --git a/components/sync/syncable/entry_kernel.cc b/components/sync/syncable/entry_kernel.cc
index d012d9865e19b9f8cb0c9406cebeaf254067b12c..9ba9c37f6e57f05d8119a4c03aaec06dfb954fbd 100644
--- a/components/sync/syncable/entry_kernel.cc
+++ b/components/sync/syncable/entry_kernel.cc
@@ -213,9 +213,9 @@ base::DictionaryValue* EntryKernel::ToValue(
return kernel_info;
}
-base::ListValue* EntryKernelMutationMapToValue(
+std::unique_ptr<base::ListValue> EntryKernelMutationMapToValue(
const EntryKernelMutationMap& mutations) {
- base::ListValue* list = new base::ListValue();
+ std::unique_ptr<base::ListValue> list(new base::ListValue());
for (EntryKernelMutationMap::const_iterator it = mutations.begin();
it != mutations.end(); ++it) {
list->Append(EntryKernelMutationToValue(it->second));
@@ -223,9 +223,9 @@ base::ListValue* EntryKernelMutationMapToValue(
return list;
}
-base::DictionaryValue* EntryKernelMutationToValue(
+std::unique_ptr<base::DictionaryValue> EntryKernelMutationToValue(
const EntryKernelMutation& mutation) {
- base::DictionaryValue* dict = new base::DictionaryValue();
+ std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
dict->Set("original", mutation.original.ToValue(NULL));
dict->Set("mutated", mutation.mutated.ToValue(NULL));
return dict;

Powered by Google App Engine
This is Rietveld 408576698