Commit 93eea8b8 authored by Lei Zhang's avatar Lei Zhang Committed by Commit Bot

Switch to 1-parameter version of base::DeleteFile() in media/ and remoting/.

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/+/2285915Reviewed-by: default avatarTed Meyer <tmathmeyer@chromium.org>
Reviewed-by: default avatarLambros Lambrou <lambroslambrou@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#786325}
parent f0455470
...@@ -198,7 +198,7 @@ class AudioDebugFileWriterTest ...@@ -198,7 +198,7 @@ class AudioDebugFileWriterTest
LOG(ERROR) << "Test failed; keeping recording(s) at [" LOG(ERROR) << "Test failed; keeping recording(s) at ["
<< file_path.value().c_str() << "]."; << file_path.value().c_str() << "].";
} else { } else {
ASSERT_TRUE(base::DeleteFile(file_path, false)); ASSERT_TRUE(base::DeleteFile(file_path));
} }
} }
...@@ -262,7 +262,7 @@ TEST_P(AudioDebugFileWriterSingleThreadTest, ...@@ -262,7 +262,7 @@ TEST_P(AudioDebugFileWriterSingleThreadTest,
LOG(ERROR) << "Test failed; keeping recording(s) at [" LOG(ERROR) << "Test failed; keeping recording(s) at ["
<< file_path.value().c_str() << "]."; << file_path.value().c_str() << "].";
} else { } else {
ASSERT_TRUE(base::DeleteFile(file_path, false)); ASSERT_TRUE(base::DeleteFile(file_path));
} }
} }
......
...@@ -137,7 +137,7 @@ class AudioDebugRecordingHelperTest : public ::testing::Test { ...@@ -137,7 +137,7 @@ class AudioDebugRecordingHelperTest : public ::testing::Test {
std::move(reply_callback).Run(std::move(debug_file)); std::move(reply_callback).Run(std::move(debug_file));
// File can be removed right away because MockAudioDebugFileWriter::Start is // File can be removed right away because MockAudioDebugFileWriter::Start is
// called synchronously. // called synchronously.
ASSERT_TRUE(base::DeleteFile(path, false)); ASSERT_TRUE(base::DeleteFile(path));
} }
protected: protected:
......
...@@ -137,8 +137,8 @@ TEST_F(AudioDebugRecordingSessionImplTest, CreateWavFileCreatesExpectedFiles) { ...@@ -137,8 +137,8 @@ TEST_F(AudioDebugRecordingSessionImplTest, CreateWavFileCreatesExpectedFiles) {
EXPECT_CALL(*mock_debug_recording_manager_, DisableDebugRecording()); EXPECT_CALL(*mock_debug_recording_manager_, DisableDebugRecording());
DestroyDebugRecordingSession(); DestroyDebugRecordingSession();
ShutdownAudioManager(); ShutdownAudioManager();
EXPECT_TRUE(base::DeleteFile(output_recording_filename, false)); EXPECT_TRUE(base::DeleteFile(output_recording_filename));
EXPECT_TRUE(base::DeleteFile(input_recording_filename, false)); EXPECT_TRUE(base::DeleteFile(input_recording_filename));
} }
} // namespace media } // namespace media
...@@ -416,8 +416,7 @@ void CameraHalDispatcherImpl::StopOnProxyThread() { ...@@ -416,8 +416,7 @@ void CameraHalDispatcherImpl::StopOnProxyThread() {
<< " last_modified: " << info.last_modified; << " last_modified: " << info.last_modified;
} }
if (!base::DeleteFile(base::FilePath(kArcCamera3SocketPath), if (!base::DeleteFile(base::FilePath(kArcCamera3SocketPath))) {
/* recursive */ false)) {
LOG(ERROR) << "Failed to delete " << kArcCamera3SocketPath; LOG(ERROR) << "Failed to delete " << kArcCamera3SocketPath;
} }
// Close |cancel_pipe_| to quit the loop in WaitForIncomingConnection. // Close |cancel_pipe_| to quit the loop in WaitForIncomingConnection.
......
...@@ -90,7 +90,7 @@ void ConfigFileWatcherTest::SetUp() { ...@@ -90,7 +90,7 @@ void ConfigFileWatcherTest::SetUp() {
void ConfigFileWatcherTest::TearDown() { void ConfigFileWatcherTest::TearDown() {
// Delete the test file. // Delete the test file.
if (!config_file_.empty()) if (!config_file_.empty())
base::DeleteFile(config_file_, false); base::DeleteFile(config_file_);
} }
// Verifies that the initial notification is delivered. // Verifies that the initial notification is delivered.
......
...@@ -249,12 +249,12 @@ int HostService::RunHost() { ...@@ -249,12 +249,12 @@ int HostService::RunHost() {
} }
bool HostService::Disable() { bool HostService::Disable() {
return base::DeleteFile(enabled_file_, false); return base::DeleteFile(enabled_file_);
} }
bool HostService::Enable() { bool HostService::Enable() {
// Ensure the config file is private whilst being written. // Ensure the config file is private whilst being written.
base::DeleteFile(config_file_, false); base::DeleteFile(config_file_);
if (!WriteStdinToConfig()) { if (!WriteStdinToConfig()) {
return false; return false;
} }
......
...@@ -75,7 +75,7 @@ bool PairingRegistryDelegateLinux::DeleteAll() { ...@@ -75,7 +75,7 @@ bool PairingRegistryDelegateLinux::DeleteAll() {
bool success = true; bool success = true;
for (base::FilePath pairing_file = enumerator.Next(); !pairing_file.empty(); for (base::FilePath pairing_file = enumerator.Next(); !pairing_file.empty();
pairing_file = enumerator.Next()) { pairing_file = enumerator.Next()) {
success = success && base::DeleteFile(pairing_file, false); success = success && base::DeleteFile(pairing_file);
} }
return success; return success;
...@@ -140,7 +140,7 @@ bool PairingRegistryDelegateLinux::Delete(const std::string& client_id) { ...@@ -140,7 +140,7 @@ bool PairingRegistryDelegateLinux::Delete(const std::string& client_id) {
base::FilePath pairing_file = registry_path.Append( base::FilePath pairing_file = registry_path.Append(
base::StringPrintf(kPairingFilenameFormat, client_id.c_str())); base::StringPrintf(kPairingFilenameFormat, client_id.c_str()));
return base::DeleteFile(pairing_file, false); return base::DeleteFile(pairing_file);
} }
base::FilePath PairingRegistryDelegateLinux::GetRegistryPath() { base::FilePath PairingRegistryDelegateLinux::GetRegistryPath() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment