Title: [260001] trunk/Source/WebCore
Revision
260001
Author
ctur...@igalia.com
Date
2020-04-13 03:18:29 -0700 (Mon, 13 Apr 2020)

Log Message

[EME][GStreamer] remove m_cdmInstance ASSERT in cdmInstanceDetached
https://bugs.webkit.org/show_bug.cgi?id=210331

Reviewed by Xabier Rodriguez-Calvar.

In tests that reset the src very quickly, the MediaKeys can be
installed and then the src is reset before an attachment message
is sent. Hence, detachment can result in no CDM currently
existing.

Covered by imported/w3c/web-platform-tests/encrypted-media.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::cdmInstanceDetached): Only
assert if the CDM instance has been set before detachment.
(WebCore::MediaPlayerPrivateGStreamer::attemptToDecryptWithInstance):
Do not need the .get(), the operator== overload in RefPtr does
this for us, and it makes the code more consistent.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (260000 => 260001)


--- trunk/Source/WebCore/ChangeLog	2020-04-13 08:45:49 UTC (rev 260000)
+++ trunk/Source/WebCore/ChangeLog	2020-04-13 10:18:29 UTC (rev 260001)
@@ -1,3 +1,24 @@
+2020-04-13  Charlie Turner  <ctur...@igalia.com>
+
+        [EME][GStreamer] remove m_cdmInstance ASSERT in cdmInstanceDetached
+        https://bugs.webkit.org/show_bug.cgi?id=210331
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        In tests that reset the src very quickly, the MediaKeys can be
+        installed and then the src is reset before an attachment message
+        is sent. Hence, detachment can result in no CDM currently
+        existing.
+
+        Covered by imported/w3c/web-platform-tests/encrypted-media.
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivateGStreamer::cdmInstanceDetached): Only
+        assert if the CDM instance has been set before detachment.
+        (WebCore::MediaPlayerPrivateGStreamer::attemptToDecryptWithInstance):
+        Do not need the .get(), the operator== overload in RefPtr does
+        this for us, and it makes the code more consistent.
+
 2020-04-13  Rob Buis  <rb...@igalia.com>
 
         Remove return parameter from FrameLoader::closeURL

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (260000 => 260001)


--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2020-04-13 08:45:49 UTC (rev 260000)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2020-04-13 10:18:29 UTC (rev 260001)
@@ -3780,18 +3780,14 @@
 void MediaPlayerPrivateGStreamer::cdmInstanceDetached(CDMInstance& instance)
 {
     ASSERT(isMainThread());
+    ASSERT(m_pipeline);
 
-    if (m_cdmInstance != &instance) {
-        GST_WARNING("passed CDMInstance %p is different from stored one %p", &instance, m_cdmInstance.get());
-        ASSERT_NOT_REACHED();
+    if (!m_cdmInstance)
         return;
-    }
 
-    ASSERT(m_pipeline);
-
+    ASSERT(m_cdmInstance == &instance);
     GST_DEBUG_OBJECT(m_pipeline.get(), "detaching CDM instance %p, setting empty context", m_cdmInstance.get());
     m_cdmInstance = nullptr;
-
     GRefPtr<GstContext> context = adoptGRef(gst_context_new("drm-cdm-proxy", FALSE));
     gst_element_set_context(GST_ELEMENT(m_pipeline.get()), context.get());
 }
@@ -3798,7 +3794,7 @@
 
 void MediaPlayerPrivateGStreamer::attemptToDecryptWithInstance(CDMInstance& instance)
 {
-    ASSERT(m_cdmInstance.get() == &instance);
+    ASSERT(m_cdmInstance == &instance);
     GST_TRACE("instance %p, current stored %p", &instance, m_cdmInstance.get());
     attemptToDecryptWithLocalInstance();
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to