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

Unified Diff: remoting/host/pairing_registry_delegate_linux.cc

Issue 1864213002: Convert //remoting to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac IWYU 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
Index: remoting/host/pairing_registry_delegate_linux.cc
diff --git a/remoting/host/pairing_registry_delegate_linux.cc b/remoting/host/pairing_registry_delegate_linux.cc
index 8bd25de77f6a35d65cb420363dd7de7feb5aa10c..f6ad1c52e09d5e92b0c5f850cf90a3ec2e7fad03 100644
--- a/remoting/host/pairing_registry_delegate_linux.cc
+++ b/remoting/host/pairing_registry_delegate_linux.cc
@@ -11,6 +11,7 @@
#include "base/json/json_file_value_serializer.h"
#include "base/json/json_string_value_serializer.h"
#include "base/location.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/stringprintf.h"
#include "base/values.h"
#include "remoting/host/branding.h"
@@ -35,8 +36,8 @@ PairingRegistryDelegateLinux::PairingRegistryDelegateLinux() {
PairingRegistryDelegateLinux::~PairingRegistryDelegateLinux() {
}
-scoped_ptr<base::ListValue> PairingRegistryDelegateLinux::LoadAll() {
- scoped_ptr<base::ListValue> pairings(new base::ListValue());
+std::unique_ptr<base::ListValue> PairingRegistryDelegateLinux::LoadAll() {
+ std::unique_ptr<base::ListValue> pairings(new base::ListValue());
// Enumerate all pairing files in the pairing registry.
base::FilePath registry_path = GetRegistryPath();
@@ -49,7 +50,7 @@ scoped_ptr<base::ListValue> PairingRegistryDelegateLinux::LoadAll() {
JSONFileValueDeserializer deserializer(pairing_file);
int error_code;
std::string error_message;
- scoped_ptr<base::Value> pairing_json =
+ std::unique_ptr<base::Value> pairing_json =
deserializer.Deserialize(&error_code, &error_message);
if (!pairing_json) {
LOG(WARNING) << "Failed to load '" << pairing_file.value() << "' ("
@@ -88,7 +89,7 @@ PairingRegistry::Pairing PairingRegistryDelegateLinux::Load(
JSONFileValueDeserializer deserializer(pairing_file);
int error_code;
std::string error_message;
- scoped_ptr<base::Value> pairing =
+ std::unique_ptr<base::Value> pairing =
deserializer.Deserialize(&error_code, &error_message);
if (!pairing) {
LOG(WARNING) << "Failed to load pairing information: " << error_message
@@ -155,9 +156,8 @@ void PairingRegistryDelegateLinux::SetRegistryPathForTesting(
registry_path_for_testing_ = registry_path;
}
-
-scoped_ptr<PairingRegistry::Delegate> CreatePairingRegistryDelegate() {
- return make_scoped_ptr(new PairingRegistryDelegateLinux());
+std::unique_ptr<PairingRegistry::Delegate> CreatePairingRegistryDelegate() {
+ return base::WrapUnique(new PairingRegistryDelegateLinux());
}
} // namespace remoting
« no previous file with comments | « remoting/host/pairing_registry_delegate_linux.h ('k') | remoting/host/pairing_registry_delegate_linux_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698