From bf75041b8da9cf7882b9a42da0dfdf600e14f47d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= Date: Thu, 22 Jul 2021 10:08:25 +0200 Subject: [PATCH] Update stats_types.cc to use make_ref_counted. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: webrtc:12701 Change-Id: I2db12680ae35359e02627edfea5f67910c39c431 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226740 Reviewed-by: Harald Alvestrand Reviewed-by: Henrik Boström Commit-Queue: Niels Moller Cr-Commit-Position: refs/heads/master@{#34715} --- api/stats_types.cc | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/api/stats_types.cc b/api/stats_types.cc index 6e62bba7cc..ddba593a1e 100644 --- a/api/stats_types.cc +++ b/api/stats_types.cc @@ -23,8 +23,6 @@ // generate strongly typed inline C++ code that forces the correct type to be // used for a given name at compile time. -using rtc::RefCountedObject; - namespace webrtc { namespace { @@ -690,17 +688,17 @@ StatsReport::~StatsReport() = default; // static StatsReport::Id StatsReport::NewBandwidthEstimationId() { - return Id(new RefCountedObject()); + return rtc::make_ref_counted(); } // static StatsReport::Id StatsReport::NewTypedId(StatsType type, const std::string& id) { - return Id(new RefCountedObject(type, id)); + return rtc::make_ref_counted(type, id); } // static StatsReport::Id StatsReport::NewTypedIntId(StatsType type, int id) { - return Id(new RefCountedObject(type, id)); + return rtc::make_ref_counted(type, id); } // static @@ -708,26 +706,25 @@ StatsReport::Id StatsReport::NewIdWithDirection( StatsType type, const std::string& id, StatsReport::Direction direction) { - return Id(new RefCountedObject(type, id, direction)); + return rtc::make_ref_counted(type, id, direction); } // static StatsReport::Id StatsReport::NewCandidateId(bool local, const std::string& id) { - return Id(new RefCountedObject(local, id)); + return rtc::make_ref_counted(local, id); } // static StatsReport::Id StatsReport::NewComponentId(const std::string& content_name, int component) { - return Id(new RefCountedObject(content_name, component)); + return rtc::make_ref_counted(content_name, component); } // static StatsReport::Id StatsReport::NewCandidatePairId(const std::string& content_name, int component, int index) { - return Id( - new RefCountedObject(content_name, component, index)); + return rtc::make_ref_counted(content_name, component, index); } const char* StatsReport::TypeToString() const {