Exemplo n.º 1
0
bool
GMPContentChild::RecvPGMPDecryptorConstructor(PGMPDecryptorChild* aActor)
{
  GMPDecryptorChild* child = static_cast<GMPDecryptorChild*>(aActor);
  GMPDecryptorHost* host = static_cast<GMPDecryptorHost*>(child);

  void* session = nullptr;
  GMPErr err = mGMPChild->GetAPI(GMP_API_DECRYPTOR, host, &session);
  if (err != GMPNoErr || !session) {
    // We Adapt the previous GMPDecryptor version to the current, so that
    // Gecko thinks it's only talking to the current version. Helpfully,
    // v7 is ABI compatible with v8, it only has different enumerations.
    // If the GMP uses a v8-only enum value in an IPDL message, the IPC
    // layer will terminate, so we rev'd the API version to signal to the
    // GMP that it's safe to use the new enum values.
    err = mGMPChild->GetAPI(GMP_API_DECRYPTOR_BACKWARDS_COMPAT, host, &session);
    if (err != GMPNoErr || !session) {
      return false;
    }
  }

  child->Init(static_cast<GMPDecryptor*>(session));

  return true;
}
Exemplo n.º 2
0
PGMPDecryptorChild*
GMPContentChild::AllocPGMPDecryptorChild()
{
  GMPDecryptorChild* actor = new GMPDecryptorChild(this,
                                                   mGMPChild->mPluginVoucher,
                                                   mGMPChild->mSandboxVoucher);
  actor->AddRef();
  return actor;
}
Exemplo n.º 3
0
bool
GMPContentChild::RecvPGMPDecryptorConstructor(PGMPDecryptorChild* aActor)
{
  GMPDecryptorChild* child = static_cast<GMPDecryptorChild*>(aActor);
  GMPDecryptorHost* host = static_cast<GMPDecryptorHost*>(child);

  void* session = nullptr;
  GMPErr err = mGMPChild->GetAPI(GMP_API_DECRYPTOR, host, &session);
  if (err != GMPNoErr || !session) {
    return false;
  }

  child->Init(static_cast<GMPDecryptor*>(session));

  return true;
}