Chromium Code Reviews| Index: components/arc/arc_session_runner.cc |
| diff --git a/components/arc/arc_session_runner.cc b/components/arc/arc_session_runner.cc |
| index 571a2c5d2996abb49c69484f41a864092c634131..6cefdcaa79cbc9a717e1cca7f0e2c880694c5518 100644 |
| --- a/components/arc/arc_session_runner.cc |
| +++ b/components/arc/arc_session_runner.cc |
| @@ -156,11 +156,15 @@ void ArcSessionRunner::OnSessionReady() { |
| observer.OnSessionReady(); |
| } |
| -void ArcSessionRunner::OnSessionStopped(StopReason stop_reason) { |
| +void ArcSessionRunner::OnSessionStopped(StopReason stop_reason, |
| + bool restarting) { |
| DCHECK(thread_checker_.CalledOnValidThread()); |
| DCHECK_NE(state_, State::STOPPED); |
| DCHECK(arc_session_); |
| DCHECK(!restart_timer_.IsRunning()); |
| + // Because ArcSession won't restart automatically by itself, |restarting| |
|
Yusuke Sato
2017/02/28 21:07:17
Then you can remove L165-167 :)
hidehiko
2017/03/01 09:10:05
Done.
|
| + // should be always false. |
| + DCHECK(!restarting); |
| VLOG(0) << "ARC stopped: " << stop_reason; |
| arc_session_->RemoveObserver(this); |
| @@ -188,13 +192,12 @@ void ArcSessionRunner::OnSessionStopped(StopReason stop_reason) { |
| restart_timer_.Start(FROM_HERE, restart_delay_, |
| base::Bind(&ArcSessionRunner::StartArcSession, |
| weak_ptr_factory_.GetWeakPtr())); |
| + restarting = true; // Overwrite the passing argument to true. |
|
hidehiko
2017/02/28 16:33:48
Note: another approach will be; not calling OnSess
|
| } |
| - // TODO(hidehiko): Consider to let observers know whether there is scheduled |
| - // restarting event, or not. |
| state_ = State::STOPPED; |
| for (auto& observer : observer_list_) |
| - observer.OnSessionStopped(stop_reason); |
| + observer.OnSessionStopped(stop_reason, restarting); |
| } |
| } // namespace arc |