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/test/mock_audio_decoder_factory.h b/test/mock_audio_decoder_factory.h
index cdb03d3..4d3eed2 100644
--- a/test/mock_audio_decoder_factory.h
+++ b/test/mock_audio_decoder_factory.h
@@ -52,7 +52,7 @@
using ::testing::Return;
rtc::scoped_refptr<webrtc::MockAudioDecoderFactory> factory =
- new rtc::RefCountedObject<webrtc::MockAudioDecoderFactory>;
+ rtc::make_ref_counted<webrtc::MockAudioDecoderFactory>();
ON_CALL(*factory.get(), GetSupportedDecoders())
.WillByDefault(Return(std::vector<webrtc::AudioCodecSpec>()));
EXPECT_CALL(*factory.get(), GetSupportedDecoders()).Times(AnyNumber());
@@ -73,7 +73,7 @@
using ::testing::SetArgPointee;
rtc::scoped_refptr<webrtc::MockAudioDecoderFactory> factory =
- new rtc::RefCountedObject<webrtc::MockAudioDecoderFactory>;
+ rtc::make_ref_counted<webrtc::MockAudioDecoderFactory>();
ON_CALL(*factory.get(), GetSupportedDecoders())
.WillByDefault(Return(std::vector<webrtc::AudioCodecSpec>()));
EXPECT_CALL(*factory.get(), GetSupportedDecoders()).Times(AnyNumber());