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

Issue 1373503002: Fix the drift in repeating timers (try #2) (Closed)

Created:
5 years, 2 months ago by alex clarke (OOO till 29th)
Modified:
5 years, 2 months ago
CC:
chromium-reviews, scheduler-bugs_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix the drift in repeating timers (try #2) Currently repeating blink timers ignore the difference between when the timer was due to fire and when it actually did. In addition the delay reported to chromium was rounded up to the nearest millisecond, introducing unnecessary extra delay. (Note seperatly DOMTimers have additional clamping). This fairly broken behaviour has been there for a long time, and I really hope nothing has come to depend on it! Judging by http://www.duckware.com/test/chrome/timeraccuracy.html this patch makes things a lot better at least on linux. The actual delays are much closer to the requested ones, and the run time modulo interval shows the drift is gone. Based on https://codereview.chromium.org/1261993006/ but without the assert. I've added test coverage to make sure nothing bad happens if the timer fires a little earlier than expected (which can happen since the delay gets quantized down to milliseconds on some platforms). BUG=328700 Committed: https://crrev.com/0d7bb8a499af076a64680f36b7b9c5b64fe334d0 Cr-Commit-Position: refs/heads/master@{#351295}

Patch Set 1 #

Patch Set 2 : Fix media/blink/run_all_unittests.cc #

Patch Set 3 : The unit is ms not s! #

Patch Set 4 : Try to fix compile #

Total comments: 10

Patch Set 5 : Rename some variables and add a todo #

Unified diffs Side-by-side diffs Delta from patch set Stats (+116 lines, -69 lines) Patch
M components/scheduler/child/web_task_runner_impl.h View 1 chunk +0 lines, -4 lines 0 comments Download
M components/scheduler/child/web_task_runner_impl.cc View 1 chunk +0 lines, -11 lines 0 comments Download
M third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/Timer.cpp View 1 2 2 chunks +11 lines, -10 lines 0 comments Download
M third_party/WebKit/Source/platform/TimerTest.cpp View 1 2 3 4 28 chunks +103 lines, -37 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurfaceTest.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/public/platform/WebTaskRunner.h View 1 chunk +0 lines, -5 lines 0 comments Download

Messages

Total messages: 33 (13 generated)
alex clarke (OOO till 29th)
5 years, 2 months ago (2015-09-25 10:50:26 UTC) #3
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1373503002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1373503002/1
5 years, 2 months ago (2015-09-25 10:50:45 UTC) #4
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_gn_chromeos_rel on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_gn_chromeos_rel/builds/86271)
5 years, 2 months ago (2015-09-25 11:06:30 UTC) #6
Sami
lgtm, thanks for giving this another shot. +Elliott, could you confirm that increasing the resolution ...
5 years, 2 months ago (2015-09-25 11:17:31 UTC) #8
alex clarke (OOO till 29th)
On 2015/09/25 11:17:31, Sami wrote: > lgtm, thanks for giving this another shot. > > ...
5 years, 2 months ago (2015-09-25 11:40:48 UTC) #9
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1373503002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1373503002/20001
5 years, 2 months ago (2015-09-25 11:41:19 UTC) #11
Sami
On 2015/09/25 11:40:48, alexclarke1 wrote: > I note that DOM timers specify the interval as ...
5 years, 2 months ago (2015-09-25 12:13:53 UTC) #12
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/107905)
5 years, 2 months ago (2015-09-25 12:22:11 UTC) #14
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1373503002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1373503002/40001
5 years, 2 months ago (2015-09-25 17:07:44 UTC) #16
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/118626) mac_chromium_compile_dbg_ng on ...
5 years, 2 months ago (2015-09-25 17:22:11 UTC) #18
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1373503002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1373503002/60001
5 years, 2 months ago (2015-09-28 09:14:35 UTC) #20
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 2 months ago (2015-09-28 10:54:25 UTC) #22
alex clarke (OOO till 29th)
Elliot does this look safe to you? Thanks!
5 years, 2 months ago (2015-09-28 17:23:48 UTC) #23
esprehn
Yeah this seems fine, you can do the renames and fix the std::vector in a ...
5 years, 2 months ago (2015-09-28 23:34:43 UTC) #24
alex clarke (OOO till 29th)
https://codereview.chromium.org/1373503002/diff/60001/third_party/WebKit/Source/platform/TimerTest.cpp File third_party/WebKit/Source/platform/TimerTest.cpp (right): https://codereview.chromium.org/1373503002/diff/60001/third_party/WebKit/Source/platform/TimerTest.cpp#newcode44 third_party/WebKit/Source/platform/TimerTest.cpp:44: DelayedTask(WebTaskRunner::Task* task, double delaySecs) On 2015/09/28 23:34:43, esprehn wrote: ...
5 years, 2 months ago (2015-09-29 10:58:36 UTC) #25
alex clarke (OOO till 29th)
+jochen@ for blink platform owners review.
5 years, 2 months ago (2015-09-29 10:59:22 UTC) #27
jochen (gone - plz use gerrit)
lgtm
5 years, 2 months ago (2015-09-29 11:09:36 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1373503002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1373503002/80001
5 years, 2 months ago (2015-09-29 11:10:39 UTC) #31
commit-bot: I haz the power
Committed patchset #5 (id:80001)
5 years, 2 months ago (2015-09-29 12:37:26 UTC) #32
commit-bot: I haz the power
5 years, 2 months ago (2015-09-29 12:38:03 UTC) #33
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/0d7bb8a499af076a64680f36b7b9c5b64fe334d0
Cr-Commit-Position: refs/heads/master@{#351295}

Powered by Google App Engine
This is Rietveld 408576698