Bug 1319508 - Ensure that we don't leave dangling pointers to CompositorBridgeParent in LayerTreeState instances. r=dvander
authorKartikaya Gupta <kgupta@mozilla.com>
Tue, 22 Nov 2016 14:38:37 -0500
changeset 323937 25c7f7eb112ccea20e2083a38499ae5f12097480
parent 323936 59f2e54d4122f2de7d8ecb5c92a2505295ed657e
child 323938 59e448d0eba8b55b2927cf8071f6d3beb2c56f5a
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersdvander
bugs1319508
milestone53.0a1
Bug 1319508 - Ensure that we don't leave dangling pointers to CompositorBridgeParent in LayerTreeState instances. r=dvander MozReview-Commit-ID: 3dxZ35uIQu
gfx/layers/ipc/CompositorBridgeParent.h
--- a/gfx/layers/ipc/CompositorBridgeParent.h
+++ b/gfx/layers/ipc/CompositorBridgeParent.h
@@ -353,17 +353,17 @@ public:
   CreateForContent(Endpoint<PCompositorBridgeParent>&& aEndpoint);
 
   struct LayerTreeState {
     LayerTreeState();
     ~LayerTreeState();
     RefPtr<Layer> mRoot;
     RefPtr<GeckoContentController> mController;
     APZCTreeManagerParent* mApzcTreeManagerParent;
-    CompositorBridgeParent* mParent;
+    RefPtr<CompositorBridgeParent> mParent;
     LayerManagerComposite* mLayerManager;
     // Pointer to the CrossProcessCompositorBridgeParent. Used by APZCs to share
     // their FrameMetrics with the corresponding child process that holds
     // the PCompositorBridgeChild
     CrossProcessCompositorBridgeParent* mCrossProcessParent;
     TargetConfig mTargetConfig;
     APZTestData mApzTestData;
     LayerTransactionParent* mLayerTree;