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

Depends on D164682

Differential Revision: https://phabricator.services.mozilla.com/D164683
This commit is contained in:
Dan Robertson 2022-12-16 19:07:07 +00:00
parent b708eda376
commit c18b24369d
3 changed files with 11 additions and 9 deletions

View File

@ -66,14 +66,5 @@ add_task(
"closed",
"Check that panel state is 'closed'"
);
// Move the cursor to the center of the browser window where hopefully it
// will cause less intermittent failures in the next tests than keeping it
// in the toolbar area.
EventUtils.synthesizeNativeMouseEvent({
type: "mousemove",
target: document.documentElement,
atCenter: true,
});
}
);

View File

@ -2778,6 +2778,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);

View File

@ -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);