зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1570369 - Part 4: Use IPDL refcounted for PChromiumCDM, r=jya
Differential Revision: https://phabricator.services.mozilla.com/D40255 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
af25db52b0
Коммит
c67bb3eb29
|
@ -20,7 +20,9 @@ class ChromiumCDMChild : public PChromiumCDMChild,
|
|||
public cdm::Host_9,
|
||||
public cdm::Host_10 {
|
||||
public:
|
||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(ChromiumCDMChild);
|
||||
// Mark AddRef and Release as `final`, as they overload pure virtual
|
||||
// implementations in PChromiumCDMChild.
|
||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(ChromiumCDMChild, final);
|
||||
|
||||
explicit ChromiumCDMChild(GMPContentChild* aPlugin);
|
||||
|
||||
|
|
|
@ -36,7 +36,9 @@ class ChromiumCDMParent final : public PChromiumCDMParent,
|
|||
public:
|
||||
typedef MozPromise<bool, MediaResult, /* IsExclusive = */ true> InitPromise;
|
||||
|
||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(ChromiumCDMParent)
|
||||
// Mark AddRef and Release as `final`, as they overload pure virtual
|
||||
// implementations in PChromiumCDMParent.
|
||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(ChromiumCDMParent, final)
|
||||
|
||||
ChromiumCDMParent(GMPContentParent* aContentParent, uint32_t aPluginId);
|
||||
|
||||
|
|
|
@ -61,15 +61,8 @@ bool GMPContentChild::DeallocPGMPVideoEncoderChild(
|
|||
return true;
|
||||
}
|
||||
|
||||
PChromiumCDMChild* GMPContentChild::AllocPChromiumCDMChild() {
|
||||
ChromiumCDMChild* actor = new ChromiumCDMChild(this);
|
||||
actor->AddRef();
|
||||
return actor;
|
||||
}
|
||||
|
||||
bool GMPContentChild::DeallocPChromiumCDMChild(PChromiumCDMChild* aActor) {
|
||||
static_cast<ChromiumCDMChild*>(aActor)->Release();
|
||||
return true;
|
||||
already_AddRefed<PChromiumCDMChild> GMPContentChild::AllocPChromiumCDMChild() {
|
||||
return MakeAndAddRef<ChromiumCDMChild>(this);
|
||||
}
|
||||
|
||||
mozilla::ipc::IPCResult GMPContentChild::RecvPGMPVideoDecoderConstructor(
|
||||
|
|
|
@ -35,8 +35,7 @@ class GMPContentChild : public PGMPContentChild, public GMPSharedMem {
|
|||
PGMPVideoEncoderChild* AllocPGMPVideoEncoderChild();
|
||||
bool DeallocPGMPVideoEncoderChild(PGMPVideoEncoderChild* aActor);
|
||||
|
||||
PChromiumCDMChild* AllocPChromiumCDMChild();
|
||||
bool DeallocPChromiumCDMChild(PChromiumCDMChild* aActor);
|
||||
already_AddRefed<PChromiumCDMChild> AllocPChromiumCDMChild();
|
||||
|
||||
void ActorDestroy(ActorDestroyReason aWhy) override;
|
||||
void ProcessingError(Result aCode, const char* aReason) override;
|
||||
|
|
|
@ -162,11 +162,11 @@ nsCOMPtr<nsISerialEventTarget> GMPContentParent::GMPEventTarget() {
|
|||
|
||||
already_AddRefed<ChromiumCDMParent> GMPContentParent::GetChromiumCDM() {
|
||||
GMP_LOG("GMPContentParent::GetChromiumCDM(this=%p)", this);
|
||||
PChromiumCDMParent* actor = SendPChromiumCDMConstructor();
|
||||
if (!actor) {
|
||||
|
||||
RefPtr<ChromiumCDMParent> parent = new ChromiumCDMParent(this, GetPluginId());
|
||||
if (!SendPChromiumCDMConstructor(parent)) {
|
||||
return nullptr;
|
||||
}
|
||||
RefPtr<ChromiumCDMParent> parent = static_cast<ChromiumCDMParent*>(actor);
|
||||
|
||||
// TODO: Remove parent from mChromiumCDMs in ChromiumCDMParent::Destroy().
|
||||
mChromiumCDMs.AppendElement(parent);
|
||||
|
@ -209,13 +209,6 @@ nsresult GMPContentParent::GetGMPVideoEncoder(GMPVideoEncoderParent** aGMPVE) {
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
PChromiumCDMParent* GMPContentParent::AllocPChromiumCDMParent() {
|
||||
GMP_LOG("GMPContentParent::AllocPChromiumCDMParent(this=%p)", this);
|
||||
ChromiumCDMParent* parent = new ChromiumCDMParent(this, GetPluginId());
|
||||
NS_ADDREF(parent);
|
||||
return parent;
|
||||
}
|
||||
|
||||
PGMPVideoDecoderParent* GMPContentParent::AllocPGMPVideoDecoderParent(
|
||||
const uint32_t& aDecryptorId) {
|
||||
GMP_LOG("GMPContentParent::AllocPGMPVideoDecoderParent(this=%p)", this);
|
||||
|
@ -224,14 +217,6 @@ PGMPVideoDecoderParent* GMPContentParent::AllocPGMPVideoDecoderParent(
|
|||
return vdp;
|
||||
}
|
||||
|
||||
bool GMPContentParent::DeallocPChromiumCDMParent(PChromiumCDMParent* aActor) {
|
||||
GMP_LOG("GMPContentParent::DeallocPChromiumCDMParent(this=%p, aActor=%p)",
|
||||
this, aActor);
|
||||
ChromiumCDMParent* parent = static_cast<ChromiumCDMParent*>(aActor);
|
||||
NS_RELEASE(parent);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GMPContentParent::DeallocPGMPVideoDecoderParent(
|
||||
PGMPVideoDecoderParent* aActor) {
|
||||
GMP_LOG("GMPContentParent::DeallocPGMPVideoDecoderParent(this=%p, aActor=%p)",
|
||||
|
|
|
@ -76,9 +76,6 @@ class GMPContentParent final : public PGMPContentParent, public GMPSharedMem {
|
|||
PGMPVideoEncoderParent* AllocPGMPVideoEncoderParent() override;
|
||||
bool DeallocPGMPVideoEncoderParent(PGMPVideoEncoderParent* aActor) override;
|
||||
|
||||
PChromiumCDMParent* AllocPChromiumCDMParent() override;
|
||||
bool DeallocPChromiumCDMParent(PChromiumCDMParent* aActor) override;
|
||||
|
||||
void CloseIfUnused();
|
||||
// Needed because NewRunnableMethod tried to use the class that the method
|
||||
// lives on to store the receiver, but PGMPContentParent isn't refcounted.
|
||||
|
|
|
@ -9,7 +9,7 @@ include GMPTypes;
|
|||
namespace mozilla {
|
||||
namespace gmp {
|
||||
|
||||
async protocol PChromiumCDM
|
||||
async refcounted protocol PChromiumCDM
|
||||
{
|
||||
manager PGMPContent;
|
||||
child:
|
||||
|
|
Загрузка…
Ссылка в новой задаче