OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROMEOS_DBUS_DBUS_CLIENT_BUNDLE_H_ |
| 6 #define CHROMEOS_DBUS_DBUS_CLIENT_BUNDLE_H_ |
| 7 |
| 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "chromeos/chromeos_export.h" |
| 10 |
| 11 namespace chromeos { |
| 12 |
| 13 class BluetoothAdapterClient; |
| 14 class BluetoothAgentManagerClient; |
| 15 class BluetoothDeviceClient; |
| 16 class BluetoothGattCharacteristicClient; |
| 17 class BluetoothGattDescriptorClient; |
| 18 class BluetoothGattManagerClient; |
| 19 class BluetoothGattServiceClient; |
| 20 class BluetoothInputClient; |
| 21 class BluetoothProfileManagerClient; |
| 22 class CrasAudioClient; |
| 23 class CrosDisksClient; |
| 24 class CryptohomeClient; |
| 25 class DebugDaemonClient; |
| 26 class EasyUnlockClient; |
| 27 class LorgnetteManagerClient; |
| 28 class ShillDeviceClient; |
| 29 class ShillIPConfigClient; |
| 30 class ShillManagerClient; |
| 31 class ShillServiceClient; |
| 32 class ShillProfileClient; |
| 33 class GsmSMSClient; |
| 34 class ImageBurnerClient; |
| 35 class IntrospectableClient; |
| 36 class ModemMessagingClient; |
| 37 class NfcManagerClient; |
| 38 class NfcAdapterClient; |
| 39 class NfcDeviceClient; |
| 40 class NfcTagClient; |
| 41 class NfcRecordClient; |
| 42 class PermissionBrokerClient; |
| 43 class SystemClockClient; |
| 44 class PowerManagerClient; |
| 45 class SessionManagerClient; |
| 46 class SMSClient; |
| 47 class UpdateEngineClient; |
| 48 |
| 49 // The bundle of all D-Bus clients used in DBusThreadManagerImpl. The bundle |
| 50 // is used to delete them at once in the right order before shutting down the |
| 51 // system bus. See also the comment in the destructor of DBusThreadManagerImpl. |
| 52 class CHROMEOS_EXPORT DBusClientBundle { |
| 53 public: |
| 54 typedef unsigned int DBusClientTypeMask; |
| 55 |
| 56 // TODO(zelidrag): We might want to collapse few more of these subsystems if |
| 57 // their dbus interfaced correspond to the same daemon. |
| 58 enum DBusClientType { |
| 59 NO_CLIENTS = 0, |
| 60 BLUETOOTH = 1 << 0, |
| 61 CRAS = 1 << 1, |
| 62 CROS_DISKS = 1 << 2, |
| 63 CRYPTOHOME = 1 << 3, |
| 64 DEBUG_DAEMON = 1 << 4, |
| 65 EASY_UNLOCK = 1 << 5, |
| 66 LORGNETTE_MANAGER = 1 << 6, |
| 67 SHILL = 1 << 7, |
| 68 GSM_SMS = 1 << 8, |
| 69 IMAGE_BURNER = 1 << 9, |
| 70 INTROSPECTABLE = 1 << 10, |
| 71 MODEM_MESSAGING = 1 << 11, |
| 72 NFC = 1 << 12, |
| 73 PERMISSION_BROKER = 1 << 13, |
| 74 POWER_MANAGER = 1 << 14, |
| 75 SESSION_MANAGER = 1 << 15, |
| 76 SMS = 1 << 16, |
| 77 SYSTEM_CLOCK = 1 << 17, |
| 78 UPDATE_ENGINE = 1 << 18, |
| 79 ALL_CLIENTS = ~static_cast<DBusClientTypeMask>(0), |
| 80 }; |
| 81 |
| 82 DBusClientBundle(); |
| 83 virtual ~DBusClientBundle(); |
| 84 |
| 85 // Parses command line param values for dbus subsystem that should be |
| 86 // un-stubbed. |
| 87 static DBusClientTypeMask ParseUnstubList(const std::string& unstub_list); |
| 88 |
| 89 BluetoothAdapterClient* bluetooth_adapter_client() { |
| 90 return bluetooth_adapter_client_.get(); |
| 91 } |
| 92 |
| 93 BluetoothAgentManagerClient* bluetooth_agent_manager_client() { |
| 94 return bluetooth_agent_manager_client_.get(); |
| 95 } |
| 96 |
| 97 BluetoothDeviceClient* bluetooth_device_client() { |
| 98 return bluetooth_device_client_.get(); |
| 99 } |
| 100 |
| 101 BluetoothGattCharacteristicClient* bluetooth_gatt_characteristic_client() { |
| 102 return bluetooth_gatt_characteristic_client_.get(); |
| 103 } |
| 104 |
| 105 BluetoothGattDescriptorClient* bluetooth_gatt_descriptor_client() { |
| 106 return bluetooth_gatt_descriptor_client_.get(); |
| 107 |
| 108 } |
| 109 BluetoothGattManagerClient* bluetooth_gatt_manager_client() { |
| 110 return bluetooth_gatt_manager_client_.get(); |
| 111 } |
| 112 |
| 113 BluetoothGattServiceClient* bluetooth_gatt_service_client() { |
| 114 return bluetooth_gatt_service_client_.get(); |
| 115 } |
| 116 |
| 117 BluetoothInputClient* bluetooth_input_client() { |
| 118 return bluetooth_input_client_.get(); |
| 119 } |
| 120 |
| 121 BluetoothProfileManagerClient* bluetooth_profile_manager_client() { |
| 122 return bluetooth_profile_manager_client_.get(); |
| 123 } |
| 124 |
| 125 CrasAudioClient* cras_audio_client() { |
| 126 return cras_audio_client_.get(); |
| 127 } |
| 128 |
| 129 CrosDisksClient* cros_disks_client() { |
| 130 return cros_disks_client_.get(); |
| 131 } |
| 132 |
| 133 CryptohomeClient* cryptohome_client() { |
| 134 return cryptohome_client_.get(); |
| 135 } |
| 136 |
| 137 DebugDaemonClient* debug_daemon_client() { |
| 138 return debug_daemon_client_.get(); |
| 139 } |
| 140 |
| 141 EasyUnlockClient* easy_unlock_client() { |
| 142 return easy_unlock_client_.get(); |
| 143 } |
| 144 |
| 145 LorgnetteManagerClient* lorgnette_manager_client() { |
| 146 return lorgnette_manager_client_.get(); |
| 147 } |
| 148 |
| 149 ShillDeviceClient* shill_device_client() { |
| 150 return shill_device_client_.get(); |
| 151 } |
| 152 |
| 153 ShillIPConfigClient* shill_ipconfig_client() { |
| 154 return shill_ipconfig_client_.get(); |
| 155 } |
| 156 |
| 157 ShillManagerClient* shill_manager_client() { |
| 158 return shill_manager_client_.get(); |
| 159 } |
| 160 |
| 161 ShillServiceClient* shill_service_client() { |
| 162 return shill_service_client_.get(); |
| 163 } |
| 164 |
| 165 ShillProfileClient* shill_profile_client() { |
| 166 return shill_profile_client_.get(); |
| 167 } |
| 168 |
| 169 GsmSMSClient* gsm_sms_client() { |
| 170 return gsm_sms_client_.get(); |
| 171 } |
| 172 |
| 173 ImageBurnerClient* image_burner_client() { |
| 174 return image_burner_client_.get(); |
| 175 } |
| 176 |
| 177 IntrospectableClient* introspectable_client() { |
| 178 return introspectable_client_.get(); |
| 179 } |
| 180 |
| 181 ModemMessagingClient* modem_messaging_client() { |
| 182 return modem_messaging_client_.get(); |
| 183 } |
| 184 |
| 185 NfcManagerClient* nfc_manager_client() { |
| 186 return nfc_manager_client_.get(); |
| 187 } |
| 188 |
| 189 NfcAdapterClient* nfc_adapter_client() { |
| 190 return nfc_adapter_client_.get(); |
| 191 } |
| 192 |
| 193 NfcDeviceClient* nfc_device_client() { |
| 194 return nfc_device_client_.get(); |
| 195 } |
| 196 |
| 197 NfcTagClient* nfc_tag_client() { |
| 198 return nfc_tag_client_.get(); |
| 199 } |
| 200 |
| 201 NfcRecordClient* nfc_record_client() { |
| 202 return nfc_record_client_.get(); |
| 203 } |
| 204 |
| 205 PermissionBrokerClient* permission_broker_client() { |
| 206 return permission_broker_client_.get(); |
| 207 } |
| 208 |
| 209 SystemClockClient* system_clock_client() { |
| 210 return system_clock_client_.get(); |
| 211 } |
| 212 |
| 213 PowerManagerClient* power_manager_client() { |
| 214 return power_manager_client_.get(); |
| 215 } |
| 216 |
| 217 SessionManagerClient* session_manager_client() { |
| 218 return session_manager_client_.get(); |
| 219 } |
| 220 |
| 221 SMSClient* sms_client() { |
| 222 return sms_client_.get(); |
| 223 } |
| 224 |
| 225 UpdateEngineClient* update_engine_client() { |
| 226 return update_engine_client_.get(); |
| 227 } |
| 228 |
| 229 private: |
| 230 scoped_ptr<BluetoothAdapterClient> bluetooth_adapter_client_; |
| 231 scoped_ptr<BluetoothAgentManagerClient> bluetooth_agent_manager_client_; |
| 232 scoped_ptr<BluetoothDeviceClient> bluetooth_device_client_; |
| 233 scoped_ptr<BluetoothGattCharacteristicClient> |
| 234 bluetooth_gatt_characteristic_client_; |
| 235 scoped_ptr<BluetoothGattDescriptorClient> bluetooth_gatt_descriptor_client_; |
| 236 scoped_ptr<BluetoothGattManagerClient> bluetooth_gatt_manager_client_; |
| 237 scoped_ptr<BluetoothGattServiceClient> bluetooth_gatt_service_client_; |
| 238 scoped_ptr<BluetoothInputClient> bluetooth_input_client_; |
| 239 scoped_ptr<BluetoothProfileManagerClient> bluetooth_profile_manager_client_; |
| 240 scoped_ptr<CrasAudioClient> cras_audio_client_; |
| 241 scoped_ptr<CrosDisksClient> cros_disks_client_; |
| 242 scoped_ptr<CryptohomeClient> cryptohome_client_; |
| 243 scoped_ptr<DebugDaemonClient> debug_daemon_client_; |
| 244 scoped_ptr<EasyUnlockClient> easy_unlock_client_; |
| 245 scoped_ptr<LorgnetteManagerClient> lorgnette_manager_client_; |
| 246 scoped_ptr<ShillDeviceClient> shill_device_client_; |
| 247 scoped_ptr<ShillIPConfigClient> shill_ipconfig_client_; |
| 248 scoped_ptr<ShillManagerClient> shill_manager_client_; |
| 249 scoped_ptr<ShillServiceClient> shill_service_client_; |
| 250 scoped_ptr<ShillProfileClient> shill_profile_client_; |
| 251 scoped_ptr<GsmSMSClient> gsm_sms_client_; |
| 252 scoped_ptr<ImageBurnerClient> image_burner_client_; |
| 253 scoped_ptr<IntrospectableClient> introspectable_client_; |
| 254 scoped_ptr<ModemMessagingClient> modem_messaging_client_; |
| 255 // The declaration order for NFC client objects is important. See |
| 256 // DBusThreadManager::CreateDefaultClients for the dependencies. |
| 257 scoped_ptr<NfcManagerClient> nfc_manager_client_; |
| 258 scoped_ptr<NfcAdapterClient> nfc_adapter_client_; |
| 259 scoped_ptr<NfcDeviceClient> nfc_device_client_; |
| 260 scoped_ptr<NfcTagClient> nfc_tag_client_; |
| 261 scoped_ptr<NfcRecordClient> nfc_record_client_; |
| 262 scoped_ptr<PermissionBrokerClient> permission_broker_client_; |
| 263 scoped_ptr<SystemClockClient> system_clock_client_; |
| 264 scoped_ptr<PowerManagerClient> power_manager_client_; |
| 265 scoped_ptr<SessionManagerClient> session_manager_client_; |
| 266 scoped_ptr<SMSClient> sms_client_; |
| 267 scoped_ptr<UpdateEngineClient> update_engine_client_; |
| 268 |
| 269 DISALLOW_COPY_AND_ASSIGN(DBusClientBundle); |
| 270 }; |
| 271 |
| 272 } // namespace chromeos |
| 273 |
| 274 #endif // CHROMEOS_DBUS_DBUS_CLIENT_BUNDLE_H_ |
OLD | NEW |