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

Issue 2155143002: Fix a bug that could occasionaly cause setInterval to stop (Closed)

Created:
4 years, 5 months ago by alex clarke (OOO till 29th)
Modified:
4 years, 5 months ago
Reviewers:
rmcilroy
CC:
chromium-reviews, blink-reviews, scheduler-bugs_chromium.org, Sami, jochen (gone - plz use gerrit)
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix a bug that could occasionaly cause setInterval to stop There was a bad interaction between throttled task queues and logic in TimerBase::setNextFireTime that could cause setInterval to stop firing. If a timer was posted to a throttled task queue after running on a normal task queue, it was possible for NOW to be in the past. Logic existed in TimeDomain::ComputeDelayedRunTime to compensate for this. Usually that worked fine, however the anti-drift logic in TimerBase for repeating tasks could cause the scheduled run time (as visible to TimerBase) to fall on the exact same time as the previous run. This would cause TimerBase::setNextFireTime to nop out, which would cause the setInterval to stop firing. This patch prevents that by changing ThrottledTimeDomain to be based on RealTimeDomain. This means Now() is the real time rather than a periodically updated virtual time. I.e. it's monotonically increasing. At the same time I've remove the now useless TimeDomain::ComputeDelayedRunTime BUG=625041 Committed: https://crrev.com/d8ef45f5f3b2d1cdfe863d346acda5da03ba6716 Cr-Commit-Position: refs/heads/master@{#406017}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Changed ThrottledTimeDomain to be based on RealTimeDomain #

Total comments: 14

Patch Set 3 : Couple of comments #

Patch Set 4 : ClearExpiredWakeups tweak. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+89 lines, -82 lines) Patch
M components/scheduler/base/real_time_domain.h View 1 1 chunk +1 line, -2 lines 0 comments Download
M components/scheduler/base/real_time_domain.cc View 1 2 chunks +6 lines, -6 lines 0 comments Download
M components/scheduler/base/task_queue.h View 1 2 chunks +2 lines, -1 line 0 comments Download
M components/scheduler/base/task_queue_impl.h View 1 2 chunks +2 lines, -2 lines 0 comments Download
M components/scheduler/base/task_queue_impl.cc View 1 5 chunks +8 lines, -11 lines 0 comments Download
M components/scheduler/base/task_queue_manager_unittest.cc View 1 7 chunks +17 lines, -9 lines 0 comments Download
M components/scheduler/base/time_domain.h View 1 2 3 1 chunk +0 lines, -7 lines 0 comments Download
M components/scheduler/base/time_domain_unittest.cc View 1 1 chunk +0 lines, -5 lines 0 comments Download
M components/scheduler/base/virtual_time_domain.h View 1 1 chunk +0 lines, -2 lines 0 comments Download
M components/scheduler/base/virtual_time_domain.cc View 1 1 chunk +0 lines, -6 lines 0 comments Download
M components/scheduler/child/compositor_worker_scheduler.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M components/scheduler/child/idle_helper.cc View 1 1 chunk +2 lines, -1 line 0 comments Download
M components/scheduler/child/scheduler_helper_unittest.cc View 1 2 chunks +3 lines, -1 line 0 comments Download
M components/scheduler/renderer/throttled_time_domain.h View 1 2 3 1 chunk +9 lines, -9 lines 0 comments Download
M components/scheduler/renderer/throttled_time_domain.cc View 1 2 1 chunk +22 lines, -14 lines 0 comments Download
M components/scheduler/renderer/throttling_helper.cc View 1 3 chunks +4 lines, -5 lines 0 comments Download
M components/scheduler/renderer/throttling_helper_unittest.cc View 1 1 chunk +12 lines, -0 lines 0 comments Download

Messages

