0

Switch to 1-parameter version of base::DeleteFile() in various dirs.

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

Bug: 1009837
Change-Id: I083906f5cb2f899814511707a639da591a711182
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2285177
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#786068}
This commit is contained in:
Lei Zhang
2020-07-08 00:02:15 +00:00
committed by Commit Bot
parent 7304c31e54
commit 7b28548aa6
12 changed files with 18 additions and 18 deletions
cloud_print/virtual_driver/win
install
port_monitor
courgette
google_apis/drive
headless/lib
mojo/core
tools
android
io_benchmark
traffic_annotation
weblayer/browser

@ -137,9 +137,9 @@ HRESULT RegisterPortMonitor(bool install, const base::FilePath& install_path) {
return HRESULT_FROM_WIN32(exit_code);
}
} else {
if (!base::DeleteFile(target_path, false)) {
if (!base::DeleteFile(target_path)) {
SpoolerServiceCommand("stop");
bool deleted = base::DeleteFile(target_path, false);
bool deleted = base::DeleteFile(target_path);
SpoolerServiceCommand("start");
if (!deleted) {

@ -126,7 +126,7 @@ void DeleteLeakedFiles(const base::FilePath& dir) {
for (base::FilePath file_path = enumerator.Next(); !file_path.empty();
file_path = enumerator.Next()) {
if (enumerator.GetInfo().GetLastModifiedTime() < delete_before)
base::DeleteFile(file_path, false);
base::DeleteFile(file_path);
}
}
@ -556,7 +556,7 @@ BOOL WINAPI Monitor2EndDocPort(HANDLE port_handle) {
}
}
if (delete_file)
base::DeleteFile(port_data->file_path, false);
base::DeleteFile(port_data->file_path);
}
if (port_data->printer_handle != NULL) {
// Tell the spooler that the job is complete.

@ -431,7 +431,7 @@ Status ApplyEnsemblePatch(const base::FilePath::CharType* old_file_name,
base::File::FLAG_WRITE |
base::File::FLAG_EXCLUSIVE_WRITE));
if (result != C_OK)
base::DeleteFile(base::FilePath(new_file_name), false);
base::DeleteFile(base::FilePath(new_file_name));
return result;
}

@ -242,7 +242,7 @@ BSDiffStatus ApplyBinaryPatch(const base::FilePath& old_file_path,
base::File::FLAG_WRITE |
base::File::FLAG_EXCLUSIVE_WRITE));
if (result != OK)
base::DeleteFile(new_file_path, false);
base::DeleteFile(new_file_path);
return result;
}

@ -127,7 +127,7 @@ TEST_F(BaseRequestsServerTest, DownloadFileRequest_ValidFile) {
std::string contents;
base::ReadFileToString(temp_file, &contents);
base::DeleteFile(temp_file, false);
base::DeleteFile(temp_file);
EXPECT_EQ(HTTP_SUCCESS, result_code);
EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method);

@ -1958,7 +1958,7 @@ TEST_F(DriveApiRequestsTest, DownloadFileRequest) {
std::string contents;
base::ReadFileToString(temp_file, &contents);
base::DeleteFile(temp_file, false);
base::DeleteFile(temp_file);
EXPECT_EQ(HTTP_SUCCESS, result_code);
EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method);
@ -1992,7 +1992,7 @@ TEST_F(DriveApiRequestsTest, DownloadFileRequest_GetContentCallback) {
run_loop.Run();
}
base::DeleteFile(temp_file, false);
base::DeleteFile(temp_file);
EXPECT_EQ(HTTP_SUCCESS, result_code);
EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method);

@ -399,9 +399,9 @@ class HeadlessBrowserRendererCommandPrefixTest : public HeadlessBrowserTest {
void TearDown() override {
if (!launcher_script_.empty())
base::DeleteFile(launcher_script_, false);
base::DeleteFile(launcher_script_);
if (!launcher_stamp_.empty())
base::DeleteFile(launcher_stamp_, false);
base::DeleteFile(launcher_stamp_);
}
void SetUpCommandLine(base::CommandLine* command_line) override {
@ -454,7 +454,7 @@ class CrashReporterTest : public HeadlessBrowserTest,
void TearDown() override {
base::ThreadRestrictions::SetIOAllowed(true);
base::DeleteFile(crash_dumps_dir_, /* recursive */ false);
base::DeleteFile(crash_dumps_dir_);
}
// HeadlessWebContents::Observer implementation:

@ -92,7 +92,7 @@ TEST_F(PlatformWrapperTest, WrapPlatformHandle) {
WriteMessageWithHandles(h, kMessage, &wrapped_handle, 1);
});
base::DeleteFile(temp_file_path, false);
base::DeleteFile(temp_file_path);
}
DEFINE_TEST_CLIENT_TEST_WITH_PIPE(ReadPlatformFile, PlatformWrapperTest, h) {

@ -114,7 +114,7 @@ std::pair<int64_t, int64_t> WriteReadData(int size,
read_us = (tock - tick).InMicroseconds();
}
CHECK(base::DeleteFile(path, false));
CHECK(base::DeleteFile(path));
return {write_us, read_us};
}
@ -169,7 +169,7 @@ void RandomlyReadWrite(std::atomic<bool>* should_stop,
}
LOG(INFO) << "Noisy neighbor " << i << ": Finishing";
base::DeleteFile(path, false);
base::DeleteFile(path);
}
} // namespace

@ -261,7 +261,7 @@ bool TrafficAnnotationAuditor::RunExtractor(
}
base::SetCurrentDirectory(original_path);
base::DeleteFile(options_filepath, false);
base::DeleteFile(options_filepath);
return result;
}

@ -28,7 +28,7 @@ bool RemoveBrowserPersistenceStorageOnBackgroundThread(
for (const std::string& id : ids) {
DCHECK(!id.empty());
base::FilePath persistence_path = BuildPathForBrowserPersister(path, id);
if (!base::DeleteFile(persistence_path, /* recurse */ false))
if (!base::DeleteFile(persistence_path))
all_succeeded = false;
}
return all_succeeded;

@ -161,7 +161,7 @@ void NukeProfilesMarkedForDeletion() {
base::DeletePathRecursively(GetDataPathFromDirName(dir_name));
// Only delete the marker if deletion is successful.
if (delete_success) {
base::DeleteFile(marker_path, /*recursive=*/false);
base::DeleteFile(marker_path);
}
}
}