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

Side by Side Diff: device/bluetooth/dbus/bluetooth_dbus_client_bundle.h

Issue 1347193004: Refactor DBusThreadManager to split away BT clients. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef DEVICE_BLUETOOTH_DBUS_BLUETOOTH_DBUS_CLIENT_BUNDLE_H_
6 #define DEVICE_BLUETOOTH_DBUS_BLUETOOTH_DBUS_CLIENT_BUNDLE_H_
7
8 #include <string>
9
10 #include "base/memory/scoped_ptr.h"
11 #include "device/bluetooth/bluetooth_export.h"
12
13 namespace bluez {
14
15 class BluetoothAdapterClient;
16 class BluetoothAgentManagerClient;
17 class BluetoothDeviceClient;
18 class BluetoothGattCharacteristicClient;
19 class BluetoothGattDescriptorClient;
20 class BluetoothGattManagerClient;
21 class BluetoothGattServiceClient;
22 class BluetoothInputClient;
23 class BluetoothLEAdvertisingManagerClient;
24 class BluetoothMediaClient;
25 class BluetoothMediaTransportClient;
26 class BluetoothProfileManagerClient;
27
28 // The bundle of all D-Bus clients used in DBusThreadManager. The bundle
29 // is used to delete them at once in the right order before shutting down the
30 // system bus. See also the comment in the destructor of DBusThreadManager.
31 class DEVICE_BLUETOOTH_EXPORT BluetoothDBusClientBundle {
32 public:
33 explicit BluetoothDBusClientBundle(bool use_stubs);
34 ~BluetoothDBusClientBundle();
35
36 // Returns true if |client| is stubbed.
37 bool IsUsingStub() { return use_stubs_; }
38
39 BluetoothAdapterClient* bluetooth_adapter_client() {
40 return bluetooth_adapter_client_.get();
41 }
42
43 BluetoothLEAdvertisingManagerClient*
44 bluetooth_le_advertising_manager_client() {
45 return bluetooth_le_advertising_manager_client_.get();
46 }
47
48 BluetoothAgentManagerClient* bluetooth_agent_manager_client() {
49 return bluetooth_agent_manager_client_.get();
50 }
51
52 BluetoothDeviceClient* bluetooth_device_client() {
53 return bluetooth_device_client_.get();
54 }
55
56 BluetoothGattCharacteristicClient* bluetooth_gatt_characteristic_client() {
57 return bluetooth_gatt_characteristic_client_.get();
58 }
59
60 BluetoothGattDescriptorClient* bluetooth_gatt_descriptor_client() {
61 return bluetooth_gatt_descriptor_client_.get();
62 }
63
64 BluetoothGattManagerClient* bluetooth_gatt_manager_client() {
65 return bluetooth_gatt_manager_client_.get();
66 }
67
68 BluetoothGattServiceClient* bluetooth_gatt_service_client() {
69 return bluetooth_gatt_service_client_.get();
70 }
71
72 BluetoothInputClient* bluetooth_input_client() {
73 return bluetooth_input_client_.get();
74 }
75
76 BluetoothMediaClient* bluetooth_media_client() {
77 return bluetooth_media_client_.get();
78 }
79
80 BluetoothMediaTransportClient* bluetooth_media_transport_client() {
81 return bluetooth_media_transport_client_.get();
82 }
83
84 BluetoothProfileManagerClient* bluetooth_profile_manager_client() {
85 return bluetooth_profile_manager_client_.get();
86 }
87
88 private:
89 friend class BluezDBusManagerSetter;
90
91 bool use_stubs_;
92
93 scoped_ptr<BluetoothAdapterClient> bluetooth_adapter_client_;
94 scoped_ptr<BluetoothLEAdvertisingManagerClient>
95 bluetooth_le_advertising_manager_client_;
96 scoped_ptr<BluetoothAgentManagerClient> bluetooth_agent_manager_client_;
97 scoped_ptr<BluetoothDeviceClient> bluetooth_device_client_;
98 scoped_ptr<BluetoothGattCharacteristicClient>
99 bluetooth_gatt_characteristic_client_;
100 scoped_ptr<BluetoothGattDescriptorClient> bluetooth_gatt_descriptor_client_;
101 scoped_ptr<BluetoothGattManagerClient> bluetooth_gatt_manager_client_;
102 scoped_ptr<BluetoothGattServiceClient> bluetooth_gatt_service_client_;
103 scoped_ptr<BluetoothInputClient> bluetooth_input_client_;
104 scoped_ptr<BluetoothMediaClient> bluetooth_media_client_;
105 scoped_ptr<BluetoothMediaTransportClient> bluetooth_media_transport_client_;
106 scoped_ptr<BluetoothProfileManagerClient> bluetooth_profile_manager_client_;
107
108 DISALLOW_COPY_AND_ASSIGN(BluetoothDBusClientBundle);
109 };
110
111 } // namespace bluez
112
113 #endif // DEVICE_BLUETOOTH_DBUS_BLUETOOTH_DBUS_CLIENT_BUNDLE_H_
OLDNEW
« no previous file with comments | « device/bluetooth/dbus/bluetooth_agent_service_provider.cc ('k') | device/bluetooth/dbus/bluetooth_dbus_client_bundle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698