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/win/wts_console_session_process_driver.h" | 5 #include "remoting/host/win/wts_console_session_process_driver.h" |
6 | 6 |
7 #include <sddl.h> | |
8 #include <limits> | |
9 | |
10 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
11 #include "base/bind.h" | |
12 #include "base/bind_helpers.h" | |
13 #include "base/file_path.h" | 8 #include "base/file_path.h" |
14 #include "base/logging.h" | 9 #include "base/logging.h" |
15 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
16 #include "base/path_service.h" | 11 #include "base/path_service.h" |
17 #include "ipc/ipc_message.h" | 12 #include "ipc/ipc_message.h" |
18 #include "remoting/host/win/worker_process_launcher.h" | 13 #include "remoting/host/win/worker_process_launcher.h" |
19 #include "remoting/host/win/wts_console_monitor.h" | 14 #include "remoting/host/win/wts_console_monitor.h" |
20 #include "remoting/host/win/wts_session_process_delegate.h" | 15 #include "remoting/host/win/wts_session_process_delegate.h" |
21 | 16 |
22 namespace { | 17 namespace { |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 return; | 86 return; |
92 } | 87 } |
93 FilePath host_binary = dir_path.Append(kMe2meHostBinaryName); | 88 FilePath host_binary = dir_path.Append(kMe2meHostBinaryName); |
94 | 89 |
95 // Create a Delegate capable of launching an elevated process in the session. | 90 // Create a Delegate capable of launching an elevated process in the session. |
96 scoped_ptr<WtsSessionProcessDelegate> delegate( | 91 scoped_ptr<WtsSessionProcessDelegate> delegate( |
97 new WtsSessionProcessDelegate(caller_task_runner_, | 92 new WtsSessionProcessDelegate(caller_task_runner_, |
98 io_task_runner_, | 93 io_task_runner_, |
99 host_binary, | 94 host_binary, |
100 session_id, | 95 session_id, |
101 true)); | 96 true, |
| 97 kDaemonIpcSecurityDescriptor)); |
102 | 98 |
103 // Use the Delegate to launch the host process. | 99 // Use the Delegate to launch the host process. |
104 launcher_.reset(new WorkerProcessLauncher(caller_task_runner_, | 100 launcher_.reset(new WorkerProcessLauncher( |
105 io_task_runner_, | 101 caller_task_runner_, delegate.Pass(), this)); |
106 delegate.Pass(), | |
107 this, | |
108 kDaemonIpcSecurityDescriptor)); | |
109 } | 102 } |
110 | 103 |
111 void WtsConsoleSessionProcessDriver::OnSessionDetached() { | 104 void WtsConsoleSessionProcessDriver::OnSessionDetached() { |
112 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 105 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
113 DCHECK(launcher_.get() != NULL); | 106 DCHECK(launcher_.get() != NULL); |
114 | 107 |
115 launcher_.reset(); | 108 launcher_.reset(); |
116 } | 109 } |
117 | 110 |
118 void WtsConsoleSessionProcessDriver::DoStop() { | 111 void WtsConsoleSessionProcessDriver::DoStop() { |
119 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 112 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
120 | 113 |
121 launcher_.reset(); | 114 launcher_.reset(); |
122 CompleteStopping(); | 115 CompleteStopping(); |
123 } | 116 } |
124 | 117 |
125 } // namespace remoting | 118 } // namespace remoting |
OLD | NEW |