| Index: third_party/WebKit/Source/core/frame/DOMTimer.cpp
|
| diff --git a/third_party/WebKit/Source/core/frame/DOMTimer.cpp b/third_party/WebKit/Source/core/frame/DOMTimer.cpp
|
| index a6140804ca9f54ac1a5eb73cb73cc82aa0a5ac0c..492982f4a7867858e02ecafb3ed86e29599c79ef 100644
|
| --- a/third_party/WebKit/Source/core/frame/DOMTimer.cpp
|
| +++ b/third_party/WebKit/Source/core/frame/DOMTimer.cpp
|
| @@ -47,7 +47,7 @@ static const double oneMillisecond = 0.001;
|
| static const double minimumInterval = 0.004;
|
|
|
| static inline bool shouldForwardUserGesture(int interval, int nestingLevel) {
|
| - return UserGestureIndicator::processingUserGesture() &&
|
| + return UserGestureIndicator::processingUserGestureThreadSafe() &&
|
| interval <= maxIntervalForUserGestureForwarding &&
|
| nestingLevel ==
|
| 1; // Gestures should not be forwarded to nested timers.
|
| @@ -90,8 +90,11 @@ DOMTimer::DOMTimer(ExecutionContext* context,
|
| m_nestingLevel(context->timers()->timerNestingLevel() + 1),
|
| m_action(action) {
|
| ASSERT(timeoutID > 0);
|
| - if (shouldForwardUserGesture(interval, m_nestingLevel))
|
| + if (shouldForwardUserGesture(interval, m_nestingLevel)) {
|
| + // Thread safe because shouldForwardUserGesture will only return true if
|
| + // execution is on the the main thread.
|
| m_userGestureToken = UserGestureIndicator::currentToken();
|
| + }
|
|
|
| InspectorInstrumentation::asyncTaskScheduled(
|
| context, singleShot ? "setTimeout" : "setInterval", this, !singleShot);
|
|
|