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

Side by Side Diff: chromeos/dbus/dbus_client_bundle.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 UNKNOWN = 0,
60 BLUETOOTH = 1 << 0,
61 BLUETOOTH_LOW_ENERGY = 1 << 1,
62 CRAS = 1 << 2,
63 CROS_DISKS = 1 << 3,
64 CRYPTOHOME = 1 << 4,
65 DEBUG_DAEMON = 1 << 5,
66 EASY_UNLOCK = 1 << 6,
67 LORGNETTE_MANAGER = 1 << 7,
68 SHILL = 1 << 8,
69 GSM_SMS = 1 << 9,
70 IMAGE_BURNER = 1 << 10,
71 INTROSPECTABLE = 1 << 11,
72 MODEM_MESSAGING = 1 << 12,
73 NFC = 1 << 13,
74 PERMISSION_BROKER = 1 << 14,
75 POWER_MANAGER = 1 << 15,
76 POWER_POLICY = 1 << 16,
77 SESSION_MANAGER = 1 << 17,
78 SMS = 1 << 18,
79 SYSTEM_CLOCK = 1 << 19,
80 UPDATE_ENGINE = 1 << 20,
81 ALL_CLIENTS = 0xFFFFFFFF,
satorux1 2014/08/11 01:52:09 maybe: 1 << 21 - 1
zel 2014/08/12 17:32:32 maybe not. why would create an extra place that on
hashimoto 2014/08/13 06:14:48 Then how about "~static_cast<DBusClientTypeMask>(0
zel 2014/08/13 17:57:43 Done.
82 };
83
84 explicit DBusClientBundle();
85 virtual ~DBusClientBundle();
86
87 // Parses command line param values for dbus subsystem that should be
88 // un-stubbed.
89 static DBusClientTypeMask ParseUnstubList(const std::string& unstub_list);
90
91 BluetoothAdapterClient* bluetooth_adapter_client() {
92 return bluetooth_adapter_client_.get();
93 }
94
95 BluetoothAgentManagerClient* bluetooth_agent_manager_client() {
96 return bluetooth_agent_manager_client_.get();
97 }
98
99 BluetoothDeviceClient* bluetooth_device_client() {
100 return bluetooth_device_client_.get();
101 }
102
103 BluetoothGattCharacteristicClient* bluetooth_gatt_characteristic_client() {
104 return bluetooth_gatt_characteristic_client_.get();
105 }
106
107 BluetoothGattDescriptorClient* bluetooth_gatt_descriptor_client() {
108 return bluetooth_gatt_descriptor_client_.get();
109
110 }
111 BluetoothGattManagerClient* bluetooth_gatt_manager_client() {
112 return bluetooth_gatt_manager_client_.get();
113 }
114
115 BluetoothGattServiceClient* bluetooth_gatt_service_client() {
116 return bluetooth_gatt_service_client_.get();
117 }
118
119 BluetoothInputClient* bluetooth_input_client() {
120 return bluetooth_input_client_.get();
121 }
122
123 BluetoothProfileManagerClient* bluetooth_profile_manager_client() {
124 return bluetooth_profile_manager_client_.get();
125 }
126
127 CrasAudioClient* cras_audio_client() {
128 return cras_audio_client_.get();
129 }
130
131 CrosDisksClient* cros_disks_client() {
132 return cros_disks_client_.get();
133 }
134
135 CryptohomeClient* cryptohome_client() {
136 return cryptohome_client_.get();
137 }
138
139 DebugDaemonClient* debug_daemon_client() {
140 return debug_daemon_client_.get();
141 }
142
143 EasyUnlockClient* easy_unlock_client() {
144 return easy_unlock_client_.get();
145 }
146
147 LorgnetteManagerClient* lorgnette_manager_client() {
148 return lorgnette_manager_client_.get();
149 }
150
151 ShillDeviceClient* shill_device_client() {
152 return shill_device_client_.get();
153 }
154
155 ShillIPConfigClient* shill_ipconfig_client() {
156 return shill_ipconfig_client_.get();
157 }
158
159 ShillManagerClient* shill_manager_client() {
160 return shill_manager_client_.get();
161 }
162
163 ShillServiceClient* shill_service_client() {
164 return shill_service_client_.get();
165 }
166
167 ShillProfileClient* shill_profile_client() {
168 return shill_profile_client_.get();
169 }
170
171 GsmSMSClient* gsm_sms_client() {
172 return gsm_sms_client_.get();
173 }
174
175 ImageBurnerClient* image_burner_client() {
176 return image_burner_client_.get();
177 }
178
179 IntrospectableClient* introspectable_client() {
180 return introspectable_client_.get();
181 }
182
183 ModemMessagingClient* modem_messaging_client() {
184 return modem_messaging_client_.get();
185 }
186
187 NfcManagerClient* nfc_manager_client() {
188 return nfc_manager_client_.get();
189 }
190
191 NfcAdapterClient* nfc_adapter_client() {
192 return nfc_adapter_client_.get();
193 }
194
195 NfcDeviceClient* nfc_device_client() {
196 return nfc_device_client_.get();
197 }
198
199 NfcTagClient* nfc_tag_client() {
200 return nfc_tag_client_.get();
201 }
202
203 NfcRecordClient* nfc_record_client() {
204 return nfc_record_client_.get();
205 }
206
207 PermissionBrokerClient* permission_broker_client() {
208 return permission_broker_client_.get();
209 }
210
211 SystemClockClient* system_clock_client() {
212 return system_clock_client_.get();
213 }
214
215 PowerManagerClient* power_manager_client() {
216 return power_manager_client_.get();
217 }
218
219 SessionManagerClient* session_manager_client() {
220 return session_manager_client_.get();
221 }
222
223 SMSClient* sms_client() {
224 return sms_client_.get();
225 }
226
227 UpdateEngineClient* update_engine_client() {
228 return update_engine_client_.get();
229 }
230
231 private:
232 scoped_ptr<BluetoothAdapterClient> bluetooth_adapter_client_;
233 scoped_ptr<BluetoothAgentManagerClient> bluetooth_agent_manager_client_;
234 scoped_ptr<BluetoothDeviceClient> bluetooth_device_client_;
235 scoped_ptr<BluetoothGattCharacteristicClient>
236 bluetooth_gatt_characteristic_client_;
237 scoped_ptr<BluetoothGattDescriptorClient> bluetooth_gatt_descriptor_client_;
238 scoped_ptr<BluetoothGattManagerClient> bluetooth_gatt_manager_client_;
239 scoped_ptr<BluetoothGattServiceClient> bluetooth_gatt_service_client_;
240 scoped_ptr<BluetoothInputClient> bluetooth_input_client_;
241 scoped_ptr<BluetoothProfileManagerClient> bluetooth_profile_manager_client_;
242 scoped_ptr<CrasAudioClient> cras_audio_client_;
243 scoped_ptr<CrosDisksClient> cros_disks_client_;
244 scoped_ptr<CryptohomeClient> cryptohome_client_;
245 scoped_ptr<DebugDaemonClient> debug_daemon_client_;
246 scoped_ptr<EasyUnlockClient> easy_unlock_client_;
247 scoped_ptr<LorgnetteManagerClient> lorgnette_manager_client_;
248 scoped_ptr<ShillDeviceClient> shill_device_client_;
249 scoped_ptr<ShillIPConfigClient> shill_ipconfig_client_;
250 scoped_ptr<ShillManagerClient> shill_manager_client_;
251 scoped_ptr<ShillServiceClient> shill_service_client_;
252 scoped_ptr<ShillProfileClient> shill_profile_client_;
253 scoped_ptr<GsmSMSClient> gsm_sms_client_;
254 scoped_ptr<ImageBurnerClient> image_burner_client_;
255 scoped_ptr<IntrospectableClient> introspectable_client_;
256 scoped_ptr<ModemMessagingClient> modem_messaging_client_;
257 // The declaration order for NFC client objects is important. See
258 // DBusThreadManager::CreateDefaultClients for the dependencies.
259 scoped_ptr<NfcManagerClient> nfc_manager_client_;
260 scoped_ptr<NfcAdapterClient> nfc_adapter_client_;
261 scoped_ptr<NfcDeviceClient> nfc_device_client_;
262 scoped_ptr<NfcTagClient> nfc_tag_client_;
263 scoped_ptr<NfcRecordClient> nfc_record_client_;
264 scoped_ptr<PermissionBrokerClient> permission_broker_client_;
265 scoped_ptr<SystemClockClient> system_clock_client_;
266 scoped_ptr<PowerManagerClient> power_manager_client_;
267 scoped_ptr<SessionManagerClient> session_manager_client_;
268 scoped_ptr<SMSClient> sms_client_;
269 scoped_ptr<UpdateEngineClient> update_engine_client_;
270
271 DISALLOW_COPY_AND_ASSIGN(DBusClientBundle);
272 };
273
274 } // namespace chromeos
275
276 #endif // CHROMEOS_DBUS_DBUS_CLIENT_BUNDLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698