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

Issue 315573002: Generalize and refactor DeviceSensorEvent* architecture to support multi-event type targets. (Closed)

Created:
6 years, 6 months ago by timvolodine
Modified:
6 years, 6 months ago
CC:
blink-reviews, mvanouwerkerk+watch_chromium.org
Visibility:
Public.

Description

Generalize and refactor DeviceSensorEvent* architecture to support multi-event type targets. This patch performs a significant refactoring of the DeviceSensorEvent{Controller,Dispatcher} and related classes. It provides new Base classes to allow simple implementation of APIs involving multi-event type non-window targets (e.g. Battery Status API). Additionally it makes the implementation of existing event-based APIs (device_orientation, device_light) simpler and more compact. In particular the following new classes have been added: * DeviceEventControllerBase and DeviceEventDispatcherBase (derived from by the Battery Status API). * DeviceSingleWindowEventController is more specific and contains functionality necessary for single-event type window target APIs (used by Device Motion/Orientation and Device Light APIs). BUG=122593, 360068 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=175661 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=175686 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=175792

Patch Set 1 #

Patch Set 2 : similarity=60 #

Total comments: 32

Patch Set 3 : fixed Chris's comments #

Patch Set 4 : fixes: rename to hasLastData, latestData() as raw pointer, rebase. #

Patch Set 5 : fix override logic in DeviceOrientationController #

Total comments: 8

Patch Set 6 : fixed comments + rebased #

Patch Set 7 : rebase #

Patch Set 8 : fix assert in BatteryManager #

Patch Set 9 : add stopUpdating in destructor of BatteryManager. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+518 lines, -483 lines) Patch
M Source/core/core.gypi View 1 2 3 4 5 6 7 8 1 chunk +6 lines, -0 lines 0 comments Download
A Source/core/frame/DeviceEventControllerBase.h View 1 2 3 1 chunk +49 lines, -0 lines 0 comments Download
A Source/core/frame/DeviceEventControllerBase.cpp View 1 2 3 1 chunk +70 lines, -0 lines 0 comments Download
A Source/core/frame/DeviceEventDispatcherBase.h View 1 2 1 chunk +37 lines, -0 lines 0 comments Download
A Source/core/frame/DeviceEventDispatcherBase.cpp View 1 2 1 chunk +87 lines, -0 lines 0 comments Download
A Source/core/frame/DeviceSingleWindowEventController.h View 1 2 1 chunk +44 lines, -0 lines 0 comments Download
A Source/core/frame/DeviceSingleWindowEventController.cpp View 1 2 1 chunk +73 lines, -0 lines 0 comments Download
M Source/modules/battery/BatteryDispatcher.h View 1 2 3 2 chunks +5 lines, -7 lines 0 comments Download
M Source/modules/battery/BatteryDispatcher.cpp View 1 2 3 2 chunks +3 lines, -48 lines 0 comments Download
M Source/modules/battery/BatteryManager.h View 1 2 3 3 chunks +10 lines, -11 lines 0 comments Download
M Source/modules/battery/BatteryManager.cpp View 1 2 3 4 5 6 7 8 3 chunks +31 lines, -39 lines 0 comments Download
M Source/modules/device_light/DeviceLightController.h View 1 2 3 2 chunks +9 lines, -16 lines 0 comments Download
M Source/modules/device_light/DeviceLightController.cpp View 1 2 3 3 chunks +11 lines, -42 lines 0 comments Download
M Source/modules/device_light/DeviceLightDispatcher.h View 2 chunks +5 lines, -7 lines 0 comments Download
M Source/modules/device_light/DeviceLightDispatcher.cpp View 3 chunks +1 line, -25 lines 0 comments Download
M Source/modules/device_orientation/DeviceMotionController.h View 1 2 3 4 5 2 chunks +12 lines, -42 lines 0 comments Download
M Source/modules/device_orientation/DeviceMotionController.cpp View 1 2 3 4 5 4 chunks +14 lines, -70 lines 0 comments Download
M Source/modules/device_orientation/DeviceMotionDispatcher.h View 3 chunks +5 lines, -7 lines 0 comments Download
M Source/modules/device_orientation/DeviceMotionDispatcher.cpp View 3 chunks +1 line, -24 lines 0 comments Download
M Source/modules/device_orientation/DeviceOrientationController.h View 1 2 3 4 5 2 chunks +18 lines, -41 lines 0 comments Download
M Source/modules/device_orientation/DeviceOrientationController.cpp View 1 2 3 4 5 6 chunks +21 lines, -73 lines 0 comments Download
M Source/modules/device_orientation/DeviceOrientationDispatcher.h View 3 chunks +5 lines, -7 lines 0 comments Download
M Source/modules/device_orientation/DeviceOrientationDispatcher.cpp View 3 chunks +1 line, -24 lines 0 comments Download

Messages

