Chromium Code Reviews| Index: device/bluetooth/bluez/bluetooth_device_bluez.h |
| diff --git a/device/bluetooth/bluez/bluetooth_device_bluez.h b/device/bluetooth/bluez/bluetooth_device_bluez.h |
| index 293c2466b6dafe10bbf817fd9160660f3b179563..2c4bdb0f9bb8917ec96bcc8153713a01ab9375e8 100644 |
| --- a/device/bluetooth/bluez/bluetooth_device_bluez.h |
| +++ b/device/bluetooth/bluez/bluetooth_device_bluez.h |
| @@ -38,6 +38,7 @@ class BluetoothPairingBlueZ; |
| // thread. |
| class DEVICE_BLUETOOTH_EXPORT BluetoothDeviceBlueZ |
| : public device::BluetoothDevice, |
| + public bluez::BluetoothDeviceClient::Observer, |
| public bluez::BluetoothGattServiceClient::Observer { |
| public: |
| // BluetoothDevice override |
| @@ -124,10 +125,19 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothDeviceBlueZ |
| scoped_refptr<device::BluetoothSocketThread> socket_thread); |
| ~BluetoothDeviceBlueZ() override; |
| - // bluez::BluetoothGattServiceClient::Observer overrides. |
| + // bluez::BluetoothDeviceClient::Observer overrides |
| + void DevicePropertyChanged(const dbus::ObjectPath& object_path, |
| + const std::string& property_name) override; |
| + |
| + // bluez::BluetoothGattServiceClient::Observer overrides |
| void GattServiceAdded(const dbus::ObjectPath& object_path) override; |
| void GattServiceRemoved(const dbus::ObjectPath& object_path) override; |
| + // Called by the constructor and |DevicePropertyChanged()| to initialize the |
|
rkc
2016/05/17 18:38:50
Fix comment. We don't call this from DevicePropert
scheib
2016/05/17 19:24:47
Still, this is only called by the constructor, not
Miao
2016/05/18 03:26:58
Done.
|
| + // map of GATT services associated with this device and to invoke |
| + // NotifyGattDiscoveryComplete() with each cached service. |
| + void InitializeGattServiceMap(); |
| + |
| // Called by dbus:: on completion of the D-Bus method call to get the |
| // connection attributes of the current connection to the device. |
| void OnGetConnInfo(const ConnectionInfoCallback& callback, |
| @@ -206,6 +216,13 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothDeviceBlueZ |
| scoped_refptr<base::SequencedTaskRunner> ui_task_runner_; |
| scoped_refptr<device::BluetoothSocketThread> socket_thread_; |
| + // This vector temporarily caches the newly added services for later |
| + // notification of discovery complete. Once DevicePropertyChange is invoked |
| + // with a toggle of ServicesResolved property, the |
| + // NotifyGattDiscoveryComplete() will be called with each service once. |
| + std::vector<device::BluetoothRemoteGattService*> |
| + newly_discovered_gatt_services_; |
| + |
| // During pairing this is set to an object that we don't own, but on which |
| // we can make method calls to request, display or confirm PIN Codes and |
| // Passkeys. Generally it is the object that owns this one. |