Bug 146853

Summary: Add HTMLMediaElement behavior and attribute value restrictions for MediaStream
Product: WebKit Reporter: Matthew Daiter <mdaiter>
Component: WebCore Misc.Assignee: Eric Carlson <eric.carlson>
Severity: Normal CC: bfulgham, commit-queue, eric.carlson, jer.noble, jonlee, mdaiter, webkit-bug-importer, webkit.review.bot
Priority: P2 Keywords: InRadar, PlatformOnly
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 146788    
Description Flags
Proposed patch. none

Description Matthew Daiter 2015-07-10 13:36:50 PDT
HTMLMediaElement has necessary conditions when running a MediaStream. These conditions must be met to run with standard behavior.
Comment 1 Radar WebKit Bug Importer 2015-07-10 13:38:29 PDT
Comment 2 Eric Carlson 2015-11-02 11:10:50 PST
Created attachment 264601 [details]
Proposed patch.
Comment 3 Jer Noble 2015-11-02 11:32:33 PST
Comment on attachment 264601 [details]
Proposed patch.

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

r=me, with the most minor of nits. (Don't feel like you have to change the patch though.)

> Source/WebCore/Modules/mediastream/MediaStream.cpp:287
> +    bool active = false;
> +    for (auto& track : m_trackSet.values()) {
> +        if (!track->ended()) {
> +            active = true;
> +            break;
> +        }
> +    }

It's not really worth it, but you could do:

auto& tracks = m_trackSet.values();
bool active = std::any_of(tracks.begin(), tracks.end(), [] (Track* track) { return !track->ended(); });

I wish we had those STL algorithms directly on our storage classes so we could do `m_trackSet.values().any_of([](auto track) { return !track->ended(); });`
Comment 4 WebKit Commit Bot 2015-11-02 13:50:06 PST
Comment on attachment 264601 [details]
Proposed patch.

Clearing flags on attachment: 264601

Committed r191909: <http://trac.webkit.org/changeset/191909>
Comment 5 WebKit Commit Bot 2015-11-02 13:50:09 PST
All reviewed patches have been landed.  Closing bug.