Bug 263538
Summary: | Make it possible to immediately wrap a retained out param in a smart pointer | ||
---|---|---|---|
Product: | WebKit | Reporter: | Simon Fraser (smfr) <simon.fraser> |
Component: | Web Template Framework | Assignee: | Simon Fraser (smfr) <simon.fraser> |
Status: | NEW | ||
Severity: | Normal | CC: | achristensen, ddkilzer, kkinnunen, simon.fraser, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=252856 |
Simon Fraser (smfr)
We have a lot of code that calls system APIs that return retained pointers like this:
SecAccessRef accessRef;
status = SecAccessCreate((__bridge CFStringRef)localizedItemName, nullptr, &accessRef);
RetainPtr<SecAccessRef> access = adoptCF(accessRef);
This is error prone and makes it hard to write a style checker that finds adoptCF() errors.
We should make it possible to have a smart pointer initialized directly at the point of "&accessRef".
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/117382839>
Simon Fraser (smfr)
Pull request: https://github.com/WebKit/WebKit/pull/19465