Bug 146282 - MediaSession: propagate MediaSessionMetadata to WebPageProxy
Summary: MediaSession: propagate MediaSessionMetadata to WebPageProxy
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-24 09:59 PDT by Matt Rajca
Modified: 2015-06-24 15:39 PDT (History)
5 users (show)

See Also:


Attachments
Patch (10.28 KB, patch)
2015-06-24 10:15 PDT, Matt Rajca
no flags Details | Formatted Diff | Diff
Patch (10.28 KB, patch)
2015-06-24 10:49 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-24 09:59:00 PDT
Propagate changes to MediaSessionMetadata to WebPageProxy for clients to ultimately respond to.
Comment 1 Radar WebKit Bug Importer 2015-06-24 09:59:41 PDT
<rdar://problem/21525952>
Comment 2 Matt Rajca 2015-06-24 10:15:09 PDT
Created attachment 255489 [details]
Patch
Comment 3 Eric Carlson 2015-06-24 10:19:32 PDT
Comment on attachment 255489 [details]
Patch

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

> Source/WebKit2/Shared/WebCoreArgumentCoders.cpp:91
> +#import <WebCore/MediaSessionMetadata.h>

This (and the one above :-O) should be "#include", not "#import".
Comment 4 Matt Rajca 2015-06-24 10:32:32 PDT
(In reply to comment #3)
> Comment on attachment 255489 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=255489&action=review
> 
> > Source/WebKit2/Shared/WebCoreArgumentCoders.cpp:91
> > +#import <WebCore/MediaSessionMetadata.h>
> 
> This (and the one above :-O) should be "#include", not "#import".

Fixed. I filed a separate bug (Bug 146283) for the one above.
Comment 5 Matt Rajca 2015-06-24 10:49:47 PDT
Created attachment 255491 [details]
Patch
Comment 6 Darin Adler 2015-06-24 14:58:10 PDT
Comment on attachment 255491 [details]
Patch

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

> Source/WebCore/Modules/mediasession/MediaSession.cpp:104
> +    m_document.page()->chrome().client().mediaSessionMetadataDidChange(m_metadata);

What guarantees that page() is not null here? We should check it for null unless there is an ironclad guarantee it can’t be.

> Source/WebCore/page/ChromeClient.h:50
> +#if ENABLE(MEDIA_SESSION)
> +#include "MediaSessionMetadata.h"
> +#endif

We should not include this header. We should be able to just forward-declare MediaSessionMetadata to compile this header.
Comment 7 Tim Horton 2015-06-24 14:58:54 PDT
Comment on attachment 255491 [details]
Patch

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

> Source/WebCore/page/ChromeClient.h:49
> +#include "MediaSessionMetadata.h"

Please forward-declare instead of including this header (it seems like you can, right?). ChromeClient.h is included in a billion places and this will just make the build slower.

> Source/WebKit2/UIProcess/WebPageProxy.cpp:5775
> +{

I assume you're going to put something here in a near-future patch?

> Source/WebKit2/UIProcess/WebPageProxy.h:123
> +#if ENABLE(MEDIA_SESSION)
> +#include <WebCore/MediaSessionMetadata.h>

Ditto here.
Comment 8 Matt Rajca 2015-06-24 15:31:07 PDT
(In reply to comment #7)
> Comment on attachment 255491 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=255491&action=review
> 
> > Source/WebCore/page/ChromeClient.h:49
> > +#include "MediaSessionMetadata.h"
> 
> Please forward-declare instead of including this header (it seems like you
> can, right?). ChromeClient.h is included in a billion places and this will
> just make the build slower.

Yup, fixed.

> 
> > Source/WebKit2/UIProcess/WebPageProxy.cpp:5775
> > +{
> 
> I assume you're going to put something here in a near-future patch?

Yes. I have the changes locally.

> 
> > Source/WebKit2/UIProcess/WebPageProxy.h:123
> > +#if ENABLE(MEDIA_SESSION)
> > +#include <WebCore/MediaSessionMetadata.h>
> 
> Ditto here.

Changed.
Comment 9 Matt Rajca 2015-06-24 15:32:18 PDT
(In reply to comment #6)
> Comment on attachment 255491 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=255491&action=review
> 
> > Source/WebCore/Modules/mediasession/MediaSession.cpp:104
> > +    m_document.page()->chrome().client().mediaSessionMetadataDidChange(m_metadata);
> 
> What guarantees that page() is not null here? We should check it for null
> unless there is an ironclad guarantee it can’t be.

Added the null check.

> 
> > Source/WebCore/page/ChromeClient.h:50
> > +#if ENABLE(MEDIA_SESSION)
> > +#include "MediaSessionMetadata.h"
> > +#endif
> 
> We should not include this header. We should be able to just forward-declare
> MediaSessionMetadata to compile this header.

Changed. Thanks!
Comment 10 Matt Rajca 2015-06-24 15:39:12 PDT
Committed r185929: <http://trac.webkit.org/changeset/185929>