Changeset 228466 in webkit


Ignore:
Timestamp:
Feb 14, 2018 10:07:17 AM (6 years ago)
Author:
Brent Fulgham
Message:

Confirm proper thread in UserGestureIndicator constructor
https://bugs.webkit.org/show_bug.cgi?id=175980

Reviewed by Daniel Bates.

Document is a main-thread object. If we enter the UserGestureIndicator constructor
on a non-main thread, we should ASSERT, not return silently.

  • dom/UserGestureIndicator.cpp:

(WebCore::UserGestureIndicator::UserGestureIndicator):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r228465 r228466  
     12018-02-14  Brent Fulgham  <bfulgham@apple.com>
     2
     3        Confirm proper thread in UserGestureIndicator constructor
     4        https://bugs.webkit.org/show_bug.cgi?id=175980
     5
     6        Reviewed by Daniel Bates.
     7
     8        Document is a main-thread object. If we enter the UserGestureIndicator constructor
     9        on a non-main thread, we should ASSERT, not return silently.
     10
     11        * dom/UserGestureIndicator.cpp:
     12        (WebCore::UserGestureIndicator::UserGestureIndicator):
     13
    1142018-02-14  Zalan Bujtas  <zalan@apple.com>
    215
  • trunk/Source/WebCore/dom/UserGestureIndicator.cpp

    r223307 r228466  
    4848
    4949UserGestureIndicator::UserGestureIndicator(std::optional<ProcessingUserGestureState> state, Document* document, UserGestureType gestureType, ProcessInteractionStyle processInteractionStyle)
     50    : m_previousToken { currentToken() }
    5051{
    51     // Silently ignore UserGestureIndicators on non main threads.
    52     if (!isMainThread())
    53         return;
    54 
    55     // It is only safe to use currentToken() on the main thread.
    56     m_previousToken = currentToken();
     52    ASSERT(isMainThread());
    5753
    5854    if (state)
     
    6965UserGestureIndicator::UserGestureIndicator(RefPtr<UserGestureToken> token)
    7066{
     67    // Silently ignore UserGestureIndicators on non main threads.
    7168    if (!isMainThread())
    7269        return;
Note: See TracChangeset for help on using the changeset viewer.