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 911c42e6601f39dfa27721a1d39c66308406a42b..2f021ae1b2f6392fd8c3613d831d848af3855d85 100644 |
| --- a/device/bluetooth/bluez/bluetooth_device_bluez.h |
| +++ b/device/bluetooth/bluez/bluetooth_device_bluez.h |
| @@ -18,7 +18,6 @@ |
| #include "device/bluetooth/bluetooth_common.h" |
| #include "device/bluetooth/bluetooth_device.h" |
| #include "device/bluetooth/bluetooth_export.h" |
| -#include "device/bluetooth/dbus/bluetooth_device_client.h" |
| #include "device/bluetooth/dbus/bluetooth_gatt_service_client.h" |
| namespace device { |
| @@ -40,7 +39,6 @@ class BluetoothServiceRecordBlueZ; |
| // thread. |
| class DEVICE_BLUETOOTH_EXPORT BluetoothDeviceBlueZ |
| : public device::BluetoothDevice, |
| - public bluez::BluetoothDeviceClient::Observer, |
| public bluez::BluetoothGattServiceClient::Observer { |
| public: |
| // BluetoothDevice override |
| @@ -133,10 +131,6 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothDeviceBlueZ |
| scoped_refptr<device::BluetoothSocketThread> socket_thread); |
| ~BluetoothDeviceBlueZ() override; |
| - // 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; |
| @@ -144,7 +138,13 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothDeviceBlueZ |
| // Called by the constructor to initialize the map of GATT services associated |
| // with this device and to invoke NotifyGattDiscoveryComplete() with each |
| // cached service. |
| - void InitializeGattServiceMap(); |
| + void InitializeGattServicesMap(); |
| + |
| + // Called once all services have been discovered. Invokes |
| + // NotifyGattDiscoveryComplete() for services for which we haven't notified |
| + // before e.g. if a services is exposed during construction but services |
| + // haven't been resolved yet.. |
| + void UpdateGattServices(const dbus::ObjectPath& object_path); |
|
vudentz
2016/07/04 11:04:03
Looks like I missed the introduction of this metho
ortuno
2016/07/06 21:31:46
Good catch. Done.
|
| // Called by dbus:: on completion of the D-Bus method call to get the |
| // connection attributes of the current connection to the device. |
| @@ -220,16 +220,15 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothDeviceBlueZ |
| // RSSI and TX power. |
| bool connection_monitor_started_; |
| + // Keeps track of all services for which we've called |
| + // NotifyGattDiscoveryComplete(). |
| + std::unordered_set<device::BluetoothRemoteGattService*> |
| + discovery_complete_notified_; |
| + |
| // UI thread task runner and socket thread object used to create sockets. |
| 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 |