Add a CDMClient class which allows the CDM to query for the currently attached MediaPlayer.
Created attachment 188215 [details] Patch
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.
(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.
Committed r143072: <http://trac.webkit.org/changeset/143072>