Commit 46e85d02 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=stevenjb@chromium.org

Change-Id: I5779a8b0bb93ad00550de27beae1ac73681ae017
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2298862
Auto-Submit: Anand K Mistry <amistry@chromium.org>
Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Commit-Queue: Steven Bennetts <stevenjb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#788659}
parent 7a7d1a3a
......@@ -130,7 +130,7 @@ void FakeShillDeviceClient::ClearProperty(const dbus::ObjectPath& device_path,
PostVoidCallback(std::move(callback), false);
return;
}
device_properties->RemoveWithoutPathExpansion(name, nullptr);
device_properties->RemoveKey(name);
PostVoidCallback(std::move(callback), true);
}
......@@ -408,7 +408,7 @@ void FakeShillDeviceClient::AddDevice(const std::string& device_path,
void FakeShillDeviceClient::RemoveDevice(const std::string& device_path) {
ShillManagerClient::Get()->GetTestInterface()->RemoveDevice(device_path);
stub_devices_.RemoveWithoutPathExpansion(device_path, nullptr);
stub_devices_.RemoveKey(device_path);
}
void FakeShillDeviceClient::ClearDevices() {
......
......@@ -113,7 +113,7 @@ void FakeShillProfileClient::DeleteEntry(const dbus::ObjectPath& profile_path,
return;
}
if (!profile->entries.RemoveWithoutPathExpansion(entry_path, nullptr)) {
if (!profile->entries.RemoveKey(entry_path)) {
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::BindOnce(std::move(error_callback),
"Error.InvalidProfileEntry", entry_path));
......
......@@ -223,7 +223,7 @@ void FakeShillServiceClient::ClearProperty(const dbus::ObjectPath& service_path,
std::move(error_callback).Run("Error.InvalidService", "Invalid Service");
return;
}
dict->RemoveWithoutPathExpansion(name, nullptr);
dict->RemoveKey(name);
// Note: Shill does not send notifications when properties are cleared.
base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, std::move(callback));
}
......@@ -446,7 +446,7 @@ base::DictionaryValue* FakeShillServiceClient::SetServiceProperties(
}
void FakeShillServiceClient::RemoveService(const std::string& service_path) {
stub_services_.RemoveWithoutPathExpansion(service_path, nullptr);
stub_services_.RemoveKey(service_path);
connect_behavior_.erase(service_path);
ShillManagerClient::Get()->GetTestInterface()->RemoveManagerService(
service_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