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 #ifndef COMPONENTS_ARC_ARC_BRIDGE_HOST_IMPL_H_ | 5 #ifndef COMPONENTS_ARC_ARC_BRIDGE_HOST_IMPL_H_ |
6 #define COMPONENTS_ARC_ARC_BRIDGE_HOST_IMPL_H_ | 6 #define COMPONENTS_ARC_ARC_BRIDGE_HOST_IMPL_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 void OnObbMounterInstanceReady( | 58 void OnObbMounterInstanceReady( |
59 mojom::ObbMounterInstancePtr obb_mounter_ptr) override; | 59 mojom::ObbMounterInstancePtr obb_mounter_ptr) override; |
60 void OnPolicyInstanceReady(mojom::PolicyInstancePtr policy_ptr) override; | 60 void OnPolicyInstanceReady(mojom::PolicyInstancePtr policy_ptr) override; |
61 void OnPowerInstanceReady(mojom::PowerInstancePtr power_ptr) override; | 61 void OnPowerInstanceReady(mojom::PowerInstancePtr power_ptr) override; |
62 void OnPrintInstanceReady(mojom::PrintInstancePtr print_ptr) override; | 62 void OnPrintInstanceReady(mojom::PrintInstancePtr print_ptr) override; |
63 void OnProcessInstanceReady(mojom::ProcessInstancePtr process_ptr) override; | 63 void OnProcessInstanceReady(mojom::ProcessInstancePtr process_ptr) override; |
64 void OnStorageManagerInstanceReady( | 64 void OnStorageManagerInstanceReady( |
65 mojom::StorageManagerInstancePtr storage_manager_ptr) override; | 65 mojom::StorageManagerInstancePtr storage_manager_ptr) override; |
66 void OnTtsInstanceReady(mojom::TtsInstancePtr tts_ptr) override; | 66 void OnTtsInstanceReady(mojom::TtsInstancePtr tts_ptr) override; |
67 void OnVideoInstanceReady(mojom::VideoInstancePtr video_ptr) override; | 67 void OnVideoInstanceReady(mojom::VideoInstancePtr video_ptr) override; |
68 void OnWallpaperInstanceReady( | |
69 mojom::WallpaperInstancePtr wallpaper_ptr) override; | |
70 | 68 |
71 private: | 69 private: |
72 // Called when the bridge channel is closed. This typically only happens when | 70 // Called when the bridge channel is closed. This typically only happens when |
73 // the ARC instance crashes. | 71 // the ARC instance crashes. |
74 void OnClosed(); | 72 void OnClosed(); |
75 | 73 |
76 // The common implementation to handle ArcBridgeHost overrides. | 74 // The common implementation to handle ArcBridgeHost overrides. |
77 // |T| is a ARC Mojo Instance type. | 75 // |T| is a ARC Mojo Instance type. |
78 template <typename T> | 76 template <typename T> |
79 void OnInstanceReady(InstanceHolder<T>* holder, mojo::InterfacePtr<T> ptr); | 77 void OnInstanceReady(InstanceHolder<T>* holder, mojo::InterfacePtr<T> ptr); |
80 | 78 |
81 // Called if one of the established channels is closed. | 79 // Called if one of the established channels is closed. |
82 void OnChannelClosed(MojoChannel* channel); | 80 void OnChannelClosed(MojoChannel* channel); |
83 | 81 |
84 base::ThreadChecker thread_checker_; | 82 base::ThreadChecker thread_checker_; |
85 | 83 |
86 mojo::Binding<mojom::ArcBridgeHost> binding_; | 84 mojo::Binding<mojom::ArcBridgeHost> binding_; |
87 mojom::ArcBridgeInstancePtr instance_; | 85 mojom::ArcBridgeInstancePtr instance_; |
88 | 86 |
89 // Put as a last member to ensure that any callback tied to the elements | 87 // Put as a last member to ensure that any callback tied to the elements |
90 // is not invoked. | 88 // is not invoked. |
91 std::vector<std::unique_ptr<MojoChannel>> mojo_channels_; | 89 std::vector<std::unique_ptr<MojoChannel>> mojo_channels_; |
92 | 90 |
93 DISALLOW_COPY_AND_ASSIGN(ArcBridgeHostImpl); | 91 DISALLOW_COPY_AND_ASSIGN(ArcBridgeHostImpl); |
94 }; | 92 }; |
95 | 93 |
96 } // namespace arc | 94 } // namespace arc |
97 | 95 |
98 #endif // COMPONENTS_ARC_ARC_BRIDGE_HOST_IMPL_H_ | 96 #endif // COMPONENTS_ARC_ARC_BRIDGE_HOST_IMPL_H_ |
OLD | NEW |