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

Issue 837414 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2018
Cc:
Components:
EstimatedDays: 3
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 2
Type: Task

Blocking:
issue 837406



Sign in to add a comment

Add WebUSB interface to WorkerNavigator for Dedicated Workers

Project Member Reported by odejesush@chromium.org, Apr 26 2018

Issue description

Update the source files in //src/third_party/blink/renderer/modules/webusb to expose the WebUSB API, minus requestDevice, to Dedicated Workers.
 
Labels: -Type-Bug Type-Task
Project Member

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

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

commit 841d469fc77210d9044fcaaa9acbdc1b0066de27
Author: Ovidio Henriquez <odejesush@chromium.org>
Date: Mon Apr 30 21:50:42 2018

Expose WebUSB API to worker context

This change updates the WebUSB IDL files to expose the API, minus
requestDevice method, to Dedicated and Shared Workers. The change is
only available via a test runtime enabled flag. The global interface
listing tests are updated to match the newly exposed interface.

The spec for this feature can be found at:
https://wicg.github.io/webusb/#enumeration

Bug:  837414 
Change-Id: I0bb9c2db50d63dc0a1363853610bb24f83897702
Reviewed-on: https://chromium-review.googlesource.com/1014196
Reviewed-by: Chong Zhang <chongz@chromium.org>
Reviewed-by: Steve Kobes <skobes@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Commit-Queue: Ovidio Henriquez <odejesush@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554892}
[modify] https://crrev.com/841d469fc77210d9044fcaaa9acbdc1b0066de27/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt
[modify] https://crrev.com/841d469fc77210d9044fcaaa9acbdc1b0066de27/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt
[modify] https://crrev.com/841d469fc77210d9044fcaaa9acbdc1b0066de27/third_party/blink/renderer/modules/webusb/navigator_usb.idl
[modify] https://crrev.com/841d469fc77210d9044fcaaa9acbdc1b0066de27/third_party/blink/renderer/modules/webusb/usb.idl
[modify] https://crrev.com/841d469fc77210d9044fcaaa9acbdc1b0066de27/third_party/blink/renderer/platform/runtime_enabled_features.json5

Project Member

Comment 3 by bugdroid1@chromium.org, May 9 2018

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

commit 729baf4b29b9d9a2d7e4417617b61ee1c53162cd
Author: Ovidio Henriquez <odejesush@chromium.org>
Date: Wed May 09 19:30:49 2018

Add WorkerNavigatorUSB supplement

This change adds a WorkerNavigatorUSB supplement for WorkerNavigator.
The WorkerNavigatorUSB interface contains a usb attribute that returns
a USB object. The constructor for this USB object was also changed to
use an ExecutionContext* parameter to allow a worker to properly
initialize the object.

This change also updates the global interface listing tests to reflect
the new attribute that WorkerNavigator contains and adds web platform
tests to check that the WorkerNavigator does indeed have the usb
attribute defined in the supported contexts.

