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

Unified Diff: remoting/host/setup/daemon_controller_delegate_mac.mm

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/setup/daemon_controller_delegate_mac.mm
diff --git a/remoting/host/setup/daemon_controller_delegate_mac.mm b/remoting/host/setup/daemon_controller_delegate_mac.mm
index 4363a405d7cf2219c9663b6de2255f6aec5ab843..c8386ead79b682f67c8ad5e4b43f3651edddcbb3 100644
--- a/remoting/host/setup/daemon_controller_delegate_mac.mm
+++ b/remoting/host/setup/daemon_controller_delegate_mac.mm
@@ -2,10 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <CoreFoundation/CoreFoundation.h>
-
#include "remoting/host/setup/daemon_controller_delegate_mac.h"
+#include <CoreFoundation/CoreFoundation.h>
#include <launch.h>
#include <stdio.h>
#include <sys/types.h>
@@ -21,6 +20,7 @@
#include "base/mac/mac_logging.h"
#include "base/mac/mac_util.h"
#include "base/mac/scoped_launch_data.h"
+#include "base/memory/ptr_util.h"
#include "base/time/time.h"
#include "base/values.h"
#include "remoting/host/constants_mac.h"
@@ -48,14 +48,15 @@ DaemonController::State DaemonControllerDelegateMac::GetState() {
}
}
-scoped_ptr<base::DictionaryValue> DaemonControllerDelegateMac::GetConfig() {
+std::unique_ptr<base::DictionaryValue>
+DaemonControllerDelegateMac::GetConfig() {
base::FilePath config_path(kHostConfigFilePath);
- scoped_ptr<base::DictionaryValue> host_config(
+ std::unique_ptr<base::DictionaryValue> host_config(
HostConfigFromJsonFile(config_path));
if (!host_config)
return nullptr;
- scoped_ptr<base::DictionaryValue> config(new base::DictionaryValue);
+ std::unique_ptr<base::DictionaryValue> config(new base::DictionaryValue);
std::string value;
if (host_config->GetString(kHostIdConfigPath, &value))
config->SetString(kHostIdConfigPath, value);
@@ -65,7 +66,7 @@ scoped_ptr<base::DictionaryValue> DaemonControllerDelegateMac::GetConfig() {
}
void DaemonControllerDelegateMac::SetConfigAndStart(
- scoped_ptr<base::DictionaryValue> config,
+ std::unique_ptr<base::DictionaryValue> config,
bool consent,
const DaemonController::CompletionCallback& done) {
config->SetBoolean(kUsageStatsConsentConfigPath, consent);
@@ -73,10 +74,10 @@ void DaemonControllerDelegateMac::SetConfigAndStart(
}
void DaemonControllerDelegateMac::UpdateConfig(
- scoped_ptr<base::DictionaryValue> config,
+ std::unique_ptr<base::DictionaryValue> config,
const DaemonController::CompletionCallback& done) {
base::FilePath config_file_path(kHostConfigFilePath);
- scoped_ptr<base::DictionaryValue> host_config(
+ std::unique_ptr<base::DictionaryValue> host_config(
HostConfigFromJsonFile(config_file_path));
if (!host_config) {
done.Run(DaemonController::RESULT_FAILED);
@@ -101,7 +102,7 @@ DaemonControllerDelegateMac::GetUsageStatsConsent() {
consent.set_by_policy = false;
base::FilePath config_file_path(kHostConfigFilePath);
- scoped_ptr<base::DictionaryValue> host_config(
+ std::unique_ptr<base::DictionaryValue> host_config(
HostConfigFromJsonFile(config_file_path));
if (host_config) {
host_config->GetBoolean(kUsageStatsConsentConfigPath, &consent.allowed);
@@ -250,7 +251,7 @@ void DaemonControllerDelegateMac::PreferencePaneCallback(
scoped_refptr<DaemonController> DaemonController::Create() {
return new DaemonController(
- make_scoped_ptr(new DaemonControllerDelegateMac()));
+ base::WrapUnique(new DaemonControllerDelegateMac()));
}
} // namespace remoting
« no previous file with comments | « remoting/host/setup/daemon_controller_delegate_mac.h ('k') | remoting/host/setup/daemon_controller_delegate_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698