Commit 1928093a authored by James Hollyer's avatar James Hollyer Committed by Commit Bot

Notify developers of inefficiency to be fixed.

When BluetoothAdapter::Observer::GattCharacteristicValueChanged() is
called WebBluetoothServiceImpl notifies all
blink::BluetoothRemoteGattCharacteristic objects even if
startNotifications() has not been called or there are no listeners. This
is inefficient.

We have decided not to fix this at the moment but we wanted to put a
comment in the code so if anyone is working on that function in the
future they could be aware of this inefficiency and fix it if the change
becomes more straightforward.

Bug: 541390
Change-Id: Icfc54cb17ac76b856effbfac97af98574a6ee17a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1724588Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
Commit-Queue: James Hollyer <jameshollyer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#682070}
parent 3fdac126
...@@ -561,6 +561,9 @@ void WebBluetoothServiceImpl::GattCharacteristicValueChanged( ...@@ -561,6 +561,9 @@ void WebBluetoothServiceImpl::GattCharacteristicValueChanged(
return; return;
} }
// TODO(crbug.com/541390): Don't send notifications when they haven't been
// requested by the client.
// On Chrome OS and Linux, GattCharacteristicValueChanged is called before the // On Chrome OS and Linux, GattCharacteristicValueChanged is called before the
// success callback for ReadRemoteCharacteristic is called, which could result // success callback for ReadRemoteCharacteristic is called, which could result
// in an event being fired before the readValue promise is resolved. // in an event being fired before the readValue promise is resolved.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment