Remove use of deprecated base::ListValue::Append(Value*) overload in //chromeos.
BUG=581865
R=derat@chromium.org
TBR=stevenjb@chromium.org
Review-Url: https://codereview.chromium.org/2417893002
Cr-Commit-Position: refs/heads/master@{#425130}
diff --git a/chromeos/dbus/fake_shill_manager_client.cc b/chromeos/dbus/fake_shill_manager_client.cc
index 047c4f1..a4df88b 100644
--- a/chromeos/dbus/fake_shill_manager_client.cc
+++ b/chromeos/dbus/fake_shill_manager_client.cc
@@ -457,7 +457,7 @@
list_value = new base::ListValue;
stub_geo_networks_.SetWithoutPathExpansion(technology, list_value);
}
- list_value->Append(network.DeepCopy());
+ list_value->Append(network.CreateDeepCopy());
}
void FakeShillManagerClient::AddProfile(const std::string& profile_path) {
@@ -867,8 +867,8 @@
services->SetServiceProperty(kCellularServicePath,
shill::kCellularLastGoodApnProperty, apn);
base::ListValue apn_list;
- apn_list.Append(apn.DeepCopy());
- apn_list.Append(apn2.DeepCopy());
+ apn_list.Append(apn.CreateDeepCopy());
+ apn_list.Append(apn2.CreateDeepCopy());
devices->SetDeviceProperty("/device/cellular1",
shill::kCellularApnListProperty, apn_list);
@@ -1041,7 +1041,7 @@
std::string type;
properties->GetString(shill::kTypeProperty, &type);
if (TechnologyEnabled(type))
- new_service_list->Append((*iter)->DeepCopy());
+ new_service_list->Append((*iter)->CreateDeepCopy());
}
}
return new_service_list;
diff --git a/chromeos/geolocation/simple_geolocation_request.cc b/chromeos/geolocation/simple_geolocation_request.cc
index 1d5ce4a..cb10cd6 100644
--- a/chromeos/geolocation/simple_geolocation_request.cc
+++ b/chromeos/geolocation/simple_geolocation_request.cc
@@ -8,9 +8,11 @@
#include <algorithm>
#include <string>
+#include <utility>
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
+#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/metrics/sparse_histogram.h"
#include "base/strings/string_number_conversions.h"
@@ -332,8 +334,7 @@
request->SetWithoutPathExpansion(kWifiAccessPoints, wifi_access_points);
for (const WifiAccessPoint& access_point : *wifi_data_) {
- base::DictionaryValue* access_point_dictionary = new base::DictionaryValue;
- wifi_access_points->Append(access_point_dictionary);
+ auto access_point_dictionary = base::MakeUnique<base::DictionaryValue>();
access_point_dictionary->SetStringWithoutPathExpansion(
kMacAddress, access_point.mac_address);
@@ -350,6 +351,8 @@
kChannel, access_point.channel);
access_point_dictionary->SetIntegerWithoutPathExpansion(
kSignalToNoiseRatio, access_point.signal_to_noise);
+
+ wifi_access_points->Append(std::move(access_point_dictionary));
}
std::string result;
if (!base::JSONWriter::Write(*request, &result)) {
diff --git a/chromeos/network/managed_network_configuration_handler_impl.cc b/chromeos/network/managed_network_configuration_handler_impl.cc
index dd46255..71eed8b 100644
--- a/chromeos/network/managed_network_configuration_handler_impl.cc
+++ b/chromeos/network/managed_network_configuration_handler_impl.cc
@@ -768,7 +768,7 @@
base::ListValue* ip_configs = new base::ListValue;
for (base::DictionaryValue::Iterator iter(device_state->ip_configs());
!iter.IsAtEnd(); iter.Advance()) {
- ip_configs->Append(iter.value().DeepCopy());
+ ip_configs->Append(iter.value().CreateDeepCopy());
}
properties->SetWithoutPathExpansion(shill::kIPConfigsProperty, ip_configs);
}