Bug 109702 - Add a CDMClient class which allows the CDM to query for the currently attached MediaPlayer.
Summary: Add a CDMClient class which allows the CDM to query for the currently attache...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jer Noble
URL:
Keywords:
Depends on:
Blocks: 109644 109739
  Show dependency treegraph
 
Reported: 2013-02-13 08:44 PST by Jer Noble
Modified: 2013-02-15 17:05 PST (History)
5 users (show)

See Also:


Attachments
Patch (7.33 KB, patch)
2013-02-13 16:23 PST, Jer Noble
eric.carlson: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jer Noble 2013-02-13 08:44:06 PST
Add a CDMClient class which allows the CDM to query for the currently attached MediaPlayer.
Comment 1 Jer Noble 2013-02-13 16:23:40 PST
Created attachment 188215 [details]
Patch
Comment 2 Eric Carlson 2013-02-15 16:09:21 PST
Comment on attachment 188215 [details]
Patch

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

> Source/WebCore/Modules/encryptedmedia/CDM.h:50
> +    virtual MediaPlayer* CDMMediaPlayer(CDM*) = 0;

The upper case "CDMMediaPlayer" seems odd, "cdmMediaPlayer" maybe? Also, can it be const?

> Source/WebCore/Modules/encryptedmedia/CDM.h:76
> +    CDMClient* client() { return m_client; }

const?

> Source/WebCore/Modules/encryptedmedia/CDM.h:79
> +    MediaPlayer* mediaPlayer();

Ditto.

> Source/WebCore/Modules/encryptedmedia/MediaKeys.h:56
> +    HTMLMediaElement* mediaElement();

const.

Do you need to implement this?

> Source/WebCore/Modules/encryptedmedia/MediaKeys.h:61
> +    virtual MediaPlayer* CDMMediaPlayer(CDM*);

OVERRIDE.
Comment 3 Jer Noble 2013-02-15 16:46:15 PST
(In reply to comment #2)
> (From update of attachment 188215 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=188215&action=review
> 
> > Source/WebCore/Modules/encryptedmedia/CDM.h:50
> > +    virtual MediaPlayer* CDMMediaPlayer(CDM*) = 0;
> 
> The upper case "CDMMediaPlayer" seems odd, "cdmMediaPlayer" maybe? Also, can it be const?

I'll change the case.  It can be const, but that implies constness in a lot of other places (and in the CDM parameter too).

> > Source/WebCore/Modules/encryptedmedia/CDM.h:76
> > +    CDMClient* client() { return m_client; }
> 
> const?

Sure.

> > Source/WebCore/Modules/encryptedmedia/CDM.h:79
> > +    MediaPlayer* mediaPlayer();
> 
> Ditto.

Sure, but this implies a const CDM* parameter in cdmMediaPlayer().

> > Source/WebCore/Modules/encryptedmedia/MediaKeys.h:56
> > +    HTMLMediaElement* mediaElement();
> 
> const.
> 
> Do you need to implement this?

Not technically, but yes.  (It's actually implemented in a future patch.)

> > Source/WebCore/Modules/encryptedmedia/MediaKeys.h:61
> > +    virtual MediaPlayer* CDMMediaPlayer(CDM*);
> 
> OVERRIDE.

OK.
Comment 4 Jer Noble 2013-02-15 17:05:10 PST
Committed r143072: <http://trac.webkit.org/changeset/143072>