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

Unified Diff: chrome/browser/chromeos/options/vpn_config_view.cc

Issue 2811673002: Reland: Stop passing raw pointers to base::Value API in c/b/chromeos and c/b/extensions (Closed)
Patch Set: Workaround with std::move Created 3 years, 8 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/chromeos/options/vpn_config_view.cc
diff --git a/chrome/browser/chromeos/options/vpn_config_view.cc b/chrome/browser/chromeos/options/vpn_config_view.cc
index 5c443860e6af5aab2bc1b7f1131dd92e7d060d3b..b45875fb67e9bb5e599c293fbd6eaf8270d55129 100644
--- a/chrome/browser/chromeos/options/vpn_config_view.cc
+++ b/chrome/browser/chromeos/options/vpn_config_view.cc
@@ -6,8 +6,11 @@
#include <stddef.h>
+#include <utility>
+
#include "base/bind.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
@@ -865,11 +868,11 @@ void VPNConfigView::SetConfigProperties(
case PROVIDER_TYPE_INDEX_L2TP_IPSEC_USER_CERT: {
if (server_ca_cert_combobox_) {
std::string ca_cert_pem = GetServerCACertPEM();
- base::ListValue* pem_list = new base::ListValue;
+ auto pem_list = base::MakeUnique<base::ListValue>();
if (!ca_cert_pem.empty())
pem_list->AppendString(ca_cert_pem);
properties->SetWithoutPathExpansion(shill::kL2tpIpsecCaCertPemProperty,
- pem_list);
+ std::move(pem_list));
}
SetUserCertProperties(client_cert::CONFIG_TYPE_IPSEC, properties);
if (!group_name.empty()) {
@@ -889,11 +892,11 @@ void VPNConfigView::SetConfigProperties(
case PROVIDER_TYPE_INDEX_OPEN_VPN: {
if (server_ca_cert_combobox_) {
std::string ca_cert_pem = GetServerCACertPEM();
- base::ListValue* pem_list = new base::ListValue;
+ auto pem_list = base::MakeUnique<base::ListValue>();
if (!ca_cert_pem.empty())
pem_list->AppendString(ca_cert_pem);
properties->SetWithoutPathExpansion(shill::kOpenVPNCaCertPemProperty,
- pem_list);
+ std::move(pem_list));
}
SetUserCertProperties(client_cert::CONFIG_TYPE_OPENVPN, properties);
properties->SetStringWithoutPathExpansion(

Powered by Google App Engine
This is Rietveld 408576698