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

Unified Diff: device/bluetooth/bluez/bluetooth_device_bluez.h

Issue 1979633004: Invoke GattDiscoveryCompleteForService by observing ServicesResolved property (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_attr
Patch Set: Update comments. Created 4 years, 7 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/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.

Powered by Google App Engine
This is Rietveld 408576698