Bug 246979

Summary: AX: Improve Ref / RefPtr hygiene in WebAccessibilityObjectWrapperMac
Product: WebKit Reporter: Tyler Wilcock <tyler_w>
Component: AccessibilityAssignee: Tyler Wilcock <tyler_w>
Status: RESOLVED FIXED    
Severity: Normal CC: aboxhall, andresg_22, apinheiro, cfleizach, darin, dmazzoni, ews-watchlist, jcraig, jdiggs, samuel_white, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Tyler Wilcock 2022-10-24 17:42:09 PDT
rdar://100895546
Comment 1 Radar WebKit Bug Importer 2022-10-24 17:42:24 PDT
<rdar://problem/101523132>
Comment 2 Tyler Wilcock 2022-10-24 17:42:49 PDT
rdar://100895546
Comment 3 Tyler Wilcock 2022-10-24 17:47:49 PDT
Created attachment 463208 [details]
Patch
Comment 4 Darin Adler 2022-10-25 09:16:57 PDT
Comment on attachment 463208 [details]
Patch

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

> Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm:409
> +    RefPtr<AXCoreObject> backingObject = [self baseUpdateBackingStore];

Just RefPtr would do. No need to write out <AXCoreObject> each time.
Comment 5 Tyler Wilcock 2022-10-25 09:22:33 PDT
(In reply to Darin Adler from comment #4)
> Comment on attachment 463208 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=463208&action=review
> 
> > Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm:409
> > +    RefPtr<AXCoreObject> backingObject = [self baseUpdateBackingStore];
> 
> Just RefPtr would do. No need to write out <AXCoreObject> each time.
I originally had that, but template inference didn't seem able to figure it out:

OpenSource/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:1115:12: error: no viable constructor or deduction guide for deduction of template arguments of 'RefPtr'
    RefPtr backingObject = self.updateObjectBackingStore;
Comment 6 EWS 2022-10-25 10:04:03 PDT
Committed 255966@main (b036a036e04c): <https://commits.webkit.org/255966@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 463208 [details].