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

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

Issue 2400943002: bluetooth: Reject with NetworkError when disconnected during getPrimaryService(s) (Closed)
Patch Set: 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/getPrimaryServices/reconnect-during-with-uuid.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/BluetoothRemoteGATTServer.cpp
diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.cpp b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.cpp
index a9664712bfb5063a6b2dfd0361d52024e9ee55cf..37289c99a1c8ff96f8ee369757a55ecbb3eba554 100644
--- a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.cpp
+++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.cpp
@@ -162,14 +162,19 @@ class GetPrimaryServicesCallback
m_resolver->getExecutionContext()->activeDOMObjectsAreStopped())
return;
- m_device->gatt()->RemoveFromActiveAlgorithms(m_resolver.get());
+ if (!m_device->gatt()->RemoveFromActiveAlgorithms(m_resolver.get())) {
+ m_resolver->reject(
+ DOMException::create(NetworkError, kGATTServerDisconnected));
+ return;
+ }
+
m_resolver->reject(BluetoothError::take(m_resolver, error));
}
private:
Persistent<BluetoothDevice> m_device;
mojom::blink::WebBluetoothGATTQueryQuantity m_quantity;
- Persistent<ScriptPromiseResolver> m_resolver;
+ const Persistent<ScriptPromiseResolver> m_resolver;
};
ScriptPromise BluetoothRemoteGATTServer::getPrimaryService(
« no previous file with comments | « third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/reconnect-during-with-uuid.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698