| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/arc/test/fake_arc_bridge_bootstrap.h" | 5 #include "components/arc/test/fake_arc_bridge_bootstrap.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "components/arc/common/arc_bridge.mojom.h" | 10 #include "components/arc/common/arc_bridge.mojom.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 void FakeArcBridgeBootstrap::Start() { | 21 void FakeArcBridgeBootstrap::Start() { |
| 22 DCHECK(delegate_); | 22 DCHECK(delegate_); |
| 23 mojom::ArcBridgeInstancePtr instance; | 23 mojom::ArcBridgeInstancePtr instance; |
| 24 instance_->Bind(mojo::GetProxy(&instance)); | 24 instance_->Bind(mojo::GetProxy(&instance)); |
| 25 delegate_->OnConnectionEstablished(std::move(instance)); | 25 delegate_->OnConnectionEstablished(std::move(instance)); |
| 26 } | 26 } |
| 27 | 27 |
| 28 void FakeArcBridgeBootstrap::Stop() { | 28 void FakeArcBridgeBootstrap::Stop() { |
| 29 DCHECK(delegate_); | 29 DCHECK(delegate_); |
| 30 instance_->Unbind(); | 30 instance_->Unbind(); |
| 31 delegate_->OnStopped(); | 31 delegate_->OnStopped(StopReason::SHUTDOWN); |
| 32 } | 32 } |
| 33 | 33 |
| 34 void FakeArcBridgeBootstrap::OnCrashed() { | 34 void FakeArcBridgeBootstrap::OnStopped(StopReason reason) { |
| 35 Stop(); | 35 DCHECK(delegate_); |
| 36 instance_->Unbind(); |
| 37 delegate_->OnStopped(reason); |
| 36 } | 38 } |
| 37 | 39 |
| 38 } // namespace arc | 40 } // namespace arc |
| OLD | NEW |