Generic Sensor API reading update notifications should be in sync with request Animation Frame code path instead of using periodic timer. The Generic Sensor API specification: https://w3c.github.io/sensors/
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/6b071fe7dc3bd64a2914eadd5c67b483d064a6cb commit 6b071fe7dc3bd64a2914eadd5c67b483d064a6cb Author: mikhail.pozdnyakov <mikhail.pozdnyakov@intel.com> Date: Mon Dec 19 13:59:39 2016 [Sensors] Align sensor reading updates and 'onchange' notification with rAF. For all sensors new reading values are read and 'onchange' notfication is send from rAF callbacks, thus avoiding possible Critical Rendering Path interruption. Before this change a timers were used and this could unnecessarily drain CPU and battery. BUG= 668052 BUG= 606766 Review-Url: https://codereview.chromium.org/2551223003 Cr-Commit-Position: refs/heads/master@{#439467} [modify] https://crrev.com/6b071fe7dc3bd64a2914eadd5c67b483d064a6cb/third_party/WebKit/LayoutTests/sensor/resources/generic-sensor-tests.js [modify] https://crrev.com/6b071fe7dc3bd64a2914eadd5c67b483d064a6cb/third_party/WebKit/Source/modules/sensor/BUILD.gn [modify] https://crrev.com/6b071fe7dc3bd64a2914eadd5c67b483d064a6cb/third_party/WebKit/Source/modules/sensor/Sensor.cpp [modify] https://crrev.com/6b071fe7dc3bd64a2914eadd5c67b483d064a6cb/third_party/WebKit/Source/modules/sensor/Sensor.h [modify] https://crrev.com/6b071fe7dc3bd64a2914eadd5c67b483d064a6cb/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.cpp [modify] https://crrev.com/6b071fe7dc3bd64a2914eadd5c67b483d064a6cb/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.h [modify] https://crrev.com/6b071fe7dc3bd64a2914eadd5c67b483d064a6cb/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp [modify] https://crrev.com/6b071fe7dc3bd64a2914eadd5c67b483d064a6cb/third_party/WebKit/Source/modules/sensor/SensorProxy.h [add] https://crrev.com/6b071fe7dc3bd64a2914eadd5c67b483d064a6cb/third_party/WebKit/Source/modules/sensor/SensorReadingUpdater.cpp [add] https://crrev.com/6b071fe7dc3bd64a2914eadd5c67b483d064a6cb/third_party/WebKit/Source/modules/sensor/SensorReadingUpdater.h [delete] https://crrev.com/d9217bcdb39187bec28543abcc5ec82761c1e64c/third_party/WebKit/Source/modules/sensor/SensorUpdateNotificationStrategy.cpp [delete] https://crrev.com/d9217bcdb39187bec28543abcc5ec82761c1e64c/third_party/WebKit/Source/modules/sensor/SensorUpdateNotificationStrategy.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/fbf954d48f20330a013b68c5f0eb32094ce29263 commit fbf954d48f20330a013b68c5f0eb32094ce29263 Author: wjmaclean <wjmaclean@chromium.org> Date: Mon Dec 19 16:26:30 2016 Revert of [Sensors] Align sensor reading updates and 'onchange' notification with rAF. (patchset #6 id:140001 of https://codereview.chromium.org/2551223003/ ) Reason for revert: Seems like a likely cause for failures on: https://test-results.appspot.com/dashboards/flakiness_dashboard.html#tests=sensor%2Faccelerometer.html&testType=webkit_tests Original issue's description: > [Sensors] Align sensor reading updates and 'onchange' notification with rAF. > > For all sensors new reading values are read and 'onchange' notfication is send from rAF callbacks, thus avoiding possible Critical Rendering Path interruption. > > Before this change a timers were used and this could unnecessarily drain CPU and battery. > > BUG= 668052 > BUG= 606766 > > Committed: https://crrev.com/6b071fe7dc3bd64a2914eadd5c67b483d064a6cb > Cr-Commit-Position: refs/heads/master@{#439467} TBR=reillyg@chromium.org,alexander.shalamov@intel.com,haraken@chromium.org,foolip@chromium.org,mikhail.pozdnyakov@intel.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG= 668052 Review-Url: https://codereview.chromium.org/2590513002 Cr-Commit-Position: refs/heads/master@{#439487} [modify] https://crrev.com/fbf954d48f20330a013b68c5f0eb32094ce29263/third_party/WebKit/LayoutTests/sensor/resources/generic-sensor-tests.js [modify] https://crrev.com/fbf954d48f20330a013b68c5f0eb32094ce29263/third_party/WebKit/Source/modules/sensor/BUILD.gn [modify] https://crrev.com/fbf954d48f20330a013b68c5f0eb32094ce29263/third_party/WebKit/Source/modules/sensor/Sensor.cpp [modify] https://crrev.com/fbf954d48f20330a013b68c5f0eb32094ce29263/third_party/WebKit/Source/modules/sensor/Sensor.h [modify] https://crrev.com/fbf954d48f20330a013b68c5f0eb32094ce29263/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.cpp [modify] https://crrev.com/fbf954d48f20330a013b68c5f0eb32094ce29263/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.h [modify] https://crrev.com/fbf954d48f20330a013b68c5f0eb32094ce29263/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp [modify] https://crrev.com/fbf954d48f20330a013b68c5f0eb32094ce29263/third_party/WebKit/Source/modules/sensor/SensorProxy.h [delete] https://crrev.com/dc9f82823179751d15790d2347e1f0e83aaf4b13/third_party/WebKit/Source/modules/sensor/SensorReadingUpdater.cpp [delete] https://crrev.com/dc9f82823179751d15790d2347e1f0e83aaf4b13/third_party/WebKit/Source/modules/sensor/SensorReadingUpdater.h [add] https://crrev.com/fbf954d48f20330a013b68c5f0eb32094ce29263/third_party/WebKit/Source/modules/sensor/SensorUpdateNotificationStrategy.cpp [add] https://crrev.com/fbf954d48f20330a013b68c5f0eb32094ce29263/third_party/WebKit/Source/modules/sensor/SensorUpdateNotificationStrategy.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/5f2cde61f6ff4a764b9b1c7d74a24ef6de815835 commit 5f2cde61f6ff4a764b9b1c7d74a24ef6de815835 Author: mikhail.pozdnyakov <mikhail.pozdnyakov@intel.com> Date: Wed Dec 21 20:58:31 2016 [Sensors] Reland: Align sensor reading updates and 'onchange' notification with rAF. For all sensors new reading values are read and 'onchange' notfication is send from rAF callbacks, thus avoiding possible Critical Rendering Path interruption. Before this change a timers were used and this could unnecessarily drain CPU and battery. BUG= 668052 BUG= 606766 Committed: https://crrev.com/6b071fe7dc3bd64a2914eadd5c67b483d064a6cb Cr-Commit-Position: refs/heads/master@{#439467} patch from issue 2551223003 at patchset 140001 (http://crrev.com/2551223003#ps140001) Review-Url: https://codereview.chromium.org/2589283003 Cr-Commit-Position: refs/heads/master@{#440208} [modify] https://crrev.com/5f2cde61f6ff4a764b9b1c7d74a24ef6de815835/third_party/WebKit/LayoutTests/sensor/accelerometer.html [modify] https://crrev.com/5f2cde61f6ff4a764b9b1c7d74a24ef6de815835/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html [modify] https://crrev.com/5f2cde61f6ff4a764b9b1c7d74a24ef6de815835/third_party/WebKit/LayoutTests/sensor/gyroscope.html [modify] https://crrev.com/5f2cde61f6ff4a764b9b1c7d74a24ef6de815835/third_party/WebKit/LayoutTests/sensor/magnetometer.html [modify] https://crrev.com/5f2cde61f6ff4a764b9b1c7d74a24ef6de815835/third_party/WebKit/LayoutTests/sensor/resources/generic-sensor-tests.js [modify] https://crrev.com/5f2cde61f6ff4a764b9b1c7d74a24ef6de815835/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js [modify] https://crrev.com/5f2cde61f6ff4a764b9b1c7d74a24ef6de815835/third_party/WebKit/Source/modules/sensor/BUILD.gn [modify] https://crrev.com/5f2cde61f6ff4a764b9b1c7d74a24ef6de815835/third_party/WebKit/Source/modules/sensor/Sensor.cpp [modify] https://crrev.com/5f2cde61f6ff4a764b9b1c7d74a24ef6de815835/third_party/WebKit/Source/modules/sensor/Sensor.h [modify] https://crrev.com/5f2cde61f6ff4a764b9b1c7d74a24ef6de815835/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.cpp [modify] https://crrev.com/5f2cde61f6ff4a764b9b1c7d74a24ef6de815835/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.h [modify] https://crrev.com/5f2cde61f6ff4a764b9b1c7d74a24ef6de815835/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp [modify] https://crrev.com/5f2cde61f6ff4a764b9b1c7d74a24ef6de815835/third_party/WebKit/Source/modules/sensor/SensorProxy.h [add] https://crrev.com/5f2cde61f6ff4a764b9b1c7d74a24ef6de815835/third_party/WebKit/Source/modules/sensor/SensorReadingUpdater.cpp [add] https://crrev.com/5f2cde61f6ff4a764b9b1c7d74a24ef6de815835/third_party/WebKit/Source/modules/sensor/SensorReadingUpdater.h [delete] https://crrev.com/f9801783df3fe00bf8e78e26bc4ed898f9df2281/third_party/WebKit/Source/modules/sensor/SensorUpdateNotificationStrategy.cpp [delete] https://crrev.com/f9801783df3fe00bf8e78e26bc4ed898f9df2281/third_party/WebKit/Source/modules/sensor/SensorUpdateNotificationStrategy.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/e2f7eddb1030e053847378b4202416c807fa298e commit e2f7eddb1030e053847378b4202416c807fa298e Author: hcarmona <hcarmona@chromium.org> Date: Wed Dec 21 23:09:05 2016 Revert of [Sensors] Reland: Align sensor reading updates and 'onchange' notification with rAF. (patchset #4 id:60001 of https://codereview.chromium.org/2589283003/ ) Reason for revert: This looks like a likely cause of these failures: https://uberchromegw.corp.google.com/i/chromium.webkit/builders/WebKit%20Linux%20Trusty%20Leak/builds/945 Original issue's description: > [Sensors] Reland: Align sensor reading updates and 'onchange' notification with rAF. > > For all sensors new reading values are read and 'onchange' notfication is send from rAF callbacks, thus avoiding possible Critical Rendering Path interruption. > > Before this change a timers were used and this could unnecessarily drain CPU and battery. > > BUG= 668052 > BUG= 606766 > > Committed: https://crrev.com/6b071fe7dc3bd64a2914eadd5c67b483d064a6cb > Cr-Commit-Position: refs/heads/master@{#439467} > > patch from issue 2551223003 at patchset 140001 (http://crrev.com/2551223003#ps140001) > > Committed: https://crrev.com/5f2cde61f6ff4a764b9b1c7d74a24ef6de815835 > Cr-Commit-Position: refs/heads/master@{#440208} TBR=alexander.shalamov@intel.com,haraken@chromium.org,reillyg@chromium.org,mikhail.pozdnyakov@intel.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG= 668052 Review-Url: https://codereview.chromium.org/2596063003 Cr-Commit-Position: refs/heads/master@{#440257} [modify] https://crrev.com/e2f7eddb1030e053847378b4202416c807fa298e/third_party/WebKit/LayoutTests/sensor/accelerometer.html [modify] https://crrev.com/e2f7eddb1030e053847378b4202416c807fa298e/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html [modify] https://crrev.com/e2f7eddb1030e053847378b4202416c807fa298e/third_party/WebKit/LayoutTests/sensor/gyroscope.html [modify] https://crrev.com/e2f7eddb1030e053847378b4202416c807fa298e/third_party/WebKit/LayoutTests/sensor/magnetometer.html [modify] https://crrev.com/e2f7eddb1030e053847378b4202416c807fa298e/third_party/WebKit/LayoutTests/sensor/resources/generic-sensor-tests.js [modify] https://crrev.com/e2f7eddb1030e053847378b4202416c807fa298e/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js [modify] https://crrev.com/e2f7eddb1030e053847378b4202416c807fa298e/third_party/WebKit/Source/modules/sensor/BUILD.gn [modify] https://crrev.com/e2f7eddb1030e053847378b4202416c807fa298e/third_party/WebKit/Source/modules/sensor/Sensor.cpp [modify] https://crrev.com/e2f7eddb1030e053847378b4202416c807fa298e/third_party/WebKit/Source/modules/sensor/Sensor.h [modify] https://crrev.com/e2f7eddb1030e053847378b4202416c807fa298e/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.cpp [modify] https://crrev.com/e2f7eddb1030e053847378b4202416c807fa298e/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.h [modify] https://crrev.com/e2f7eddb1030e053847378b4202416c807fa298e/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp [modify] https://crrev.com/e2f7eddb1030e053847378b4202416c807fa298e/third_party/WebKit/Source/modules/sensor/SensorProxy.h [delete] https://crrev.com/ffc683508cd14f45a6fe8463224795a5c48c3c18/third_party/WebKit/Source/modules/sensor/SensorReadingUpdater.cpp [delete] https://crrev.com/ffc683508cd14f45a6fe8463224795a5c48c3c18/third_party/WebKit/Source/modules/sensor/SensorReadingUpdater.h [add] https://crrev.com/e2f7eddb1030e053847378b4202416c807fa298e/third_party/WebKit/Source/modules/sensor/SensorUpdateNotificationStrategy.cpp [add] https://crrev.com/e2f7eddb1030e053847378b4202416c807fa298e/third_party/WebKit/Source/modules/sensor/SensorUpdateNotificationStrategy.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/a14c24ea3dd1eb6c6bcb72d1ffa1b1cece4c3257 commit a14c24ea3dd1eb6c6bcb72d1ffa1b1cece4c3257 Author: mikhail.pozdnyakov <mikhail.pozdnyakov@intel.com> Date: Fri Dec 23 18:58:20 2016 [Sensors] Reland: Reland: Align sensor reading updates and 'onchange' notification with rAF. For all sensors new reading values are read and 'onchange' notfication is send from rAF callbacks, thus avoiding possible Critical Rendering Path interruption. Before this change a timers were used and this could unnecessarily drain CPU and battery. BUG= 668052 BUG= 606766 Committed: https://crrev.com/6b071fe7dc3bd64a2914eadd5c67b483d064a6cb Cr-Commit-Position: refs/heads/master@{#439467} patch from issue 2551223003 at patchset 140001 (http://crrev.com/2551223003#ps140001) Committed: https://crrev.com/5f2cde61f6ff4a764b9b1c7d74a24ef6de815835 Cr-Commit-Position: refs/heads/master@{#440208} patch from issue 2589283003 at patchset 60001 (http://crrev.com/2589283003#ps60001) Review-Url: https://codereview.chromium.org/2604483004 Cr-Commit-Position: refs/heads/master@{#440650} [modify] https://crrev.com/a14c24ea3dd1eb6c6bcb72d1ffa1b1cece4c3257/third_party/WebKit/LayoutTests/sensor/accelerometer.html [modify] https://crrev.com/a14c24ea3dd1eb6c6bcb72d1ffa1b1cece4c3257/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html [modify] https://crrev.com/a14c24ea3dd1eb6c6bcb72d1ffa1b1cece4c3257/third_party/WebKit/LayoutTests/sensor/gyroscope.html [modify] https://crrev.com/a14c24ea3dd1eb6c6bcb72d1ffa1b1cece4c3257/third_party/WebKit/LayoutTests/sensor/magnetometer.html [modify] https://crrev.com/a14c24ea3dd1eb6c6bcb72d1ffa1b1cece4c3257/third_party/WebKit/LayoutTests/sensor/resources/generic-sensor-tests.js [modify] https://crrev.com/a14c24ea3dd1eb6c6bcb72d1ffa1b1cece4c3257/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js [modify] https://crrev.com/a14c24ea3dd1eb6c6bcb72d1ffa1b1cece4c3257/third_party/WebKit/Source/modules/sensor/BUILD.gn [modify] https://crrev.com/a14c24ea3dd1eb6c6bcb72d1ffa1b1cece4c3257/third_party/WebKit/Source/modules/sensor/Sensor.cpp [modify] https://crrev.com/a14c24ea3dd1eb6c6bcb72d1ffa1b1cece4c3257/third_party/WebKit/Source/modules/sensor/Sensor.h [modify] https://crrev.com/a14c24ea3dd1eb6c6bcb72d1ffa1b1cece4c3257/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.cpp [modify] https://crrev.com/a14c24ea3dd1eb6c6bcb72d1ffa1b1cece4c3257/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.h [modify] https://crrev.com/a14c24ea3dd1eb6c6bcb72d1ffa1b1cece4c3257/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp [modify] https://crrev.com/a14c24ea3dd1eb6c6bcb72d1ffa1b1cece4c3257/third_party/WebKit/Source/modules/sensor/SensorProxy.h [add] https://crrev.com/a14c24ea3dd1eb6c6bcb72d1ffa1b1cece4c3257/third_party/WebKit/Source/modules/sensor/SensorReadingUpdater.cpp [add] https://crrev.com/a14c24ea3dd1eb6c6bcb72d1ffa1b1cece4c3257/third_party/WebKit/Source/modules/sensor/SensorReadingUpdater.h [delete] https://crrev.com/caa1245b3c7c6e75f3e79139bf6d90eb2227d953/third_party/WebKit/Source/modules/sensor/SensorUpdateNotificationStrategy.cpp [delete] https://crrev.com/caa1245b3c7c6e75f3e79139bf6d90eb2227d953/third_party/WebKit/Source/modules/sensor/SensorUpdateNotificationStrategy.h
Comment 1 by mikhail....@intel.com
, Nov 23 2016