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

Issue 2896583005: Reland: Refactor DeviceMotionEventPump to use //device/generic_sensor instead of //device/sensors (Closed)

Created:
3 years, 7 months ago by juncai
Modified:
3 years, 5 months ago
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, mlamouri+watch-test-runner_chromium.org, shalamov, Peter Beverloo, riju_, blink-reviews, mlamouri+watch-blink_chromium.org, dglazkov+blink, darin-cc_chromium.org, wanming.lin, mlamouri+watch-sensors_chromium.org, haraken, einbinder+watch-test-runner_chromium.org, blink-reviews-api_chromium.org, jochen+watch_chromium.org, Mikhail
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Refactor DeviceMotionEventPump to use //device/generic_sensor instead of //device/sensors //device/generic_sensors already has all the sensors that can be used to implement the DeviceOrientation event: https://w3c.github.io/deviceorientation/spec-source-orientation.html Currently, //content/renderer/device_sensors uses sensors from //device/sensors as its backend, and this is one of the CLs that refactor //content/renderer/device_sensors to use sensors from //device/generic_sensor as the backend and removes //device/sensors. This CL refactors DeviceMotionEvent to use sensors from //device/generic_sensor. The issue page contains the design doc link for this change. BUG=721427 Review-Url: https://codereview.chromium.org/2896583005 Cr-Original-Commit-Position: refs/heads/master@{#480934} Committed: https://chromium.googlesource.com/chromium/src/+/687e6a76c9d634404eb93643ab900596a77958fd Review-Url: https://codereview.chromium.org/2896583005 Cr-Commit-Position: refs/heads/master@{#481791} Committed: https://chromium.googlesource.com/chromium/src/+/33f72bfe8b9364e82990f92befa041a08d465d3c

Patch Set 1 : refactor DeviceMotionEventPump to use //device/generic_sensor instead of //device/sensors #

Patch Set 2 : updated test code #

Total comments: 22

Patch Set 3 : fix presubmit error #

Patch Set 4 : address comments #

Total comments: 24

Patch Set 5 : updated device sensor browsertest #

Total comments: 38

Patch Set 6 : address comments #

Patch Set 7 : removed WebDeviceMotionData.h #

Patch Set 8 : continue using motion_data.h from //device/sensors #

Patch Set 9 : clean up #include files #

Total comments: 14

Patch Set 10 : address more comments #

Total comments: 37

Patch Set 11 : address more comments #

Patch Set 12 : added comments #

Patch Set 13 : set suppress_on_change_events_ to true #

Patch Set 14 : fix issues on Android, Mac and Windows #

Total comments: 2

Patch Set 15 : fix issues on Android, Mac, and Windows #

Patch Set 16 : fix compile error on Windows #

Unified diffs Side-by-side diffs Delta from patch set Stats (+897 lines, -204 lines) Patch
M content/browser/device_sensors/device_sensor_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 16 chunks +214 lines, -73 lines 0 comments Download
M content/renderer/BUILD.gn 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/renderer/DEPS View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M content/renderer/device_sensors/device_motion_event_pump.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +86 lines, -17 lines 0 comments Download
M content/renderer/device_sensors/device_motion_event_pump.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +306 lines, -13 lines 0 comments Download
M content/renderer/device_sensors/device_motion_event_pump_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 6 chunks +195 lines, -61 lines 0 comments Download
M content/test/BUILD.gn 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/test/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/test/data/device_sensors/device_motion_only_some_sensors_are_available_test.html View 1 2 3 4 5 6 7 8 9 10 1 chunk +6 lines, -5 lines 0 comments Download
M content/test/data/device_sensors/device_motion_test.html View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -1 line 0 comments Download
M device/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +2 lines, -0 lines 0 comments Download
M device/generic_sensor/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -0 lines 0 comments Download
M device/generic_sensor/DEPS View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M device/generic_sensor/android/java/src/org/chromium/device/sensors/PlatformSensorProvider.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +9 lines, -1 line 0 comments Download
M device/generic_sensor/platform_sensor_provider_android.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +5 lines, -1 line 0 comments Download
M device/generic_sensor/platform_sensor_provider_android.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +9 lines, -1 line 0 comments Download
A device/generic_sensor/platform_sensor_provider_unittest_android.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +40 lines, -0 lines 0 comments Download
M device/generic_sensor/platform_sensor_provider_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -1 line 0 comments Download
M device/generic_sensor/sensor_provider_impl.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +13 lines, -0 lines 0 comments Download
M services/device/device_service.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +0 lines, -5 lines 0 comments Download
M services/device/device_service.cc View 1 2 3 4 5 6 5 chunks +2 lines, -25 lines 0 comments Download

