Use absl::make_unique and absl::WrapUnique directly
Instead of going through our wrappers in ptr_util.h.
This CL was generated by the following script:
git grep -l ptr_util | xargs perl -pi -e 's,#include "rtc_base/ptr_util.h",#include "absl/memory/memory.h",'
git grep -l MakeUnique | xargs perl -pi -e 's,\b(rtc::)?MakeUnique\b,absl::make_unique,g'
git grep -l WrapUnique | xargs perl -pi -e 's,\b(rtc::)?WrapUnique\b,absl::WrapUnique,g'
git checkout -- rtc_base/ptr_util{.h,_unittest.cc}
git cl format
Followed by manually adding dependencies on
//third_party/abseil-cpp/absl/memory until `gn check` stopped
complaining.
Bug: webrtc:9473
Change-Id: I89ccd363f070479b8c431eb2c3d404a46eaacc1c
Reviewed-on: https://webrtc-review.googlesource.com/86600
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23850}
diff --git a/video/video_send_stream_tests.cc b/video/video_send_stream_tests.cc
index c6122a7..89c048f 100644
--- a/video/video_send_stream_tests.cc
+++ b/video/video_send_stream_tests.cc
@@ -204,7 +204,7 @@
public:
TransmissionTimeOffsetObserver()
: SendTest(kDefaultTimeoutMs), encoder_factory_([]() {
- return rtc::MakeUnique<test::DelayedEncoder>(
+ return absl::make_unique<test::DelayedEncoder>(
Clock::GetRealTimeClock(), kEncodeDelayMs);
}) {
EXPECT_TRUE(parser_->RegisterRtpHeaderExtension(
@@ -251,7 +251,7 @@
public:
TransportWideSequenceNumberObserver()
: SendTest(kDefaultTimeoutMs), encoder_factory_([]() {
- return rtc::MakeUnique<test::FakeEncoder>(
+ return absl::make_unique<test::FakeEncoder>(
Clock::GetRealTimeClock());
}) {
EXPECT_TRUE(parser_->RegisterRtpHeaderExtension(
@@ -612,7 +612,7 @@
// that the received state is actually decodable.
TEST_F(VideoSendStreamTest, DoesNotUtilizeUlpfecForH264WithNackEnabled) {
test::FunctionVideoEncoderFactory encoder_factory([]() {
- return rtc::MakeUnique<test::FakeH264Encoder>(Clock::GetRealTimeClock());
+ return absl::make_unique<test::FakeH264Encoder>(Clock::GetRealTimeClock());
});
UlpfecObserver test(false, true, true, false, "H264", &encoder_factory);
RunBaseTest(&test);
@@ -621,7 +621,7 @@
// Without retransmissions FEC for H264 is fine.
TEST_F(VideoSendStreamTest, DoesUtilizeUlpfecForH264WithoutNackEnabled) {
test::FunctionVideoEncoderFactory encoder_factory([]() {
- return rtc::MakeUnique<test::FakeH264Encoder>(Clock::GetRealTimeClock());
+ return absl::make_unique<test::FakeH264Encoder>(Clock::GetRealTimeClock());
});
UlpfecObserver test(false, false, true, true, "H264", &encoder_factory);
RunBaseTest(&test);
@@ -647,7 +647,7 @@
TEST_F(VideoSendStreamTest, SupportsUlpfecWithMultithreadedH264) {
test::FunctionVideoEncoderFactory encoder_factory([]() {
- return rtc::MakeUnique<test::MultithreadedFakeH264Encoder>(
+ return absl::make_unique<test::MultithreadedFakeH264Encoder>(
Clock::GetRealTimeClock());
});
UlpfecObserver test(false, false, true, true, "H264", &encoder_factory);
@@ -801,7 +801,7 @@
TEST_F(VideoSendStreamTest, SupportsFlexfecH264) {
test::FunctionVideoEncoderFactory encoder_factory([]() {
- return rtc::MakeUnique<test::FakeH264Encoder>(Clock::GetRealTimeClock());
+ return absl::make_unique<test::FakeH264Encoder>(Clock::GetRealTimeClock());
});
FlexfecObserver test(false, false, "H264", &encoder_factory, 1);
RunBaseTest(&test);
@@ -809,7 +809,7 @@
TEST_F(VideoSendStreamTest, SupportsFlexfecWithNackH264) {
test::FunctionVideoEncoderFactory encoder_factory([]() {
- return rtc::MakeUnique<test::FakeH264Encoder>(Clock::GetRealTimeClock());
+ return absl::make_unique<test::FakeH264Encoder>(Clock::GetRealTimeClock());
});
FlexfecObserver test(false, true, "H264", &encoder_factory, 1);
RunBaseTest(&test);
@@ -817,7 +817,7 @@
TEST_F(VideoSendStreamTest, SupportsFlexfecWithMultithreadedH264) {
test::FunctionVideoEncoderFactory encoder_factory([]() {
- return rtc::MakeUnique<test::MultithreadedFakeH264Encoder>(
+ return absl::make_unique<test::MultithreadedFakeH264Encoder>(
Clock::GetRealTimeClock());
});