Changeset 214702 in webkit


Ignore:
Timestamp:
Mar 31, 2017, 5:10:59 PM (8 years ago)
Author:
Simon Fraser
Message:

When destroying a Node, assert that it's been removed from all the touch handler maps
https://bugs.webkit.org/show_bug.cgi?id=170363
rdar://problem/31377469

Reviewed by Tim Horton.

Assert that the Node has been removed from the touch handler maps in all documents on destruction.

  • dom/Document.h:

(WebCore::Document::hasTouchEventHandlers):
(WebCore::Document::touchEventTargetsContain):

  • dom/Node.cpp:

(WebCore::Node::~Node):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/Source/WebCore/ChangeLog

    r214700 r214702  
     12017-03-31  Simon Fraser  <simon.fraser@apple.com>
     2
     3        When destroying a Node, assert that it's been removed from all the touch handler maps
     4        https://bugs.webkit.org/show_bug.cgi?id=170363
     5        rdar://problem/31377469
     6
     7        Reviewed by Tim Horton.
     8
     9        Assert that the Node has been removed from the touch handler maps in all documents on destruction.
     10
     11        * dom/Document.h:
     12        (WebCore::Document::hasTouchEventHandlers):
     13        (WebCore::Document::touchEventTargetsContain):
     14        * dom/Node.cpp:
     15        (WebCore::Node::~Node):
     16
    1172017-03-31  Alexey Proskuryakov  <ap@apple.com>
    218
  • TabularUnified trunk/Source/WebCore/dom/Document.h

    r214435 r214702  
    11461146    void updateLastHandledUserGestureTimestamp();
    11471147
    1148 #if ENABLE(TOUCH_EVENTS)
    1149     bool hasTouchEventHandlers() const { return (m_touchEventTargets.get()) ? m_touchEventTargets->size() : false; }
    1150 #else
    1151     bool hasTouchEventHandlers() const { return false; }
    1152 #endif
    1153 
    11541148    // Used for testing. Count handlers in the main document, and one per frame which contains handlers.
    11551149    WEBCORE_EXPORT unsigned wheelEventHandlerCount() const;
     
    11581152    WEBCORE_EXPORT void startTrackingStyleRecalcs();
    11591153    WEBCORE_EXPORT unsigned styleRecalcCount() const;
     1154
     1155#if ENABLE(TOUCH_EVENTS)
     1156    bool hasTouchEventHandlers() const { return (m_touchEventTargets.get()) ? m_touchEventTargets->size() : false; }
     1157    bool touchEventTargetsContain(Node& node) const { return m_touchEventTargets ? m_touchEventTargets->contains(&node) : false; }
     1158#else
     1159    bool hasTouchEventHandlers() const { return false; }
     1160    bool touchEventTargetsContain(Node&) const { return false; }
     1161#endif
    11601162
    11611163    void didAddTouchEventHandler(Node&);
  • TabularUnified trunk/Source/WebCore/dom/Node.cpp

    r214649 r214702  
    302302
    303303    document().decrementReferencingNodeCount();
     304
     305#if ENABLE(TOUCH_EVENTS) && PLATFORM(IOS) && (!ASSERT_DISABLED || ENABLE(SECURITY_ASSERTIONS))
     306    for (auto* document : Document::allDocuments()) {
     307        ASSERT_WITH_SECURITY_IMPLICATION(!document->touchEventListenersContain(*this));
     308        ASSERT_WITH_SECURITY_IMPLICATION(!document->touchEventHandlersContain(*this));
     309        ASSERT_WITH_SECURITY_IMPLICATION(!document->touchEventTargetsContain(*this));
     310    }
     311#endif
    304312}
    305313
Note: See TracChangeset for help on using the changeset viewer.