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

Side by Side Diff: chromeos/dbus/dbus_client_bundle.h

Issue 980973003: apmanager: Add dbus implementation to chromium. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased on conflicting change Created 5 years, 9 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
OLDNEW
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 <string> 8 #include <string>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "chromeos/chromeos_export.h" 11 #include "chromeos/chromeos_export.h"
12 12
13 namespace chromeos { 13 namespace chromeos {
14 14
15 class ApManagerClient;
15 class BluetoothAdapterClient; 16 class BluetoothAdapterClient;
16 class BluetoothAgentManagerClient; 17 class BluetoothAgentManagerClient;
17 class BluetoothDeviceClient; 18 class BluetoothDeviceClient;
18 class BluetoothGattCharacteristicClient; 19 class BluetoothGattCharacteristicClient;
19 class BluetoothGattDescriptorClient; 20 class BluetoothGattDescriptorClient;
20 class BluetoothGattManagerClient; 21 class BluetoothGattManagerClient;
21 class BluetoothGattServiceClient; 22 class BluetoothGattServiceClient;
22 class BluetoothInputClient; 23 class BluetoothInputClient;
23 class BluetoothMediaClient; 24 class BluetoothMediaClient;
24 class BluetoothMediaTransportClient; 25 class BluetoothMediaTransportClient;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 NFC = 1 << 12, 81 NFC = 1 << 12,
81 PERMISSION_BROKER = 1 << 13, 82 PERMISSION_BROKER = 1 << 13,
82 POWER_MANAGER = 1 << 14, 83 POWER_MANAGER = 1 << 14,
83 SESSION_MANAGER = 1 << 15, 84 SESSION_MANAGER = 1 << 15,
84 SMS = 1 << 16, 85 SMS = 1 << 16,
85 SYSTEM_CLOCK = 1 << 17, 86 SYSTEM_CLOCK = 1 << 17,
86 UPDATE_ENGINE = 1 << 18, 87 UPDATE_ENGINE = 1 << 18,
87 PEER_DAEMON = 1 << 19, 88 PEER_DAEMON = 1 << 19,
88 LEADERSHIP_DAEMON = 1 << 20, 89 LEADERSHIP_DAEMON = 1 << 20,
89 METRONOME = 1 << 21, 90 METRONOME = 1 << 21,
91 AP_MANAGER = 1 << 22,
90 }; 92 };
91 93
92 explicit DBusClientBundle(DBusClientTypeMask unstub_client_mask); 94 explicit DBusClientBundle(DBusClientTypeMask unstub_client_mask);
93 ~DBusClientBundle(); 95 ~DBusClientBundle();
94 96
95 // Returns true if |client| is stubbed. 97 // Returns true if |client| is stubbed.
96 bool IsUsingStub(DBusClientType client); 98 bool IsUsingStub(DBusClientType client);
97 99
98 // Returns true if any real DBusClient is used. 100 // Returns true if any real DBusClient is used.
99 bool IsUsingAnyRealClient(); 101 bool IsUsingAnyRealClient();
100 102
101 // Initialize proper runtime environment for its dbus clients. 103 // Initialize proper runtime environment for its dbus clients.
102 void SetupDefaultEnvironment(); 104 void SetupDefaultEnvironment();
103 105
104 // Parses command line param values for dbus subsystem that should be 106 // Parses command line param values for dbus subsystem that should be
105 // un-stubbed. 107 // un-stubbed.
106 static DBusClientTypeMask ParseUnstubList(const std::string& unstub_list); 108 static DBusClientTypeMask ParseUnstubList(const std::string& unstub_list);
107 109
110 ApManagerClient* ap_manager_client() { return ap_manager_client_.get(); }
111
108 BluetoothAdapterClient* bluetooth_adapter_client() { 112 BluetoothAdapterClient* bluetooth_adapter_client() {
109 return bluetooth_adapter_client_.get(); 113 return bluetooth_adapter_client_.get();
110 } 114 }
111 115
112 BluetoothAgentManagerClient* bluetooth_agent_manager_client() { 116 BluetoothAgentManagerClient* bluetooth_agent_manager_client() {
113 return bluetooth_agent_manager_client_.get(); 117 return bluetooth_agent_manager_client_.get();
114 } 118 }
115 119
116 BluetoothDeviceClient* bluetooth_device_client() { 120 BluetoothDeviceClient* bluetooth_device_client() {
117 return bluetooth_device_client_.get(); 121 return bluetooth_device_client_.get();
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 return update_engine_client_.get(); 271 return update_engine_client_.get();
268 } 272 }
269 273
270 private: 274 private:
271 friend class DBusThreadManagerSetter; 275 friend class DBusThreadManagerSetter;
272 276
273 // Bitmask that defines which dbus clients are not stubbed out. Bitmap flags 277 // Bitmask that defines which dbus clients are not stubbed out. Bitmap flags
274 // are defined within DBusClientType enum. 278 // are defined within DBusClientType enum.
275 DBusClientTypeMask unstub_client_mask_; 279 DBusClientTypeMask unstub_client_mask_;
276 280
281 scoped_ptr<ApManagerClient> ap_manager_client_;
277 scoped_ptr<BluetoothAdapterClient> bluetooth_adapter_client_; 282 scoped_ptr<BluetoothAdapterClient> bluetooth_adapter_client_;
278 scoped_ptr<BluetoothAgentManagerClient> bluetooth_agent_manager_client_; 283 scoped_ptr<BluetoothAgentManagerClient> bluetooth_agent_manager_client_;
279 scoped_ptr<BluetoothDeviceClient> bluetooth_device_client_; 284 scoped_ptr<BluetoothDeviceClient> bluetooth_device_client_;
280 scoped_ptr<BluetoothGattCharacteristicClient> 285 scoped_ptr<BluetoothGattCharacteristicClient>
281 bluetooth_gatt_characteristic_client_; 286 bluetooth_gatt_characteristic_client_;
282 scoped_ptr<BluetoothGattDescriptorClient> bluetooth_gatt_descriptor_client_; 287 scoped_ptr<BluetoothGattDescriptorClient> bluetooth_gatt_descriptor_client_;
283 scoped_ptr<BluetoothGattManagerClient> bluetooth_gatt_manager_client_; 288 scoped_ptr<BluetoothGattManagerClient> bluetooth_gatt_manager_client_;
284 scoped_ptr<BluetoothGattServiceClient> bluetooth_gatt_service_client_; 289 scoped_ptr<BluetoothGattServiceClient> bluetooth_gatt_service_client_;
285 scoped_ptr<BluetoothInputClient> bluetooth_input_client_; 290 scoped_ptr<BluetoothInputClient> bluetooth_input_client_;
286 scoped_ptr<BluetoothMediaClient> bluetooth_media_client_; 291 scoped_ptr<BluetoothMediaClient> bluetooth_media_client_;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 scoped_ptr<SessionManagerClient> session_manager_client_; 324 scoped_ptr<SessionManagerClient> session_manager_client_;
320 scoped_ptr<SMSClient> sms_client_; 325 scoped_ptr<SMSClient> sms_client_;
321 scoped_ptr<UpdateEngineClient> update_engine_client_; 326 scoped_ptr<UpdateEngineClient> update_engine_client_;
322 327
323 DISALLOW_COPY_AND_ASSIGN(DBusClientBundle); 328 DISALLOW_COPY_AND_ASSIGN(DBusClientBundle);
324 }; 329 };
325 330
326 } // namespace chromeos 331 } // namespace chromeos
327 332
328 #endif // CHROMEOS_DBUS_DBUS_CLIENT_BUNDLE_H_ 333 #endif // CHROMEOS_DBUS_DBUS_CLIENT_BUNDLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698