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

Unified Diff: remoting/host/desktop_session_win.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
« no previous file with comments | « remoting/host/desktop_session_win.h ('k') | remoting/host/disconnect_window_chromeos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/desktop_session_win.cc
diff --git a/remoting/host/desktop_session_win.cc b/remoting/host/desktop_session_win.cc
index 3001a131692203655fad1ea0c3ee681b62fa9988..413b17985ecdab2fc8093ed793e8a40bf74814ff 100644
--- a/remoting/host/desktop_session_win.cc
+++ b/remoting/host/desktop_session_win.cc
@@ -7,6 +7,7 @@
#include <sddl.h>
#include <limits>
+#include <memory>
#include <utility>
#include "base/base_switches.h"
@@ -14,8 +15,8 @@
#include "base/files/file_path.h"
#include "base/guid.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
@@ -104,7 +105,7 @@ class ConsoleSession : public DesktopSessionWin {
void InjectSas() override;
private:
- scoped_ptr<SasInjector> sas_injector_;
+ std::unique_ptr<SasInjector> sas_injector_;
DISALLOW_COPY_AND_ASSIGN(ConsoleSession);
};
@@ -365,27 +366,27 @@ STDMETHODIMP RdpSession::EventHandler::OnRdpClosed() {
} // namespace
// static
-scoped_ptr<DesktopSession> DesktopSessionWin::CreateForConsole(
+std::unique_ptr<DesktopSession> DesktopSessionWin::CreateForConsole(
scoped_refptr<AutoThreadTaskRunner> caller_task_runner,
scoped_refptr<AutoThreadTaskRunner> io_task_runner,
DaemonProcess* daemon_process,
int id,
const ScreenResolution& resolution) {
- return make_scoped_ptr(new ConsoleSession(
- caller_task_runner, io_task_runner, daemon_process, id,
- HostService::GetInstance()));
+ return base::WrapUnique(new ConsoleSession(caller_task_runner, io_task_runner,
+ daemon_process, id,
+ HostService::GetInstance()));
}
// static
-scoped_ptr<DesktopSession> DesktopSessionWin::CreateForVirtualTerminal(
+std::unique_ptr<DesktopSession> DesktopSessionWin::CreateForVirtualTerminal(
scoped_refptr<AutoThreadTaskRunner> caller_task_runner,
scoped_refptr<AutoThreadTaskRunner> io_task_runner,
DaemonProcess* daemon_process,
int id,
const ScreenResolution& resolution) {
- scoped_ptr<RdpSession> session(new RdpSession(
- caller_task_runner, io_task_runner, daemon_process, id,
- HostService::GetInstance()));
+ std::unique_ptr<RdpSession> session(
+ new RdpSession(caller_task_runner, io_task_runner, daemon_process, id,
+ HostService::GetInstance()));
if (!session->Initialize(resolution))
return nullptr;
@@ -530,16 +531,18 @@ void DesktopSessionWin::OnSessionAttached(uint32_t session_id) {
session_attach_timer_.Stop();
- scoped_ptr<base::CommandLine> target(new base::CommandLine(desktop_binary));
+ std::unique_ptr<base::CommandLine> target(
+ new base::CommandLine(desktop_binary));
target->AppendSwitchASCII(kProcessTypeSwitchName, kProcessTypeDesktop);
// Copy the command line switches enabling verbose logging.
target->CopySwitchesFrom(*base::CommandLine::ForCurrentProcess(),
kCopiedSwitchNames, arraysize(kCopiedSwitchNames));
// Create a delegate capable of launching a process in a different session.
- scoped_ptr<WtsSessionProcessDelegate> delegate(new WtsSessionProcessDelegate(
- io_task_runner_, std::move(target), launch_elevated,
- base::WideToUTF8(kDaemonIpcSecurityDescriptor)));
+ std::unique_ptr<WtsSessionProcessDelegate> delegate(
+ new WtsSessionProcessDelegate(
+ io_task_runner_, std::move(target), launch_elevated,
+ base::WideToUTF8(kDaemonIpcSecurityDescriptor)));
if (!delegate->Initialize(session_id)) {
TerminateSession();
return;
« no previous file with comments | « remoting/host/desktop_session_win.h ('k') | remoting/host/disconnect_window_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698