Commit da2b41ec authored by Dan Robertson's avatar Dan Robertson
Browse files

Bug 1488886 - AllocPAPZCTreeManager should gracefully fail if APZ is not...

Bug 1488886 - AllocPAPZCTreeManager should gracefully fail if APZ is not enabled. r=botond, a=RyanVM

Depends on D164682

Differential Revision: https://phabricator.services.mozilla.com/D164683
parent 06b9bac3
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -2851,6 +2851,11 @@ void BrowserChild::InitAPZState() {
  // multiple inheritance.
  PAPZCTreeManagerChild* baseProtocol =
      cbc->SendPAPZCTreeManagerConstructor(mLayersId);
  if (!baseProtocol) {
    MOZ_ASSERT(false,
               "Allocating a TreeManager should not fail with APZ enabled");
    return;
  }
  APZCTreeManagerChild* derivedProtocol =
      static_cast<APZCTreeManagerChild*>(baseProtocol);

+6 −0
Original line number Diff line number Diff line
@@ -81,9 +81,15 @@ ContentCompositorBridgeParent::AllocPAPZCTreeManagerParent(
    return new APZCTreeManagerParent(aLayersId, temp, tempUpdater);
  }

  // If we do not have APZ enabled, we should gracefully fail.
  if (!state.mParent->GetOptions().UseAPZ()) {
    return nullptr;
  }

  state.mParent->AllocateAPZCTreeManagerParent(lock, aLayersId, state);
  return state.mApzcTreeManagerParent;
}

bool ContentCompositorBridgeParent::DeallocPAPZCTreeManagerParent(
    PAPZCTreeManagerParent* aActor) {
  APZCTreeManagerParent* parent = static_cast<APZCTreeManagerParent*>(aActor);