Bug 1507068 - Ensure mParent is not null in mozilla::layers::CompositorBridgeParent::GetAndroidDynamicToolbarAnimator. r=snorp,kats, a=jcristau
authorRandall Barker <rbarker@mozilla.com>
Fri, 16 Nov 2018 14:41:08 +0000
changeset 501296 88649b8165f06f85195acbac78619ab97ee3de33
parent 501295 2da9de110c930390a4d2f269f5b2d562f5594fa9
child 501297 27727035c0de45862af6d6fd140c962f8bd5e483
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp, kats, jcristau
bugs1507068
milestone64.0
Bug 1507068 - Ensure mParent is not null in mozilla::layers::CompositorBridgeParent::GetAndroidDynamicToolbarAnimator. r=snorp,kats, a=jcristau Speculative fix for Bug 1507068. Checks if mParent is not null before trying to get a pointer to the toolbar animator Differential Revision: https://phabricator.services.mozilla.com/D11957
gfx/layers/ipc/UiCompositorControllerParent.cpp
--- a/gfx/layers/ipc/UiCompositorControllerParent.cpp
+++ b/gfx/layers/ipc/UiCompositorControllerParent.cpp
@@ -294,16 +294,19 @@ UiCompositorControllerParent::Initialize
 void
 UiCompositorControllerParent::Initialize()
 {
   MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread());
   AddRef();
   LayerTreeState* state = CompositorBridgeParent::GetIndirectShadowTree(mRootLayerTreeId);
   MOZ_ASSERT(state);
   MOZ_ASSERT(state->mParent);
+  if (!state->mParent) {
+    return;
+  }
   state->mUiControllerParent = this;
 #if defined(MOZ_WIDGET_ANDROID)
   AndroidDynamicToolbarAnimator* animator = state->mParent->GetAndroidDynamicToolbarAnimator();
   // It is possible the compositor has already started shutting down and
   // the AndroidDynamicToolbarAnimator could be a nullptr. Or this could be
   // non-Fennec in which case the animator is null anyway.
   if (animator) {
     animator->Initialize(mRootLayerTreeId);