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