void GMPDecryptorChild::Decrypted(GMPBuffer* aBuffer, GMPErr aResult) { if (!ON_GMP_THREAD()) { // We should run this whole method on the GMP thread since the buffer needs // to be deleted after the SendDecrypted call. mPlugin->GMPMessageLoop()->PostTask( NewRunnableMethod<GMPBuffer*, GMPErr>("gmp::GMPDecryptorChild::Decrypted", this, &GMPDecryptorChild::Decrypted, aBuffer, aResult)); return; } if (!aBuffer) { NS_WARNING("GMPDecryptorCallback passed bull GMPBuffer"); return; } auto buffer = static_cast<GMPBufferImpl*>(aBuffer); if (mSession) { SendDecrypted(buffer->mId, aResult, buffer->mData); } delete buffer; }
void GMPDecryptorChild::Decrypted(GMPBuffer* aBuffer, GMPErr aResult) { if (!ON_GMP_THREAD()) { // We should run this whole method on the GMP thread since the buffer needs // to be deleted after the SendDecrypted call. CALL_ON_GMP_THREAD(Decrypted, aBuffer, aResult); return; } if (!aBuffer) { NS_WARNING("GMPDecryptorCallback passed bull GMPBuffer"); return; } auto buffer = static_cast<GMPBufferImpl*>(aBuffer); SendDecrypted(buffer->mId, aResult, buffer->mData); delete buffer; }