Title: [225594] trunk/Source/WebCore
Revision
225594
Author
jer.no...@apple.com
Date
2017-12-06 13:53:09 -0800 (Wed, 06 Dec 2017)

Log Message

[EME] Make CDMInstance& parameter passed through MediaPlayer non-const
https://bugs.webkit.org/show_bug.cgi?id=180484

Reviewed by Jon Lee.

One can only call const methods on const references, and the obvious intent
of these methods is for the callee to call non-const methods on the parameters.

* Modules/encryptedmedia/MediaKeys.h:
(WebCore::MediaKeys::cdmInstance):
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::cdmInstanceAttached):
(WebCore::MediaPlayer::cdmInstanceDetached):
(WebCore::MediaPlayer::attemptToDecryptWithInstance):
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::cdmInstanceAttached):
(WebCore::MediaPlayerPrivateInterface::cdmInstanceDetached):
(WebCore::MediaPlayerPrivateInterface::attemptToDecryptWithInstance):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceAttached):
(WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceDetached):
(WebCore::MediaPlayerPrivateGStreamerBase::attemptToDecryptWithInstance):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithInstance):
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (225593 => 225594)


--- trunk/Source/WebCore/ChangeLog	2017-12-06 21:34:25 UTC (rev 225593)
+++ trunk/Source/WebCore/ChangeLog	2017-12-06 21:53:09 UTC (rev 225594)
@@ -1,3 +1,33 @@
+2017-12-06  Jer Noble  <jer.no...@apple.com>
+
+        [EME] Make CDMInstance& parameter passed through MediaPlayer non-const
+        https://bugs.webkit.org/show_bug.cgi?id=180484
+
+        Reviewed by Jon Lee.
+
+        One can only call const methods on const references, and the obvious intent
+        of these methods is for the callee to call non-const methods on the parameters.
+
+        * Modules/encryptedmedia/MediaKeys.h:
+        (WebCore::MediaKeys::cdmInstance):
+        * platform/graphics/MediaPlayer.cpp:
+        (WebCore::MediaPlayer::cdmInstanceAttached):
+        (WebCore::MediaPlayer::cdmInstanceDetached):
+        (WebCore::MediaPlayer::attemptToDecryptWithInstance):
+        * platform/graphics/MediaPlayer.h:
+        * platform/graphics/MediaPlayerPrivate.h:
+        (WebCore::MediaPlayerPrivateInterface::cdmInstanceAttached):
+        (WebCore::MediaPlayerPrivateInterface::cdmInstanceDetached):
+        (WebCore::MediaPlayerPrivateInterface::attemptToDecryptWithInstance):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
+        (WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceAttached):
+        (WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceDetached):
+        (WebCore::MediaPlayerPrivateGStreamerBase::attemptToDecryptWithInstance):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
+        * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
+        (WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithInstance):
+        * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
+
 2017-12-06  Youenn Fablet  <you...@apple.com>
 
         Preflight should bypass service worker

Modified: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.h (225593 => 225594)


--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.h	2017-12-06 21:34:25 UTC (rev 225593)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.h	2017-12-06 21:53:09 UTC (rev 225594)
@@ -65,6 +65,7 @@
     void attemptToResumePlaybackOnClients();
 
     bool hasOpenSessions() const;
+    CDMInstance& cdmInstance() { return m_instance; }
     const CDMInstance& cdmInstance() const { return m_instance; }
 
 protected:

Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp (225593 => 225594)


--- trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp	2017-12-06 21:34:25 UTC (rev 225593)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp	2017-12-06 21:53:09 UTC (rev 225594)
@@ -600,17 +600,17 @@
 #endif
     
 #if ENABLE(ENCRYPTED_MEDIA)
-void MediaPlayer::cdmInstanceAttached(const CDMInstance& instance)
+void MediaPlayer::cdmInstanceAttached(CDMInstance& instance)
 {
     m_private->cdmInstanceAttached(instance);
 }
 
-void MediaPlayer::cdmInstanceDetached(const CDMInstance& instance)
+void MediaPlayer::cdmInstanceDetached(CDMInstance& instance)
 {
     m_private->cdmInstanceDetached(instance);
 }
 
-void MediaPlayer::attemptToDecryptWithInstance(const CDMInstance& instance)
+void MediaPlayer::attemptToDecryptWithInstance(CDMInstance& instance)
 {
     m_private->attemptToDecryptWithInstance(instance);
 }

Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.h (225593 => 225594)


--- trunk/Source/WebCore/platform/graphics/MediaPlayer.h	2017-12-06 21:34:25 UTC (rev 225593)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.h	2017-12-06 21:53:09 UTC (rev 225594)
@@ -394,9 +394,9 @@
 #endif
 
 #if ENABLE(ENCRYPTED_MEDIA)
