| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |