Skip to content

Commit

Permalink
Bug 1824465 - Part 7: Make PRemoteDecoderManager refcounted, r=ipc-re…
Browse files Browse the repository at this point in the history
…viewers,mccr8

Differential Revision: https://phabricator.services.mozilla.com/D173722
  • Loading branch information
mystor committed Apr 19, 2023
1 parent a838c2c commit b29589e
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 15 deletions.
2 changes: 1 addition & 1 deletion dom/media/ipc/PRemoteDecoderManager.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ union RemoteDecoderInfoIPDL
VideoDecoderInfoIPDL;
};

[ManualDealloc, NeedsOtherPid]
[NeedsOtherPid]
sync protocol PRemoteDecoderManager
{
manages PRemoteDecoder;
Expand Down
5 changes: 0 additions & 5 deletions dom/media/ipc/RemoteDecoderManagerChild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -768,15 +768,10 @@ void RemoteDecoderManagerChild::OpenRemoteDecoderManagerChildForProcess(
new RemoteDecoderManagerChild(aLocation);
if (aEndpoint.Bind(manager)) {
remoteDecoderManagerChild = manager;
manager->InitIPDL();
}
}
}

void RemoteDecoderManagerChild::InitIPDL() { mIPDLSelfRef = this; }

void RemoteDecoderManagerChild::ActorDealloc() { mIPDLSelfRef = nullptr; }

bool RemoteDecoderManagerChild::DeallocShmem(mozilla::ipc::Shmem& aShmem) {
nsCOMPtr<nsISerialEventTarget> managerThread = GetManagerThread();
if (!managerThread) {
Expand Down
5 changes: 0 additions & 5 deletions dom/media/ipc/RemoteDecoderManagerChild.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,6 @@ class RemoteDecoderManagerChild final
RemoteDecodeIn aLocation);

protected:
void InitIPDL();

void ActorDealloc() override;

void HandleFatalError(const char* aMsg) const override;

PRemoteDecoderChild* AllocPRemoteDecoderChild(
Expand Down Expand Up @@ -140,7 +136,6 @@ class RemoteDecoderManagerChild final
// A thread-safe method to launch the RDD process if it hasn't launched yet.
static RefPtr<GenericNonExclusivePromise> LaunchRDDProcessIfNeeded();

RefPtr<RemoteDecoderManagerChild> mIPDLSelfRef;
// The location for decoding, Rdd or Gpu process.
const RemoteDecodeIn mLocation;
};
Expand Down
3 changes: 0 additions & 3 deletions dom/media/ipc/RemoteDecoderManagerParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,11 +277,8 @@ void RemoteDecoderManagerParent::Open(
// We can't recover from this.
MOZ_CRASH("Failed to bind RemoteDecoderManagerParent to endpoint");
}
AddRef();
}

void RemoteDecoderManagerParent::ActorDealloc() { Release(); }

mozilla::ipc::IPCResult RemoteDecoderManagerParent::RecvReadback(
const SurfaceDescriptorGPUVideo& aSD, SurfaceDescriptor* aResult) {
const SurfaceDescriptorRemoteDecoder& sd = aSD;
Expand Down
1 change: 0 additions & 1 deletion dom/media/ipc/RemoteDecoderManagerParent.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ class RemoteDecoderManagerParent final
const SurfaceDescriptorGPUVideo& aSD);

void ActorDestroy(mozilla::ipc::IProtocol::ActorDestroyReason) override;
void ActorDealloc() override;

private:
explicit RemoteDecoderManagerParent(nsISerialEventTarget* aThread);
Expand Down

0 comments on commit b29589e

Please sign in to comment.