- Revision
- 279363
- Author
- [email protected]
- Date
- 2021-06-28 23:11:52 -0700 (Mon, 28 Jun 2021)
Log Message
[GStreamer][EME] Fix resources release when a MediaKeySession is closed
https://bugs.webkit.org/show_bug.cgi?id=227403
Reviewed by Philippe Normand.
Thunder sessions should be a BoxPtr, already when stored at the
CDMInstanceSessionThunder, it does not make sense to store then in
a unique_ptr. This way the same session lives in the
MediaKeySession wrapper (CDMInstanceSessionThunder) and inside the
KeyStores.
Removed the CDMInstanceProxy key store. It is not needed.
When a session is closed in Thunder, there should be a cascade to
remove it from the other synced stores, that's why we introduce
the removeAllKeysFrom logic.
Regular key stores do not manage key session references
anymore. They are only needed in the CDMProxy class, which is
where the keys are shared among different sessions. We were
managing key session references in other stores and they were
messing up with the key references in the CDMProxy class. In
those cases, a key kept in a local store could have a reference
that would prevent the CDMProxy key store from removing it when
asked from it. There were also cases of removing keys from local
stores that were creating negative reference numbers, which
created the opposite effect, this is, leaving in place keys in the
CDMProxy store that should be released.
* platform/encryptedmedia/CDMProxy.cpp:
(WebCore::KeyStore::merge): Simplified to just add keys.
(WebCore::KeyStore::add): Adds references (if needed) and merges
if needed.
(WebCore::KeyStore::unrefAllKeys): Renamed. Unrefs all keys from a
store by copying itself and calling unrefAllKeysFrom that copy.
(WebCore::KeyStore::unref): Renamed. Uses proper refefencing.
(WebCore::CDMProxy::unrefAllKeysFrom): Method to unref all keys
that are contained in some other store.
(WebCore::CDMInstanceProxy::mergeKeysFrom): There is no more key
store in this class.
(WebCore::CDMInstanceProxy::unrefAllKeysFrom): Renamed. Calls the
CDMproxy to unref the keys from there.
* platform/encryptedmedia/CDMProxy.h:
(WebCore::KeyHandle::mergeKeyInto): Merges one key into self by
copying status, data and summing reference count.
(WebCore::KeyHandle::numSessionReferences const): Turn int.
(WebCore::KeyHandle::hasReferences const): Added.
(WebCore::KeyStore::addSessionReferenceTo const):
(WebCore::KeyStore::removeSessionReferenceFrom const): Helpers to
check if the store is reference counted or not. Default is do
nothing and but the ReferenceAwareKeyStore redefines them to do
reference counting.
(WebCore::KeyStore::unrefAllKeys): Deleted.
* platform/encryptedmedia/clearkey/CDMClearKey.cpp:
(WebCore::CDMInstanceSessionClearKey::updateLicense):
(WebCore::CDMInstanceSessionClearKey::removeSessionData): Use
renamed methods.
* platform/graphics/gstreamer/eme/CDMThunder.h:
* platform/graphics/gstreamer/eme/CDMThunder.cpp:
(WebCore::CDMInstanceSessionThunder::status const):
(WebCore::CDMInstanceSessionThunder::keyUpdatedCallback):
(WebCore::CDMInstanceSessionThunder::requestLicense):
(WebCore::CDMInstanceSessionThunder::updateLicense):
(WebCore::CDMInstanceSessionThunder::removeSessionData):
(WebCore::CDMInstanceSessionThunder::loadSession): Use BoxPtr in
the session.
(WebCore::CDMInstanceSessionThunder::closeSession): Close the
current session, release the BoxPtr, notify the instance and
therefore the proxy to unref all they key IDs in this session and
empty the local key store.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (279362 => 279363)
--- trunk/Source/WebCore/ChangeLog 2021-06-29 04:05:14 UTC (rev 279362)
+++ trunk/Source/WebCore/ChangeLog 2021-06-29 06:11:52 UTC (rev 279363)
@@ -1,3 +1,76 @@
+2021-06-28 Xabier Rodriguez Calvar <[email protected]>
+
+ [GStreamer][EME] Fix resources release when a MediaKeySession is closed
+ https://bugs.webkit.org/show_bug.cgi?id=227403
+
+ Reviewed by Philippe Normand.
+
+ Thunder sessions should be a BoxPtr, already when stored at the
+ CDMInstanceSessionThunder, it does not make sense to store then in
+ a unique_ptr. This way the same session lives in the
+ MediaKeySession wrapper (CDMInstanceSessionThunder) and inside the
+ KeyStores.
+
+ Removed the CDMInstanceProxy key store. It is not needed.
+
+ When a session is closed in Thunder, there should be a cascade to
+ remove it from the other synced stores, that's why we introduce
+ the removeAllKeysFrom logic.
+
+ Regular key stores do not manage key session references
+ anymore. They are only needed in the CDMProxy class, which is
+ where the keys are shared among different sessions. We were
+ managing key session references in other stores and they were
+ messing up with the key references in the CDMProxy class. In
+ those cases, a key kept in a local store could have a reference
+ that would prevent the CDMProxy key store from removing it when
+ asked from it. There were also cases of removing keys from local
+ stores that were creating negative reference numbers, which
+ created the opposite effect, this is, leaving in place keys in the
+ CDMProxy store that should be released.
+
+ * platform/encryptedmedia/CDMProxy.cpp:
+ (WebCore::KeyStore::merge): Simplified to just add keys.
+ (WebCore::KeyStore::add): Adds references (if needed) and merges
+ if needed.
+ (WebCore::KeyStore::unrefAllKeys): Renamed. Unrefs all keys from a
+ store by copying itself and calling unrefAllKeysFrom that copy.
+ (WebCore::KeyStore::unref): Renamed. Uses proper refefencing.
+ (WebCore::CDMProxy::unrefAllKeysFrom): Method to unref all keys
+ that are contained in some other store.
+ (WebCore::CDMInstanceProxy::mergeKeysFrom): There is no more key
+ store in this class.
+ (WebCore::CDMInstanceProxy::unrefAllKeysFrom): Renamed. Calls the
+ CDMproxy to unref the keys from there.
+ * platform/encryptedmedia/CDMProxy.h:
+ (WebCore::KeyHandle::mergeKeyInto): Merges one key into self by
+ copying status, data and summing reference count.
+ (WebCore::KeyHandle::numSessionReferences const): Turn int.
+ (WebCore::KeyHandle::hasReferences const): Added.
+ (WebCore::KeyStore::addSessionReferenceTo const):
+ (WebCore::KeyStore::removeSessionReferenceFrom const): Helpers to
+ check if the store is reference counted or not. Default is do
+ nothing and but the ReferenceAwareKeyStore redefines them to do
+ reference counting.
+ (WebCore::KeyStore::unrefAllKeys): Deleted.
+ * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
+ (WebCore::CDMInstanceSessionClearKey::updateLicense):
+ (WebCore::CDMInstanceSessionClearKey::removeSessionData): Use
+ renamed methods.
+ * platform/graphics/gstreamer/eme/CDMThunder.h:
+ * platform/graphics/gstreamer/eme/CDMThunder.cpp:
+ (WebCore::CDMInstanceSessionThunder::status const):
+ (WebCore::CDMInstanceSessionThunder::keyUpdatedCallback):
+ (WebCore::CDMInstanceSessionThunder::requestLicense):
+ (WebCore::CDMInstanceSessionThunder::updateLicense):
+ (WebCore::CDMInstanceSessionThunder::removeSessionData):
+ (WebCore::CDMInstanceSessionThunder::loadSession): Use BoxPtr in
+ the session.
+ (WebCore::CDMInstanceSessionThunder::closeSession): Close the
+ current session, release the BoxPtr, notify the instance and
+ therefore the proxy to unref all they key IDs in this session and
+ empty the local key store.
+
2021-06-28 Darin Adler <[email protected]>
CSS parser "consume declaration" algorithm does not handle whitespace correctly
Modified: trunk/Source/WebCore/platform/encryptedmedia/CDMProxy.cpp (279362 => 279363)
--- trunk/Source/WebCore/platform/encryptedmedia/CDMProxy.cpp 2021-06-29 04:05:14 UTC (rev 279362)
+++ trunk/Source/WebCore/platform/encryptedmedia/CDMProxy.cpp 2021-06-29 06:11:52 UTC (rev 279363)
@@ -117,18 +117,8 @@
{
ASSERT(isMainThread());
LOG(EME, "EME - CDMProxy - merging %u new keys into a key store of %u keys", other.numKeys(), numKeys());
- for (const auto& key : other) {
- // NOTE: Do we care that we will not append a key if it matches a key ID
- // in the keystore and has different data. Should we overwrite? Which is "newer"?
- // Don't think we need this extra complexity.
- size_t keyWithMatchingKeyIDIndex = m_keys.findMatching([&] (const RefPtr<KeyHandle>& storedKey) { return *key == *storedKey; });
- if (keyWithMatchingKeyIDIndex == WTF::notFound)
- m_keys.append(key);
- else {
- LOG(EME, "EME - CDMProxy - keys with the same ID!");
- ASSERT(key->value() == m_keys[keyWithMatchingKeyIDIndex]->value());
- }
- }
+ for (const auto& key : other)
+ add(key.copyRef());
#if !LOG_DISABLED
LOG(EME, "EME - CDMProxy - key store now has %u keys", numKeys());
@@ -162,14 +152,15 @@
return *key == *storedKey;
});
+ addSessionReferenceTo(key);
if (keyWithMatchingKeyIDIndex != WTF::notFound) {
auto& keyWithMatchingKeyID = m_keys[keyWithMatchingKeyIDIndex];
- didStoreChange = keyWithMatchingKeyID == key;
+ didStoreChange = keyWithMatchingKeyID != key;
if (didStoreChange)
- keyWithMatchingKeyID = key;
+ keyWithMatchingKeyID->mergeKeyInto(WTFMove(key));
} else {
LOG(EME, "EME - ClearKey - New key with ID %s getting added to key store", key->idAsString().ascii().data());
- m_keys.append(key);
+ m_keys.append(WTFMove(key));
didStoreChange = true;
}
@@ -183,33 +174,38 @@
});
}
- key->addSessionReference();
return didStoreChange;
}
-void KeyStore::removeAllKeysFrom(const KeyStore& other)
+void KeyStore::unrefAllKeysFrom(const KeyStore& other)
{
for (const auto& key : other)
- remove(key);
+ unref(key);
}
-bool KeyStore::remove(const RefPtr<KeyHandle>& key)
+void KeyStore::unrefAllKeys()
{
+ KeyStore store(*this);
+ unrefAllKeysFrom(store);
+}
+
+bool KeyStore::unref(const RefPtr<KeyHandle>& key)
+{
bool storeChanged = false;
size_t keyWithMatchingKeyIDIndex = m_keys.find(key);
- LOG(EME, "EME - ClearKey - requested to remove key with ID %s and %u session references", key->idAsString().ascii().data(), key->numSessionReferences());
+ LOG(EME, "EME - ClearKey - requested to unref key with ID %s and %d session references", key->idAsString().ascii().data(), key->numSessionReferences());
if (keyWithMatchingKeyIDIndex != WTF::notFound) {
auto& keyWithMatchingKeyID = m_keys[keyWithMatchingKeyIDIndex];
- keyWithMatchingKeyID->removeSessionReference();
- if (!keyWithMatchingKeyID->numSessionReferences()) {
- LOG(EME, "EME - ClearKey - remove key with ID %s", keyWithMatchingKeyID->idAsString().ascii().data());
+ removeSessionReferenceFrom(keyWithMatchingKeyID);
+ if (!keyWithMatchingKeyID->hasReferences()) {
+ LOG(EME, "EME - ClearKey - unref key with ID %s", keyWithMatchingKeyID->idAsString().ascii().data());
m_keys.remove(keyWithMatchingKeyIDIndex);
storeChanged = true;
}
} else
- LOG(EME, "EME - ClearKey - attempt to remove key with ID %s ignored, does not exist", key->idAsString().ascii().data());
+ LOG(EME, "EME - ClearKey - attempt to unref key with ID %s ignored, does not exist", key->idAsString().ascii().data());
return storeChanged;
}
@@ -248,6 +244,14 @@
return m_instance;
}
+void CDMProxy::unrefAllKeysFrom(const KeyStore& keyStore)
+{
+ Locker locker { m_keysLock };
+ m_keyStore.unrefAllKeysFrom(keyStore);
+ LOG(EME, "EME - CDMProxy - removing from key store from a session closure");
+ m_keysCondition.notifyAll();
+}
+
void CDMProxy::setInstance(CDMInstanceProxy* instance)
{
Locker locker { m_instanceLock };
@@ -377,7 +381,6 @@
{
// FIXME: Notify JS when appropriate.
ASSERT(isMainThread());
- m_keyStore.merge(keyStore);
if (m_cdmProxy) {
LOG(EME, "EME - CDMInstanceProxy - merging keys into proxy instance and notifying CDMProxy of changes");
m_cdmProxy->updateKeyStore(keyStore);
@@ -384,10 +387,13 @@
}
}
-void CDMInstanceProxy::removeAllKeysFrom(const KeyStore& keyStore)
+void CDMInstanceProxy::unrefAllKeysFrom(const KeyStore& keyStore)
{
ASSERT(isMainThread());
- m_keyStore.removeAllKeysFrom(keyStore);
+ if (m_cdmProxy) {
+ LOG(EME, "EME - CDMInstanceProxy - removing keys from proxy instance and notifying CDMProxy of changes");
+ m_cdmProxy->unrefAllKeysFrom(keyStore);
+ }
}
CDMInstanceSessionProxy::CDMInstanceSessionProxy(CDMInstanceProxy& instance)
Modified: trunk/Source/WebCore/platform/encryptedmedia/CDMProxy.h (279362 => 279363)
--- trunk/Source/WebCore/platform/encryptedmedia/CDMProxy.h 2021-06-29 04:05:14 UTC (rev 279362)
+++ trunk/Source/WebCore/platform/encryptedmedia/CDMProxy.h 2021-06-29 06:11:52 UTC (rev 279363)
@@ -68,6 +68,12 @@
const KeyHandleValueVariant& value() const { return m_value; }
KeyHandleValueVariant& value() { return m_value; }
KeyStatus status() const { return m_status; }
+ void mergeKeyInto(RefPtr<KeyHandle>&& other)
+ {
+ m_status = other->m_status;
+ m_value = other->m_value;
+ m_numSessionReferences += other->m_numSessionReferences;
+ }
bool isStatusCurrentlyValid()
{
return m_status == CDMInstanceSession::KeyStatus::Usable || m_status == CDMInstanceSession::KeyStatus::OutputRestricted
@@ -99,8 +105,10 @@
private:
void addSessionReference() { ASSERT(isMainThread()); m_numSessionReferences++; }
void removeSessionReference() { ASSERT(isMainThread()); m_numSessionReferences--; }
- unsigned numSessionReferences() const { ASSERT(isMainThread()); return m_numSessionReferences; }
+ int numSessionReferences() const { ASSERT(isMainThread()); return m_numSessionReferences; }
+ bool hasReferences() const { ASSERT(isMainThread()); return m_numSessionReferences > 0; }
friend class KeyStore;
+ friend class ReferenceAwareKeyStore;
KeyHandle(KeyStatus status, KeyIDType&& keyID, KeyHandleValueVariant&& keyHandleValue)
: m_status(status), m_id(WTFMove(keyID)), m_value(WTFMove(keyHandleValue)) { }
@@ -108,7 +116,7 @@
KeyStatus m_status;
KeyIDType m_id;
KeyHandleValueVariant m_value;
- unsigned m_numSessionReferences { 0 };
+ int m_numSessionReferences { 0 };
};
class KeyStore {
@@ -116,14 +124,15 @@
using KeyStatusVector = CDMInstanceSession::KeyStatusVector;
KeyStore() = default;
+ virtual ~KeyStore() = default;
bool containsKeyID(const KeyIDType&) const;
void merge(const KeyStore&);
- void removeAllKeysFrom(const KeyStore&);
- void removeAllKeys() { m_keys.clear(); }
+ void unrefAllKeysFrom(const KeyStore&);
+ void unrefAllKeys();
bool addKeys(Vector<RefPtr<KeyHandle>>&&);
bool add(RefPtr<KeyHandle>&&);
- bool remove(const RefPtr<KeyHandle>&);
+ bool unref(const RefPtr<KeyHandle>&);
bool hasKeys() const { return m_keys.size(); }
unsigned numKeys() const { return m_keys.size(); }
const RefPtr<KeyHandle>& keyHandle(const KeyIDType&) const;
@@ -130,6 +139,8 @@
KeyStatusVector allKeysAs(CDMInstanceSession::KeyStatus) const;
KeyStatusVector convertToJSKeyStatusVector() const;
bool isEmpty() const { return m_keys.isEmpty(); }
+ virtual void addSessionReferenceTo(const RefPtr<KeyHandle>&) const { }
+ virtual void removeSessionReferenceFrom(const RefPtr<KeyHandle>&) const { };
auto begin() { return m_keys.begin(); }
auto begin() const { return m_keys.begin(); }
@@ -144,6 +155,13 @@
Vector<RefPtr<KeyHandle>> m_keys;
};
+class ReferenceAwareKeyStore : public KeyStore {
+public:
+ virtual ~ReferenceAwareKeyStore() = default;
+ void addSessionReferenceTo(const RefPtr<KeyHandle>& key) const final { key->addSessionReference(); }
+ void removeSessionReferenceFrom(const RefPtr<KeyHandle>& key) const final { key->removeSessionReference(); }
+};
+
class CDMInstanceProxy;
class CDMProxyDecryptionClient;
@@ -155,7 +173,8 @@
virtual ~CDMProxy() = default;
- void updateKeyStore(const KeyStore& newKeyStore);
+ void updateKeyStore(const KeyStore&);
+ void unrefAllKeysFrom(const KeyStore&);
void setInstance(CDMInstanceProxy*);
void abortWaitingForKey() const;
@@ -178,7 +197,7 @@
mutable Condition m_keysCondition;
// FIXME: Duplicated key stores in the instance and the proxy are probably not needed, but simplified
// the initial implementation in terms of threading invariants.
- KeyStore m_keyStore WTF_GUARDED_BY_LOCK(m_keysLock);
+ ReferenceAwareKeyStore m_keyStore WTF_GUARDED_BY_LOCK(m_keysLock);
};
class CDMProxyFactory {
@@ -229,7 +248,7 @@
// Main-thread only.
void mergeKeysFrom(const KeyStore&);
- void removeAllKeysFrom(const KeyStore&);
+ void unrefAllKeysFrom(const KeyStore&);
// Media player query methods - main thread only.
const RefPtr<CDMProxy>& proxy() const { ASSERT(isMainThread()); return m_cdmProxy; }
@@ -248,8 +267,6 @@
MediaPlayer* m_player { nullptr }; // FIXME: MainThread<T>?
std::atomic<int> m_numDecryptorsWaitingForKey { 0 };
-
- KeyStore m_keyStore;
};
class CDMProxyDecryptionClient : public CanMakeWeakPtr<CDMProxyDecryptionClient, WeakPtrFactoryInitialization::Eager> {
Modified: trunk/Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.cpp (279362 => 279363)
--- trunk/Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.cpp 2021-06-29 04:05:14 UTC (rev 279362)
+++ trunk/Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.cpp 2021-06-29 06:11:52 UTC (rev 279363)
@@ -520,8 +520,8 @@
if (parseLicenseReleaseAcknowledgementFormat(*root)) {
LOG(EME, "EME - ClearKey - session %s release acknowledged, clearing all known keys", sessionId.utf8().data());
- parentInstance().removeAllKeysFrom(m_keyStore);
- m_keyStore.removeAllKeys();
+ parentInstance().unrefAllKeysFrom(m_keyStore);
+ m_keyStore.unrefAllKeys();
dispatchCallback(true, std::nullopt, SuccessValue::Succeeded);
return;
}
@@ -599,7 +599,7 @@
message = SharedBuffer::create(messageCString.data(), messageCString.length());
}
- m_keyStore.removeAllKeys();
+ m_keyStore.unrefAllKeys();
dispatchCallback(WTFMove(keyStatusVector), Ref<SharedBuffer>(*message), SuccessValue::Succeeded);
}
Modified: trunk/Source/WebCore/platform/graphics/gstreamer/eme/CDMThunder.cpp (279362 => 279363)
--- trunk/Source/WebCore/platform/graphics/gstreamer/eme/CDMThunder.cpp 2021-06-29 04:05:14 UTC (rev 279362)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/eme/CDMThunder.cpp 2021-06-29 06:11:52 UTC (rev 279363)
@@ -432,7 +432,7 @@
CDMInstanceSession::KeyStatus CDMInstanceSessionThunder::status(const KeyIDType& keyID) const
{
- ThunderKeyStatus status = m_session && !m_sessionID.isEmpty() ? opencdm_session_status(m_session.get(), keyID.data(), keyID.size()) : StatusPending;
+ ThunderKeyStatus status = m_session && !m_sessionID.isEmpty() ? opencdm_session_status(m_session->get(), keyID.data(), keyID.size()) : StatusPending;
switch (status) {
case Usable:
@@ -461,7 +461,7 @@
auto keyStatus = status(keyID);
GST_DEBUG("updated with with key status %s", toString(keyStatus));
- m_doesKeyStoreNeedMerging |= m_keyStore.add(KeyHandle::create(keyStatus, WTFMove(keyID), BoxPtr<OpenCDMSession>()));
+ m_doesKeyStoreNeedMerging |= m_keyStore.add(KeyHandle::create(keyStatus, WTFMove(keyID), BoxPtr<OpenCDMSession>(m_session)));
}
void CDMInstanceSessionThunder::keysUpdateDoneCallback()
@@ -518,8 +518,8 @@
callback(initData.releaseNonNull(), { }, false, Failed);
return;
}
- m_session.reset(session);
- m_sessionID = String::fromUTF8(opencdm_session_id(m_session.get()));
+ m_session = adoptInBoxPtr(session);
+ m_sessionID = String::fromUTF8(opencdm_session_id(m_session->get()));
auto generateChallenge = [this, callback = WTFMove(callback)]() mutable {
ASSERT(isMainThread());
@@ -586,7 +586,7 @@
callback(false, std::nullopt, std::nullopt, std::nullopt, SuccessValue::Failed);
}
});
- if (!m_session || m_sessionID.isEmpty() || opencdm_session_update(m_session.get(), response->data(), response->size()))
+ if (!m_session || m_sessionID.isEmpty() || opencdm_session_update(m_session->get(), response->data(), response->size()))
sessionFailure();
}
@@ -623,7 +623,7 @@
callback(std::nullopt, std::nullopt, std::nullopt, SuccessValue::Failed, sessionLoadFailureFromThunder(response));
}
});
- if (!m_session || m_sessionID.isEmpty() || opencdm_session_load(m_session.get()))
+ if (!m_session || m_sessionID.isEmpty() || opencdm_session_load(m_session->get()))
sessionFailure();
}
@@ -631,8 +631,15 @@
{
ASSERT_UNUSED(sessionID, m_sessionID == sessionID);
- if (m_session && !m_sessionID.isEmpty())
- opencdm_session_close(m_session.get());
+ if (m_session && !m_sessionID.isEmpty()) {
+ opencdm_session_close(m_session->get());
+ m_session = BoxPtr<OpenCDMSession>();
+ auto instance = cdmInstanceThunder();
+ if (instance) {
+ instance->unrefAllKeysFrom(m_keyStore);
+ m_keyStore.unrefAllKeys();
+ }
+ }
callback();
}
@@ -664,7 +671,7 @@
callback(m_keyStore.allKeysAs(MediaKeyStatus::InternalError), std::nullopt, SuccessValue::Failed);
}
});
- if (!m_session || m_sessionID.isEmpty() || opencdm_session_remove(m_session.get()))
+ if (!m_session || m_sessionID.isEmpty() || opencdm_session_remove(m_session->get()))
sessionFailure();
}
Modified: trunk/Source/WebCore/platform/graphics/gstreamer/eme/CDMThunder.h (279362 => 279363)
--- trunk/Source/WebCore/platform/graphics/gstreamer/eme/CDMThunder.h 2021-06-29 04:05:14 UTC (rev 279362)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/eme/CDMThunder.h 2021-06-29 06:11:52 UTC (rev 279363)
@@ -50,8 +50,6 @@
using UniqueThunderSystem = std::unique_ptr<OpenCDMSystem, ThunderSystemDeleter>;
-using UniqueThunderSession = std::unique_ptr<OpenCDMSession, WTF::BoxPtrDeleter<OpenCDMSession>>;
-
} // namespace Thunder
class CDMFactoryThunder final : public CDMFactory, public CDMProxyFactory {
@@ -161,7 +159,7 @@
bool m_doesKeyStoreNeedMerging { false };
InitData m_initData;
OpenCDMSessionCallbacks m_thunderSessionCallbacks { };
- Thunder::UniqueThunderSession m_session;
+ BoxPtr<OpenCDMSession> m_session;
RefPtr<SharedBuffer> m_message;
bool m_needsIndividualization { false };
Vector<ChallengeGeneratedCallback> m_challengeCallbacks;