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/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/win/scoped_handle.h" |
| 12 #include "ipc/ipc_platform_file.h" |
11 #include "remoting/host/desktop_session.h" | 13 #include "remoting/host/desktop_session.h" |
12 #include "remoting/host/win/wts_console_observer.h" | 14 #include "remoting/host/win/wts_console_observer.h" |
13 #include "remoting/host/worker_process_ipc_delegate.h" | 15 #include "remoting/host/worker_process_ipc_delegate.h" |
14 | 16 |
15 namespace base { | 17 namespace base { |
16 class SingleThreadTaskRunner; | 18 class SingleThreadTaskRunner; |
17 } // namespace base | 19 } // namespace base |
18 | 20 |
| 21 namespace tracked_objects { |
| 22 class Location; |
| 23 } // namespace tracked_objects |
| 24 |
19 namespace remoting { | 25 namespace remoting { |
20 | 26 |
21 class DaemonProcess; | 27 class DaemonProcess; |
22 class WorkerProcessLauncher; | 28 class WorkerProcessLauncher; |
23 class WtsConsoleMonitor; | 29 class WtsConsoleMonitor; |
24 | 30 |
25 // DesktopSession implementation which attaches to the host's physical console. | 31 // DesktopSession implementation which attaches to the host's physical console. |
26 // Receives IPC messages from the desktop process, running in the console | 32 // Receives IPC messages from the desktop process, running in the console |
27 // session, via |WorkerProcessIpcDelegate|, and monitors console session | 33 // session, via |WorkerProcessIpcDelegate|, and monitors console session |
28 // attach/detach events via |WtsConsoleObserer|. | 34 // attach/detach events via |WtsConsoleObserer|. |
(...skipping 18 matching lines...) Expand all Loading... |
47 // WorkerProcessIpcDelegate implementation. | 53 // WorkerProcessIpcDelegate implementation. |
48 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; | 54 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; |
49 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 55 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
50 virtual void OnPermanentError() OVERRIDE; | 56 virtual void OnPermanentError() OVERRIDE; |
51 | 57 |
52 // WtsConsoleObserver implementation. | 58 // WtsConsoleObserver implementation. |
53 virtual void OnSessionAttached(uint32 session_id) OVERRIDE; | 59 virtual void OnSessionAttached(uint32 session_id) OVERRIDE; |
54 virtual void OnSessionDetached() OVERRIDE; | 60 virtual void OnSessionDetached() OVERRIDE; |
55 | 61 |
56 private: | 62 private: |
| 63 // ChromotingDesktopDaemonMsg_DesktopAttached handler. |
| 64 void OnDesktopSessionAgentAttached(IPC::PlatformFileForTransit desktop_pipe); |
| 65 |
| 66 // Restarts the desktop process. |
| 67 void RestartDesktopProcess(const tracked_objects::Location& location); |
| 68 |
57 // Task runner on which public methods of this class should be called. | 69 // Task runner on which public methods of this class should be called. |
58 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; | 70 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
59 | 71 |
60 // Message loop used by the IPC channel. | 72 // Message loop used by the IPC channel. |
61 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; | 73 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
62 | 74 |
63 // Contains the full path to the desktop binary. | 75 // Contains the full path to the desktop binary. |
64 FilePath desktop_binary_; | 76 FilePath desktop_binary_; |
65 | 77 |
| 78 // Handle of the desktop process. |
| 79 base::win::ScopedHandle desktop_process_; |
| 80 |
66 // Launches and monitors the desktop process. | 81 // Launches and monitors the desktop process. |
67 scoped_ptr<WorkerProcessLauncher> launcher_; | 82 scoped_ptr<WorkerProcessLauncher> launcher_; |
68 | 83 |
69 // Pointer used to unsubscribe from session attach and detach events. | 84 // Pointer used to unsubscribe from session attach and detach events. |
70 WtsConsoleMonitor* monitor_; | 85 WtsConsoleMonitor* monitor_; |
71 | 86 |
72 DISALLOW_COPY_AND_ASSIGN(DesktopSessionWin); | 87 DISALLOW_COPY_AND_ASSIGN(DesktopSessionWin); |
73 }; | 88 }; |
74 | 89 |
75 } // namespace remoting | 90 } // namespace remoting |
76 | 91 |
77 #endif // REMOTING_HOST_DESKTOP_SESSION_WIN_H_ | 92 #endif // REMOTING_HOST_DESKTOP_SESSION_WIN_H_ |
OLD | NEW |