Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(390)

Side by Side Diff: components/arc/arc_bridge_service.h

Issue 1451353002: Implement GpuArcVideoService for arc video accelerator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed avi's comments Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #ifndef COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_ 5 #ifndef COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_
6 #define COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_ 6 #define COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 virtual void OnPowerInstanceClosed() {} 90 virtual void OnPowerInstanceClosed() {}
91 91
92 // Called whenever the ARC process interface state changes. 92 // Called whenever the ARC process interface state changes.
93 virtual void OnProcessInstanceReady() {} 93 virtual void OnProcessInstanceReady() {}
94 virtual void OnProcessInstanceClosed() {} 94 virtual void OnProcessInstanceClosed() {}
95 95
96 // Called whenever the ARC settings interface state changes. 96 // Called whenever the ARC settings interface state changes.
97 virtual void OnSettingsInstanceReady() {} 97 virtual void OnSettingsInstanceReady() {}
98 virtual void OnSettingsInstanceClosed() {} 98 virtual void OnSettingsInstanceClosed() {}
99 99
100 // Called whenever the ARC video interface state changes.
101 virtual void OnVideoInstanceReady() {}
102 virtual void OnVideoInstanceClosed() {}
103
100 protected: 104 protected:
101 virtual ~Observer() {} 105 virtual ~Observer() {}
102 }; 106 };
103 107
104 ~ArcBridgeService() override; 108 ~ArcBridgeService() override;
105 109
106 // Gets the global instance of the ARC Bridge Service. This can only be 110 // Gets the global instance of the ARC Bridge Service. This can only be
107 // called on the thread that this class was created on. 111 // called on the thread that this class was created on.
108 static ArcBridgeService* Get(); 112 static ArcBridgeService* Get();
109 113
(...skipping 25 matching lines...) Expand all
135 // you want to be notified when this is ready. This can only be called on the 139 // you want to be notified when this is ready. This can only be called on the
136 // thread that this class was created on. 140 // thread that this class was created on.
137 AppInstance* app_instance() { return app_ptr_.get(); } 141 AppInstance* app_instance() { return app_ptr_.get(); }
138 InputInstance* input_instance() { return input_ptr_.get(); } 142 InputInstance* input_instance() { return input_ptr_.get(); }
139 NotificationsInstance* notifications_instance() { 143 NotificationsInstance* notifications_instance() {
140 return notifications_ptr_.get(); 144 return notifications_ptr_.get();
141 } 145 }
142 PowerInstance* power_instance() { return power_ptr_.get(); } 146 PowerInstance* power_instance() { return power_ptr_.get(); }
143 ProcessInstance* process_instance() { return process_ptr_.get(); } 147 ProcessInstance* process_instance() { return process_ptr_.get(); }
144 SettingsInstance* settings_instance() { return settings_ptr_.get(); } 148 SettingsInstance* settings_instance() { return settings_ptr_.get(); }
149 VideoInstance* video_instance() { return video_ptr_.get(); }
145 150
146 int32_t app_version() const { return app_ptr_.version(); } 151 int32_t app_version() const { return app_ptr_.version(); }
147 int32_t input_version() const { return input_ptr_.version(); } 152 int32_t input_version() const { return input_ptr_.version(); }
148 int32_t notifications_version() const { return notifications_ptr_.version(); } 153 int32_t notifications_version() const { return notifications_ptr_.version(); }
149 int32_t power_version() const { return power_ptr_.version(); } 154 int32_t power_version() const { return power_ptr_.version(); }
150 int32_t process_version() const { return process_ptr_.version(); } 155 int32_t process_version() const { return process_ptr_.version(); }
151 int32_t settings_version() const { return settings_ptr_.version(); } 156 int32_t settings_version() const { return settings_ptr_.version(); }
157 int32_t video_version() const { return video_ptr_.version(); }
152 158
153 // ArcHost: 159 // ArcHost:
154 void OnAppInstanceReady(AppInstancePtr app_ptr) override; 160 void OnAppInstanceReady(AppInstancePtr app_ptr) override;
155 void OnInputInstanceReady(InputInstancePtr input_ptr) override; 161 void OnInputInstanceReady(InputInstancePtr input_ptr) override;
156 void OnNotificationsInstanceReady( 162 void OnNotificationsInstanceReady(
157 NotificationsInstancePtr notifications_ptr) override; 163 NotificationsInstancePtr notifications_ptr) override;
158 void OnPowerInstanceReady(PowerInstancePtr power_ptr) override; 164 void OnPowerInstanceReady(PowerInstancePtr power_ptr) override;
159 void OnProcessInstanceReady(ProcessInstancePtr process_ptr) override; 165 void OnProcessInstanceReady(ProcessInstancePtr process_ptr) override;
160 void OnSettingsInstanceReady(SettingsInstancePtr process_ptr) override; 166 void OnSettingsInstanceReady(SettingsInstancePtr process_ptr) override;
167 void OnVideoInstanceReady(VideoInstancePtr video_ptr) override;
161 168
162 // Gets the current state of the bridge service. 169 // Gets the current state of the bridge service.
163 State state() const { return state_; } 170 State state() const { return state_; }
164 171
165 // Gets if ARC is available in this system. 172 // Gets if ARC is available in this system.
166 bool available() const { return available_; } 173 bool available() const { return available_; }
167 174
168 protected: 175 protected:
169 ArcBridgeService(); 176 ArcBridgeService();
170 177
(...skipping 17 matching lines...) Expand all
188 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, ShutdownMidStartup); 195 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, ShutdownMidStartup);
189 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, Restart); 196 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, Restart);
190 197
191 // Called when one of the individual channels is closed. 198 // Called when one of the individual channels is closed.
192 void CloseAppChannel(); 199 void CloseAppChannel();
193 void CloseInputChannel(); 200 void CloseInputChannel();
194 void CloseNotificationsChannel(); 201 void CloseNotificationsChannel();
195 void ClosePowerChannel(); 202 void ClosePowerChannel();
196 void CloseProcessChannel(); 203 void CloseProcessChannel();
197 void CloseSettingsChannel(); 204 void CloseSettingsChannel();
205 void CloseVideoChannel();
198 206
199 // Callbacks for QueryVersion. 207 // Callbacks for QueryVersion.
200 void OnAppVersionReady(int32_t version); 208 void OnAppVersionReady(int32_t version);
201 void OnInputVersionReady(int32_t version); 209 void OnInputVersionReady(int32_t version);
202 void OnNotificationsVersionReady(int32_t version); 210 void OnNotificationsVersionReady(int32_t version);
203 void OnPowerVersionReady(int32_t version); 211 void OnPowerVersionReady(int32_t version);
204 void OnProcessVersionReady(int32_t version); 212 void OnProcessVersionReady(int32_t version);
205 void OnSettingsVersionReady(int32_t version); 213 void OnSettingsVersionReady(int32_t version);
214 void OnVideoVersionReady(int32_t version);
206 215
207 // Mojo interfaces. 216 // Mojo interfaces.
208 AppInstancePtr app_ptr_; 217 AppInstancePtr app_ptr_;
209 InputInstancePtr input_ptr_; 218 InputInstancePtr input_ptr_;
210 NotificationsInstancePtr notifications_ptr_; 219 NotificationsInstancePtr notifications_ptr_;
211 PowerInstancePtr power_ptr_; 220 PowerInstancePtr power_ptr_;
212 ProcessInstancePtr process_ptr_; 221 ProcessInstancePtr process_ptr_;
213 SettingsInstancePtr settings_ptr_; 222 SettingsInstancePtr settings_ptr_;
223 VideoInstancePtr video_ptr_;
214 224
215 // Temporary Mojo interfaces. After a Mojo interface pointer has been 225 // Temporary Mojo interfaces. After a Mojo interface pointer has been
216 // received from the other endpoint, we still need to asynchronously query 226 // received from the other endpoint, we still need to asynchronously query
217 // its version. While that is going on, we should still return nullptr on 227 // its version. While that is going on, we should still return nullptr on
218 // the xxx_instance() functions. 228 // the xxx_instance() functions.
219 // To keep the xxx_instance() functions being trivial, store the instance 229 // To keep the xxx_instance() functions being trivial, store the instance
220 // pointer in a temporary variable to avoid losing its reference. 230 // pointer in a temporary variable to avoid losing its reference.
221 AppInstancePtr temporary_app_ptr_; 231 AppInstancePtr temporary_app_ptr_;
222 InputInstancePtr temporary_input_ptr_; 232 InputInstancePtr temporary_input_ptr_;
223 NotificationsInstancePtr temporary_notifications_ptr_; 233 NotificationsInstancePtr temporary_notifications_ptr_;
224 PowerInstancePtr temporary_power_ptr_; 234 PowerInstancePtr temporary_power_ptr_;
225 ProcessInstancePtr temporary_process_ptr_; 235 ProcessInstancePtr temporary_process_ptr_;
226 SettingsInstancePtr temporary_settings_ptr_; 236 SettingsInstancePtr temporary_settings_ptr_;
237 VideoInstancePtr temporary_video_ptr_;
227 238
228 base::ObserverList<Observer> observer_list_; 239 base::ObserverList<Observer> observer_list_;
229 240
230 base::ThreadChecker thread_checker_; 241 base::ThreadChecker thread_checker_;
231 242
232 // If the ARC instance service is available. 243 // If the ARC instance service is available.
233 bool available_; 244 bool available_;
234 245
235 // The current state of the bridge. 246 // The current state of the bridge.
236 ArcBridgeService::State state_; 247 ArcBridgeService::State state_;
237 248
238 // WeakPtrFactory to use callbacks. 249 // WeakPtrFactory to use callbacks.
239 base::WeakPtrFactory<ArcBridgeService> weak_factory_; 250 base::WeakPtrFactory<ArcBridgeService> weak_factory_;
240 251
241 DISALLOW_COPY_AND_ASSIGN(ArcBridgeService); 252 DISALLOW_COPY_AND_ASSIGN(ArcBridgeService);
242 }; 253 };
243 254
244 } // namespace arc 255 } // namespace arc
245 256
246 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_ 257 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698