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

Unified Diff: Source/core/frame/DOMTimer.cpp

Issue 258783004: Add a "forwarded" flag to usergesture tokens. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix unittest Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/frame/DOMTimer.cpp
diff --git a/Source/core/frame/DOMTimer.cpp b/Source/core/frame/DOMTimer.cpp
index 26a2133bf75c9e0179ce192dd206f50cf9dbc406..f6a587ccf0066c100166bbf8d319afa5ec0378ec 100644
--- a/Source/core/frame/DOMTimer.cpp
+++ b/Source/core/frame/DOMTimer.cpp
@@ -51,7 +51,8 @@ static inline bool shouldForwardUserGesture(int interval, int nestingLevel)
{
return UserGestureIndicator::processingUserGesture()
&& interval <= maxIntervalForUserGestureForwarding
- && nestingLevel == 1; // Gestures should not be forwarded to nested timers.
+ && nestingLevel == 1
+ && !UserGestureIndicator::currentToken()->wasForwarded();
}
double DOMTimer::hiddenPageAlignmentInterval()
@@ -114,6 +115,8 @@ void DOMTimer::fired()
timerNestingLevel = m_nestingLevel;
ASSERT(!context->activeDOMObjectsAreSuspended());
// Only the first execution of a multi-shot timer should get an affirmative user gesture indicator.
+ if (m_userGestureToken)
+ m_userGestureToken->setForwarded();
UserGestureIndicator gestureIndicator(m_userGestureToken.release());
InspectorInstrumentationCookie cookie = InspectorInstrumentation::willFireTimer(context, m_timeoutID);
« no previous file with comments | « LayoutTests/fast/events/popup-forwarded-postmessage-blocked-expected.txt ('k') | Source/core/frame/DOMWindow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698