OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CHROMEOS_DBUS_DBUS_CLIENT_BUNDLE_H_ | 5 #ifndef CHROMEOS_DBUS_DBUS_CLIENT_BUNDLE_H_ |
6 #define CHROMEOS_DBUS_DBUS_CLIENT_BUNDLE_H_ | 6 #define CHROMEOS_DBUS_DBUS_CLIENT_BUNDLE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "chromeos/chromeos_export.h" | 11 #include "chromeos/chromeos_export.h" |
12 | 12 |
13 namespace chromeos { | 13 namespace chromeos { |
14 | 14 |
15 class AmplifierClient; | 15 class AmplifierClient; |
16 class ApManagerClient; | 16 class ApManagerClient; |
17 class ArcBridgeClient; | 17 class ArcInstanceClient; |
18 class AudioDspClient; | 18 class AudioDspClient; |
19 class BluetoothAdapterClient; | 19 class BluetoothAdapterClient; |
20 class BluetoothAgentManagerClient; | 20 class BluetoothAgentManagerClient; |
21 class BluetoothDeviceClient; | 21 class BluetoothDeviceClient; |
22 class BluetoothGattCharacteristicClient; | 22 class BluetoothGattCharacteristicClient; |
23 class BluetoothGattDescriptorClient; | 23 class BluetoothGattDescriptorClient; |
24 class BluetoothGattManagerClient; | 24 class BluetoothGattManagerClient; |
25 class BluetoothGattServiceClient; | 25 class BluetoothGattServiceClient; |
26 class BluetoothInputClient; | 26 class BluetoothInputClient; |
27 class BluetoothLEAdvertisingManagerClient; | 27 class BluetoothLEAdvertisingManagerClient; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 POWER_MANAGER = 1 << 14, | 86 POWER_MANAGER = 1 << 14, |
87 SESSION_MANAGER = 1 << 15, | 87 SESSION_MANAGER = 1 << 15, |
88 SMS = 1 << 16, | 88 SMS = 1 << 16, |
89 SYSTEM_CLOCK = 1 << 17, | 89 SYSTEM_CLOCK = 1 << 17, |
90 UPDATE_ENGINE = 1 << 18, | 90 UPDATE_ENGINE = 1 << 18, |
91 PEER_DAEMON = 1 << 19, | 91 PEER_DAEMON = 1 << 19, |
92 AP_MANAGER = 1 << 20, | 92 AP_MANAGER = 1 << 20, |
93 PRIVET_DAEMON = 1 << 21, | 93 PRIVET_DAEMON = 1 << 21, |
94 AMPLIFIER = 1 << 22, | 94 AMPLIFIER = 1 << 22, |
95 AUDIO_DSP = 1 << 23, | 95 AUDIO_DSP = 1 << 23, |
96 ARC_BRIDGE = 1 << 24, | 96 ARC_INSTANCE = 1 << 24, |
97 }; | 97 }; |
98 | 98 |
99 explicit DBusClientBundle(DBusClientTypeMask unstub_client_mask); | 99 explicit DBusClientBundle(DBusClientTypeMask unstub_client_mask); |
100 ~DBusClientBundle(); | 100 ~DBusClientBundle(); |
101 | 101 |
102 // Returns true if |client| is stubbed. | 102 // Returns true if |client| is stubbed. |
103 bool IsUsingStub(DBusClientType client); | 103 bool IsUsingStub(DBusClientType client); |
104 | 104 |
105 // Returns true if any real DBusClient is used. | 105 // Returns true if any real DBusClient is used. |
106 bool IsUsingAnyRealClient(); | 106 bool IsUsingAnyRealClient(); |
107 | 107 |
108 // Initialize proper runtime environment for its dbus clients. | 108 // Initialize proper runtime environment for its dbus clients. |
109 void SetupDefaultEnvironment(); | 109 void SetupDefaultEnvironment(); |
110 | 110 |
111 // Parses command line param values for dbus subsystem that should be | 111 // Parses command line param values for dbus subsystem that should be |
112 // un-stubbed. | 112 // un-stubbed. |
113 static DBusClientTypeMask ParseUnstubList(const std::string& unstub_list); | 113 static DBusClientTypeMask ParseUnstubList(const std::string& unstub_list); |
114 | 114 |
115 AmplifierClient* amplifier_client() { return amplifier_client_.get(); } | 115 AmplifierClient* amplifier_client() { return amplifier_client_.get(); } |
116 | 116 |
117 ApManagerClient* ap_manager_client() { return ap_manager_client_.get(); } | 117 ApManagerClient* ap_manager_client() { return ap_manager_client_.get(); } |
118 | 118 |
119 ArcBridgeClient* arc_bridge_client() { return arc_bridge_client_.get(); } | 119 ArcInstanceClient* arc_instance_client() { |
| 120 return arc_instance_client_.get(); |
| 121 } |
120 | 122 |
121 AudioDspClient* audio_dsp_client() { return audio_dsp_client_.get(); } | 123 AudioDspClient* audio_dsp_client() { return audio_dsp_client_.get(); } |
122 | 124 |
123 BluetoothAdapterClient* bluetooth_adapter_client() { | 125 BluetoothAdapterClient* bluetooth_adapter_client() { |
124 return bluetooth_adapter_client_.get(); | 126 return bluetooth_adapter_client_.get(); |
125 } | 127 } |
126 | 128 |
127 BluetoothLEAdvertisingManagerClient* | 129 BluetoothLEAdvertisingManagerClient* |
128 bluetooth_le_advertising_manager_client() { | 130 bluetooth_le_advertising_manager_client() { |
129 return bluetooth_le_advertising_manager_client_.get(); | 131 return bluetooth_le_advertising_manager_client_.get(); |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 | 289 |
288 private: | 290 private: |
289 friend class DBusThreadManagerSetter; | 291 friend class DBusThreadManagerSetter; |
290 | 292 |
291 // Bitmask that defines which dbus clients are not stubbed out. Bitmap flags | 293 // Bitmask that defines which dbus clients are not stubbed out. Bitmap flags |
292 // are defined within DBusClientType enum. | 294 // are defined within DBusClientType enum. |
293 DBusClientTypeMask unstub_client_mask_; | 295 DBusClientTypeMask unstub_client_mask_; |
294 | 296 |
295 scoped_ptr<AmplifierClient> amplifier_client_; | 297 scoped_ptr<AmplifierClient> amplifier_client_; |
296 scoped_ptr<ApManagerClient> ap_manager_client_; | 298 scoped_ptr<ApManagerClient> ap_manager_client_; |
297 scoped_ptr<ArcBridgeClient> arc_bridge_client_; | 299 scoped_ptr<ArcInstanceClient> arc_instance_client_; |
298 scoped_ptr<AudioDspClient> audio_dsp_client_; | 300 scoped_ptr<AudioDspClient> audio_dsp_client_; |
299 scoped_ptr<BluetoothAdapterClient> bluetooth_adapter_client_; | 301 scoped_ptr<BluetoothAdapterClient> bluetooth_adapter_client_; |
300 scoped_ptr<BluetoothLEAdvertisingManagerClient> | 302 scoped_ptr<BluetoothLEAdvertisingManagerClient> |
301 bluetooth_le_advertising_manager_client_; | 303 bluetooth_le_advertising_manager_client_; |
302 scoped_ptr<BluetoothAgentManagerClient> bluetooth_agent_manager_client_; | 304 scoped_ptr<BluetoothAgentManagerClient> bluetooth_agent_manager_client_; |
303 scoped_ptr<BluetoothDeviceClient> bluetooth_device_client_; | 305 scoped_ptr<BluetoothDeviceClient> bluetooth_device_client_; |
304 scoped_ptr<BluetoothGattCharacteristicClient> | 306 scoped_ptr<BluetoothGattCharacteristicClient> |
305 bluetooth_gatt_characteristic_client_; | 307 bluetooth_gatt_characteristic_client_; |
306 scoped_ptr<BluetoothGattDescriptorClient> bluetooth_gatt_descriptor_client_; | 308 scoped_ptr<BluetoothGattDescriptorClient> bluetooth_gatt_descriptor_client_; |
307 scoped_ptr<BluetoothGattManagerClient> bluetooth_gatt_manager_client_; | 309 scoped_ptr<BluetoothGattManagerClient> bluetooth_gatt_manager_client_; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 scoped_ptr<SessionManagerClient> session_manager_client_; | 344 scoped_ptr<SessionManagerClient> session_manager_client_; |
343 scoped_ptr<SMSClient> sms_client_; | 345 scoped_ptr<SMSClient> sms_client_; |
344 scoped_ptr<UpdateEngineClient> update_engine_client_; | 346 scoped_ptr<UpdateEngineClient> update_engine_client_; |
345 | 347 |
346 DISALLOW_COPY_AND_ASSIGN(DBusClientBundle); | 348 DISALLOW_COPY_AND_ASSIGN(DBusClientBundle); |
347 }; | 349 }; |
348 | 350 |
349 } // namespace chromeos | 351 } // namespace chromeos |
350 | 352 |
351 #endif // CHROMEOS_DBUS_DBUS_CLIENT_BUNDLE_H_ | 353 #endif // CHROMEOS_DBUS_DBUS_CLIENT_BUNDLE_H_ |
OLD | NEW |