Commit dfee4992 authored by Lei Zhang's avatar Lei Zhang Committed by Commit Bot

Switch away from 2-parameter version of base::DeleteFile() in ash/.

The 2-parameter version is deprecated. Use either the simpler
1-parameter version, or base::DeletePathRecursively() when appropriate.

Bug: 1009837
Change-Id: I9b5c1bf506da6928410ef97b44addf9ad47352e7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2284355Reviewed-by: default avatarAhmed Fakhry <afakhry@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#785995}
parent f3beb68e
...@@ -1426,7 +1426,7 @@ TEST_F(AcceleratorControllerTest, SideVolumeButtonLocation) { ...@@ -1426,7 +1426,7 @@ TEST_F(AcceleratorControllerTest, SideVolumeButtonLocation) {
test_api_->side_volume_button_location().region); test_api_->side_volume_button_location().region);
EXPECT_EQ(AcceleratorControllerImpl::kVolumeButtonSideLeft, EXPECT_EQ(AcceleratorControllerImpl::kVolumeButtonSideLeft,
test_api_->side_volume_button_location().side); test_api_->side_volume_button_location().side);
base::DeleteFile(file_path, false); base::DeleteFile(file_path);
} }
// Tests the histogram of volume adjustment in tablet mode. // Tests the histogram of volume adjustment in tablet mode.
......
...@@ -135,7 +135,7 @@ void WriteFile(const base::FilePath& path, const std::string& data) { ...@@ -135,7 +135,7 @@ void WriteFile(const base::FilePath& path, const std::string& data) {
int written_size = base::WriteFile(temp_file, data.data(), size); int written_size = base::WriteFile(temp_file, data.data(), size);
if (written_size != size) { if (written_size != size) {
LOG(ERROR) << "Cannot write the temporary file."; LOG(ERROR) << "Cannot write the temporary file.";
base::DeleteFile(temp_file, /*recursive=*/false); base::DeleteFile(temp_file);
return; return;
} }
......
...@@ -224,7 +224,7 @@ bool ResizeAndSaveWallpaper(const gfx::ImageSkia& image, ...@@ -224,7 +224,7 @@ bool ResizeAndSaveWallpaper(const gfx::ImageSkia& image,
int preferred_height) { int preferred_height) {
if (layout == WALLPAPER_LAYOUT_CENTER) { if (layout == WALLPAPER_LAYOUT_CENTER) {
if (base::PathExists(path)) if (base::PathExists(path))
base::DeleteFile(path, false); base::DeleteFile(path);
return false; return false;
} }
scoped_refptr<base::RefCountedBytes> data; scoped_refptr<base::RefCountedBytes> data;
...@@ -333,18 +333,18 @@ void SaveCustomWallpaper(const std::string& wallpaper_files_id, ...@@ -333,18 +333,18 @@ void SaveCustomWallpaper(const std::string& wallpaper_files_id,
const base::FilePath& original_path, const base::FilePath& original_path,
WallpaperLayout layout, WallpaperLayout layout,
gfx::ImageSkia image) { gfx::ImageSkia image) {
base::DeleteFile(WallpaperControllerImpl::GetCustomWallpaperDir( base::DeletePathRecursively(
WallpaperControllerImpl::kOriginalWallpaperSubDir) WallpaperControllerImpl::GetCustomWallpaperDir(
.Append(wallpaper_files_id), WallpaperControllerImpl::kOriginalWallpaperSubDir)
true /* recursive */); .Append(wallpaper_files_id));
base::DeleteFile(WallpaperControllerImpl::GetCustomWallpaperDir( base::DeletePathRecursively(
WallpaperControllerImpl::kSmallWallpaperSubDir) WallpaperControllerImpl::GetCustomWallpaperDir(
.Append(wallpaper_files_id), WallpaperControllerImpl::kSmallWallpaperSubDir)
true /* recursive */); .Append(wallpaper_files_id));
base::DeleteFile(WallpaperControllerImpl::GetCustomWallpaperDir( base::DeletePathRecursively(
WallpaperControllerImpl::kLargeWallpaperSubDir) WallpaperControllerImpl::GetCustomWallpaperDir(
.Append(wallpaper_files_id), WallpaperControllerImpl::kLargeWallpaperSubDir)
true /* recursive */); .Append(wallpaper_files_id));
EnsureCustomWallpaperDirectories(wallpaper_files_id); EnsureCustomWallpaperDirectories(wallpaper_files_id);
const std::string file_name = original_path.BaseName().value(); const std::string file_name = original_path.BaseName().value();
const base::FilePath small_wallpaper_path = const base::FilePath small_wallpaper_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