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

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: No ListValue::SetDouble 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..298ebe8d9a2435e893ce1e0196b7634939dc46d3 100644
--- a/chrome/browser/ui/webui/instant_ui.cc
+++ b/chrome/browser/ui/webui/instant_ui.cc
@@ -14,6 +14,7 @@
#include "base/memory/ptr_util.h"
#include "base/strings/stringprintf.h"
#include "base/time/time.h"
+#include "base/values.h"
#include "build/build_config.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser_finder.h"
@@ -140,7 +141,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 +149,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