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" |
11 #include "components/arc/test/fake_arc_bridge_instance.h" | 11 #include "components/arc/test/fake_arc_bridge_instance.h" |
12 #include "mojo/public/cpp/bindings/interface_request.h" | 12 #include "mojo/public/cpp/bindings/interface_request.h" |
13 | 13 |
14 namespace arc { | 14 namespace arc { |
15 | 15 |
16 FakeArcBridgeBootstrap::FakeArcBridgeBootstrap(FakeArcBridgeInstance* instance) | 16 FakeArcBridgeBootstrap::FakeArcBridgeBootstrap(FakeArcBridgeInstance* instance) |
17 : instance_(instance) { | 17 : instance_(instance) { |
18 } | 18 } |
19 | 19 |
20 void FakeArcBridgeBootstrap::Start() { | 20 void FakeArcBridgeBootstrap::Start() { |
21 DCHECK(delegate_); | 21 DCHECK(delegate_); |
22 ArcBridgeInstancePtr instance; | 22 mojom::ArcBridgeInstancePtr instance; |
23 instance_->Bind(mojo::GetProxy(&instance)); | 23 instance_->Bind(mojo::GetProxy(&instance)); |
24 delegate_->OnConnectionEstablished(std::move(instance)); | 24 delegate_->OnConnectionEstablished(std::move(instance)); |
25 } | 25 } |
26 | 26 |
27 void FakeArcBridgeBootstrap::Stop() { | 27 void FakeArcBridgeBootstrap::Stop() { |
28 DCHECK(delegate_); | 28 DCHECK(delegate_); |
29 instance_->Unbind(); | 29 instance_->Unbind(); |
30 delegate_->OnStopped(); | 30 delegate_->OnStopped(); |
31 } | 31 } |
32 | 32 |
33 } // namespace arc | 33 } // namespace arc |
OLD | NEW |