New issue
Advanced search Search tips

Issue 598855 link

Starred by 3 users

Issue metadata

Status: Verified
Owner:
Closed: Apr 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows , Mac
Pri: 3
Type: Bug



Sign in to add a comment

navigator.usb connect/disconnect events are flaky

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

Issue description

Version: 51.0.2693.2
OS: OS X 10.11.4 and Windows 8.1

What steps will reproduce the problem?
(1) Connect one of miket@'s WebLights (https://github.com/sowbug/weblight).
(2) Click the "WebLight detected" notification.
(3) Grant the site permission to use the device.
(4) Disconnect and reconnect the device multiple times.

What is the expected output?
The page should update every time to hide and show the device as it is disconnected and reconnected. These should match the "WebLight detected" notifications which are also tied to the presence of the device.

What do you see instead?
Sometimes there is a "WebLight detected" notification but the site doesn't appear to be getting the 'onconnect' event and so it is not updated.
 
Components: Blink>USB
Project Member

Comment 2 by bugdroid1@chromium.org, Apr 2 2016

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

commit e0584330d7c9ddf1887547d58cc2a7e0cb92fe1b
Author: reillyg <reillyg@chromium.org>
Date: Sat Apr 02 00:53:55 2016

Remove single observer assumption in WebUSBClient.

This patch removes the assumption in WebUSBClient that there will be a
single instance of blink::USB active at once. Delayed garbage collection
can mean that an old instance exists for some time after a new instance
has added itself as an observer. With only a single observer slot the
old instance could accidentally unregister the new instance when it was
destroyed.

BUG= 598855 

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

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

[modify] https://crrev.com/e0584330d7c9ddf1887547d58cc2a7e0cb92fe1b/content/renderer/usb/web_usb_client_impl.cc
[modify] https://crrev.com/e0584330d7c9ddf1887547d58cc2a7e0cb92fe1b/content/renderer/usb/web_usb_client_impl.h
[modify] https://crrev.com/e0584330d7c9ddf1887547d58cc2a7e0cb92fe1b/third_party/WebKit/Source/modules/webusb/USB.cpp
[modify] https://crrev.com/e0584330d7c9ddf1887547d58cc2a7e0cb92fe1b/third_party/WebKit/Source/modules/webusb/USB.h
[modify] https://crrev.com/e0584330d7c9ddf1887547d58cc2a7e0cb92fe1b/third_party/WebKit/public/platform/modules/webusb/WebUSBClient.h

Status: Verified (was: Started)
Tested the above fix (C#2) for Latest Canary#51.0.2700.0 on Win10, Mac OS X 10.11.4 & Linux 14.04 - working as intended.

Thank you!
Project Member

Comment 4 by bugdroid1@chromium.org, Apr 6 2016

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

commit 54ad52b6a815e0aaca6391f7baac2e1064d4acec
Author: reillyg <reillyg@chromium.org>
Date: Wed Apr 06 01:30:39 2016

Make USB a ContextLifecycleObserver.

This patch makes USB a ContextLifecycleObserver. When the context is
destroyed it stops listening for device changes. This is the same signal
USBDevice listens for to close device connections on navigation.

BUG= 598855 

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

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

[modify] https://crrev.com/54ad52b6a815e0aaca6391f7baac2e1064d4acec/third_party/WebKit/Source/modules/webusb/USB.cpp
[modify] https://crrev.com/54ad52b6a815e0aaca6391f7baac2e1064d4acec/third_party/WebKit/Source/modules/webusb/USB.h
[modify] https://crrev.com/54ad52b6a815e0aaca6391f7baac2e1064d4acec/third_party/WebKit/Source/modules/webusb/USBDevice.cpp
[modify] https://crrev.com/54ad52b6a815e0aaca6391f7baac2e1064d4acec/third_party/WebKit/Source/modules/webusb/USBDevice.h

Sign in to add a comment