diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-03-05 14:34:32 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-05 14:34:32 -0800 |
commit | 635860845790a19bf50bbc51ba8fb66a96dde068 (patch) | |
tree | ef6ad9ff73a5b57f65249d4232a202fa77e6a140 /WebCore/platform/Timer.cpp | |
parent | 8e35f3cfc7fba1d1c829dc557ebad6409cbe16a2 (diff) | |
download | external_webkit-635860845790a19bf50bbc51ba8fb66a96dde068.zip external_webkit-635860845790a19bf50bbc51ba8fb66a96dde068.tar.gz external_webkit-635860845790a19bf50bbc51ba8fb66a96dde068.tar.bz2 |
auto import from //depot/cupcake/@136594
Diffstat (limited to 'WebCore/platform/Timer.cpp')
-rw-r--r-- | WebCore/platform/Timer.cpp | 46 |
1 files changed, 28 insertions, 18 deletions
diff --git a/WebCore/platform/Timer.cpp b/WebCore/platform/Timer.cpp index 94e2af8..a8fcbb8 100644 --- a/WebCore/platform/Timer.cpp +++ b/WebCore/platform/Timer.cpp @@ -27,10 +27,10 @@ #include "Timer.h" #include "SharedTimer.h" -#include "SystemTime.h" #include <limits.h> #include <limits> #include <math.h> +#include <wtf/CurrentTime.h> #include <wtf/HashSet.h> #include <wtf/Vector.h> @@ -46,7 +46,9 @@ namespace WebCore { // ---------------- -static bool deferringTimers; +#ifdef ANDROID_FIX // it is removed in http://trac.webkit.org/changeset/40080, but Android needs it +static bool deferringTimers; +#endif static Vector<TimerBase*>* timerHeap; static HashSet<const TimerBase*>* timersReadyToFire; @@ -64,7 +66,8 @@ public: TimerBase* timer() const { return m_timer; } - void checkConsistency() const { + void checkConsistency() const + { ASSERT(m_index >= 0); ASSERT(m_index < (timerHeap ? static_cast<int>(timerHeap->size()) : 0)); } @@ -131,9 +134,10 @@ public: int index() const { return m_index; } - void checkConsistency(int offset = 0) const { - ASSERT(m_index + offset >= 0); - ASSERT(m_index + offset <= (timerHeap ? static_cast<int>(timerHeap->size()) : 0)); + void checkConsistency(int offset = 0) const + { + ASSERT_UNUSED(offset, m_index + offset >= 0); + ASSERT_UNUSED(offset, m_index + offset <= (timerHeap ? static_cast<int>(timerHeap->size()) : 0)); } private: @@ -154,7 +158,11 @@ inline int operator-(TimerHeapIterator a, TimerHeapIterator b) { return a.index( void updateSharedTimer() { - if (timersReadyToFire || deferringTimers || !timerHeap || timerHeap->isEmpty()) +#ifdef ANDROID_FIX // it is removed in http://trac.webkit.org/changeset/40080, but Android needs it + if (timersReadyToFire || deferringTimers || !timerHeap || timerHeap->isEmpty()) +#else + if (timersReadyToFire || !timerHeap || timerHeap->isEmpty()) +#endif stopSharedTimer(); else setSharedTimerFireTime(timerHeap->first()->m_nextFireTime); @@ -378,19 +386,21 @@ void TimerBase::fireTimersInNestedEventLoop() updateSharedTimer(); } -// ---------------- +#ifdef ANDROID_FIX // it is removed in http://trac.webkit.org/changeset/40080, but Android needs it +// ---------------- -bool isDeferringTimers() -{ - return deferringTimers; -} +bool isDeferringTimers() +{ + return deferringTimers; +} -void setDeferringTimers(bool shouldDefer) -{ - if (shouldDefer == deferringTimers) - return; - deferringTimers = shouldDefer; - updateSharedTimer(); +void setDeferringTimers(bool shouldDefer) +{ + if (shouldDefer == deferringTimers) + return; + deferringTimers = shouldDefer; + updateSharedTimer(); } +#endif } |