Due to a bug (https://crbug.com/839117) with the WebIDL bindings
generator, the global-interface-listing-service-worker.html test
exposes the usb attribute of WorkerNavigator. Therefore, a check is
performed in WorkerNavigatorUSB to return a null pointer if the
execution context is a ServiceWorkerGlobalScope. Since the intended
behavior for navigator.usb in a service worker is to be undefined, the
web platform test for this checks that condition instead.

Bug:  837414 
Change-Id: I3ca63c9ae0b85e5425134024d2fdd9b29ef7d8c3
Reviewed-on: https://chromium-review.googlesource.com/1024724
Commit-Queue: Ovidio Henriquez <odejesush@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Chong Zhang <chongz@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#557272}
[add] https://crrev.com/729baf4b29b9d9a2d7e4417617b61ee1c53162cd/third_party/WebKit/LayoutTests/external/wpt/webusb/resources/usb.dedicatedworker.sharedworker.js
[add] https://crrev.com/729baf4b29b9d9a2d7e4417617b61ee1c53162cd/third_party/WebKit/LayoutTests/external/wpt/webusb/resources/usb.serviceworker.js
[add] https://crrev.com/729baf4b29b9d9a2d7e4417617b61ee1c53162cd/third_party/WebKit/LayoutTests/external/wpt/webusb/worker/usb.dedicatedworker.https.html
[add] https://crrev.com/729baf4b29b9d9a2d7e4417617b61ee1c53162cd/third_party/WebKit/LayoutTests/external/wpt/webusb/worker/usb.serviceworker.https-expected.txt
[add] https://crrev.com/729baf4b29b9d9a2d7e4417617b61ee1c53162cd/third_party/WebKit/LayoutTests/external/wpt/webusb/worker/usb.serviceworker.https.html
[add] https://crrev.com/729baf4b29b9d9a2d7e4417617b61ee1c53162cd/third_party/WebKit/LayoutTests/external/wpt/webusb/worker/usb.sharedworker.https.html
[modify] https://crrev.com/729baf4b29b9d9a2d7e4417617b61ee1c53162cd/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
[modify] https://crrev.com/729baf4b29b9d9a2d7e4417617b61ee1c53162cd/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt
[modify] https://crrev.com/729baf4b29b9d9a2d7e4417617b61ee1c53162cd/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt
[modify] https://crrev.com/729baf4b29b9d9a2d7e4417617b61ee1c53162cd/third_party/blink/renderer/modules/modules_idl_files.gni
[modify] https://crrev.com/729baf4b29b9d9a2d7e4417617b61ee1c53162cd/third_party/blink/renderer/modules/webusb/BUILD.gn
[modify] https://crrev.com/729baf4b29b9d9a2d7e4417617b61ee1c53162cd/third_party/blink/renderer/modules/webusb/navigator_usb.cc
[modify] https://crrev.com/729baf4b29b9d9a2d7e4417617b61ee1c53162cd/third_party/blink/renderer/modules/webusb/usb.cc
[modify] https://crrev.com/729baf4b29b9d9a2d7e4417617b61ee1c53162cd/third_party/blink/renderer/modules/webusb/usb.h
[add] https://crrev.com/729baf4b29b9d9a2d7e4417617b61ee1c53162cd/third_party/blink/renderer/modules/webusb/worker_navigator_usb.cc
[add] https://crrev.com/729baf4b29b9d9a2d7e4417617b61ee1c53162cd/third_party/blink/renderer/modules/webusb/worker_navigator_usb.h
[add] https://crrev.com/729baf4b29b9d9a2d7e4417617b61ee1c53162cd/third_party/blink/renderer/modules/webusb/worker_navigator_usb.idl

Project Member

Comment 4 by bugdroid1@chromium.org, May 18 2018

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

commit 36ffbe7850c1b2495d4ba62ae1d3872f4788db8e
Author: Ovidio Henriquez <odejesush@chromium.org>
Date: Fri May 18 20:56:35 2018

Allow WebUSB to work in a Dedicated Worker

This change updates the USB class to allow the exposed APIs to work
correctly in the context of a Dedicated Worker. In order to do this, USB
was reworked to use an ExecutionContext object to check the context and
the FeaturePolicy, rather than the LocalFrame that it was using
previously. The usb layout test for workers was also updated to use the
WebUSB test API to check that getDevices and event listeners work in
Dedicated Workers.

Additionally, the UsbDeviceManager Mojo interface used by WebUSB is
added to the DedicatedWorkerHost BinderRegistry so that the request is
handled correctly.

Bug:  837414 , 837422 
Change-Id: I1ad95e288312851e9ec39ce6ec917bf38b12d4d6
Reviewed-on: https://chromium-review.googlesource.com/1045309
Commit-Queue: Ovidio Henriquez <odejesush@chromium.org>
Reviewed-by: Greg Kerr <kerrnel@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Chong Zhang <chongz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560026}
[modify] https://crrev.com/36ffbe7850c1b2495d4ba62ae1d3872f4788db8e/content/browser/dedicated_worker/dedicated_worker_host.cc
[modify] https://crrev.com/36ffbe7850c1b2495d4ba62ae1d3872f4788db8e/content/public/app/mojo/content_browser_manifest.json
[modify] https://crrev.com/36ffbe7850c1b2495d4ba62ae1d3872f4788db8e/third_party/WebKit/LayoutTests/external/wpt/resources/chromium/webusb-test.js
[modify] https://crrev.com/36ffbe7850c1b2495d4ba62ae1d3872f4788db8e/third_party/WebKit/LayoutTests/external/wpt/webusb/resources/usb-helpers.js
[modify] https://crrev.com/36ffbe7850c1b2495d4ba62ae1d3872f4788db8e/third_party/WebKit/LayoutTests/external/wpt/webusb/resources/usb.dedicatedworker.sharedworker.js
[modify] https://crrev.com/36ffbe7850c1b2495d4ba62ae1d3872f4788db8e/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt
[modify] https://crrev.com/36ffbe7850c1b2495d4ba62ae1d3872f4788db8e/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt
[modify] https://crrev.com/36ffbe7850c1b2495d4ba62ae1d3872f4788db8e/third_party/blink/renderer/modules/webusb/usb.cc
[modify] https://crrev.com/36ffbe7850c1b2495d4ba62ae1d3872f4788db8e/third_party/blink/renderer/modules/webusb/usb.h
[modify] https://crrev.com/36ffbe7850c1b2495d4ba62ae1d3872f4788db8e/third_party/blink/renderer/modules/webusb/usb_connection_event.idl

