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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 WorkerProcessLauncher::WorkerProcessLauncher( | 54 WorkerProcessLauncher::WorkerProcessLauncher( |
55 scoped_ptr<WorkerProcessLauncher::Delegate> launcher_delegate, | 55 scoped_ptr<WorkerProcessLauncher::Delegate> launcher_delegate, |
56 WorkerProcessIpcDelegate* ipc_handler) | 56 WorkerProcessIpcDelegate* ipc_handler) |
57 : ipc_handler_(ipc_handler), | 57 : ipc_handler_(ipc_handler), |
58 launcher_delegate_(launcher_delegate.Pass()), | 58 launcher_delegate_(launcher_delegate.Pass()), |
59 exit_code_(CONTROL_C_EXIT), | 59 exit_code_(CONTROL_C_EXIT), |
60 ipc_enabled_(false), | 60 ipc_enabled_(false), |
61 kill_process_timeout_( | 61 kill_process_timeout_( |
62 base::TimeDelta::FromSeconds(kKillProcessTimeoutSeconds)), | 62 base::TimeDelta::FromSeconds(kKillProcessTimeoutSeconds)), |
63 launch_backoff_(&kDefaultBackoffPolicy) { | 63 launch_backoff_(&kDefaultBackoffPolicy) { |
64 DCHECK(ipc_handler_ != NULL); | 64 DCHECK(ipc_handler_ != nullptr); |
65 | 65 |
66 LaunchWorker(); | 66 LaunchWorker(); |
67 } | 67 } |
68 | 68 |
69 WorkerProcessLauncher::~WorkerProcessLauncher() { | 69 WorkerProcessLauncher::~WorkerProcessLauncher() { |
70 DCHECK(CalledOnValidThread()); | 70 DCHECK(CalledOnValidThread()); |
71 | 71 |
72 ipc_handler_ = NULL; | 72 ipc_handler_ = nullptr; |
73 StopWorker(); | 73 StopWorker(); |
74 } | 74 } |
75 | 75 |
76 void WorkerProcessLauncher::Crash( | 76 void WorkerProcessLauncher::Crash( |
77 const tracked_objects::Location& location) { | 77 const tracked_objects::Location& location) { |
78 DCHECK(CalledOnValidThread()); | 78 DCHECK(CalledOnValidThread()); |
79 | 79 |
80 // Ask the worker process to crash voluntarily if it is still connected. | 80 // Ask the worker process to crash voluntarily if it is still connected. |
81 if (ipc_enabled_) { | 81 if (ipc_enabled_) { |
82 Send(new ChromotingDaemonMsg_Crash(location.function_name(), | 82 Send(new ChromotingDaemonMsg_Crash(location.function_name(), |
(...skipping 176 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 |