Bug 88541

Summary: [V8] Keep TextTrackList alive as long as its owner is alive
Product: WebKit Reporter: Erik Arvidsson <arv>
Component: New BugsAssignee: Erik Arvidsson <arv>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, antonm, haraken, japhet, jochen, ojan, rakuco, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 73865    
Attachments:
Description Flags
Patch none

Description Erik Arvidsson 2012-06-07 09:25:30 PDT
[V8] Keep TextTrackList alive as long as its owner is alive
Comment 1 Erik Arvidsson 2012-06-07 09:28:33 PDT
Created attachment 146306 [details]
Patch
Comment 2 Erik Arvidsson 2012-06-07 09:30:13 PDT
This is a stop gap solution for TextTrackList. The end solution is to do use V8GCController but I haven't gotten that to work reliably.
Comment 3 Adam Barth 2012-06-07 16:49:19 PDT
Comment on attachment 146306 [details]
Patch

Ok.  Can you add a FIXME to explain the right way of doing this?
Comment 4 anton muhin 2012-06-08 07:37:08 PDT
Comment on attachment 146306 [details]
Patch

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

> Source/WebCore/bindings/v8/custom/V8TextTrackListCustom.cpp:48
> +    Node* element = impl->owner();

May TextTrackList change owners?
Comment 5 Erik Arvidsson 2012-06-08 09:43:55 PDT
(In reply to comment #4)
> (From update of attachment 146306 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=146306&action=review
> 
> > Source/WebCore/bindings/v8/custom/V8TextTrackListCustom.cpp:48
> > +    Node* element = impl->owner();
> 
> May TextTrackList change owners?

No. TextTrack objects may change owners but the TextTrackList itself doesn't change owner.
Comment 6 anton muhin 2012-06-08 09:56:42 PDT
Comment on attachment 146306 [details]
Patch

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

>>> Source/WebCore/bindings/v8/custom/V8TextTrackListCustom.cpp:48
>>> +    Node* element = impl->owner();
>> 
>> May TextTrackList change owners?
> 
> No. TextTrack objects may change owners but the TextTrackList itself doesn't change owner.

I see, great.  May one reach owner of TextTrackList from the item via JS DOM API?
Comment 7 Erik Arvidsson 2012-06-08 10:30:18 PDT
(In reply to comment #6)
> (From update of attachment 146306 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=146306&action=review
> 
> >>> Source/WebCore/bindings/v8/custom/V8TextTrackListCustom.cpp:48
> >>> +    Node* element = impl->owner();
> >> 
> >> May TextTrackList change owners?
> > 
> > No. TextTrack objects may change owners but the TextTrackList itself doesn't change owner.
> 
> I see, great.  May one reach owner of TextTrackList from the item via JS DOM API?

No, there is no way to get to the owner from the TextTrackList in JS. (See TextTrackList.idl etc for details)
Comment 8 anton muhin 2012-06-08 10:31:59 PDT
(In reply to comment #7)
> (In reply to comment #6)
> > (From update of attachment 146306 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=146306&action=review
> > 
> > >>> Source/WebCore/bindings/v8/custom/V8TextTrackListCustom.cpp:48
> > >>> +    Node* element = impl->owner();
> > >> 
> > >> May TextTrackList change owners?
> > > 
> > > No. TextTrack objects may change owners but the TextTrackList itself doesn't change owner.
> > 
> > I see, great.  May one reach owner of TextTrackList from the item via JS DOM API?
> 
> No, there is no way to get to the owner from the TextTrackList in JS. (See TextTrackList.idl etc for details)

Great, then LGTM too.
Comment 9 Erik Arvidsson 2012-06-08 11:16:21 PDT
(In reply to comment #3)
> (From update of attachment 146306 [details])
> Ok.  Can you add a FIXME to explain the right way of doing this?

Sorry, I thought I replied to this already.

We have this pattern in a few places already and we have open bugs to let V8GCController handle these using implicit references.
Comment 10 Adam Barth 2012-06-08 11:41:56 PDT
> We have this pattern in a few places already and we have open bugs to let V8GCController handle these using implicit references.

Ok.  :)
Comment 11 WebKit Review Bot 2012-06-08 12:05:35 PDT
Comment on attachment 146306 [details]
Patch

Clearing flags on attachment: 146306

Committed r119853: <http://trac.webkit.org/changeset/119853>
Comment 12 WebKit Review Bot 2012-06-08 12:05:41 PDT
All reviewed patches have been landed.  Closing bug.