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

Unified Diff: chrome/browser/ui/webui/options/media_devices_selection_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/media_devices_selection_handler.cc
diff --git a/chrome/browser/ui/webui/options/media_devices_selection_handler.cc b/chrome/browser/ui/webui/options/media_devices_selection_handler.cc
index 77618f38866431cd4d0dfd7499f86b56e3e19de1..cb5009b15215ceb27225ae6385ea18147f380cb6 100644
--- a/chrome/browser/ui/webui/options/media_devices_selection_handler.cc
+++ b/chrome/browser/ui/webui/options/media_devices_selection_handler.cc
@@ -6,6 +6,9 @@
#include <stddef.h>
+#include <memory>
+#include <utility>
+
#include "base/bind.h"
#include "base/macros.h"
#include "chrome/browser/profiles/profile.h"
@@ -109,10 +112,10 @@ void MediaDevicesSelectionHandler::UpdateDevicesMenu(
std::string default_id;
base::ListValue device_list;
for (size_t i = 0; i < devices.size(); ++i) {
- base::DictionaryValue* entry = new base::DictionaryValue();
+ std::unique_ptr<base::DictionaryValue> entry(new base::DictionaryValue());
entry->SetString("name", devices[i].name);
entry->SetString("id", devices[i].id);
- device_list.Append(entry);
+ device_list.Append(std::move(entry));
if (devices[i].id == default_device)
default_id = default_device;
}
« no previous file with comments | « chrome/browser/ui/webui/options/language_options_handler.cc ('k') | chrome/browser/ui/webui/options/options_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698