void CDMProxy::OnSessionMessage(const nsAString& aSessionId, GMPSessionMessageType aMessageType, nsTArray<uint8_t>& aMessage) { MOZ_ASSERT(NS_IsMainThread()); if (mKeys.IsNull()) { return; } RefPtr<dom::MediaKeySession> session(mKeys->GetSession(aSessionId)); if (session) { session->DispatchKeyMessage(ToMediaKeyMessageType(aMessageType), aMessage); } }
mozilla::ipc::IPCResult GMPDecryptorParent::RecvSessionMessage(const nsCString& aSessionId, const GMPSessionMessageType& aMessageType, nsTArray<uint8_t>&& aMessage) { LOGD(("GMPDecryptorParent[%p]::RecvSessionMessage(sessionId='%s', type=%d, msg='%s')", this, aSessionId.get(), aMessageType, ToBase64(aMessage).get())); if (!mIsOpen) { NS_WARNING("Trying to use a dead GMP decrypter!"); return IPC_FAIL_NO_REASON(this); } mCallback->SessionMessage(aSessionId, ToMediaKeyMessageType(aMessageType), aMessage); return IPC_OK(); }
bool GMPDecryptorParent::RecvSessionMessage(const nsCString& aSessionId, const GMPSessionMessageType& aMessageType, nsTArray<uint8_t>&& aMessage) { LOGD(("GMPDecryptorParent[%p]::RecvSessionMessage(sessionId='%s', type=%d, msg='%s')", this, aSessionId.get(), aMessageType, ToBase64(aMessage).get())); if (!mIsOpen) { NS_WARNING("Trying to use a dead GMP decrypter!"); return false; } mCallback->SessionMessage(aSessionId, ToMediaKeyMessageType(aMessageType), aMessage); return true; }
NS_IMETHOD Run() { mProxy->OnSessionMessage(mSid, ToMediaKeyMessageType(mMsgType), mMsg); return NS_OK; }