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

Issue 2522843002: Convert Gamepad IPC messages into mojo interface. (Closed)

Created:
4 years, 1 month ago by ke.he
Modified:
4 years ago
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, creis+watch_chromium.org, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, nasko+codewatch_chromium.org, jam, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, darin-cc_chromium.org, darin (slow to review)
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Convert Gamepad IPC messages into mojo interface. This patch is a subtask of "Decoupling Gamepad from //content". The Gamepad IPC messages are converted into mojo interfaces, so the GamepadBrowserMessageFilter doesn't need to extend BrowserMessageFilter anymore so we renamed it as GamepadMonitor. GamepadMonitor still extend GamepadConsumer interface. Each RenderProcessHost owns one GamepadMonitor. GamepadMonitor instance is created by "StrongBinding" and will be registered into the "ConsumerSet" of GamepadService. The base::SharedMemory handle are wrapped into mojo::SharedMemoryHandle and passed as parameter of mojo interface from Browser to Renderer, Renderer Process unwrap it to get the real shared memory contents. Note that to obtain a new SharedMemoryHandle to wrap in a Mojo handle we simply clone the existing one. While it's not obvious, this is functionally equivalent to the old approach of passing the peer handle: when the renderer unwraps the Mojo handle that it obtained into a base::SharedMemoryHandle, it fills in that handle with its own process ID. BUG=612330 Committed: https://crrev.com/0bb26d507b0a3ee05b01784841b850e22e58eec5 Cr-Commit-Position: refs/heads/master@{#437477}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Convert GamepadMsg_GamepadConnected/Disconnected msgs to mojo interface. #

Patch Set 3 : remove IPC messages #

Patch Set 4 : trybot strangely failed, code rebase. #

Total comments: 2

Patch Set 5 : Convert Gamepad IPC messages into mojo interface. #

Patch Set 6 : remove useless Fuzztraits<blink::WebGamepad> #

Total comments: 7

Patch Set 7 : add GetSharedMemoryHandle() in GamepadService. #

Total comments: 6

Patch Set 8 : hide the "sharedmemory wrap" in GamepadService. #

Total comments: 1

Patch Set 9 : Convert Gamepad IPC messages into mojo interface. #

Total comments: 18

Patch Set 10 : Convert Gamepad IPC messages into mojo interface. #

Patch Set 11 : Convert Gamepad IPC messages into mojo interface. #

Patch Set 12 : code rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+198 lines, -324 lines) Patch
M content/browser/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +3 lines, -2 lines 0 comments Download
M content/browser/gamepad/gamepad_service.h View 1 2 3 4 5 6 7 8 9 2 chunks +4 lines, -0 lines 0 comments Download
M content/browser/gamepad/gamepad_service.cc View 1 2 3 4 5 6 7 8 9 2 chunks +12 lines, -0 lines 0 comments Download
M content/browser/renderer_host/gamepad_browser_message_filter.h View 1 2 3 4 1 chunk +0 lines, -44 lines 0 comments Download
M content/browser/renderer_host/gamepad_browser_message_filter.cc View 1 2 3 4 1 chunk +0 lines, -67 lines 0 comments Download
A content/browser/renderer_host/gamepad_monitor.h View 1 2 3 4 5 6 1 chunk +44 lines, -0 lines 0 comments Download
A content/browser/renderer_host/gamepad_monitor.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +65 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 11 3 chunks +3 lines, -2 lines 0 comments Download
M content/common/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -3 lines 0 comments Download
M content/common/content_message_generator.h View 1 2 3 4 1 chunk +0 lines, -1 line 0 comments Download
M content/common/gamepad_messages.h View 1 2 3 4 1 chunk +0 lines, -33 lines 0 comments Download
D content/common/gamepad_param_traits.h View 1 2 1 chunk +0 lines, -33 lines 0 comments Download
D content/common/gamepad_param_traits.cc View 1 2 1 chunk +0 lines, -79 lines 0 comments Download
M content/public/app/mojo/content_browser_manifest.json View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/DEPS View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/gamepad_shared_memory_reader.h View 1 2 3 4 3 chunks +12 lines, -5 lines 0 comments Download
M content/renderer/gamepad_shared_memory_reader.cc View 1 2 3 4 5 6 7 8 9 4 chunks +23 lines, -17 lines 0 comments Download
M device/gamepad/gamepad_provider.h View 1 2 3 4 5 6 7 8 9 1 chunk +5 lines, -0 lines 0 comments Download
M device/gamepad/gamepad_provider.cc View 1 2 3 4 5 6 1 chunk +5 lines, -0 lines 0 comments Download
M device/gamepad/public/interfaces/gamepad.mojom View 1 2 3 4 5 6 7 8 9 1 chunk +19 lines, -0 lines 0 comments Download
M tools/ipc_fuzzer/fuzzer/fuzzer.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -38 lines 0 comments Download

