OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "components/arc/test/fake_arc_bridge_bootstrap.h" |
| 6 |
| 7 #include <utility> |
| 8 |
| 9 #include "base/logging.h" |
| 10 #include "components/arc/common/arc_bridge.mojom.h" |
| 11 #include "components/arc/test/fake_arc_bridge_instance.h" |
| 12 #include "mojo/public/cpp/bindings/interface_request.h" |
| 13 |
| 14 namespace arc { |
| 15 |
| 16 FakeArcBridgeBootstrap::FakeArcBridgeBootstrap(FakeArcBridgeInstance* instance) |
| 17 : instance_(instance) { |
| 18 } |
| 19 |
| 20 void FakeArcBridgeBootstrap::Start() { |
| 21 DCHECK(delegate_); |
| 22 ArcBridgeInstancePtr instance; |
| 23 instance_->Bind(mojo::GetProxy(&instance)); |
| 24 delegate_->OnConnectionEstablished(std::move(instance)); |
| 25 } |
| 26 |
| 27 void FakeArcBridgeBootstrap::Stop() { |
| 28 DCHECK(delegate_); |
| 29 instance_->Unbind(); |
| 30 delegate_->OnStopped(); |
| 31 } |
| 32 |
| 33 } // namespace arc |
OLD | NEW |