Description: Show this description
Status: Fixed (was: Assigned)
Summary: Add WebUSB interface to WorkerNavigator for Dedicated Workers (was: Add WebUSB interface to WorkerNavigator for Dedicated and Shared Workers)
Labels: M-69 Target-69
Project Member

Comment 8 by bugdroid1@chromium.org, Jul 2

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

commit 2285ed7f115cb316d9f4bb4f57963cdeae12e10b
Author: Ovidio Henriquez <odejesush@chromium.org>
Date: Mon Jul 02 16:14:41 2018

Split flag for WebUSBOnDedicatedAndSharedWorkers

This change splits the runtime enabled flag for
WebUSBOnDedicatedAndSharedWorkers into WebUSBOnDedicatedWorkers and
WebUSBOnSharedWorkers to facilitate the independent development of the
features.

Bug:  837414 
Change-Id: Icb9237a42a1f0b27391f602db7b3f395d53dcd6d
Reviewed-on: https://chromium-review.googlesource.com/1098031
Commit-Queue: Ovidio Henriquez <odejesush@chromium.org>
Reviewed-by: Ojan Vafai <ojan@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Chong Zhang <chongz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#571914}
[modify] https://crrev.com/2285ed7f115cb316d9f4bb4f57963cdeae12e10b/third_party/WebKit/LayoutTests/virtual/stable/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
[modify] https://crrev.com/2285ed7f115cb316d9f4bb4f57963cdeae12e10b/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-dedicated-worker-expected.txt
[modify] https://crrev.com/2285ed7f115cb316d9f4bb4f57963cdeae12e10b/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-shared-worker-expected.txt
[modify] https://crrev.com/2285ed7f115cb316d9f4bb4f57963cdeae12e10b/third_party/blink/renderer/modules/webusb/usb.cc
[modify] https://crrev.com/2285ed7f115cb316d9f4bb4f57963cdeae12e10b/third_party/blink/renderer/modules/webusb/usb.idl
[modify] https://crrev.com/2285ed7f115cb316d9f4bb4f57963cdeae12e10b/third_party/blink/renderer/modules/webusb/usb_alternate_interface.idl
[modify] https://crrev.com/2285ed7f115cb316d9f4bb4f57963cdeae12e10b/third_party/blink/renderer/modules/webusb/usb_configuration.idl
[modify] https://crrev.com/2285ed7f115cb316d9f4bb4f57963cdeae12e10b/third_party/blink/renderer/modules/webusb/usb_connection_event.idl
[modify] https://crrev.com/2285ed7f115cb316d9f4bb4f57963cdeae12e10b/third_party/blink/renderer/modules/webusb/usb_device.idl
[modify] https://crrev.com/2285ed7f115cb316d9f4bb4f57963cdeae12e10b/third_party/blink/renderer/modules/webusb/usb_endpoint.idl
[modify] https://crrev.com/2285ed7f115cb316d9f4bb4f57963cdeae12e10b/third_party/blink/renderer/modules/webusb/usb_in_transfer_result.idl
[modify] https://crrev.com/2285ed7f115cb316d9f4bb4f57963cdeae12e10b/third_party/blink/renderer/modules/webusb/usb_interface.idl
[modify] https://crrev.com/2285ed7f115cb316d9f4bb4f57963cdeae12e10b/third_party/blink/renderer/modules/webusb/usb_isochronous_in_transfer_packet.idl
[modify] https://crrev.com/2285ed7f115cb316d9f4bb4f57963cdeae12e10b/third_party/blink/renderer/modules/webusb/usb_isochronous_in_transfer_result.idl
[modify] https://crrev.com/2285ed7f115cb316d9f4bb4f57963cdeae12e10b/third_party/blink/renderer/modules/webusb/usb_isochronous_out_transfer_packet.idl
[modify] https://crrev.com/2285ed7f115cb316d9f4bb4f57963cdeae12e10b/third_party/blink/renderer/modules/webusb/usb_isochronous_out_transfer_result.idl
[modify] https://crrev.com/2285ed7f115cb316d9f4bb4f57963cdeae12e10b/third_party/blink/renderer/modules/webusb/usb_out_transfer_result.idl
[modify] https://crrev.com/2285ed7f115cb316d9f4bb4f57963cdeae12e10b/third_party/blink/renderer/modules/webusb/worker_navigator_usb.cc
[modify] https://crrev.com/2285ed7f115cb316d9f4bb4f57963cdeae12e10b/third_party/blink/renderer/modules/webusb/worker_navigator_usb.idl
[modify] https://crrev.com/2285ed7f115cb316d9f4bb4f57963cdeae12e10b/third_party/blink/renderer/platform/runtime_enabled_features.json5

