Index: device/geolocation/network_location_request.cc |
diff --git a/device/geolocation/network_location_request.cc b/device/geolocation/network_location_request.cc |
index 0db378af8d1e0e140b40f98ad127971ca2525834..08c157415f47cc0a928227dbbaacc2005efa6283 100644 |
--- a/device/geolocation/network_location_request.cc |
+++ b/device/geolocation/network_location_request.cc |
@@ -9,9 +9,11 @@ |
#include <limits> |
#include <set> |
#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.h" |
#include "base/metrics/histogram_macros.h" |
#include "base/strings/string_number_conversions.h" |
@@ -274,10 +276,9 @@ void AddWifiData(const WifiData& wifi_data, |
for (const auto& ap_data : wifi_data.access_point_data) |
access_points_by_signal_strength.insert(&ap_data); |
- base::ListValue* wifi_access_point_list = new base::ListValue(); |
+ auto wifi_access_point_list = base::MakeUnique<base::ListValue>(); |
for (auto* ap_data : access_points_by_signal_strength) { |
- std::unique_ptr<base::DictionaryValue> wifi_dict( |
- new base::DictionaryValue()); |
+ auto wifi_dict = base::MakeUnique<base::DictionaryValue>(); |
AddString("macAddress", base::UTF16ToUTF8(ap_data->mac_address), |
wifi_dict.get()); |
AddInteger("signalStrength", ap_data->radio_signal_strength, |
@@ -287,7 +288,7 @@ void AddWifiData(const WifiData& wifi_data, |
AddInteger("signalToNoiseRatio", ap_data->signal_to_noise, wifi_dict.get()); |
wifi_access_point_list->Append(std::move(wifi_dict)); |
} |
- request->Set("wifiAccessPoints", wifi_access_point_list); |
+ request->Set("wifiAccessPoints", std::move(wifi_access_point_list)); |
} |
void FormatPositionError(const GURL& server_url, |