Messages

Total messages: 121 (77 generated)
ke.he
4 years, 1 month ago (2016-11-22 07:35:31 UTC) #2
ke.he
blundell@, PTAL. Thanks!
4 years, 1 month ago (2016-11-22 08:57:30 UTC) #8
leonhsl(Using Gerrit)
https://codereview.chromium.org/2522843002/diff/1/content/browser/renderer_host/gamepad_browser_message_filter.cc File content/browser/renderer_host/gamepad_browser_message_filter.cc (right): https://codereview.chromium.org/2522843002/diff/1/content/browser/renderer_host/gamepad_browser_message_filter.cc#newcode39 content/browser/renderer_host/gamepad_browser_message_filter.cc:39: interface_provider_->GetInterface(mojo::GetProxy(&gamepad_observer_)); Hi, blundell@, we have a concern: here |interface_provider_| ...
4 years, 1 month ago (2016-11-22 09:43:45 UTC) #9
blundell
Thanks! Could you also remove the IPC messages that you're transitioning away from and make ...
4 years ago (2016-11-23 12:13:13 UTC) #14
ke.he
On 2016/11/23 12:13:13, blundell wrote: > Thanks! Could you also remove the IPC messages that ...
4 years ago (2016-11-25 10:21:52 UTC) #36
blundell
Thanks! https://codereview.chromium.org/2522843002/diff/80001/content/browser/renderer_host/gamepad_browser_message_filter.cc File content/browser/renderer_host/gamepad_browser_message_filter.cc (right): https://codereview.chromium.org/2522843002/diff/80001/content/browser/renderer_host/gamepad_browser_message_filter.cc#newcode39 content/browser/renderer_host/gamepad_browser_message_filter.cc:39: interface_provider_->GetInterface(mojo::GetProxy(&gamepad_observer_)); You're planning on following up by converting ...
4 years ago (2016-11-28 14:45:34 UTC) #37
blundell
https://codereview.chromium.org/2522843002/diff/1/content/browser/renderer_host/gamepad_browser_message_filter.cc File content/browser/renderer_host/gamepad_browser_message_filter.cc (right): https://codereview.chromium.org/2522843002/diff/1/content/browser/renderer_host/gamepad_browser_message_filter.cc#newcode39 content/browser/renderer_host/gamepad_browser_message_filter.cc:39: interface_provider_->GetInterface(mojo::GetProxy(&gamepad_observer_)); On 2016/11/22 09:43:44, leonhsl wrote: > Hi, blundell@, ...
4 years ago (2016-11-28 14:58:05 UTC) #38
ke.he
https://codereview.chromium.org/2522843002/diff/80001/content/browser/renderer_host/gamepad_browser_message_filter.cc File content/browser/renderer_host/gamepad_browser_message_filter.cc (right): https://codereview.chromium.org/2522843002/diff/80001/content/browser/renderer_host/gamepad_browser_message_filter.cc#newcode39 content/browser/renderer_host/gamepad_browser_message_filter.cc:39: interface_provider_->GetInterface(mojo::GetProxy(&gamepad_observer_)); On 2016/11/28 14:45:34, blundell wrote: > You're planning ...
4 years ago (2016-11-29 06:40:06 UTC) #40
ke.he
Change the title and description.
4 years ago (2016-11-29 06:46:52 UTC) #43
blundell
Thanks! I didn't have time to do a full review, but I did look at ...
4 years ago (2016-11-29 15:36:24 UTC) #50
ke.he
https://codereview.chromium.org/2522843002/diff/120001/content/browser/renderer_host/gamepad_monitor.cc File content/browser/renderer_host/gamepad_monitor.cc (right): https://codereview.chromium.org/2522843002/diff/120001/content/browser/renderer_host/gamepad_monitor.cc#newcode52 content/browser/renderer_host/gamepad_monitor.cc:52: service->GetSharedMemoryHandleForProcess(base::GetCurrentProcessHandle()); On 2016/11/29 15:36:24, blundell wrote: > I don't ...
4 years ago (2016-11-30 05:45:11 UTC) #51
blundell
On 2016/11/30 05:45:11, ke.he wrote: > https://codereview.chromium.org/2522843002/diff/120001/content/browser/renderer_host/gamepad_monitor.cc > File content/browser/renderer_host/gamepad_monitor.cc (right): > > https://codereview.chromium.org/2522843002/diff/120001/content/browser/renderer_host/gamepad_monitor.cc#newcode52 > ...
4 years ago (2016-11-30 09:39:17 UTC) #52
ke.he
On 2016/11/29 06:40:06, ke.he wrote: > https://codereview.chromium.org/2522843002/diff/80001/content/browser/renderer_host/gamepad_browser_message_filter.cc > File content/browser/renderer_host/gamepad_browser_message_filter.cc (right): > > https://codereview.chromium.org/2522843002/diff/80001/content/browser/renderer_host/gamepad_browser_message_filter.cc#newcode39 > ...
4 years ago (2016-12-01 03:23:14 UTC) #53
blundell
Thanks! https://codereview.chromium.org/2522843002/diff/120001/content/browser/renderer_host/gamepad_monitor.cc File content/browser/renderer_host/gamepad_monitor.cc (right): https://codereview.chromium.org/2522843002/diff/120001/content/browser/renderer_host/gamepad_monitor.cc#newcode52 content/browser/renderer_host/gamepad_monitor.cc:52: service->GetSharedMemoryHandleForProcess(base::GetCurrentProcessHandle()); On 2016/11/30 05:45:11, ke.he wrote: > On ...
4 years ago (2016-12-01 16:01:26 UTC) #54
blundell
https://codereview.chromium.org/2522843002/diff/120001/content/browser/renderer_host/gamepad_monitor.cc File content/browser/renderer_host/gamepad_monitor.cc (right): https://codereview.chromium.org/2522843002/diff/120001/content/browser/renderer_host/gamepad_monitor.cc#newcode52 content/browser/renderer_host/gamepad_monitor.cc:52: service->GetSharedMemoryHandleForProcess(base::GetCurrentProcessHandle()); On 2016/12/01 16:01:26, blundell wrote: > On 2016/11/30 ...
4 years ago (2016-12-01 16:04:39 UTC) #55
ke.he
blundell@, CL updated. PTAL. Big Thanks:) https://codereview.chromium.org/2522843002/diff/120001/content/browser/renderer_host/gamepad_monitor.cc File content/browser/renderer_host/gamepad_monitor.cc (right): https://codereview.chromium.org/2522843002/diff/120001/content/browser/renderer_host/gamepad_monitor.cc#newcode52 content/browser/renderer_host/gamepad_monitor.cc:52: service->GetSharedMemoryHandleForProcess(base::GetCurrentProcessHandle()); On 2016/12/01 ...
4 years ago (2016-12-02 13:20:47 UTC) #56
ke.he
On 2016/12/01 03:23:14, ke.he wrote: > On 2016/11/29 06:40:06, ke.he wrote: > > > https://codereview.chromium.org/2522843002/diff/80001/content/browser/renderer_host/gamepad_browser_message_filter.cc ...
4 years ago (2016-12-02 13:30:24 UTC) #58
blundell
This looks good, thanks! I agree with your reasoning on why it's not a good ...
4 years ago (2016-12-05 15:22:34 UTC) #59
blundell
On 2016/12/05 15:22:34, blundell wrote: > This looks good, thanks! I agree with your reasoning ...
4 years ago (2016-12-05 15:24:17 UTC) #60
leonhsl(Using Gerrit)
On 2016/12/05 15:24:17, blundell wrote: > On 2016/12/05 15:22:34, blundell wrote: > > This looks ...
4 years ago (2016-12-06 03:08:41 UTC) #61
ke.he
Hi, blundell@, CL updated. PTAL. Thanks~ https://codereview.chromium.org/2522843002/diff/140001/content/browser/gamepad/gamepad_service.h File content/browser/gamepad/gamepad_service.h (right): https://codereview.chromium.org/2522843002/diff/140001/content/browser/gamepad/gamepad_service.h#newcode78 content/browser/gamepad/gamepad_service.h:78: base::SharedMemoryHandle GetSharedMemoryHandle(); On ...
4 years ago (2016-12-06 09:51:27 UTC) #67
blundell
lgtm, thanks! Ke He, filed request for you to have tryjobs access. You should now ...
4 years ago (2016-12-06 12:26:50 UTC) #70
blundell
bajones@: Can you review the whole CL as a gamepad OWNER? tsepez@: Can you review ...
4 years ago (2016-12-06 12:28:08 UTC) #72
blundell
Ke He, could you extend the CL description with why the change to how the ...
4 years ago (2016-12-06 12:31:56 UTC) #73
bajones
LGTM with blundell@'s comments addressed. Thanks for taking on this work!
4 years ago (2016-12-06 17:48:22 UTC) #76
Tom Sepez
mojom/messages LGTM, please build target ipc_fuzzer_all locally as a double-check on your work. Thanks. https://codereview.chromium.org/2522843002/diff/200001/device/gamepad/public/interfaces/gamepad.mojom ...
4 years ago (2016-12-06 17:53:40 UTC) #77
ke.he
https://codereview.chromium.org/2522843002/diff/200001/content/browser/gamepad/gamepad_service.cc File content/browser/gamepad/gamepad_service.cc (right): https://codereview.chromium.org/2522843002/diff/200001/content/browser/gamepad/gamepad_service.cc#newcode161 content/browser/gamepad/gamepad_service.cc:161: // TODO(heke): Use mojo::SharedBuffer rather than base::Sharedmemory in On ...
4 years ago (2016-12-07 08:05:10 UTC) #80
ke.he
On 2016/12/06 12:31:56, blundell wrote: > Ke He, could you extend the CL description with ...
4 years ago (2016-12-07 08:07:56 UTC) #82
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/2522843002/220001
4 years ago (2016-12-07 08:09:16 UTC) #86
commit-bot: I haz the power
Try jobs failed on following builders: cast_shell_android on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/cast_shell_android/builds/176138)
4 years ago (2016-12-07 08:13:03 UTC) #88
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/2522843002/240001
4 years ago (2016-12-07 08:24:14 UTC) #91
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/320266)
4 years ago (2016-12-07 08:30:33 UTC) #93
ke.he
jam@, Could you please PTAL on this? Thanks very much.
4 years ago (2016-12-07 08:39:05 UTC) #95
blundell
Ke He, you should specify which files (or directories) you need John's review on (you ...
4 years ago (2016-12-08 09:28:02 UTC) #103
ke.he
On 2016/12/08 09:28:02, blundell wrote: > Ke He, you should specify which files (or directories) ...
4 years ago (2016-12-08 09:40:41 UTC) #104
ke.he
jam@, Could you PTAL on the changed files in //content? Thanks very much.
4 years ago (2016-12-08 10:10:14 UTC) #105
jam
lgtm
4 years ago (2016-12-08 23:42:41 UTC) #106
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/2522843002/240001
4 years ago (2016-12-09 01:18:22 UTC) #108
commit-bot: I haz the power
Failed to apply patch for content/public/app/mojo/content_browser_manifest.json: While running git apply --index -p1; error: patch failed: ...
4 years ago (2016-12-09 03:27:51 UTC) #110
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/2522843002/240001
4 years ago (2016-12-09 03:41:39 UTC) #112
commit-bot: I haz the power
Failed to apply patch for content/public/app/mojo/content_browser_manifest.json: While running git apply --index -p1; error: patch failed: ...
4 years ago (2016-12-09 03:48:56 UTC) #114
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/2522843002/260001
4 years ago (2016-12-09 04:04:11 UTC) #117
commit-bot: I haz the power
Committed patchset #12 (id:260001)
4 years ago (2016-12-09 05:31:22 UTC) #119
commit-bot: I haz the power
4 years ago (2016-12-09 05:34:01 UTC) #121
Message was sent while issue was closed.
Patchset 12 (id:??) landed as
https://crrev.com/0bb26d507b0a3ee05b01784841b850e22e58eec5
Cr-Commit-Position: refs/heads/master@{#437477}

Powered by Google App Engine
This is Rietveld 408576698