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

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

Issue 2105423003: bluetooth: Update the map of GATT services when services resolve (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Address Luiz's and scheib's comments Created 4 years, 6 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
« no previous file with comments | « device/bluetooth/bluez/bluetooth_adapter_bluez.cc ('k') | device/bluetooth/bluez/bluetooth_device_bluez.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « device/bluetooth/bluez/bluetooth_adapter_bluez.cc ('k') | device/bluetooth/bluez/bluetooth_device_bluez.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698