Skip to content

Commit

Permalink
Switch to 1-parameter version of base::DeleteFile() in media/ and rem…
Browse files Browse the repository at this point in the history
…oting/.

The 1-parameter version is simpler, and the 2-parameter version is
deprecated.

Bug: 1009837
Change-Id: I398fbf56c8d8201e665862d12b4dddece5691a0f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2285915
Reviewed-by: Ted Meyer <tmathmeyer@chromium.org>
Reviewed-by: Lambros Lambrou <lambroslambrou@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#786325}
  • Loading branch information
leizleiz authored and Commit Bot committed Jul 8, 2020
1 parent f045547 commit 93eea8b
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions media/audio/audio_debug_file_writer_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class AudioDebugFileWriterTest
LOG(ERROR) << "Test failed; keeping recording(s) at ["
<< file_path.value().c_str() << "].";
} else {
ASSERT_TRUE(base::DeleteFile(file_path, false));
ASSERT_TRUE(base::DeleteFile(file_path));
}
}

Expand Down Expand Up @@ -262,7 +262,7 @@ TEST_P(AudioDebugFileWriterSingleThreadTest,
LOG(ERROR) << "Test failed; keeping recording(s) at ["
<< file_path.value().c_str() << "].";
} else {
ASSERT_TRUE(base::DeleteFile(file_path, false));
ASSERT_TRUE(base::DeleteFile(file_path));
}
}

Expand Down
2 changes: 1 addition & 1 deletion media/audio/audio_debug_recording_helper_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class AudioDebugRecordingHelperTest : public ::testing::Test {
std::move(reply_callback).Run(std::move(debug_file));
// File can be removed right away because MockAudioDebugFileWriter::Start is
// called synchronously.
ASSERT_TRUE(base::DeleteFile(path, false));
ASSERT_TRUE(base::DeleteFile(path));
}

protected:
Expand Down
4 changes: 2 additions & 2 deletions media/audio/audio_debug_recording_session_impl_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ TEST_F(AudioDebugRecordingSessionImplTest, CreateWavFileCreatesExpectedFiles) {
EXPECT_CALL(*mock_debug_recording_manager_, DisableDebugRecording());
DestroyDebugRecordingSession();
ShutdownAudioManager();
EXPECT_TRUE(base::DeleteFile(output_recording_filename, false));
EXPECT_TRUE(base::DeleteFile(input_recording_filename, false));
EXPECT_TRUE(base::DeleteFile(output_recording_filename));
EXPECT_TRUE(base::DeleteFile(input_recording_filename));
}

} // namespace media
3 changes: 1 addition & 2 deletions media/capture/video/chromeos/camera_hal_dispatcher_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,7 @@ void CameraHalDispatcherImpl::StopOnProxyThread() {
<< " last_modified: " << info.last_modified;
}

if (!base::DeleteFile(base::FilePath(kArcCamera3SocketPath),
/* recursive */ false)) {
if (!base::DeleteFile(base::FilePath(kArcCamera3SocketPath))) {
LOG(ERROR) << "Failed to delete " << kArcCamera3SocketPath;
}
// Close |cancel_pipe_| to quit the loop in WaitForIncomingConnection.
Expand Down
2 changes: 1 addition & 1 deletion remoting/host/config_file_watcher_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void ConfigFileWatcherTest::SetUp() {
void ConfigFileWatcherTest::TearDown() {
// Delete the test file.
if (!config_file_.empty())
base::DeleteFile(config_file_, false);
base::DeleteFile(config_file_);
}

// Verifies that the initial notification is delivered.
Expand Down
4 changes: 2 additions & 2 deletions remoting/host/mac/host_service_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,12 @@ int HostService::RunHost() {
}

bool HostService::Disable() {
return base::DeleteFile(enabled_file_, false);
return base::DeleteFile(enabled_file_);
}

bool HostService::Enable() {
// Ensure the config file is private whilst being written.
base::DeleteFile(config_file_, false);
base::DeleteFile(config_file_);
if (!WriteStdinToConfig()) {
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions remoting/host/pairing_registry_delegate_linux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ bool PairingRegistryDelegateLinux::DeleteAll() {
bool success = true;
for (base::FilePath pairing_file = enumerator.Next(); !pairing_file.empty();
pairing_file = enumerator.Next()) {
success = success && base::DeleteFile(pairing_file, false);
success = success && base::DeleteFile(pairing_file);
}

return success;
Expand Down Expand Up @@ -140,7 +140,7 @@ bool PairingRegistryDelegateLinux::Delete(const std::string& client_id) {
base::FilePath pairing_file = registry_path.Append(
base::StringPrintf(kPairingFilenameFormat, client_id.c_str()));

return base::DeleteFile(pairing_file, false);
return base::DeleteFile(pairing_file);
}

base::FilePath PairingRegistryDelegateLinux::GetRegistryPath() {
Expand Down

0 comments on commit 93eea8b

Please sign in to comment.