-    void cdmInstanceAttached(const CDMInstance&);
-    void cdmInstanceDetached(const CDMInstance&);
-    void attemptToDecryptWithInstance(const CDMInstance&);
+    void cdmInstanceAttached(CDMInstance&);
+    void cdmInstanceDetached(CDMInstance&);
+    void attemptToDecryptWithInstance(CDMInstance&);
 #endif
 
     bool paused() const;

Modified: trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h (225593 => 225594)


--- trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h	2017-12-06 21:34:25 UTC (rev 225593)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h	2017-12-06 21:53:09 UTC (rev 225594)
@@ -237,9 +237,9 @@
 #endif
 
 #if ENABLE(ENCRYPTED_MEDIA)
-    virtual void cdmInstanceAttached(const CDMInstance&) { }
-    virtual void cdmInstanceDetached(const CDMInstance&) { }
-    virtual void attemptToDecryptWithInstance(const CDMInstance&) { }
+    virtual void cdmInstanceAttached(CDMInstance&) { }
+    virtual void cdmInstanceDetached(CDMInstance&) { }
+    virtual void attemptToDecryptWithInstance(CDMInstance&) { }
 #endif
 
 #if ENABLE(VIDEO_TRACK)

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp (225593 => 225594)


--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp	2017-12-06 21:34:25 UTC (rev 225593)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp	2017-12-06 21:53:09 UTC (rev 225594)
@@ -1142,7 +1142,7 @@
 }
 
 #if ENABLE(ENCRYPTED_MEDIA)
-void MediaPlayerPrivateGStreamerBase::cdmInstanceAttached(const CDMInstance& instance)
+void MediaPlayerPrivateGStreamerBase::cdmInstanceAttached(CDMInstance& instance)
 {
     ASSERT(!m_cdmInstance);
     m_cdmInstance = &instance;
@@ -1150,7 +1150,7 @@
     m_protectionCondition.notifyAll();
 }
 
-void MediaPlayerPrivateGStreamerBase::cdmInstanceDetached(const CDMInstance& instance)
+void MediaPlayerPrivateGStreamerBase::cdmInstanceDetached(CDMInstance& instance)
 {
 #ifdef NDEBUG
     UNUSED_PARAM(instance);
@@ -1161,7 +1161,7 @@
     m_protectionCondition.notifyAll();
 }
 
-void MediaPlayerPrivateGStreamerBase::attemptToDecryptWithInstance(const CDMInstance& instance)
+void MediaPlayerPrivateGStreamerBase::attemptToDecryptWithInstance(CDMInstance& instance)
 {
     ASSERT(m_cdmInstance.get() == &instance);
     GST_TRACE("instance %p, current stored %p", &instance, m_cdmInstance.get());

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h (225593 => 225594)


--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h	2017-12-06 21:34:25 UTC (rev 225593)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h	2017-12-06 21:53:09 UTC (rev 225594)
@@ -137,12 +137,12 @@
 #endif
 
 #if ENABLE(ENCRYPTED_MEDIA)
-    void cdmInstanceAttached(const CDMInstance&) override;
-    void cdmInstanceDetached(const CDMInstance&) override;
+    void cdmInstanceAttached(CDMInstance&) override;
+    void cdmInstanceDetached(CDMInstance&) override;
     void dispatchDecryptionKey(GstBuffer*);
     void handleProtectionEvent(GstEvent*);
     void attemptToDecryptWithLocalInstance();
-    void attemptToDecryptWithInstance(const CDMInstance&) override;
+    void attemptToDecryptWithInstance(CDMInstance&) override;
 #endif
 
     static bool supportsKeySystem(const String& keySystem, const String& mimeType);

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp (225593 => 225594)


--- trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp	2017-12-06 21:34:25 UTC (rev 225593)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp	2017-12-06 21:53:09 UTC (rev 225594)
@@ -936,7 +936,7 @@
 }
 
 #if ENABLE(ENCRYPTED_MEDIA)
-void MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithInstance(const CDMInstance& instance)
+void MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithInstance(CDMInstance& instance)
 {
     if (is<CDMInstanceClearKey>(instance)) {
         auto& ckInstance = downcast<CDMInstanceClearKey>(instance);

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h (225593 => 225594)


--- trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h	2017-12-06 21:34:25 UTC (rev 225593)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h	2017-12-06 21:53:09 UTC (rev 225594)
@@ -87,7 +87,7 @@
     static bool supportsAllCodecs(const Vector<String>& codecs);
 
 #if ENABLE(ENCRYPTED_MEDIA)
-    void attemptToDecryptWithInstance(const CDMInstance&) final;
+    void attemptToDecryptWithInstance(CDMInstance&) final;
 #endif
 
 private:
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to