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

Unified Diff: extensions/browser/extension_prefs.cc

Issue 2058233002: Rewrite simple uses of base::ListValue::Append() taking a raw pointer var. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: less comments more ownership Created 4 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 13820316ec9cb0badd3b6f172043b0c5ad92ad17..3335600a72577e179ebdb3d2612ce990509bd542 100644
--- a/extensions/browser/extension_prefs.cc
+++ b/extensions/browser/extension_prefs.cc
@@ -628,9 +628,9 @@ static base::ListValue* CreatePermissionList(const T& permissions) {
i != permissions.end(); ++i) {
std::unique_ptr<base::Value> detail(i->ToValue());
if (detail) {
- base::DictionaryValue* tmp = new base::DictionaryValue();
+ std::unique_ptr<base::DictionaryValue> tmp(new base::DictionaryValue());
tmp->Set(i->name(), detail.release());
- values->Append(tmp);
+ values->Append(std::move(tmp));
} else {
values->AppendString(i->name());
}
« no previous file with comments | « extensions/browser/api/web_request/upload_data_presenter.cc ('k') | google_apis/drive/drive_api_requests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698