Title: [243287] trunk/Source/WebCore
- Revision
- 243287
- Author
- [email protected]
- Date
- 2019-03-21 05:14:04 -0700 (Thu, 21 Mar 2019)
Log Message
[GStreamer][EME][Clearkey] Take a lock in keys() method
https://bugs.webkit.org/show_bug.cgi?id=195900
Reviewed by Xabier Rodriguez-Calvar.
This isn't ideal, since we're taking a lock for every frame to
decode. But there's no good way around it when keys can be
made unavailable at any time via an update() call, so we can't
cache key IDs in the decryptor.
Covered by test imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multikey.https.html
* platform/encryptedmedia/clearkey/CDMClearKey.cpp:
(WebCore::CDMInstanceClearKey::keys const): This method is called
from GStreamer's decode() method, which runs off the main thread,
therefore we need to take a lock.
* platform/encryptedmedia/clearkey/CDMClearKey.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (243286 => 243287)
--- trunk/Source/WebCore/ChangeLog 2019-03-21 10:35:58 UTC (rev 243286)
+++ trunk/Source/WebCore/ChangeLog 2019-03-21 12:14:04 UTC (rev 243287)
@@ -1,3 +1,23 @@
+2019-03-21 Charlie Turner <[email protected]>
+
+ [GStreamer][EME][Clearkey] Take a lock in keys() method
+ https://bugs.webkit.org/show_bug.cgi?id=195900
+
+ Reviewed by Xabier Rodriguez-Calvar.
+
+ This isn't ideal, since we're taking a lock for every frame to
+ decode. But there's no good way around it when keys can be
+ made unavailable at any time via an update() call, so we can't
+ cache key IDs in the decryptor.
+
+ Covered by test imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multikey.https.html
+
+ * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
+ (WebCore::CDMInstanceClearKey::keys const): This method is called
+ from GStreamer's decode() method, which runs off the main thread,
+ therefore we need to take a lock.
+ * platform/encryptedmedia/clearkey/CDMClearKey.h:
+
2019-03-21 Carlos Garcia Campos <[email protected]>
[GTK][WPE] Add API to provide geolocation information
Modified: trunk/Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.cpp (243286 => 243287)
--- trunk/Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.cpp 2019-03-21 10:35:58 UTC (rev 243286)
+++ trunk/Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.cpp 2019-03-21 12:14:04 UTC (rev 243287)
@@ -507,6 +507,7 @@
{
// Return the keys of all sessions.
Vector<CDMInstanceClearKey::Key> allKeys { };
+ auto locker = holdLock(m_keysMutex);
size_t initialCapacity = 0;
for (auto& key : ClearKeyState::singleton().keys().values())
initialCapacity += key.size();
Modified: trunk/Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.h (243286 => 243287)
--- trunk/Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.h 2019-03-21 10:35:58 UTC (rev 243286)
+++ trunk/Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.h 2019-03-21 12:14:04 UTC (rev 243287)
@@ -97,6 +97,9 @@
};
const Vector<Key> keys() const;
+
+private:
+ mutable Lock m_keysMutex;
};
class CDMInstanceSessionClearKey final : public CDMInstanceSession, public CanMakeWeakPtr<CDMInstanceSessionClearKey> {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes