Ejemplo n.º 1
0
void
GlobalAllocPolicy::Dealloc()
{
  ReentrantMonitorAutoEnter mon(mMonitor);
  ++mDecoderLimit;
  ResolvePromise(mon);
}
Ejemplo n.º 2
0
void
CDMProxy::SetServerCertificate(PromiseId aPromiseId,
                               const Uint8Array& aCertData)
{
  MOZ_ASSERT(NS_IsMainThread());
  MOZ_ASSERT(mGMPThread);

  // TODO: Dispatch task to GMPThread to call CDM SetServerCertificate via IPC.

  ResolvePromise(aPromiseId);
}
Ejemplo n.º 3
0
void
CDMProxy::CloseSession(const nsAString& aSessionId,
                       PromiseId aPromiseId)
{
  MOZ_ASSERT(NS_IsMainThread());
  NS_ENSURE_TRUE_VOID(!mKeys.IsNull());

  // TODO: Dispatch task to GMPThread to call CDM CloseSession via IPC.

  nsRefPtr<dom::MediaKeySession> session(mKeys->GetSession(aSessionId));

  // Pretend that the CDM actually does close the session...
  // "...the [MediaKeySession's] closed attribute promise is resolved
  // when the session is closed."
  session->OnClosed();

  // "The promise is resolved when the request has been processed."
  ResolvePromise(aPromiseId);
}
Ejemplo n.º 4
0
void
CDMProxy::UpdateSession(const nsAString& aSessionId,
                        PromiseId aPromiseId,
                        const Uint8Array& aResponse)
{
  MOZ_ASSERT(NS_IsMainThread());
  MOZ_ASSERT(mGMPThread);
  NS_ENSURE_TRUE_VOID(!mKeys.IsNull());

  // TODO: Dispatch task to GMPThread to call CDM UpdateSession via IPC.

  nsRefPtr<dom::MediaKeySession> session(mKeys->GetSession(aSessionId));
  nsAutoCString str(NS_LITERAL_CSTRING("Update_"));
  str.AppendInt(sUpdateCount++);
  nsTArray<uint8_t> msg;
  msg.AppendElements(str.get(), str.Length());
  session->DispatchKeyMessage(msg, NS_LITERAL_STRING("http://bogus.url"));
  ResolvePromise(aPromiseId);
}