0
Files
src/content/browser/bluetooth
Alison Gale 923a33e9d5 Migrate TODOs referencing old crbug IDs to the new issue tracker IDs
The canonical bug format is TODO(crbug.com/<id>). TODOs of the
following forms will all be migrated to the new format:

- TODO(crbug.com/<old id>)
- TODO(https://crbug.com/<old id>)
- TODO(crbug/<old id>)
- TODO(crbug/monorail/<old id>)
- TODO(<old id>)
- TODO(issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/u/1/issues/<old id>)
- TODO(bugs.chromium.org/<old id>)

Bug id mapping is sourced from go/chrome-on-buganizer-prod-issues.
See go/crbug-todo-migration for details.

#crbug-todo-migration

Bug: b/321899722
Change-Id: Ib028de8bb63c99e5a81d90e24e422cf88061ad05
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5469583
Owners-Override: Alison Gale <agale@chromium.org>
Reviewed-by: Darryl James <dljames@chromium.org>
Commit-Queue: Alison Gale <agale@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1290952}
2024-04-22 23:34:28 +00:00
..

Web Bluetooth Service in Content

This directory contains the implementation of the Web Bluetooth specification using the Bluetooth abstraction module implemented in //device/bluetooth. See the Bluetooth Abstraction README for more details on the cross-platform implementation of Bluetooth in Chromium.

This service is exposed to the Web through the Blink Bluetooth module, which accesses the Web Bluetooth Service through Mojo IPC. For more details, see the Web Bluetooth Blink Module README.

Web Bluetooth Permissions

The legacy permissions system is implemented by bluetooth_allowed_devices.h, which is created per origin.

The new permissions system is implemented by providing an implementation for the //content/public/browser/bluetooth_delegate.h interface. In Chrome and WebLayer, the implementation of this interface is provided by //components/permissions/bluetooth_delegate_impl.h which forwards permission queries to //components/permissions/contexts/bluetooth_chooser_context.h. This class uses //components/permissions/chooser_context_base.h as the base. This base class is also in use by other device APIs, like WebUSB. The new permission system enables Web Bluetooth permissions to be persistent and to be exposed in the settings UI for users to manage more easily. For more details on the new permissions system, see the Web Bluetooth Persistent Permissions design document.

Secure Characteristics

The Bluetooth client implementation will authenticate (i.e. pair) when needed. This allows clients to read values that do not require pairing without going through the pairing process. In practice this means that pairing will be initiated during a read/write operation. Some operating system Bluetooth implementations (like macOS and Android) do this transparently for the application. Other OS's (like Windows and Linux/BlueZ) need to explicitly pair when a read/write fails due to an authentication error.

Testing

The Web Bluetooth Service is primarily tested using Blink Web Tests and Web Platform Tests. These tests are found in //third_party/blink/web_tests/bluetooth and //third_party/blink/web_tests/external/wpt/bluetooth. There is currently an ongoing effort to refactor the Web Bluetooth tests using the legacy BluetoothFakeAdapter test infrastructure to use the new FakeBluetooth Test API. For more details, see the Web Bluetooth Web Tests README and the Web Bluetooth Web Platform Tests README.

TODO(https://crbug.com/509038): Update this document when the remaining tests have been submitted to W3C Web Platform Tests.

The tests are run using content_shell, which fakes the Bluetooth related UI and the new permissions system. For more details, see the following files in //content/shell/browser/web_test:

Resources and Documentation

Mailing list: web-bluetooth@chromium.org

Bug tracker: Blink>Bluetooth

Design Documents