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/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 protected: | 56 protected: |
57 // Passes the owning |daemon_process|, a unique identifier of the desktop | 57 // Passes the owning |daemon_process|, a unique identifier of the desktop |
58 // session |id| and the interface for monitoring session attach/detach events. | 58 // session |id| and the interface for monitoring session attach/detach events. |
59 // Both |daemon_process| and |monitor| must outlive |this|. | 59 // Both |daemon_process| and |monitor| must outlive |this|. |
60 DesktopSessionWin( | 60 DesktopSessionWin( |
61 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, | 61 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, |
62 scoped_refptr<AutoThreadTaskRunner> io_task_runner, | 62 scoped_refptr<AutoThreadTaskRunner> io_task_runner, |
63 DaemonProcess* daemon_process, | 63 DaemonProcess* daemon_process, |
64 int id, | 64 int id, |
65 WtsTerminalMonitor* monitor); | 65 WtsTerminalMonitor* monitor); |
66 virtual ~DesktopSessionWin(); | 66 ~DesktopSessionWin() override; |
67 | 67 |
68 const scoped_refptr<AutoThreadTaskRunner>& caller_task_runner() const { | 68 const scoped_refptr<AutoThreadTaskRunner>& caller_task_runner() const { |
69 return caller_task_runner_; | 69 return caller_task_runner_; |
70 } | 70 } |
71 | 71 |
72 // Called when |session_attach_timer_| expires. | 72 // Called when |session_attach_timer_| expires. |
73 void OnSessionAttachTimeout(); | 73 void OnSessionAttachTimeout(); |
74 | 74 |
75 // Starts monitoring for session attach/detach events for |terminal_id|. | 75 // Starts monitoring for session attach/detach events for |terminal_id|. |
76 void StartMonitoring(const std::string& terminal_id); | 76 void StartMonitoring(const std::string& terminal_id); |
77 | 77 |
78 // Stops monitoring for session attach/detach events. | 78 // Stops monitoring for session attach/detach events. |
79 void StopMonitoring(); | 79 void StopMonitoring(); |
80 | 80 |
81 // Asks DaemonProcess to terminate this session. | 81 // Asks DaemonProcess to terminate this session. |
82 void TerminateSession(); | 82 void TerminateSession(); |
83 | 83 |
84 // Injects a secure attention sequence into the session. | 84 // Injects a secure attention sequence into the session. |
85 virtual void InjectSas() = 0; | 85 virtual void InjectSas() = 0; |
86 | 86 |
87 // WorkerProcessIpcDelegate implementation. | 87 // WorkerProcessIpcDelegate implementation. |
88 virtual void OnChannelConnected(int32 peer_pid) override; | 88 void OnChannelConnected(int32 peer_pid) override; |
89 virtual bool OnMessageReceived(const IPC::Message& message) override; | 89 bool OnMessageReceived(const IPC::Message& message) override; |
90 virtual void OnPermanentError(int exit_code) override; | 90 void OnPermanentError(int exit_code) override; |
91 | 91 |
92 // WtsTerminalObserver implementation. | 92 // WtsTerminalObserver implementation. |
93 virtual void OnSessionAttached(uint32 session_id) override; | 93 void OnSessionAttached(uint32 session_id) override; |
94 virtual void OnSessionDetached() override; | 94 void OnSessionDetached() override; |
95 | 95 |
96 private: | 96 private: |
97 // ChromotingDesktopDaemonMsg_DesktopAttached handler. | 97 // ChromotingDesktopDaemonMsg_DesktopAttached handler. |
98 void OnDesktopSessionAgentAttached(IPC::PlatformFileForTransit desktop_pipe); | 98 void OnDesktopSessionAgentAttached(IPC::PlatformFileForTransit desktop_pipe); |
99 | 99 |
100 // Requests the desktop process to crash. | 100 // Requests the desktop process to crash. |
101 void CrashDesktopProcess(const tracked_objects::Location& location); | 101 void CrashDesktopProcess(const tracked_objects::Location& location); |
102 | 102 |
103 // Reports time elapsed since previous event to the debug log. | 103 // Reports time elapsed since previous event to the debug log. |
104 void ReportElapsedTime(const std::string& event); | 104 void ReportElapsedTime(const std::string& event); |
(...skipping 21 matching lines...) Expand all Loading... |
126 base::OneShotTimer<DesktopSessionWin> session_attach_timer_; | 126 base::OneShotTimer<DesktopSessionWin> session_attach_timer_; |
127 | 127 |
128 base::Time last_timestamp_; | 128 base::Time last_timestamp_; |
129 | 129 |
130 DISALLOW_COPY_AND_ASSIGN(DesktopSessionWin); | 130 DISALLOW_COPY_AND_ASSIGN(DesktopSessionWin); |
131 }; | 131 }; |
132 | 132 |
133 } // namespace remoting | 133 } // namespace remoting |
134 | 134 |
135 #endif // REMOTING_HOST_DESKTOP_SESSION_WIN_H_ | 135 #endif // REMOTING_HOST_DESKTOP_SESSION_WIN_H_ |
OLD | NEW |