[Webkit-unassigned] [Bug 66878] HTMLAudioElement can be garbage collected while it playing

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Oct 4 14:45:21 PDT 2011


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


Adam Barth <abarth at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #109669|review?                     |review-
               Flag|                            |




--- Comment #8 from Adam Barth <abarth at webkit.org>  2011-10-04 14:45:21 PST ---
(From update of attachment 109669)
View in context: https://bugs.webkit.org/attachment.cgi?id=109669&action=review

I'm not sure the part of this change that adds the hidden property is correct.  There can be many listeners added for each event.  I thought it was the job of V8EventListener (or one of those related classes) to stop the listener from being collected by GC.

If I were making this change, I would break it down into two parts.

1) Make CodeGeneratorV8.pm respect the ActiveDOMObject IDL attribute.  That will fix the proximate bug with HTMLAudioElement.
2) Fix the bug with event listeners getting garbage collected.

I suspect (2) is better fixed in the V8EventListener objects, which are already involved in managing the lifetimes of these objects.

> Source/WebCore/ChangeLog:13
> +        (b) fix v8 bindings bug that was in the code forever, event listener
> +        could be garbage collected even if object it attached to is still
> +        alive, resulting in the loss of events

Ah!  That makes sense.

> Source/WebCore/bindings/scripts/CodeGeneratorV8.pm:1174
> +        // value. Spec guarantees that one can have only a single event listener
> +        // per event type. 

Why do we only have a single event listener for each event type?  Can't you add more with addEventListener?  Maybe you mean the onclick-like properties in the DOM?

> Source/WebCore/bindings/scripts/CodeGeneratorV8.pm:2866
> -    # FIXME: Consider making this an .idl attribute.
> +    # FIXME: Make this an .idl attribute.

It is already an IDL attribute.  We need to respect the IDL attribute.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list