diff --git a/dom/media/gmp/GMPDecryptorParent.cpp b/dom/media/gmp/GMPDecryptorParent.cpp index 41631e6d9824..18ecce8d55ab 100644 --- a/dom/media/gmp/GMPDecryptorParent.cpp +++ b/dom/media/gmp/GMPDecryptorParent.cpp @@ -16,8 +16,11 @@ GMPDecryptorParent::GMPDecryptorParent(GMPParent* aPlugin) , mShuttingDown(false) , mPlugin(aPlugin) , mCallback(nullptr) +#ifdef DEBUG + , mGMPThread(aPlugin->GMPThread()) +#endif { - MOZ_ASSERT(mPlugin); + MOZ_ASSERT(mPlugin && mGMPThread); } GMPDecryptorParent::~GMPDecryptorParent() @@ -312,7 +315,7 @@ GMPDecryptorParent::RecvDecrypted(const uint32_t& aId, void GMPDecryptorParent::Close() { - MOZ_ASSERT(mPlugin->GMPThread() == NS_GetCurrentThread()); + MOZ_ASSERT(mGMPThread == NS_GetCurrentThread()); // Consumer is done with us; we can shut down. No more callbacks should // be made to mCallback. Note: do this before Shutdown()! mCallback = nullptr; @@ -320,14 +323,14 @@ GMPDecryptorParent::Close() // In case this is the last reference nsRefPtr kungfudeathgrip(this); - NS_RELEASE(kungfudeathgrip); + this->Release(); Shutdown(); } void GMPDecryptorParent::Shutdown() { - MOZ_ASSERT(mPlugin->GMPThread() == NS_GetCurrentThread()); + MOZ_ASSERT(mGMPThread == NS_GetCurrentThread()); if (mShuttingDown) { return; diff --git a/dom/media/gmp/GMPDecryptorParent.h b/dom/media/gmp/GMPDecryptorParent.h index 987c17358cbf..5cc1d8461f6d 100644 --- a/dom/media/gmp/GMPDecryptorParent.h +++ b/dom/media/gmp/GMPDecryptorParent.h @@ -109,6 +109,9 @@ private: bool mShuttingDown; nsRefPtr mPlugin; GMPDecryptorProxyCallback* mCallback; +#ifdef DEBUG + nsIThread* const mGMPThread; +#endif }; } // namespace gmp