Bug 64525 - MediaStream API: Release script objects when detaching document
Summary: MediaStream API: Release script objects when detaching document
Status: RESOLVED DUPLICATE of bug 68171
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 56459
  Show dependency treegraph
 
Reported: 2011-07-14 05:54 PDT by Henrik Grunell
Modified: 2011-09-15 23:59 PDT (History)
4 users (show)

See Also:


Attachments
Patch (4.14 KB, patch)
2011-07-15 01:08 PDT, Henrik Grunell
tonyg: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Henrik Grunell 2011-07-14 05:54:40 PDT
We need to release the clients held by MediaStreamFrameController when a document is detached since they are not valid for the new document. A specific problem that this solves: a LocalMediaStream object should stop [it's generation of media] when a web page is reloaded. This is not the case today, meaning that a camera capture device will be blocked until the garbage collector has deleted the old document (which would in turn delete and stop the MediaStream objects).
Comment 1 Henrik Grunell 2011-07-15 01:08:40 PDT
Created attachment 100945 [details]
Patch
Comment 2 Tony Gentilcore 2011-07-15 02:32:23 PDT
Comment on attachment 100945 [details]
Patch

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

r- for lack of test

> Source/WebCore/ChangeLog:10
> +        No new tests because the patch is just a bug fix.

In WebKit, fixing a bug is usually a great reason to add a test. This is the sort of edge case that could easily break during future refactoring, so please add a test so we don't regress here.

> Source/WebCore/dom/Document.cpp:1778
> +        if (mediaStreamFrameController)

If you prefer, a common idiom in WebKit is:

if (MediaStreamFrameController* mediaStreamFrameController = m_frame->mediaStreamFrameController())
    mediaStreamFrameController->clearAllClients();
Comment 3 John Knottenbelt 2011-07-15 05:44:18 PDT
Comment on attachment 100945 [details]
Patch

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

>> Source/WebCore/ChangeLog:10
>> +        No new tests because the patch is just a bug fix.
> 
> In WebKit, fixing a bug is usually a great reason to add a test. This is the sort of edge case that could easily break during future refactoring, so please add a test so we don't regress here.

Check out LayoutTests/fast/dom/Geolocation/page-reload-cancel-permission-requests.html for a possible way to do a test involving a reload.
Comment 4 Henrik Grunell 2011-09-15 23:59:22 PDT
The MediaStream object handling will be rewritten in bug 68171, and that change shall ensure that the issue described in this bug is resolved.

*** This bug has been marked as a duplicate of bug 68171 ***