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 #include "remoting/host/daemon_process.h" | 5 #include "remoting/host/daemon_process.h" |
6 | 6 |
7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/process.h" | 14 #include "base/process.h" |
15 #include "base/single_thread_task_runner.h" | 15 #include "base/single_thread_task_runner.h" |
16 #include "base/time.h" | 16 #include "base/time.h" |
17 #include "base/timer.h" | 17 #include "base/timer.h" |
18 #include "base/utf_string_conversions.h" | 18 #include "base/utf_string_conversions.h" |
19 #include "base/win/scoped_handle.h" | 19 #include "base/win/scoped_handle.h" |
20 #include "ipc/ipc_message.h" | 20 #include "ipc/ipc_message.h" |
21 #include "ipc/ipc_message_macros.h" | 21 #include "ipc/ipc_message_macros.h" |
22 #include "remoting/base/auto_thread_task_runner.h" | 22 #include "remoting/base/auto_thread_task_runner.h" |
23 #include "remoting/host/chromoting_messages.h" | 23 #include "remoting/host/chromoting_messages.h" |
24 #include "remoting/host/desktop_session_win.h" | 24 #include "remoting/host/desktop_session_win.h" |
25 #include "remoting/host/host_exit_codes.h" | 25 #include "remoting/host/host_exit_codes.h" |
26 #include "remoting/host/host_main.h" | 26 #include "remoting/host/host_main.h" |
27 #include "remoting/host/ipc_constants.h" | 27 #include "remoting/host/ipc_constants.h" |
28 #include "remoting/host/win/host_service.h" | |
29 #include "remoting/host/win/launch_process_with_token.h" | 28 #include "remoting/host/win/launch_process_with_token.h" |
30 #include "remoting/host/win/unprivileged_process_delegate.h" | 29 #include "remoting/host/win/unprivileged_process_delegate.h" |
31 #include "remoting/host/win/worker_process_launcher.h" | 30 #include "remoting/host/win/worker_process_launcher.h" |
32 | 31 |
33 using base::win::ScopedHandle; | 32 using base::win::ScopedHandle; |
34 using base::TimeDelta; | 33 using base::TimeDelta; |
35 | 34 |
36 namespace remoting { | 35 namespace remoting { |
37 | 36 |
38 class WtsTerminalMonitor; | 37 class WtsTerminalMonitor; |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 network_launcher_.reset(); | 143 network_launcher_.reset(); |
145 DaemonProcess::DoStop(); | 144 DaemonProcess::DoStop(); |
146 } | 145 } |
147 | 146 |
148 scoped_ptr<DesktopSession> DaemonProcessWin::DoCreateDesktopSession( | 147 scoped_ptr<DesktopSession> DaemonProcessWin::DoCreateDesktopSession( |
149 int terminal_id, | 148 int terminal_id, |
150 const DesktopSessionParams& params, | 149 const DesktopSessionParams& params, |
151 bool virtual_terminal) { | 150 bool virtual_terminal) { |
152 DCHECK(caller_task_runner()->BelongsToCurrentThread()); | 151 DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
153 | 152 |
154 return scoped_ptr<DesktopSession>(new DesktopSessionWin( | 153 if (virtual_terminal) { |
155 caller_task_runner(), io_task_runner(), this, terminal_id, | 154 return DesktopSessionWin::CreateForVirtualTerminal( |
156 params, virtual_terminal, HostService::GetInstance())); | 155 caller_task_runner(), io_task_runner(), this, terminal_id, params); |
| 156 } else { |
| 157 return DesktopSessionWin::CreateForConsole( |
| 158 caller_task_runner(), io_task_runner(), this, terminal_id, params); |
| 159 } |
157 } | 160 } |
158 | 161 |
159 void DaemonProcessWin::DoCrashNetworkProcess( | 162 void DaemonProcessWin::DoCrashNetworkProcess( |
160 const tracked_objects::Location& location) { | 163 const tracked_objects::Location& location) { |
161 DCHECK(caller_task_runner()->BelongsToCurrentThread()); | 164 DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
162 | 165 |
163 network_launcher_->Crash(location); | 166 network_launcher_->Crash(location); |
164 } | 167 } |
165 | 168 |
166 void DaemonProcessWin::LaunchNetworkProcess() { | 169 void DaemonProcessWin::LaunchNetworkProcess() { |
(...skipping 25 matching lines...) Expand all Loading... |
192 scoped_refptr<AutoThreadTaskRunner> io_task_runner, | 195 scoped_refptr<AutoThreadTaskRunner> io_task_runner, |
193 const base::Closure& stopped_callback) { | 196 const base::Closure& stopped_callback) { |
194 scoped_ptr<DaemonProcessWin> daemon_process( | 197 scoped_ptr<DaemonProcessWin> daemon_process( |
195 new DaemonProcessWin(caller_task_runner, io_task_runner, | 198 new DaemonProcessWin(caller_task_runner, io_task_runner, |
196 stopped_callback)); | 199 stopped_callback)); |
197 daemon_process->Initialize(); | 200 daemon_process->Initialize(); |
198 return daemon_process.PassAs<DaemonProcess>(); | 201 return daemon_process.PassAs<DaemonProcess>(); |
199 } | 202 } |
200 | 203 |
201 } // namespace remoting | 204 } // namespace remoting |
OLD | NEW |