RESOLVED FIXED 106587
HTMLMediaElement::resume() should schedule a load rather than load immediately
https://bugs.webkit.org/show_bug.cgi?id=106587
Summary HTMLMediaElement::resume() should schedule a load rather than load immediately
Yong Li
Reported 2013-01-10 11:44:13 PST
Generally, those resume() methods should only schedule the resumed jobs by timers. This is because: 1) It is not always safe to start the jobs at the time resume() is called. That is why the jobs are suspended. For example, when ActiveDOMObjects are suspended for nested event loop, the sequence is like this: - The stack is on top of document parsing, javascript execution, so it is not safe to run some jobs in the nested event loop. - suspend all scheduled jobs so they won't run in the event loop - run the nested event loop - resume (re-schedule those jobs). However, it is still not safe at this point to run those jobs! ... - Stack unwinds back to main event loop .... - Timers fire and scheduled jobs get done. Another case is PageCache. ActiveDOMObjects are suspended while a document is in the page cache. When it is being restored, resume() is called upon every ActiveDOMObject. However I don't think the page is guaranteed ready at this point to start the resumed jobs immediately. 2) It is also good for performance, as the objects may be suspended again after being resumed.
Attachments
the proposed patch (1.74 KB, patch)
2013-01-10 12:00 PST, Yong Li
no flags
Yong Li
Comment 1 2013-01-10 12:00:37 PST
Created attachment 182186 [details] the proposed patch
Yong Li
Comment 2 2013-01-10 12:03:22 PST
+Eric Carlson Does the patch make sense?
Eric Carlson
Comment 3 2013-01-10 12:10:24 PST
Comment on attachment 182186 [details] the proposed patch This change looks good, but please wait until the bots have had a chance to exercise the change.
Yong Li
Comment 4 2013-01-10 12:10:43 PST
(In reply to comment #3) > (From update of attachment 182186 [details]) > This change looks good, but please wait until the bots have had a chance to exercise the change. Sure. thanks!
WebKit Review Bot
Comment 5 2013-01-10 14:33:14 PST
Comment on attachment 182186 [details] the proposed patch Clearing flags on attachment: 182186 Committed r139371: <http://trac.webkit.org/changeset/139371>
WebKit Review Bot
Comment 6 2013-01-10 14:33:18 PST
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.