diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-16 14:56:46 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-16 14:57:30 +0200 |
commit | b297e0fa5c217c9467033b7c8b46891a52870120 (patch) | |
tree | 43fc14689295e9e64f2719d05aad94e3049f6cd7 /Source/WebCore/page/DOMTimer.cpp | |
parent | 69d517dbfa69903d8593cc1737f0474b21e3251e (diff) | |
download | qtwebkit-b297e0fa5c217c9467033b7c8b46891a52870120.tar.gz |
Revert "Imported WebKit commit 0dc6cd75e1d4836eaffbb520be96fac4847cc9d2 (http://svn.webkit.org/repository/webkit/trunk@131300)"
This reverts commit 5466563f4b5b6b86523e3f89bb7f77e5b5270c78.
Caused OOM issues on some CI machines :(
Diffstat (limited to 'Source/WebCore/page/DOMTimer.cpp')
-rw-r--r-- | Source/WebCore/page/DOMTimer.cpp | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/Source/WebCore/page/DOMTimer.cpp b/Source/WebCore/page/DOMTimer.cpp index 7d6831196..dad76f58d 100644 --- a/Source/WebCore/page/DOMTimer.cpp +++ b/Source/WebCore/page/DOMTimer.cpp @@ -30,7 +30,7 @@ #include "InspectorInstrumentation.h" #include "ScheduledAction.h" #include "ScriptExecutionContext.h" -#include <wtf/CurrentTime.h> +#include "UserGestureIndicator.h" #include <wtf/HashSet.h> #include <wtf/StdLibExtras.h> @@ -42,7 +42,6 @@ static const int maxIntervalForUserGestureForwarding = 1000; // One second match static const int maxTimerNestingLevel = 5; static const double oneMillisecond = 0.001; double DOMTimer::s_minDefaultTimerInterval = 0.010; // 10 milliseconds -double DOMTimer::s_defaultTimerAlignmentInterval = 0; static int timerNestingLevel = 0; @@ -69,9 +68,8 @@ DOMTimer::DOMTimer(ScriptExecutionContext* context, PassOwnPtr<ScheduledAction> , m_nestingLevel(timerNestingLevel + 1) , m_action(action) , m_originalInterval(interval) + , m_shouldForwardUserGesture(shouldForwardUserGesture(interval, m_nestingLevel)) { - if (shouldForwardUserGesture(interval, m_nestingLevel)) - m_userGestureToken = UserGestureIndicator::currentToken(); scriptExecutionContext()->addTimeout(m_timeoutId, this); double intervalMilliseconds = intervalClampedToMinimum(interval, context->minimumTimerInterval()); @@ -118,8 +116,10 @@ void DOMTimer::fired() ScriptExecutionContext* context = scriptExecutionContext(); timerNestingLevel = m_nestingLevel; ASSERT(!context->activeDOMObjectsAreSuspended()); + UserGestureIndicator gestureIndicator(m_shouldForwardUserGesture ? DefinitelyProcessingUserGesture : PossiblyProcessingUserGesture); + // Only the first execution of a multi-shot timer should get an affirmative user gesture indicator. - UserGestureIndicator gestureIndicator(m_userGestureToken.release()); + m_shouldForwardUserGesture = false; InspectorInstrumentationCookie cookie = InspectorInstrumentation::willFireTimer(context, m_timeoutId); @@ -194,19 +194,4 @@ double DOMTimer::intervalClampedToMinimum(int timeout, double minimumTimerInterv return intervalMilliseconds; } -double DOMTimer::alignedFireTime(double fireTime) const -{ - double alignmentInterval = scriptExecutionContext()->timerAlignmentInterval(); - if (alignmentInterval) { - double currentTime = monotonicallyIncreasingTime(); - if (fireTime <= currentTime) - return fireTime; - - double alignedTime = ceil(fireTime / alignmentInterval) * alignmentInterval; - return alignedTime; - } - - return fireTime; -} - } // namespace WebCore |