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

Unified Diff: third_party/WebKit/Source/modules/bluetooth/BluetoothAttributeInstanceMap.h

Issue 2478013002: bluetooth: Invalidate services upon disconnection (Closed)
Patch Set: Address scheib's comments Created 4 years, 1 month 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: third_party/WebKit/Source/modules/bluetooth/BluetoothAttributeInstanceMap.h
diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothAttributeInstanceMap.h b/third_party/WebKit/Source/modules/bluetooth/BluetoothAttributeInstanceMap.h
index aeeddede9e482ecfcabae6abbb3b098ce25a5033..cb82118dc437a39d63a7e4ab869e9569c9b903a4 100644
--- a/third_party/WebKit/Source/modules/bluetooth/BluetoothAttributeInstanceMap.h
+++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothAttributeInstanceMap.h
@@ -25,11 +25,21 @@ class BluetoothAttributeInstanceMap final
public:
BluetoothAttributeInstanceMap(BluetoothDevice*);
+ // Constructs a new BluetoothRemoteGATTService object if there was
+ // no service with the same instance id and adds it to the map.
+ // Otherwise returns the BluetoothRemoteGATTService object already
+ // in the map.
BluetoothRemoteGATTService* getOrCreateBluetoothRemoteGATTService(
std::unique_ptr<WebBluetoothRemoteGATTService>);
- // TODO(crbug.com/654950): Implement methods to retrieve all attributes
- // associated with the device.
+ // Returns true if a BluetoothRemoteGATTService with |serviceInstanceId|
+ // is in the map.
+ bool containsService(const String& serviceInstanceId);
+
+ // Removes all Attributes from the map.
+ // TODO(crbug.com/654950): Remove characteristics and descriptors when
+ // implemented.
+ void Clear();
DECLARE_VIRTUAL_TRACE();

Powered by Google App Engine
This is Rietveld 408576698