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 {