| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_instance.h" | 5 #include "components/arc/test/fake_arc_bridge_instance.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 namespace arc { | 9 namespace arc { |
| 10 | 10 |
| 11 FakeArcBridgeInstance::FakeArcBridgeInstance() : binding_(this) {} | 11 FakeArcBridgeInstance::FakeArcBridgeInstance() : binding_(this) {} |
| 12 FakeArcBridgeInstance::~FakeArcBridgeInstance() {} | 12 FakeArcBridgeInstance::~FakeArcBridgeInstance() {} |
| 13 | 13 |
| 14 void FakeArcBridgeInstance::Init(ArcBridgeHostPtr host) { | 14 void FakeArcBridgeInstance::Init(ArcBridgeHostPtr host) { |
| 15 host_ptr_ = std::move(host); | 15 host_ptr_ = std::move(host); |
| 16 init_calls_++; |
| 17 } |
| 18 |
| 19 void FakeArcBridgeInstance::Unbind() { |
| 20 host_ptr_.reset(); |
| 21 if (binding_.is_bound()) |
| 22 binding_.Close(); |
| 16 } | 23 } |
| 17 | 24 |
| 18 void FakeArcBridgeInstance::Bind( | 25 void FakeArcBridgeInstance::Bind( |
| 19 mojo::InterfaceRequest<ArcBridgeInstance> interface_request) { | 26 mojo::InterfaceRequest<ArcBridgeInstance> interface_request) { |
| 20 binding_.Bind(std::move(interface_request)); | 27 binding_.Bind(std::move(interface_request)); |
| 21 } | 28 } |
| 22 | 29 |
| 30 void FakeArcBridgeInstance::WaitForInitCall() { |
| 31 binding_.WaitForIncomingMethodCall(); |
| 32 } |
| 33 |
| 23 } // namespace arc | 34 } // namespace arc |
| OLD | NEW |