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

Unified Diff: chromeos/geolocation/simple_geolocation_request.cc

Issue 2417893002: Remove use of deprecated base::ListValue::Append(Value*) overload in //chromeos. (Closed)
Patch Set: Created 4 years, 2 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/geolocation/simple_geolocation_request.cc
diff --git a/chromeos/geolocation/simple_geolocation_request.cc b/chromeos/geolocation/simple_geolocation_request.cc
index 1d5ce4a94656dde84f4eb218b747798bc3466930..cb10cd6618b6209599a731f5c6c46eaa7edf9eee 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 @@ std::string SimpleGeolocationRequest::FormatRequestBody() const {
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 @@ std::string SimpleGeolocationRequest::FormatRequestBody() const {
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)) {
« no previous file with comments | « chromeos/dbus/fake_shill_manager_client.cc ('k') | chromeos/network/managed_network_configuration_handler_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698