Chromium Code Reviews| Index: chromeos/dbus/dbus_client_bundle.h |
| diff --git a/chromeos/dbus/dbus_client_bundle.h b/chromeos/dbus/dbus_client_bundle.h |
| index e4710a86e36668ffcb764636ed5ebd01324c625a..fa4fab8464dd1ee7c0e81594de6f4c65954535fc 100644 |
| --- a/chromeos/dbus/dbus_client_bundle.h |
| +++ b/chromeos/dbus/dbus_client_bundle.h |
| @@ -51,12 +51,14 @@ class UpdateEngineClient; |
| // system bus. See also the comment in the destructor of DBusThreadManagerImpl. |
| class CHROMEOS_EXPORT DBusClientBundle { |
| public: |
| - typedef unsigned int DBusClientTypeMask; |
| + typedef int DBusClientTypeMask; |
| + |
| + static const DBusClientTypeMask NO_CLIENTS; |
| + static const DBusClientTypeMask ALL_CLIENTS; |
| // TODO(zelidrag): We might want to collapse few more of these subsystems if |
| // their dbus interfaced correspond to the same daemon. |
| enum DBusClientType { |
| - NO_CLIENTS = 0, |
| BLUETOOTH = 1 << 0, |
| CRAS = 1 << 1, |
| CROS_DISKS = 1 << 2, |
| @@ -76,12 +78,17 @@ class CHROMEOS_EXPORT DBusClientBundle { |
| SMS = 1 << 16, |
| SYSTEM_CLOCK = 1 << 17, |
| UPDATE_ENGINE = 1 << 18, |
| - ALL_CLIENTS = ~static_cast<DBusClientTypeMask>(0), |
| }; |
| - DBusClientBundle(); |
| + DBusClientBundle(DBusClientTypeMask unstub_client_mask); |
| ~DBusClientBundle(); |
| + // Returns true if |client| is stubbed. |
| + bool IsUsingStub(DBusClientType client); |
| + |
| + // Returns true if any regular DBusClient is used. |
|
hashimoto
2014/09/10 06:01:28
What does "regular" here mean?
DBusClientImplement
pneubeck (no reviews)
2014/09/10 07:58:13
Regular was used in the function name 'InitializeR
|
| + bool IsUsingAnyRegularClient(); |
| + |
| // Initialize proper runtime environment for its dbus clients. |
| void SetupDefaultEnvironment(); |
| @@ -232,6 +239,10 @@ class CHROMEOS_EXPORT DBusClientBundle { |
| private: |
| friend class DBusThreadManagerSetter; |
| + // Bitmask that defines which dbus clients are not stubbed out. Bitmap flags |
| + // are defined within DBusClientType enum. |
| + DBusClientTypeMask unstub_client_mask_; |
| + |
| scoped_ptr<BluetoothAdapterClient> bluetooth_adapter_client_; |
| scoped_ptr<BluetoothAgentManagerClient> bluetooth_agent_manager_client_; |
| scoped_ptr<BluetoothDeviceClient> bluetooth_device_client_; |
| @@ -258,7 +269,7 @@ class CHROMEOS_EXPORT DBusClientBundle { |
| scoped_ptr<IntrospectableClient> introspectable_client_; |
| scoped_ptr<ModemMessagingClient> modem_messaging_client_; |
| // The declaration order for NFC client objects is important. See |
| - // DBusThreadManager::CreateDefaultClients for the dependencies. |
| + // DBusThreadManager::InitializeClients for the dependencies. |
| scoped_ptr<NfcManagerClient> nfc_manager_client_; |
| scoped_ptr<NfcAdapterClient> nfc_adapter_client_; |
| scoped_ptr<NfcDeviceClient> nfc_device_client_; |