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

Side by Side Diff: Source/platform/Timer.cpp

Issue 189833009: Trace where timers were scheduled in Blink (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/platform/Timer.h ('k') | Source/platform/TraceLocation.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Google Inc. All rights reserved. 3 * Copyright (C) 2009 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 #endif 196 #endif
197 { 197 {
198 } 198 }
199 199
200 TimerBase::~TimerBase() 200 TimerBase::~TimerBase()
201 { 201 {
202 stop(); 202 stop();
203 ASSERT(!inHeap()); 203 ASSERT(!inHeap());
204 } 204 }
205 205
206 void TimerBase::start(double nextFireInterval, double repeatInterval) 206 void TimerBase::start(double nextFireInterval, double repeatInterval, const Trac eLocation& caller)
207 { 207 {
208 ASSERT(m_thread == currentThread()); 208 ASSERT(m_thread == currentThread());
209 209
210 m_location = caller;
210 m_repeatInterval = repeatInterval; 211 m_repeatInterval = repeatInterval;
211 setNextFireTime(monotonicallyIncreasingTime() + nextFireInterval); 212 setNextFireTime(monotonicallyIncreasingTime() + nextFireInterval);
212 } 213 }
213 214
214 void TimerBase::stop() 215 void TimerBase::stop()
215 { 216 {
216 ASSERT(m_thread == currentThread()); 217 ASSERT(m_thread == currentThread());
217 218
218 m_repeatInterval = 0; 219 m_repeatInterval = 0;
219 setNextFireTime(0); 220 setNextFireTime(0);
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 } 407 }
407 408
408 double TimerBase::nextUnalignedFireInterval() const 409 double TimerBase::nextUnalignedFireInterval() const
409 { 410 {
410 ASSERT(isActive()); 411 ASSERT(isActive());
411 return max(m_unalignedNextFireTime - monotonicallyIncreasingTime(), 0.0); 412 return max(m_unalignedNextFireTime - monotonicallyIncreasingTime(), 0.0);
412 } 413 }
413 414
414 } // namespace WebCore 415 } // namespace WebCore
415 416
OLDNEW
« no previous file with comments | « Source/platform/Timer.h ('k') | Source/platform/TraceLocation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698