Index: services/preferences/public/cpp/pref_observer_store.cc |
diff --git a/services/preferences/public/cpp/pref_observer_store.cc b/services/preferences/public/cpp/pref_observer_store.cc |
index 7bf6f7f2f158c330bae8d220c85a11a06744800e..fac38338cc1e52b0333777d099af287ebae289d9 100644 |
--- a/services/preferences/public/cpp/pref_observer_store.cc |
+++ b/services/preferences/public/cpp/pref_observer_store.cc |
@@ -78,14 +78,14 @@ void PrefObserverStore::SetValueOnPreferenceManager(const std::string& key, |
if (keys_.find(key) == keys_.end()) |
return; |
- base::DictionaryValue prefs; |
- prefs.Set(key, value.CreateDeepCopy()); |
- prefs_manager_ptr_->SetPreferences(prefs); |
+ auto prefs = base::MakeUnique<base::DictionaryValue>(); |
+ prefs->Set(key, value.CreateDeepCopy()); |
+ prefs_manager_ptr_->SetPreferences(std::move(prefs)); |
} |
void PrefObserverStore::OnPreferencesChanged( |
- const base::DictionaryValue& preferences) { |
- for (base::DictionaryValue::Iterator it(preferences); !it.IsAtEnd(); |
+ std::unique_ptr<base::DictionaryValue> preferences) { |
+ for (base::DictionaryValue::Iterator it(*preferences); !it.IsAtEnd(); |
it.Advance()) { |
if (keys_.find(it.key()) == keys_.end()) |
continue; |