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

Issue 648015 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
inactive
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 1
Type: Bug-Regression



Sign in to add a comment

Gamepad removal causes all gamepads to disappear

Reported by aicomman...@gmail.com, Sep 18 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2859.0 Safari/537.36

Steps to reproduce the problem:
1. Navigate to http://html5gamepad.com
2. Connect a gamepad - this should show up as gamepad 1
3. Connect another gamepad - this should show up as gamepad 2
4. Disconnect gamepad 1

What is the expected behavior?
Gamepad 2 should remain in the list.

What went wrong?
All gamepads disappear from the list. They both reappear if gamepad 1 is reattached.

Did this work before? Yes Prior to https://chromium.googlesource.com/chromium/src.git/+/667f05771b5c1275f87599076d222c0ed21ba22b

Chrome version: 55.0.2859.0  Channel: dev
OS Version: OS X 10.12.0
Flash Version: Shockwave Flash 23.0 r0

On debug builds, this scenario will crash due to an assertion failure tracked as issue 644170.
 

Comment 1 by rsesek@chromium.org, Sep 19 2016

Components: Blink>GamepadAPI

Comment 2 by rsesek@chromium.org, Sep 19 2016

Owner: bajones@chromium.org
Status: Assigned (was: Unconfirmed)
Labels: -Pri-2 Pri-1
bajones@ sounds like you introduced a regression in Chrome 55 here, right?  We've got a couple weeks left to revert if you don't want this regression hitting stable.
Project Member

Comment 4 by bugdroid1@chromium.org, Jan 4 2017

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

commit 5367010cc54ad46dfa4cf535fd8e6527d4460891
Author: aelias <aelias@chromium.org>
Date: Wed Jan 04 23:13:36 2017

Delete WebGamepads::length.

This field has only one use, the "i < gamepads.length" check in
NavigatorGamepad.cpp.  This check doesn't do anything useful and
actually introduces the following bug: if two gamepads are connected and
then the first one is disconnected, the second one remained at index 1
and was therefore dropped.  (There's no identifier for a gamepad other
than its index, so this bug can't be fixed by moving it to the beginning
of the WebGamepads structure.)

So I deleted the dynamic length and rely purely on itemsLengthCap
instead.

As a drive-by, add an initialization of displayId to 0 (was unset).

(This patch is an improved version of http://crrev.com/2457703002/)

BUG= 648015 

Review-Url: https://codereview.chromium.org/2572323002
Cr-Commit-Position: refs/heads/master@{#441503}

[modify] https://crrev.com/5367010cc54ad46dfa4cf535fd8e6527d4460891/components/exo/gamepad.cc
[modify] https://crrev.com/5367010cc54ad46dfa4cf535fd8e6527d4460891/components/exo/gamepad_unittest.cc
[modify] https://crrev.com/5367010cc54ad46dfa4cf535fd8e6527d4460891/components/test_runner/gamepad_controller.cc
[modify] https://crrev.com/5367010cc54ad46dfa4cf535fd8e6527d4460891/content/browser/renderer_host/pepper/pepper_gamepad_host_unittest.cc
[modify] https://crrev.com/5367010cc54ad46dfa4cf535fd8e6527d4460891/device/gamepad/gamepad_provider.cc
[modify] https://crrev.com/5367010cc54ad46dfa4cf535fd8e6527d4460891/device/gamepad/gamepad_provider_unittest.cc
[modify] https://crrev.com/5367010cc54ad46dfa4cf535fd8e6527d4460891/ppapi/shared_impl/ppb_gamepad_shared.cc
[modify] https://crrev.com/5367010cc54ad46dfa4cf535fd8e6527d4460891/ppapi/shared_impl/ppb_gamepad_shared.h
[modify] https://crrev.com/5367010cc54ad46dfa4cf535fd8e6527d4460891/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.cpp
[modify] https://crrev.com/5367010cc54ad46dfa4cf535fd8e6527d4460891/third_party/WebKit/public/platform/Platform.h
[modify] https://crrev.com/5367010cc54ad46dfa4cf535fd8e6527d4460891/third_party/WebKit/public/platform/WebGamepad.h
[modify] https://crrev.com/5367010cc54ad46dfa4cf535fd8e6527d4460891/third_party/WebKit/public/platform/WebGamepads.h

Cc: bajones@chromium.org
Owner: aelias@chromium.org
Status: Fixed (was: Assigned)

Sign in to add a comment