Bug 1540521 - Only attempt to set the CompositionRecorder on the LayerManager when there is one r=mstange
authorBarret Rennie <barret@brennie.ca>
Thu, 16 May 2019 17:26:19 +0000
changeset 532976 beb59fe4dd80fdf4fd6f65e916fd394350431a7d
parent 532975 2c353f21c1dce7f28d8a35594f4628b38d5a1bbd
child 532977 742a8ae0110dc3d862a637e4348b587fe431938f
push id11276
push userrgurzau@mozilla.com
push dateMon, 20 May 2019 13:11:24 +0000
treeherdermozilla-beta@847755a7c325 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1540521
milestone68.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 1540521 - Only attempt to set the CompositionRecorder on the LayerManager when there is one r=mstange The CompositorBridgeParent won't have a LayerManager when running with WebRender, so attempting to take a composition recording will cause a crash. We now silently fail to take the recording since recording is not supported on Web Render. Differential Revision: https://phabricator.services.mozilla.com/D31169
gfx/layers/ipc/CompositorBridgeParent.cpp
--- a/gfx/layers/ipc/CompositorBridgeParent.cpp
+++ b/gfx/layers/ipc/CompositorBridgeParent.cpp
@@ -2606,21 +2606,27 @@ int32_t RecordContentFrameTime(
   }
 
   return 0;
 }
 
 mozilla::ipc::IPCResult CompositorBridgeParent::RecvBeginRecording(
     const TimeStamp& aRecordingStart) {
   mCompositionRecorder.reset(new CompositionRecorder(aRecordingStart));
-  mLayerManager->SetCompositionRecorder(mCompositionRecorder.get());
+
+  if (mLayerManager) {
+    mLayerManager->SetCompositionRecorder(mCompositionRecorder.get());
+  }
+
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult CompositorBridgeParent::RecvEndRecording() {
-  mLayerManager->SetCompositionRecorder(nullptr);
+  if (mLayerManager) {
+    mLayerManager->SetCompositionRecorder(nullptr);
+  }
   mCompositionRecorder->WriteCollectedFrames();
   mCompositionRecorder.reset(nullptr);
   return IPC_OK();
 }
 
 }  // namespace layers
 }  // namespace mozilla