Messages

Total messages: 129 (79 generated)
juncai
Please take a look.
3 years, 7 months ago (2017-05-22 19:59:38 UTC) #12
Reilly Grant (use Gerrit)
https://codereview.chromium.org/2896583005/diff/20001/content/browser/device_sensors/device_sensor_browsertest.cc File content/browser/device_sensors/device_sensor_browsertest.cc (left): https://codereview.chromium.org/2896583005/diff/20001/content/browser/device_sensors/device_sensor_browsertest.cc#oldcode318 content/browser/device_sensors/device_sensor_browsertest.cc:318: IN_PROC_BROWSER_TEST_F(DeviceSensorBrowserTest, MotionTest) { Where did these tests move to? ...
3 years, 7 months ago (2017-05-22 20:29:47 UTC) #13
juncai
Please take a look. https://codereview.chromium.org/2896583005/diff/20001/content/browser/device_sensors/device_sensor_browsertest.cc File content/browser/device_sensors/device_sensor_browsertest.cc (left): https://codereview.chromium.org/2896583005/diff/20001/content/browser/device_sensors/device_sensor_browsertest.cc#oldcode318 content/browser/device_sensors/device_sensor_browsertest.cc:318: IN_PROC_BROWSER_TEST_F(DeviceSensorBrowserTest, MotionTest) { On 2017/05/22 ...
3 years, 7 months ago (2017-05-23 02:30:24 UTC) #18
timvolodine
some drive-by comments, hope you don't mind ) https://codereview.chromium.org/2896583005/diff/20001/content/browser/device_sensors/device_sensor_browsertest.cc File content/browser/device_sensors/device_sensor_browsertest.cc (left): https://codereview.chromium.org/2896583005/diff/20001/content/browser/device_sensors/device_sensor_browsertest.cc#oldcode318 content/browser/device_sensors/device_sensor_browsertest.cc:318: IN_PROC_BROWSER_TEST_F(DeviceSensorBrowserTest, ...
3 years, 7 months ago (2017-05-23 12:33:40 UTC) #22
juncai
https://codereview.chromium.org/2896583005/diff/20001/content/browser/device_sensors/device_sensor_browsertest.cc File content/browser/device_sensors/device_sensor_browsertest.cc (left): https://codereview.chromium.org/2896583005/diff/20001/content/browser/device_sensors/device_sensor_browsertest.cc#oldcode318 content/browser/device_sensors/device_sensor_browsertest.cc:318: IN_PROC_BROWSER_TEST_F(DeviceSensorBrowserTest, MotionTest) { On 2017/05/23 12:33:40, timvolodine wrote: > ...
3 years, 7 months ago (2017-05-23 21:33:55 UTC) #23
timvolodine
Thanks for the replies, some more comments below https://codereview.chromium.org/2896583005/diff/20001/content/browser/device_sensors/device_sensor_browsertest.cc File content/browser/device_sensors/device_sensor_browsertest.cc (left): https://codereview.chromium.org/2896583005/diff/20001/content/browser/device_sensors/device_sensor_browsertest.cc#oldcode318 content/browser/device_sensors/device_sensor_browsertest.cc:318: IN_PROC_BROWSER_TEST_F(DeviceSensorBrowserTest, ...
3 years, 7 months ago (2017-05-24 15:30:16 UTC) #25
juncai
Thanks a lot for the comments. Please take a look. https://codereview.chromium.org/2896583005/diff/20001/content/browser/device_sensors/device_sensor_browsertest.cc File content/browser/device_sensors/device_sensor_browsertest.cc (left): https://codereview.chromium.org/2896583005/diff/20001/content/browser/device_sensors/device_sensor_browsertest.cc#oldcode318 ...
3 years, 7 months ago (2017-05-26 02:38:53 UTC) #28
Reilly Grant (use Gerrit)
https://codereview.chromium.org/2896583005/diff/80001/content/browser/device_sensors/device_sensor_browsertest.cc File content/browser/device_sensors/device_sensor_browsertest.cc (right): https://codereview.chromium.org/2896583005/diff/80001/content/browser/device_sensors/device_sensor_browsertest.cc#newcode156 content/browser/device_sensors/device_sensor_browsertest.cc:156: class FakeAccelerometerSensor : public device::PlatformSensor { "meter" means "sensor", ...
3 years, 6 months ago (2017-05-27 03:17:51 UTC) #31
timvolodine
Thanks for the fixes juncai@! In addition to Reilly's comments a couple of thoughts: If ...
3 years, 6 months ago (2017-05-30 00:53:30 UTC) #32
juncai
https://codereview.chromium.org/2896583005/diff/60001/content/renderer/device_sensors/device_motion_event_pump.cc File content/renderer/device_sensors/device_motion_event_pump.cc (right): https://codereview.chromium.org/2896583005/diff/60001/content/renderer/device_sensors/device_motion_event_pump.cc#newcode108 content/renderer/device_sensors/device_motion_event_pump.cc:108: // method doesn't need to be implemented. On 2017/05/30 ...
3 years, 6 months ago (2017-05-30 22:26:57 UTC) #35
juncai
On 2017/05/30 00:53:30, timvolodine wrote: > Thanks for the fixes juncai@! In addition to Reilly's ...
3 years, 6 months ago (2017-05-30 22:27:41 UTC) #36
juncai
On 2017/05/30 22:27:41, juncai wrote: > On 2017/05/30 00:53:30, timvolodine wrote: > > Thanks for ...
3 years, 6 months ago (2017-05-30 22:53:18 UTC) #37
timvolodine
On 2017/05/30 22:27:41, juncai wrote: > On 2017/05/30 00:53:30, timvolodine wrote: > > Thanks for ...
3 years, 6 months ago (2017-05-31 16:58:24 UTC) #40
juncai
On 2017/05/31 16:58:24, timvolodine wrote: > There could be multiple visible tabs, e.g. in recent ...
3 years, 6 months ago (2017-05-31 18:43:09 UTC) #41
timvolodine
On 2017/05/31 18:43:09, juncai wrote: > On 2017/05/31 16:58:24, timvolodine wrote: > > There could ...
3 years, 6 months ago (2017-06-02 12:56:19 UTC) #42
juncai
On 2017/06/02 12:56:19, timvolodine wrote: > On some platforms like windows there is direct support ...
3 years, 6 months ago (2017-06-02 18:33:47 UTC) #43
timvolodine
On 2017/06/02 18:33:47, juncai wrote: > On 2017/06/02 12:56:19, timvolodine wrote: > > On some ...
3 years, 6 months ago (2017-06-02 23:21:38 UTC) #44
juncai
On 2017/06/02 23:21:38, timvolodine wrote: > Sounds good. Thanks for constructively keeping up with this. ...
3 years, 6 months ago (2017-06-05 19:35:17 UTC) #51
juncai
timvolodine@, reillyg@: Please take a look again on the device sensor related changes. jam@chromium.org: Please ...
3 years, 6 months ago (2017-06-05 20:02:40 UTC) #57
Reilly Grant (use Gerrit)
On 2017/06/02 23:21:38, timvolodine wrote: > [...] What still bothers me somewhat is the reintroduction ...
3 years, 6 months ago (2017-06-06 20:00:13 UTC) #60
Reilly Grant (use Gerrit)
https://codereview.chromium.org/2896583005/diff/80001/content/browser/device_sensors/device_sensor_browsertest.cc File content/browser/device_sensors/device_sensor_browsertest.cc (right): https://codereview.chromium.org/2896583005/diff/80001/content/browser/device_sensors/device_sensor_browsertest.cc#newcode405 content/browser/device_sensors/device_sensor_browsertest.cc:405: void SetUpOnIOThreadForAndroid() { On 2017/05/30 22:26:57, juncai wrote: > ...
3 years, 6 months ago (2017-06-06 20:58:55 UTC) #61
juncai
On 2017/06/06 20:00:13, Reilly Grant wrote: > On 2017/06/02 23:21:38, timvolodine wrote: > > [...] ...
3 years, 6 months ago (2017-06-06 23:36:02 UTC) #64
juncai
https://codereview.chromium.org/2896583005/diff/80001/content/browser/device_sensors/device_sensor_browsertest.cc File content/browser/device_sensors/device_sensor_browsertest.cc (right): https://codereview.chromium.org/2896583005/diff/80001/content/browser/device_sensors/device_sensor_browsertest.cc#newcode405 content/browser/device_sensors/device_sensor_browsertest.cc:405: void SetUpOnIOThreadForAndroid() { On 2017/06/06 20:58:55, Reilly Grant wrote: ...
3 years, 6 months ago (2017-06-06 23:36:26 UTC) #65
jam
On 2017/06/05 20:02:40, juncai wrote: > timvolodine@, reillyg@: Please take a look again on the ...
3 years, 6 months ago (2017-06-07 01:20:03 UTC) #68
juncai
ping timvolodine, :).
3 years, 6 months ago (2017-06-07 19:13:12 UTC) #69
timvolodine
Thanks juncai, a few more questions/comments below. Didn't look at all the details but looks ...
3 years, 6 months ago (2017-06-07 20:37:36 UTC) #70
juncai
https://codereview.chromium.org/2896583005/diff/180001/content/browser/device_sensors/device_sensor_browsertest.cc File content/browser/device_sensors/device_sensor_browsertest.cc (right): https://codereview.chromium.org/2896583005/diff/180001/content/browser/device_sensors/device_sensor_browsertest.cc#newcode354 content/browser/device_sensors/device_sensor_browsertest.cc:354: #endif // defined(OS_ANDROID) On 2017/06/07 20:37:35, timvolodine wrote: > ...
3 years, 6 months ago (2017-06-07 23:05:08 UTC) #73
timvolodine
also, looking at generic_sensors they still seem to be experimental, landing this patch would switch ...
3 years, 6 months ago (2017-06-08 20:26:51 UTC) #76
juncai
On 2017/06/08 20:26:51, timvolodine wrote: > also, looking at generic_sensors they still seem to be ...
3 years, 6 months ago (2017-06-08 22:53:22 UTC) #77
juncai
https://codereview.chromium.org/2896583005/diff/180001/content/browser/device_sensors/device_sensor_browsertest.cc File content/browser/device_sensors/device_sensor_browsertest.cc (right): https://codereview.chromium.org/2896583005/diff/180001/content/browser/device_sensors/device_sensor_browsertest.cc#newcode379 content/browser/device_sensors/device_sensor_browsertest.cc:379: SetUpFetcher(); On 2017/06/08 20:26:51, timvolodine wrote: > On 2017/06/07 ...
3 years, 6 months ago (2017-06-08 23:29:43 UTC) #80
timvolodine
https://codereview.chromium.org/2896583005/diff/180001/content/renderer/device_sensors/device_motion_event_pump.h File content/renderer/device_sensors/device_motion_event_pump.h (right): https://codereview.chromium.org/2896583005/diff/180001/content/renderer/device_sensors/device_motion_event_pump.h#newcode95 content/renderer/device_sensors/device_motion_event_pump.h:95: enum class PumpState { STOPPED, RUNNING, PENDING_START }; On ...
3 years, 6 months ago (2017-06-09 18:54:51 UTC) #83
timvolodine
On 2017/06/08 22:53:22, juncai wrote: > On 2017/06/08 20:26:51, timvolodine wrote: > > also, looking ...
3 years, 6 months ago (2017-06-09 18:55:48 UTC) #84
juncai
On 2017/06/09 18:55:48, timvolodine wrote: > Sure there are benefits :). My point is that ...
3 years, 6 months ago (2017-06-13 23:01:12 UTC) #87
juncai
https://codereview.chromium.org/2896583005/diff/180001/content/renderer/device_sensors/device_motion_event_pump.cc File content/renderer/device_sensors/device_motion_event_pump.cc (right): https://codereview.chromium.org/2896583005/diff/180001/content/renderer/device_sensors/device_motion_event_pump.cc#newcode150 content/renderer/device_sensors/device_motion_event_pump.cc:150: // method doesn't need to be implemented. On 2017/06/08 ...
3 years, 6 months ago (2017-06-13 23:02:18 UTC) #88
timvolodine
On 2017/06/13 23:01:12, juncai wrote: > On 2017/06/09 18:55:48, timvolodine wrote: > > Sure there ...
3 years, 6 months ago (2017-06-14 18:18:03 UTC) #91
juncai
On 2017/06/14 18:18:03, timvolodine wrote: > Are there any reasons why generic_sensor APIs are not ...
3 years, 6 months ago (2017-06-15 00:43:30 UTC) #92
juncai
To clarify, my previous response is the restructured as following: > Are there any reasons ...
3 years, 6 months ago (2017-06-15 01:37:52 UTC) #93
juncai
ping timvolodine@.
3 years, 6 months ago (2017-06-16 18:12:31 UTC) #94
scheib
On 2017/06/15 01:37:52, juncai wrote: > > Maybe launching generic_sensors/ first would make the process ...
3 years, 6 months ago (2017-06-16 21:10:44 UTC) #95
timvolodine
On 2017/06/16 21:10:44, scheib - Prefer gerrit tool wrote: > On 2017/06/15 01:37:52, juncai wrote: ...
3 years, 6 months ago (2017-06-20 14:44:50 UTC) #97
Reilly Grant (use Gerrit)
lgtm
3 years, 6 months ago (2017-06-20 18:35:00 UTC) #98
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/2896583005/240001
3 years, 6 months ago (2017-06-20 18:54:52 UTC) #101
commit-bot: I haz the power
Committed patchset #13 (id:240001) as https://chromium.googlesource.com/chromium/src/+/687e6a76c9d634404eb93643ab900596a77958fd
3 years, 6 months ago (2017-06-20 20:26:01 UTC) #104
juncai
A revert of this CL (patchset #13 id:240001) has been created in https://codereview.chromium.org/2948253002/ by juncai@chromium.org. ...
3 years, 6 months ago (2017-06-22 16:40:26 UTC) #105
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/2896583005/260001
3 years, 6 months ago (2017-06-23 02:32:34 UTC) #113
commit-bot: I haz the power
Committed patchset #14 (id:260001) as https://chromium.googlesource.com/chromium/src/+/33f72bfe8b9364e82990f92befa041a08d465d3c
3 years, 6 months ago (2017-06-23 02:36:29 UTC) #116
Reilly Grant (use Gerrit)
Please add the tests I asked for we discussed this issue offline. This change should ...
3 years, 6 months ago (2017-06-23 06:45:55 UTC) #117
juncai
A revert of this CL (patchset #14 id:260001) has been created in https://codereview.chromium.org/2953263002/ by juncai@chromium.org. ...
3 years, 6 months ago (2017-06-23 17:35:18 UTC) #118
juncai
reillyg@, timvolodine@: I updated this CL to fix issues on Android, Mac, and Windows. Please ...
3 years, 5 months ago (2017-06-27 05:28:40 UTC) #128
juncai
3 years, 5 months ago (2017-06-27 23:04:52 UTC) #129

Powered by Google App Engine
This is Rietveld 408576698