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

Unified Diff: chrome/browser/ui/webui/chromeos/choose_mobile_network_ui.cc

Issue 2392693002: Rewrite simple uses of base::ListValue::Append(base::Value*) on CrOS. (Closed)
Patch Set: MakeUnique 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: chrome/browser/ui/webui/chromeos/choose_mobile_network_ui.cc
diff --git a/chrome/browser/ui/webui/chromeos/choose_mobile_network_ui.cc b/chrome/browser/ui/webui/chromeos/choose_mobile_network_ui.cc
index 058bb906f0d86c096640f51a9e454f730b09e082..b57c6e0ea375a81de8a5ce35fd47f9a779451301 100644
--- a/chrome/browser/ui/webui/chromeos/choose_mobile_network_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/choose_mobile_network_ui.cc
@@ -6,14 +6,17 @@
#include <stddef.h>
+#include <memory>
#include <set>
#include <string>
+#include <utility>
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_piece.h"
#include "base/values.h"
@@ -189,7 +192,7 @@ void ChooseMobileNetworkHandler::DeviceListChanged() {
// Register API doesn't allow technology to be specified so just show unique
// network in UI.
if (network_ids.insert(it->network_id).second) {
- base::DictionaryValue* network = new base::DictionaryValue();
+ auto network = base::MakeUnique<base::DictionaryValue>();
network->SetString(kNetworkIdProperty, it->network_id);
if (!it->long_name.empty())
network->SetString(kOperatorNameProperty, it->long_name);
@@ -199,7 +202,7 @@ void ChooseMobileNetworkHandler::DeviceListChanged() {
network->SetString(kOperatorNameProperty, it->network_id);
network->SetString(kStatusProperty, it->status);
network->SetString(kTechnologyProperty, it->technology);
- networks_list_.Append(network);
+ networks_list_.Append(std::move(network));
}
}
if (is_page_ready_) {

Powered by Google App Engine
This is Rietveld 408576698