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

Unified Diff: chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.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/guest_view/web_view/chrome_web_view_guest_delegate.cc
diff --git a/chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.cc b/chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.cc
index 6e12fedeea2eaed0714670be29ec7d489e8585d1..97b57043a7dbc64b25bf69ee5f5f673b34a8e087 100644
--- a/chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.cc
+++ b/chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.h"
+#include <memory>
#include <utility>
#include "base/memory/ptr_util.h"
@@ -93,13 +94,14 @@ std::unique_ptr<base::ListValue> ChromeWebViewGuestDelegate::MenuModelToValue(
const ui::SimpleMenuModel& menu_model) {
std::unique_ptr<base::ListValue> items(new base::ListValue());
for (int i = 0; i < menu_model.GetItemCount(); ++i) {
- base::DictionaryValue* item_value = new base::DictionaryValue();
+ std::unique_ptr<base::DictionaryValue> item_value(
+ new base::DictionaryValue());
// TODO(lazyboy): We need to expose some kind of enum equivalent of
// |command_id| instead of plain integers.
item_value->SetInteger(webview::kMenuItemCommandId,
menu_model.GetCommandIdAt(i));
item_value->SetString(webview::kMenuItemLabel, menu_model.GetLabelAt(i));
- items->Append(item_value);
+ items->Append(std::move(item_value));
}
return items;
}
« no previous file with comments | « chrome/browser/extensions/extension_messages_apitest.cc ('k') | chrome/browser/media_galleries/media_galleries_preferences.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698