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

Unified Diff: chrome/browser/ui/webui/instant_ui.cc

Issue 2812953002: Stop passing raw pointers to base::Value API in c/b/ui (Closed)
Patch Set: Rebased Created 3 years, 8 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/instant_ui.cc
diff --git a/chrome/browser/ui/webui/instant_ui.cc b/chrome/browser/ui/webui/instant_ui.cc
index 859d307dadf2abee104fe9744dbb099d802b1770..253245fa6af5700d125d4801f6fc7a547822414b 100644
--- a/chrome/browser/ui/webui/instant_ui.cc
+++ b/chrome/browser/ui/webui/instant_ui.cc
@@ -140,7 +140,7 @@ void InstantUIMessageHandler::GetDebugInfo(const base::ListValue* args) {
const std::list<DebugEvent>& events = instant->debug_events();
base::DictionaryValue data;
- base::ListValue* entries = new base::ListValue();
+ auto entries = base::MakeUnique<base::ListValue>();
for (std::list<DebugEvent>::const_iterator it = events.begin();
it != events.end(); ++it) {
std::unique_ptr<base::DictionaryValue> entry(new base::DictionaryValue());
@@ -148,7 +148,7 @@ void InstantUIMessageHandler::GetDebugInfo(const base::ListValue* args) {
entry->SetString("text", it->second);
entries->Append(std::move(entry));
}
- data.Set("entries", entries);
+ data.Set("entries", std::move(entries));
web_ui()->CallJavascriptFunctionUnsafe("instantConfig.getDebugInfoResult",
data);

Powered by Google App Engine
This is Rietveld 408576698