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

Issue 200783002: Gamepad API: add support for gamepadconnected and gamepaddisconnected events (Closed)

Created:
6 years, 9 months ago by kbalazs
Modified:
6 years, 9 months ago
CC:
blink-reviews, Nils Barth (inactive), jamesr, kojih, arv+blink, jsbell+bindings_chromium.org, sof, kouhei+bindings_chromium.org, abarth-chromium, marja+watch_chromium.org, dglazkov+blink, adamk+blink_chromium.org, haraken, Nate Chapin
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Gamepad API: add support for gamepadconnected and gamepaddisconnected events Co-authored with Brandon Jones. This CL continues the work of updating the Gamepad API to latest spec. NavigatorGamepad implements WebGamepadListener which is the interface chromium will talk to when dispatching gamepad events. The implementation follows the dispatcher-controller pattern used by device motion and device orientation. There is some difference though because the gamepad data is polled instead of pushed by the platform. BUG=344556 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=169716

Patch Set 1 #

Total comments: 22

Patch Set 2 : unviolate layering and other fixes #

Patch Set 3 : fix missing check for event type #

Total comments: 10

Patch Set 4 : address comments #

Total comments: 12

Patch Set 5 : rework in terms of dispather&controller pattern used by motion and orientation #

Total comments: 2

Patch Set 6 : remaining fixes #

Patch Set 7 : typo fix mistyped override #

Patch Set 8 : layout fix: webexposed/global-constructors-listing #

