Adopt absl::string_view in rtc_base/ (straightforward cases)
Bug: webrtc:13579 Change-Id: I240db6285abb22652242bc0b2ebe9844ec4a45f0 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258723 Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org> Commit-Queue: Ali Tofigh <alito@webrtc.org> Cr-Commit-Position: refs/heads/main@{#36561}
This commit is contained in:
committed by
WebRTC LUCI CQ
parent
a62136ac74
commit
2ab914c6ab
@ -255,8 +255,8 @@ std::unique_ptr<AecDump> AecDumpFactory::Create(webrtc::FileWrapper file,
|
||||
std::unique_ptr<AecDump> AecDumpFactory::Create(std::string file_name,
|
||||
int64_t max_log_size_bytes,
|
||||
rtc::TaskQueue* worker_queue) {
|
||||
return Create(FileWrapper::OpenWriteOnly(file_name.c_str()),
|
||||
max_log_size_bytes, worker_queue);
|
||||
return Create(FileWrapper::OpenWriteOnly(file_name), max_log_size_bytes,
|
||||
worker_queue);
|
||||
}
|
||||
|
||||
std::unique_ptr<AecDump> AecDumpFactory::Create(FILE* handle,
|
||||
|
||||
@ -1600,7 +1600,7 @@ TEST_F(ApmTest, DebugDumpFromFileHandle) {
|
||||
|
||||
const std::string filename =
|
||||
test::TempFilename(test::OutputPath(), "debug_aec");
|
||||
FileWrapper f = FileWrapper::OpenWriteOnly(filename.c_str());
|
||||
FileWrapper f = FileWrapper::OpenWriteOnly(filename);
|
||||
ASSERT_TRUE(f.is_open());
|
||||
|
||||
#ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP
|
||||
|
||||
@ -25,7 +25,7 @@ namespace test {
|
||||
std::vector<WavBasedSimulator::SimulationEventType>
|
||||
WavBasedSimulator::GetCustomEventChain(const std::string& filename) {
|
||||
std::vector<WavBasedSimulator::SimulationEventType> call_chain;
|
||||
FileWrapper file_wrapper = FileWrapper::OpenReadOnly(filename.c_str());
|
||||
FileWrapper file_wrapper = FileWrapper::OpenReadOnly(filename);
|
||||
|
||||
RTC_CHECK(file_wrapper.is_open())
|
||||
<< "Could not open the custom call order file, reverting "
|
||||
|
||||
@ -159,7 +159,7 @@ TEST_F(TransientFileUtilsTest, MAYBE_ConvertDoubleToByteArray) {
|
||||
TEST_F(TransientFileUtilsTest, MAYBE_ReadInt16BufferFromFile) {
|
||||
std::string test_filename = kTestFileName;
|
||||
|
||||
FileWrapper file = FileWrapper::OpenReadOnly(test_filename.c_str());
|
||||
FileWrapper file = FileWrapper::OpenReadOnly(test_filename);
|
||||
ASSERT_TRUE(file.is_open()) << "File could not be opened:\n"
|
||||
<< kTestFileName.c_str();
|
||||
|
||||
@ -197,7 +197,7 @@ TEST_F(TransientFileUtilsTest, MAYBE_ReadInt16BufferFromFile) {
|
||||
TEST_F(TransientFileUtilsTest, MAYBE_ReadInt16FromFileToFloatBuffer) {
|
||||
std::string test_filename = kTestFileName;
|
||||
|
||||
FileWrapper file = FileWrapper::OpenReadOnly(test_filename.c_str());
|
||||
FileWrapper file = FileWrapper::OpenReadOnly(test_filename);
|
||||
ASSERT_TRUE(file.is_open()) << "File could not be opened:\n"
|
||||
<< kTestFileName.c_str();
|
||||
|
||||
@ -237,7 +237,7 @@ TEST_F(TransientFileUtilsTest, MAYBE_ReadInt16FromFileToFloatBuffer) {
|
||||
TEST_F(TransientFileUtilsTest, MAYBE_ReadInt16FromFileToDoubleBuffer) {
|
||||
std::string test_filename = kTestFileName;
|
||||
|
||||
FileWrapper file = FileWrapper::OpenReadOnly(test_filename.c_str());
|
||||
FileWrapper file = FileWrapper::OpenReadOnly(test_filename);
|
||||
ASSERT_TRUE(file.is_open()) << "File could not be opened:\n"
|
||||
<< kTestFileName.c_str();
|
||||
|
||||
@ -275,7 +275,7 @@ TEST_F(TransientFileUtilsTest, MAYBE_ReadInt16FromFileToDoubleBuffer) {
|
||||
TEST_F(TransientFileUtilsTest, MAYBE_ReadFloatBufferFromFile) {
|
||||
std::string test_filename = kTestFileNamef;
|
||||
|
||||
FileWrapper file = FileWrapper::OpenReadOnly(test_filename.c_str());
|
||||
FileWrapper file = FileWrapper::OpenReadOnly(test_filename);
|
||||
ASSERT_TRUE(file.is_open()) << "File could not be opened:\n"
|
||||
<< kTestFileNamef.c_str();
|
||||
|
||||
@ -311,7 +311,7 @@ TEST_F(TransientFileUtilsTest, MAYBE_ReadFloatBufferFromFile) {
|
||||
TEST_F(TransientFileUtilsTest, MAYBE_ReadDoubleBufferFromFile) {
|
||||
std::string test_filename = kTestFileName;
|
||||
|
||||
FileWrapper file = FileWrapper::OpenReadOnly(test_filename.c_str());
|
||||
FileWrapper file = FileWrapper::OpenReadOnly(test_filename);
|
||||
ASSERT_TRUE(file.is_open()) << "File could not be opened:\n"
|
||||
<< kTestFileName.c_str();
|
||||
|
||||
@ -348,7 +348,7 @@ TEST_F(TransientFileUtilsTest, MAYBE_WriteInt16BufferToFile) {
|
||||
std::string kOutFileName =
|
||||
CreateTempFilename(test::OutputPath(), "utils_test");
|
||||
|
||||
FileWrapper file = FileWrapper::OpenWriteOnly(kOutFileName.c_str());
|
||||
FileWrapper file = FileWrapper::OpenWriteOnly(kOutFileName);
|
||||
ASSERT_TRUE(file.is_open()) << "File could not be opened:\n"
|
||||
<< kOutFileName.c_str();
|
||||
|
||||
@ -365,7 +365,7 @@ TEST_F(TransientFileUtilsTest, MAYBE_WriteInt16BufferToFile) {
|
||||
|
||||
file.Close();
|
||||
|
||||
file = FileWrapper::OpenReadOnly(kOutFileName.c_str());
|
||||
file = FileWrapper::OpenReadOnly(kOutFileName);
|
||||
ASSERT_TRUE(file.is_open()) << "File could not be opened:\n"
|
||||
<< kOutFileName.c_str();
|
||||
|
||||
@ -384,7 +384,7 @@ TEST_F(TransientFileUtilsTest, MAYBE_WriteFloatBufferToFile) {
|
||||
std::string kOutFileName =
|
||||
CreateTempFilename(test::OutputPath(), "utils_test");
|
||||
|
||||
FileWrapper file = FileWrapper::OpenWriteOnly(kOutFileName.c_str());
|
||||
FileWrapper file = FileWrapper::OpenWriteOnly(kOutFileName);
|
||||
ASSERT_TRUE(file.is_open()) << "File could not be opened:\n"
|
||||
<< kOutFileName.c_str();
|
||||
|
||||
@ -401,7 +401,7 @@ TEST_F(TransientFileUtilsTest, MAYBE_WriteFloatBufferToFile) {
|
||||
|
||||
file.Close();
|
||||
|
||||
file = FileWrapper::OpenReadOnly(kOutFileName.c_str());
|
||||
file = FileWrapper::OpenReadOnly(kOutFileName);
|
||||
ASSERT_TRUE(file.is_open()) << "File could not be opened:\n"
|
||||
<< kOutFileName.c_str();
|
||||
|
||||
@ -420,7 +420,7 @@ TEST_F(TransientFileUtilsTest, MAYBE_WriteDoubleBufferToFile) {
|
||||
std::string kOutFileName =
|
||||
CreateTempFilename(test::OutputPath(), "utils_test");
|
||||
|
||||
FileWrapper file = FileWrapper::OpenWriteOnly(kOutFileName.c_str());
|
||||
FileWrapper file = FileWrapper::OpenWriteOnly(kOutFileName);
|
||||
ASSERT_TRUE(file.is_open()) << "File could not be opened:\n"
|
||||
<< kOutFileName.c_str();
|
||||
|
||||
@ -437,7 +437,7 @@ TEST_F(TransientFileUtilsTest, MAYBE_WriteDoubleBufferToFile) {
|
||||
|
||||
file.Close();
|
||||
|
||||
file = FileWrapper::OpenReadOnly(kOutFileName.c_str());
|
||||
file = FileWrapper::OpenReadOnly(kOutFileName);
|
||||
ASSERT_TRUE(file.is_open()) << "File could not be opened:\n"
|
||||
<< kOutFileName.c_str();
|
||||
|
||||
@ -472,7 +472,7 @@ TEST_F(TransientFileUtilsTest, MAYBE_ExpectedErrorReturnValues) {
|
||||
EXPECT_EQ(0u, WriteInt16BufferToFile(&file, 1, int16_buffer.get()));
|
||||
EXPECT_EQ(0u, WriteDoubleBufferToFile(&file, 1, double_buffer.get()));
|
||||
|
||||
file = FileWrapper::OpenReadOnly(test_filename.c_str());
|
||||
file = FileWrapper::OpenReadOnly(test_filename);
|
||||
ASSERT_TRUE(file.is_open()) << "File could not be opened:\n"
|
||||
<< kTestFileName.c_str();
|
||||
|
||||
|
||||
@ -48,7 +48,7 @@ TEST(TransientDetectorTest, CorrectnessBasedOnFiles) {
|
||||
<< (sample_rate_hz / 1000) << "kHz";
|
||||
|
||||
FileWrapper detect_file = FileWrapper::OpenReadOnly(
|
||||
test::ResourcePath(detect_file_name.str(), "dat").c_str());
|
||||
test::ResourcePath(detect_file_name.str(), "dat"));
|
||||
|
||||
bool file_opened = detect_file.is_open();
|
||||
ASSERT_TRUE(file_opened) << "File could not be opened.\n"
|
||||
@ -60,7 +60,7 @@ TEST(TransientDetectorTest, CorrectnessBasedOnFiles) {
|
||||
<< (sample_rate_hz / 1000) << "kHz";
|
||||
|
||||
FileWrapper audio_file = FileWrapper::OpenReadOnly(
|
||||
test::ResourcePath(audio_file_name.str(), "pcm").c_str());
|
||||
test::ResourcePath(audio_file_name.str(), "pcm"));
|
||||
|
||||
// Create detector.
|
||||
TransientDetector detector(sample_rate_hz);
|
||||
|
||||
@ -88,7 +88,7 @@ TEST(WPDTreeTest, CorrectnessBasedOnMatlabFiles) {
|
||||
rtc::StringBuilder matlab_stream;
|
||||
matlab_stream << "audio_processing/transient/wpd" << i;
|
||||
std::string matlab_string = test::ResourcePath(matlab_stream.str(), "dat");
|
||||
matlab_files_data[i] = FileWrapper::OpenReadOnly(matlab_string.c_str());
|
||||
matlab_files_data[i] = FileWrapper::OpenReadOnly(matlab_string);
|
||||
|
||||
bool file_opened = matlab_files_data[i].is_open();
|
||||
ASSERT_TRUE(file_opened) << "File could not be opened.\n" << matlab_string;
|
||||
@ -98,7 +98,7 @@ TEST(WPDTreeTest, CorrectnessBasedOnMatlabFiles) {
|
||||
out_stream << test::OutputPath() << "wpd_" << i << ".out";
|
||||
std::string out_string = out_stream.str();
|
||||
|
||||
out_files_data[i] = FileWrapper::OpenWriteOnly(out_string.c_str());
|
||||
out_files_data[i] = FileWrapper::OpenWriteOnly(out_string);
|
||||
|
||||
file_opened = out_files_data[i].is_open();
|
||||
ASSERT_TRUE(file_opened) << "File could not be opened.\n" << out_string;
|
||||
@ -108,7 +108,7 @@ TEST(WPDTreeTest, CorrectnessBasedOnMatlabFiles) {
|
||||
std::string test_file_name = test::ResourcePath(
|
||||
"audio_processing/transient/ajm-macbook-1-spke16m", "pcm");
|
||||
|
||||
FileWrapper test_file = FileWrapper::OpenReadOnly(test_file_name.c_str());
|
||||
FileWrapper test_file = FileWrapper::OpenReadOnly(test_file_name);
|
||||
|
||||
bool file_opened = test_file.is_open();
|
||||
ASSERT_TRUE(file_opened) << "File could not be opened.\n" << test_file_name;
|
||||
|
||||
Reference in New Issue
Block a user