[webkit-dev] Smart Pointers Usage Guidelines

Ryosuke Niwa rniwa at apple.com
Mon Aug 21 16:51:59 PDT 2023



> On Aug 21, 2023, at 4:50 PM, Tim Horton <thorton at apple.com> wrote:
> 
> 
> 
>> On Aug 21, 2023, at 4:42 PM, Ryosuke Niwa <rniwa at apple.com> wrote:
>> 
>> 
>> 
>>> On Aug 21, 2023, at 4:41 PM, Darin Adler <darin at apple.com> wrote:
>>> 
>>>> On Aug 21, 2023, at 4:39 PM, Ryosuke Niwa <rniwa at apple.com> wrote:
>>>> 
>>>> Alternatively, we could add a new member function which returns CheckedPtr like `pageChecked()`.
>>> 
>>> Yes, I think that would be a good approach that would complement the static checker.
>> 
>> Okay, let’s go with this solution since others have expressed concerns for ref churns in the past.
> 
> So, to be clear, this example:
> 
>> page()->document()->foo()
> 
> 
> would become:
> 
>> page()->documentChecked()->foo()?
> 
> (only `checked` for the deepest getter before the complex call)?

Yes.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20230821/0722c2bb/attachment.htm>


More information about the webkit-dev mailing list