WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED DUPLICATE of
bug 129841
109644
MediaKeySession should not be GCd while firing event listeners or with custom properties.
https://bugs.webkit.org/show_bug.cgi?id=109644
Summary
MediaKeySession should not be GCd while firing event listeners or with custom...
Jer Noble
Reported
2013-02-12 18:09:45 PST
MediaKeySession should not be GCd while firing event listeners or with custom properties.
Attachments
Patch
(5.28 KB, patch)
2013-02-12 22:16 PST
,
Jer Noble
no flags
Details
Formatted Diff
Diff
Patch
(9.28 KB, patch)
2013-02-12 22:19 PST
,
Jer Noble
no flags
Details
Formatted Diff
Diff
Patch
(21.50 KB, patch)
2013-02-15 15:24 PST
,
Jer Noble
no flags
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Jer Noble
Comment 1
2013-02-12 21:46:58 PST
I find that I'm having a very hard time writing a LayoutTest for this case. How does one write a layout test to check whether an object has been GCd without holding a reference to that object (and thus keeping it from being GCd)?
Jer Noble
Comment 2
2013-02-12 22:16:21 PST
Created
attachment 188011
[details]
Patch
Jer Noble
Comment 3
2013-02-12 22:19:49 PST
Created
attachment 188012
[details]
Patch This time, with project changes.
Geoffrey Garen
Comment 4
2013-02-14 10:53:51 PST
> I find that I'm having a very hard time writing a LayoutTest for this case. How does one write a layout test to check whether an object has been GCd without holding a reference to that object (and thus keeping it from being GCd)?
mediaKeys.mediaKeySession.customProperty = 1; gc(); if (mediaKeys.mediaKeySession.customProperty) pass(); else fail(); Here, your only explicit reference is to the MediaKeys object, and not the MediaKeySession object.
Geoffrey Garen
Comment 5
2013-02-14 10:55:52 PST
Comment on
attachment 188012
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=188012&action=review
> Source/WebCore/bindings/js/JSMediaKeySessionCustom.cpp:54 > + return visitor.containsOpaqueRoot(mediaKeySession->keys());
This line will only keep the MediaKeySession object alive if another object has called "visitor.addOpaqueRoot(keys)". If you want a MediaKeys object to keep a MediaKeySession object alive, you also need MediaKeys to call "visitor.addOpaqueRoot(keys)".
Geoffrey Garen
Comment 6
2013-02-14 11:24:36 PST
Further review on IRC: ggaren: jer: so, here's what you need: [11:14am] ggaren: jer: (1) MediaKeySession needs to adopt the ActiveDOMObject API, so it won't GC in the middle of scheduled stuff [11:15am] jer: yep. [11:15am] ggaren: jer: (2) MediaKeySession needs to adopt the isReachable API, but only for the purpose of event listeners, and this should be automatic for any subclass of EventTarget -- so just double-check that it is auto-generated [11:16am] jer: okay, i looked into that, and it does do it for event listeners, but not custom properties…. *double checks* [11:17am] jer: oh never mind, it's both [11:17am] jer: ok [11:18am] ggaren: jer: (3) double-check that the automatic isReachable for event listener checks for isFiringEventListeners -- this might be an oversight in the auto generated code, which you should fix (one-line change in the auto generater) [11:18am] jer: so, what about the "isFiringEventLiseteners" part? that should be handled by bumping ... [11:18am] jer: okay, EventTarget doesn't check isFiringEventLiseteners. [11:18am] ggaren: jer: i think that's a missing feature in the auto generator, which you should correct [11:18am] jer: lol. ok. [11:19am] ggaren: (4) MediaKeys needs to to check visitor.containsOpaqueRoot(root(HTMLMediaElement)) -- because of the HTMLMediaElement.mediaKeys API
Jer Noble
Comment 7
2013-02-15 15:24:46 PST
Created
attachment 188652
[details]
Patch
Jer Noble
Comment 8
2013-02-15 15:48:34 PST
Depends on
bug #109702
for the mediaElement accessor on MediaKeys.
Jer Noble
Comment 9
2013-02-15 15:59:10 PST
Whoops, an extra entry in the LayoutTests/ChangeLog. I'll remove it before landing (or an upcoming version, depending).
Brent Fulgham
Comment 10
2014-04-24 09:21:35 PDT
(In reply to
comment #9
)
> Whoops, an extra entry in the LayoutTests/ChangeLog. I'll remove it before landing (or an upcoming version, depending).
Wow -- did this ever get landed? Seems important!
Jer Noble
Comment 11
2014-04-25 10:27:12 PDT
This was fixed by
bug #129841
. *** This bug has been marked as a duplicate of
bug 129841
***
Csaba Osztrogonác
Comment 12
2014-06-04 00:34:30 PDT
Comment on
attachment 188652
[details]
Patch Cleared review? from
attachment 188652
[details]
so that this bug does not appear in
http://webkit.org/pending-review
. If you would like this patch reviewed, please attach it to a new bug (or re-open this bug before marking it for review again).
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug