| Index: device/bluetooth/bluez/bluetooth_local_gatt_characteristic_bluez.h
|
| diff --git a/device/bluetooth/bluez/bluetooth_local_gatt_characteristic_bluez.h b/device/bluetooth/bluez/bluetooth_local_gatt_characteristic_bluez.h
|
| index 466d67debc8b44e2e42d5eccfbec7891d9435e6c..220b2e8bb60645534707b8da13d61efb4f9f6ca1 100644
|
| --- a/device/bluetooth/bluez/bluetooth_local_gatt_characteristic_bluez.h
|
| +++ b/device/bluetooth/bluez/bluetooth_local_gatt_characteristic_bluez.h
|
| @@ -5,11 +5,15 @@
|
| #ifndef DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_LOCAL_GATT_CHARACTERISTIC_BLUEZ_H_
|
| #define DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_LOCAL_GATT_CHARACTERISTIC_BLUEZ_H_
|
|
|
| +#include <vector>
|
| +
|
| #include "base/macros.h"
|
| #include "base/memory/weak_ptr.h"
|
| -#include "dbus/object_path.h"
|
| #include "device/bluetooth/bluetooth_local_gatt_characteristic.h"
|
| +#include "device/bluetooth/bluetooth_local_gatt_service.h"
|
| +#include "device/bluetooth/bluetooth_uuid.h"
|
| #include "device/bluetooth/bluez/bluetooth_gatt_characteristic_bluez.h"
|
| +#include "device/bluetooth/bluez/bluetooth_local_gatt_descriptor_bluez.h"
|
|
|
| namespace bluez {
|
|
|
| @@ -22,13 +26,45 @@ class BluetoothLocalGattCharacteristicBlueZ
|
| : public BluetoothGattCharacteristicBlueZ,
|
| public device::BluetoothLocalGattCharacteristic {
|
| public:
|
| - private:
|
| - friend class BluetoothLocalGattServiceBlueZ;
|
| + static base::WeakPtr<device::BluetoothLocalGattCharacteristic> Create(
|
| + const device::BluetoothUUID& uuid,
|
| + BluetoothGattCharacteristic::Properties properties,
|
| + BluetoothGattCharacteristic::Permissions permissions,
|
| + device::BluetoothLocalGattService* service);
|
|
|
| - BluetoothLocalGattCharacteristicBlueZ(BluetoothLocalGattServiceBlueZ* service,
|
| - const dbus::ObjectPath& object_path);
|
| + BluetoothLocalGattCharacteristicBlueZ(
|
| + const device::BluetoothUUID& uuid,
|
| + BluetoothLocalGattServiceBlueZ* service);
|
| ~BluetoothLocalGattCharacteristicBlueZ() override;
|
|
|
| + // device::BluetoothLocalGattCharacteristic overrides.
|
| + device::BluetoothUUID GetUUID() const override;
|
| + Properties GetProperties() const override;
|
| + Permissions GetPermissions() const override;
|
| +
|
| + BluetoothLocalGattServiceBlueZ* GetService();
|
| +
|
| + const std::vector<std::unique_ptr<BluetoothLocalGattDescriptorBlueZ>>&
|
| + GetDescriptors() const;
|
| +
|
| + private:
|
| + friend class BluetoothLocalGattDescriptorBlueZ;
|
| + // Needs access to weak_ptr_factory_.
|
| + friend device::BluetoothLocalGattCharacteristic;
|
| +
|
| + // Adds a descriptor to this characteristic.
|
| + void AddDescriptor(
|
| + std::unique_ptr<BluetoothLocalGattDescriptorBlueZ> descriptor);
|
| +
|
| + // UUID of this characteristic.
|
| + device::BluetoothUUID uuid_;
|
| +
|
| + // Service that contains this characteristic.
|
| + BluetoothLocalGattServiceBlueZ* service_;
|
| +
|
| + // Descriptors contained by this characteristic.
|
| + std::vector<std::unique_ptr<BluetoothLocalGattDescriptorBlueZ>> descriptors_;
|
| +
|
| // Note: This should remain the last member so it'll be destroyed and
|
| // invalidate its weak pointers before any other members are destroyed.
|
| base::WeakPtrFactory<BluetoothLocalGattCharacteristicBlueZ> weak_ptr_factory_;
|
|
|