UserGestureIndicator: remove many unnecessary calls to isMainThread
Most code that calls the UserGestureIndicator knows which thread it is executing in. Calling isMainThread involves doing a thread id syscall which can be quite slow, and there are places in the loading code that do this in a tight loop (e.g. preloading resources). This patch adds an optional argument to the indicator's static methods which optionally allow callers to get the gesture state in a thread-safe way. BUG=348655 Review-Url: https://codereview.chromium.org/2555013004 Cr-Commit-Position: refs/heads/master@{#437941}
Showing
Please register or sign in to comment