Commit bed1fe1d authored by David Lechner's avatar David Lechner Committed by Commit Bot

[bluetooth] enable writeValueWith[out]Response on supported platforms

This enables the new Web Bluetooth BluetoothRemoteGattCharacteristic
writeValueWithResponse() and writeValueWithoutResponse() APIs on Win10,
Mac, Android and ChromeOS.

This has LGTM3 from blink-dev.
https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/1JE8tjylY3s

Bug: 672648
Change-Id: Iebcdb0c6c7daeb3aa230f0ec511a805655a0cdaa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2220694Reviewed-by: default avatarMike West <mkwst@chromium.org>
Commit-Queue: David Lechner <david@pybricks.com>
Cr-Commit-Position: refs/heads/master@{#774613}
parent 019b0188
......@@ -59,8 +59,11 @@ void SetRuntimeFeatureDefaultsForPlatform(
WebRuntimeFeatures::EnableCompositedSelectionUpdate(true);
#endif
#if defined(OS_WIN)
if (base::win::GetVersion() >= base::win::Version::WIN10)
if (base::win::GetVersion() >= base::win::Version::WIN10) {
WebRuntimeFeatures::EnableWebBluetooth(true);
WebRuntimeFeatures::EnableWebBluetoothRemoteCharacteristicNewWriteValue(
true);
}
#endif
#if defined(SUPPORT_WEBGL2_COMPUTE_CONTEXT)
......
......@@ -173,6 +173,8 @@ class WebRuntimeFeatures {
BLINK_PLATFORM_EXPORT static void
EnableWebAuthenticationGetAssertionFeaturePolicy(bool);
BLINK_PLATFORM_EXPORT static void EnableWebBluetooth(bool);
BLINK_PLATFORM_EXPORT static void
EnableWebBluetoothRemoteCharacteristicNewWriteValue(bool);
BLINK_PLATFORM_EXPORT static void EnableWebBluetoothScanning(bool);
BLINK_PLATFORM_EXPORT static void EnableWebGL2ComputeContext(bool);
BLINK_PLATFORM_EXPORT static void EnableWebGLDraftExtensions(bool);
......
......@@ -58,6 +58,12 @@ void WebRuntimeFeatures::EnableWebBluetooth(bool enable) {
RuntimeEnabledFeatures::SetWebBluetoothEnabled(enable);
}
void WebRuntimeFeatures::EnableWebBluetoothRemoteCharacteristicNewWriteValue(
bool enable) {
RuntimeEnabledFeatures::
SetWebBluetoothRemoteCharacteristicNewWriteValueEnabled(enable);
}
void WebRuntimeFeatures::EnableWebBluetoothScanning(bool enable) {
RuntimeEnabledFeatures::SetWebBluetoothScanningEnabled(enable);
}
......
......@@ -1907,7 +1907,12 @@
},
{
name: "WebBluetoothRemoteCharacteristicNewWriteValue",
status: "experimental",
status: {
"Android": "stable",
"ChromeOS": "stable",
"MacOSX": "stable",
"default": "experimental",
},
},
{
name: "WebBluetoothScanning",
......
......@@ -42,6 +42,8 @@ interface BluetoothRemoteGATTCharacteristic : EventTarget
method startNotifications
method stopNotifications
method writeValue
method writeValueWithResponse
method writeValueWithoutResponse
setter oncharacteristicvaluechanged
interface BluetoothRemoteGATTDescriptor
attribute @@toStringTag
......
......@@ -42,6 +42,8 @@ interface BluetoothRemoteGATTCharacteristic : EventTarget
method startNotifications
method stopNotifications
method writeValue
method writeValueWithResponse
method writeValueWithoutResponse
setter oncharacteristicvaluechanged
interface BluetoothRemoteGATTDescriptor
attribute @@toStringTag
......
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