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

Unified Diff: content/browser/geolocation/network_location_provider_unittest.cc

Issue 2058233002: Rewrite simple uses of base::ListValue::Append() taking a raw pointer var. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: less comments more ownership Created 4 years, 6 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 | « components/url_matcher/url_matcher_factory_unittest.cc ('k') | content/browser/gpu/compositor_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/geolocation/network_location_provider_unittest.cc
diff --git a/content/browser/geolocation/network_location_provider_unittest.cc b/content/browser/geolocation/network_location_provider_unittest.cc
index ebbf582160a89411c58af261473faa3617cb33bd..68973fffbad331aad436092d6f056088739ba28a 100644
--- a/content/browser/geolocation/network_location_provider_unittest.cc
+++ b/content/browser/geolocation/network_location_provider_unittest.cc
@@ -7,6 +7,7 @@
#include <stddef.h>
#include <memory>
+#include <utility>
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
@@ -175,13 +176,13 @@ class GeolocationNetworkProviderTest : public testing::Test {
int ap_count, int start_index, base::ListValue* wifi_access_point_list) {
std::vector<std::string> wifi_data;
for (int i = 0; i < ap_count; ++i) {
- base::DictionaryValue* ap = new base::DictionaryValue();
+ std::unique_ptr<base::DictionaryValue> ap(new base::DictionaryValue());
ap->SetString("macAddress", base::StringPrintf("%02d-34-56-78-54-32", i));
ap->SetInteger("signalStrength", start_index + ap_count - i);
ap->SetInteger("age", 0);
ap->SetInteger("channel", IndexToChannel(i));
ap->SetInteger("signalToNoiseRatio", i + 42);
- wifi_access_point_list->Append(ap);
+ wifi_access_point_list->Append(std::move(ap));
}
}
« no previous file with comments | « components/url_matcher/url_matcher_factory_unittest.cc ('k') | content/browser/gpu/compositor_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698