Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Unified Diff: chromeos/network/managed_network_configuration_handler_impl.cc

Issue 2871653002: Remove raw base::DictionaryValue::SetWithoutPathExpansion in //chromeos (Closed)
Patch Set: Minor Fix Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chromeos/network/managed_network_configuration_handler_impl.cc
diff --git a/chromeos/network/managed_network_configuration_handler_impl.cc b/chromeos/network/managed_network_configuration_handler_impl.cc
index 1fc9374fd73ebb5498a89743e5128c011a4e9f24..2aead19cee39f7bc86e567b9c5417b655311d1e3 100644
--- a/chromeos/network/managed_network_configuration_handler_impl.cc
+++ b/chromeos/network/managed_network_configuration_handler_impl.cc
@@ -838,12 +838,13 @@ void ManagedNetworkConfigurationHandlerImpl::GetDeviceStateProperties(
}
// Convert IPConfig dictionary to a ListValue.
- base::ListValue* ip_configs = new base::ListValue;
+ auto ip_configs = base::MakeUnique<base::ListValue>();
for (base::DictionaryValue::Iterator iter(device_state->ip_configs());
!iter.IsAtEnd(); iter.Advance()) {
ip_configs->Append(iter.value().CreateDeepCopy());
}
- properties->SetWithoutPathExpansion(shill::kIPConfigsProperty, ip_configs);
+ properties->SetWithoutPathExpansion(shill::kIPConfigsProperty,
+ std::move(ip_configs));
}
void ManagedNetworkConfigurationHandlerImpl::GetPropertiesCallback(
@@ -916,7 +917,7 @@ void ManagedNetworkConfigurationHandlerImpl::GetDevicePropertiesSuccess(
const base::DictionaryValue& device_properties) {
// Create a "Device" dictionary in |network_properties|.
network_properties->SetWithoutPathExpansion(
- shill::kDeviceProperty, device_properties.DeepCopy());
+ shill::kDeviceProperty, base::MakeUnique<base::Value>(device_properties));
send_callback.Run(service_path, std::move(network_properties));
}
« no previous file with comments | « chromeos/network/device_state.cc ('k') | chromeos/network/managed_network_configuration_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698