Bug 127297

Summary: Allow MediaSessionManager to restrict 'preload' behavior
Product: WebKit Reporter: Eric Carlson <eric.carlson>
Component: MediaAssignee: Eric Carlson <eric.carlson>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, esprehn+autocc, glenn, gyuyoung.kim, jer.noble
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Proposed patch none

Description Eric Carlson 2014-01-20 09:56:02 PST
Some platforms limit media data preloading. Allow ports to configure MediaSessionManager to control this.
Comment 1 Eric Carlson 2014-01-20 10:25:12 PST
Created attachment 221672 [details]
Proposed patch
Comment 2 Jer Noble 2014-01-20 10:42:31 PST
Comment on attachment 221672 [details]
Proposed patch

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

r=me with one nit.

> Source/WebCore/html/HTMLMediaSession.cpp:146
> +MediaPlayer::Preload HTMLMediaSession::applyPreloadRestrictions(const HTMLMediaElement&, MediaPlayer::Preload preload) const

I'm not a huge fan of this name.  It implies that the parameter is being modified, rather than a new preload being returned.  How about "effectivePreload()" or "effectivePreloadForElement()", like your variables above?  If you added an accessor for m_preload, you wouldn't even have to pass in the m_preload attribute; effectivePreloadForElement() could just as the media element for it's m_preload value and return the effective (post-restrictions) preload value.
Comment 3 Eric Carlson 2014-01-20 11:19:57 PST
(In reply to comment #2)
> (From update of attachment 221672 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=221672&action=review
> 
> r=me with one nit.
> 
> > Source/WebCore/html/HTMLMediaSession.cpp:146
> > +MediaPlayer::Preload HTMLMediaSession::applyPreloadRestrictions(const HTMLMediaElement&, MediaPlayer::Preload preload) const
> 
> I'm not a huge fan of this name.  It implies that the parameter is being modified, rather than a new preload being returned.  How about "effectivePreload()" or "effectivePreloadForElement()", like your variables above?  If you added an accessor for m_preload, you wouldn't even have to pass in the m_preload attribute; effectivePreloadForElement() could just as the media element for it's m_preload value and return the effective (post-restrictions) preload value.

Great suggestion, done.
Comment 4 Eric Carlson 2014-01-20 11:20:12 PST
Committed r162360: https://trac.webkit.org/r162360