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

Unified Diff: components/wifi_sync/wifi_credential.cc

Issue 1917673002: Convert //components/[u-z]* from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 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
« no previous file with comments | « components/wifi_sync/wifi_credential.h ('k') | components/wifi_sync/wifi_credential_syncable_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/wifi_sync/wifi_credential.cc
diff --git a/components/wifi_sync/wifi_credential.cc b/components/wifi_sync/wifi_credential.cc
index 0970f264d4f1b71b7e45dff96c13ca77f6fa05b4..e4e9544cb9217a06d5cd35d9212e676f60e82d63 100644
--- a/components/wifi_sync/wifi_credential.cc
+++ b/components/wifi_sync/wifi_credential.cc
@@ -6,6 +6,7 @@
#include "base/i18n/streaming_utf8_validator.h"
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/values.h"
@@ -19,7 +20,7 @@ WifiCredential::~WifiCredential() {
}
// static
-scoped_ptr<WifiCredential> WifiCredential::Create(
+std::unique_ptr<WifiCredential> WifiCredential::Create(
const SsidBytes& ssid,
WifiSecurityClass security_class,
const std::string& passphrase) {
@@ -33,10 +34,10 @@ scoped_ptr<WifiCredential> WifiCredential::Create(
return nullptr;
}
- return make_scoped_ptr(new WifiCredential(ssid, security_class, passphrase));
+ return base::WrapUnique(new WifiCredential(ssid, security_class, passphrase));
}
-scoped_ptr<base::DictionaryValue> WifiCredential::ToOncProperties() const {
+std::unique_ptr<base::DictionaryValue> WifiCredential::ToOncProperties() const {
const std::string ssid_utf8(ssid().begin(), ssid().end());
// TODO(quiche): Remove this test, once ONC suports non-UTF-8 SSIDs.
// crbug.com/432546.
@@ -49,10 +50,10 @@ scoped_ptr<base::DictionaryValue> WifiCredential::ToOncProperties() const {
if (!WifiSecurityClassToOncSecurityString(security_class(), &onc_security)) {
NOTREACHED() << "Failed to convert SecurityClass with value "
<< security_class();
- return make_scoped_ptr(new base::DictionaryValue());
+ return base::WrapUnique(new base::DictionaryValue());
}
- scoped_ptr<base::DictionaryValue> onc_properties(
+ std::unique_ptr<base::DictionaryValue> onc_properties(
new base::DictionaryValue());
onc_properties->Set(onc::toplevel_config::kType,
new base::StringValue(onc::network_type::kWiFi));
« no previous file with comments | « components/wifi_sync/wifi_credential.h ('k') | components/wifi_sync/wifi_credential_syncable_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698