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 21256002: Fire null Device Motion events only once. (Closed)

Created:
7 years, 4 months ago by timvolodine
Modified:
7 years, 4 months ago
Reviewers:
abarth-chromium
CC:
blink-reviews, dglazkov+blink, eae+blinkwatch, pilgrim_google
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Fire null Device Motion events only once. This CL makes sure that the all-null events are fired only once. This lets the developers determine that no motion information can be provided and allows to save battery. Summarized this CL also implements the following features: - Unregister controller when receiving a null event. - Don't fire controllers removed or added during event dispatch. - Purge the controllers asap, i.e. not only on dispatch. This is also necessary to save battery in the case of Device Orientation events which fire only when substantially changed. Layout-Tests: - Tests for firing all null or partial null events. - Tests no firing of listeners added during event dispatch. - Tests firing last available event in case of multiple iframes. BUG=263415 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=155340

Patch Set 1 #

Total comments: 18

Patch Set 2 : fixed comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+462 lines, -24 lines) Patch
A LayoutTests/fast/dom/DeviceMotion/add-during-dispatch.html View 1 chunk +9 lines, -0 lines 0 comments Download
A LayoutTests/fast/dom/DeviceMotion/add-during-dispatch-expected.txt View 1 chunk +20 lines, -0 lines 0 comments Download
A LayoutTests/fast/dom/DeviceMotion/fire-last-event.html View 1 1 chunk +85 lines, -0 lines 0 comments Download
A LayoutTests/fast/dom/DeviceMotion/fire-last-event-expected.txt View 1 chunk +29 lines, -0 lines 0 comments Download
A + LayoutTests/fast/dom/DeviceMotion/null-values.html View 0 chunks +-1 lines, --1 lines 0 comments Download
A LayoutTests/fast/dom/DeviceMotion/null-values-expected.txt View 1 chunk +49 lines, -0 lines 0 comments Download
A LayoutTests/fast/dom/DeviceMotion/script-tests/add-during-dispatch.js View 1 chunk +71 lines, -0 lines 0 comments Download
A LayoutTests/fast/dom/DeviceMotion/script-tests/null-values.js View 1 chunk +101 lines, -0 lines 0 comments Download
M Source/modules/device_orientation/DeviceMotionController.h View 1 chunk +1 line, -0 lines 0 comments Download
M Source/modules/device_orientation/DeviceMotionController.cpp View 1 2 chunks +8 lines, -0 lines 0 comments Download
M Source/modules/device_orientation/DeviceMotionData.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M Source/modules/device_orientation/DeviceMotionData.cpp View 1 1 chunk +9 lines, -0 lines 0 comments Download
M Source/modules/device_orientation/DeviceMotionDispatcher.h View 1 chunk +0 lines, -1 line 0 comments Download
M Source/modules/device_orientation/DeviceMotionDispatcher.cpp View 1 2 chunks +13 lines, -8 lines 0 comments Download
M Source/modules/device_orientation/DeviceOrientationData.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M Source/modules/device_orientation/DeviceOrientationData.cpp View 1 1 chunk +5 lines, -0 lines 0 comments Download
M Source/modules/device_orientation/DeviceOrientationDispatcher.cpp View 1 2 chunks +12 lines, -7 lines 0 comments Download
M Source/modules/device_orientation/DeviceSensorEventController.h View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/modules/device_orientation/DeviceSensorEventController.cpp View 4 chunks +14 lines, -3 lines 0 comments Download
M Source/modules/device_orientation/DeviceSensorEventDispatcher.h View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/modules/device_orientation/DeviceSensorEventDispatcher.cpp View 1 3 chunks +20 lines, -6 lines 0 comments Download
M Source/modules/device_orientation/NewDeviceOrientationController.h View 1 chunk +1 line, -0 lines 0 comments Download
M Source/modules/device_orientation/NewDeviceOrientationController.cpp View 1 2 chunks +8 lines, -0 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
timvolodine
7 years, 4 months ago (2013-07-30 15:07:55 UTC) #1
abarth-chromium
https://chromiumcodereview.appspot.com/21256002/diff/1/LayoutTests/fast/dom/DeviceMotion/fire-last-event.html File LayoutTests/fast/dom/DeviceMotion/fire-last-event.html (right): https://chromiumcodereview.appspot.com/21256002/diff/1/LayoutTests/fast/dom/DeviceMotion/fire-last-event.html#newcode6 LayoutTests/fast/dom/DeviceMotion/fire-last-event.html:6: <script src="script-tests/fire-last-event.js"></script> You can just line this script in ...
7 years, 4 months ago (2013-07-31 00:56:19 UTC) #2
timvolodine
https://chromiumcodereview.appspot.com/21256002/diff/1/LayoutTests/fast/dom/DeviceMotion/fire-last-event.html File LayoutTests/fast/dom/DeviceMotion/fire-last-event.html (right): https://chromiumcodereview.appspot.com/21256002/diff/1/LayoutTests/fast/dom/DeviceMotion/fire-last-event.html#newcode6 LayoutTests/fast/dom/DeviceMotion/fire-last-event.html:6: <script src="script-tests/fire-last-event.js"></script> On 2013/07/31 00:56:19, abarth wrote: > You ...
7 years, 4 months ago (2013-07-31 13:59:00 UTC) #3
abarth-chromium
On 2013/07/31 13:59:00, timvolodine wrote: > https://chromiumcodereview.appspot.com/21256002/diff/1/Source/modules/device_orientation/DeviceMotionDispatcher.cpp#newcode81 > Source/modules/device_orientation/DeviceMotionDispatcher.cpp:81: size_t end = > m_controllers.size(); > ...
7 years, 4 months ago (2013-07-31 22:28:00 UTC) #4
abarth-chromium
lgtm
7 years, 4 months ago (2013-07-31 22:28:58 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/timvolodine@chromium.org/21256002/12001
7 years, 4 months ago (2013-07-31 22:30:02 UTC) #6
commit-bot: I haz the power
Retried try job too often on linux_blink_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_blink_rel&number=699
7 years, 4 months ago (2013-08-01 00:31:56 UTC) #7
timvolodine
+ Mark FYI
7 years, 4 months ago (2013-08-01 11:00:52 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/timvolodine@chromium.org/21256002/12001
7 years, 4 months ago (2013-08-01 15:02:47 UTC) #9
commit-bot: I haz the power
7 years, 4 months ago (2013-08-01 16:25:38 UTC) #10
Message was sent while issue was closed.
Change committed as 155340

Powered by Google App Engine
This is Rietveld 408576698