Unified diffs Side-by-side diffs Delta from patch set Stats (+433 lines, -23 lines) Patch
M LayoutTests/virtual/stable/webexposed/global-constructors-listing-expected.txt View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M LayoutTests/webexposed/global-constructors-listing-expected.txt View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M Source/bindings/v8/Dictionary.h View 2 chunks +2 lines, -0 lines 0 comments Download
M Source/bindings/v8/Dictionary.cpp View 3 chunks +12 lines, -0 lines 0 comments Download
M Source/core/events/EventTypeNames.in View 1 chunk +2 lines, -0 lines 0 comments Download
A Source/modules/gamepad/GamepadDispatcher.h View 1 2 3 4 1 chunk +42 lines, -0 lines 0 comments Download
A Source/modules/gamepad/GamepadDispatcher.cpp View 1 2 3 4 1 chunk +80 lines, -0 lines 0 comments Download
A Source/modules/gamepad/GamepadEvent.h View 1 2 3 4 5 1 chunk +51 lines, -0 lines 0 comments Download
A Source/modules/gamepad/GamepadEvent.cpp View 1 chunk +49 lines, -0 lines 0 comments Download
A + Source/modules/gamepad/GamepadEvent.idl View 1 chunk +3 lines, -4 lines 0 comments Download
M Source/modules/gamepad/NavigatorGamepad.h View 1 2 3 4 5 6 2 chunks +31 lines, -3 lines 0 comments Download
M Source/modules/gamepad/NavigatorGamepad.cpp View 1 2 3 4 5 6 6 chunks +123 lines, -14 lines 0 comments Download
M Source/modules/modules.gypi View 1 2 3 4 2 chunks +5 lines, -0 lines 0 comments Download
M Source/web/FrameLoaderClientImpl.cpp View 1 2 3 4 2 chunks +3 lines, -0 lines 0 comments Download
M public/platform/Platform.h View 1 2 3 4 5 2 chunks +3 lines, -0 lines 0 comments Download
A public/platform/WebGamepadListener.h View 1 2 3 1 chunk +23 lines, -0 lines 0 comments Download
M public/platform/WebGamepads.h View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 32 (0 generated)
kbalazs
I need some help as this adds a call from core to modules which is ...
6 years, 9 months ago (2014-03-14 19:28:16 UTC) #1
Inactive
https://codereview.chromium.org/200783002/diff/1/Source/core/frame/DOMWindow.cpp File Source/core/frame/DOMWindow.cpp (right): https://codereview.chromium.org/200783002/diff/1/Source/core/frame/DOMWindow.cpp#newcode108 Source/core/frame/DOMWindow.cpp:108: // FIXME: this is a layering vilation. Yes, we ...
6 years, 9 months ago (2014-03-14 19:46:07 UTC) #2
Inactive
Also, you'll probably need layout testing.
6 years, 9 months ago (2014-03-14 19:50:21 UTC) #3
sof
https://codereview.chromium.org/200783002/diff/1/Source/core/frame/DOMWindow.cpp File Source/core/frame/DOMWindow.cpp (right): https://codereview.chromium.org/200783002/diff/1/Source/core/frame/DOMWindow.cpp#newcode1524 Source/core/frame/DOMWindow.cpp:1524: } else if (eventType == EventTypeNames::gamepadconnected || eventType == ...
6 years, 9 months ago (2014-03-14 20:52:42 UTC) #4
kbalazs
Layering violation solved. For layout testing we will need to extend WebKitTestRunner which lives in ...
6 years, 9 months ago (2014-03-14 23:51:26 UTC) #5
abarth-chromium
https://codereview.chromium.org/200783002/diff/40001/Source/modules/gamepad/NavigatorGamepad.cpp File Source/modules/gamepad/NavigatorGamepad.cpp (right): https://codereview.chromium.org/200783002/diff/40001/Source/modules/gamepad/NavigatorGamepad.cpp#newcode81 Source/modules/gamepad/NavigatorGamepad.cpp:81: blink::Platform::current()->setGamepadListener(0); This line sets a static field in the ...
6 years, 9 months ago (2014-03-17 18:23:46 UTC) #6
kbalazs
Comments incorporated, PTAL. https://codereview.chromium.org/200783002/diff/40001/Source/modules/gamepad/NavigatorGamepad.cpp File Source/modules/gamepad/NavigatorGamepad.cpp (right): https://codereview.chromium.org/200783002/diff/40001/Source/modules/gamepad/NavigatorGamepad.cpp#newcode81 Source/modules/gamepad/NavigatorGamepad.cpp:81: blink::Platform::current()->setGamepadListener(0); On 2014/03/17 18:23:46, abarth wrote: ...
6 years, 9 months ago (2014-03-17 23:49:27 UTC) #7
abarth-chromium
https://codereview.chromium.org/200783002/diff/60001/Source/modules/gamepad/NavigatorGamepad.cpp File Source/modules/gamepad/NavigatorGamepad.cpp (right): https://codereview.chromium.org/200783002/diff/60001/Source/modules/gamepad/NavigatorGamepad.cpp#newcode42 Source/modules/gamepad/NavigatorGamepad.cpp:42: class GlobalGamepadListener : public blink::WebGamepadListener { Can you put ...
6 years, 9 months ago (2014-03-19 18:00:32 UTC) #8
kbalazs
Reworked to use DeviceSensorEventDispatcher and DeviceSensorEventController. PTAL. https://codereview.chromium.org/200783002/diff/60001/Source/modules/gamepad/NavigatorGamepad.cpp File Source/modules/gamepad/NavigatorGamepad.cpp (right): https://codereview.chromium.org/200783002/diff/60001/Source/modules/gamepad/NavigatorGamepad.cpp#newcode59 Source/modules/gamepad/NavigatorGamepad.cpp:59: blink::Platform::current()->setGamepadListener(this); On ...
6 years, 9 months ago (2014-03-20 18:57:20 UTC) #9
sof
https://codereview.chromium.org/200783002/diff/80001/Source/modules/gamepad/GamepadEvent.h File Source/modules/gamepad/GamepadEvent.h (right): https://codereview.chromium.org/200783002/diff/80001/Source/modules/gamepad/GamepadEvent.h#newcode46 Source/modules/gamepad/GamepadEvent.h:46: RefPtrWillBeMember<Gamepad> m_gamepad; Please use RefPtrWillBePersistent as Events aren't garbage ...
6 years, 9 months ago (2014-03-20 19:54:39 UTC) #10
abarth-chromium
LGTM modulo sof's comment https://codereview.chromium.org/200783002/diff/80001/public/platform/Platform.h File public/platform/Platform.h (right): https://codereview.chromium.org/200783002/diff/80001/public/platform/Platform.h#newcode221 public/platform/Platform.h:221: Please keep two blank lines ...
6 years, 9 months ago (2014-03-20 20:10:09 UTC) #11
kbalazs
The CQ bit was checked by b.kelemen@samsung.com
6 years, 9 months ago (2014-03-20 22:03:09 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/b.kelemen@samsung.com/200783002/100001
6 years, 9 months ago (2014-03-20 22:03:19 UTC) #13
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-20 22:15:28 UTC) #14
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.blink on mac_blink_compile_dbg
6 years, 9 months ago (2014-03-20 22:15:29 UTC) #15
kbalazs
The CQ bit was checked by b.kelemen@samsung.com
6 years, 9 months ago (2014-03-20 22:38:34 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/b.kelemen@samsung.com/200783002/120001
6 years, 9 months ago (2014-03-20 22:38:41 UTC) #17
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-20 22:39:56 UTC) #18
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.blink on mac_blink_rel
6 years, 9 months ago (2014-03-20 22:39:57 UTC) #19
bajones
Just wanted to say thanks to kbalazs@ for carrying this forward. A lot of the ...
6 years, 9 months ago (2014-03-20 22:42:14 UTC) #20
kbalazs
The CQ bit was checked by b.kelemen@samsung.com
6 years, 9 months ago (2014-03-20 23:16:03 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/b.kelemen@samsung.com/200783002/120001
6 years, 9 months ago (2014-03-20 23:16:09 UTC) #22
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-20 23:16:38 UTC) #23
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.blink on linux_blink_rel
6 years, 9 months ago (2014-03-20 23:16:39 UTC) #24
kbalazs
On 2014/03/20 22:42:14, bajones wrote: > Just wanted to say thanks to kbalazs@ for carrying ...
6 years, 9 months ago (2014-03-20 23:16:48 UTC) #25
kbalazs
The CQ bit was checked by b.kelemen@samsung.com
6 years, 9 months ago (2014-03-20 23:26:32 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/b.kelemen@samsung.com/200783002/140001
6 years, 9 months ago (2014-03-20 23:26:41 UTC) #27
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-20 23:28:56 UTC) #28
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.blink on mac_blink_compile_dbg
6 years, 9 months ago (2014-03-20 23:28:57 UTC) #29
kbalazs
The CQ bit was checked by b.kelemen@samsung.com
6 years, 9 months ago (2014-03-21 02:38:33 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/b.kelemen@samsung.com/200783002/140001
6 years, 9 months ago (2014-03-21 02:38:38 UTC) #31
commit-bot: I haz the power
6 years, 9 months ago (2014-03-21 02:57:51 UTC) #32
Message was sent while issue was closed.
Change committed as 169716

Powered by Google App Engine
This is Rietveld 408576698