Replace more instances of rtc::RefCountedObject with make_ref_counted.
This is essentially replacing `new rtc::RefCountedObject` with
`rtc::make_ref_counted` in many files. In a couple of places I
made minor tweaks to make things compile such as adding parenthesis
when they were missing.
Bug: webrtc:12701
Change-Id: I3828dbf3ee0eb0232f3a47067474484ac2f4aed2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215973
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33852}
diff --git a/pc/track_media_info_map_unittest.cc b/pc/track_media_info_map_unittest.cc
index 0cb1e0e..2a4889a 100644
--- a/pc/track_media_info_map_unittest.cc
+++ b/pc/track_media_info_map_unittest.cc
@@ -52,8 +52,7 @@
} else {
first_ssrc = 0;
}
- rtc::scoped_refptr<MockRtpSenderInternal> sender(
- new rtc::RefCountedObject<MockRtpSenderInternal>());
+ auto sender = rtc::make_ref_counted<MockRtpSenderInternal>();
EXPECT_CALL(*sender, track())
.WillRepeatedly(::testing::Return(std::move(track)));
EXPECT_CALL(*sender, ssrc()).WillRepeatedly(::testing::Return(first_ssrc));
@@ -69,8 +68,7 @@
cricket::MediaType media_type,
std::initializer_list<uint32_t> ssrcs,
rtc::scoped_refptr<MediaStreamTrackInterface> track) {
- rtc::scoped_refptr<MockRtpReceiverInternal> receiver(
- new rtc::RefCountedObject<MockRtpReceiverInternal>());
+ auto receiver = rtc::make_ref_counted<MockRtpReceiverInternal>();
EXPECT_CALL(*receiver, track())
.WillRepeatedly(::testing::Return(std::move(track)));
EXPECT_CALL(*receiver, media_type())