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

Unified Diff: Source/platform/ThreadTimers.cpp

Issue 189833009: Trace where timers were scheduled in Blink (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 months 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: Source/platform/ThreadTimers.cpp
diff --git a/Source/platform/ThreadTimers.cpp b/Source/platform/ThreadTimers.cpp
index afac766be4370610b3ab274da6c6bf79aa06e2e6..43035709c8c1c4d16ea33166efc0f91a2ffb0d33 100644
--- a/Source/platform/ThreadTimers.cpp
+++ b/Source/platform/ThreadTimers.cpp
@@ -122,16 +122,20 @@ void ThreadTimers::sharedTimerFiredInternal()
double timeToQuit = fireTime + maxDurationOfFiringTimers;
while (!m_timerHeap.isEmpty() && m_timerHeap.first()->m_nextFireTime <= fireTime) {
- TimerBase* timer = m_timerHeap.first();
- timer->m_nextFireTime = 0;
- timer->m_unalignedNextFireTime = 0;
- timer->heapDeleteMin();
+ TimerBase& timer = *m_timerHeap.first();
+ timer.m_nextFireTime = 0;
+ timer.m_unalignedNextFireTime = 0;
+ timer.heapDeleteMin();
- double interval = timer->repeatInterval();
- timer->setNextFireTime(interval ? fireTime + interval : 0);
+ double interval = timer.repeatInterval();
+ timer.setNextFireTime(interval ? fireTime + interval : 0);
+
+ TRACE_EVENT2("blink", "ThreadTimers::sharedTimerFiredInternal",
+ "src_file", timer.location().fileName(),
+ "src_func", timer.location().functionName());
// Once the timer has been fired, it may be deleted, so do nothing else with it after this point.
- timer->fired();
+ timer.fired();
// Catch the case where the timer asked timers to fire in a nested event loop, or we are over time limit.
if (!m_firingTimers || timeToQuit < monotonicallyIncreasingTime())

Powered by Google App Engine
This is Rietveld 408576698