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

Issue 10912062: Implement the gamepad API in the IPC proxy (Closed)

Created:
8 years, 3 months ago by brettw
Modified:
8 years, 3 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, jam
Visibility:
Public.

Description

Implement the gamepad API in the IPC proxy This does some reworking of the gamepad system to make it possible to hook in (previously it assumed that it was only talking to renderers) and I did some cleanup. Gamepad files were renamed to match the classes, and I did a bunch of test infrastructure work. IMPORTANT BEHAVIOR CHANGE: This changes the Web gamepad API to report all gamepad data as soon as any of them are interacted with. This is what we need to do for Pepper anyway (since it gets all or none of the share memory) and I think makes more sense for most consumers anyway. I separated out the user gesture detection code into a place where it can be used in the browser process as well, and exposed functionality in the gamepad provider to be notified when a user gesture happens. The existing gamepad test was disabled and had bitrotted. This fixes it. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=155676 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=155860

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Total comments: 12

Patch Set 5 : #

Total comments: 2

Patch Set 6 : #

Patch Set 7 : #

Patch Set 8 : tweaks #

Patch Set 9 : add host to broker to keep it from crashing #

Patch Set 10 : #

Patch Set 11 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2327 lines, -1324 lines) Patch
M content/browser/browser_main_loop.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +4 lines, -2 lines 0 comments Download
D content/browser/gamepad/data_fetcher.h View 1 chunk +0 lines, -24 lines 0 comments Download
A content/browser/gamepad/gamepad_data_fetcher.h View 1 2 7 8 1 chunk +26 lines, -0 lines 0 comments Download
A content/browser/gamepad/gamepad_platform_data_fetcher.h View 7 8 1 chunk +55 lines, -0 lines 0 comments Download
A content/browser/gamepad/gamepad_platform_data_fetcher.cc View 7 8 1 chunk +19 lines, -0 lines 0 comments Download
A content/browser/gamepad/gamepad_platform_data_fetcher_linux.h View 7 8 1 chunk +56 lines, -0 lines 0 comments Download
A content/browser/gamepad/gamepad_platform_data_fetcher_linux.cc View 7 8 1 chunk +258 lines, -0 lines 0 comments Download
A content/browser/gamepad/gamepad_platform_data_fetcher_mac.h View 7 8 1 chunk +82 lines, -0 lines 0 comments Download
A content/browser/gamepad/gamepad_platform_data_fetcher_mac.mm View 7 8 1 chunk +313 lines, -0 lines 0 comments Download
A content/browser/gamepad/gamepad_platform_data_fetcher_win.h View 7 8 1 chunk +57 lines, -0 lines 0 comments Download
A content/browser/gamepad/gamepad_platform_data_fetcher_win.cc View 7 8 1 chunk +168 lines, -0 lines 0 comments Download
M content/browser/gamepad/gamepad_provider.h View 1 2 3 4 5 6 7 8 9 6 chunks +40 lines, -6 lines 0 comments Download
M content/browser/gamepad/gamepad_provider.cc View 1 2 3 4 5 6 7 8 9 5 chunks +69 lines, -32 lines 0 comments Download
M content/browser/gamepad/gamepad_provider_unittest.cc View 5 chunks +79 lines, -30 lines 0 comments Download
M content/browser/gamepad/gamepad_service.h View 1 chunk +38 lines, -34 lines 0 comments Download
content/browser/gamepad/gamepad_service.cc View 1 2 3 4 5 2 chunks +28 lines, -54 lines 0 comments Download
A content/browser/gamepad/gamepad_test_helpers.h View 1 2 3 1 chunk +90 lines, -0 lines 0 comments Download
A content/browser/gamepad/gamepad_test_helpers.cc View 1 2 3 1 chunk +60 lines, -0 lines 0 comments Download
D content/browser/gamepad/platform_data_fetcher.h View 1 chunk +0 lines, -55 lines 0 comments Download
D content/browser/gamepad/platform_data_fetcher.cc View 1 chunk +0 lines, -19 lines 0 comments Download
D content/browser/gamepad/platform_data_fetcher_linux.h View 1 chunk +0 lines, -56 lines 0 comments Download
D content/browser/gamepad/platform_data_fetcher_linux.cc View 1 chunk +0 lines, -258 lines 0 comments Download
D content/browser/gamepad/platform_data_fetcher_mac.h View 1 chunk +0 lines, -82 lines 0 comments Download
D content/browser/gamepad/platform_data_fetcher_mac.mm View 1 chunk +0 lines, -313 lines 0 comments Download
D content/browser/gamepad/platform_data_fetcher_win.h View 1 chunk +0 lines, -57 lines 0 comments Download
D content/browser/gamepad/platform_data_fetcher_win.cc View 1 chunk +0 lines, -168 lines 0 comments Download
M content/browser/ppapi_plugin_process_host.cc View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -0 lines 0 comments Download
content/browser/renderer_host/gamepad_browser_message_filter.h View 2 chunks +3 lines, -4 lines 0 comments Download
M content/browser/renderer_host/gamepad_browser_message_filter.cc View 1 2 3 4 2 chunks +20 lines, -6 lines 0 comments Download
M content/browser/renderer_host/pepper/browser_ppapi_host_impl.h View 1 2 3 4 5 3 chunks +15 lines, -2 lines 0 comments Download
M content/browser/renderer_host/pepper/browser_ppapi_host_impl.cc View 2 chunks +8 lines, -1 line 0 comments Download
A content/browser/renderer_host/pepper/browser_ppapi_host_test.h View 1 2 3 1 chunk +37 lines, -0 lines 0 comments Download
A content/browser/renderer_host/pepper/browser_ppapi_host_test.cc View 1 2 3 1 chunk +27 lines, -0 lines 0 comments Download
M content/browser/renderer_host/pepper/pepper_gamepad_host.h View 2 chunks +24 lines, -0 lines 0 comments Download
M content/browser/renderer_host/pepper/pepper_gamepad_host.cc View 1 2 3 4 5 6 3 chunks +50 lines, -2 lines 0 comments Download
A content/browser/renderer_host/pepper/pepper_gamepad_host_unittest.cc View 1 2 3 4 5 6 1 chunk +204 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_process_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M content/common/gamepad_hardware_buffer.h View 1 1 chunk +1 line, -1 line 0 comments Download
A content/common/gamepad_user_gesture.h View 1 2 3 1 chunk +20 lines, -0 lines 0 comments Download
A content/common/gamepad_user_gesture.cc View 1 2 3 4 5 1 chunk +33 lines, -0 lines 0 comments Download
M content/content_browser.gypi View 1 2 3 4 5 6 7 8 9 10 2 chunks +8 lines, -8 lines 0 comments Download
M content/content_common.gypi View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M content/content_tests.gypi View 1 2 3 4 5 6 7 8 9 10 3 chunks +9 lines, -0 lines 0 comments Download
M content/ppapi_plugin/ppapi_thread.h View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M content/ppapi_plugin/ppapi_thread.cc View 1 2 3 2 chunks +9 lines, -0 lines 0 comments Download
M content/public/browser/browser_ppapi_host.h View 2 chunks +7 lines, -1 line 0 comments Download
M content/renderer/gamepad_shared_memory_reader.h View 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/gamepad_shared_memory_reader.cc View 1 4 chunks +23 lines, -23 lines 0 comments Download
content/renderer/pepper/pepper_file_chooser_host.cc View 1 chunk +1 line, -3 lines 0 comments Download
M ppapi/examples/gamepad/gamepad.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M ppapi/host/dispatch_host_message.h View 1 2 3 4 5 6 1 chunk +3 lines, -4 lines 0 comments Download
M ppapi/host/host_message_context.h View 1 chunk +7 lines, -3 lines 0 comments Download
A ppapi/host/host_message_context.cc View 1 2 3 1 chunk +24 lines, -0 lines 0 comments Download
M ppapi/host/ppapi_host.h View 1 chunk +1 line, -1 line 0 comments Download
M ppapi/host/ppapi_host.cc View 1 chunk +2 lines, -1 line 0 comments Download
M ppapi/host/resource_host.h View 1 chunk +3 lines, -1 line 0 comments Download
M ppapi/ppapi_host.gypi View 1 chunk +1 line, -0 lines 0 comments Download
M ppapi/ppapi_shared.gypi View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M ppapi/proxy/dispatch_reply_message.h View 1 2 3 4 5 6 1 chunk +16 lines, -9 lines 0 comments Download
M ppapi/proxy/gamepad_resource.h View 1 2 3 4 5 6 2 chunks +7 lines, -3 lines 0 comments Download
ppapi/proxy/gamepad_resource.cc View 1 2 3 4 5 6 2 chunks +72 lines, -15 lines 0 comments Download
M ppapi/proxy/plugin_dispatcher.h View 1 2 3 1 chunk +7 lines, -0 lines 0 comments Download
M ppapi/proxy/plugin_dispatcher.cc View 1 2 3 2 chunks +14 lines, -7 lines 0 comments Download
M ppapi/proxy/ppapi_messages.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +8 lines, -2 lines 0 comments Download
M ppapi/proxy/resource_message_params.h View 1 2 3 4 5 6 8 3 chunks +35 lines, -0 lines 0 comments Download
M ppapi/proxy/resource_message_params.cc View 1 2 3 4 5 6 8 1 chunk +40 lines, -1 line 0 comments Download
M ppapi/shared_impl/ppapi_permissions.h View 2 chunks +6 lines, -0 lines 0 comments Download
M ppapi/shared_impl/ppapi_permissions.cc View 1 chunk +8 lines, -0 lines 0 comments Download
A ppapi/shared_impl/ppb_gamepad_shared.h View 1 2 3 1 chunk +78 lines, -0 lines 0 comments Download
A ppapi/shared_impl/ppb_gamepad_shared.cc View 1 2 3 1 chunk +37 lines, -0 lines 0 comments Download
M webkit/plugins/ppapi/event_conversion.h View 1 2 chunks +0 lines, -6 lines 0 comments Download
M webkit/plugins/ppapi/event_conversion.cc View 1 1 chunk +0 lines, -26 lines 0 comments Download
M webkit/plugins/ppapi/ppapi_plugin_instance.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +3 lines, -1 line 0 comments Download

Messages

Total messages: 18 (0 generated)
brettw
Don't panic, this is not as scary as it looks. scottmg: Please review - content/browser/gamepad ...
8 years, 3 months ago (2012-09-04 22:23:09 UTC) #1
scottmg
content/browser and content/common lgtm. Thanks for all the cleanup! https://chromiumcodereview.appspot.com/10912062/diff/8001/content/browser/gamepad/gamepad_provider.h File content/browser/gamepad/gamepad_provider.h (right): https://chromiumcodereview.appspot.com/10912062/diff/8001/content/browser/gamepad/gamepad_provider.h#newcode37 content/browser/gamepad/gamepad_provider.h:37: ...
8 years, 3 months ago (2012-09-05 16:42:05 UTC) #2
raymes
Just nits but I want to go over it one more time. http://codereview.chromium.org/10912062/diff/8001/content/browser/renderer_host/gamepad_browser_message_filter.cc File content/browser/renderer_host/gamepad_browser_message_filter.cc ...
8 years, 3 months ago (2012-09-05 21:05:57 UTC) #3
brettw
New snap up. PTAL. http://codereview.chromium.org/10912062/diff/8001/content/browser/gamepad/gamepad_provider.h File content/browser/gamepad/gamepad_provider.h (right): http://codereview.chromium.org/10912062/diff/8001/content/browser/gamepad/gamepad_provider.h#newcode37 content/browser/gamepad/gamepad_provider.h:37: explicit GamepadProvider(scoped_ptr<GamepadDataFetcher> fetcher); Yes, this ...
8 years, 3 months ago (2012-09-05 21:25:51 UTC) #4
raymes
https://chromiumcodereview.appspot.com/10912062/diff/10003/content/browser/gamepad/gamepad_provider.cc File content/browser/gamepad/gamepad_provider.cc (right): https://chromiumcodereview.appspot.com/10912062/diff/10003/content/browser/gamepad/gamepad_provider.cc#newcode83 content/browser/gamepad/gamepad_provider.cc:83: void GamepadProvider::RegisterForUserGesture(const base::Closure& closure) { This must be called ...
8 years, 3 months ago (2012-09-05 23:37:13 UTC) #5
raymes
non- content/browser/gamepad/* code looks ok. Looks like the gamepad_provider_unittest is failing though and there are ...
8 years, 3 months ago (2012-09-06 04:07:53 UTC) #6
brettw
This should fix the test (it was reading uninitialized data, the fix is in gamepad_user_gesture ...
8 years, 3 months ago (2012-09-06 18:24:25 UTC) #7
raymes
On 2012/09/06 18:24:25, brettw wrote: > This should fix the test (it was reading uninitialized ...
8 years, 3 months ago (2012-09-06 18:29:20 UTC) #8
brettw
New snap up with PPAPI resource message handle sharing. I added a handle vector and ...
8 years, 3 months ago (2012-09-06 22:03:57 UTC) #9
brettw
You should be able to diff patches 6 & 7 to see what changed.
8 years, 3 months ago (2012-09-06 22:06:18 UTC) #10
brettw
I made the new general-purpose handle getter private after a suggestion from David Michael and ...
8 years, 3 months ago (2012-09-06 22:18:07 UTC) #11
raymes
lgtm
8 years, 3 months ago (2012-09-06 22:27:41 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/brettw@chromium.org/10912062/16017
8 years, 3 months ago (2012-09-09 23:36:26 UTC) #13
commit-bot: I haz the power
Failed to apply patch for ppapi/proxy/ppapi_messages.h: While running patch -p1 --forward --force; patching file ppapi/proxy/ppapi_messages.h ...
8 years, 3 months ago (2012-09-09 23:36:43 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/brettw@chromium.org/10912062/12012
8 years, 3 months ago (2012-09-10 04:52:01 UTC) #15
commit-bot: I haz the power
Change committed as 155676
8 years, 3 months ago (2012-09-10 07:06:41 UTC) #16
Isaac (away)
Hello! This CL has broken a unit test on the android tester http://build.chromium.org/p/chromium.linux/builders/Android%20Tester%20%28dbg%29 See here ...
8 years, 3 months ago (2012-09-10 08:56:58 UTC) #17
Isaac (away)
8 years, 3 months ago (2012-09-10 08:56:59 UTC) #18
Hello!  This CL has broken a unit test on the android tester
http://build.chromium.org/p/chromium.linux/builders/Android%20Tester%20%28dbg%29

See here
[http://build.chromium.org/p/chromium.linux/builders/Android%20Tester%20%28dbg%29/builds/37/steps/Logcat%20dump/logs/stdio
] and search for GamepadProviderTest.PollingAccess

Powered by Google App Engine
This is Rietveld 408576698