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.
<rdar://problem/21312717>
Created attachment 254616 [details] Patch
Created attachment 254619 [details] Patch (re-based)
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.
Created attachment 254656 [details] Patch
(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.
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.
Created attachment 254657 [details] Patch (commented and fixed build error)
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.
Created attachment 254658 [details] Patch
Comment on attachment 254658 [details] Patch Clearing flags on attachment: 254658 Committed r185424: <http://trac.webkit.org/changeset/185424>
All reviewed patches have been landed. Closing bug.