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

Unified Diff: chrome/browser/ui/webui/options/handler_options_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/handler_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/handler_options_handler.cc b/chrome/browser/ui/webui/options/handler_options_handler.cc
index e0318752581083ed2e5ec759a44d69a27ef934da..3900ba6b1a69d1e305baefe609f6788d8e01ea8c 100644
--- a/chrome/browser/ui/webui/options/handler_options_handler.cc
+++ b/chrome/browser/ui/webui/options/handler_options_handler.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/ui/webui/options/handler_options_handler.h"
+#include <memory>
+#include <utility>
#include <vector>
#include "base/bind.h"
@@ -89,11 +91,11 @@ static void GetHandlersAsListValue(
base::ListValue* handler_list) {
ProtocolHandlerRegistry::ProtocolHandlerList::const_iterator handler;
for (handler = handlers.begin(); handler != handlers.end(); ++handler) {
- base::ListValue* handlerValue = new base::ListValue();
+ std::unique_ptr<base::ListValue> handlerValue(new base::ListValue());
handlerValue->AppendString(handler->protocol());
handlerValue->AppendString(handler->url().spec());
handlerValue->AppendString(handler->url().host());
- handler_list->Append(handlerValue);
+ handler_list->Append(std::move(handlerValue));
}
}
« no previous file with comments | « chrome/browser/ui/webui/options/font_settings_handler.cc ('k') | chrome/browser/ui/webui/options/import_data_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698