mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1047107 - Make CDMProxy Close() its GMPDecryptorProxy on Shutdown. r=ehsan
This commit is contained in:
parent
59b45ae708
commit
b7a84dcba6
@ -302,6 +302,19 @@ CDMProxy::Shutdown()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
mKeys.Clear();
|
||||
// Note: This may end up being the last owning reference to the CDMProxy.
|
||||
nsRefPtr<nsIRunnable> task(NS_NewRunnableMethod(this, &CDMProxy::gmp_Shutdown));
|
||||
mGMPThread->Dispatch(task, NS_DISPATCH_NORMAL);
|
||||
}
|
||||
|
||||
void
|
||||
CDMProxy::gmp_Shutdown()
|
||||
{
|
||||
MOZ_ASSERT(IsOnGMPThread());
|
||||
if (mCDM) {
|
||||
mCDM->Close();
|
||||
mCDM = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -485,10 +498,7 @@ CDMProxy::gmp_Terminated()
|
||||
{
|
||||
MOZ_ASSERT(IsOnGMPThread());
|
||||
EME_LOG("CDM terminated");
|
||||
if (mCDM) {
|
||||
mCDM->Close();
|
||||
mCDM = nullptr;
|
||||
}
|
||||
gmp_Shutdown();
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
@ -167,6 +167,9 @@ private:
|
||||
// GMP thread only.
|
||||
void gmp_Init(uint32_t aPromiseId);
|
||||
|
||||
// GMP thread only.
|
||||
void gmp_Shutdown();
|
||||
|
||||
// Main thread only.
|
||||
void OnCDMCreated(uint32_t aPromiseId);
|
||||
|
||||
|
@ -44,12 +44,24 @@ MediaKeys::MediaKeys(nsPIDOMWindow* aParent, const nsAString& aKeySystem)
|
||||
SetIsDOMBinding();
|
||||
}
|
||||
|
||||
static PLDHashOperator
|
||||
RejectPromises(const uint32_t& aKey,
|
||||
nsRefPtr<dom::Promise>& aPromise,
|
||||
void* aClosure)
|
||||
{
|
||||
aPromise->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR);
|
||||
return PL_DHASH_NEXT;
|
||||
}
|
||||
|
||||
MediaKeys::~MediaKeys()
|
||||
{
|
||||
if (mProxy) {
|
||||
mProxy->Shutdown();
|
||||
mProxy = nullptr;
|
||||
}
|
||||
|
||||
mPromises.Enumerate(&RejectPromises, nullptr);
|
||||
mPromises.Clear();
|
||||
}
|
||||
|
||||
nsPIDOMWindow*
|
||||
|
Loading…
Reference in New Issue
Block a user