Bug 255047 - AX: AccessibilityRenderObject::addRemoteSVGChildren() should protect the created SVG object with a RefPtr
Summary: AX: AccessibilityRenderObject::addRemoteSVGChildren() should protect the crea...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Tyler Wilcock
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-04-05 13:25 PDT by Tyler Wilcock
Modified: 2023-04-05 20:04 PDT (History)
10 users (show)

See Also:


Attachments
Patch (2.09 KB, patch)
2023-04-05 13:30 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 2023-04-05 13:25:15 PDT
Per https://github.com/WebKit/WebKit/wiki/Smart-Pointer-Usage-Guidelines:

> Every object passed to a non-trivial function as an argument (including "this" pointer) should be stored as a Ref, RefPtr, CheckedRef, or CheckedPtr in the caller’s local scope
Let's bring this function inline with this guidance since AccessibilityObject::addChild is not trivial.

This RefPtr will be free in the common case that there is no remote SVG root object to add.
Comment 1 Radar WebKit Bug Importer 2023-04-05 13:25:27 PDT
<rdar://problem/107674710>
Comment 2 Tyler Wilcock 2023-04-05 13:30:07 PDT
Created attachment 465783 [details]
Patch
Comment 3 EWS 2023-04-05 20:04:13 PDT
Committed 262656@main (ff96b4d0c120): <https://commits.webkit.org/262656@main>

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