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

Unified Diff: third_party/WebKit/Source/platform/UserGestureIndicator.h

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/platform/UserGestureIndicator.h
diff --git a/third_party/WebKit/Source/platform/UserGestureIndicator.h b/third_party/WebKit/Source/platform/UserGestureIndicator.h
index 5cab2e0c690d05884219ad11a0204570c1b19ab7..ddd2efa25fe6741a2b86f4c4d24b29ed3ba386fd 100644
--- a/third_party/WebKit/Source/platform/UserGestureIndicator.h
+++ b/third_party/WebKit/Source/platform/UserGestureIndicator.h
@@ -94,11 +94,15 @@ class PLATFORM_EXPORT UserGestureIndicator final {
WTF_MAKE_NONCOPYABLE(UserGestureIndicator);
public:
+ // Note: All *ThreadSafe methods are safe to call from any thread. Their
+ // non-suffixed counterparts *must* be called on the main thread.
kinuko 2016/12/12 14:51:26 Let's add: "Consider always using the non-suffixed
Charlie Harrison 2016/12/12 15:20:47 Done.
+
// Returns whether a user gesture is currently in progress.
// Does not invoke the UserGestureUtilizedCallback. Consider calling
// utilizeUserGesture instead if you know for sure that the return value
// will have an effect.
static bool processingUserGesture();
+ static bool processingUserGestureThreadSafe();
// Indicates that a user gesture (if any) is being used, without preventing it
// from being used again. Returns whether a user gesture is currently in
@@ -111,8 +115,10 @@ class PLATFORM_EXPORT UserGestureIndicator final {
// operations like creating a new process.
// Like utilizeUserGesture, may invoke/clear any UserGestureUtilizedCallback.
static bool consumeUserGesture();
+ static bool consumeUserGestureThreadSafe();
kinuko 2016/12/12 04:45:12 We don't need this and currentTokenThreadSafe othe
Charlie Harrison 2016/12/12 13:10:09 We use currentTokenThreadSafe in DOMTimer, and we
Charlie Harrison 2016/12/12 15:20:47 I don't think this comment was properly resolved.
kinuko 2016/12/12 15:37:49 Sorry I hadn't explicitly responded to this one. I
static UserGestureToken* currentToken();
+ static UserGestureToken* currentTokenThreadSafe();
explicit UserGestureIndicator(PassRefPtr<UserGestureToken>);
~UserGestureIndicator();

Powered by Google App Engine
This is Rietveld 408576698