Commit 13819e49 authored by Lei Zhang's avatar Lei Zhang Committed by Commit Bot

Stop using deprecated base::DeleteFile() in c/b/web_applications/.

The 2-parameter version is deprecated. Switch to its replacements.

Bug: 1009837
Change-Id: I9e6c767c6765b954ef01fc7f5d48bc95d6db28e2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2286269Reviewed-by: default avatarAlan Cutter <alancutter@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#786191}
parent 467c0cda
......@@ -227,17 +227,15 @@ void ReRegisterFileHandlersWithOs(
const std::set<base::string16>& file_extensions,
const base::string16& prog_id,
const base::string16& app_name_extension) {
auto deleteFile = [](const base::FilePath& path, bool recursive) {
bool result = base::DeleteFile(path, recursive);
if (!result)
auto delete_file_callback = [](const base::FilePath& path) {
if (!base::DeleteFile(path))
RecordRegistration(RegistrationResult::kFailToDeleteExistingRegistration);
};
base::ThreadPool::PostTask(
FROM_HERE,
{base::MayBlock(), base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN},
base::BindOnce(deleteFile,
ShellUtil::GetApplicationPathForProgId(prog_id),
/*recursively=*/false));
base::BindOnce(delete_file_callback,
ShellUtil::GetApplicationPathForProgId(prog_id)));
bool result = ShellUtil::DeleteFileAssociations(prog_id);
if (!result) {
RecordRegistration(
......
......@@ -56,7 +56,9 @@ bool FileUtilsWrapper::ReadFileToString(const base::FilePath& path,
}
bool FileUtilsWrapper::DeleteFile(const base::FilePath& path, bool recursive) {
return base::DeleteFile(path, recursive);
if (!recursive)
return base::DeleteFile(path);
return base::DeletePathRecursively(path);
}
bool FileUtilsWrapper::DeleteFileRecursively(const base::FilePath& path) {
......
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