Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Issue 2572323002: Delete WebGamepads::length. (Closed)

Created:
4 years ago by aelias_OOO_until_Jul13
Modified:
3 years, 11 months ago
CC:
cgutman, blink-reviews, blink-reviews-api_chromium.org, chromium-reviews, dglazkov+blink, einbinder+watch-test-runner_chromium.org, haraken, jochen+watch_chromium.org, mlamouri+watch-test-runner_chromium.org, pfeldman
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

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 Committed: https://crrev.com/5367010cc54ad46dfa4cf535fd8e6527d4460891 Cr-Commit-Position: refs/heads/master@{#441503}

Patch Set 1 #

Patch Set 2 : Rebase #

Patch Set 3 : Add displayId initialization to 0 #

Patch Set 4 : Fix pepper_gamepad_host_unittest #

Patch Set 5 : Really fix pepper_gamepad_host_unittest #

Patch Set 6 : Fix components/exo #

Patch Set 7 : Disable on Android #

Patch Set 8 : Bring back active_state clearing in exo #

Total comments: 2

Patch Set 9 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+80 lines, -58 lines) Patch
M components/exo/gamepad.cc View 1 2 3 4 5 6 7 2 chunks +7 lines, -15 lines 0 comments Download
M components/exo/gamepad_unittest.cc View 1 2 3 4 5 3 chunks +0 lines, -3 lines 0 comments Download
M components/test_runner/gamepad_controller.cc View 2 chunks +0 lines, -10 lines 0 comments Download
M content/browser/renderer_host/pepper/pepper_gamepad_host_unittest.cc View 1 2 3 4 3 chunks +0 lines, -4 lines 0 comments Download
M device/gamepad/gamepad_provider.cc View 1 1 chunk +0 lines, -3 lines 0 comments Download
M device/gamepad/gamepad_provider_unittest.cc View 1 2 3 4 5 6 8 chunks +64 lines, -8 lines 0 comments Download
M ppapi/shared_impl/ppb_gamepad_shared.h View 1 1 chunk +0 lines, -3 lines 0 comments Download
M ppapi/shared_impl/ppb_gamepad_shared.cc View 1 chunk +2 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.cpp View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/public/platform/Platform.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/public/platform/WebGamepad.h View 1 2 1 chunk +5 lines, -1 line 0 comments Download
M third_party/WebKit/public/platform/WebGamepads.h View 1 chunk +0 lines, -5 lines 0 comments Download

Messages

Total messages: 56 (39 generated)
aelias_OOO_until_Jul13
Hi scottmg@, PTAL since bajones@ is out on leave. If this looks good to you, ...
4 years ago (2016-12-14 23:05:56 UTC) #4
scottmg
(Apparently WebGamepad has a constructor now!) Can you add to this CL the initialization of ...
4 years ago (2016-12-14 23:22:13 UTC) #8
aelias_OOO_until_Jul13
On 2016/12/14 at 23:22:13, scottmg wrote: > (Apparently WebGamepad has a constructor now!) > > ...
4 years ago (2016-12-14 23:30:32 UTC) #12
scottmg
lgtm
4 years ago (2016-12-14 23:32:21 UTC) #14
aelias_OOO_until_Jul13
Adding OWNERS: - pfeldman@ for components/test_runner/ and Source/modules - raymes@ for ppapi/
4 years ago (2016-12-14 23:37:14 UTC) #16
aelias_OOO_until_Jul13
Also adding reveman@ for components/exo OWNERS
4 years ago (2016-12-15 03:18:22 UTC) #36
raymes
https://codereview.chromium.org/2572323002/diff/140001/ppapi/shared_impl/ppb_gamepad_shared.cc File ppapi/shared_impl/ppb_gamepad_shared.cc (right): https://codereview.chromium.org/2572323002/diff/140001/ppapi/shared_impl/ppb_gamepad_shared.cc#newcode19 ppapi/shared_impl/ppb_gamepad_shared.cc:19: PP_GamepadSampleData& output_pad = output_data->items[i]; Just to check - will ...
4 years ago (2016-12-15 04:14:48 UTC) #37
aelias_OOO_until_Jul13
https://codereview.chromium.org/2572323002/diff/140001/ppapi/shared_impl/ppb_gamepad_shared.cc File ppapi/shared_impl/ppb_gamepad_shared.cc (right): https://codereview.chromium.org/2572323002/diff/140001/ppapi/shared_impl/ppb_gamepad_shared.cc#newcode19 ppapi/shared_impl/ppb_gamepad_shared.cc:19: PP_GamepadSampleData& output_pad = output_data->items[i]; On 2016/12/15 at 04:14:48, raymes ...
4 years ago (2016-12-15 04:19:06 UTC) #38
raymes
Thanks! lgtm
4 years ago (2016-12-15 04:32:22 UTC) #39
reveman
+denniskempin components/exo lgtm
4 years ago (2016-12-15 15:11:31 UTC) #43
aelias_OOO_until_Jul13
OK thanks, just need pfeldman@ OWNERS on components/test_runner/ and Source/modules
4 years ago (2016-12-16 00:04:21 UTC) #44
aelias_OOO_until_Jul13
OK, I'd like OWNERS approval from: - bajones@ for Source/modules/gamepad - rbyers@ for components/test_runner/
3 years, 11 months ago (2017-01-03 22:55:30 UTC) #46
bajones
On 2017/01/03 22:55:30, aelias wrote: > OK, I'd like OWNERS approval from: > - bajones@ ...
3 years, 11 months ago (2017-01-03 22:58:36 UTC) #47
Rick Byers
test_runner LGTM
3 years, 11 months ago (2017-01-04 14:52:16 UTC) #48
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2572323002/160001
3 years, 11 months ago (2017-01-04 20:17:39 UTC) #51
commit-bot: I haz the power
Committed patchset #9 (id:160001)
3 years, 11 months ago (2017-01-04 23:14:14 UTC) #54
commit-bot: I haz the power
3 years, 11 months ago (2017-01-04 23:16:24 UTC) #56
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/5367010cc54ad46dfa4cf535fd8e6527d4460891
Cr-Commit-Position: refs/heads/master@{#441503}

Powered by Google App Engine
This is Rietveld 408576698