| Index: third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.h
|
| diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.h b/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.h
|
| index 87c9ab816561293dff707ebf5c347e32e69e7575..6f6fdaa395f7c1eaec7506a6071569f0962ece4c 100644
|
| --- a/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.h
|
| +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.h
|
| @@ -48,6 +48,7 @@ class BluetoothDevice final : public EventTargetWithInlineData,
|
|
|
| BluetoothRemoteGATTService* getOrCreateBluetoothRemoteGATTService(
|
| std::unique_ptr<WebBluetoothRemoteGATTService>);
|
| + bool isValidService(const String& serviceInstanceId);
|
|
|
| // We should disconnect from the device in all of the following cases:
|
| // 1. When the object gets GarbageCollected e.g. it went out of scope.
|
| @@ -65,9 +66,15 @@ class BluetoothDevice final : public EventTargetWithInlineData,
|
| // ContextLifecycleObserver interface.
|
| void contextDestroyed() override;
|
|
|
| - // If gatt is connected then disconnects and sets gatt.connected to false.
|
| - // Returns true if gatt was disconnected.
|
| - bool disconnectGATTIfConnected();
|
| + // If gatt is connected then sets gatt.connected to false and disconnects.
|
| + // This function only performs the necessary steps to ensure a device
|
| + // disconnects therefore it should only be used when the object is being
|
| + // garbage collected or the context is being destroyed.
|
| + void disconnectGATTIfConnected();
|
| +
|
| + // Performs necessary cleanup when a device disconnects and fires
|
| + // gattserverdisconnected event.
|
| + void cleanupDisconnectedDeviceAndFireEvent();
|
|
|
| // EventTarget methods:
|
| const AtomicString& interfaceName() const override;
|
|
|