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

Unified Diff: chrome/browser/ui/webui/options/startup_pages_handler.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/ui/webui/options/startup_pages_handler.cc
diff --git a/chrome/browser/ui/webui/options/startup_pages_handler.cc b/chrome/browser/ui/webui/options/startup_pages_handler.cc
index a06fa42f1eecee4e24fcf469935f6a30cb9b6bc5..d19fa21fcefc946603a68e07266a4c0b06b2ba9d 100644
--- a/chrome/browser/ui/webui/options/startup_pages_handler.cc
+++ b/chrome/browser/ui/webui/options/startup_pages_handler.cc
@@ -6,6 +6,8 @@
#include <stddef.h>
+#include <utility>
+
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/logging.h"
@@ -121,13 +123,13 @@ void StartupPagesHandler::OnModelChanged() {
int page_count = startup_custom_pages_table_model_->RowCount();
std::vector<GURL> urls = startup_custom_pages_table_model_->GetURLs();
for (int i = 0; i < page_count; ++i) {
- base::DictionaryValue* entry = new base::DictionaryValue();
+ std::unique_ptr<base::DictionaryValue> entry(new base::DictionaryValue());
entry->SetString("title", startup_custom_pages_table_model_->GetText(i, 0));
entry->SetString("url", urls[i].spec());
entry->SetString("tooltip",
startup_custom_pages_table_model_->GetTooltip(i));
entry->SetInteger("modelIndex", i);
- startup_pages.Append(entry);
+ startup_pages.Append(std::move(entry));
}
web_ui()->CallJavascriptFunctionUnsafe("StartupOverlay.updateStartupPages",
« no previous file with comments | « chrome/browser/ui/webui/options/options_ui.cc ('k') | chrome/browser/ui/webui/options/supervised_user_import_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698