Bug 146355 - Add support for 'Default' media session types
Summary: Add support for 'Default' media session types
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-26 11:48 PDT by Matt Rajca
Modified: 2015-06-28 22:32 PDT (History)
5 users (show)

See Also:


Attachments
Patch (5.91 KB, patch)
2015-06-26 16:58 PDT, Matt Rajca
darin: review+
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-26 11:48:49 PDT
Media elements that do not specify a media session content kind should be assigned the top-level browsing context's media session.
Comment 1 Radar WebKit Bug Importer 2015-06-26 11:49:39 PDT
<rdar://problem/21569054>
Comment 2 Matt Rajca 2015-06-26 16:58:29 PDT
Created attachment 255676 [details]
Patch
Comment 3 Darin Adler 2015-06-27 15:31:16 PDT
Comment on attachment 255676 [details]
Patch

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

> Source/WebCore/Modules/mediasession/MediaSession.cpp:62
> +    , m_kind(MediaSession::Kind::Default)

Here in the MediaSession class, the name of this type is Kind, not MediaSession::Kind, so can leave off the MediaSession part.

Seems that m_kind could default to this in the header, then we could omit it in this constructor. Syntax we would normally use in the class definition is:

    Kind m_kind { Kind::Default };

> Source/WebCore/Modules/mediasession/MediaSession.h:53
> +    MediaSession(Document&);

Probably should be:

    explicit MediaSession(Document&);
Comment 4 Matt Rajca 2015-06-28 22:21:45 PDT
(In reply to comment #3)
> Comment on attachment 255676 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=255676&action=review
> 
> > Source/WebCore/Modules/mediasession/MediaSession.cpp:62
> > +    , m_kind(MediaSession::Kind::Default)
> 
> Here in the MediaSession class, the name of this type is Kind, not
> MediaSession::Kind, so can leave off the MediaSession part.
> 
> Seems that m_kind could default to this in the header, then we could omit it
> in this constructor. Syntax we would normally use in the class definition is:
> 
>     Kind m_kind { Kind::Default };

That's simpler. Changed.

> 
> > Source/WebCore/Modules/mediasession/MediaSession.h:53
> > +    MediaSession(Document&);
> 
> Probably should be:
> 
>     explicit MediaSession(Document&);

Yup, looks like we use `explicit` heavily throughout WebKit to avoid implicit conversions with single-argument constructors.

Thanks!
Comment 5 Matt Rajca 2015-06-28 22:32:33 PDT
Committed r186064: <http://trac.webkit.org/changeset/186064>