Bug 127297 - Allow MediaSessionManager to restrict 'preload' behavior
Summary: Allow MediaSessionManager to restrict 'preload' behavior
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Eric Carlson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-20 09:56 PST by Eric Carlson
Modified: 2014-01-20 11:20 PST (History)
5 users (show)

See Also:


Attachments
Proposed patch (14.59 KB, patch)
2014-01-20 10:25 PST, Eric Carlson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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