зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1072024 - Destroy uninitialized GMP objects - r=cpearce
This commit is contained in:
Родитель
93b110ea4a
Коммит
3e448dc9d3
|
@ -31,6 +31,7 @@ namespace gmp {
|
|||
|
||||
GMPAudioDecoderParent::GMPAudioDecoderParent(GMPParent* aPlugin)
|
||||
: mIsOpen(false)
|
||||
, mShuttingDown(false)
|
||||
, mPlugin(aPlugin)
|
||||
, mCallback(nullptr)
|
||||
{
|
||||
|
@ -161,17 +162,19 @@ GMPAudioDecoderParent::Shutdown()
|
|||
LOGD(("%s: %p", __FUNCTION__, this));
|
||||
MOZ_ASSERT(mPlugin->GMPThread() == NS_GetCurrentThread());
|
||||
|
||||
if (mShuttingDown) {
|
||||
return NS_OK;
|
||||
}
|
||||
mShuttingDown = true;
|
||||
|
||||
// Notify client we're gone! Won't occur after Close()
|
||||
if (mCallback) {
|
||||
mCallback->Terminated();
|
||||
mCallback = nullptr;
|
||||
}
|
||||
|
||||
if (mIsOpen) {
|
||||
// Don't send DecodingComplete if we died
|
||||
mIsOpen = false;
|
||||
unused << SendDecodingComplete();
|
||||
}
|
||||
mIsOpen = false;
|
||||
unused << SendDecodingComplete();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -53,6 +53,7 @@ private:
|
|||
virtual bool Recv__delete__() MOZ_OVERRIDE;
|
||||
|
||||
bool mIsOpen;
|
||||
bool mShuttingDown;
|
||||
nsRefPtr<GMPParent> mPlugin;
|
||||
GMPAudioDecoderProxyCallback* mCallback;
|
||||
};
|
||||
|
|
|
@ -13,6 +13,7 @@ namespace gmp {
|
|||
|
||||
GMPDecryptorParent::GMPDecryptorParent(GMPParent* aPlugin)
|
||||
: mIsOpen(false)
|
||||
, mShuttingDown(false)
|
||||
, mPlugin(aPlugin)
|
||||
, mCallback(nullptr)
|
||||
{
|
||||
|
@ -328,16 +329,19 @@ GMPDecryptorParent::Shutdown()
|
|||
{
|
||||
MOZ_ASSERT(mPlugin->GMPThread() == NS_GetCurrentThread());
|
||||
|
||||
if (mShuttingDown) {
|
||||
return;
|
||||
}
|
||||
mShuttingDown = true;
|
||||
|
||||
// Notify client we're gone! Won't occur after Close()
|
||||
if (mCallback) {
|
||||
mCallback->Terminated();
|
||||
mCallback = nullptr;
|
||||
}
|
||||
|
||||
if (mIsOpen) {
|
||||
mIsOpen = false;
|
||||
unused << SendDecryptingComplete();
|
||||
}
|
||||
mIsOpen = false;
|
||||
unused << SendDecryptingComplete();
|
||||
}
|
||||
|
||||
// Note: Keep this sync'd up with Shutdown
|
||||
|
|
|
@ -106,6 +106,7 @@ private:
|
|||
virtual bool Recv__delete__() MOZ_OVERRIDE;
|
||||
|
||||
bool mIsOpen;
|
||||
bool mShuttingDown;
|
||||
nsRefPtr<GMPParent> mPlugin;
|
||||
GMPDecryptorProxyCallback* mCallback;
|
||||
};
|
||||
|
|
|
@ -45,6 +45,7 @@ namespace gmp {
|
|||
GMPVideoDecoderParent::GMPVideoDecoderParent(GMPParent* aPlugin)
|
||||
: GMPSharedMemManager(aPlugin)
|
||||
, mIsOpen(false)
|
||||
, mShuttingDown(false)
|
||||
, mPlugin(aPlugin)
|
||||
, mCallback(nullptr)
|
||||
, mVideoHost(MOZ_THIS_IN_INITIALIZER_LIST())
|
||||
|
@ -187,6 +188,11 @@ GMPVideoDecoderParent::Shutdown()
|
|||
LOGD(("%s: %p", __FUNCTION__, this));
|
||||
MOZ_ASSERT(mPlugin->GMPThread() == NS_GetCurrentThread());
|
||||
|
||||
if (mShuttingDown) {
|
||||
return NS_OK;
|
||||
}
|
||||
mShuttingDown = true;
|
||||
|
||||
// Notify client we're gone! Won't occur after Close()
|
||||
if (mCallback) {
|
||||
mCallback->Terminated();
|
||||
|
@ -194,11 +200,8 @@ GMPVideoDecoderParent::Shutdown()
|
|||
}
|
||||
mVideoHost.DoneWithAPI();
|
||||
|
||||
if (mIsOpen) {
|
||||
// Don't send DecodingComplete if we died
|
||||
mIsOpen = false;
|
||||
unused << SendDecodingComplete();
|
||||
}
|
||||
mIsOpen = false;
|
||||
unused << SendDecodingComplete();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -77,6 +77,7 @@ private:
|
|||
virtual bool Recv__delete__() MOZ_OVERRIDE;
|
||||
|
||||
bool mIsOpen;
|
||||
bool mShuttingDown;
|
||||
nsRefPtr<GMPParent> mPlugin;
|
||||
GMPVideoDecoderCallbackProxy* mCallback;
|
||||
GMPVideoHostImpl mVideoHost;
|
||||
|
|
|
@ -52,6 +52,7 @@ namespace gmp {
|
|||
GMPVideoEncoderParent::GMPVideoEncoderParent(GMPParent *aPlugin)
|
||||
: GMPSharedMemManager(aPlugin),
|
||||
mIsOpen(false),
|
||||
mShuttingDown(false),
|
||||
mPlugin(aPlugin),
|
||||
mCallback(nullptr),
|
||||
mVideoHost(MOZ_THIS_IN_INITIALIZER_LIST())
|
||||
|
@ -220,17 +221,20 @@ GMPVideoEncoderParent::Shutdown()
|
|||
LOGD(("%s::%s: %p", __CLASS__, __FUNCTION__, this));
|
||||
MOZ_ASSERT(mPlugin->GMPThread() == NS_GetCurrentThread());
|
||||
|
||||
if (mShuttingDown) {
|
||||
return;
|
||||
}
|
||||
mShuttingDown = true;
|
||||
|
||||
// Notify client we're gone! Won't occur after Close()
|
||||
if (mCallback) {
|
||||
mCallback->Terminated();
|
||||
mCallback = nullptr;
|
||||
}
|
||||
mVideoHost.DoneWithAPI();
|
||||
if (mIsOpen) {
|
||||
// Don't send EncodingComplete if we died
|
||||
mIsOpen = false;
|
||||
unused << SendEncodingComplete();
|
||||
}
|
||||
|
||||
mIsOpen = false;
|
||||
unused << SendEncodingComplete();
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -74,6 +74,7 @@ private:
|
|||
virtual bool Recv__delete__() MOZ_OVERRIDE;
|
||||
|
||||
bool mIsOpen;
|
||||
bool mShuttingDown;
|
||||
nsRefPtr<GMPParent> mPlugin;
|
||||
GMPVideoEncoderCallbackProxy* mCallback;
|
||||
GMPVideoHostImpl mVideoHost;
|
||||
|
|
Загрузка…
Ссылка в новой задаче