diff --git a/gfx/layers/ipc/PUiCompositorController.ipdl b/gfx/layers/ipc/PUiCompositorController.ipdl index a4054cff1384..2ccbd35222c9 100644 --- a/gfx/layers/ipc/PUiCompositorController.ipdl +++ b/gfx/layers/ipc/PUiCompositorController.ipdl @@ -20,7 +20,7 @@ namespace layers { * compositor from the UI thread. Primarily used on Android to coordinate registering and * releasing the surface with the compositor. */ -[ManualDealloc, NeedsOtherPid] +[NeedsOtherPid] sync protocol PUiCompositorController { diff --git a/gfx/layers/ipc/UiCompositorControllerChild.cpp b/gfx/layers/ipc/UiCompositorControllerChild.cpp index 8754f3d4825b..a87c2055db6c 100644 --- a/gfx/layers/ipc/UiCompositorControllerChild.cpp +++ b/gfx/layers/ipc/UiCompositorControllerChild.cpp @@ -200,13 +200,6 @@ void UiCompositorControllerChild::ActorDestroy(ActorDestroyReason aWhy) { } } -void UiCompositorControllerChild::ActorDealloc() { - if (mParent) { - mParent = nullptr; - } - Release(); -} - void UiCompositorControllerChild::ProcessingError(Result aCode, const char* aReason) { if (aCode != MsgDropped) { @@ -272,7 +265,6 @@ void UiCompositorControllerChild::OpenForSameProcess() { } mParent->InitializeForSameProcess(); - AddRef(); SendCachedValues(); // Let Ui thread know the connection is open; RecvToolbarAnimatorMessageFromCompositor(COMPOSITOR_CONTROLLER_OPEN); @@ -293,7 +285,6 @@ void UiCompositorControllerChild::OpenForGPUProcess( return; } - AddRef(); SendCachedValues(); // Let Ui thread know the connection is open; RecvToolbarAnimatorMessageFromCompositor(COMPOSITOR_CONTROLLER_OPEN); diff --git a/gfx/layers/ipc/UiCompositorControllerChild.h b/gfx/layers/ipc/UiCompositorControllerChild.h index e2072713f570..fa0b6e44c1a6 100644 --- a/gfx/layers/ipc/UiCompositorControllerChild.h +++ b/gfx/layers/ipc/UiCompositorControllerChild.h @@ -29,7 +29,7 @@ class UiCompositorControllerChild final friend class PUiCompositorControllerChild; public: - NS_INLINE_DECL_THREADSAFE_REFCOUNTING(UiCompositorControllerChild) + NS_INLINE_DECL_THREADSAFE_REFCOUNTING(UiCompositorControllerChild, final) static RefPtr CreateForSameProcess( const LayersId& aRootLayerTreeId, nsBaseWidget* aWidget); @@ -76,7 +76,6 @@ class UiCompositorControllerChild final protected: void ActorDestroy(ActorDestroyReason aWhy) override; - void ActorDealloc() override; void ProcessingError(Result aCode, const char* aReason) override; void HandleFatalError(const char* aMsg) const override; mozilla::ipc::IPCResult RecvToolbarAnimatorMessageFromCompositor( diff --git a/gfx/layers/ipc/UiCompositorControllerParent.cpp b/gfx/layers/ipc/UiCompositorControllerParent.cpp index 0f56120cd15a..783f6b2e33d9 100644 --- a/gfx/layers/ipc/UiCompositorControllerParent.cpp +++ b/gfx/layers/ipc/UiCompositorControllerParent.cpp @@ -163,12 +163,9 @@ UiCompositorControllerParent::RecvEnableLayerUpdateNotifications( return IPC_OK(); } -void UiCompositorControllerParent::ActorDestroy(ActorDestroyReason aWhy) {} - -void UiCompositorControllerParent::ActorDealloc() { +void UiCompositorControllerParent::ActorDestroy(ActorDestroyReason aWhy) { MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread()); Shutdown(); - Release(); // For AddRef in Initialize() } void UiCompositorControllerParent::ToolbarAnimatorMessageFromCompositor( @@ -263,7 +260,6 @@ void UiCompositorControllerParent::InitializeForOutOfProcess() { void UiCompositorControllerParent::Initialize() { MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread()); - AddRef(); LayerTreeState* state = CompositorBridgeParent::GetIndirectShadowTree(mRootLayerTreeId); MOZ_ASSERT(state); diff --git a/gfx/layers/ipc/UiCompositorControllerParent.h b/gfx/layers/ipc/UiCompositorControllerParent.h index 2093a92c1034..d7f2df064898 100644 --- a/gfx/layers/ipc/UiCompositorControllerParent.h +++ b/gfx/layers/ipc/UiCompositorControllerParent.h @@ -23,7 +23,7 @@ class UiCompositorControllerParent final friend class UiCompositorControllerChild; public: - NS_INLINE_DECL_THREADSAFE_REFCOUNTING(UiCompositorControllerParent) + NS_INLINE_DECL_THREADSAFE_REFCOUNTING(UiCompositorControllerParent, final) static RefPtr GetFromRootLayerTreeId( const LayersId& aRootLayerTreeId); @@ -46,7 +46,6 @@ class UiCompositorControllerParent final mozilla::ipc::IPCResult RecvEnableLayerUpdateNotifications( const bool& aEnable); void ActorDestroy(ActorDestroyReason aWhy) override; - void ActorDealloc() override; // Class specific functions void ToolbarAnimatorMessageFromCompositor(int32_t aMessage);