Commit 3c57dcb5 authored by Anand K Mistry's avatar Anand K Mistry Committed by Commit Bot

Replace RemoveWithoutPathExpansion(.*, nullptr) with Value::RemoveKey()

DictionaryValue::RemoveWithoutPathExpansion() is deprecated. For the
case where nullptr is passed for the output argument, Value::RemoveKey()
is a trivial replacement.

Mostly done with the following command line, plus a bit of finesse:
% git grep -l RemoveWithoutPathExpansion | \
  xargs sed -E -i 's/RemoveWithoutPathExpansion\((.*), nullptr/RemoveKey\(\1/g'

Bug: 646113

This CL was uploaded by git cl split.

R=xdai@chromium.org

Change-Id: I404ebeab57af22c4e7ad6521b4f3811bd56883df
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2298819
Auto-Submit: Anand K Mistry <amistry@chromium.org>
Reviewed-by: default avatarXiaoqian Dai <xdai@chromium.org>
Commit-Queue: Xiaoqian Dai <xdai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#788728}
parent a1dc13d1
...@@ -765,8 +765,7 @@ bool WallpaperControllerImpl::SetUserWallpaperInfo(const AccountId& account_id, ...@@ -765,8 +765,7 @@ bool WallpaperControllerImpl::SetUserWallpaperInfo(const AccountId& account_id,
// Remove the color cache of the previous wallpaper if it exists. // Remove the color cache of the previous wallpaper if it exists.
DictionaryPrefUpdate wallpaper_colors_update(local_state_, DictionaryPrefUpdate wallpaper_colors_update(local_state_,
prefs::kWallpaperColors); prefs::kWallpaperColors);
wallpaper_colors_update->RemoveWithoutPathExpansion(old_info.location, wallpaper_colors_update->RemoveKey(old_info.location);
nullptr);
} }
DictionaryPrefUpdate wallpaper_update(local_state_, DictionaryPrefUpdate wallpaper_update(local_state_,
...@@ -1521,12 +1520,11 @@ void WallpaperControllerImpl::RemoveUserWallpaperInfo( ...@@ -1521,12 +1520,11 @@ void WallpaperControllerImpl::RemoveUserWallpaperInfo(
GetUserWallpaperInfo(account_id, &info); GetUserWallpaperInfo(account_id, &info);
DictionaryPrefUpdate prefs_wallpapers_info_update(local_state_, DictionaryPrefUpdate prefs_wallpapers_info_update(local_state_,
prefs::kUserWallpaperInfo); prefs::kUserWallpaperInfo);
prefs_wallpapers_info_update->RemoveWithoutPathExpansion( prefs_wallpapers_info_update->RemoveKey(account_id.GetUserEmail());
account_id.GetUserEmail(), nullptr);
// Remove the color cache of the previous wallpaper if it exists. // Remove the color cache of the previous wallpaper if it exists.
DictionaryPrefUpdate wallpaper_colors_update(local_state_, DictionaryPrefUpdate wallpaper_colors_update(local_state_,
prefs::kWallpaperColors); prefs::kWallpaperColors);
wallpaper_colors_update->RemoveWithoutPathExpansion(info.location, nullptr); wallpaper_colors_update->RemoveKey(info.location);
} }
void WallpaperControllerImpl::RemoveUserWallpaperImpl( void WallpaperControllerImpl::RemoveUserWallpaperImpl(
......
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