Total messages: 31 (17 generated)
alex clarke (OOO till 29th)
4 years, 5 months ago (2016-07-18 12:21:17 UTC) #4
rmcilroy
https://codereview.chromium.org/2155143002/diff/1/components/scheduler/renderer/throttled_time_domain.cc File components/scheduler/renderer/throttled_time_domain.cc (right): https://codereview.chromium.org/2155143002/diff/1/components/scheduler/renderer/throttled_time_domain.cc#newcode18 components/scheduler/renderer/throttled_time_domain.cc:18: base::TimeTicks ThrottledTimeDomain::BlinkNow() const { As discussed offline, could we ...
4 years, 5 months ago (2016-07-18 13:03:03 UTC) #6
alex clarke (OOO till 29th)
I'll make a Blink change separately, TimerBase::runInternal is calling timerMonotonicallyIncreasingTime twice which it doesn't need ...
4 years, 5 months ago (2016-07-18 14:58:20 UTC) #13
alex clarke (OOO till 29th)
https://codereview.chromium.org/2155143002/diff/1/components/scheduler/renderer/throttled_time_domain.cc File components/scheduler/renderer/throttled_time_domain.cc (right): https://codereview.chromium.org/2155143002/diff/1/components/scheduler/renderer/throttled_time_domain.cc#newcode18 components/scheduler/renderer/throttled_time_domain.cc:18: base::TimeTicks ThrottledTimeDomain::BlinkNow() const { On 2016/07/18 13:03:03, rmcilroy wrote: ...
4 years, 5 months ago (2016-07-18 15:02:01 UTC) #15
rmcilroy
I like this approach better, thanks! I'm not sure I totally understand the intricacies of ...
4 years, 5 months ago (2016-07-18 15:22:57 UTC) #16
alex clarke (OOO till 29th)
Thanks Ross. https://codereview.chromium.org/2155143002/diff/20001/components/scheduler/base/task_queue_impl.cc File components/scheduler/base/task_queue_impl.cc (right): https://codereview.chromium.org/2155143002/diff/20001/components/scheduler/base/task_queue_impl.cc#newcode450 components/scheduler/base/task_queue_impl.cc:450: LazyNow lazy_now(main_thread_only().time_domain->CreateLazyNow()); On 2016/07/18 15:22:57, rmcilroy wrote: ...
4 years, 5 months ago (2016-07-18 15:35:53 UTC) #17
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/2155143002/40001
4 years, 5 months ago (2016-07-18 15:36:35 UTC) #20
rmcilroy
https://codereview.chromium.org/2155143002/diff/20001/components/scheduler/base/task_queue_impl.cc File components/scheduler/base/task_queue_impl.cc (right): https://codereview.chromium.org/2155143002/diff/20001/components/scheduler/base/task_queue_impl.cc#newcode450 components/scheduler/base/task_queue_impl.cc:450: LazyNow lazy_now(main_thread_only().time_domain->CreateLazyNow()); On 2016/07/18 15:35:52, alex clarke wrote: > ...
4 years, 5 months ago (2016-07-18 16:01:42 UTC) #21
alex clarke (OOO till 29th)
https://codereview.chromium.org/2155143002/diff/20001/components/scheduler/base/time_domain.h File components/scheduler/base/time_domain.h (right): https://codereview.chromium.org/2155143002/diff/20001/components/scheduler/base/time_domain.h#newcode67 components/scheduler/base/time_domain.h:67: void ClearExpiredWakeups(); On 2016/07/18 16:01:42, rmcilroy wrote: > On ...
4 years, 5 months ago (2016-07-18 16:06:38 UTC) #22
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/2155143002/60001
4 years, 5 months ago (2016-07-18 16:07:34 UTC) #25
rmcilroy
https://codereview.chromium.org/2155143002/diff/20001/components/scheduler/base/time_domain.h File components/scheduler/base/time_domain.h (right): https://codereview.chromium.org/2155143002/diff/20001/components/scheduler/base/time_domain.h#newcode67 components/scheduler/base/time_domain.h:67: void ClearExpiredWakeups(); On 2016/07/18 16:06:38, alex clarke wrote: > ...
4 years, 5 months ago (2016-07-18 16:10:44 UTC) #26
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 5 months ago (2016-07-18 16:57:06 UTC) #28
commit-bot: I haz the power
CQ bit was unchecked.
4 years, 5 months ago (2016-07-18 16:57:16 UTC) #29
commit-bot: I haz the power
4 years, 5 months ago (2016-07-18 16:58:53 UTC) #31
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/d8ef45f5f3b2d1cdfe863d346acda5da03ba6716
Cr-Commit-Position: refs/heads/master@{#406017}

Powered by Google App Engine
This is Rietveld 408576698