[webkit-reviews] review granted: [Bug 238719] [WebGPU] Add ObjectBase base class for WebGPU objects : [Attachment 456546] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Apr 7 02:57:39 PDT 2022


Kimmo Kinnunen <kkinnunen at apple.com> has granted Myles C. Maxfield
<mmaxfield at apple.com>'s request for review:
Bug 238719: [WebGPU] Add ObjectBase base class for WebGPU objects
https://bugs.webkit.org/show_bug.cgi?id=238719

Attachment 456546: Patch

https://bugs.webkit.org/attachment.cgi?id=456546&action=review




--- Comment #3 from Kimmo Kinnunen <kkinnunen at apple.com> ---
Comment on attachment 456546
  --> https://bugs.webkit.org/attachment.cgi?id=456546
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=456546&action=review

also changes refcounts to thread safe (which is probably good)

> Source/WebGPU/WebGPU/ObjectBase.h:40
> +    ~ObjectBase();

Surprisingly ThreadSafeRefCounted has a footgun  where the destructor is not a
virtual.
So written this way, Ref<ObjectBase> would never run the subclass destructors,
which is a hard to find down the line if you ever end up using that.
It's better to mark this virtual.

If you don't intend to support Ref<ObjectBase>, then it's better to leave the
threadsaferefcounted in the held classes.


More information about the webkit-reviews mailing list