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/logging.h" | 10 #include "base/logging.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/process.h" | 13 #include "base/process.h" |
14 #include "base/single_thread_task_runner.h" | 14 #include "base/single_thread_task_runner.h" |
15 #include "base/time.h" | 15 #include "base/time.h" |
16 #include "base/timer.h" | 16 #include "base/timer.h" |
17 #include "base/utf_string_conversions.h" | 17 #include "base/utf_string_conversions.h" |
18 #include "base/win/scoped_handle.h" | 18 #include "base/win/scoped_handle.h" |
19 #include "ipc/ipc_message.h" | 19 #include "ipc/ipc_message.h" |
20 #include "ipc/ipc_message_macros.h" | 20 #include "ipc/ipc_message_macros.h" |
21 #include "remoting/base/auto_thread_task_runner.h" | 21 #include "remoting/base/auto_thread_task_runner.h" |
22 #include "remoting/host/chromoting_messages.h" | 22 #include "remoting/host/chromoting_messages.h" |
23 #include "remoting/host/desktop_session_win.h" | 23 #include "remoting/host/desktop_session_win.h" |
24 #include "remoting/host/host_exit_codes.h" | 24 #include "remoting/host/host_exit_codes.h" |
25 #include "remoting/host/host_main.h" | 25 #include "remoting/host/host_main.h" |
26 #include "remoting/host/ipc_constants.h" | 26 #include "remoting/host/ipc_constants.h" |
27 #include "remoting/host/win/host_service.h" | |
28 #include "remoting/host/win/launch_process_with_token.h" | 27 #include "remoting/host/win/launch_process_with_token.h" |
29 #include "remoting/host/win/unprivileged_process_delegate.h" | 28 #include "remoting/host/win/unprivileged_process_delegate.h" |
30 #include "remoting/host/win/worker_process_launcher.h" | 29 #include "remoting/host/win/worker_process_launcher.h" |
31 | 30 |
32 using base::win::ScopedHandle; | 31 using base::win::ScopedHandle; |
33 using base::TimeDelta; | 32 using base::TimeDelta; |
34 | 33 |
35 namespace remoting { | 34 namespace remoting { |
36 | 35 |
37 class WtsTerminalMonitor; | 36 class WtsTerminalMonitor; |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 network_launcher_.reset(); | 140 network_launcher_.reset(); |
142 DaemonProcess::DoStop(); | 141 DaemonProcess::DoStop(); |
143 } | 142 } |
144 | 143 |
145 scoped_ptr<DesktopSession> DaemonProcessWin::DoCreateDesktopSession( | 144 scoped_ptr<DesktopSession> DaemonProcessWin::DoCreateDesktopSession( |
146 int terminal_id, | 145 int terminal_id, |
147 const DesktopSessionParams& params, | 146 const DesktopSessionParams& params, |
148 bool virtual_terminal) { | 147 bool virtual_terminal) { |
149 DCHECK(caller_task_runner()->BelongsToCurrentThread()); | 148 DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
150 | 149 |
151 return scoped_ptr<DesktopSession>(new DesktopSessionWin( | 150 return CreateDesktopSessionWin(caller_task_runner(), io_task_runner(), this, |
152 caller_task_runner(), io_task_runner(), this, terminal_id, | 151 terminal_id, params, virtual_terminal); |
153 params, virtual_terminal, HostService::GetInstance())); | |
154 } | 152 } |
155 | 153 |
156 void DaemonProcessWin::LaunchNetworkProcess() { | 154 void DaemonProcessWin::LaunchNetworkProcess() { |
157 DCHECK(caller_task_runner()->BelongsToCurrentThread()); | 155 DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
158 DCHECK(!network_launcher_); | 156 DCHECK(!network_launcher_); |
159 | 157 |
160 // Construct the host binary name. | 158 // Construct the host binary name. |
161 base::FilePath host_binary; | 159 base::FilePath host_binary; |
162 if (!GetInstalledBinaryPath(kHostBinaryName, &host_binary)) { | 160 if (!GetInstalledBinaryPath(kHostBinaryName, &host_binary)) { |
163 Stop(); | 161 Stop(); |
(...skipping 18 matching lines...) Expand all Loading... |
182 scoped_refptr<AutoThreadTaskRunner> io_task_runner, | 180 scoped_refptr<AutoThreadTaskRunner> io_task_runner, |
183 const base::Closure& stopped_callback) { | 181 const base::Closure& stopped_callback) { |
184 scoped_ptr<DaemonProcessWin> daemon_process( | 182 scoped_ptr<DaemonProcessWin> daemon_process( |
185 new DaemonProcessWin(caller_task_runner, io_task_runner, | 183 new DaemonProcessWin(caller_task_runner, io_task_runner, |
186 stopped_callback)); | 184 stopped_callback)); |
187 daemon_process->Initialize(); | 185 daemon_process->Initialize(); |
188 return daemon_process.PassAs<DaemonProcess>(); | 186 return daemon_process.PassAs<DaemonProcess>(); |
189 } | 187 } |
190 | 188 |
191 } // namespace remoting | 189 } // namespace remoting |
OLD | NEW |