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

Unified Diff: device/geolocation/network_location_request.cc

Issue 2285933003: Remove more usage of the base::ListValue::Append(Value*) overload. (Closed)
Patch Set: rebase Created 4 years, 4 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
« no previous file with comments | « content/renderer/media/peer_connection_tracker.cc ('k') | google_apis/drive/drive_api_requests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/geolocation/network_location_request.cc
diff --git a/device/geolocation/network_location_request.cc b/device/geolocation/network_location_request.cc
index 49762137609a5df11c386ef7ac17b5ae70f9636a..3278db702e3951fdbd6603a2ecfd6699caabb328 100644
--- a/device/geolocation/network_location_request.cc
+++ b/device/geolocation/network_location_request.cc
@@ -250,13 +250,16 @@ void AddWifiData(const WifiData& wifi_data,
base::ListValue* wifi_access_point_list = new base::ListValue();
for (auto* ap_data : access_points_by_signal_strength) {
- base::DictionaryValue* wifi_dict = new base::DictionaryValue();
- AddString("macAddress", base::UTF16ToUTF8(ap_data->mac_address), wifi_dict);
- AddInteger("signalStrength", ap_data->radio_signal_strength, wifi_dict);
- AddInteger("age", age_milliseconds, wifi_dict);
- AddInteger("channel", ap_data->channel, wifi_dict);
- AddInteger("signalToNoiseRatio", ap_data->signal_to_noise, wifi_dict);
- wifi_access_point_list->Append(wifi_dict);
+ std::unique_ptr<base::DictionaryValue> wifi_dict(
+ new base::DictionaryValue());
+ AddString("macAddress", base::UTF16ToUTF8(ap_data->mac_address),
+ wifi_dict.get());
+ AddInteger("signalStrength", ap_data->radio_signal_strength,
+ wifi_dict.get());
+ AddInteger("age", age_milliseconds, wifi_dict.get());
+ AddInteger("channel", ap_data->channel, wifi_dict.get());
+ 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);
}
« no previous file with comments | « content/renderer/media/peer_connection_tracker.cc ('k') | google_apis/drive/drive_api_requests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698