Chromium Code Reviews| 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(); |