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

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

Issue 2443063002: bluetooth: Require frame to be connected for stopNotifications to succeed. (Closed)
Patch Set: Fix test expectations Created 4 years, 2 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 | « third_party/WebKit/LayoutTests/bluetooth/stopNotifications/reconnect-during-success.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.cpp
diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.cpp b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.cpp
index 6ca66b2e66188fa85b0b1c404940edf86f35e5c9..df461634afbf54149e8873b58ca8a530ff6c5fc5 100644
--- a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.cpp
+++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.cpp
@@ -355,6 +355,12 @@ ScriptPromise BluetoothRemoteGATTCharacteristic::stopNotifications(
"yet. See https://goo.gl/J6ASzs"));
#endif // OS(MACOSX)
+ if (!gatt()->connected()) {
+ return ScriptPromise::rejectWithDOMException(
+ scriptState,
+ DOMException::create(NetworkError, kGATTServerNotConnected));
+ }
+
WebBluetooth* webbluetooth =
BluetoothSupplement::fromScriptState(scriptState);
ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState);
« no previous file with comments | « third_party/WebKit/LayoutTests/bluetooth/stopNotifications/reconnect-during-success.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698