Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_GATT_CHARACTERISTIC_BLUEZ_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_GATT_CHARACTERISTIC_BLUEZ_H_ |
| 6 #define DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_GATT_CHARACTERISTIC_BLUEZ_H_ | 6 #define DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_GATT_CHARACTERISTIC_BLUEZ_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "dbus/object_path.h" | 12 #include "dbus/object_path.h" |
| 13 #include "device/bluetooth/bluetooth_gatt_characteristic.h" | 13 #include "device/bluetooth/bluetooth_gatt_characteristic.h" |
| 14 | 14 |
| 15 namespace bluez { | 15 namespace bluez { |
| 16 | 16 |
| 17 // The BluetoothGattCharacteristicBlueZ class implements | 17 // The BluetoothGattCharacteristicBlueZ class implements |
| 18 // BluetoothRemoteGattCharacteristic for GATT characteristics for platforms | 18 // BluetoothRemoteGattCharacteristic for GATT characteristics for platforms |
| 19 // that use BlueZ. | 19 // that use BlueZ. |
| 20 class BluetoothGattCharacteristicBlueZ | 20 class BluetoothGattCharacteristicBlueZ |
| 21 : public virtual device::BluetoothGattCharacteristic { | 21 : public virtual device::BluetoothGattCharacteristic { |
| 22 public: | 22 public: |
| 23 // device::BluetoothGattCharacteristic overrides. | 23 // device::BluetoothGattCharacteristic overrides. |
| 24 std::string GetIdentifier() const override; | 24 std::string GetIdentifier() const override; |
| 25 | 25 |
| 26 // Object path of the underlying D-Bus characteristic. | 26 // Object path of the underlying D-Bus characteristic. |
| 27 const dbus::ObjectPath& object_path() const { return object_path_; } | 27 const dbus::ObjectPath& object_path() const { return object_path_; } |
| 28 | 28 |
| 29 protected: | 29 protected: |
| 30 explicit BluetoothGattCharacteristicBlueZ( | 30 BluetoothGattCharacteristicBlueZ(); |
|
scheib
2016/04/28 01:06:24
I mentioned in the earlier patch (before splitting
rkc
2016/04/28 02:06:57
Done.
| |
| 31 const dbus::ObjectPath& object_path); | |
| 32 ~BluetoothGattCharacteristicBlueZ() override; | 31 ~BluetoothGattCharacteristicBlueZ() override; |
| 33 | 32 |
| 34 private: | |
| 35 // Object path of the D-Bus characteristic object. | 33 // Object path of the D-Bus characteristic object. |
| 36 dbus::ObjectPath object_path_; | 34 dbus::ObjectPath object_path_; |
| 37 | 35 |
| 36 private: | |
| 38 // Note: This should remain the last member so it'll be destroyed and | 37 // Note: This should remain the last member so it'll be destroyed and |
| 39 // invalidate its weak pointers before any other members are destroyed. | 38 // invalidate its weak pointers before any other members are destroyed. |
| 40 base::WeakPtrFactory<BluetoothGattCharacteristicBlueZ> weak_ptr_factory_; | 39 base::WeakPtrFactory<BluetoothGattCharacteristicBlueZ> weak_ptr_factory_; |
| 41 | 40 |
| 42 DISALLOW_COPY_AND_ASSIGN(BluetoothGattCharacteristicBlueZ); | 41 DISALLOW_COPY_AND_ASSIGN(BluetoothGattCharacteristicBlueZ); |
| 43 }; | 42 }; |
| 44 | 43 |
| 45 } // namespace bluez | 44 } // namespace bluez |
| 46 | 45 |
| 47 #endif // DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_GATT_CHARACTERISTIC_BLUEZ_H_ | 46 #endif // DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_GATT_CHARACTERISTIC_BLUEZ_H_ |
| OLD | NEW |