⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 286811 in webkit


Ignore:
Timestamp:
Dec 9, 2021, 3:20:39 PM (5 years ago)
Author:
Tyler Wilcock
Message:

AX: Improve ASSERT while processing tree appends in AXIsolatedTree::applyPendingChanges
https://bugs.webkit.org/show_bug.cgi?id=234085

Reviewed by Chris Fleizach.

When processing m_pendingAppends in AXIsolatedTree::applyPendingChanges,
we ASSERT to verify the refcount is what we expect:

ASSERT_UNUSED(addResult, addResult.iterator->value->refCount() == 2

(addResult.iterator->value.ptr() == m_rootNode.get() && m_rootNode->refCount() == 3));

But this doesn't include the actual refcount in the ASSERT message,
making it harder to debug.

This patch uses ASSERT_WITH_MESSAGE to display the actual refcount.

  • accessibility/isolatedtree/AXIsolatedTree.cpp:

(WebCore::AXIsolatedTree::applyPendingChanges):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r286807 r286811  
     12021-12-09  Tyler Wilcock  <tyler_w@apple.com>
     2
     3        AX: Improve ASSERT while processing tree appends in AXIsolatedTree::applyPendingChanges
     4        https://bugs.webkit.org/show_bug.cgi?id=234085
     5
     6        Reviewed by Chris Fleizach.
     7
     8        When processing m_pendingAppends in AXIsolatedTree::applyPendingChanges,
     9        we ASSERT to verify the refcount is what we expect:
     10
     11        ASSERT_UNUSED(addResult, addResult.iterator->value->refCount() == 2
     12            || (addResult.iterator->value.ptr() == m_rootNode.get() && m_rootNode->refCount() == 3));
     13
     14        But this doesn't include the actual refcount in the ASSERT message,
     15        making it harder to debug.
     16
     17        This patch uses ASSERT_WITH_MESSAGE to display the actual refcount.
     18
     19        * accessibility/isolatedtree/AXIsolatedTree.cpp:
     20        (WebCore::AXIsolatedTree::applyPendingChanges):
     21
    1222021-12-09  Alan Bujtas  <zalan@apple.com>
    223
  • trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp

    r285991 r286811  
    513513        // because it is referenced by m_readerThreadNodeMap and m_pendingAppends.
    514514        // When m_pendingAppends is cleared, the object will be held only by m_readerThreadNodeMap. The exception is the root node whose reference count is 3.
    515         ASSERT_UNUSED(addResult, addResult.iterator->value->refCount() == 2
    516             || (addResult.iterator->value.ptr() == m_rootNode.get() && m_rootNode->refCount() == 3));
     515        ASSERT_WITH_MESSAGE(
     516            addResult.iterator->value->refCount() == 2 || (addResult.iterator->value.ptr() == m_rootNode.get() && m_rootNode->refCount() == 3),
     517            "unexpected ref count after adding object to m_readerThreadNodeMap: %d", addResult.iterator->value->refCount()
     518        );
    517519    }
    518520    m_pendingAppends.clear();
Note: See TracChangeset for help on using the changeset viewer.