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

Unified Diff: chrome/browser/extensions/api/font_settings/font_settings_api.cc

Issue 2777063003: Stop passing raw pointers to base::Value API in c/b/chromeos and c/b/extensions (Closed)
Patch Set: Fix SupervisedUserWhitelistInstaller 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: chrome/browser/extensions/api/font_settings/font_settings_api.cc
diff --git a/chrome/browser/extensions/api/font_settings/font_settings_api.cc b/chrome/browser/extensions/api/font_settings/font_settings_api.cc
index b417664a7ef3dd09481fdc5f33497f7f4bf5ef34..c606caae31249bf5ebdfb5e593d222223d3f54f3 100644
--- a/chrome/browser/extensions/api/font_settings/font_settings_api.cc
+++ b/chrome/browser/extensions/api/font_settings/font_settings_api.cc
@@ -186,7 +186,7 @@ void FontSettingsEventRouter::OnFontPrefChanged(
base::ListValue args;
std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
- dict->Set(key, pref->GetValue()->DeepCopy());
+ dict->Set(key, pref->GetValue()->CreateDeepCopy());
args.Append(std::move(dict));
extensions::preference_helpers::DispatchEventToExtensions(
@@ -319,8 +319,9 @@ bool FontSettingsGetFontListFunction::CopyFontsToResult(
std::unique_ptr<base::DictionaryValue> font_name(
new base::DictionaryValue());
- font_name->Set(kFontIdKey, new base::Value(name));
- font_name->Set(kDisplayNameKey, new base::Value(localized_name));
+ font_name->Set(kFontIdKey, base::MakeUnique<base::Value>(name));
+ font_name->Set(kDisplayNameKey,
+ base::MakeUnique<base::Value>(localized_name));
result->Append(std::move(font_name));
}
@@ -353,7 +354,7 @@ ExtensionFunction::ResponseAction GetFontPrefExtensionFunction::Run() {
profile, extension_id(), GetPrefName(), kIncognito);
std::unique_ptr<base::DictionaryValue> result(new base::DictionaryValue());
- result->Set(GetKey(), pref->GetValue()->DeepCopy());
+ result->Set(GetKey(), pref->GetValue()->CreateDeepCopy());
result->SetString(kLevelOfControlKey, level_of_control);
return RespondNow(OneArgument(std::move(result)));
}

Powered by Google App Engine
This is Rietveld 408576698