| 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 <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "chromeos/chromeos_export.h" | 12 #include "chromeos/chromeos_export.h" |
| 13 | 13 |
| 14 namespace chromeos { | 14 namespace chromeos { |
| 15 | 15 |
| 16 class ApManagerClient; | |
| 17 class ArcObbMounterClient; | 16 class ArcObbMounterClient; |
| 18 class CrasAudioClient; | 17 class CrasAudioClient; |
| 19 class CrosDisksClient; | 18 class CrosDisksClient; |
| 20 class CryptohomeClient; | 19 class CryptohomeClient; |
| 21 class DebugDaemonClient; | 20 class DebugDaemonClient; |
| 22 class EasyUnlockClient; | 21 class EasyUnlockClient; |
| 23 class GsmSMSClient; | 22 class GsmSMSClient; |
| 24 class ImageBurnerClient; | 23 class ImageBurnerClient; |
| 25 class IntrospectableClient; | 24 class IntrospectableClient; |
| 26 class LorgnetteManagerClient; | 25 class LorgnetteManagerClient; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 INTROSPECTABLE = 1 << 10, | 67 INTROSPECTABLE = 1 << 10, |
| 69 MODEM_MESSAGING = 1 << 11, | 68 MODEM_MESSAGING = 1 << 11, |
| 70 NFC = 1 << 12, | 69 NFC = 1 << 12, |
| 71 PERMISSION_BROKER = 1 << 13, | 70 PERMISSION_BROKER = 1 << 13, |
| 72 POWER_MANAGER = 1 << 14, | 71 POWER_MANAGER = 1 << 14, |
| 73 SESSION_MANAGER = 1 << 15, | 72 SESSION_MANAGER = 1 << 15, |
| 74 SMS = 1 << 16, | 73 SMS = 1 << 16, |
| 75 SYSTEM_CLOCK = 1 << 17, | 74 SYSTEM_CLOCK = 1 << 17, |
| 76 UPDATE_ENGINE = 1 << 18, | 75 UPDATE_ENGINE = 1 << 18, |
| 77 PEER_DAEMON = 1 << 19, | 76 PEER_DAEMON = 1 << 19, |
| 78 AP_MANAGER = 1 << 20, | 77 ARC_OBB_MOUNTER = 1 << 20, |
| 79 ARC_OBB_MOUNTER = 1 << 21, | |
| 80 }; | 78 }; |
| 81 | 79 |
| 82 explicit DBusClientBundle(DBusClientTypeMask unstub_client_mask); | 80 explicit DBusClientBundle(DBusClientTypeMask unstub_client_mask); |
| 83 ~DBusClientBundle(); | 81 ~DBusClientBundle(); |
| 84 | 82 |
| 85 // Returns true if |client| is stubbed. | 83 // Returns true if |client| is stubbed. |
| 86 bool IsUsingStub(DBusClientType client); | 84 bool IsUsingStub(DBusClientType client); |
| 87 | 85 |
| 88 // Returns true if any real DBusClient is used. | 86 // Returns true if any real DBusClient is used. |
| 89 bool IsUsingAnyRealClient(); | 87 bool IsUsingAnyRealClient(); |
| 90 | 88 |
| 91 // Initialize proper runtime environment for its dbus clients. | 89 // Initialize proper runtime environment for its dbus clients. |
| 92 void SetupDefaultEnvironment(); | 90 void SetupDefaultEnvironment(); |
| 93 | 91 |
| 94 // Parses command line param values for dbus subsystem that should be | 92 // Parses command line param values for dbus subsystem that should be |
| 95 // un-stubbed. | 93 // un-stubbed. |
| 96 static DBusClientTypeMask ParseUnstubList(const std::string& unstub_list); | 94 static DBusClientTypeMask ParseUnstubList(const std::string& unstub_list); |
| 97 | 95 |
| 98 ApManagerClient* ap_manager_client() { return ap_manager_client_.get(); } | |
| 99 | |
| 100 ArcObbMounterClient* arc_obb_mounter_client() { | 96 ArcObbMounterClient* arc_obb_mounter_client() { |
| 101 return arc_obb_mounter_client_.get(); | 97 return arc_obb_mounter_client_.get(); |
| 102 } | 98 } |
| 103 | 99 |
| 104 CrasAudioClient* cras_audio_client() { | 100 CrasAudioClient* cras_audio_client() { |
| 105 return cras_audio_client_.get(); | 101 return cras_audio_client_.get(); |
| 106 } | 102 } |
| 107 | 103 |
| 108 CrosDisksClient* cros_disks_client() { | 104 CrosDisksClient* cros_disks_client() { |
| 109 return cros_disks_client_.get(); | 105 return cros_disks_client_.get(); |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 return update_engine_client_.get(); | 209 return update_engine_client_.get(); |
| 214 } | 210 } |
| 215 | 211 |
| 216 private: | 212 private: |
| 217 friend class DBusThreadManagerSetter; | 213 friend class DBusThreadManagerSetter; |
| 218 | 214 |
| 219 // Bitmask that defines which dbus clients are not stubbed out. Bitmap flags | 215 // Bitmask that defines which dbus clients are not stubbed out. Bitmap flags |
| 220 // are defined within DBusClientType enum. | 216 // are defined within DBusClientType enum. |
| 221 DBusClientTypeMask unstub_client_mask_; | 217 DBusClientTypeMask unstub_client_mask_; |
| 222 | 218 |
| 223 std::unique_ptr<ApManagerClient> ap_manager_client_; | |
| 224 std::unique_ptr<ArcObbMounterClient> arc_obb_mounter_client_; | 219 std::unique_ptr<ArcObbMounterClient> arc_obb_mounter_client_; |
| 225 std::unique_ptr<CrasAudioClient> cras_audio_client_; | 220 std::unique_ptr<CrasAudioClient> cras_audio_client_; |
| 226 std::unique_ptr<CrosDisksClient> cros_disks_client_; | 221 std::unique_ptr<CrosDisksClient> cros_disks_client_; |
| 227 std::unique_ptr<CryptohomeClient> cryptohome_client_; | 222 std::unique_ptr<CryptohomeClient> cryptohome_client_; |
| 228 std::unique_ptr<DebugDaemonClient> debug_daemon_client_; | 223 std::unique_ptr<DebugDaemonClient> debug_daemon_client_; |
| 229 std::unique_ptr<EasyUnlockClient> easy_unlock_client_; | 224 std::unique_ptr<EasyUnlockClient> easy_unlock_client_; |
| 230 std::unique_ptr<LorgnetteManagerClient> lorgnette_manager_client_; | 225 std::unique_ptr<LorgnetteManagerClient> lorgnette_manager_client_; |
| 231 std::unique_ptr<PeerDaemonManagerClient> peer_daemon_manager_client_; | 226 std::unique_ptr<PeerDaemonManagerClient> peer_daemon_manager_client_; |
| 232 std::unique_ptr<ShillDeviceClient> shill_device_client_; | 227 std::unique_ptr<ShillDeviceClient> shill_device_client_; |
| 233 std::unique_ptr<ShillIPConfigClient> shill_ipconfig_client_; | 228 std::unique_ptr<ShillIPConfigClient> shill_ipconfig_client_; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 253 std::unique_ptr<SessionManagerClient> session_manager_client_; | 248 std::unique_ptr<SessionManagerClient> session_manager_client_; |
| 254 std::unique_ptr<SMSClient> sms_client_; | 249 std::unique_ptr<SMSClient> sms_client_; |
| 255 std::unique_ptr<UpdateEngineClient> update_engine_client_; | 250 std::unique_ptr<UpdateEngineClient> update_engine_client_; |
| 256 | 251 |
| 257 DISALLOW_COPY_AND_ASSIGN(DBusClientBundle); | 252 DISALLOW_COPY_AND_ASSIGN(DBusClientBundle); |
| 258 }; | 253 }; |
| 259 | 254 |
| 260 } // namespace chromeos | 255 } // namespace chromeos |
| 261 | 256 |
| 262 #endif // CHROMEOS_DBUS_DBUS_CLIENT_BUNDLE_H_ | 257 #endif // CHROMEOS_DBUS_DBUS_CLIENT_BUNDLE_H_ |
| OLD | NEW |