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

Unified Diff: third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.cpp

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/BluetoothRemoteGATTServer.cpp
diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.cpp b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.cpp
index 7a33a680bbad9d60282e39caf24f9d47843d3a0e..ca5b518442a24a7d2334afc5d9ee05d108a25240 100644
--- a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.cpp
+++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.cpp
@@ -100,13 +100,10 @@ ScriptPromise BluetoothRemoteGATTServer::connect(ScriptState* scriptState) {
void BluetoothRemoteGATTServer::disconnect(ScriptState* scriptState) {
if (!m_connected)
return;
- m_connected = false;
- ClearActiveAlgorithms();
+ device()->cleanupDisconnectedDeviceAndFireEvent();
WebBluetooth* webbluetooth =
BluetoothSupplement::fromScriptState(scriptState);
webbluetooth->disconnect(device()->id());
- device()->dispatchEvent(
- Event::createBubble(EventTypeNames::gattserverdisconnected));
}
// Class that allows us to resolve the promise with a single service or

Powered by Google App Engine
This is Rietveld 408576698