Bug 246979 - AX: Improve Ref / RefPtr hygiene in WebAccessibilityObjectWrapperMac
Summary: AX: Improve Ref / RefPtr hygiene in WebAccessibilityObjectWrapperMac
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tyler Wilcock
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-10-24 17:42 PDT by Tyler Wilcock
Modified: 2022-10-25 10:04 PDT (History)
11 users (show)

See Also:


Attachments
Patch (10.88 KB, patch)
2022-10-24 17:47 PDT, Tyler Wilcock
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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].