WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
314781
Use protect() instead of Ref { } in style code
https://bugs.webkit.org/show_bug.cgi?id=314781
Summary
Use protect() instead of Ref { } in style code
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
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2026-05-13 20:08:12 PDT
<
rdar://problem/177033111
>
Ruthvik Konda
Comment 2
2026-05-13 20:10:57 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/64895
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.
Top of Page
Format For Printing
XML
Clone This Bug