Closed Bug 1280715 Opened 6 years ago Closed 6 years ago

Refactor destruction code in TextureForwarder's subclasses


(Core :: Graphics: Layers, defect)

Not set



Tracking Status
firefox51 --- fixed


(Reporter: gw280, Assigned: gw280)


(Blocks 1 open bug)


(Keywords: feature, Whiteboard: [gfx-noted])


(1 file)

We rely on IPCOpen() to ensure that we can send IPC messages correctly. This is normally overridden and managed in the leaf class in a class hierarchy (e.g. ShadowLayerForwarder).

Sometimes we need to be able to send IPC messages into to do destruction-related cleanup (such as in TextureForwarder's dtor, where we dealloc shmems). At the moment, this also now checks to see if the shmem allocator is still available but ideally we should move this cleanup to Destroy() methods that are executed before destruction.

I opted not to fix this immediately in bug 1176011 as that code is already complex enough and I didn't want to involve more refactoring in the patch (and adding even more risk onto an already risky patch).
See Also: → 1176011
Keywords: feature
Whiteboard: [gfx-noted]
Assignee: nobody → gwright
I had a long think about this, and it looks like the tile lock allocator is the only thing that complicates this. I think moving this into CompositorBridgeChild makes sense, and makes TextureForwarder an abstract class which is more in keeping with what it should be.
Attachment #8787050 - Flags: review?(nical.bugzilla)
Oops, looks like this patch isn't quite correct. TextureForwarder.cpp should be deleted, not just have some code removed. The rest of the patch is fine though.
Comment on attachment 8787050 [details] [diff] [review]

Review of attachment 8787050 [details] [diff] [review]:

::: gfx/layers/ipc/CompositorBridgeChild.cpp
@@ +101,5 @@
>      mTexturePools[i]->Destroy();
>    }
> +  if (mSectionAllocator) {
> +    delete mSectionAllocator;

Please null out mSectionAllocator after deleting (I realize the original code did not), it'll be less footgun-prone that way.
Attachment #8787050 - Flags: review?(nical.bugzilla) → review+
Pushed by
Move FixedSizeShmemAllocator to CompositorBridgeChild to allow for a more sane destruction sequence r=nical
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
You need to log in before you can comment on or make changes to this bug.