[webkit-reviews] review granted: [Bug 199306] AX: Both convertToNSArray() functions in WebAccessibilityObjectWrapperBase.mm leak every NSMutableArray returned : [Attachment 373077] patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jun 28 09:55:34 PDT 2019


David Kilzer (:ddkilzer) <ddkilzer at webkit.org> has granted chris fleizach
<cfleizach at apple.com>'s request for review:
Bug 199306: AX: Both convertToNSArray() functions in
WebAccessibilityObjectWrapperBase.mm leak every NSMutableArray returned
https://bugs.webkit.org/show_bug.cgi?id=199306

Attachment 373077: patch

https://bugs.webkit.org/attachment.cgi?id=373077&action=review




--- Comment #2 from David Kilzer (:ddkilzer) <ddkilzer at webkit.org> ---
Comment on attachment 373077
  --> https://bugs.webkit.org/attachment.cgi?id=373077
patch

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

r=me

> Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.h:105
>  #if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
> -extern RetainPtr<NSArray> convertToNSArray(const
Vector<RefPtr<WebCore::AXIsolatedTreeNode>>&);
> +extern NSArray *convertToNSArray(const
Vector<RefPtr<WebCore::AXIsolatedTreeNode>>&);
>  #endif
> -extern RetainPtr<NSArray> convertToNSArray(const
WebCore::AccessibilityObject::AccessibilityChildrenVector&);
> +extern NSArray *convertToNSArray(const
WebCore::AccessibilityObject::AccessibilityChildrenVector&);

I would really like to see statements like this cleaned up in
WebAccessibilityObjectWrapperIOS.mm and WebAccessibilityObjectWrapperMac.mm:

    return (NSArray *)convertToNSArray(results);

To remove the now-unnecessary cast:

    return convertToNSArray(results);

I count 29 of them by searching for ")convertToNSArray" in the WebKit Xcode
project.

A search-and-replace of "(NSArray *)convertToNSArray(" to "convertToNSArray("
should do it.


More information about the webkit-reviews mailing list