| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef Timer_h | 26 #ifndef Timer_h |
| 27 #define Timer_h | 27 #define Timer_h |
| 28 | 28 |
| 29 #include "platform/PlatformExport.h" | 29 #include "platform/PlatformExport.h" |
| 30 #include "platform/heap/Handle.h" | 30 #include "platform/heap/Handle.h" |
| 31 #include "public/platform/WebTaskRunner.h" |
| 31 #include "public/platform/WebTraceLocation.h" | 32 #include "public/platform/WebTraceLocation.h" |
| 32 #include "wtf/AddressSanitizer.h" | 33 #include "wtf/AddressSanitizer.h" |
| 33 #include "wtf/Noncopyable.h" | 34 #include "wtf/Noncopyable.h" |
| 34 #include "wtf/Threading.h" | 35 #include "wtf/Threading.h" |
| 35 #include "wtf/Vector.h" | 36 #include "wtf/Vector.h" |
| 36 | 37 |
| 37 namespace blink { | 38 namespace blink { |
| 38 | 39 |
| 39 // Time intervals are all in seconds. | 40 // Time intervals are all in seconds. |
| 40 | 41 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 81 |
| 81 NO_LAZY_SWEEP_SANITIZE_ADDRESS | 82 NO_LAZY_SWEEP_SANITIZE_ADDRESS |
| 82 virtual bool canFire() const { return true; } | 83 virtual bool canFire() const { return true; } |
| 83 | 84 |
| 84 virtual double alignedFireTime(double fireTime) const { return fireTime; } | 85 virtual double alignedFireTime(double fireTime) const { return fireTime; } |
| 85 | 86 |
| 86 void setNextFireTime(double now, double delay); | 87 void setNextFireTime(double now, double delay); |
| 87 | 88 |
| 88 void runInternal(); | 89 void runInternal(); |
| 89 | 90 |
| 90 class CancellableTimerTask final : public WebThread::Task { | 91 class CancellableTimerTask final : public WebTaskRunner::Task { |
| 91 WTF_MAKE_NONCOPYABLE(CancellableTimerTask); | 92 WTF_MAKE_NONCOPYABLE(CancellableTimerTask); |
| 92 public: | 93 public: |
| 93 explicit CancellableTimerTask(TimerBase* timer) : m_timer(timer) { } | 94 explicit CancellableTimerTask(TimerBase* timer) : m_timer(timer) { } |
| 94 | 95 |
| 95 ~CancellableTimerTask() override | 96 ~CancellableTimerTask() override |
| 96 { | 97 { |
| 97 if (m_timer) | 98 if (m_timer) |
| 98 m_timer->m_cancellableTimerTask = nullptr; | 99 m_timer->m_cancellableTimerTask = nullptr; |
| 99 } | 100 } |
| 100 | 101 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 NO_LAZY_SWEEP_SANITIZE_ADDRESS | 186 NO_LAZY_SWEEP_SANITIZE_ADDRESS |
| 186 inline bool TimerBase::isActive() const | 187 inline bool TimerBase::isActive() const |
| 187 { | 188 { |
| 188 ASSERT(m_thread == currentThread()); | 189 ASSERT(m_thread == currentThread()); |
| 189 return m_cancellableTimerTask; | 190 return m_cancellableTimerTask; |
| 190 } | 191 } |
| 191 | 192 |
| 192 } // namespace blink | 193 } // namespace blink |
| 193 | 194 |
| 194 #endif // Timer_h | 195 #endif // Timer_h |
| OLD | NEW |