Replace most explicit new RefCountedObject... with make_ref_counted

Bug: webrtc:12701
Change-Id: Iab91f1e96715eed7f9ddcfe1ca55510a18c817eb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/224544
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35786}
This commit is contained in:
Niels Möller
2022-01-25 13:56:07 +01:00
committed by WebRTC LUCI CQ
parent b428d6bad4
commit 027c793c57
16 changed files with 37 additions and 55 deletions

View File

@ -59,7 +59,7 @@ class DummySetSessionDescriptionObserver
: public webrtc::SetSessionDescriptionObserver {
public:
static DummySetSessionDescriptionObserver* Create() {
return new rtc::RefCountedObject<DummySetSessionDescriptionObserver>();
return rtc::make_ref_counted<DummySetSessionDescriptionObserver>();
}
virtual void OnSuccess() { RTC_LOG(LS_INFO) << __FUNCTION__; }
virtual void OnFailure(webrtc::RTCError error) {

View File

@ -101,8 +101,7 @@ int main(int argc, char* argv[]) {
rtc::InitializeSSL();
// Must be constructed after we set the socketserver.
PeerConnectionClient client;
rtc::scoped_refptr<Conductor> conductor(
new rtc::RefCountedObject<Conductor>(&client, &wnd));
auto conductor = rtc::make_ref_counted<Conductor>(&client, &wnd);
socket_server.set_client(&client);
socket_server.set_conductor(conductor);

View File

@ -107,8 +107,7 @@ int PASCAL wWinMain(HINSTANCE instance,
rtc::InitializeSSL();
PeerConnectionClient client;
rtc::scoped_refptr<Conductor> conductor(
new rtc::RefCountedObject<Conductor>(&client, &wnd));
auto conductor = rtc::make_ref_counted<Conductor>(&client, &wnd);
// Main loop.
MSG msg;