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

Unified Diff: remoting/host/setup/daemon_controller.h

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
« no previous file with comments | « remoting/host/server_log_entry_host_unittest.cc ('k') | remoting/host/setup/daemon_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/setup/daemon_controller.h
diff --git a/remoting/host/setup/daemon_controller.h b/remoting/host/setup/daemon_controller.h
index 52ab0d15f1996bb0f9ff52ed1de72ec1d5a445d7..8d1359067880f79f8b1f83a3abfd94276810dd08 100644
--- a/remoting/host/setup/daemon_controller.h
+++ b/remoting/host/setup/daemon_controller.h
@@ -5,13 +5,13 @@
#ifndef REMOTING_HOST_SETUP_DAEMON_CONTROLLER_H_
#define REMOTING_HOST_SETUP_DAEMON_CONTROLLER_H_
+#include <memory>
#include <queue>
#include <string>
#include "base/callback.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
namespace base {
class DictionaryValue;
@@ -66,7 +66,7 @@ class DaemonController : public base::RefCountedThreadSafe<DaemonController> {
// is returned containing host_id and xmpp_login, with security-sensitive
// fields filtered out. An empty dictionary is returned if the host is not
// configured, and nullptr if the configuration is corrupt or cannot be read.
- typedef base::Callback<void (scoped_ptr<base::DictionaryValue> config)>
+ typedef base::Callback<void(std::unique_ptr<base::DictionaryValue> config)>
GetConfigCallback;
// Callback used for asynchronous operations, e.g. when
@@ -107,13 +107,13 @@ class DaemonController : public base::RefCountedThreadSafe<DaemonController> {
// Queries current host configuration. Any values that might be security
// sensitive have been filtered out.
- virtual scoped_ptr<base::DictionaryValue> GetConfig() = 0;
+ virtual std::unique_ptr<base::DictionaryValue> GetConfig() = 0;
// Starts the daemon process. This may require that the daemon be
// downloaded and installed. |done| is invoked on the calling thread when
// the operation is completed.
virtual void SetConfigAndStart(
- scoped_ptr<base::DictionaryValue> config,
+ std::unique_ptr<base::DictionaryValue> config,
bool consent,
const CompletionCallback& done) = 0;
@@ -122,9 +122,8 @@ class DaemonController : public base::RefCountedThreadSafe<DaemonController> {
// |config| is preserved. |config| must not contain host_id or xmpp_login
// values, because implementations of this method cannot change them. |done|
// is invoked on the calling thread when the operation is completed.
- virtual void UpdateConfig(
- scoped_ptr<base::DictionaryValue> config,
- const CompletionCallback& done) = 0;
+ virtual void UpdateConfig(std::unique_ptr<base::DictionaryValue> config,
+ const CompletionCallback& done) = 0;
// Stops the daemon process. |done| is invoked on the calling thread when
// the operation is completed.
@@ -136,7 +135,7 @@ class DaemonController : public base::RefCountedThreadSafe<DaemonController> {
static scoped_refptr<DaemonController> Create();
- explicit DaemonController(scoped_ptr<Delegate> delegate);
+ explicit DaemonController(std::unique_ptr<Delegate> delegate);
// Return the "installed/running" state of the daemon process.
//
@@ -159,7 +158,7 @@ class DaemonController : public base::RefCountedThreadSafe<DaemonController> {
// these two steps are merged for simplicity. Consider splitting it
// into SetConfig() and Start() once we have basic host setup flow
// working.
- void SetConfigAndStart(scoped_ptr<base::DictionaryValue> config,
+ void SetConfigAndStart(std::unique_ptr<base::DictionaryValue> config,
bool consent,
const CompletionCallback& done);
@@ -168,7 +167,7 @@ class DaemonController : public base::RefCountedThreadSafe<DaemonController> {
// Any value in the existing configuration that isn't specified in |config|
// is preserved. |config| must not contain host_id or xmpp_login values,
// because implementations of this method cannot change them.
- void UpdateConfig(scoped_ptr<base::DictionaryValue> config,
+ void UpdateConfig(std::unique_ptr<base::DictionaryValue> config,
const CompletionCallback& done);
// Stop the daemon process. It is permitted to call Stop while the daemon
@@ -188,10 +187,10 @@ class DaemonController : public base::RefCountedThreadSafe<DaemonController> {
// Blocking helper methods used to call the delegate.
void DoGetConfig(const GetConfigCallback& done);
- void DoSetConfigAndStart(scoped_ptr<base::DictionaryValue> config,
+ void DoSetConfigAndStart(std::unique_ptr<base::DictionaryValue> config,
bool consent,
const CompletionCallback& done);
- void DoUpdateConfig(scoped_ptr<base::DictionaryValue> config,
+ void DoUpdateConfig(std::unique_ptr<base::DictionaryValue> config,
const CompletionCallback& done);
void DoStop(const CompletionCallback& done);
void DoGetUsageStatsConsent(const GetUsageStatsConsentCallback& done);
@@ -203,7 +202,7 @@ class DaemonController : public base::RefCountedThreadSafe<DaemonController> {
AsyncResult result);
void InvokeConfigCallbackAndScheduleNext(
const GetConfigCallback& done,
- scoped_ptr<base::DictionaryValue> config);
+ std::unique_ptr<base::DictionaryValue> config);
void InvokeConsentCallbackAndScheduleNext(
const GetUsageStatsConsentCallback& done,
const UsageStatsConsent& consent);
@@ -221,9 +220,9 @@ class DaemonController : public base::RefCountedThreadSafe<DaemonController> {
// called at a time.
scoped_refptr<AutoThreadTaskRunner> delegate_task_runner_;
- scoped_ptr<AutoThread> delegate_thread_;
+ std::unique_ptr<AutoThread> delegate_thread_;
- scoped_ptr<Delegate> delegate_;
+ std::unique_ptr<Delegate> delegate_;
std::queue<base::Closure> pending_requests_;
« no previous file with comments | « remoting/host/server_log_entry_host_unittest.cc ('k') | remoting/host/setup/daemon_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698