Bug 145829 - Explicitly keep track of active HTMLMediaElements in MediaSessions
Summary: Explicitly keep track of active HTMLMediaElements in MediaSessions
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks: 145411
  Show dependency treegraph
 
Reported: 2015-06-09 17:28 PDT by Matt Rajca
Modified: 2015-06-10 11:44 PDT (History)
6 users (show)

See Also:


Attachments
Patch (3.92 KB, patch)
2015-06-09 17:35 PDT, Matt Rajca
no flags Details | Formatted Diff | Diff
Patch (re-based) (3.86 KB, patch)
2015-06-09 18:10 PDT, Matt Rajca
no flags Details | Formatted Diff | Diff
Patch (4.32 KB, patch)
2015-06-10 09:23 PDT, Matt Rajca
no flags Details | Formatted Diff | Diff
Patch (commented and fixed build error) (4.35 KB, patch)
2015-06-10 09:27 PDT, Matt Rajca
no flags Details | Formatted Diff | Diff
Patch (4.35 KB, patch)
2015-06-10 09:29 PDT, Matt Rajca
no flags Details | Formatted Diff | Diff

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