Make RtpTransceiver not inherit from RefCountedObject.
Also update API proxy Create() factory functions to accept the inner
reference counted object via scoped_refptr instead of a raw pointer.
This is to avoid accidentally creating and deleting an object when
passing an inner object to a proxy class.
Consider something like:
auto proxy = MyProxy::Create(
signaling_thread(), make_ref_counted<Foo>());
Bug: webrtc:13464, webrtc:12701
Change-Id: I55ccfff43bbc164a5e909b2c9020e306ebb09075
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256010
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36261}
diff --git a/pc/proxy_unittest.cc b/pc/proxy_unittest.cc
index ab02359..48c087f 100644
--- a/pc/proxy_unittest.cc
+++ b/pc/proxy_unittest.cc
@@ -98,7 +98,7 @@
ASSERT_TRUE(signaling_thread_->Start());
fake_ = Fake::Create();
fake_signaling_proxy_ =
- FakeSignalingProxy::Create(signaling_thread_.get(), fake_.get());
+ FakeSignalingProxy::Create(signaling_thread_.get(), fake_);
}
protected:
@@ -186,8 +186,8 @@
ASSERT_TRUE(signaling_thread_->Start());
ASSERT_TRUE(worker_thread_->Start());
fake_ = Fake::Create();
- fake_proxy_ = FakeProxy::Create(signaling_thread_.get(),
- worker_thread_.get(), fake_.get());
+ fake_proxy_ =
+ FakeProxy::Create(signaling_thread_.get(), worker_thread_.get(), fake_);
}
protected: