Bug 145829

Summary: Explicitly keep track of active HTMLMediaElements in MediaSessions
Product: WebKit Reporter: Matt Rajca <mrajca>
Component: MediaAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, conrad_shultz, eric.carlson, jer.noble, mrajca, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 145411    
Attachments:
Description Flags
Patch
none
Patch (re-based)
none
Patch
none
Patch (commented and fixed build error)
none
Patch none

Description Matt Rajca 2015-06-09 17:28:31 PDT
In preparation for implementing the media session invocation algorithm as described in the Media Session spec, we should be explicitly keeping track of active media elements.
Comment 1 Radar WebKit Bug Importer 2015-06-09 17:30:08 PDT
<rdar://problem/21312717>
Comment 2 Matt Rajca 2015-06-09 17:35:44 PDT
Created attachment 254616 [details]
Patch
Comment 3 Matt Rajca 2015-06-09 18:10:18 PDT
Created attachment 254619 [details]
Patch (re-based)
Comment 4 Eric Carlson 2015-06-09 20:06:01 PDT
Comment on attachment 254619 [details]
Patch (re-based)

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

> Source/WebCore/html/HTMLMediaElement.cpp:2836
> +        if (m_readyState == HAVE_CURRENT_DATA || m_readyState == HAVE_FUTURE_DATA) {
> +            if (m_session)
> +                m_session->addActiveMediaElement(*this);
> +        }

As we do elsewhere in this file, please include a comment with the text from the media session spec to explain why this is happening:

// https://mediasession.spec.whatwg.org/#activating-a-media-session
// 6.3. Activating a media session from a media element
// When the play() method on a media element is invoked and ...
// 1. Let media session be the value of media element’s current media session.
// 2.  ...

etc.
Comment 5 Matt Rajca 2015-06-10 09:23:44 PDT
Created attachment 254656 [details]
Patch
Comment 6 Matt Rajca 2015-06-10 09:24:20 PDT
(In reply to comment #4)
> Comment on attachment 254619 [details]
> Patch (re-based)
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=254619&action=review
> 
> > Source/WebCore/html/HTMLMediaElement.cpp:2836
> > +        if (m_readyState == HAVE_CURRENT_DATA || m_readyState == HAVE_FUTURE_DATA) {
> > +            if (m_session)
> > +                m_session->addActiveMediaElement(*this);
> > +        }
> 
> As we do elsewhere in this file, please include a comment with the text from
> the media session spec to explain why this is happening:
> 
> // https://mediasession.spec.whatwg.org/#activating-a-media-session
> // 6.3. Activating a media session from a media element
> // When the play() method on a media element is invoked and ...
> // 1. Let media session be the value of media element’s current media
> session.
> // 2.  ...
> 
> etc.

Done.
Comment 7 WebKit Commit Bot 2015-06-10 09:25:53 PDT
Attachment 254656 [details] did not pass style-queue:


ERROR: Source/WebCore/html/HTMLMediaElement.cpp:2842:  One line control clauses should not use braces.  [whitespace/braces] [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 8 Matt Rajca 2015-06-10 09:27:22 PDT
Created attachment 254657 [details]
Patch (commented and fixed build error)
Comment 9 WebKit Commit Bot 2015-06-10 09:28:51 PDT
Attachment 254657 [details] did not pass style-queue:


ERROR: Source/WebCore/html/HTMLMediaElement.cpp:2843:  One line control clauses should not use braces.  [whitespace/braces] [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 10 Matt Rajca 2015-06-10 09:29:21 PDT
Created attachment 254658 [details]
Patch
Comment 11 WebKit Commit Bot 2015-06-10 11:44:25 PDT
Comment on attachment 254658 [details]
Patch

Clearing flags on attachment: 254658

Committed r185424: <http://trac.webkit.org/changeset/185424>
Comment 12 WebKit Commit Bot 2015-06-10 11:44:29 PDT
All reviewed patches have been landed.  Closing bug.