void GMPDecryptorChild::SessionClosed(const char* aSessionId, uint32_t aSessionIdLength) { CALL_ON_GMP_THREAD(SendSessionClosed, nsCString(aSessionId, aSessionIdLength)); }
GMPErr GMPStorageChild::Write(GMPRecordImpl* aRecord, const uint8_t* aData, uint32_t aDataSize) { if (aDataSize > GMP_MAX_RECORD_SIZE) { return GMPQuotaExceededErr; } MonitorAutoLock lock(mMonitor); if (mShutdown) { NS_WARNING("GMPStorage used after it's been shutdown!"); return GMPClosedErr; } if (!HasRecord(aRecord->Name())) { // Record not opened. return GMPClosedErr; } CALL_ON_GMP_THREAD(SendWrite, aRecord->Name(), ToArray(aData, aDataSize)); return GMPNoErr; }
void GMPDecryptorChild::ResolveNewSessionPromise(uint32_t aPromiseId, const char* aSessionId, uint32_t aSessionIdLength) { CALL_ON_GMP_THREAD(SendResolveNewSessionPromise, aPromiseId, nsAutoCString(aSessionId, aSessionIdLength)); }
void GMPDecryptorChild::ExpirationChange(const char* aSessionId, uint32_t aSessionIdLength, GMPTimestamp aExpiryTime) { CALL_ON_GMP_THREAD(SendExpirationChange, nsCString(aSessionId, aSessionIdLength), aExpiryTime); }
void GMPDecryptorChild::SetSessionId(uint32_t aCreateSessionToken, const char* aSessionId, uint32_t aSessionIdLength) { CALL_ON_GMP_THREAD(SendSetSessionId, aCreateSessionToken, nsCString(aSessionId, aSessionIdLength)); }
void GMPDecryptorChild::RejectPromise(uint32_t aPromiseId, GMPDOMException aException, const char* aMessage, uint32_t aMessageLength) { CALL_ON_GMP_THREAD(SendRejectPromise, aPromiseId, aException, nsCString(aMessage, aMessageLength)); }
void GMPDecryptorChild::KeyIdNotUsable(const char* aSessionId, uint32_t aSessionIdLength, const uint8_t* aKeyId, uint32_t aKeyIdLength) { nsAutoTArray<uint8_t, 16> kid; kid.AppendElements(aKeyId, aKeyIdLength); CALL_ON_GMP_THREAD(SendKeyIdNotUsable, nsAutoCString(aSessionId, aSessionIdLength), kid); }
void GMPDecryptorChild::SessionError(const char* aSessionId, uint32_t aSessionIdLength, GMPDOMException aException, uint32_t aSystemCode, const char* aMessage, uint32_t aMessageLength) { CALL_ON_GMP_THREAD(SendSessionError, nsCString(aSessionId, aSessionIdLength), aException, aSystemCode, nsCString(aMessage, aMessageLength)); }
void GMPDecryptorChild::KeyStatusChanged(const char* aSessionId, uint32_t aSessionIdLength, const uint8_t* aKeyId, uint32_t aKeyIdLength, GMPMediaKeyStatus aStatus) { AutoTArray<uint8_t, 16> kid; kid.AppendElements(aKeyId, aKeyIdLength); CALL_ON_GMP_THREAD(SendKeyStatusChanged, nsCString(aSessionId, aSessionIdLength), kid, aStatus); }
void GMPDecryptorChild::SessionMessage(const char* aSessionId, uint32_t aSessionIdLength, GMPSessionMessageType aMessageType, const uint8_t* aMessage, uint32_t aMessageLength) { nsTArray<uint8_t> msg; msg.AppendElements(aMessage, aMessageLength); CALL_ON_GMP_THREAD(SendSessionMessage, nsCString(aSessionId, aSessionIdLength), aMessageType, Move(msg)); }
void GMPDecryptorChild::SessionMessage(const char* aSessionId, uint32_t aSessionIdLength, const uint8_t* aMessage, uint32_t aMessageLength, const char* aDestinationURL, uint32_t aDestinationURLLength) { nsTArray<uint8_t> msg; msg.AppendElements(aMessage, aMessageLength); CALL_ON_GMP_THREAD(SendSessionMessage, nsAutoCString(aSessionId, aSessionIdLength), msg, nsAutoCString(aDestinationURL, aDestinationURLLength)); }
void GMPDecryptorChild::BatchedKeyStatusChanged(const char* aSessionId, uint32_t aSessionIdLength, const GMPMediaKeyInfo* aKeyInfos, uint32_t aKeyInfosLength) { nsTArray<GMPKeyInformation> keyInfos; for (uint32_t i = 0; i < aKeyInfosLength; i++) { nsTArray<uint8_t> keyId; keyId.AppendElements(aKeyInfos[i].keyid, aKeyInfos[i].keyid_size); keyInfos.AppendElement(GMPKeyInformation(keyId, aKeyInfos[i].status)); } CALL_ON_GMP_THREAD(SendBatchedKeyStatusChanged, nsCString(aSessionId, aSessionIdLength), keyInfos); }
GMPErr GMPStorageChild::Close(const nsCString& aRecordName) { MonitorAutoLock lock(mMonitor); if (!HasRecord(aRecordName)) { // Already closed. return GMPClosedErr; } mRecords.Remove(aRecordName); if (!mShutdown) { CALL_ON_GMP_THREAD(SendClose, aRecordName); } return GMPNoErr; }
GMPErr GMPStorageChild::EnumerateRecords(RecvGMPRecordIteratorPtr aRecvIteratorFunc, void* aUserArg) { MonitorAutoLock lock(mMonitor); if (mShutdown) { NS_WARNING("GMPStorage used after it's been shutdown!"); return GMPClosedErr; } MOZ_ASSERT(aRecvIteratorFunc); mPendingRecordIterators.push(RecordIteratorContext(aRecvIteratorFunc, aUserArg)); CALL_ON_GMP_THREAD(SendGetRecordNames); return GMPNoErr; }
GMPErr GMPStorageChild::Open(GMPRecordImpl* aRecord) { MonitorAutoLock lock(mMonitor); if (mShutdown) { NS_WARNING("GMPStorage used after it's been shutdown!"); return GMPClosedErr; } if (!HasRecord(aRecord->Name())) { // Trying to re-open a record that has already been closed. return GMPClosedErr; } CALL_ON_GMP_THREAD(SendOpen, aRecord->Name()); return GMPNoErr; }
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; }
GMPErr GMPStorageChild::Read(GMPRecordImpl* aRecord) { MonitorAutoLock lock(mMonitor); if (mShutdown) { NS_WARNING("GMPStorage used after it's been shutdown!"); return GMPClosedErr; } if (!HasRecord(aRecord->Name())) { // Record not opened. return GMPClosedErr; } CALL_ON_GMP_THREAD(SendRead, aRecord->Name()); return GMPNoErr; }
void GMPDecryptorChild::ResolvePromise(uint32_t aPromiseId) { CALL_ON_GMP_THREAD(SendResolvePromise, aPromiseId); }
void GMPDecryptorChild::ResolveLoadSessionPromise(uint32_t aPromiseId, bool aSuccess) { CALL_ON_GMP_THREAD(SendResolveLoadSessionPromise, aPromiseId, aSuccess); }
void GMPDecryptorChild::SetCapabilities(uint64_t aCaps) { CALL_ON_GMP_THREAD(SendSetCaps, aCaps); }