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

Unified Diff: content/browser/media/media_internals.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: content/browser/media/media_internals.cc
diff --git a/content/browser/media/media_internals.cc b/content/browser/media/media_internals.cc
index 6b3e0cd65d5fc849625edc8372e2e1a4afbceeb8..33df1a834fc3b6d18f9947b8372a5f26e900e05b 100644
--- a/content/browser/media/media_internals.cc
+++ b/content/browser/media/media_internals.cc
@@ -5,6 +5,8 @@
#include "content/browser/media/media_internals.h"
#include <stddef.h>
+
+#include <memory>
#include <utility>
#include "base/macros.h"
@@ -611,7 +613,8 @@ void MediaInternals::UpdateVideoCaptureDeviceCapabilities(
for (const auto& format : video_capture_device_info.supported_formats)
format_list->AppendString(media::VideoCaptureFormat::ToString(format));
- base::DictionaryValue* device_dict = new base::DictionaryValue();
+ std::unique_ptr<base::DictionaryValue> device_dict(
+ new base::DictionaryValue());
device_dict->SetString("id", video_capture_device_info.name.id());
device_dict->SetString(
"name", video_capture_device_info.name.GetNameAndModel());
@@ -621,7 +624,7 @@ void MediaInternals::UpdateVideoCaptureDeviceCapabilities(
device_dict->SetString(
"captureApi", video_capture_device_info.name.GetCaptureApiTypeString());
#endif
- video_capture_capabilities_cached_data_.Append(device_dict);
+ video_capture_capabilities_cached_data_.Append(std::move(device_dict));
}
SendVideoCaptureDeviceCapabilities();
« no previous file with comments | « content/browser/gpu/gpu_data_manager_impl_private.cc ('k') | content/browser/net/network_errors_listing_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698