Bug 146853 - Add HTMLMediaElement behavior and attribute value restrictions for MediaStream
Summary: Add HTMLMediaElement behavior and attribute value restrictions for MediaStream
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Eric Carlson
URL:
Keywords: InRadar, PlatformOnly
Depends on:
Blocks: 146788
  Show dependency treegraph
 
Reported: 2015-07-10 13:36 PDT by Matthew Daiter
Modified: 2015-11-02 13:50 PST (History)
8 users (show)

See Also:


Attachments
Proposed patch. (20.96 KB, patch)
2015-11-02 11:10 PST, Eric Carlson
no flags Details | Formatted Diff | Diff

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