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

Unified Diff: third_party/WebKit/Source/web/WebUserGestureIndicator.cpp

Issue 2555013004: UserGestureIndicator: remove many unnecessary calls to isMainThread (Closed)
Patch Set: Avoid duplicate thread checks in DOMTimer 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/web/WebUserGestureIndicator.cpp
diff --git a/third_party/WebKit/Source/web/WebUserGestureIndicator.cpp b/third_party/WebKit/Source/web/WebUserGestureIndicator.cpp
index e1eaf1b52459469ceb9fb1ce05652574b7455c7d..9e206ee672285d8f65d9e4ab2ebdc81498015bd3 100644
--- a/third_party/WebKit/Source/web/WebUserGestureIndicator.cpp
+++ b/third_party/WebKit/Source/web/WebUserGestureIndicator.cpp
@@ -40,8 +40,15 @@ bool WebUserGestureIndicator::isProcessingUserGesture() {
return UserGestureIndicator::processingUserGesture();
}
+bool WebUserGestureIndicator::isProcessingUserGestureThreadSafe() {
+ return UserGestureIndicator::processingUserGestureThreadSafe();
+}
+
+// TODO(csharrison): consumeUserGesture() and currentUserGestureToken() use
+// the thread-safe API, which many callers probably do not need. Consider
+// updating them if they are in any sort of critical path or called often.
bool WebUserGestureIndicator::consumeUserGesture() {
- return UserGestureIndicator::consumeUserGesture();
+ return UserGestureIndicator::consumeUserGestureThreadSafe();
}
bool WebUserGestureIndicator::processedUserGestureSinceLoad(
@@ -51,7 +58,7 @@ bool WebUserGestureIndicator::processedUserGestureSinceLoad(
}
WebUserGestureToken WebUserGestureIndicator::currentUserGestureToken() {
- return WebUserGestureToken(UserGestureIndicator::currentToken());
+ return WebUserGestureToken(UserGestureIndicator::currentTokenThreadSafe());
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/platform/UserGestureIndicator.cpp ('k') | third_party/WebKit/public/web/WebUserGestureIndicator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698