| OLD | NEW |
| 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 #ifndef REMOTING_HOST_DESKTOP_SESSION_WIN_H_ | 5 #ifndef REMOTING_HOST_DESKTOP_SESSION_WIN_H_ |
| 6 #define REMOTING_HOST_DESKTOP_SESSION_WIN_H_ | 6 #define REMOTING_HOST_DESKTOP_SESSION_WIN_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/timer.h" | 10 #include "base/timer.h" |
| 11 #include "base/win/scoped_handle.h" | 11 #include "base/win/scoped_handle.h" |
| 12 #include "ipc/ipc_platform_file.h" | 12 #include "ipc/ipc_platform_file.h" |
| 13 #include "remoting/host/desktop_session.h" | 13 #include "remoting/host/desktop_session.h" |
| 14 #include "remoting/host/win/wts_terminal_observer.h" | 14 #include "remoting/host/win/wts_terminal_observer.h" |
| 15 #include "remoting/host/worker_process_ipc_delegate.h" | 15 #include "remoting/host/worker_process_ipc_delegate.h" |
| 16 | 16 |
| 17 namespace net { | 17 namespace net { |
| 18 class IPEndPoint; | 18 class IPEndPoint; |
| 19 } // namespace net | 19 } // namespace net |
| 20 | 20 |
| 21 namespace tracked_objects { | 21 namespace tracked_objects { |
| 22 class Location; | 22 class Location; |
| 23 } // namespace tracked_objects | 23 } // namespace tracked_objects |
| 24 | 24 |
| 25 namespace remoting { | 25 namespace remoting { |
| 26 | 26 |
| 27 class AutoThreadTaskRunner; | 27 class AutoThreadTaskRunner; |
| 28 class DaemonProcess; | 28 class DaemonProcess; |
| 29 class DesktopSession; | 29 class DesktopSession; |
| 30 struct DesktopSessionParams; | 30 class ScreenResolution; |
| 31 class WorkerProcessLauncher; | 31 class WorkerProcessLauncher; |
| 32 class WtsTerminalMonitor; | 32 class WtsTerminalMonitor; |
| 33 | 33 |
| 34 // DesktopSession implementation which attaches to either physical or virtual | 34 // DesktopSession implementation which attaches to either physical or virtual |
| 35 // (RDP) console. Receives IPC messages from the desktop process, running in | 35 // (RDP) console. Receives IPC messages from the desktop process, running in |
| 36 // the target session, via |WorkerProcessIpcDelegate|, and monitors session | 36 // the target session, via |WorkerProcessIpcDelegate|, and monitors session |
| 37 // attach/detach events via |WtsTerminalObserer|. | 37 // attach/detach events via |WtsTerminalObserer|. |
| 38 class DesktopSessionWin | 38 class DesktopSessionWin |
| 39 : public DesktopSession, | 39 : public DesktopSession, |
| 40 public WorkerProcessIpcDelegate, | 40 public WorkerProcessIpcDelegate, |
| 41 public WtsTerminalObserver { | 41 public WtsTerminalObserver { |
| 42 public: | 42 public: |
| 43 // Creates a desktop session instance that attaches to the physical console. | 43 // Creates a desktop session instance that attaches to the physical console. |
| 44 static scoped_ptr<DesktopSession> CreateForConsole( | 44 static scoped_ptr<DesktopSession> CreateForConsole( |
| 45 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, | 45 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, |
| 46 scoped_refptr<AutoThreadTaskRunner> io_task_runner, | 46 scoped_refptr<AutoThreadTaskRunner> io_task_runner, |
| 47 DaemonProcess* daemon_process, | 47 DaemonProcess* daemon_process, |
| 48 int id, | 48 int id, |
| 49 const DesktopSessionParams& params); | 49 const ScreenResolution& resolution); |
| 50 | 50 |
| 51 // Creates a desktop session instance that attaches to a virtual console. | 51 // Creates a desktop session instance that attaches to a virtual console. |
| 52 static scoped_ptr<DesktopSession> CreateForVirtualTerminal( | 52 static scoped_ptr<DesktopSession> CreateForVirtualTerminal( |
| 53 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, | 53 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, |
| 54 scoped_refptr<AutoThreadTaskRunner> io_task_runner, | 54 scoped_refptr<AutoThreadTaskRunner> io_task_runner, |
| 55 DaemonProcess* daemon_process, | 55 DaemonProcess* daemon_process, |
| 56 int id, | 56 int id, |
| 57 const DesktopSessionParams& params); | 57 const ScreenResolution& resolution); |
| 58 | 58 |
| 59 protected: | 59 protected: |
| 60 // Passes the owning |daemon_process|, a unique identifier of the desktop | 60 // Passes the owning |daemon_process|, a unique identifier of the desktop |
| 61 // session |id| and the interface for monitoring session attach/detach events. | 61 // session |id| and the interface for monitoring session attach/detach events. |
| 62 // Both |daemon_process| and |monitor| must outlive |this|. | 62 // Both |daemon_process| and |monitor| must outlive |this|. |
| 63 DesktopSessionWin( | 63 DesktopSessionWin( |
| 64 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, | 64 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, |
| 65 scoped_refptr<AutoThreadTaskRunner> io_task_runner, | 65 scoped_refptr<AutoThreadTaskRunner> io_task_runner, |
| 66 DaemonProcess* daemon_process, | 66 DaemonProcess* daemon_process, |
| 67 int id, | 67 int id, |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 // Used to report an error if the session attach notification does not arrives | 121 // Used to report an error if the session attach notification does not arrives |
| 122 // for too long. | 122 // for too long. |
| 123 base::OneShotTimer<DesktopSessionWin> session_attach_timer_; | 123 base::OneShotTimer<DesktopSessionWin> session_attach_timer_; |
| 124 | 124 |
| 125 DISALLOW_COPY_AND_ASSIGN(DesktopSessionWin); | 125 DISALLOW_COPY_AND_ASSIGN(DesktopSessionWin); |
| 126 }; | 126 }; |
| 127 | 127 |
| 128 } // namespace remoting | 128 } // namespace remoting |
| 129 | 129 |
| 130 #endif // REMOTING_HOST_DESKTOP_SESSION_WIN_H_ | 130 #endif // REMOTING_HOST_DESKTOP_SESSION_WIN_H_ |
| OLD | NEW |