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/worker_process_launcher.h" | 5 #include "remoting/host/win/worker_process_launcher.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "base/timer.h" | 10 #include "base/timer.h" |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 // trusted. | 221 // trusted. |
222 DWORD actual_pid = launcher_delegate_->GetProcessId(); | 222 DWORD actual_pid = launcher_delegate_->GetProcessId(); |
223 if (peer_pid != static_cast<int32>(actual_pid)) { | 223 if (peer_pid != static_cast<int32>(actual_pid)) { |
224 LOG(ERROR) << "The actual client PID " << actual_pid | 224 LOG(ERROR) << "The actual client PID " << actual_pid |
225 << " does not match the one reported by the client: " | 225 << " does not match the one reported by the client: " |
226 << peer_pid; | 226 << peer_pid; |
227 StopWorker(); | 227 StopWorker(); |
228 return; | 228 return; |
229 } | 229 } |
230 | 230 |
| 231 // This can result in |this| being deleted, so this call must be the last in |
| 232 // this method. |
231 worker_delegate_->OnChannelConnected(peer_pid); | 233 worker_delegate_->OnChannelConnected(peer_pid); |
232 } | 234 } |
233 | 235 |
234 void WorkerProcessLauncher::Core::OnChannelError() { | 236 void WorkerProcessLauncher::Core::OnChannelError() { |
235 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 237 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
236 | 238 |
237 // Schedule a delayed termination of the worker process. Usually, the pipe is | 239 // Schedule a delayed termination of the worker process. Usually, the pipe is |
238 // disconnected when the worker process is about to exit. Waiting a little bit | 240 // disconnected when the worker process is about to exit. Waiting a little bit |
239 // here allows the worker to exit completely and so, notify | 241 // here allows the worker to exit completely and so, notify |
240 // |process_watcher_|. As the result KillProcess() will not be called and | 242 // |process_watcher_|. As the result KillProcess() will not be called and |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 WorkerProcessLauncher::~WorkerProcessLauncher() { | 342 WorkerProcessLauncher::~WorkerProcessLauncher() { |
341 core_->Stop(); | 343 core_->Stop(); |
342 core_ = NULL; | 344 core_ = NULL; |
343 } | 345 } |
344 | 346 |
345 void WorkerProcessLauncher::Send(IPC::Message* message) { | 347 void WorkerProcessLauncher::Send(IPC::Message* message) { |
346 core_->Send(message); | 348 core_->Send(message); |
347 } | 349 } |
348 | 350 |
349 } // namespace remoting | 351 } // namespace remoting |
OLD | NEW |