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

Issue 195873019: Gamepad API: add support for connection events (Closed)

Created:
6 years, 9 months ago by kbalazs
Modified:
6 years, 7 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, nasko+codewatch_chromium.org, creis+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Gamepad API: add support for connection events Co-authored with Brandon Jones. This CL continues the work of updating the Gamepad API to latest spec. IPC's added for connected and disconnected events. The connection state is observed by GamepadProvider together with polling. The other option would be to add logic to each platform fetcher. Doing it in GamepadProvider avoids duplicated logic and I think it is a bit simpler and more consistent with the polling base nature of the gamepad implementation. Extra care has been taken to make it consistent with the policy of not exposing gamepad data to the page before a user gesture is observed. When a new page starts listening it will not get any events until we see a user gesture. When we see it we notify it about all the connected pads. Now we stop polling as soon as blink is no more interested in gamepad data. BUG=344556 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=269189

Patch Set 1 #

Total comments: 11

Patch Set 2 : fix comments and stop polling when blink is not interested (according to new blink patch) #

Patch Set 3 : some fixes inspired by testing #

Patch Set 4 : add some more comments #

Total comments: 1

Patch Set 5 : fix inspired by testing on Android #

Patch Set 6 : rebased #

Patch Set 7 : some more cleanups #

Patch Set 8 : rebase #

Patch Set 9 : speculative win buildfix by including set #

Patch Set 10 : rework message serialization #

Patch Set 11 : rebase #

Patch Set 12 : rebased correctly #

Patch Set 13 : add WebGamepad to the list of ok POD deps to fix presubmit #

Total comments: 1

Patch Set 14 : fix alignment issue in ipc code #

Total comments: 2

Patch Set 15 : incorp comments and fix build #

Total comments: 10

Patch Set 16 : cleaned up based on jam's comments #

Patch Set 17 : added back export as it is needed #

Patch Set 18 : fix last typo #

Patch Set 19 : and a missing override #

Unified diffs Side-by-side diffs Delta from patch set Stats (+593 lines, -58 lines) Patch
M content/browser/DEPS View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
A content/browser/gamepad/gamepad_consumer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +29 lines, -0 lines 0 comments Download
M content/browser/gamepad/gamepad_provider.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +39 lines, -2 lines 0 comments Download
M content/browser/gamepad/gamepad_provider.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 9 chunks +107 lines, -10 lines 0 comments Download
M content/browser/gamepad/gamepad_service.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 5 chunks +54 lines, -4 lines 0 comments Download
M content/browser/gamepad/gamepad_service.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +87 lines, -13 lines 0 comments Download
M content/browser/renderer_host/gamepad_browser_message_filter.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +12 lines, -1 line 0 comments Download
M content/browser/renderer_host/gamepad_browser_message_filter.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +20 lines, -17 lines 0 comments Download
M content/browser/renderer_host/pepper/pepper_gamepad_host.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 3 chunks +12 lines, -1 line 0 comments Download
M content/browser/renderer_host/pepper/pepper_gamepad_host.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -2 lines 0 comments Download
M content/common/DEPS View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M content/common/gamepad_messages.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +11 lines, -1 line 0 comments Download
A content/common/gamepad_param_traits.h View 1 2 3 4 5 6 7 8 9 1 chunk +32 lines, -0 lines 0 comments Download
A content/common/gamepad_param_traits.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +79 lines, -0 lines 0 comments Download
M content/content_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M content/content_common.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -0 lines 0 comments Download
M content/renderer/gamepad_shared_memory_reader.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +19 lines, -2 lines 0 comments Download
M content/renderer/gamepad_shared_memory_reader.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +65 lines, -2 lines 0 comments Download
M content/renderer/render_thread_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +9 lines, -0 lines 0 comments Download
M content/renderer/render_thread_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +7 lines, -2 lines 0 comments Download
M content/renderer/renderer_webkitplatformsupport_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +4 lines, -1 line 0 comments Download

