| 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/location.h" | 7 #include "base/location.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 } | 106 } |
| 107 | 107 |
| 108 void WorkerProcessLauncher::OnProcessLaunched( | 108 void WorkerProcessLauncher::OnProcessLaunched( |
| 109 base::win::ScopedHandle worker_process) { | 109 base::win::ScopedHandle worker_process) { |
| 110 DCHECK(CalledOnValidThread()); | 110 DCHECK(CalledOnValidThread()); |
| 111 DCHECK(!ipc_enabled_); | 111 DCHECK(!ipc_enabled_); |
| 112 DCHECK(!launch_timer_.IsRunning()); | 112 DCHECK(!launch_timer_.IsRunning()); |
| 113 DCHECK(!process_watcher_.GetWatchedObject()); | 113 DCHECK(!process_watcher_.GetWatchedObject()); |
| 114 DCHECK(!worker_process_.IsValid()); | 114 DCHECK(!worker_process_.IsValid()); |
| 115 | 115 |
| 116 if (!process_watcher_.StartWatching(worker_process.Get(), this)) { | 116 if (!process_watcher_.StartWatching(worker_process.Get(), this, false)) { |
| 117 StopWorker(); | 117 StopWorker(); |
| 118 return; | 118 return; |
| 119 } | 119 } |
| 120 | 120 |
| 121 ipc_enabled_ = true; | 121 ipc_enabled_ = true; |
| 122 worker_process_ = worker_process.Pass(); | 122 worker_process_ = worker_process.Pass(); |
| 123 } | 123 } |
| 124 | 124 |
| 125 void WorkerProcessLauncher::OnFatalError() { | 125 void WorkerProcessLauncher::OnFatalError() { |
| 126 DCHECK(CalledOnValidThread()); | 126 DCHECK(CalledOnValidThread()); |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 ipc_handler_->OnPermanentError(exit_code_); | 259 ipc_handler_->OnPermanentError(exit_code_); |
| 260 return; | 260 return; |
| 261 } | 261 } |
| 262 | 262 |
| 263 // Schedule the next attempt to launch the worker process. | 263 // Schedule the next attempt to launch the worker process. |
| 264 launch_timer_.Start(FROM_HERE, launch_backoff_.GetTimeUntilRelease(), this, | 264 launch_timer_.Start(FROM_HERE, launch_backoff_.GetTimeUntilRelease(), this, |
| 265 &WorkerProcessLauncher::LaunchWorker); | 265 &WorkerProcessLauncher::LaunchWorker); |
| 266 } | 266 } |
| 267 | 267 |
| 268 } // namespace remoting | 268 } // namespace remoting |
| OLD | NEW |