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

Unified Diff: chrome/browser/ui/webui/options/font_settings_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/font_settings_handler.cc
diff --git a/chrome/browser/ui/webui/options/font_settings_handler.cc b/chrome/browser/ui/webui/options/font_settings_handler.cc
index 4a87924f989f87ab5c8494e52163081408632201..0352145efba820373abd1781c71d70668b445370 100644
--- a/chrome/browser/ui/webui/options/font_settings_handler.cc
+++ b/chrome/browser/ui/webui/options/font_settings_handler.cc
@@ -7,6 +7,7 @@
#include <stddef.h>
#include <string>
+#include <utility>
#include "base/bind.h"
#include "base/bind_helpers.h"
@@ -223,7 +224,7 @@ void FontSettingsHandler::FontsListHasLoaded(
std::vector<CharacterEncoding::EncodingInfo>::const_iterator it;
for (it = encodings->begin(); it != encodings->end(); ++it) {
- base::ListValue* option = new base::ListValue();
+ std::unique_ptr<base::ListValue> option(new base::ListValue());
if (it->encoding_id) {
int cmd_id = it->encoding_id;
std::string encoding =
@@ -238,7 +239,7 @@ void FontSettingsHandler::FontsListHasLoaded(
option->AppendString(std::string());
option->AppendString(std::string());
}
- encoding_list.Append(option);
+ encoding_list.Append(std::move(option));
}
base::ListValue selected_values;

Powered by Google App Engine
This is Rietveld 408576698