From a90a5cba08fdf6c0ceb95101c275108a152a3aed Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 07:35:37 +0200 Subject: Merging upstream version 127.0. Signed-off-by: Daniel Baumann --- gfx/layers/ipc/APZInputBridgeParent.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'gfx/layers/ipc/APZInputBridgeParent.cpp') diff --git a/gfx/layers/ipc/APZInputBridgeParent.cpp b/gfx/layers/ipc/APZInputBridgeParent.cpp index fcc642ff7a..475c15abca 100644 --- a/gfx/layers/ipc/APZInputBridgeParent.cpp +++ b/gfx/layers/ipc/APZInputBridgeParent.cpp @@ -16,14 +16,15 @@ namespace mozilla { namespace layers { /* static */ -RefPtr APZInputBridgeParent::Create( +APZInputBridgeParent* APZInputBridgeParent::Create( const LayersId& aLayersId, Endpoint&& aEndpoint) { - RefPtr parent = new APZInputBridgeParent(aLayersId); + APZInputBridgeParent* parent = new APZInputBridgeParent(aLayersId); if (!aEndpoint.Bind(parent)) { // We can't recover from this. MOZ_CRASH("Failed to bind APZInputBridgeParent to endpoint"); } + CompositorBridgeParent::SetAPZInputBridgeParent(aLayersId, parent); return parent; } @@ -31,6 +32,7 @@ APZInputBridgeParent::APZInputBridgeParent(const LayersId& aLayersId) { MOZ_ASSERT(XRE_IsGPUProcess()); MOZ_ASSERT(NS_IsMainThread()); + mLayersId = aLayersId; mTreeManager = CompositorBridgeParent::GetAPZCTreeManager(aLayersId); MOZ_ASSERT(mTreeManager); } @@ -205,6 +207,10 @@ mozilla::ipc::IPCResult APZInputBridgeParent::RecvProcessUnhandledEvent( } void APZInputBridgeParent::ActorDestroy(ActorDestroyReason aWhy) { + StaticMonitorAutoLock lock(CompositorBridgeParent::sIndirectLayerTreesLock); + CompositorBridgeParent::LayerTreeState& state = + CompositorBridgeParent::sIndirectLayerTrees[mLayersId]; + state.mApzInputBridgeParent = nullptr; // We shouldn't need it after this mTreeManager = nullptr; } -- cgit v1.2.3