New issue
Advanced search Search tips

Issue 593164 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 2
Type: Bug

Blocking:
issue 492204



Sign in to add a comment

Add USBDevice.opened and USBConfiguration/USBAlternateInterface.selected.

Project Member Reported by reillyg@chromium.org, Mar 8 2016

Issue description

This bug tracks work to add the following attributes:

 * USBDevice.opened
 * USBConfiguration.selected
 * USBAlternateInterface.selected

For clarity USBDevice.setConfiguration and USBDevice.setInterface will be renamed to USBDevice.selectConfiguration and USBDevice.selectAlternateInterface as the calls will no longer map 1:1 with SET_CONFIGURATION and SET_INTERFACE requests sent to the device.

This prototyping work based on feedback on the WebUSB specification here:

https://github.com/WICG/webusb/issues/34
https://github.com/WICG/webusb/issues/45
 
Blocking: 492204
Project Member

Comment 2 by bugdroid1@chromium.org, Mar 10 2016

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

commit 3a80f8993c32aefb757e8e2ff5e1fcff3a9dbc32
Author: reillyg <reillyg@chromium.org>
Date: Thu Mar 10 02:52:04 2016

Track USBDevice open state in Blink.

This change is the first in a series of patches that add logic to track
aspects of device state such as whether it is open and what
configuration has been selected in Blink in addition to whatever
validation occurs in the browser. The reasons for this are two-fold:

 1) It makes generating useful error messages easier because detailed
    error information does not need to be transmitted over IPC.
 2) It allows the WebUSB API to provide attributes such as ".opened" and
    ".selected" on the device, configurations and interfaces.

BUG= 593164 

Review URL: https://codereview.chromium.org/1781533002

