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

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

Issue 2650003005: Mark Bluetooth devices connected after they are actually connected (Closed)
Patch Set: mark Bluetooth devices connected after they are actually connected Created 3 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
« no previous file with comments | « third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.cpp ('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 853418168d8a1e2055ce9ec581cb9e3d331b5654..b2f4cde4bb37fc2066c53d5b2c9d50f5d50e7852 100644
--- a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.cpp
+++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.cpp
@@ -64,6 +64,7 @@ void BluetoothRemoteGATTServer::ConnectCallback(
return;
if (result == mojom::blink::WebBluetoothResult::SUCCESS) {
+ m_device->bluetooth()->addToConnectedDevicesMap(device()->id(), device());
setConnected(true);
resolver->resolve(this);
} else {
@@ -72,8 +73,6 @@ void BluetoothRemoteGATTServer::ConnectCallback(
}
ScriptPromise BluetoothRemoteGATTServer::connect(ScriptState* scriptState) {
- m_device->bluetooth()->addDevice(device()->id(), device());
-
ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState);
ScriptPromise promise = resolver->promise();
@@ -90,7 +89,7 @@ void BluetoothRemoteGATTServer::disconnect(ScriptState* scriptState) {
if (!m_connected)
return;
device()->cleanupDisconnectedDeviceAndFireEvent();
- m_device->bluetooth()->removeDevice(device()->id());
+ m_device->bluetooth()->removeFromConnectedDevicesMap(device()->id());
mojom::blink::WebBluetoothService* service = m_device->bluetooth()->service();
service->RemoteServerDisconnect(device()->id());
}
« no previous file with comments | « third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698