Commit 216f65a8 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=hgrandinetti@chromium.org

Change-Id: I0ab953517310bcb03b6edab3afa6dedb63b662e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2298879
Auto-Submit: Anand K Mistry <amistry@chromium.org>
Reviewed-by: default avatarHenrique Grandinetti <hgrandinetti@chromium.org>
Commit-Queue: Henrique Grandinetti <hgrandinetti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#788623}
parent 293c4d48
......@@ -171,7 +171,7 @@ void SupervisedUserSettingsService::SetLocalSetting(
if (value)
local_settings_->SetWithoutPathExpansion(key, std::move(value));
else
local_settings_->RemoveWithoutPathExpansion(key, nullptr);
local_settings_->RemoveKey(key);
InformSubscribers();
}
......@@ -350,7 +350,7 @@ SupervisedUserSettingsService::ProcessSyncChanges(
case SyncChange::ACTION_DELETE: {
DLOG_IF(WARNING, !dict->HasKey(key)) << "Trying to delete nonexistent "
<< "key " << key;
dict->RemoveWithoutPathExpansion(key, nullptr);
dict->RemoveKey(key);
break;
}
case SyncChange::ACTION_INVALID: {
......
......@@ -293,7 +293,7 @@ void SupervisedUserWhitelistService::RemoveWhitelist(
const std::string& id) {
base::RecordAction(base::UserMetricsAction("ManagedUsers_Whitelist_Removed"));
pref_dict->RemoveWithoutPathExpansion(id, NULL);
pref_dict->RemoveKey(id);
installer_->UnregisterWhitelist(client_id_, id);
UnloadWhitelist(id);
}
......
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