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

Side by Side 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: rebase 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 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_MIXED_DBUS_THREAD_MANAGER_H_
6 #define CHROMEOS_DBUS_MIXED_DBUS_THREAD_MANAGER_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "chromeos/chromeos_export.h"
10 #include "chromeos/dbus/dbus_client_bundle.h"
11 #include "chromeos/dbus/dbus_thread_manager.h"
12
13 namespace chromeos {
14
15 // This class permits mixing DBusThreadManagerImpl and FakeDBusThreadManager
16 // implementation and allow us to selectively activate some dbus clients while
17 // others remain stubbed out.
18 class CHROMEOS_EXPORT MixedDBusThreadManager : public DBusThreadManager {
hashimoto 2014/08/08 07:08:44 Instead of introducing MixedDBusThreadManager, can
zel 2014/08/08 19:00:15 I am not sure about that. DBusThreadManagerImpl se
hashimoto 2014/08/11 11:01:05 My primary concern here is that we have to maintai
19 public:
20 explicit MixedDBusThreadManager(unsigned int unstub_mask,
21 DBusThreadManager* real_thread_manager,
22 DBusThreadManager* fake_thread_manager);
23
24 virtual ~MixedDBusThreadManager();
25
26 private:
27
28 // DBusThreadManager overrides.
29 virtual void AddObserver(DBusThreadManagerObserver* observer) OVERRIDE;
30 virtual void RemoveObserver(DBusThreadManagerObserver* observer) OVERRIDE;
31 virtual dbus::Bus* GetSystemBus() OVERRIDE;
32 virtual BluetoothAdapterClient* GetBluetoothAdapterClient() OVERRIDE;
33 virtual BluetoothAgentManagerClient*
34 GetBluetoothAgentManagerClient() OVERRIDE;
35 virtual BluetoothDeviceClient* GetBluetoothDeviceClient() OVERRIDE;
36 virtual BluetoothGattCharacteristicClient*
37 GetBluetoothGattCharacteristicClient() OVERRIDE;
38 virtual BluetoothGattDescriptorClient*
39 GetBluetoothGattDescriptorClient() OVERRIDE;
40 virtual BluetoothGattManagerClient* GetBluetoothGattManagerClient() OVERRIDE;
41 virtual BluetoothGattServiceClient* GetBluetoothGattServiceClient() OVERRIDE;
42 virtual BluetoothInputClient* GetBluetoothInputClient() OVERRIDE;
43 virtual BluetoothProfileManagerClient*
44 GetBluetoothProfileManagerClient() OVERRIDE;
45 virtual CrasAudioClient* GetCrasAudioClient() OVERRIDE;
46 virtual CrosDisksClient* GetCrosDisksClient() OVERRIDE;
47 virtual CryptohomeClient* GetCryptohomeClient() OVERRIDE;
48 virtual DebugDaemonClient* GetDebugDaemonClient() OVERRIDE;
49 virtual EasyUnlockClient* GetEasyUnlockClient() OVERRIDE;
50 virtual LorgnetteManagerClient* GetLorgnetteManagerClient() OVERRIDE;
51 virtual ShillDeviceClient* GetShillDeviceClient() OVERRIDE;
52 virtual ShillIPConfigClient* GetShillIPConfigClient() OVERRIDE;
53 virtual ShillManagerClient* GetShillManagerClient() OVERRIDE;
54 virtual ShillProfileClient* GetShillProfileClient() OVERRIDE;
55 virtual ShillServiceClient* GetShillServiceClient() OVERRIDE;
56 virtual GsmSMSClient* GetGsmSMSClient() OVERRIDE;
57 virtual ImageBurnerClient* GetImageBurnerClient() OVERRIDE;
58 virtual IntrospectableClient* GetIntrospectableClient() OVERRIDE;
59 virtual ModemMessagingClient* GetModemMessagingClient() OVERRIDE;
60 virtual NfcAdapterClient* GetNfcAdapterClient() OVERRIDE;
61 virtual NfcDeviceClient* GetNfcDeviceClient() OVERRIDE;
62 virtual NfcManagerClient* GetNfcManagerClient() OVERRIDE;
63 virtual NfcRecordClient* GetNfcRecordClient() OVERRIDE;
64 virtual NfcTagClient* GetNfcTagClient() OVERRIDE;
65 virtual PermissionBrokerClient* GetPermissionBrokerClient() OVERRIDE;
66 virtual PowerManagerClient* GetPowerManagerClient() OVERRIDE;
67 virtual PowerPolicyController* GetPowerPolicyController() OVERRIDE;
68 virtual SessionManagerClient* GetSessionManagerClient() OVERRIDE;
69 virtual SMSClient* GetSMSClient() OVERRIDE;
70 virtual SystemClockClient* GetSystemClockClient() OVERRIDE;
71 virtual UpdateEngineClient* GetUpdateEngineClient() OVERRIDE;
72
73 private:
74 // Returns either the real or fake DBusThreadManager implementation based on
75 // |client| and |unstub_mask_|.
76 DBusThreadManager* GetThreadManager(DBusClientBundle::DBusClientType client);
77
78 // Bitmask that defines which dbus clients should use |real_thread_manager_|,
79 // all other will be served by |fake_thread_manager_|. Bitmap flags are
80 // defined within DBusClientBundle::DBusClientType enum.
81 unsigned int unstub_mask_;
82 scoped_ptr<DBusThreadManager> real_thread_manager_;
83 scoped_ptr<DBusThreadManager> fake_thread_manager_;
84
85 DISALLOW_COPY_AND_ASSIGN(MixedDBusThreadManager);
86 };
87
88 } // namespace chromeos
89
90 #endif // CHROMEOS_DBUS_MIXED_DBUS_THREAD_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698