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

Unified 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, 3 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
Index: device/bluetooth/dbus/bluetooth_dbus_client_bundle.h
diff --git a/device/bluetooth/dbus/bluetooth_dbus_client_bundle.h b/device/bluetooth/dbus/bluetooth_dbus_client_bundle.h
new file mode 100644
index 0000000000000000000000000000000000000000..bc1a63c5a35fa8b2255a6115b74c9473c628da95
--- /dev/null
+++ b/device/bluetooth/dbus/bluetooth_dbus_client_bundle.h
@@ -0,0 +1,113 @@
+// Copyright 2014 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 DEVICE_BLUETOOTH_DBUS_BLUETOOTH_DBUS_CLIENT_BUNDLE_H_
+#define DEVICE_BLUETOOTH_DBUS_BLUETOOTH_DBUS_CLIENT_BUNDLE_H_
+
+#include <string>
+
+#include "base/memory/scoped_ptr.h"
+#include "device/bluetooth/bluetooth_export.h"
+
+namespace bluez {
+
+class BluetoothAdapterClient;
+class BluetoothAgentManagerClient;
+class BluetoothDeviceClient;
+class BluetoothGattCharacteristicClient;
+class BluetoothGattDescriptorClient;
+class BluetoothGattManagerClient;
+class BluetoothGattServiceClient;
+class BluetoothInputClient;
+class BluetoothLEAdvertisingManagerClient;
+class BluetoothMediaClient;
+class BluetoothMediaTransportClient;
+class BluetoothProfileManagerClient;
+
+// The bundle of all D-Bus clients used in DBusThreadManager. The bundle
+// is used to delete them at once in the right order before shutting down the
+// system bus. See also the comment in the destructor of DBusThreadManager.
+class DEVICE_BLUETOOTH_EXPORT BluetoothDBusClientBundle {
+ public:
+ explicit BluetoothDBusClientBundle(bool use_stubs);
+ ~BluetoothDBusClientBundle();
+
+ // Returns true if |client| is stubbed.
+ bool IsUsingStub() { return use_stubs_; }
+
+ BluetoothAdapterClient* bluetooth_adapter_client() {
+ return bluetooth_adapter_client_.get();
+ }
+
+ BluetoothLEAdvertisingManagerClient*
+ bluetooth_le_advertising_manager_client() {
+ return bluetooth_le_advertising_manager_client_.get();
+ }
+
+ BluetoothAgentManagerClient* bluetooth_agent_manager_client() {
+ return bluetooth_agent_manager_client_.get();
+ }
+
+ BluetoothDeviceClient* bluetooth_device_client() {
+ return bluetooth_device_client_.get();
+ }
+
+ BluetoothGattCharacteristicClient* bluetooth_gatt_characteristic_client() {
+ return bluetooth_gatt_characteristic_client_.get();
+ }
+
+ BluetoothGattDescriptorClient* bluetooth_gatt_descriptor_client() {
+ return bluetooth_gatt_descriptor_client_.get();
+ }
+
+ BluetoothGattManagerClient* bluetooth_gatt_manager_client() {
+ return bluetooth_gatt_manager_client_.get();
+ }
+
+ BluetoothGattServiceClient* bluetooth_gatt_service_client() {
+ return bluetooth_gatt_service_client_.get();
+ }
+
+ BluetoothInputClient* bluetooth_input_client() {
+ return bluetooth_input_client_.get();
+ }
+
+ BluetoothMediaClient* bluetooth_media_client() {
+ return bluetooth_media_client_.get();
+ }
+
+ BluetoothMediaTransportClient* bluetooth_media_transport_client() {
+ return bluetooth_media_transport_client_.get();
+ }
+
+ BluetoothProfileManagerClient* bluetooth_profile_manager_client() {
+ return bluetooth_profile_manager_client_.get();
+ }
+
+ private:
+ friend class BluezDBusManagerSetter;
+
+ bool use_stubs_;
+
+ scoped_ptr<BluetoothAdapterClient> bluetooth_adapter_client_;
+ scoped_ptr<BluetoothLEAdvertisingManagerClient>
+ bluetooth_le_advertising_manager_client_;
+ scoped_ptr<BluetoothAgentManagerClient> bluetooth_agent_manager_client_;
+ scoped_ptr<BluetoothDeviceClient> bluetooth_device_client_;
+ scoped_ptr<BluetoothGattCharacteristicClient>
+ bluetooth_gatt_characteristic_client_;
+ scoped_ptr<BluetoothGattDescriptorClient> bluetooth_gatt_descriptor_client_;
+ scoped_ptr<BluetoothGattManagerClient> bluetooth_gatt_manager_client_;
+ scoped_ptr<BluetoothGattServiceClient> bluetooth_gatt_service_client_;
+ scoped_ptr<BluetoothInputClient> bluetooth_input_client_;
+ scoped_ptr<BluetoothMediaClient> bluetooth_media_client_;
+ scoped_ptr<BluetoothMediaTransportClient> bluetooth_media_transport_client_;
+ scoped_ptr<BluetoothProfileManagerClient> bluetooth_profile_manager_client_;
+
+ DISALLOW_COPY_AND_ASSIGN(BluetoothDBusClientBundle);
+};
+
+} // namespace bluez
+
+#endif // DEVICE_BLUETOOTH_DBUS_BLUETOOTH_DBUS_CLIENT_BUNDLE_H_
« 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