Total messages: 46 (0 generated)
timvolodine
6 years, 6 months ago (2014-06-03 12:13:58 UTC) #1
Inactive
https://codereview.chromium.org/315573002/diff/60001/Source/core/frame/DeviceEventControllerBase.h File Source/core/frame/DeviceEventControllerBase.h (right): https://codereview.chromium.org/315573002/diff/60001/Source/core/frame/DeviceEventControllerBase.h#newcode2 Source/core/frame/DeviceEventControllerBase.h:2: * Copyright (C) 2014 Google Inc. All rights reserved. ...
6 years, 6 months ago (2014-06-03 13:25:32 UTC) #2
Inactive
Here are some comments. Note that I am not a modules OWNER and I think ...
6 years, 6 months ago (2014-06-03 13:49:33 UTC) #3
timvolodine
thanks for the comments Chris, replies below. https://codereview.chromium.org/315573002/diff/60001/Source/core/frame/DeviceEventControllerBase.cpp File Source/core/frame/DeviceEventControllerBase.cpp (right): https://codereview.chromium.org/315573002/diff/60001/Source/core/frame/DeviceEventControllerBase.cpp#newcode55 Source/core/frame/DeviceEventControllerBase.cpp:55: m_timer.stop(); On ...
6 years, 6 months ago (2014-06-03 18:45:53 UTC) #4
Inactive
https://codereview.chromium.org/315573002/diff/60001/Source/core/frame/DeviceSingleWindowEventController.h File Source/core/frame/DeviceSingleWindowEventController.h (right): https://codereview.chromium.org/315573002/diff/60001/Source/core/frame/DeviceSingleWindowEventController.h#newcode49 Source/core/frame/DeviceSingleWindowEventController.h:49: // Inherited from DOMWindowLifecycleObserver. On 2014/06/03 18:45:54, timvolodine wrote: ...
6 years, 6 months ago (2014-06-03 18:53:50 UTC) #5
timvolodine
On 2014/06/03 18:53:50, Chris Dumez wrote: > https://codereview.chromium.org/315573002/diff/60001/Source/core/frame/DeviceSingleWindowEventController.h > File Source/core/frame/DeviceSingleWindowEventController.h (right): > > https://codereview.chromium.org/315573002/diff/60001/Source/core/frame/DeviceSingleWindowEventController.h#newcode49 ...
6 years, 6 months ago (2014-06-03 18:59:53 UTC) #6
Inactive
https://codereview.chromium.org/315573002/diff/60001/Source/modules/battery/BatteryDispatcher.cpp File Source/modules/battery/BatteryDispatcher.cpp (right): https://codereview.chromium.org/315573002/diff/60001/Source/modules/battery/BatteryDispatcher.cpp#newcode34 Source/modules/battery/BatteryDispatcher.cpp:34: PassRefPtr<BatteryStatus> BatteryDispatcher::getLatestData() On 2014/06/03 18:45:54, timvolodine wrote: > On ...
6 years, 6 months ago (2014-06-03 19:04:22 UTC) #7
Inactive
On 2014/06/03 18:59:53, timvolodine wrote: > On 2014/06/03 18:53:50, Chris Dumez wrote: > > > ...
6 years, 6 months ago (2014-06-03 19:08:37 UTC) #8
timvolodine
On 2014/06/03 19:08:37, Chris Dumez wrote: > On 2014/06/03 18:59:53, timvolodine wrote: > > On ...
6 years, 6 months ago (2014-06-04 12:58:26 UTC) #9
Inactive
On 2014/06/04 12:58:26, timvolodine wrote: > On 2014/06/03 19:08:37, Chris Dumez wrote: > > On ...
6 years, 6 months ago (2014-06-04 13:06:58 UTC) #10
timvolodine
adding jochen@ as owner of modules/
6 years, 6 months ago (2014-06-05 11:07:51 UTC) #11
tkent
lgtm https://codereview.chromium.org/315573002/diff/120001/Source/modules/device_orientation/DeviceMotionController.cpp File Source/modules/device_orientation/DeviceMotionController.cpp (right): https://codereview.chromium.org/315573002/diff/120001/Source/modules/device_orientation/DeviceMotionController.cpp#newcode2 Source/modules/device_orientation/DeviceMotionController.cpp:2: * Copyright (C) 2013 Google Inc. All rights ...
6 years, 6 months ago (2014-06-05 16:06:17 UTC) #12
timvolodine
thanks! https://codereview.chromium.org/315573002/diff/120001/Source/modules/device_orientation/DeviceMotionController.cpp File Source/modules/device_orientation/DeviceMotionController.cpp (right): https://codereview.chromium.org/315573002/diff/120001/Source/modules/device_orientation/DeviceMotionController.cpp#newcode2 Source/modules/device_orientation/DeviceMotionController.cpp:2: * Copyright (C) 2013 Google Inc. All rights ...
6 years, 6 months ago (2014-06-05 17:29:04 UTC) #13
timvolodine
The CQ bit was checked by timvolodine@chromium.org
6 years, 6 months ago (2014-06-05 19:34:20 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/timvolodine@chromium.org/315573002/160001
6 years, 6 months ago (2014-06-05 19:35:33 UTC) #15
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: blink_presubmit on tryserver.blink ...
6 years, 6 months ago (2014-06-05 20:50:50 UTC) #16
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 6 months ago (2014-06-05 22:19:13 UTC) #17
commit-bot: I haz the power
Try jobs failed on following builders: linux_blink_dbg on tryserver.blink (http://build.chromium.org/p/tryserver.blink/builders/linux_blink_dbg/builds/11180)
6 years, 6 months ago (2014-06-05 22:19:14 UTC) #18
tkent
The CQ bit was checked by tkent@chromium.org
6 years, 6 months ago (2014-06-05 23:01:38 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/timvolodine@chromium.org/315573002/160001
6 years, 6 months ago (2014-06-05 23:02:16 UTC) #20
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: linux_blink_dbg on tryserver.blink ...
6 years, 6 months ago (2014-06-06 00:18:08 UTC) #21
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 6 months ago (2014-06-06 02:04:08 UTC) #22
commit-bot: I haz the power
Try jobs failed on following builders: linux_blink_dbg on tryserver.blink (http://build.chromium.org/p/tryserver.blink/builders/linux_blink_dbg/builds/11222)
6 years, 6 months ago (2014-06-06 02:04:09 UTC) #23
timvolodine
The CQ bit was checked by timvolodine@chromium.org
6 years, 6 months ago (2014-06-06 09:48:18 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/timvolodine@chromium.org/315573002/160001
6 years, 6 months ago (2014-06-06 09:49:10 UTC) #25
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: linux_blink_dbg on tryserver.blink ...
6 years, 6 months ago (2014-06-06 10:58:15 UTC) #26
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 6 months ago (2014-06-06 12:15:18 UTC) #27
commit-bot: I haz the power
Try jobs failed on following builders: linux_blink_dbg on tryserver.blink (http://build.chromium.org/p/tryserver.blink/builders/linux_blink_dbg/builds/11305)
6 years, 6 months ago (2014-06-06 12:15:19 UTC) #28
timvolodine
On 2014/06/06 12:15:19, I haz the power (commit-bot) wrote: > Try jobs failed on following ...
6 years, 6 months ago (2014-06-06 12:18:58 UTC) #29
timvolodine
The CQ bit was checked by timvolodine@chromium.org
6 years, 6 months ago (2014-06-06 12:19:30 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/timvolodine@chromium.org/315573002/160001
6 years, 6 months ago (2014-06-06 12:20:20 UTC) #31
commit-bot: I haz the power
Change committed as 175661
6 years, 6 months ago (2014-06-06 12:32:49 UTC) #32
dcheng
A revert of this CL has been created in https://codereview.chromium.org/315023006/ by dcheng@chromium.org. The reason for ...
6 years, 6 months ago (2014-06-06 16:25:16 UTC) #33
timvolodine
The CQ bit was checked by timvolodine@chromium.org
6 years, 6 months ago (2014-06-06 18:10:51 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/timvolodine@chromium.org/315573002/180001
6 years, 6 months ago (2014-06-06 18:11:08 UTC) #35
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: blink_presubmit on tryserver.blink ...
6 years, 6 months ago (2014-06-06 18:20:11 UTC) #36
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 6 months ago (2014-06-06 18:22:35 UTC) #37
commit-bot: I haz the power
Try jobs failed on following builders: blink_presubmit on tryserver.blink (http://build.chromium.org/p/tryserver.blink/builders/blink_presubmit/builds/7196)
6 years, 6 months ago (2014-06-06 18:22:36 UTC) #38
timvolodine
The CQ bit was checked by timvolodine@chromium.org
6 years, 6 months ago (2014-06-06 18:24:16 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/315573002/180001
6 years, 6 months ago (2014-06-06 18:25:15 UTC) #40
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: blink_presubmit on tryserver.blink ...
6 years, 6 months ago (2014-06-06 18:28:16 UTC) #41
commit-bot: I haz the power
Change committed as 175686
6 years, 6 months ago (2014-06-06 18:31:18 UTC) #42
dcheng
A revert of this CL has been created in https://codereview.chromium.org/321653003/ by dcheng@chromium.org. The reason for ...
6 years, 6 months ago (2014-06-07 07:59:32 UTC) #43
timvolodine
The CQ bit was checked by timvolodine@chromium.org
6 years, 6 months ago (2014-06-09 13:09:41 UTC) #44
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/timvolodine@chromium.org/315573002/200001
6 years, 6 months ago (2014-06-09 13:10:00 UTC) #45
commit-bot: I haz the power
6 years, 6 months ago (2014-06-09 13:18:25 UTC) #46
Message was sent while issue was closed.
Change committed as 175792

Powered by Google App Engine
This is Rietveld 408576698