OLD | NEW |
1 | 1 |
2 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
5 // | 5 // |
6 // This file implements the Windows service controlling Me2Me host processes | 6 // This file implements the Windows service controlling Me2Me host processes |
7 // running within user sessions. | 7 // running within user sessions. |
8 | 8 |
9 #include "remoting/host/win/unprivileged_process_delegate.h" | 9 #include "remoting/host/win/unprivileged_process_delegate.h" |
10 | 10 |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 UnprivilegedProcessDelegate::~UnprivilegedProcessDelegate() { | 225 UnprivilegedProcessDelegate::~UnprivilegedProcessDelegate() { |
226 KillProcess(CONTROL_C_EXIT); | 226 KillProcess(CONTROL_C_EXIT); |
227 } | 227 } |
228 | 228 |
229 bool UnprivilegedProcessDelegate::Send(IPC::Message* message) { | 229 bool UnprivilegedProcessDelegate::Send(IPC::Message* message) { |
230 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 230 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
231 | 231 |
232 return channel_->Send(message); | 232 return channel_->Send(message); |
233 } | 233 } |
234 | 234 |
| 235 void UnprivilegedProcessDelegate::CloseChannel() { |
| 236 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
| 237 |
| 238 channel_.reset(); |
| 239 } |
| 240 |
235 DWORD UnprivilegedProcessDelegate::GetProcessId() const { | 241 DWORD UnprivilegedProcessDelegate::GetProcessId() const { |
236 if (worker_process_.IsValid()) { | 242 if (worker_process_.IsValid()) { |
237 return ::GetProcessId(worker_process_); | 243 return ::GetProcessId(worker_process_); |
238 } else { | 244 } else { |
239 return 0; | 245 return 0; |
240 } | 246 } |
241 } | 247 } |
242 | 248 |
243 bool UnprivilegedProcessDelegate::IsPermanentError(int failure_count) const { | 249 bool UnprivilegedProcessDelegate::IsPermanentError(int failure_count) const { |
244 // Get exit code of the worker process if it is available. | 250 // Get exit code of the worker process if it is available. |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 KillProcess(CONTROL_C_EXIT); | 378 KillProcess(CONTROL_C_EXIT); |
373 return false; | 379 return false; |
374 } | 380 } |
375 | 381 |
376 channel_ = server.Pass(); | 382 channel_ = server.Pass(); |
377 *process_exit_event_out = process_exit_event.Pass(); | 383 *process_exit_event_out = process_exit_event.Pass(); |
378 return true; | 384 return true; |
379 } | 385 } |
380 | 386 |
381 } // namespace remoting | 387 } // namespace remoting |
OLD | NEW |