Bug 83143

Summary: MediaStream API: MediaStreams stops proper cleanup to take place during a page reload.
Product: WebKit Reporter: Tommy Widenflycht <tommyw>
Component: WebCore Misc.Assignee: Tommy Widenflycht <tommyw>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, fischman, ojan, s.choi, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 56459    
Attachments:
Description Flags
Patch
none
Patch none

Tommy Widenflycht
Reported 2012-04-04 04:07:37 PDT
To fix this I have converted MediaStream and LocalMediaStream to be ActiveDOMObjects.
Attachments
Patch (7.58 KB, patch)
2012-04-04 04:11 PDT, Tommy Widenflycht
no flags
Patch (8.12 KB, patch)
2012-04-05 02:41 PDT, Tommy Widenflycht
no flags
Tommy Widenflycht
Comment 1 2012-04-04 04:11:25 PDT
Tommy Widenflycht
Comment 2 2012-04-04 04:14:17 PDT
I think the main problem was having the ScriptExecutionContext stored in a RefPtr which likely caused a circular reference. However switching to ActiveDOMObjects also gives the automatic calling of the stop() function which is an added bonus.
Adam Barth
Comment 3 2012-04-04 11:06:04 PDT
Comment on attachment 135553 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=135553&action=review This looks mostly fine, but I'm going to mark it R- because of the IDL / ActiveDOMObject thing. I've also left you a couple other things to think about for the next iteration. > Source/WebCore/Modules/mediastream/LocalMediaStream.h:41 > + // ActiveDOMObject and idl Woah. Should we use [ImplementedAs] to avoid having this one function play both roles? It's fine if one calls the other, but it's better to do that explicitly rather than having a name collision like this. > Source/WebCore/Modules/mediastream/MediaStream.cpp:135 > +void MediaStream::stop() > +{ > +} If you don't need stop(), you can just use a ContextDestructionObserver rather than ActiveDOMObject.
Tommy Widenflycht
Comment 4 2012-04-05 02:41:09 PDT
Tommy Widenflycht
Comment 5 2012-04-05 02:43:32 PDT
Comment on attachment 135553 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=135553&action=review >> Source/WebCore/Modules/mediastream/LocalMediaStream.h:41 >> + // ActiveDOMObject and idl > > Woah. Should we use [ImplementedAs] to avoid having this one function play both roles? It's fine if one calls the other, but it's better to do that explicitly rather than having a name collision like this. Fixed. And I learnt something new today as well :) >> Source/WebCore/Modules/mediastream/MediaStream.cpp:135 >> +} > > If you don't need stop(), you can just use a ContextDestructionObserver rather than ActiveDOMObject. MediaStream doesn't but LocalMediaStream does. Removed the empty implementation.
Adam Barth
Comment 6 2012-04-06 10:13:36 PDT
Comment on attachment 135788 [details] Patch Thanks.
WebKit Review Bot
Comment 7 2012-04-06 11:07:32 PDT
Comment on attachment 135788 [details] Patch Clearing flags on attachment: 135788 Committed r113460: <http://trac.webkit.org/changeset/113460>
WebKit Review Bot
Comment 8 2012-04-06 11:07:37 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.