[webkit-reviews] review denied: [Bug 233025] JSCustomElementInterface should keep strong references to constructor / callbacks : [Attachment 444026] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Nov 12 10:05:12 PST 2021


Geoffrey Garen <ggaren at apple.com> has denied Alexey Shvayka
<ashvayka at apple.com>'s request for review:
Bug 233025: JSCustomElementInterface should keep strong references to
constructor / callbacks
https://bugs.webkit.org/show_bug.cgi?id=233025

Attachment 444026: Patch

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




--- Comment #2 from Geoffrey Garen <ggaren at apple.com> ---
Comment on attachment 444026
  --> https://bugs.webkit.org/attachment.cgi?id=444026
Patch

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

> Source/WebCore/bindings/js/JSCustomElementInterface.h:104
> +    JSC::Strong<JSC::JSObject> m_constructor;
> +    JSC::Strong<JSC::JSObject> m_connectedCallback;
> +    JSC::Strong<JSC::JSObject> m_disconnectedCallback;
> +    JSC::Strong<JSC::JSObject> m_adoptedCallback;
> +    JSC::Strong<JSC::JSObject> m_attributeChangedCallback;

Unfortunately, it can't be this simple because this would create a retain cycle
that can't be broken by GC.

I think you could achieve something similarly elegant if you used
JSValueInWrappedObject, and had the global object or the document visit this
registry and these values during GC, in visitAdditionalChildren.


More information about the webkit-reviews mailing list