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

Unified Diff: chrome/browser/extensions/convert_web_app.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: chrome/browser/extensions/convert_web_app.cc
diff --git a/chrome/browser/extensions/convert_web_app.cc b/chrome/browser/extensions/convert_web_app.cc
index 409eb9baaff391adfed6eff2e3ef6c21ba77cc33..3c20a528a4d14c723cdde1bd19a344990715aee2 100644
--- a/chrome/browser/extensions/convert_web_app.cc
+++ b/chrome/browser/extensions/convert_web_app.cc
@@ -9,7 +9,9 @@
#include <cmath>
#include <limits>
+#include <memory>
#include <string>
+#include <utility>
#include <vector>
#include "base/base64.h"
@@ -125,10 +127,11 @@ scoped_refptr<Extension> ConvertWebAppToExtension(
icons->SetString(size, icon_path);
if (icon.url.is_valid()) {
- base::DictionaryValue* linked_icon = new base::DictionaryValue();
+ std::unique_ptr<base::DictionaryValue> linked_icon(
+ new base::DictionaryValue());
linked_icon->SetString(keys::kLinkedAppIconURL, icon.url.spec());
linked_icon->SetInteger(keys::kLinkedAppIconSize, icon.width);
- linked_icons->Append(linked_icon);
+ linked_icons->Append(std::move(linked_icon));
}
}
« no previous file with comments | « chrome/browser/extensions/convert_user_script.cc ('k') | chrome/browser/extensions/extension_messages_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698