Messages

Total messages: 86 (0 generated)
kbalazs
This depends on the Blink part: https://codereview.chromium.org/200783002/. PTAL
6 years, 9 months ago (2014-03-14 21:07:31 UTC) #1
jam
https://codereview.chromium.org/195873019/diff/1/content/browser/gamepad/gamepad_consumer.h File content/browser/gamepad/gamepad_consumer.h (right): https://codereview.chromium.org/195873019/diff/1/content/browser/gamepad/gamepad_consumer.h#newcode1 content/browser/gamepad/gamepad_consumer.h:1: // Copyright (c) 2014 The Chromium Authors. All rights ...
6 years, 9 months ago (2014-03-17 19:01:00 UTC) #2
kbalazs
Fixes nits and some other changes. https://codereview.chromium.org/195873019/diff/1/content/browser/gamepad/gamepad_consumer.h File content/browser/gamepad/gamepad_consumer.h (right): https://codereview.chromium.org/195873019/diff/1/content/browser/gamepad/gamepad_consumer.h#newcode1 content/browser/gamepad/gamepad_consumer.h:1: // Copyright (c) ...
6 years, 9 months ago (2014-03-20 20:42:49 UTC) #3
kbalazs
More exactly the additional change is that we stop polling when blink set the listener ...
6 years, 9 months ago (2014-03-20 20:44:07 UTC) #4
jam
On 2014/03/20 20:44:07, kbalazs wrote: > More exactly the additional change is that we stop ...
6 years, 9 months ago (2014-03-24 21:40:41 UTC) #5
bajones
LGTM, but that should be taken with a grain of salt since I wrote a ...
6 years, 9 months ago (2014-03-27 18:56:48 UTC) #6
kbalazs
On 2014/03/27 18:56:48, bajones wrote: > LGTM, but that should be taken with a grain ...
6 years, 9 months ago (2014-03-27 23:25:32 UTC) #7
kbalazs
PTAL?
6 years, 8 months ago (2014-03-31 15:36:59 UTC) #8
kbalazs
On 2014/03/31 15:36:59, kbalazs wrote: > PTAL? I mean the patch changed quite a lot, ...
6 years, 8 months ago (2014-03-31 22:55:43 UTC) #9
bajones
On 2014/03/31 22:55:43, kbalazs wrote: > On 2014/03/31 15:36:59, kbalazs wrote: > > PTAL? > ...
6 years, 8 months ago (2014-04-01 05:29:58 UTC) #10
kbalazs
On 2014/04/01 05:29:58, bajones wrote: > On 2014/03/31 22:55:43, kbalazs wrote: > > On 2014/03/31 ...
6 years, 8 months ago (2014-04-01 21:46:25 UTC) #11
kbalazs
The CQ bit was checked by b.kelemen@samsung.com
6 years, 8 months ago (2014-04-02 17:03:58 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/195873019/160001
6 years, 8 months ago (2014-04-02 17:04:51 UTC) #13
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-02 17:32:23 UTC) #14
commit-bot: I haz the power
Retried try job too often on chromium_presubmit for step(s) presubmit http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=chromium_presubmit&number=59082
6 years, 8 months ago (2014-04-02 17:32:24 UTC) #15
kbalazs
@cdn, @cevans: could you rubber stamp the messages in content/common please?
6 years, 8 months ago (2014-04-02 19:12:59 UTC) #16
Cris Neckar
On 2014/04/02 19:12:59, kbalazs wrote: > @cdn, @cevans: could you rubber stamp the messages in ...
6 years, 8 months ago (2014-04-02 19:54:19 UTC) #17
kbalazs
The CQ bit was checked by b.kelemen@samsung.com
6 years, 8 months ago (2014-04-02 22:46:30 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/b.kelemen@samsung.com/195873019/160001
6 years, 8 months ago (2014-04-02 22:46:37 UTC) #19
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-02 22:55:40 UTC) #20
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on win_chromium_compile_dbg
6 years, 8 months ago (2014-04-02 22:55:40 UTC) #21
kbalazs
On 2014/04/02 22:55:40, I haz the power (commit-bot) wrote: > Try jobs failed on following ...
6 years, 8 months ago (2014-04-03 00:41:02 UTC) #22
kbalazs
On 2014/04/02 19:54:19, Cris Neckar wrote: > On 2014/04/02 19:12:59, kbalazs wrote: > > @cdn, ...
6 years, 8 months ago (2014-04-03 22:40:44 UTC) #23
kbalazs
On 2014/04/03 22:40:44, kbalazs wrote: > On 2014/04/02 19:54:19, Cris Neckar wrote: > > On ...
6 years, 8 months ago (2014-04-08 16:37:46 UTC) #24
kbalazs
Could you please review the messages in content/common? I'm asking it for 2 weeks. I ...
6 years, 8 months ago (2014-04-23 19:14:45 UTC) #25
Cris Neckar
On 2014/04/23 19:14:45, kbalazs wrote: > Could you please review the messages in content/common? I'm ...
6 years, 8 months ago (2014-04-25 17:15:26 UTC) #26
kbalazs
On 2014/04/25 17:15:26, Cris Neckar wrote: > On 2014/04/23 19:14:45, kbalazs wrote: > > Could ...
6 years, 8 months ago (2014-04-25 17:29:44 UTC) #27
Cris Neckar
On 2014/04/25 17:29:44, kbalazs wrote: > On 2014/04/25 17:15:26, Cris Neckar wrote: > > On ...
6 years, 8 months ago (2014-04-25 17:36:14 UTC) #28
kbalazs
The CQ bit was checked by b.kelemen@samsung.com
6 years, 8 months ago (2014-04-25 17:48:39 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/b.kelemen@samsung.com/195873019/200001
6 years, 8 months ago (2014-04-25 17:53:09 UTC) #30
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-25 22:33:58 UTC) #31
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on mac_chromium_compile_dbg
6 years, 8 months ago (2014-04-25 22:33:59 UTC) #32
kbalazs
The CQ bit was checked by b.kelemen@samsung.com
6 years, 8 months ago (2014-04-28 06:28:00 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/b.kelemen@samsung.com/195873019/200001
6 years, 8 months ago (2014-04-28 06:28:33 UTC) #34
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-28 06:37:51 UTC) #35
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on linux_chromium_rel
6 years, 8 months ago (2014-04-28 06:37:51 UTC) #36
kbalazs
The CQ bit was checked by b.kelemen@samsung.com
6 years, 7 months ago (2014-04-28 16:03:32 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/b.kelemen@samsung.com/195873019/220001
6 years, 7 months ago (2014-04-28 16:03:40 UTC) #38
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-04-28 16:17:13 UTC) #39
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on chromium_presubmit
6 years, 7 months ago (2014-04-28 16:17:14 UTC) #40
kbalazs
The CQ bit was checked by b.kelemen@samsung.com
6 years, 7 months ago (2014-04-28 22:07:10 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/b.kelemen@samsung.com/195873019/240001
6 years, 7 months ago (2014-04-28 22:08:18 UTC) #42
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-04-28 23:04:35 UTC) #43
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on chromium_presubmit
6 years, 7 months ago (2014-04-28 23:04:36 UTC) #44
kbalazs
On 2014/04/28 23:04:36, I haz the power (commit-bot) wrote: > Try jobs failed on following ...
6 years, 7 months ago (2014-04-28 23:42:06 UTC) #45
abarth-chromium
https://codereview.chromium.org/195873019/diff/240001/content/browser/DEPS File content/browser/DEPS (right): https://codereview.chromium.org/195873019/diff/240001/content/browser/DEPS#newcode36 content/browser/DEPS:36: "+third_party/WebKit/public/platform/WebGamepad.h", LGTM
6 years, 7 months ago (2014-04-29 16:58:47 UTC) #46
kbalazs
The CQ bit was checked by b.kelemen@samsung.com
6 years, 7 months ago (2014-04-29 16:59:42 UTC) #47
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/b.kelemen@samsung.com/195873019/240001
6 years, 7 months ago (2014-04-29 17:00:39 UTC) #48
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-04-30 02:45:53 UTC) #49
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_x64_rel on tryserver.chromium
6 years, 7 months ago (2014-04-30 02:45:54 UTC) #50
kbalazs
On 2014/04/30 02:45:54, I haz the power (commit-bot) wrote: > Try jobs failed on following ...
6 years, 7 months ago (2014-04-30 18:21:49 UTC) #51
kbalazs
On 2014/04/30 18:21:49, kbalazs wrote: > On 2014/04/30 02:45:54, I haz the power (commit-bot) wrote: ...
6 years, 7 months ago (2014-05-02 18:20:10 UTC) #52
kbalazs
On 2014/05/02 18:20:10, kbalazs wrote: > On 2014/04/30 18:21:49, kbalazs wrote: > > On 2014/04/30 ...
6 years, 7 months ago (2014-05-02 18:23:15 UTC) #53
kbalazs
The CQ bit was checked by b.kelemen@samsung.com
6 years, 7 months ago (2014-05-02 18:23:46 UTC) #54
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/b.kelemen@samsung.com/195873019/260001
6 years, 7 months ago (2014-05-02 18:24:56 UTC) #55
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-05-02 22:18:09 UTC) #56
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel on tryserver.chromium
6 years, 7 months ago (2014-05-02 22:18:10 UTC) #57
bajones
On 2014/05/02 22:18:10, I haz the power (commit-bot) wrote: > Try jobs failed on following ...
6 years, 7 months ago (2014-05-02 22:27:49 UTC) #58
bajones
On 2014/05/02 22:27:49, bajones wrote: > On 2014/05/02 22:18:10, I haz the power (commit-bot) wrote: ...
6 years, 7 months ago (2014-05-02 23:06:53 UTC) #59
kbalazs
On 2014/05/02 23:06:53, bajones wrote: > On 2014/05/02 22:27:49, bajones wrote: > > On 2014/05/02 ...
6 years, 7 months ago (2014-05-02 23:25:54 UTC) #60
jam
https://codereview.chromium.org/195873019/diff/260001/content/renderer/render_thread_impl.h File content/renderer/render_thread_impl.h (right): https://codereview.chromium.org/195873019/diff/260001/content/renderer/render_thread_impl.h#newcode372 content/renderer/render_thread_impl.h:372: void SetGamepadListener(blink::WebGamepadListener* listener); nit: how about we remove this ...
6 years, 7 months ago (2014-05-05 17:20:31 UTC) #61
jam
https://codereview.chromium.org/195873019/diff/260001/content/browser/renderer_host/gamepad_browser_message_filter.h File content/browser/renderer_host/gamepad_browser_message_filter.h (right): https://codereview.chromium.org/195873019/diff/260001/content/browser/renderer_host/gamepad_browser_message_filter.h#newcode22 content/browser/renderer_host/gamepad_browser_message_filter.h:22: explicit GamepadBrowserMessageFilter(IPC::Sender* sender); this isn't safe, since the filter ...
6 years, 7 months ago (2014-05-05 17:42:59 UTC) #62
kbalazs
> > I forgot about this error with the macro. That's why I was trying ...
6 years, 7 months ago (2014-05-05 21:04:13 UTC) #63
kbalazs
On 2014/05/05 17:20:31, jam wrote: > https://codereview.chromium.org/195873019/diff/260001/content/renderer/render_thread_impl.h > File content/renderer/render_thread_impl.h (right): > > https://codereview.chromium.org/195873019/diff/260001/content/renderer/render_thread_impl.h#newcode372 > ...
6 years, 7 months ago (2014-05-05 21:04:56 UTC) #64
kbalazs
On 2014/05/05 17:42:59, jam wrote: > https://codereview.chromium.org/195873019/diff/260001/content/browser/renderer_host/gamepad_browser_message_filter.h > File content/browser/renderer_host/gamepad_browser_message_filter.h (right): > > https://codereview.chromium.org/195873019/diff/260001/content/browser/renderer_host/gamepad_browser_message_filter.h#newcode22 > ...
6 years, 7 months ago (2014-05-05 21:05:13 UTC) #65
jam
I took a closer look at this cl and here are my (last, promise) round ...
6 years, 7 months ago (2014-05-05 21:19:08 UTC) #66
kbalazs
Nits fixed, suggestions incorporated. https://codereview.chromium.org/195873019/diff/270001/content/browser/renderer_host/pepper/pepper_gamepad_host.h File content/browser/renderer_host/pepper/pepper_gamepad_host.h (right): https://codereview.chromium.org/195873019/diff/270001/content/browser/renderer_host/pepper/pepper_gamepad_host.h#newcode27 content/browser/renderer_host/pepper/pepper_gamepad_host.h:27: public GamepadConsumer { On 2014/05/05 ...
6 years, 7 months ago (2014-05-06 22:20:33 UTC) #67
kbalazs
@jam: I guess you want to take a final rubber-stamp, so PTAL.
6 years, 7 months ago (2014-05-06 23:01:12 UTC) #68
jam
lgtm
6 years, 7 months ago (2014-05-06 23:39:13 UTC) #69
kbalazs
The CQ bit was checked by b.kelemen@samsung.com
6 years, 7 months ago (2014-05-07 01:24:19 UTC) #70
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/b.kelemen@samsung.com/195873019/310001
6 years, 7 months ago (2014-05-07 01:28:52 UTC) #71
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). Please consider checking whether the failures are ...
6 years, 7 months ago (2014-05-07 12:59:03 UTC) #72
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #2). Please consider checking whether the failures are ...
6 years, 7 months ago (2014-05-07 14:35:18 UTC) #73
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-05-07 14:46:12 UTC) #74
commit-bot: I haz the power
Try jobs failed on following builders: android_clang_dbg on tryserver.chromium
6 years, 7 months ago (2014-05-07 14:46:14 UTC) #75
kbalazs
The CQ bit was checked by b.kelemen@samsung.com
6 years, 7 months ago (2014-05-07 16:23:28 UTC) #76
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/b.kelemen@samsung.com/195873019/330001
6 years, 7 months ago (2014-05-07 16:24:35 UTC) #77
kbalazs
The CQ bit was checked by b.kelemen@samsung.com
6 years, 7 months ago (2014-05-07 18:03:01 UTC) #78
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/b.kelemen@samsung.com/195873019/350001
6 years, 7 months ago (2014-05-07 18:08:13 UTC) #79
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). Please consider checking whether the failures are ...
6 years, 7 months ago (2014-05-08 17:50:16 UTC) #80
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-05-08 22:54:09 UTC) #81
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/win_chromium_rel/builds/13702)
6 years, 7 months ago (2014-05-08 22:54:10 UTC) #82
kbalazs
The CQ bit was checked by b.kelemen@samsung.com
6 years, 7 months ago (2014-05-08 23:42:40 UTC) #83
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/b.kelemen@samsung.com/195873019/350001
6 years, 7 months ago (2014-05-08 23:53:00 UTC) #84
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). Please consider checking whether the failures are ...
6 years, 7 months ago (2014-05-09 06:21:12 UTC) #85
commit-bot: I haz the power
6 years, 7 months ago (2014-05-09 09:09:49 UTC) #86
Message was sent while issue was closed.
Change committed as 269189

Powered by Google App Engine
This is Rietveld 408576698