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

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

Issue 1527853002: bluetooth: Add disconnect function (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-device-identifier
Patch Set: Fix test that fails after upstream change. Created 4 years, 11 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
Index: third_party/WebKit/Source/modules/bluetooth/BluetoothGATTRemoteServer.cpp
diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothGATTRemoteServer.cpp b/third_party/WebKit/Source/modules/bluetooth/BluetoothGATTRemoteServer.cpp
index ed091b8aa92f0ba9e1bc624ed5cfb615efddbb70..862d903186b11a82d6c2120023a66aad0d3e2c91 100644
--- a/third_party/WebKit/Source/modules/bluetooth/BluetoothGATTRemoteServer.cpp
+++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothGATTRemoteServer.cpp
@@ -29,6 +29,13 @@ BluetoothGATTRemoteServer* BluetoothGATTRemoteServer::take(ScriptPromiseResolver
return new BluetoothGATTRemoteServer(webGATT);
}
+void BluetoothGATTRemoteServer::disconnect(ScriptState* scriptState)
+{
+ m_webGATT->connected = false;
+ WebBluetooth* webbluetooth = BluetoothSupplement::fromScriptState(scriptState);
+ webbluetooth->disconnect(m_webGATT->deviceId);
+}
+
ScriptPromise BluetoothGATTRemoteServer::getPrimaryService(ScriptState* scriptState, const StringOrUnsignedLong& service, ExceptionState& exceptionState)
{
WebBluetooth* webbluetooth = BluetoothSupplement::fromScriptState(scriptState);
@@ -39,7 +46,7 @@ ScriptPromise BluetoothGATTRemoteServer::getPrimaryService(ScriptState* scriptSt
ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState);
ScriptPromise promise = resolver->promise();
- webbluetooth->getPrimaryService(m_webGATT->deviceInstanceID, serviceUUID, new CallbackPromiseAdapter<BluetoothGATTService, BluetoothError>(resolver));
+ webbluetooth->getPrimaryService(m_webGATT->deviceId, serviceUUID, new CallbackPromiseAdapter<BluetoothGATTService, BluetoothError>(resolver));
return promise;
}

Powered by Google App Engine
This is Rietveld 408576698