Bug 83143 - MediaStream API: MediaStreams stops proper cleanup to take place during a page reload.
: MediaStream API: MediaStreams stops proper cleanup to take place during a pag...
Status: RESOLVED FIXED
: WebKit
WebCore Misc.
: 528+ (Nightly build)
: All All
: P2 Normal
Assigned To:
:
:
:
: 56459
  Show dependency treegraph
 
Reported: 2012-04-04 04:07 PST by
Modified: 2012-04-18 17:25 PST (History)


Attachments
Patch (7.58 KB, patch)
2012-04-04 04:11 PST, Tommy Widenflycht
no flags Review Patch | Details | Formatted Diff | Diff
Patch (8.12 KB, patch)
2012-04-05 02:41 PST, Tommy Widenflycht
no flags Review Patch | Details | Formatted Diff | Diff


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2012-04-04 04:07:37 PST
To fix this I have converted MediaStream and LocalMediaStream to be ActiveDOMObjects.
------- Comment #1 From 2012-04-04 04:11:25 PST -------
Created an attachment (id=135553) [details]
Patch
------- Comment #2 From 2012-04-04 04:14:17 PST -------
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.
------- Comment #3 From 2012-04-04 11:06:04 PST -------
(From update of attachment 135553 [details])
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.
------- Comment #4 From 2012-04-05 02:41:09 PST -------
Created an attachment (id=135788) [details]
Patch
------- Comment #5 From 2012-04-05 02:43:32 PST -------
(From update of attachment 135553 [details])
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.
------- Comment #6 From 2012-04-06 10:13:36 PST -------
(From update of attachment 135788 [details])
Thanks.
------- Comment #7 From 2012-04-06 11:07:32 PST -------
(From update of attachment 135788 [details])
Clearing flags on attachment: 135788

Committed r113460: <http://trac.webkit.org/changeset/113460>
------- Comment #8 From 2012-04-06 11:07:37 PST -------
All reviewed patches have been landed.  Closing bug.