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}
diff --git a/modules/audio_processing/BUILD.gn b/modules/audio_processing/BUILD.gn
index 1341f76..d2be4f8 100644
--- a/modules/audio_processing/BUILD.gn
+++ b/modules/audio_processing/BUILD.gn
@@ -58,7 +58,6 @@
"../../rtc_base:rtc_base_approved",
"../../rtc_base/system:arch",
"../../rtc_base/system:rtc_export",
- "//third_party/abseil-cpp/absl/memory",
"//third_party/abseil-cpp/absl/types:optional",
]
}
@@ -202,7 +201,6 @@
"agc2:fixed_digital",
"agc2:gain_applier",
"vad",
- "//third_party/abseil-cpp/absl/memory",
"//third_party/abseil-cpp/absl/types:optional",
]
@@ -301,7 +299,6 @@
"../../common_audio",
"../../rtc_base:rtc_base_approved",
"../../system_wrappers",
- "//third_party/abseil-cpp/absl/memory",
]
}
@@ -503,7 +500,6 @@
"utility:pffft_wrapper_unittest",
"vad:vad_unittests",
"//testing/gtest",
- "//third_party/abseil-cpp/absl/memory",
"//third_party/abseil-cpp/absl/types:optional",
]
@@ -609,7 +605,6 @@
"../../rtc_base:rtc_base_approved",
"../../rtc_base:safe_minmax",
"agc:gain_map",
- "//third_party/abseil-cpp/absl/memory",
"//third_party/abseil-cpp/absl/types:optional",
]
}
@@ -655,7 +650,6 @@
"//testing/gtest",
"//third_party/abseil-cpp/absl/flags:flag",
"//third_party/abseil-cpp/absl/flags:parse",
- "//third_party/abseil-cpp/absl/memory",
"//third_party/abseil-cpp/absl/strings",
"//third_party/abseil-cpp/absl/types:optional",
]
@@ -670,7 +664,6 @@
":audio_processing",
"../../api:audioproc_f_api",
"../../rtc_base:rtc_base_approved",
- "//third_party/abseil-cpp/absl/memory",
]
} # audioproc_f
}
@@ -766,7 +759,6 @@
"../../rtc_base:protobuf_utils",
"../../rtc_base:rtc_base_approved",
"../../rtc_base/system:arch",
- "//third_party/abseil-cpp/absl/memory:memory",
]
}
diff --git a/modules/audio_processing/aec_dump/BUILD.gn b/modules/audio_processing/aec_dump/BUILD.gn
index 554fee5..419a5ec 100644
--- a/modules/audio_processing/aec_dump/BUILD.gn
+++ b/modules/audio_processing/aec_dump/BUILD.gn
@@ -48,7 +48,6 @@
"../",
"../../../rtc_base:rtc_base_approved",
"//testing/gtest",
- "//third_party/abseil-cpp/absl/memory",
]
}
@@ -74,7 +73,6 @@
"../../../rtc_base:rtc_task_queue",
"../../../rtc_base/system:file_wrapper",
"../../../system_wrappers",
- "//third_party/abseil-cpp/absl/memory",
]
deps += [ "../:audioproc_debug_proto" ]
diff --git a/modules/audio_processing/aec_dump/aec_dump_impl.cc b/modules/audio_processing/aec_dump/aec_dump_impl.cc
index 904033a..a7ac552 100644
--- a/modules/audio_processing/aec_dump/aec_dump_impl.cc
+++ b/modules/audio_processing/aec_dump/aec_dump_impl.cc
@@ -10,9 +10,9 @@
#include "modules/audio_processing/aec_dump/aec_dump_impl.h"
+#include <memory>
#include <utility>
-#include "absl/memory/memory.h"
#include "modules/audio_processing/aec_dump/aec_dump_factory.h"
#include "rtc_base/checks.h"
#include "rtc_base/event.h"
@@ -212,8 +212,8 @@
}
std::unique_ptr<WriteToFileTask> AecDumpImpl::CreateWriteToFileTask() {
- return absl::make_unique<WriteToFileTask>(&debug_file_,
- &num_bytes_left_for_log_);
+ return std::make_unique<WriteToFileTask>(&debug_file_,
+ &num_bytes_left_for_log_);
}
std::unique_ptr<AecDump> AecDumpFactory::Create(webrtc::FileWrapper file,
@@ -223,8 +223,8 @@
if (!file.is_open())
return nullptr;
- return absl::make_unique<AecDumpImpl>(std::move(file), max_log_size_bytes,
- worker_queue);
+ return std::make_unique<AecDumpImpl>(std::move(file), max_log_size_bytes,
+ worker_queue);
}
std::unique_ptr<AecDump> AecDumpFactory::Create(std::string file_name,
diff --git a/modules/audio_processing/aec_dump/aec_dump_integration_test.cc b/modules/audio_processing/aec_dump/aec_dump_integration_test.cc
index a32867f..f3544b5 100644
--- a/modules/audio_processing/aec_dump/aec_dump_integration_test.cc
+++ b/modules/audio_processing/aec_dump/aec_dump_integration_test.cc
@@ -8,9 +8,9 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#include <memory>
#include <utility>
-#include "absl/memory/memory.h"
#include "modules/audio_processing/aec_dump/mock_aec_dump.h"
#include "modules/audio_processing/include/audio_processing.h"
@@ -31,14 +31,14 @@
std::unique_ptr<webrtc::test::MockAecDump> CreateMockAecDump() {
auto mock_aec_dump =
- absl::make_unique<testing::StrictMock<webrtc::test::MockAecDump>>();
+ std::make_unique<testing::StrictMock<webrtc::test::MockAecDump>>();
EXPECT_CALL(*mock_aec_dump.get(), WriteConfig(_)).Times(AtLeast(1));
EXPECT_CALL(*mock_aec_dump.get(), WriteInitMessage(_, _)).Times(AtLeast(1));
return std::unique_ptr<webrtc::test::MockAecDump>(std::move(mock_aec_dump));
}
std::unique_ptr<webrtc::AudioFrame> CreateFakeFrame() {
- auto fake_frame = absl::make_unique<webrtc::AudioFrame>();
+ auto fake_frame = std::make_unique<webrtc::AudioFrame>();
fake_frame->num_channels_ = 1;
fake_frame->sample_rate_hz_ = 48000;
fake_frame->samples_per_channel_ = 480;
diff --git a/modules/audio_processing/agc2/BUILD.gn b/modules/audio_processing/agc2/BUILD.gn
index 5431a15..5a8e81a 100644
--- a/modules/audio_processing/agc2/BUILD.gn
+++ b/modules/audio_processing/agc2/BUILD.gn
@@ -235,7 +235,6 @@
"../../../rtc_base:gunit_helpers",
"../../../rtc_base:rtc_base_approved",
"../../../system_wrappers:metrics",
- "//third_party/abseil-cpp/absl/memory",
]
}
diff --git a/modules/audio_processing/agc2/rnn_vad/BUILD.gn b/modules/audio_processing/agc2/rnn_vad/BUILD.gn
index 670bbb6..63ce0c1 100644
--- a/modules/audio_processing/agc2/rnn_vad/BUILD.gn
+++ b/modules/audio_processing/agc2/rnn_vad/BUILD.gn
@@ -57,7 +57,6 @@
"../../../../rtc_base:checks",
"../../../../test:fileutils",
"../../../../test:test_support",
- "//third_party/abseil-cpp/absl/memory",
]
}
diff --git a/modules/audio_processing/agc2/rnn_vad/test_utils.cc b/modules/audio_processing/agc2/rnn_vad/test_utils.cc
index 8236d5f..6e0eb5b 100644
--- a/modules/audio_processing/agc2/rnn_vad/test_utils.cc
+++ b/modules/audio_processing/agc2/rnn_vad/test_utils.cc
@@ -10,7 +10,8 @@
#include "modules/audio_processing/agc2/rnn_vad/test_utils.h"
-#include "absl/memory/memory.h"
+#include <memory>
+
#include "rtc_base/checks.h"
#include "test/gtest.h"
#include "test/testsupport/file_utils.h"
@@ -48,7 +49,7 @@
std::pair<std::unique_ptr<BinaryFileReader<int16_t, float>>, const size_t>
CreatePcmSamplesReader(const size_t frame_length) {
- auto ptr = absl::make_unique<BinaryFileReader<int16_t, float>>(
+ auto ptr = std::make_unique<BinaryFileReader<int16_t, float>>(
test::ResourcePath("audio_processing/agc2/rnn_vad/samples", "pcm"),
frame_length);
// The last incomplete frame is ignored.
@@ -57,14 +58,14 @@
ReaderPairType CreatePitchBuffer24kHzReader() {
constexpr size_t cols = 864;
- auto ptr = absl::make_unique<BinaryFileReader<float>>(
+ auto ptr = std::make_unique<BinaryFileReader<float>>(
ResourcePath("audio_processing/agc2/rnn_vad/pitch_buf_24k", "dat"), cols);
return {std::move(ptr), rtc::CheckedDivExact(ptr->data_length(), cols)};
}
ReaderPairType CreateLpResidualAndPitchPeriodGainReader() {
constexpr size_t num_lp_residual_coeffs = 864;
- auto ptr = absl::make_unique<BinaryFileReader<float>>(
+ auto ptr = std::make_unique<BinaryFileReader<float>>(
ResourcePath("audio_processing/agc2/rnn_vad/pitch_lp_res", "dat"),
num_lp_residual_coeffs);
return {std::move(ptr),
@@ -72,7 +73,7 @@
}
ReaderPairType CreateVadProbsReader() {
- auto ptr = absl::make_unique<BinaryFileReader<float>>(
+ auto ptr = std::make_unique<BinaryFileReader<float>>(
test::ResourcePath("audio_processing/agc2/rnn_vad/vad_prob", "dat"));
return {std::move(ptr), ptr->data_length()};
}
diff --git a/modules/audio_processing/audio_processing_impl.cc b/modules/audio_processing/audio_processing_impl.cc
index 55bdaae..cdc37c6 100644
--- a/modules/audio_processing/audio_processing_impl.cc
+++ b/modules/audio_processing/audio_processing_impl.cc
@@ -12,11 +12,11 @@
#include <algorithm>
#include <cstdint>
+#include <memory>
#include <string>
#include <type_traits>
#include <utility>
-#include "absl/memory/memory.h"
#include "absl/types/optional.h"
#include "api/array_view.h"
#include "common_audio/audio_converter.h"
@@ -1845,7 +1845,7 @@
private_submodules_->echo_controller =
echo_control_factory_->Create(proc_sample_rate_hz());
} else {
- private_submodules_->echo_controller = absl::make_unique<EchoCanceller3>(
+ private_submodules_->echo_controller = std::make_unique<EchoCanceller3>(
EchoCanceller3Config(), proc_sample_rate_hz(),
/*num_render_channels=*/1, /*num_capture_channels=*/1);
}
diff --git a/modules/audio_processing/audio_processing_impl_unittest.cc b/modules/audio_processing/audio_processing_impl_unittest.cc
index 72bd673..292b632 100644
--- a/modules/audio_processing/audio_processing_impl_unittest.cc
+++ b/modules/audio_processing/audio_processing_impl_unittest.cc
@@ -12,7 +12,6 @@
#include <memory>
-#include "absl/memory/memory.h"
#include "api/scoped_refptr.h"
#include "modules/audio_processing/include/audio_processing.h"
#include "modules/audio_processing/test/echo_control_mock.h"
@@ -51,12 +50,12 @@
// to the creation of a new EchoControl object.
class MockEchoControlFactory : public EchoControlFactory {
public:
- MockEchoControlFactory() : next_mock_(absl::make_unique<MockEchoControl>()) {}
+ MockEchoControlFactory() : next_mock_(std::make_unique<MockEchoControl>()) {}
// Returns a pointer to the next MockEchoControl that this factory creates.
MockEchoControl* GetNext() const { return next_mock_.get(); }
std::unique_ptr<EchoControl> Create(int sample_rate_hz) override {
std::unique_ptr<EchoControl> mock = std::move(next_mock_);
- next_mock_ = absl::make_unique<MockEchoControl>();
+ next_mock_ = std::make_unique<MockEchoControl>();
return mock;
}
@@ -215,7 +214,7 @@
EchoControllerObservesPreAmplifierEchoPathGainChange) {
// Tests that the echo controller observes an echo path gain change when the
// pre-amplifier submodule changes the gain.
- auto echo_control_factory = absl::make_unique<MockEchoControlFactory>();
+ auto echo_control_factory = std::make_unique<MockEchoControlFactory>();
const auto* echo_control_factory_ptr = echo_control_factory.get();
std::unique_ptr<AudioProcessing> apm(
@@ -258,7 +257,7 @@
EchoControllerObservesAnalogAgc1EchoPathGainChange) {
// Tests that the echo controller observes an echo path gain change when the
// AGC1 analog adaptive submodule changes the analog gain.
- auto echo_control_factory = absl::make_unique<MockEchoControlFactory>();
+ auto echo_control_factory = std::make_unique<MockEchoControlFactory>();
const auto* echo_control_factory_ptr = echo_control_factory.get();
std::unique_ptr<AudioProcessing> apm(
@@ -299,7 +298,7 @@
TEST(AudioProcessingImplTest, EchoControllerObservesPlayoutVolumeChange) {
// Tests that the echo controller observes an echo path gain change when a
// playout volume change is reported.
- auto echo_control_factory = absl::make_unique<MockEchoControlFactory>();
+ auto echo_control_factory = std::make_unique<MockEchoControlFactory>();
const auto* echo_control_factory_ptr = echo_control_factory.get();
std::unique_ptr<AudioProcessing> apm(
diff --git a/modules/audio_processing/gain_controller2_unittest.cc b/modules/audio_processing/gain_controller2_unittest.cc
index 3295328..9369a8a 100644
--- a/modules/audio_processing/gain_controller2_unittest.cc
+++ b/modules/audio_processing/gain_controller2_unittest.cc
@@ -11,8 +11,8 @@
#include "modules/audio_processing/gain_controller2.h"
#include <algorithm>
+#include <memory>
-#include "absl/memory/memory.h"
#include "api/array_view.h"
#include "modules/audio_processing/agc2/agc2_testing_common.h"
#include "modules/audio_processing/audio_buffer.h"
@@ -62,7 +62,7 @@
std::unique_ptr<GainController2> CreateAgc2FixedDigitalMode(
float fixed_gain_db,
size_t sample_rate_hz) {
- auto agc2 = absl::make_unique<GainController2>();
+ auto agc2 = std::make_unique<GainController2>();
agc2->ApplyConfig(CreateAgc2FixedDigitalModeConfig(fixed_gain_db));
agc2->Initialize(sample_rate_hz);
return agc2;
diff --git a/modules/audio_processing/include/audio_generator_factory.cc b/modules/audio_processing/include/audio_generator_factory.cc
index 69a5401..d132f89 100644
--- a/modules/audio_processing/include/audio_generator_factory.cc
+++ b/modules/audio_processing/include/audio_generator_factory.cc
@@ -10,7 +10,8 @@
#include "modules/audio_processing/include/audio_generator_factory.h"
-#include "absl/memory/memory.h"
+#include <memory>
+
#include "common_audio/wav_file.h"
#include "modules/audio_processing/audio_generator/file_audio_generator.h"
@@ -19,7 +20,7 @@
std::unique_ptr<AudioGenerator> AudioGeneratorFactory::Create(
const std::string& file_name) {
std::unique_ptr<WavReader> input_audio_file(new WavReader(file_name));
- return absl::make_unique<FileAudioGenerator>(std::move(input_audio_file));
+ return std::make_unique<FileAudioGenerator>(std::move(input_audio_file));
}
} // namespace webrtc
diff --git a/modules/audio_processing/test/aec_dump_based_simulator.cc b/modules/audio_processing/test/aec_dump_based_simulator.cc
index 0d6bdd1..ba39274 100644
--- a/modules/audio_processing/test/aec_dump_based_simulator.cc
+++ b/modules/audio_processing/test/aec_dump_based_simulator.cc
@@ -11,8 +11,8 @@
#include "modules/audio_processing/test/aec_dump_based_simulator.h"
#include <iostream>
+#include <memory>
-#include "absl/memory/memory.h"
#include "modules/audio_processing/echo_cancellation_impl.h"
#include "modules/audio_processing/echo_control_mobile_impl.h"
#include "modules/audio_processing/test/protobuf_utils.h"
@@ -609,7 +609,7 @@
"_" +
std::to_string(output_reset_counter_)
: *settings_.call_order_output_filename;
- call_order_output_file_ = absl::make_unique<std::ofstream>(filename);
+ call_order_output_file_ = std::make_unique<std::ofstream>(filename);
}
}
diff --git a/modules/audio_processing/test/api_call_statistics.cc b/modules/audio_processing/test/api_call_statistics.cc
index 5e95668..736b77b 100644
--- a/modules/audio_processing/test/api_call_statistics.cc
+++ b/modules/audio_processing/test/api_call_statistics.cc
@@ -16,7 +16,6 @@
#include <limits>
#include <memory>
-#include "absl/memory/memory.h"
#include "rtc_base/time_utils.h"
namespace webrtc {
@@ -75,7 +74,7 @@
void ApiCallStatistics::WriteReportToFile(const std::string& filename) const {
std::unique_ptr<std::ofstream> out =
- absl::make_unique<std::ofstream>(filename);
+ std::make_unique<std::ofstream>(filename);
for (auto v : calls_) {
if (v.call_type == CallType::kRender) {
*out << "render, ";
diff --git a/modules/audio_processing/test/audio_processing_simulator.cc b/modules/audio_processing/test/audio_processing_simulator.cc
index 1565e71..e3534cc 100644
--- a/modules/audio_processing/test/audio_processing_simulator.cc
+++ b/modules/audio_processing/test/audio_processing_simulator.cc
@@ -13,11 +13,11 @@
#include <algorithm>
#include <fstream>
#include <iostream>
+#include <memory>
#include <string>
#include <utility>
#include <vector>
-#include "absl/memory/memory.h"
#include "api/audio/echo_canceller3_config_json.h"
#include "api/audio/echo_canceller3_factory.h"
#include "common_audio/include/audio_util.h"
@@ -139,7 +139,7 @@
std::unique_ptr<AudioProcessingBuilder> ap_builder)
: settings_(settings),
ap_builder_(ap_builder ? std::move(ap_builder)
- : absl::make_unique<AudioProcessingBuilder>()),
+ : std::make_unique<AudioProcessingBuilder>()),
analog_mic_level_(settings.initial_mic_level),
fake_recording_device_(
settings.initial_mic_level,
@@ -341,7 +341,7 @@
static_cast<size_t>(out_config_.num_channels())));
buffer_file_writer_.reset(new ChannelBufferWavWriter(std::move(out_file)));
} else if (settings_.aec_dump_input_string.has_value()) {
- buffer_memory_writer_ = absl::make_unique<ChannelBufferVectorWriter>(
+ buffer_memory_writer_ = std::make_unique<ChannelBufferVectorWriter>(
settings_.processed_capture_samples);
}
diff --git a/modules/audio_processing/test/audioproc_float_main.cc b/modules/audio_processing/test/audioproc_float_main.cc
index 900b927..3cc6d43 100644
--- a/modules/audio_processing/test/audioproc_float_main.cc
+++ b/modules/audio_processing/test/audioproc_float_main.cc
@@ -8,11 +8,12 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#include "absl/memory/memory.h"
+#include <memory>
+
#include "api/test/audioproc_float.h"
#include "modules/audio_processing/include/audio_processing.h"
int main(int argc, char* argv[]) {
return webrtc::test::AudioprocFloat(
- absl::make_unique<webrtc::AudioProcessingBuilder>(), argc, argv);
+ std::make_unique<webrtc::AudioProcessingBuilder>(), argc, argv);
}
diff --git a/modules/audio_processing/test/conversational_speech/BUILD.gn b/modules/audio_processing/test/conversational_speech/BUILD.gn
index 7a278a3..298e684 100644
--- a/modules/audio_processing/test/conversational_speech/BUILD.gn
+++ b/modules/audio_processing/test/conversational_speech/BUILD.gn
@@ -26,7 +26,6 @@
"../../../../test:test_support",
"//third_party/abseil-cpp/absl/flags:flag",
"//third_party/abseil-cpp/absl/flags:parse",
- "//third_party/abseil-cpp/absl/memory",
]
}
@@ -52,7 +51,6 @@
"../../../../rtc_base:checks",
"../../../../rtc_base:rtc_base_approved",
"../../../../test:fileutils",
- "//third_party/abseil-cpp/absl/memory",
]
visibility = [ ":*" ] # Only targets in this file can depend on this.
}
diff --git a/modules/audio_processing/test/conversational_speech/generator.cc b/modules/audio_processing/test/conversational_speech/generator.cc
index abbea8c..d0bc2f2 100644
--- a/modules/audio_processing/test/conversational_speech/generator.cc
+++ b/modules/audio_processing/test/conversational_speech/generator.cc
@@ -11,9 +11,10 @@
#include <iostream>
#include <vector>
+#include <memory>
+
#include "absl/flags/flag.h"
#include "absl/flags/parse.h"
-#include "absl/memory/memory.h"
#include "modules/audio_processing/test/conversational_speech/config.h"
#include "modules/audio_processing/test/conversational_speech/multiend_call.h"
#include "modules/audio_processing/test/conversational_speech/simulator.h"
@@ -59,7 +60,7 @@
// Parse timing and audio tracks.
auto wavreader_factory =
- absl::make_unique<conversational_speech::WavReaderFactory>();
+ std::make_unique<conversational_speech::WavReaderFactory>();
conversational_speech::MultiEndCall multiend_call(
timing, config.audiotracks_path(), std::move(wavreader_factory));
diff --git a/modules/audio_processing/test/conversational_speech/simulator.cc b/modules/audio_processing/test/conversational_speech/simulator.cc
index 81b73fb..0591252 100644
--- a/modules/audio_processing/test/conversational_speech/simulator.cc
+++ b/modules/audio_processing/test/conversational_speech/simulator.cc
@@ -13,11 +13,11 @@
#include <math.h>
#include <algorithm>
+#include <memory>
#include <set>
#include <utility>
#include <vector>
-#include "absl/memory/memory.h"
#include "api/array_view.h"
#include "common_audio/include/audio_util.h"
#include "common_audio/wav_file.h"
@@ -42,7 +42,7 @@
const std::string& output_path) {
// Create map.
auto speaker_output_file_paths_map =
- absl::make_unique<std::map<std::string, SpeakerOutputFilePaths>>();
+ std::make_unique<std::map<std::string, SpeakerOutputFilePaths>>();
// Add near-end and far-end output paths into the map.
for (const auto& speaker_name : speaker_names) {
@@ -89,7 +89,7 @@
int sample_rate) {
// Create map.
auto speaker_wav_writers_map =
- absl::make_unique<std::map<std::string, SpeakerWavWriters>>();
+ std::make_unique<std::map<std::string, SpeakerWavWriters>>();
// Add SpeakerWavWriters instance into the map.
for (auto it = speaker_output_file_paths.begin();
@@ -108,7 +108,7 @@
audiotrack_readers) {
// Create map.
auto audiotracks_map =
- absl::make_unique<std::map<std::string, std::vector<int16_t>>>();
+ std::make_unique<std::map<std::string, std::vector<int16_t>>>();
// Add audio track vectors.
for (auto it = audiotrack_readers.begin(); it != audiotrack_readers.end();
diff --git a/modules/audio_processing/test/fake_recording_device.cc b/modules/audio_processing/test/fake_recording_device.cc
index ee134ea..b82cb1d 100644
--- a/modules/audio_processing/test/fake_recording_device.cc
+++ b/modules/audio_processing/test/fake_recording_device.cc
@@ -11,8 +11,8 @@
#include "modules/audio_processing/test/fake_recording_device.h"
#include <algorithm>
+#include <memory>
-#include "absl/memory/memory.h"
#include "absl/types/optional.h"
#include "modules/audio_processing/agc/gain_map_internal.h"
#include "rtc_base/logging.h"
@@ -141,13 +141,13 @@
switch (device_kind) {
case 0:
worker_ =
- absl::make_unique<FakeRecordingDeviceIdentity>(initial_mic_level);
+ std::make_unique<FakeRecordingDeviceIdentity>(initial_mic_level);
break;
case 1:
- worker_ = absl::make_unique<FakeRecordingDeviceLinear>(initial_mic_level);
+ worker_ = std::make_unique<FakeRecordingDeviceLinear>(initial_mic_level);
break;
case 2:
- worker_ = absl::make_unique<FakeRecordingDeviceAgc1>(initial_mic_level);
+ worker_ = std::make_unique<FakeRecordingDeviceAgc1>(initial_mic_level);
break;
default:
RTC_NOTREACHED();
diff --git a/modules/audio_processing/test/fake_recording_device_unittest.cc b/modules/audio_processing/test/fake_recording_device_unittest.cc
index da62beb..74bb47f 100644
--- a/modules/audio_processing/test/fake_recording_device_unittest.cc
+++ b/modules/audio_processing/test/fake_recording_device_unittest.cc
@@ -15,7 +15,6 @@
#include <string>
#include <vector>
-#include "absl/memory/memory.h"
#include "api/array_view.h"
#include "rtc_base/strings/string_builder.h"
#include "test/gtest.h"
@@ -48,7 +47,7 @@
std::unique_ptr<ChannelBuffer<float>> CreateChannelBufferWithData(
const std::vector<std::vector<float>>& data) {
auto buff =
- absl::make_unique<ChannelBuffer<float>>(data[0].size(), data.size());
+ std::make_unique<ChannelBuffer<float>>(data[0].size(), data.size());
WritesDataIntoChannelBuffer(data, buff.get());
return buff;
}
diff --git a/modules/audio_processing/test/protobuf_utils.cc b/modules/audio_processing/test/protobuf_utils.cc
index 3042bce..7557496 100644
--- a/modules/audio_processing/test/protobuf_utils.cc
+++ b/modules/audio_processing/test/protobuf_utils.cc
@@ -10,7 +10,8 @@
#include "modules/audio_processing/test/protobuf_utils.h"
-#include "absl/memory/memory.h"
+#include <memory>
+
#include "rtc_base/system/arch.h"
namespace {
@@ -27,7 +28,7 @@
if (size <= 0)
return 0;
- *bytes = absl::make_unique<uint8_t[]>(size);
+ *bytes = std::make_unique<uint8_t[]>(size);
input->read(reinterpret_cast<char*>(bytes->get()),
size * sizeof((*bytes)[0]));
size_read = input->gcount();
@@ -49,7 +50,7 @@
if (size <= 0)
return 0;
- *bytes = absl::make_unique<uint8_t[]>(size);
+ *bytes = std::make_unique<uint8_t[]>(size);
return fread(bytes->get(), sizeof((*bytes)[0]), size, file);
}