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

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

Issue 2555013004: UserGestureIndicator: remove many unnecessary calls to isMainThread (Closed)
Patch Set: remove bad comment (trybots prev) Created 4 years 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: 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..5dd767478644789ffeb7c2e77d4584c527ae4750 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.
@@ -91,7 +91,7 @@ DOMTimer::DOMTimer(ExecutionContext* context,
m_action(action) {
ASSERT(timeoutID > 0);
if (shouldForwardUserGesture(interval, m_nestingLevel))
- m_userGestureToken = UserGestureIndicator::currentToken();
+ m_userGestureToken = UserGestureIndicator::currentTokenThreadSafe();
InspectorInstrumentation::asyncTaskScheduled(
context, singleShot ? "setTimeout" : "setInterval", this, !singleShot);

Powered by Google App Engine
This is Rietveld 408576698