Summary: | Allow MediaSessionManager to restrict 'preload' behavior | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Eric Carlson <eric.carlson> | ||||
Component: | Media | Assignee: | 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
Eric Carlson
2014-01-20 09:56:02 PST
Created attachment 221672 [details]
Proposed patch
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. (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. Committed r162360: https://trac.webkit.org/r162360 |