Bug 314781

Summary: Use protect() instead of Ref { } in style code
Product: WebKit Reporter: Ruthvik Konda <rkonda2>
Component: WebKit Misc.Assignee: Ruthvik Konda <rkonda2>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Ruthvik Konda
Reported 2026-05-13 20:08:05 PDT
Source/WebCore/style contains 10 instances of `Ref { }` brace-initialized smart pointer temporaries. As part of the codebase-wide transition to the `protect()` free function (which SaferCPP prefers for lifetime extension in inline expressions, function arguments, return values, and lambda captures), these should be updated. Of the 10 instances, 7 are convertible to `protect()` directly (inline temporaries, function args, return values). The remaining 3 are local-variable initializations where the style checker (`safercpp/protected_getter_for_init`) forbids `protect()`; those should be converted to direct brace-init form (`Ref x { y };`) instead.
Attachments
Radar WebKit Bug Importer
Comment 1 2026-05-13 20:08:12 PDT
Ruthvik Konda
Comment 2 2026-05-13 20:10:57 PDT
EWS
Comment 3 2026-05-15 01:14:32 PDT
Committed 313298@main (772188b773db): <https://commits.webkit.org/313298@main> Reviewed commits have been landed. Closing PR #64895 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.