Bug 147020 - Improve behavior of media elements in page cache.
Summary: Improve behavior of media elements in page cache.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andreas Kling
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-07-16 14:54 PDT by Andreas Kling
Modified: 2016-06-19 17:09 PDT (History)
4 users (show)

See Also:


Attachments
Patch for EWS (5.60 KB, patch)
2015-07-16 16:05 PDT, Andreas Kling
no flags Details | Formatted Diff | Diff
Patch for EWS (6.17 KB, patch)
2015-07-17 13:42 PDT, Andreas Kling
no flags Details | Formatted Diff | Diff
Proposed patch (12.76 KB, patch)
2015-07-19 13:33 PDT, Andreas Kling
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Kling 2015-07-16 14:54:29 PDT
Now that we're caching more pages with media elements, we need to make some improvements to the suspend/resume behavior:

1) Scheduled events should be suspended, not canceled altogether.
2) <source> elements should suspend their error event delivery.
3) When in page cache, network buffering should be turned off.

<rdar://problem/21712311>
Comment 1 Andreas Kling 2015-07-16 16:05:46 PDT
Created attachment 256936 [details]
Patch for EWS

This patch implements the functionality, but will need tests. Letting EWS have a chew.
Comment 2 Andreas Kling 2015-07-16 16:09:07 PDT
Thought for posterity: Maybe it would be neat to have event queues that automatically respond to page cache suspend/resume without the owner having to worry about it.
Comment 3 Chris Dumez 2015-07-16 16:28:15 PDT
Comment on attachment 256936 [details]
Patch for EWS

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

> Source/WebCore/html/HTMLSourceElement.cpp:119
> +void HTMLSourceElement::suspendErrorEventDispatch()

Maybe we should just mark HTMLSourceElement as an ActiveDOMObject and have it implement suspend() / resume(). Instead of having HTMLMediaElement worry about the source elements when suspending.
Comment 4 Andreas Kling 2015-07-17 13:42:44 PDT
Created attachment 256985 [details]
Patch for EWS

Again for EWS with HTMLSourceElement now inheriting from ActiveDOMObject.
Comment 5 Andreas Kling 2015-07-19 13:33:25 PDT
Created attachment 257065 [details]
Proposed patch
Comment 6 Chris Dumez 2015-07-20 09:32:00 PDT
Comment on attachment 257065 [details]
Proposed patch

nice, r=me.
Comment 7 WebKit Commit Bot 2015-07-20 13:17:36 PDT
Comment on attachment 257065 [details]
Proposed patch

Clearing flags on attachment: 257065

Committed r187031: <http://trac.webkit.org/changeset/187031>
Comment 8 WebKit Commit Bot 2015-07-20 13:17:40 PDT
All reviewed patches have been landed.  Closing bug.
Comment 9 Michael Catanzaro 2016-06-19 17:09:17 PDT
This broke layout test media/restore-from-page-cache.html for GTK, see bug #158914. Sorry it took a year to be noticed.