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

Unified Diff: components/sync_preferences/pref_model_associator.cc

Issue 2843813002: Remove SetWithoutPathExpansion (Closed)
Patch Set: Fix CrOS Error Created 3 years, 8 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_preferences/pref_model_associator.cc
diff --git a/components/sync_preferences/pref_model_associator.cc b/components/sync_preferences/pref_model_associator.cc
index 6bb1801dc52a0ce53b1d64d4449b331e133164d8..1231784aa7db38fb187d7119ca53e481d8a718ad 100644
--- a/components/sync_preferences/pref_model_associator.cc
+++ b/components/sync_preferences/pref_model_associator.cc
@@ -319,14 +319,15 @@ base::Value* PrefModelAssociator::MergeDictionaryValues(
if (result->GetWithoutPathExpansion(it.key(), &to_key_value)) {
if (from_key_value->GetType() == base::Value::Type::DICTIONARY &&
to_key_value->GetType() == base::Value::Type::DICTIONARY) {
- base::Value* merged_value =
- MergeDictionaryValues(*from_key_value, *to_key_value);
- result->SetWithoutPathExpansion(it.key(), merged_value);
+ std::unique_ptr<base::Value> merged_value(
+ MergeDictionaryValues(*from_key_value, *to_key_value));
+ result->SetWithoutPathExpansion(it.key(), std::move(merged_value));
}
// Note that for all other types we want to preserve the "to"
// values so we do nothing here.
} else {
- result->SetWithoutPathExpansion(it.key(), from_key_value->DeepCopy());
+ result->SetWithoutPathExpansion(it.key(),
+ from_key_value->CreateDeepCopy());
}
}
return result;
« no previous file with comments | « components/policy/core/common/registry_dict.cc ('k') | components/sync_preferences/pref_model_associator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698