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

Unified Diff: third_party/WebKit/Source/core/frame/DOMTimerCoordinator.cpp

Issue 1477353002: Revert of Move throttling of background timers into the renderer scheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/frame/DOMTimerCoordinator.cpp
diff --git a/third_party/WebKit/Source/core/frame/DOMTimerCoordinator.cpp b/third_party/WebKit/Source/core/frame/DOMTimerCoordinator.cpp
index 4401db92bd20fae0217377162b880c4e627fd185..240f8cb5d0d7c6abb041666c257b9f14056fb1e5 100644
--- a/third_party/WebKit/Source/core/frame/DOMTimerCoordinator.cpp
+++ b/third_party/WebKit/Source/core/frame/DOMTimerCoordinator.cpp
@@ -42,6 +42,20 @@
m_timers.remove(timeoutID);
}
+void DOMTimerCoordinator::didChangeTimerAlignmentInterval()
+{
+ // Reschedule timers in increasing order of desired run time to maintain their relative order.
+ // TODO(skyostil): Move timer alignment into the scheduler.
+ WillBeHeapVector<RawPtrWillBeMember<DOMTimer>> timers;
+ timers.reserveCapacity(m_timers.size());
+ for (TimeoutMap::iterator iter = m_timers.begin(); iter != m_timers.end(); ++iter)
+ timers.append(iter->value.get());
+ std::sort(timers.begin(), timers.end(), TimerBase::Comparator());
+ double now = monotonicallyIncreasingTime();
+ for (DOMTimer* timer : timers)
+ timer->didChangeAlignmentInterval(now);
+}
+
DEFINE_TRACE(DOMTimerCoordinator)
{
#if ENABLE(OILPAN)
« no previous file with comments | « third_party/WebKit/Source/core/frame/DOMTimerCoordinator.h ('k') | third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698