Bug 146369

Summary: [iOS] Drop buffered data in paused media elements on memory pressure.
Product: WebKit Reporter: Andreas Kling <kling>
Component: MediaAssignee: Andreas Kling <kling>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, eric.carlson, jeremyj-wk, jer.noble, kling
Priority: P2 Keywords: InRadar, Performance
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 146592    
Bug Blocks:    
Attachments:
Description Flags
Patch idea eric.carlson: review+

Description Andreas Kling 2015-06-26 16:55:02 PDT
When we get the system memory pressure notification, we should try to drop buffered data for paused media elements.

<rdar://problem/20366883>
Comment 1 Andreas Kling 2015-06-26 16:55:46 PDT
Created attachment 255675 [details]
Patch idea
Comment 2 WebKit Commit Bot 2015-06-26 16:59:32 PDT
Attachment 255675 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/MemoryPressureHandler.cpp:148:  Missing space around : in range-based for statement  [whitespace/colon] [4]
Total errors found: 1 in 4 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Pratik Solanki 2015-06-26 17:10:16 PDT
*** Bug 146368 has been marked as a duplicate of this bug. ***
Comment 4 Eric Carlson 2015-06-27 07:16:19 PDT
Comment on attachment 255675 [details]
Patch idea

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

Very nice - thanks!

> Source/WebCore/html/HTMLMediaElement.cpp:6385
> +void HTMLMediaElement::dropBufferedDataIfPossible()

Nit: "purgeBufferedDataIfPossible" might be slightly clearer.
Comment 5 Andreas Kling 2015-06-28 15:16:57 PDT
Committed r186054: <http://trac.webkit.org/changeset/186054>