Bug 1370093 - Add mDestroyed checks r=nical
authorsotaro <sotaro.ikeda.g@gmail.com>
Mon, 05 Jun 2017 15:41:21 +0900
changeset 412790 af18a71db2946e60778fc8c4666fad11e883eb49
parent 412789 4d78fccf03b43ff103be9339a705402b7da66602
child 412791 0534d36df322f8d1b806cef0705733cdf3f7b89f
push id1490
push usermtabara@mozilla.com
push dateMon, 31 Jul 2017 14:08:16 +0000
treeherdermozilla-release@70e32e6bf15e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1370093
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1370093 - Add mDestroyed checks r=nical
gfx/layers/wr/WebRenderBridgeParent.cpp
--- a/gfx/layers/wr/WebRenderBridgeParent.cpp
+++ b/gfx/layers/wr/WebRenderBridgeParent.cpp
@@ -408,32 +408,38 @@ WebRenderBridgeParent::RecvDPEnd(const g
                                  InfallibleTArray<OpDestroy>&& aToDestroy,
                                  const uint64_t& aFwdTransactionId,
                                  const uint64_t& aTransactionId,
                                  const WrSize& aContentSize,
                                  const ByteBuffer& dl,
                                  const WrBuiltDisplayListDescriptor& dlDesc,
                                  const WebRenderScrollData& aScrollData)
 {
+  if (mDestroyed) {
+    return IPC_OK();
+  }
   HandleDPEnd(aSize, Move(aCommands), Move(aToDestroy), aFwdTransactionId, aTransactionId,
               aContentSize, dl, dlDesc, aScrollData);
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
 WebRenderBridgeParent::RecvDPSyncEnd(const gfx::IntSize &aSize,
                                      InfallibleTArray<WebRenderParentCommand>&& aCommands,
                                      InfallibleTArray<OpDestroy>&& aToDestroy,
                                      const uint64_t& aFwdTransactionId,
                                      const uint64_t& aTransactionId,
                                      const WrSize& aContentSize,
                                      const ByteBuffer& dl,
                                      const WrBuiltDisplayListDescriptor& dlDesc,
                                      const WebRenderScrollData& aScrollData)
 {
+  if (mDestroyed) {
+    return IPC_OK();
+  }
   HandleDPEnd(aSize, Move(aCommands), Move(aToDestroy), aFwdTransactionId, aTransactionId,
               aContentSize, dl, dlDesc, aScrollData);
   return IPC_OK();
 }
 
 void
 WebRenderBridgeParent::ProcessWebRenderCommands(const gfx::IntSize &aSize,
                                                 InfallibleTArray<WebRenderParentCommand>& aCommands, const wr::Epoch& aEpoch,
@@ -690,23 +696,29 @@ WebRenderBridgeParent::RecvRemoveExterna
   mExternalImageIds.Remove(wr::AsUint64(aImageId));
 
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
 WebRenderBridgeParent::RecvSetLayerObserverEpoch(const uint64_t& aLayerObserverEpoch)
 {
+  if (mDestroyed) {
+    return IPC_OK();
+  }
   mChildLayerObserverEpoch = aLayerObserverEpoch;
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
 WebRenderBridgeParent::RecvClearCachedResources()
 {
+  if (mDestroyed) {
+    return IPC_OK();
+  }
   mCompositorBridge->ObserveLayerUpdate(GetLayersId(), GetChildLayerObserverEpoch(), false);
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
 WebRenderBridgeParent::RecvForceComposite()
 {
   if (mDestroyed) {
@@ -727,48 +739,60 @@ WebRenderBridgeParent::GetTargetAPZC(con
   }
   return apzc.forget();
 }
 
 mozilla::ipc::IPCResult
 WebRenderBridgeParent::RecvSetConfirmedTargetAPZC(const uint64_t& aBlockId,
                                                   nsTArray<ScrollableLayerGuid>&& aTargets)
 {
+  if (mDestroyed) {
+    return IPC_OK();
+  }
   mCompositorBridge->SetConfirmedTargetAPZC(GetLayersId(), aBlockId, aTargets);
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
 WebRenderBridgeParent::RecvSetAsyncScrollOffset(const FrameMetrics::ViewID& aScrollId,
                                                 const float& aX,
                                                 const float& aY)
 {
+  if (mDestroyed) {
+    return IPC_OK();
+  }
   RefPtr<AsyncPanZoomController> apzc = GetTargetAPZC(aScrollId);
   if (!apzc) {
     return IPC_FAIL_NO_REASON(this);
   }
   apzc->SetTestAsyncScrollOffset(CSSPoint(aX, aY));
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
 WebRenderBridgeParent::RecvSetAsyncZoom(const FrameMetrics::ViewID& aScrollId,
                                         const float& aZoom)
 {
+  if (mDestroyed) {
+    return IPC_OK();
+  }
   RefPtr<AsyncPanZoomController> apzc = GetTargetAPZC(aScrollId);
   if (!apzc) {
     return IPC_FAIL_NO_REASON(this);
   }
   apzc->SetTestAsyncZoom(LayerToParentLayerScale(aZoom));
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
 WebRenderBridgeParent::RecvFlushApzRepaints()
 {
+  if (mDestroyed) {
+    return IPC_OK();
+  }
   mCompositorBridge->FlushApzRepaints(GetLayersId());
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
 WebRenderBridgeParent::RecvGetAPZTestData(APZTestData* aOutData)
 {
   mCompositorBridge->GetAPZTestData(GetLayersId(), aOutData);
@@ -1069,32 +1093,41 @@ WebRenderBridgeParent::IsSameProcess() c
 {
   return OtherPid() == base::GetCurrentProcId();
 }
 
 mozilla::ipc::IPCResult
 WebRenderBridgeParent::RecvNewCompositable(const CompositableHandle& aHandle,
                                            const TextureInfo& aInfo)
 {
+  if (mDestroyed) {
+    return IPC_OK();
+  }
   if (!AddCompositable(aHandle, aInfo)) {
     return IPC_FAIL_NO_REASON(this);
   }
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
 WebRenderBridgeParent::RecvReleaseCompositable(const CompositableHandle& aHandle)
 {
+  if (mDestroyed) {
+    return IPC_OK();
+  }
   ReleaseCompositable(aHandle);
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
 WebRenderBridgeParent::RecvInitReadLocks(ReadLockArray&& aReadLocks)
 {
+  if (mDestroyed) {
+    return IPC_OK();
+  }
   if (!AddReadLocks(Move(aReadLocks))) {
     return IPC_FAIL_NO_REASON(this);
   }
   return IPC_OK();
 }
 
 void
 WebRenderBridgeParent::SetWebRenderProfilerEnabled(bool aEnabled)