Bug 1507212 - Guard against the compositor receiving a delayed FlushApzRepaints message. r=botond
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 06 Dec 2018 19:20:12 +0000
changeset 508773 537b39da583098454476d886dcf8edd9c203c719
parent 508772 07ce5163f3dac2e65ca2524a1f20c2c9d48805ac
child 508774 1de7634102699e83608af8b16f758df090b23426
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs1507212
milestone65.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 1507212 - Guard against the compositor receiving a delayed FlushApzRepaints message. r=botond On Android the FlushApzRepaints API is used as part of the code flow of zooming/scrolling to a focused input field. In mochitests this code can run but the message might arrive late, after the test suite is down and the browser is shutting down. Depending on timing, the parent process compositor bridge instance might already have been cleared, in which case the code would crash/fail an assertion. This patch makes the code handle this case more gracefully. Differential Revision: https://phabricator.services.mozilla.com/D13941
gfx/layers/ipc/CrossProcessCompositorBridgeParent.cpp
--- a/gfx/layers/ipc/CrossProcessCompositorBridgeParent.cpp
+++ b/gfx/layers/ipc/CrossProcessCompositorBridgeParent.cpp
@@ -510,21 +510,20 @@ void CrossProcessCompositorBridgeParent:
   state->mParent->SetTestAsyncZoom(aLayersId, aScrollId, aZoom);
 }
 
 void CrossProcessCompositorBridgeParent::FlushApzRepaints(
     const LayersId& aLayersId) {
   MOZ_ASSERT(aLayersId.IsValid());
   const CompositorBridgeParent::LayerTreeState* state =
       CompositorBridgeParent::GetIndirectShadowTree(aLayersId);
-  if (!state) {
+  if (!state || !state->mParent) {
     return;
   }
 
-  MOZ_ASSERT(state->mParent);
   state->mParent->FlushApzRepaints(aLayersId);
 }
 
 void CrossProcessCompositorBridgeParent::GetAPZTestData(
     const LayersId& aLayersId, APZTestData* aOutData) {
   MOZ_ASSERT(aLayersId.IsValid());
   const CompositorBridgeParent::LayerTreeState* state =
       CompositorBridgeParent::GetIndirectShadowTree(aLayersId);