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

Unified Diff: extensions/browser/extension_prefs.cc

Issue 2899743002: Remove raw base::DictionaryValue::Set in //extensions (Closed)
Patch Set: Addressed nit Created 3 years, 6 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: extensions/browser/extension_prefs.cc
diff --git a/extensions/browser/extension_prefs.cc b/extensions/browser/extension_prefs.cc
index cc8847d3c648845b824e5d0dc2a300e8610aa375..b3388cd00534d5dc32ddf0a8506429acd513563c 100644
--- a/extensions/browser/extension_prefs.cc
+++ b/extensions/browser/extension_prefs.cc
@@ -614,7 +614,7 @@ static std::unique_ptr<base::ListValue> CreatePermissionList(
std::unique_ptr<base::Value> detail(i->ToValue());
if (detail) {
auto tmp(base::MakeUnique<base::DictionaryValue>());
- tmp->Set(i->name(), detail.release());
+ tmp->Set(i->name(), std::move(detail));
values->Append(std::move(tmp));
} else {
values->AppendString(i->name());
@@ -1351,7 +1351,7 @@ bool ExtensionPrefs::FinishDelayedInstallInfo(
for (base::DictionaryValue::Iterator it(
*pending_install_dict->AsConstDictionary());
!it.IsAtEnd(); it.Advance()) {
- extension_dict->Set(it.key(), it.value().CreateDeepCopy());
+ extension_dict->Set(it.key(), base::MakeUnique<base::Value>(it.value()));
}
FinishExtensionInfoPrefs(extension_id, install_time, needs_sort_ordinal,
suggested_page_ordinal, extension_dict.get());
@@ -1841,8 +1841,8 @@ void ExtensionPrefs::PopulateExtensionInfoPrefs(
// We store prefs about LOAD extensions, but don't cache their manifest
// since it may change on disk.
if (!Manifest::IsUnpackedLocation(extension->location())) {
- extension_dict->Set(kPrefManifest,
- extension->manifest()->value()->CreateDeepCopy());
+ extension_dict->Set(kPrefManifest, base::MakeUnique<base::Value>(
+ *extension->manifest()->value()));
}
// Only writes kPrefDoNotSync when it is not the default.
« no previous file with comments | « extensions/browser/event_listener_map_unittest.cc ('k') | extensions/browser/guest_view/app_view/app_view_guest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698