Cr-Commit-Position: refs/heads/master@{#380315}

[modify] https://crrev.com/3a80f8993c32aefb757e8e2ff5e1fcff3a9dbc32/third_party/WebKit/LayoutTests/usb/resources/usb-helpers.js
[modify] https://crrev.com/3a80f8993c32aefb757e8e2ff5e1fcff3a9dbc32/third_party/WebKit/LayoutTests/usb/usbDevice.html
[modify] https://crrev.com/3a80f8993c32aefb757e8e2ff5e1fcff3a9dbc32/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/3a80f8993c32aefb757e8e2ff5e1fcff3a9dbc32/third_party/WebKit/Source/modules/webusb/USB.cpp
[modify] https://crrev.com/3a80f8993c32aefb757e8e2ff5e1fcff3a9dbc32/third_party/WebKit/Source/modules/webusb/USBDevice.cpp
[modify] https://crrev.com/3a80f8993c32aefb757e8e2ff5e1fcff3a9dbc32/third_party/WebKit/Source/modules/webusb/USBDevice.h
[modify] https://crrev.com/3a80f8993c32aefb757e8e2ff5e1fcff3a9dbc32/third_party/WebKit/Source/modules/webusb/USBDevice.idl

Project Member

Comment 3 by bugdroid1@chromium.org, Mar 15 2016

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

commit cc9b0c5fa36368bb012b4b4d572ada52ceb1146b
Author: reillyg <reillyg@chromium.org>
Date: Tue Mar 15 19:47:06 2016

Track USB device configuration state in Blink.

Blink now tracks the currently selected device configuration and can
thus provide it as an IDL attribute without a getConfiguration() method
which has been removed.

This continues the trend of being able to handle errors in Blink before
calling methods on the Mojo interface.

BUG= 593164 
R=juncai@chromium.org
TBR=dgozman@chromium.org

Review URL: https://codereview.chromium.org/1784733002

Cr-Commit-Position: refs/heads/master@{#381288}

[modify] https://crrev.com/cc9b0c5fa36368bb012b4b4d572ada52ceb1146b/chrome/browser/devtools/device/usb/android_usb_browsertest.cc
[modify] https://crrev.com/cc9b0c5fa36368bb012b4b4d572ada52ceb1146b/content/renderer/usb/type_converters.cc
[modify] https://crrev.com/cc9b0c5fa36368bb012b4b4d572ada52ceb1146b/content/renderer/usb/web_usb_device_impl.cc
[modify] https://crrev.com/cc9b0c5fa36368bb012b4b4d572ada52ceb1146b/content/renderer/usb/web_usb_device_impl.h
[modify] https://crrev.com/cc9b0c5fa36368bb012b4b4d572ada52ceb1146b/device/usb/mock_usb_device.h
[modify] https://crrev.com/cc9b0c5fa36368bb012b4b4d572ada52ceb1146b/device/usb/mojo/device_impl.cc
[modify] https://crrev.com/cc9b0c5fa36368bb012b4b4d572ada52ceb1146b/device/usb/mojo/device_impl.h
[modify] https://crrev.com/cc9b0c5fa36368bb012b4b4d572ada52ceb1146b/device/usb/mojo/type_converters.cc
[modify] https://crrev.com/cc9b0c5fa36368bb012b4b4d572ada52ceb1146b/device/usb/public/interfaces/device.mojom
[modify] https://crrev.com/cc9b0c5fa36368bb012b4b4d572ada52ceb1146b/device/usb/usb_device.h
[modify] https://crrev.com/cc9b0c5fa36368bb012b4b4d572ada52ceb1146b/device/usb/usb_device_android.cc
[modify] https://crrev.com/cc9b0c5fa36368bb012b4b4d572ada52ceb1146b/device/usb/usb_device_android.h
[modify] https://crrev.com/cc9b0c5fa36368bb012b4b4d572ada52ceb1146b/device/usb/usb_device_impl.cc
[modify] https://crrev.com/cc9b0c5fa36368bb012b4b4d572ada52ceb1146b/device/usb/usb_device_impl.h
[modify] https://crrev.com/cc9b0c5fa36368bb012b4b4d572ada52ceb1146b/third_party/WebKit/LayoutTests/usb/resources/fake-devices.js
[modify] https://crrev.com/cc9b0c5fa36368bb012b4b4d572ada52ceb1146b/third_party/WebKit/LayoutTests/usb/resources/usb-helpers.js
[modify] https://crrev.com/cc9b0c5fa36368bb012b4b4d572ada52ceb1146b/third_party/WebKit/LayoutTests/usb/usbDevice.html
[modify] https://crrev.com/cc9b0c5fa36368bb012b4b4d572ada52ceb1146b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/cc9b0c5fa36368bb012b4b4d572ada52ceb1146b/third_party/WebKit/Source/modules/webusb/USBDevice.cpp
[modify] https://crrev.com/cc9b0c5fa36368bb012b4b4d572ada52ceb1146b/third_party/WebKit/Source/modules/webusb/USBDevice.h
[modify] https://crrev.com/cc9b0c5fa36368bb012b4b4d572ada52ceb1146b/third_party/WebKit/Source/modules/webusb/USBDevice.idl
[modify] https://crrev.com/cc9b0c5fa36368bb012b4b4d572ada52ceb1146b/third_party/WebKit/public/platform/modules/webusb/WebUSBDevice.h
[modify] https://crrev.com/cc9b0c5fa36368bb012b4b4d572ada52ceb1146b/third_party/WebKit/public/platform/modules/webusb/WebUSBDeviceInfo.h

Project Member

Comment 4 by bugdroid1@chromium.org, Mar 21 2016

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

commit 8953a7b9ffec800ce8a36e44a7c27a5f7725e33d
Author: reillyg <reillyg@chromium.org>
Date: Mon Mar 21 22:02:36 2016

Track USB device interface claim state in Blink.

This patch updates the WebUSB IDL to include a 'claimed' attribute on
USBInterface and the necessary renderer-side logic to keep track of this
state.

The most interesting part of this is continuing to work out what
operations on the device should block other operations because they
change the device state in a way that effects argument validation.

BUG= 593164 

Review URL: https://codereview.chromium.org/1814603002

Cr-Commit-Position: refs/heads/master@{#382407}

[modify] https://crrev.com/8953a7b9ffec800ce8a36e44a7c27a5f7725e33d/third_party/WebKit/LayoutTests/usb/usbDevice.html
[modify] https://crrev.com/8953a7b9ffec800ce8a36e44a7c27a5f7725e33d/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/8953a7b9ffec800ce8a36e44a7c27a5f7725e33d/third_party/WebKit/Source/modules/webusb/USBConfiguration.cpp
[modify] https://crrev.com/8953a7b9ffec800ce8a36e44a7c27a5f7725e33d/third_party/WebKit/Source/modules/webusb/USBConfiguration.h
[modify] https://crrev.com/8953a7b9ffec800ce8a36e44a7c27a5f7725e33d/third_party/WebKit/Source/modules/webusb/USBDevice.cpp
[modify] https://crrev.com/8953a7b9ffec800ce8a36e44a7c27a5f7725e33d/third_party/WebKit/Source/modules/webusb/USBDevice.h
[modify] https://crrev.com/8953a7b9ffec800ce8a36e44a7c27a5f7725e33d/third_party/WebKit/Source/modules/webusb/USBDevice.idl
[modify] https://crrev.com/8953a7b9ffec800ce8a36e44a7c27a5f7725e33d/third_party/WebKit/Source/modules/webusb/USBInterface.cpp
[modify] https://crrev.com/8953a7b9ffec800ce8a36e44a7c27a5f7725e33d/third_party/WebKit/Source/modules/webusb/USBInterface.h
[modify] https://crrev.com/8953a7b9ffec800ce8a36e44a7c27a5f7725e33d/third_party/WebKit/Source/modules/webusb/USBInterface.idl

Project Member

Comment 5 by bugdroid1@chromium.org, Mar 22 2016

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

commit 92c1f849580dea46a5ddc1a3762a86ea5a9b7cf4
Author: reillyg <reillyg@chromium.org>
Date: Tue Mar 22 02:59:09 2016

Track USB alternate interface state in Blink.

This patch adds logic to track which alternate interface has been
selected. This isn't too interesting by itself but is a step towards
knowing which endpoints are available.

BUG= 593164 

Review URL: https://codereview.chromium.org/1806163002

Cr-Commit-Position: refs/heads/master@{#382486}

[modify] https://crrev.com/92c1f849580dea46a5ddc1a3762a86ea5a9b7cf4/third_party/WebKit/LayoutTests/usb/usbDevice.html
[modify] https://crrev.com/92c1f849580dea46a5ddc1a3762a86ea5a9b7cf4/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/92c1f849580dea46a5ddc1a3762a86ea5a9b7cf4/third_party/WebKit/Source/modules/webusb/USBDevice.cpp
[modify] https://crrev.com/92c1f849580dea46a5ddc1a3762a86ea5a9b7cf4/third_party/WebKit/Source/modules/webusb/USBDevice.h
[modify] https://crrev.com/92c1f849580dea46a5ddc1a3762a86ea5a9b7cf4/third_party/WebKit/Source/modules/webusb/USBDevice.idl
[modify] https://crrev.com/92c1f849580dea46a5ddc1a3762a86ea5a9b7cf4/third_party/WebKit/Source/modules/webusb/USBInterface.cpp
[modify] https://crrev.com/92c1f849580dea46a5ddc1a3762a86ea5a9b7cf4/third_party/WebKit/Source/modules/webusb/USBInterface.h
[modify] https://crrev.com/92c1f849580dea46a5ddc1a3762a86ea5a9b7cf4/third_party/WebKit/Source/modules/webusb/USBInterface.idl

Project Member

Comment 6 by bugdroid1@chromium.org, Mar 24 2016

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

commit 6cfa6305dc22be1489cec97f8ddcf595d75f2a75
Author: reillyg <reillyg@chromium.org>
Date: Thu Mar 24 23:55:39 2016

Track USB endpoint state in Blink.

The last in a series of patches putting input validation for the WebUSB
directly into Blink. This one adds bit vectors that track which
endpoints are available given the current set of claimed interfaces and
selected alternate interfaces.

BUG= 593164 

Review URL: https://codereview.chromium.org/1830833002

Cr-Commit-Position: refs/heads/master@{#383194}

[modify] https://crrev.com/6cfa6305dc22be1489cec97f8ddcf595d75f2a75/device/usb/mojo/type_converters.cc
[modify] https://crrev.com/6cfa6305dc22be1489cec97f8ddcf595d75f2a75/third_party/WebKit/LayoutTests/usb/usbDevice.html
[modify] https://crrev.com/6cfa6305dc22be1489cec97f8ddcf595d75f2a75/third_party/WebKit/Source/modules/webusb/USBDevice.cpp
[modify] https://crrev.com/6cfa6305dc22be1489cec97f8ddcf595d75f2a75/third_party/WebKit/Source/modules/webusb/USBDevice.h

Status: Fixed (was: Started)

Sign in to add a comment