Use std::make_unique instead of absl::make_unique.
WebRTC is now using C++14 so there is no need to use the Abseil version of std::make_unique. This CL has been created with the following steps: git grep -l absl::make_unique | sort | uniq > /tmp/make_unique.txt git grep -l absl::WrapUnique | sort | uniq > /tmp/wrap_unique.txt git grep -l "#include <memory>" | sort | uniq > /tmp/memory.txt diff --new-line-format="" --unchanged-line-format="" \ /tmp/make_unique.txt /tmp/wrap_unique.txt | sort | \ uniq > /tmp/only_make_unique.txt diff --new-line-format="" --unchanged-line-format="" \ /tmp/only_make_unique.txt /tmp/memory.txt | \ xargs grep -l "absl/memory" > /tmp/add-memory.txt git grep -l "\babsl::make_unique\b" | \ xargs sed -i "s/\babsl::make_unique\b/std::make_unique/g" git checkout PRESUBMIT.py abseil-in-webrtc.md cat /tmp/add-memory.txt | \ xargs sed -i \ 's/#include "absl\/memory\/memory.h"/#include <memory>/g' git cl format # Manual fix order of the new inserted #include <memory> cat /tmp/only_make_unique | xargs grep -l "#include <memory>" | \ xargs sed -i '/#include "absl\/memory\/memory.h"/d' git ls-files | grep BUILD.gn | \ xargs sed -i '/\/\/third_party\/abseil-cpp\/absl\/memory/d' python tools_webrtc/gn_check_autofix.py \ -m tryserver.webrtc -b linux_rel # Repead the gn_check_autofix step for other platforms git ls-files | grep BUILD.gn | \ xargs sed -i 's/absl\/memory:memory/absl\/memory/g' git cl format Bug: webrtc:10945 Change-Id: I3fe28ea80f4dd3ba3cf28effd151d5e1f19aff89 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153221 Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#29209}
This commit is contained in:
committed by
Commit Bot
parent
809198edff
commit
317a1f09ed
@ -25,7 +25,6 @@ rtc_static_library("audio_encoder_L16") {
|
||||
"../../../rtc_base:rtc_base_approved",
|
||||
"../../../rtc_base:safe_minmax",
|
||||
"../../../rtc_base/system:rtc_export",
|
||||
"//third_party/abseil-cpp/absl/memory",
|
||||
"//third_party/abseil-cpp/absl/strings",
|
||||
"//third_party/abseil-cpp/absl/types:optional",
|
||||
]
|
||||
@ -43,7 +42,6 @@ rtc_static_library("audio_decoder_L16") {
|
||||
"../../../modules/audio_coding:pcm16b",
|
||||
"../../../rtc_base:rtc_base_approved",
|
||||
"../../../rtc_base/system:rtc_export",
|
||||
"//third_party/abseil-cpp/absl/memory",
|
||||
"//third_party/abseil-cpp/absl/strings",
|
||||
"//third_party/abseil-cpp/absl/types:optional",
|
||||
]
|
||||
|
||||
@ -10,7 +10,8 @@
|
||||
|
||||
#include "api/audio_codecs/L16/audio_decoder_L16.h"
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include <memory>
|
||||
|
||||
#include "absl/strings/match.h"
|
||||
#include "modules/audio_coding/codecs/pcm16b/audio_decoder_pcm16b.h"
|
||||
#include "modules/audio_coding/codecs/pcm16b/pcm16b_common.h"
|
||||
@ -36,7 +37,7 @@ void AudioDecoderL16::AppendSupportedDecoders(
|
||||
std::unique_ptr<AudioDecoder> AudioDecoderL16::MakeAudioDecoder(
|
||||
const Config& config,
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/) {
|
||||
return config.IsOk() ? absl::make_unique<AudioDecoderPcm16B>(
|
||||
return config.IsOk() ? std::make_unique<AudioDecoderPcm16B>(
|
||||
config.sample_rate_hz, config.num_channels)
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
@ -10,7 +10,8 @@
|
||||
|
||||
#include "api/audio_codecs/L16/audio_encoder_L16.h"
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include <memory>
|
||||
|
||||
#include "absl/strings/match.h"
|
||||
#include "modules/audio_coding/codecs/pcm16b/audio_encoder_pcm16b.h"
|
||||
#include "modules/audio_coding/codecs/pcm16b/pcm16b_common.h"
|
||||
@ -63,7 +64,7 @@ std::unique_ptr<AudioEncoder> AudioEncoderL16::MakeAudioEncoder(
|
||||
c.num_channels = config.num_channels;
|
||||
c.frame_size_ms = config.frame_size_ms;
|
||||
c.payload_type = payload_type;
|
||||
return absl::make_unique<AudioEncoderPcm16B>(c);
|
||||
return std::make_unique<AudioEncoderPcm16B>(c);
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -25,7 +25,6 @@ rtc_static_library("audio_encoder_g711") {
|
||||
"../../../rtc_base:rtc_base_approved",
|
||||
"../../../rtc_base:safe_minmax",
|
||||
"../../../rtc_base/system:rtc_export",
|
||||
"//third_party/abseil-cpp/absl/memory",
|
||||
"//third_party/abseil-cpp/absl/strings",
|
||||
"//third_party/abseil-cpp/absl/types:optional",
|
||||
]
|
||||
@ -43,7 +42,6 @@ rtc_static_library("audio_decoder_g711") {
|
||||
"../../../modules/audio_coding:g711",
|
||||
"../../../rtc_base:rtc_base_approved",
|
||||
"../../../rtc_base/system:rtc_export",
|
||||
"//third_party/abseil-cpp/absl/memory",
|
||||
"//third_party/abseil-cpp/absl/strings",
|
||||
"//third_party/abseil-cpp/absl/types:optional",
|
||||
]
|
||||
|
||||
@ -13,7 +13,6 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "absl/strings/match.h"
|
||||
#include "modules/audio_coding/codecs/g711/audio_decoder_pcm.h"
|
||||
#include "rtc_base/numerics/safe_conversions.h"
|
||||
@ -49,9 +48,9 @@ std::unique_ptr<AudioDecoder> AudioDecoderG711::MakeAudioDecoder(
|
||||
RTC_DCHECK(config.IsOk());
|
||||
switch (config.type) {
|
||||
case Config::Type::kPcmU:
|
||||
return absl::make_unique<AudioDecoderPcmU>(config.num_channels);
|
||||
return std::make_unique<AudioDecoderPcmU>(config.num_channels);
|
||||
case Config::Type::kPcmA:
|
||||
return absl::make_unique<AudioDecoderPcmA>(config.num_channels);
|
||||
return std::make_unique<AudioDecoderPcmA>(config.num_channels);
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -13,7 +13,6 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "absl/strings/match.h"
|
||||
#include "modules/audio_coding/codecs/g711/audio_encoder_pcm.h"
|
||||
#include "rtc_base/numerics/safe_conversions.h"
|
||||
@ -70,14 +69,14 @@ std::unique_ptr<AudioEncoder> AudioEncoderG711::MakeAudioEncoder(
|
||||
impl_config.num_channels = config.num_channels;
|
||||
impl_config.frame_size_ms = config.frame_size_ms;
|
||||
impl_config.payload_type = payload_type;
|
||||
return absl::make_unique<AudioEncoderPcmU>(impl_config);
|
||||
return std::make_unique<AudioEncoderPcmU>(impl_config);
|
||||
}
|
||||
case Config::Type::kPcmA: {
|
||||
AudioEncoderPcmA::Config impl_config;
|
||||
impl_config.num_channels = config.num_channels;
|
||||
impl_config.frame_size_ms = config.frame_size_ms;
|
||||
impl_config.payload_type = payload_type;
|
||||
return absl::make_unique<AudioEncoderPcmA>(impl_config);
|
||||
return std::make_unique<AudioEncoderPcmA>(impl_config);
|
||||
}
|
||||
default: {
|
||||
return nullptr;
|
||||
|
||||
@ -33,7 +33,6 @@ rtc_static_library("audio_encoder_g722") {
|
||||
"../../../rtc_base:rtc_base_approved",
|
||||
"../../../rtc_base:safe_minmax",
|
||||
"../../../rtc_base/system:rtc_export",
|
||||
"//third_party/abseil-cpp/absl/memory",
|
||||
"//third_party/abseil-cpp/absl/strings",
|
||||
"//third_party/abseil-cpp/absl/types:optional",
|
||||
]
|
||||
@ -51,7 +50,6 @@ rtc_static_library("audio_decoder_g722") {
|
||||
"../../../modules/audio_coding:g722",
|
||||
"../../../rtc_base:rtc_base_approved",
|
||||
"../../../rtc_base/system:rtc_export",
|
||||
"//third_party/abseil-cpp/absl/memory",
|
||||
"//third_party/abseil-cpp/absl/strings",
|
||||
"//third_party/abseil-cpp/absl/types:optional",
|
||||
]
|
||||
|
||||
@ -13,7 +13,6 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "absl/strings/match.h"
|
||||
#include "modules/audio_coding/codecs/g722/audio_decoder_g722.h"
|
||||
#include "rtc_base/numerics/safe_conversions.h"
|
||||
@ -40,9 +39,9 @@ std::unique_ptr<AudioDecoder> AudioDecoderG722::MakeAudioDecoder(
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/) {
|
||||
switch (config.num_channels) {
|
||||
case 1:
|
||||
return absl::make_unique<AudioDecoderG722Impl>();
|
||||
return std::make_unique<AudioDecoderG722Impl>();
|
||||
case 2:
|
||||
return absl::make_unique<AudioDecoderG722StereoImpl>();
|
||||
return std::make_unique<AudioDecoderG722StereoImpl>();
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -13,7 +13,6 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "absl/strings/match.h"
|
||||
#include "modules/audio_coding/codecs/g722/audio_encoder_g722.h"
|
||||
#include "rtc_base/numerics/safe_conversions.h"
|
||||
@ -62,7 +61,7 @@ std::unique_ptr<AudioEncoder> AudioEncoderG722::MakeAudioEncoder(
|
||||
int payload_type,
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/) {
|
||||
RTC_DCHECK(config.IsOk());
|
||||
return absl::make_unique<AudioEncoderG722Impl>(config, payload_type);
|
||||
return std::make_unique<AudioEncoderG722Impl>(config, payload_type);
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -32,7 +32,6 @@ rtc_static_library("audio_encoder_ilbc") {
|
||||
"../../../modules/audio_coding:ilbc",
|
||||
"../../../rtc_base:rtc_base_approved",
|
||||
"../../../rtc_base:safe_minmax",
|
||||
"//third_party/abseil-cpp/absl/memory",
|
||||
"//third_party/abseil-cpp/absl/strings",
|
||||
"//third_party/abseil-cpp/absl/types:optional",
|
||||
]
|
||||
@ -49,7 +48,6 @@ rtc_static_library("audio_decoder_ilbc") {
|
||||
"..:audio_codecs_api",
|
||||
"../../../modules/audio_coding:ilbc",
|
||||
"../../../rtc_base:rtc_base_approved",
|
||||
"//third_party/abseil-cpp/absl/memory",
|
||||
"//third_party/abseil-cpp/absl/strings",
|
||||
"//third_party/abseil-cpp/absl/types:optional",
|
||||
]
|
||||
|
||||
@ -13,7 +13,6 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "absl/strings/match.h"
|
||||
#include "modules/audio_coding/codecs/ilbc/audio_decoder_ilbc.h"
|
||||
|
||||
@ -35,7 +34,7 @@ void AudioDecoderIlbc::AppendSupportedDecoders(
|
||||
std::unique_ptr<AudioDecoder> AudioDecoderIlbc::MakeAudioDecoder(
|
||||
Config config,
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/) {
|
||||
return absl::make_unique<AudioDecoderIlbcImpl>();
|
||||
return std::make_unique<AudioDecoderIlbcImpl>();
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -13,7 +13,6 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "absl/strings/match.h"
|
||||
#include "modules/audio_coding/codecs/ilbc/audio_encoder_ilbc.h"
|
||||
#include "rtc_base/numerics/safe_conversions.h"
|
||||
@ -76,7 +75,7 @@ std::unique_ptr<AudioEncoder> AudioEncoderIlbc::MakeAudioEncoder(
|
||||
int payload_type,
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/) {
|
||||
RTC_DCHECK(config.IsOk());
|
||||
return absl::make_unique<AudioEncoderIlbcImpl>(config, payload_type);
|
||||
return std::make_unique<AudioEncoderIlbcImpl>(config, payload_type);
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -79,7 +79,6 @@ rtc_static_library("audio_encoder_isac_fix") {
|
||||
"..:audio_codecs_api",
|
||||
"../../../modules/audio_coding:isac_fix",
|
||||
"../../../rtc_base:rtc_base_approved",
|
||||
"//third_party/abseil-cpp/absl/memory",
|
||||
"//third_party/abseil-cpp/absl/strings",
|
||||
"//third_party/abseil-cpp/absl/types:optional",
|
||||
]
|
||||
@ -96,7 +95,6 @@ rtc_static_library("audio_decoder_isac_fix") {
|
||||
"..:audio_codecs_api",
|
||||
"../../../modules/audio_coding:isac_fix",
|
||||
"../../../rtc_base:rtc_base_approved",
|
||||
"//third_party/abseil-cpp/absl/memory",
|
||||
"//third_party/abseil-cpp/absl/strings",
|
||||
"//third_party/abseil-cpp/absl/types:optional",
|
||||
]
|
||||
@ -114,7 +112,6 @@ rtc_static_library("audio_encoder_isac_float") {
|
||||
"../../../modules/audio_coding:isac",
|
||||
"../../../rtc_base:rtc_base_approved",
|
||||
"../../../rtc_base/system:rtc_export",
|
||||
"//third_party/abseil-cpp/absl/memory",
|
||||
"//third_party/abseil-cpp/absl/strings",
|
||||
"//third_party/abseil-cpp/absl/types:optional",
|
||||
]
|
||||
@ -132,7 +129,6 @@ rtc_static_library("audio_decoder_isac_float") {
|
||||
"../../../modules/audio_coding:isac",
|
||||
"../../../rtc_base:rtc_base_approved",
|
||||
"../../../rtc_base/system:rtc_export",
|
||||
"//third_party/abseil-cpp/absl/memory",
|
||||
"//third_party/abseil-cpp/absl/strings",
|
||||
"//third_party/abseil-cpp/absl/types:optional",
|
||||
]
|
||||
|
||||
@ -10,7 +10,8 @@
|
||||
|
||||
#include "api/audio_codecs/isac/audio_decoder_isac_fix.h"
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include <memory>
|
||||
|
||||
#include "absl/strings/match.h"
|
||||
#include "modules/audio_coding/codecs/isac/fix/include/audio_decoder_isacfix.h"
|
||||
|
||||
@ -34,7 +35,7 @@ std::unique_ptr<AudioDecoder> AudioDecoderIsacFix::MakeAudioDecoder(
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/) {
|
||||
AudioDecoderIsacFixImpl::Config c;
|
||||
c.sample_rate_hz = 16000;
|
||||
return absl::make_unique<AudioDecoderIsacFixImpl>(c);
|
||||
return std::make_unique<AudioDecoderIsacFixImpl>(c);
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -10,7 +10,8 @@
|
||||
|
||||
#include "api/audio_codecs/isac/audio_decoder_isac_float.h"
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include <memory>
|
||||
|
||||
#include "absl/strings/match.h"
|
||||
#include "modules/audio_coding/codecs/isac/main/include/audio_decoder_isac.h"
|
||||
|
||||
@ -41,7 +42,7 @@ std::unique_ptr<AudioDecoder> AudioDecoderIsacFloat::MakeAudioDecoder(
|
||||
RTC_DCHECK(config.IsOk());
|
||||
AudioDecoderIsacFloatImpl::Config c;
|
||||
c.sample_rate_hz = config.sample_rate_hz;
|
||||
return absl::make_unique<AudioDecoderIsacFloatImpl>(c);
|
||||
return std::make_unique<AudioDecoderIsacFloatImpl>(c);
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -10,7 +10,8 @@
|
||||
|
||||
#include "api/audio_codecs/isac/audio_encoder_isac_fix.h"
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include <memory>
|
||||
|
||||
#include "absl/strings/match.h"
|
||||
#include "modules/audio_coding/codecs/isac/fix/include/audio_encoder_isacfix.h"
|
||||
#include "rtc_base/string_to_number.h"
|
||||
@ -56,7 +57,7 @@ std::unique_ptr<AudioEncoder> AudioEncoderIsacFix::MakeAudioEncoder(
|
||||
AudioEncoderIsacFixImpl::Config c;
|
||||
c.frame_size_ms = config.frame_size_ms;
|
||||
c.payload_type = payload_type;
|
||||
return absl::make_unique<AudioEncoderIsacFixImpl>(c);
|
||||
return std::make_unique<AudioEncoderIsacFixImpl>(c);
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -10,7 +10,8 @@
|
||||
|
||||
#include "api/audio_codecs/isac/audio_encoder_isac_float.h"
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include <memory>
|
||||
|
||||
#include "absl/strings/match.h"
|
||||
#include "modules/audio_coding/codecs/isac/main/include/audio_encoder_isac.h"
|
||||
#include "rtc_base/string_to_number.h"
|
||||
@ -70,7 +71,7 @@ std::unique_ptr<AudioEncoder> AudioEncoderIsacFloat::MakeAudioEncoder(
|
||||
c.sample_rate_hz = config.sample_rate_hz;
|
||||
c.frame_size_ms = config.frame_size_ms;
|
||||
c.bit_rate = config.bit_rate;
|
||||
return absl::make_unique<AudioEncoderIsacFloatImpl>(c);
|
||||
return std::make_unique<AudioEncoderIsacFloatImpl>(c);
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -72,7 +72,6 @@ rtc_static_library("audio_decoder_opus") {
|
||||
"../../../modules/audio_coding:webrtc_opus",
|
||||
"../../../rtc_base:rtc_base_approved",
|
||||
"../../../rtc_base/system:rtc_export",
|
||||
"//third_party/abseil-cpp/absl/memory",
|
||||
"//third_party/abseil-cpp/absl/strings",
|
||||
"//third_party/abseil-cpp/absl/types:optional",
|
||||
]
|
||||
|
||||
@ -14,7 +14,6 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "absl/strings/match.h"
|
||||
#include "modules/audio_coding/codecs/opus/audio_decoder_opus.h"
|
||||
|
||||
@ -73,8 +72,8 @@ std::unique_ptr<AudioDecoder> AudioDecoderOpus::MakeAudioDecoder(
|
||||
Config config,
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/) {
|
||||
RTC_DCHECK(config.IsOk());
|
||||
return absl::make_unique<AudioDecoderOpusImpl>(config.num_channels,
|
||||
config.sample_rate_hz);
|
||||
return std::make_unique<AudioDecoderOpusImpl>(config.num_channels,
|
||||
config.sample_rate_hz);
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -38,7 +38,6 @@ if (rtc_include_tests) {
|
||||
"../isac:audio_encoder_isac_float",
|
||||
"../opus:audio_decoder_opus",
|
||||
"../opus:audio_encoder_opus",
|
||||
"//third_party/abseil-cpp/absl/memory",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,7 +10,8 @@
|
||||
|
||||
#include "api/audio_codecs/audio_decoder_factory_template.h"
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include <memory>
|
||||
|
||||
#include "api/audio_codecs/L16/audio_decoder_L16.h"
|
||||
#include "api/audio_codecs/g711/audio_decoder_g711.h"
|
||||
#include "api/audio_codecs/g722/audio_decoder_g722.h"
|
||||
@ -65,7 +66,7 @@ struct AudioDecoderFakeApi {
|
||||
static std::unique_ptr<AudioDecoder> MakeAudioDecoder(
|
||||
const Config&,
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/ = absl::nullopt) {
|
||||
auto dec = absl::make_unique<testing::StrictMock<MockAudioDecoder>>();
|
||||
auto dec = std::make_unique<testing::StrictMock<MockAudioDecoder>>();
|
||||
EXPECT_CALL(*dec, SampleRateHz())
|
||||
.WillOnce(::testing::Return(Params::CodecInfo().sample_rate_hz));
|
||||
EXPECT_CALL(*dec, Die());
|
||||
|
||||
@ -10,7 +10,8 @@
|
||||
|
||||
#include "api/audio_codecs/audio_encoder_factory_template.h"
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include <memory>
|
||||
|
||||
#include "api/audio_codecs/L16/audio_encoder_L16.h"
|
||||
#include "api/audio_codecs/g711/audio_encoder_g711.h"
|
||||
#include "api/audio_codecs/g722/audio_encoder_g722.h"
|
||||
@ -66,7 +67,7 @@ struct AudioEncoderFakeApi {
|
||||
const Config&,
|
||||
int payload_type,
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/ = absl::nullopt) {
|
||||
auto enc = absl::make_unique<testing::StrictMock<MockAudioEncoder>>();
|
||||
auto enc = std::make_unique<testing::StrictMock<MockAudioEncoder>>();
|
||||
EXPECT_CALL(*enc, SampleRateHz())
|
||||
.WillOnce(::testing::Return(Params::CodecInfo().sample_rate_hz));
|
||||
return std::move(enc);
|
||||
|
||||
Reference in New Issue
Block a user