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/modules/audio_processing/audio_processing_impl_unittest.cc b/modules/audio_processing/audio_processing_impl_unittest.cc
index ef18303..ca8b8b4 100644
--- a/modules/audio_processing/audio_processing_impl_unittest.cc
+++ b/modules/audio_processing/audio_processing_impl_unittest.cc
@@ -544,8 +544,7 @@
 TEST(AudioProcessingImplTest, RenderPreProcessorBeforeEchoDetector) {
   // Make sure that signal changes caused by a render pre-processing sub-module
   // take place before any echo detector analysis.
-  rtc::scoped_refptr<TestEchoDetector> test_echo_detector(
-      new rtc::RefCountedObject<TestEchoDetector>());
+  auto test_echo_detector = rtc::make_ref_counted<TestEchoDetector>();
   std::unique_ptr<CustomProcessing> test_render_pre_processor(
       new TestRenderPreProcessor());
   // Create APM injecting the test echo detector and render pre-processor.
@@ -605,8 +604,7 @@
 // config should be bit-exact with running APM with said submodules disabled.
 // This mainly tests that SetCreateOptionalSubmodulesForTesting has an effect.
 TEST(ApmWithSubmodulesExcludedTest, BitexactWithDisabledModules) {
-  rtc::scoped_refptr<AudioProcessingImpl> apm =
-      new rtc::RefCountedObject<AudioProcessingImpl>(webrtc::Config());
+  auto apm = rtc::make_ref_counted<AudioProcessingImpl>(webrtc::Config());
   ASSERT_EQ(apm->Initialize(), AudioProcessing::kNoError);
 
   ApmSubmoduleCreationOverrides overrides;
@@ -654,8 +652,7 @@
 // Disable transient suppressor creation and run APM in ways that should trigger
 // calls to the transient suppressor API.
 TEST(ApmWithSubmodulesExcludedTest, ReinitializeTransientSuppressor) {
-  rtc::scoped_refptr<AudioProcessingImpl> apm =
-      new rtc::RefCountedObject<AudioProcessingImpl>(webrtc::Config());
+  auto apm = rtc::make_ref_counted<AudioProcessingImpl>(webrtc::Config());
   ASSERT_EQ(apm->Initialize(), kNoErr);
 
   ApmSubmoduleCreationOverrides overrides;
@@ -716,8 +713,7 @@
 // Disable transient suppressor creation and run APM in ways that should trigger
 // calls to the transient suppressor API.
 TEST(ApmWithSubmodulesExcludedTest, ToggleTransientSuppressor) {
-  rtc::scoped_refptr<AudioProcessingImpl> apm =
-      new rtc::RefCountedObject<AudioProcessingImpl>(webrtc::Config());
+  auto apm = rtc::make_ref_counted<AudioProcessingImpl>(webrtc::Config());
   ASSERT_EQ(apm->Initialize(), AudioProcessing::kNoError);
 
   ApmSubmoduleCreationOverrides overrides;