[Webkit-unassigned] [Bug 260389] AX: Improve smart pointer usage in AXObjectCache

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Aug 18 11:09:14 PDT 2023


https://bugs.webkit.org/show_bug.cgi?id=260389

Tyler Wilcock <tyler_w at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tyler_w at apple.com

--- Comment #4 from Tyler Wilcock <tyler_w at apple.com> ---
Comment on attachment 467328
  --> https://bugs.webkit.org/attachment.cgi?id=467328
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=467328&action=review

> Source/WebCore/accessibility/AXObjectCache.cpp:2291
> +    RefPtr protectedElement { element };
> +
>      if (nodeAndRendererAreValid(element) && rendererNeedsDeferredUpdate(*element->renderer())) {
> -        m_deferredAttributeChange.append({ element, attrName, oldValue, newValue });
> +        m_deferredAttributeChange.append({ protectedElement, attrName, oldValue, newValue });
>          if (!m_performCacheUpdateTimer.isActive())
>              m_performCacheUpdateTimer.startOneShot(0_s);
>          AXLOG(makeString("Deferring handling of attribute ", attrName.localName().string(), " for element ", element->debugDescription()));
>          return;
>      }
> -    handleAttributeChange(element, attrName, oldValue, newValue);
> +    handleAttributeChange(protectedElement.get(), attrName, oldValue, newValue);

I don't think we need to protect this element with a RefPtr if !rendererNeedsDeferredUpdate(*element->renderer()) (because otherwise we append it to m_deferredAttributeChange which stores it as a WeakPtr). I think we only need to protect it if we're going to directly call handleAttributeChange with it.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230818/18d37522/attachment-0001.htm>


More information about the webkit-unassigned mailing list