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

Issue 14678012: Implement the content/renderer and content/browser part of the Device Motion API. (Closed)

Created:
7 years, 7 months ago by timvolodine
Modified:
7 years, 5 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, jam, Miguel Garcia
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Implement the content/renderer and content/browser part of the Device Motion API. This patch has a partial implementation of provider and does not include any device motion fetchers. The patch features: - chromium-side event pump - shared memory reader and buffer representation - IPC messages and filters for shared memory communication - service class to keep track of listening renderers BUG=135804 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=211043

Patch Set 1 #

Total comments: 24

Patch Set 2 : fixed comments #

Patch Set 3 : added unit test for device_motion_event_pump #

Total comments: 26

Patch Set 4 : initial Darin's comments #

Patch Set 5 : fixed interface change for the pump test #

Patch Set 6 : upload of rebased solution for android with fetcher #

Patch Set 7 : implemented async messaging for obtaining the shared memory handle #

Total comments: 22

Patch Set 8 : fixed Darin's comments, added generic reader + rebased #

Total comments: 14

Patch Set 9 : fixed comments and uploaded a refactored templated shared_memory_seqlock_reader #

Patch Set 10 : factored out as much code as possible from the templated reader #

Total comments: 16

Patch Set 11 : fixed comments, removed ready_for_read, removed fetcher related code to make this CL shorter #

Patch Set 12 : similarity=70 #

Total comments: 8

Patch Set 13 : fixed comments and simplified shared_memory_seqlock_buffer, added terminate call to browser_main_lo… #

Patch Set 14 : renamed Terminate -> Shutdown and added a shutdown flag #

Patch Set 15 : rebased #

Patch Set 16 : added modified device_motion_event_pump_unittest and rebased #

Patch Set 17 : fixed compilation issues #

Patch Set 18 : fixed compilation issues on other platforms #

Patch Set 19 : added CONTENT_EXPORT to device_motion_event_pump #

Patch Set 20 : excluded device_motion_event_pump_unittest from win7_aura #

Patch Set 21 : excluded device_motion_event_pump_unittest from win builds #

Patch Set 22 : rebased #

Total comments: 6

Patch Set 23 : fixed comments + rebased #

Patch Set 24 : fix compilation: peer_handle -> PeerHandle() #

Unified diffs Side-by-side diffs Delta from patch set Stats (+950 lines, -114 lines) Patch
M content/browser/browser_main_loop.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 2 chunks +2 lines, -0 lines 0 comments Download
A content/browser/device_orientation/device_motion_provider.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +47 lines, -0 lines 0 comments Download
A content/browser/device_orientation/device_motion_provider.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +51 lines, -0 lines 0 comments Download
A content/browser/device_orientation/device_motion_service.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +65 lines, -0 lines 0 comments Download
A content/browser/device_orientation/device_motion_service.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +65 lines, -0 lines 0 comments Download
A content/browser/renderer_host/device_motion_browser_message_filter.h View 1 2 3 4 5 6 1 chunk +39 lines, -0 lines 0 comments Download
A content/browser/renderer_host/device_motion_browser_message_filter.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +61 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 12 13 14 15 16 17 18 19 20 21 22 2 chunks +2 lines, -0 lines 0 comments Download
A content/common/device_motion_hardware_buffer.h View 1 2 3 4 5 6 7 1 chunk +18 lines, -0 lines 0 comments Download
M content/common/device_motion_messages.h View 1 2 3 4 5 6 1 chunk +18 lines, -0 lines 0 comments Download
M content/common/gamepad_hardware_buffer.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +3 lines, -2 lines 0 comments Download
D content/common/gamepad_seqlock.h View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -46 lines 0 comments Download
D content/common/gamepad_seqlock.cc View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -49 lines 0 comments Download
A + content/common/one_writer_seqlock.h View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +9 lines, -9 lines 0 comments Download
A + content/common/one_writer_seqlock.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +6 lines, -6 lines 0 comments Download
A content/common/shared_memory_seqlock_buffer.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +30 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 15 16 17 18 19 20 21 22 2 chunks +6 lines, -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 15 16 17 18 19 20 21 2 chunks +2 lines, -2 lines 0 comments Download
M content/content_renderer.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 2 chunks +4 lines, -0 lines 0 comments Download
M content/content_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +1 line, -0 lines 0 comments Download
A content/renderer/device_orientation/OWNERS View 1 1 chunk +3 lines, -0 lines 0 comments Download
A content/renderer/device_orientation/device_motion_event_pump.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +72 lines, -0 lines 0 comments Download
A content/renderer/device_orientation/device_motion_event_pump.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +117 lines, -0 lines 0 comments Download
A content/renderer/device_orientation/device_motion_event_pump_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +183 lines, -0 lines 0 comments Download
M content/renderer/renderer_webkitplatformsupport_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +5 lines, -0 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 15 16 17 18 19 20 21 22 2 chunks +12 lines, -0 lines 0 comments Download
A content/renderer/shared_memory_seqlock_reader.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +71 lines, -0 lines 0 comments Download
A content/renderer/shared_memory_seqlock_reader.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +58 lines, -0 lines 0 comments Download

