Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Unified Diff: chromeos/dbus/mixed_dbus_thread_manager.h

Issue 444263002: Added switch that let us 'un-stub' certain dbus clients. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/dbus/dbus_thread_manager.cc ('k') | chromeos/dbus/mixed_dbus_thread_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/mixed_dbus_thread_manager.h
diff --git a/chromeos/dbus/mixed_dbus_thread_manager.h b/chromeos/dbus/mixed_dbus_thread_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..ce1adf8434c9dc2722fb649182139bd29ded7069
--- /dev/null
+++ b/chromeos/dbus/mixed_dbus_thread_manager.h
@@ -0,0 +1,81 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROMEOS_DBUS_MIXED_DBUS_THREAD_MANAGER_H_
+#define CHROMEOS_DBUS_MIXED_DBUS_THREAD_MANAGER_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "chromeos/chromeos_export.h"
+#include "chromeos/dbus/dbus_thread_manager.h"
+
+namespace chromeos {
+
+// This class permits mixing DBusThreadManagerImpl and FakeDBusThreadManager
+// implementation and allow us to selectively activate some dbus clients while
+// others remain stubbed out.
+class CHROMEOS_EXPORT MixedDBusThreadManager : public DBusThreadManager {
+ public:
+ explicit MixedDBusThreadManager(
+ DBusThreadManager* real_thread_manager,
+ DBusThreadManager* fake_thread_manager);
+
+ virtual ~MixedDBusThreadManager();
+
+ // DBusThreadManager overrides.
+ virtual dbus::Bus* GetSystemBus() OVERRIDE;
+ virtual BluetoothAdapterClient* GetBluetoothAdapterClient() OVERRIDE;
+ virtual BluetoothAgentManagerClient*
+ GetBluetoothAgentManagerClient() OVERRIDE;
+ virtual BluetoothDeviceClient* GetBluetoothDeviceClient() OVERRIDE;
+ virtual BluetoothGattCharacteristicClient*
+ GetBluetoothGattCharacteristicClient() OVERRIDE;
+ virtual BluetoothGattDescriptorClient*
+ GetBluetoothGattDescriptorClient() OVERRIDE;
+ virtual BluetoothGattManagerClient* GetBluetoothGattManagerClient() OVERRIDE;
+ virtual BluetoothGattServiceClient* GetBluetoothGattServiceClient() OVERRIDE;
+ virtual BluetoothInputClient* GetBluetoothInputClient() OVERRIDE;
+ virtual BluetoothProfileManagerClient*
+ GetBluetoothProfileManagerClient() OVERRIDE;
+ virtual CrasAudioClient* GetCrasAudioClient() OVERRIDE;
+ virtual CrosDisksClient* GetCrosDisksClient() OVERRIDE;
+ virtual CryptohomeClient* GetCryptohomeClient() OVERRIDE;
+ virtual DebugDaemonClient* GetDebugDaemonClient() OVERRIDE;
+ virtual EasyUnlockClient* GetEasyUnlockClient() OVERRIDE;
+ virtual LorgnetteManagerClient* GetLorgnetteManagerClient() OVERRIDE;
+ virtual ShillDeviceClient* GetShillDeviceClient() OVERRIDE;
+ virtual ShillIPConfigClient* GetShillIPConfigClient() OVERRIDE;
+ virtual ShillManagerClient* GetShillManagerClient() OVERRIDE;
+ virtual ShillProfileClient* GetShillProfileClient() OVERRIDE;
+ virtual ShillServiceClient* GetShillServiceClient() OVERRIDE;
+ virtual GsmSMSClient* GetGsmSMSClient() OVERRIDE;
+ virtual ImageBurnerClient* GetImageBurnerClient() OVERRIDE;
+ virtual IntrospectableClient* GetIntrospectableClient() OVERRIDE;
+ virtual ModemMessagingClient* GetModemMessagingClient() OVERRIDE;
+ virtual NfcAdapterClient* GetNfcAdapterClient() OVERRIDE;
+ virtual NfcDeviceClient* GetNfcDeviceClient() OVERRIDE;
+ virtual NfcManagerClient* GetNfcManagerClient() OVERRIDE;
+ virtual NfcRecordClient* GetNfcRecordClient() OVERRIDE;
+ virtual NfcTagClient* GetNfcTagClient() OVERRIDE;
+ virtual PermissionBrokerClient* GetPermissionBrokerClient() OVERRIDE;
+ virtual PowerManagerClient* GetPowerManagerClient() OVERRIDE;
+ virtual PowerPolicyController* GetPowerPolicyController() OVERRIDE;
+ virtual SessionManagerClient* GetSessionManagerClient() OVERRIDE;
+ virtual SMSClient* GetSMSClient() OVERRIDE;
+ virtual SystemClockClient* GetSystemClockClient() OVERRIDE;
+ virtual UpdateEngineClient* GetUpdateEngineClient() OVERRIDE;
+
+ private:
+ // Returns either the real or fake DBusThreadManager implementation based on
+ // |client| and |unstub_mask_|.
+ DBusThreadManager* GetThreadManager(DBusClientBundle::DBusClientType client);
+
+ scoped_ptr<DBusThreadManager> real_thread_manager_;
+ scoped_ptr<DBusThreadManager> fake_thread_manager_;
+
+ DISALLOW_COPY_AND_ASSIGN(MixedDBusThreadManager);
+};
+
+} // namespace chromeos
+
+#endif // CHROMEOS_DBUS_MIXED_DBUS_THREAD_MANAGER_H_
« no previous file with comments | « chromeos/dbus/dbus_thread_manager.cc ('k') | chromeos/dbus/mixed_dbus_thread_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698