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

Unified Diff: chrome/browser/ui/webui/sync_file_system_internals/sync_file_system_internals_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/sync_file_system_internals/sync_file_system_internals_handler.cc
diff --git a/chrome/browser/ui/webui/sync_file_system_internals/sync_file_system_internals_handler.cc b/chrome/browser/ui/webui/sync_file_system_internals/sync_file_system_internals_handler.cc
index 600045ad1dc057c90874635eef7f8d8be677ebfd..57872aaca994ccba7f1328e214c70c337a802f16 100644
--- a/chrome/browser/ui/webui/sync_file_system_internals/sync_file_system_internals_handler.cc
+++ b/chrome/browser/ui/webui/sync_file_system_internals/sync_file_system_internals_handler.cc
@@ -6,6 +6,8 @@
#include <stdint.h>
+#include <memory>
+#include <utility>
#include <vector>
#include "base/bind.h"
@@ -152,12 +154,12 @@ void SyncFileSystemInternalsHandler::GetLog(
if (log_entry->id <= last_log_id_sent)
continue;
- base::DictionaryValue* dict = new base::DictionaryValue;
+ std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue);
dict->SetInteger("id", log_entry->id);
dict->SetString("time",
google_apis::util::FormatTimeAsStringLocaltime(log_entry->when));
dict->SetString("logEvent", log_entry->what);
- list.Append(dict);
+ list.Append(std::move(dict));
last_log_id_sent = log_entry->id;
}
if (list.empty())

Powered by Google App Engine
This is Rietveld 408576698