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

Side by Side Diff: remoting/host/desktop_session_win.cc

Issue 609923004: Cleanup usage of scoped_ptr<> in remoting for C++11 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/host/desktop_session_win.h" 5 #include "remoting/host/desktop_session_win.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <sddl.h> 8 #include <sddl.h>
9 9
10 #include "base/base_switches.h" 10 #include "base/base_switches.h"
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 scoped_ptr<DesktopSession> DesktopSessionWin::CreateForConsole( 368 scoped_ptr<DesktopSession> DesktopSessionWin::CreateForConsole(
369 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, 369 scoped_refptr<AutoThreadTaskRunner> caller_task_runner,
370 scoped_refptr<AutoThreadTaskRunner> io_task_runner, 370 scoped_refptr<AutoThreadTaskRunner> io_task_runner,
371 DaemonProcess* daemon_process, 371 DaemonProcess* daemon_process,
372 int id, 372 int id,
373 const ScreenResolution& resolution) { 373 const ScreenResolution& resolution) {
374 scoped_ptr<ConsoleSession> session(new ConsoleSession( 374 scoped_ptr<ConsoleSession> session(new ConsoleSession(
375 caller_task_runner, io_task_runner, daemon_process, id, 375 caller_task_runner, io_task_runner, daemon_process, id,
376 HostService::GetInstance())); 376 HostService::GetInstance()));
377 377
378 return session.PassAs<DesktopSession>(); 378 return session.Pass();
379 } 379 }
380 380
381 // static 381 // static
382 scoped_ptr<DesktopSession> DesktopSessionWin::CreateForVirtualTerminal( 382 scoped_ptr<DesktopSession> DesktopSessionWin::CreateForVirtualTerminal(
383 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, 383 scoped_refptr<AutoThreadTaskRunner> caller_task_runner,
384 scoped_refptr<AutoThreadTaskRunner> io_task_runner, 384 scoped_refptr<AutoThreadTaskRunner> io_task_runner,
385 DaemonProcess* daemon_process, 385 DaemonProcess* daemon_process,
386 int id, 386 int id,
387 const ScreenResolution& resolution) { 387 const ScreenResolution& resolution) {
388 scoped_ptr<RdpSession> session(new RdpSession( 388 scoped_ptr<RdpSession> session(new RdpSession(
389 caller_task_runner, io_task_runner, daemon_process, id, 389 caller_task_runner, io_task_runner, daemon_process, id,
390 HostService::GetInstance())); 390 HostService::GetInstance()));
391 if (!session->Initialize(resolution)) 391 if (!session->Initialize(resolution))
392 return scoped_ptr<DesktopSession>(); 392 return nullptr;
393 393
394 return session.PassAs<DesktopSession>(); 394 return session.Pass();
395 } 395 }
396 396
397 DesktopSessionWin::DesktopSessionWin( 397 DesktopSessionWin::DesktopSessionWin(
398 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, 398 scoped_refptr<AutoThreadTaskRunner> caller_task_runner,
399 scoped_refptr<AutoThreadTaskRunner> io_task_runner, 399 scoped_refptr<AutoThreadTaskRunner> io_task_runner,
400 DaemonProcess* daemon_process, 400 DaemonProcess* daemon_process,
401 int id, 401 int id,
402 WtsTerminalMonitor* monitor) 402 WtsTerminalMonitor* monitor)
403 : DesktopSession(daemon_process, id), 403 : DesktopSession(daemon_process, id),
404 caller_task_runner_(caller_task_runner), 404 caller_task_runner_(caller_task_runner),
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 target.Pass(), 545 target.Pass(),
546 launch_elevated, 546 launch_elevated,
547 base::WideToUTF8( 547 base::WideToUTF8(
548 kDaemonIpcSecurityDescriptor))); 548 kDaemonIpcSecurityDescriptor)));
549 if (!delegate->Initialize(session_id)) { 549 if (!delegate->Initialize(session_id)) {
550 TerminateSession(); 550 TerminateSession();
551 return; 551 return;
552 } 552 }
553 553
554 // Create a launcher for the desktop process, using the per-session delegate. 554 // Create a launcher for the desktop process, using the per-session delegate.
555 launcher_.reset(new WorkerProcessLauncher( 555 launcher_.reset(new WorkerProcessLauncher(delegate.Pass(), this));
556 delegate.PassAs<WorkerProcessLauncher::Delegate>(), this));
557 } 556 }
558 557
559 void DesktopSessionWin::OnSessionDetached() { 558 void DesktopSessionWin::OnSessionDetached() {
560 DCHECK(caller_task_runner_->BelongsToCurrentThread()); 559 DCHECK(caller_task_runner_->BelongsToCurrentThread());
561 560
562 launcher_.reset(); 561 launcher_.reset();
563 562
564 if (monitoring_notifications_) { 563 if (monitoring_notifications_) {
565 ReportElapsedTime("detached"); 564 ReportElapsedTime("detached");
566 565
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 exploded.hour, 602 exploded.hour,
604 exploded.minute, 603 exploded.minute,
605 exploded.second, 604 exploded.second,
606 exploded.millisecond, 605 exploded.millisecond,
607 passed.c_str()); 606 passed.c_str());
608 607
609 last_timestamp_ = now; 608 last_timestamp_ = now;
610 } 609 }
611 610
612 } // namespace remoting 611 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698