New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 786407 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 696617



Sign in to add a comment

Should BlueTooth/USB requestDevice consume user gestures?

Project Member Reported by mustaq@chromium.org, Nov 17 2017

Issue description

Given that the user activation ("user gesture") state maintained in Blink expires after a few seconds, it seems unnecessary to /consume/ the state in BlueTooth::requestDevice and USB::requestDevice (vs just /checking/ the state).

None of the specs require the consumption behavior:
https://webbluetoothcg.github.io/web-bluetooth/#device-discovery
https://wicg.github.io/webusb/#device-requests

Does it sound reasonable then to switch requestDevice to "check" instead of to "consume" user activation?
 
Cc: -scheib@chromium.org
Project Member

Comment 2 by bugdroid1@chromium.org, Apr 6 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c4dfbae6d308b4f0a7140e71db3c7f6db01bdc3a

commit c4dfbae6d308b4f0a7140e71db3c7f6db01bdc3a
Author: Mustaq Ahmed <mustaq@google.com>
Date: Fri Apr 06 14:01:02 2018

Make BlueTooth/USB requestDevice non-consuming.

The specs for both WebBlueTooth & WebUSB only require a user
activation during a requestDevice call.  So consuming the activation
(vs just checking) is not a strong requirement.  There was a concern
that "not consuming" could possibly mean multiple choosers for a single
user activation but our browser code already handles the situation
gracefully.  Multiple requests to browser is possible from different
tabs anyway, even with (isolated) consumptions in individual tabs.

Therefore it makes sense to remove the consumption behavior here,
which is not spec-ed anyway.  This would fit our goal of a simple
user activation model ("UserActivationV2" project) which should be
simple enough for cross-browser implementation and for a complete spec.

Bug:  786407 
Change-Id: I3c9dbf43df34d4cb4a2a33214a6c44847fa7435b
Reviewed-on: https://chromium-review.googlesource.com/775866
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Giovanni Ortuño Urquidi <ortuno@chromium.org>
Commit-Queue: Mustaq Ahmed <mustaq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548768}
[modify] https://crrev.com/c4dfbae6d308b4f0a7140e71db3c7f6db01bdc3a/content/browser/bluetooth/web_bluetooth_service_impl.cc
[rename] https://crrev.com/c4dfbae6d308b4f0a7140e71db3c7f6db01bdc3a/third_party/WebKit/LayoutTests/external/wpt/bluetooth/requestDevice/doesnt-consume-user-gesture.https.html
[modify] https://crrev.com/c4dfbae6d308b4f0a7140e71db3c7f6db01bdc3a/third_party/WebKit/LayoutTests/external/wpt/webusb/usb.https.html
[modify] https://crrev.com/c4dfbae6d308b4f0a7140e71db3c7f6db01bdc3a/third_party/WebKit/Source/modules/bluetooth/Bluetooth.cpp
[modify] https://crrev.com/c4dfbae6d308b4f0a7140e71db3c7f6db01bdc3a/third_party/WebKit/Source/modules/webusb/USB.cpp

Owner: mustaq@chromium.org
Status: Fixed (was: Available)
Blocking: 696617
Looks like I never linked this to our main UAv2 tracker bug!
Project Member

Comment 5 by bugdroid1@chromium.org, Apr 7 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d80085143667bef3ac458a5350f6fb22debe03c3

commit d80085143667bef3ac458a5350f6fb22debe03c3
Author: Reilly Grant <reillyg@chromium.org>
Date: Sat Apr 07 01:11:52 2018

Track only a single WebUSB chooser bubble on desktop

A similar change was made for Android in r548482. Since only one bubble
can be visible at a time there is no reason to track multiple
references. If a request to open another chooser is received the
previous bubble should be closed first.

Bug:  786407 
Change-Id: I5f7b2f56ff1c394aaedd23e5360977bde2076fbd
Reviewed-on: https://chromium-review.googlesource.com/1000396
Reviewed-by: Jun Cai <juncai@chromium.org>
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#549001}
[modify] https://crrev.com/d80085143667bef3ac458a5350f6fb22debe03c3/chrome/browser/usb/web_usb_chooser_service_desktop.cc
[modify] https://crrev.com/d80085143667bef3ac458a5350f6fb22debe03c3/chrome/browser/usb/web_usb_chooser_service_desktop.h

Sign in to add a comment