Messages

Total messages: 43 (0 generated)
timvolodine
7 years, 7 months ago (2013-05-10 15:18:11 UTC) #1
timvolodine
7 years, 7 months ago (2013-05-16 09:45:34 UTC) #2
darin (slow to review)
high level comment: how about creating a renderer/device_orientation/ directory to mirror the one on the ...
7 years, 7 months ago (2013-05-16 19:49:15 UTC) #3
jamesr
It looks like the data being passed around is around 24 bytes and the pump ...
7 years, 7 months ago (2013-05-16 19:53:05 UTC) #4
jamesr
https://codereview.chromium.org/14678012/diff/1/content/common/device_motion_messages.h File content/common/device_motion_messages.h (right): https://codereview.chromium.org/14678012/diff/1/content/common/device_motion_messages.h#newcode21 content/common/device_motion_messages.h:21: IPC_SYNC_MESSAGE_CONTROL0_1(DeviceMotionHostMsg_StartPolling, Why synchronous? https://codereview.chromium.org/14678012/diff/1/content/common/device_motion_messages.h#newcode24 content/common/device_motion_messages.h:24: IPC_SYNC_MESSAGE_CONTROL0_0(DeviceMotionHostMsg_StopPolling) Ditto - why ...
7 years, 7 months ago (2013-05-16 19:58:21 UTC) #5
timvolodine
On 2013/05/16 19:49:15, darin wrote: > high level comment: how about creating a renderer/device_orientation/ directory ...
7 years, 7 months ago (2013-05-20 18:12:37 UTC) #6
timvolodine
On 2013/05/16 19:53:05, jamesr wrote: > It looks like the data being passed around is ...
7 years, 7 months ago (2013-05-20 18:18:13 UTC) #7
timvolodine
thanks for comments! https://codereview.chromium.org/14678012/diff/1/content/common/device_motion_hardware_buffer.h File content/common/device_motion_hardware_buffer.h (right): https://codereview.chromium.org/14678012/diff/1/content/common/device_motion_hardware_buffer.h#newcode13 content/common/device_motion_hardware_buffer.h:13: /* On 2013/05/16 19:53:05, jamesr wrote: ...
7 years, 7 months ago (2013-05-20 18:18:47 UTC) #8
timvolodine
Hi Darin, could you please have a look at this chromium-side patch as well ? ...
7 years, 6 months ago (2013-05-28 15:31:43 UTC) #9
darin (slow to review)
Just a first pass code review... https://codereview.chromium.org/14678012/diff/16001/content/renderer/device_orientation/device_motion_event_pump.cc File content/renderer/device_orientation/device_motion_event_pump.cc (right): https://codereview.chromium.org/14678012/diff/16001/content/renderer/device_orientation/device_motion_event_pump.cc#newcode48 content/renderer/device_orientation/device_motion_event_pump.cc:48: this, &DeviceMotionEventPump::fireEvent); nit: ...
7 years, 6 months ago (2013-05-29 06:41:53 UTC) #10
timvolodine
Thanks for the initial comments, I appreciate that you are making time for this :) ...
7 years, 6 months ago (2013-05-29 18:59:06 UTC) #11
timvolodine
On 2013/05/29 18:59:06, timvolodine wrote: > Thanks for the initial comments, I appreciate that you ...
7 years, 6 months ago (2013-05-30 15:34:02 UTC) #12
timvolodine
On 2013/05/30 15:34:02, timvolodine wrote: > On 2013/05/29 18:59:06, timvolodine wrote: > > Thanks for ...
7 years, 6 months ago (2013-05-31 17:31:41 UTC) #13
timvolodine
On 2013/05/31 17:31:41, timvolodine wrote: > On 2013/05/30 15:34:02, timvolodine wrote: > > On 2013/05/29 ...
7 years, 6 months ago (2013-06-03 18:59:46 UTC) #14
timvolodine
uploaded a 'complete' solution with an android fetcher. (contains some debugging LOG statements which will ...
7 years, 6 months ago (2013-06-12 18:12:14 UTC) #15
timvolodine
added async messaging for obtaining a shared memory handle from the browser. added tri-state status ...
7 years, 6 months ago (2013-06-13 20:09:23 UTC) #16
timvolodine
friendly ping :)
7 years, 6 months ago (2013-06-14 19:29:59 UTC) #17
jamesr
On 2013/06/14 19:29:59, timvolodine wrote: > friendly ping :) Could you specify who you are ...
7 years, 6 months ago (2013-06-14 19:30:59 UTC) #18
timvolodine
On 2013/06/14 19:30:59, jamesr wrote: > On 2013/06/14 19:29:59, timvolodine wrote: > > friendly ping ...
7 years, 6 months ago (2013-06-14 21:00:12 UTC) #19
darin (slow to review)
Sorry for the delay in getting this feedback out. https://chromiumcodereview.appspot.com/14678012/diff/40001/content/renderer/device_orientation/device_motion_event_pump.cc File content/renderer/device_orientation/device_motion_event_pump.cc (right): https://chromiumcodereview.appspot.com/14678012/diff/40001/content/renderer/device_orientation/device_motion_event_pump.cc#newcode39 content/renderer/device_orientation/device_motion_event_pump.cc:39: ...
7 years, 6 months ago (2013-06-17 05:27:46 UTC) #20
timvolodine
thanks for the comments! refactored the reader using templates to be more generic, see shared_memory_seqlock_{reader,buffer}. ...
7 years, 6 months ago (2013-06-17 20:10:55 UTC) #21
darin (slow to review)
Some quick comments focused on the seqlock code. https://chromiumcodereview.appspot.com/14678012/diff/51001/content/common/shared_memory_seqlock_buffer.h File content/common/shared_memory_seqlock_buffer.h (right): https://chromiumcodereview.appspot.com/14678012/diff/51001/content/common/shared_memory_seqlock_buffer.h#newcode23 content/common/shared_memory_seqlock_buffer.h:23: GamepadSeqLock ...
7 years, 6 months ago (2013-06-17 20:23:44 UTC) #22
timvolodine
refactoring out the templates in shared_memory_seqlock_reader seems somewhat challenging, I've uploaded some new code for ...
7 years, 6 months ago (2013-06-18 16:44:31 UTC) #23
timvolodine
Did some more thinking about this and eventually factored out most of the templated reader ...
7 years, 6 months ago (2013-06-19 18:28:51 UTC) #24
timvolodine
Hi Scott, we ended up touching the gamepad implementation slightly in this patch, could you ...
7 years, 6 months ago (2013-06-24 22:38:42 UTC) #25
scottmg
the lock renaming seems a mechanical change so that seems fine, but i think the ...
7 years, 6 months ago (2013-06-24 23:24:38 UTC) #26
darin (slow to review)
https://chromiumcodereview.appspot.com/14678012/diff/61001/content/browser/renderer_host/device_motion_browser_message_filter.cc File content/browser/renderer_host/device_motion_browser_message_filter.cc (right): https://chromiumcodereview.appspot.com/14678012/diff/61001/content/browser/renderer_host/device_motion_browser_message_filter.cc#newcode39 content/browser/renderer_host/device_motion_browser_message_filter.cc:39: if (!is_started_) { nit: Consider returning early when is_started_ ...
7 years, 6 months ago (2013-06-24 23:40:34 UTC) #27
timvolodine
fixed comments + removed data fetcher related code to make this CL shorter and easier ...
7 years, 6 months ago (2013-06-25 03:36:06 UTC) #28
timvolodine
On 2013/06/25 03:36:06, timvolodine wrote: > fixed comments + removed data fetcher related code to ...
7 years, 6 months ago (2013-06-26 01:00:11 UTC) #29
darin (slow to review)
https://chromiumcodereview.appspot.com/14678012/diff/73001/content/browser/device_orientation/device_motion_service.h File content/browser/device_orientation/device_motion_service.h (right): https://chromiumcodereview.appspot.com/14678012/diff/73001/content/browser/device_orientation/device_motion_service.h#newcode47 content/browser/device_orientation/device_motion_service.h:47: void Terminate(); I'm trying to understand this method. It ...
7 years, 5 months ago (2013-06-27 17:33:25 UTC) #30
timvolodine
https://chromiumcodereview.appspot.com/14678012/diff/73001/content/browser/device_orientation/device_motion_service.h File content/browser/device_orientation/device_motion_service.h (right): https://chromiumcodereview.appspot.com/14678012/diff/73001/content/browser/device_orientation/device_motion_service.h#newcode47 content/browser/device_orientation/device_motion_service.h:47: void Terminate(); On 2013/06/27 17:33:26, darin wrote: > I'm ...
7 years, 5 months ago (2013-06-27 21:08:43 UTC) #31
darin (slow to review)
On 2013/06/27 21:08:43, timvolodine wrote: > https://chromiumcodereview.appspot.com/14678012/diff/73001/content/browser/device_orientation/device_motion_service.h > File content/browser/device_orientation/device_motion_service.h (right): > > https://chromiumcodereview.appspot.com/14678012/diff/73001/content/browser/device_orientation/device_motion_service.h#newcode47 > ...
7 years, 5 months ago (2013-06-27 21:43:33 UTC) #32
timvolodine
Thanks Darin! > Maybe a slightly more canonical name for this method would be "Shutdown" ...
7 years, 5 months ago (2013-06-28 00:08:33 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/timvolodine@chromium.org/14678012/126001
7 years, 5 months ago (2013-07-10 10:42:53 UTC) #34
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=14475
7 years, 5 months ago (2013-07-10 10:57:05 UTC) #35
timvolodine
Hi Chris, apparently I also need your lgtm for the content/common/device_motion_messages.h. Could you please approve ...
7 years, 5 months ago (2013-07-10 11:04:44 UTC) #36
timvolodine
Hi Chris, Looks like Chris Evans is on vacation and I also need your lgtm ...
7 years, 5 months ago (2013-07-10 11:19:07 UTC) #37
palmer
IPC security LGTM https://chromiumcodereview.appspot.com/14678012/diff/126001/content/browser/device_orientation/device_motion_provider.cc File content/browser/device_orientation/device_motion_provider.cc (right): https://chromiumcodereview.appspot.com/14678012/diff/126001/content/browser/device_orientation/device_motion_provider.cc#newcode15 content/browser/device_orientation/device_motion_provider.cc:15: CHECK(res); Should the browser really crash ...
7 years, 5 months ago (2013-07-10 18:23:48 UTC) #38
timvolodine
thanks! https://chromiumcodereview.appspot.com/14678012/diff/126001/content/browser/device_orientation/device_motion_provider.cc File content/browser/device_orientation/device_motion_provider.cc (right): https://chromiumcodereview.appspot.com/14678012/diff/126001/content/browser/device_orientation/device_motion_provider.cc#newcode15 content/browser/device_orientation/device_motion_provider.cc:15: CHECK(res); On 2013/07/10 18:23:48, Chromium Palmer wrote: > ...
7 years, 5 months ago (2013-07-10 21:17:50 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/timvolodine@chromium.org/14678012/141001
7 years, 5 months ago (2013-07-10 21:29:37 UTC) #40
commit-bot: I haz the power
Step "update" is always a major failure. Look at the try server FAQ for more ...
7 years, 5 months ago (2013-07-10 21:49:41 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/timvolodine@chromium.org/14678012/157001
7 years, 5 months ago (2013-07-10 23:07:29 UTC) #42
commit-bot: I haz the power
7 years, 5 months ago (2013-07-11 08:01:00 UTC) #43
Message was sent while issue was closed.
Change committed as 211043

Powered by Google App Engine
This is Rietveld 408576698