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

Unified Diff: base/prefs/pref_service.cc

Issue 1129083003: More base::Values-related bare pointer -> scoped_ptr conversions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix bad merge Created 5 years, 7 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 | « base/prefs/json_pref_store.cc ('k') | base/test/values_test_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/prefs/pref_service.cc
diff --git a/base/prefs/pref_service.cc b/base/prefs/pref_service.cc
index ad2315755771f898322ad80cec00bdcc65c4dea1..6e1d58ca0f163eff22c4048e6691ba3192bec884 100644
--- a/base/prefs/pref_service.cc
+++ b/base/prefs/pref_service.cc
@@ -190,8 +190,7 @@ scoped_ptr<base::DictionaryValue> PrefService::GetPreferenceValues() const {
DCHECK(CalledOnValidThread());
scoped_ptr<base::DictionaryValue> out(new base::DictionaryValue);
for (const auto& it : *pref_registry_) {
- const base::Value* value = GetPreferenceValue(it.first);
- out->Set(it.first, value->DeepCopy());
+ out->Set(it.first, GetPreferenceValue(it.first)->CreateDeepCopy());
}
return out.Pass();
}
@@ -204,7 +203,7 @@ scoped_ptr<base::DictionaryValue> PrefService::GetPreferenceValuesOmitDefaults()
const Preference* pref = FindPreference(it.first);
if (pref->IsDefaultValue())
continue;
- out->Set(it.first, pref->GetValue()->DeepCopy());
+ out->Set(it.first, pref->GetValue()->CreateDeepCopy());
}
return out.Pass();
}
@@ -216,7 +215,7 @@ PrefService::GetPreferenceValuesWithoutPathExpansion() const {
for (const auto& it : *pref_registry_) {
const base::Value* value = GetPreferenceValue(it.first);
DCHECK(value);
- out->SetWithoutPathExpansion(it.first, value->DeepCopy());
+ out->SetWithoutPathExpansion(it.first, value->CreateDeepCopy());
}
return out.Pass();
}
« no previous file with comments | « base/prefs/json_pref_store.cc ('k') | base/test/values_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698