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

Unified Diff: content/renderer/media/peer_connection_tracker.cc

Issue 2285933003: Remove more usage of the base::ListValue::Append(Value*) overload. (Closed)
Patch Set: rebase Created 4 years, 4 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
« no previous file with comments | « content/renderer/devtools/devtools_agent.cc ('k') | device/geolocation/network_location_request.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/peer_connection_tracker.cc
diff --git a/content/renderer/media/peer_connection_tracker.cc b/content/renderer/media/peer_connection_tracker.cc
index c76674bde73cbdab54e5e00e6e53aa7016e5ab21..3e2dc702483711cdcbe025876c565dd167689214 100644
--- a/content/renderer/media/peer_connection_tracker.cc
+++ b/content/renderer/media/peer_connection_tracker.cc
@@ -1,11 +1,15 @@
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+
#include "content/renderer/media/peer_connection_tracker.h"
#include <stddef.h>
#include <stdint.h>
+#include <memory>
+#include <utility>
+
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/threading/thread_task_runner_handle.h"
@@ -271,7 +275,8 @@ static base::DictionaryValue* GetDictValueStats(const StatsReport& report) {
// Builds a DictionaryValue from the StatsReport.
// The caller takes the ownership of the returned value.
-static base::DictionaryValue* GetDictValue(const StatsReport& report) {
+static std::unique_ptr<base::DictionaryValue> GetDictValue(
+ const StatsReport& report) {
std::unique_ptr<base::DictionaryValue> stats, result;
stats.reset(GetDictValueStats(report));
@@ -286,7 +291,7 @@ static base::DictionaryValue* GetDictValue(const StatsReport& report) {
result->SetString("id", report.id()->ToString());
result->SetString("type", report.TypeToString());
- return result.release();
+ return result;
}
class InternalStatsObserver : public webrtc::StatsObserver {
@@ -298,9 +303,9 @@ class InternalStatsObserver : public webrtc::StatsObserver {
std::unique_ptr<base::ListValue> list(new base::ListValue());
for (const auto* r : reports) {
- base::DictionaryValue* report = GetDictValue(*r);
+ std::unique_ptr<base::DictionaryValue> report = GetDictValue(*r);
if (report)
- list->Append(report);
+ list->Append(std::move(report));
}
if (!list->empty()) {
« no previous file with comments | « content/renderer/devtools/devtools_agent.cc ('k') | device/geolocation/network_location_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698