[Webkit-unassigned] [Bug 205617] Add makeRefCounted<>

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 2 10:45:32 PST 2020


https://bugs.webkit.org/show_bug.cgi?id=205617

Alex Christensen <achristensen at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |achristensen at apple.com

--- Comment #7 from Alex Christensen <achristensen at apple.com> ---
Another approach is something like what we've done in classes like CustomHeaderFields.  We templatize the create function to just call whatever constructor it can.  This templatized create can be moved to RefCounted and ThreadSafeRefCounted, but then we would need to befriend that class (like we do in many places with our "friend class NeverDestroyed" instances) or have a public constructor.

Either way, I think that it would be a bit nicer to continue having T::create() rather than makeRefCounted<T>() because the code reads nicer.  It's an implementation detail that it's ref counted and we don't need to remind ourselves at every call site.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200102/a5dcd126/attachment-0001.htm>


More information about the webkit-unassigned mailing list