Project Member

Comment 9 by bugdroid1@chromium.org, Aug 2

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

commit 6ed4277143bc91de86dfd3df0ae8d753d8805510
Author: Ovidio Henriquez <odejesush@chromium.org>
Date: Thu Aug 02 18:35:40 2018

Clean up WebUSB on Shared Worker code

This change removes the WebUSBOnSharedWorker flag and the Blink IDL
changes made to expose WebUSB in the SharedWorkerGlobalScope, since the
feature will not be implemented anytime soon.

Bug:  837414 
Change-Id: I0bf49b8bb7fc9ded42d43732ed1c01c0b6831ffc
Reviewed-on: https://chromium-review.googlesource.com/1153222
Commit-Queue: Ovidio Henriquez <odejesush@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Chong Zhang <chongz@chromium.org>
Reviewed-by: Philip Jägenstedt <foolip@chromium.org>
Cr-Commit-Position: refs/heads/master@{#580261}
[modify] https://crrev.com/6ed4277143bc91de86dfd3df0ae8d753d8805510/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt
[modify] https://crrev.com/6ed4277143bc91de86dfd3df0ae8d753d8805510/third_party/blink/renderer/modules/webusb/usb.cc
[modify] https://crrev.com/6ed4277143bc91de86dfd3df0ae8d753d8805510/third_party/blink/renderer/modules/webusb/usb.idl
[modify] https://crrev.com/6ed4277143bc91de86dfd3df0ae8d753d8805510/third_party/blink/renderer/modules/webusb/usb_alternate_interface.idl
[modify] https://crrev.com/6ed4277143bc91de86dfd3df0ae8d753d8805510/third_party/blink/renderer/modules/webusb/usb_configuration.idl
[modify] https://crrev.com/6ed4277143bc91de86dfd3df0ae8d753d8805510/third_party/blink/renderer/modules/webusb/usb_connection_event.idl
[modify] https://crrev.com/6ed4277143bc91de86dfd3df0ae8d753d8805510/third_party/blink/renderer/modules/webusb/usb_device.idl
[modify] https://crrev.com/6ed4277143bc91de86dfd3df0ae8d753d8805510/third_party/blink/renderer/modules/webusb/usb_endpoint.idl
[modify] https://crrev.com/6ed4277143bc91de86dfd3df0ae8d753d8805510/third_party/blink/renderer/modules/webusb/usb_in_transfer_result.idl
[modify] https://crrev.com/6ed4277143bc91de86dfd3df0ae8d753d8805510/third_party/blink/renderer/modules/webusb/usb_interface.idl
[modify] https://crrev.com/6ed4277143bc91de86dfd3df0ae8d753d8805510/third_party/blink/renderer/modules/webusb/usb_isochronous_in_transfer_packet.idl
[modify] https://crrev.com/6ed4277143bc91de86dfd3df0ae8d753d8805510/third_party/blink/renderer/modules/webusb/usb_isochronous_in_transfer_result.idl
[modify] https://crrev.com/6ed4277143bc91de86dfd3df0ae8d753d8805510/third_party/blink/renderer/modules/webusb/usb_isochronous_out_transfer_packet.idl
[modify] https://crrev.com/6ed4277143bc91de86dfd3df0ae8d753d8805510/third_party/blink/renderer/modules/webusb/usb_isochronous_out_transfer_result.idl
[modify] https://crrev.com/6ed4277143bc91de86dfd3df0ae8d753d8805510/third_party/blink/renderer/modules/webusb/usb_out_transfer_result.idl
[modify] https://crrev.com/6ed4277143bc91de86dfd3df0ae8d753d8805510/third_party/blink/renderer/modules/webusb/worker_navigator_usb.cc
[modify] https://crrev.com/6ed4277143bc91de86dfd3df0ae8d753d8805510/third_party/blink/renderer/platform/runtime_enabled_features.json5

Sign in to add a comment