Bug 1691065 - Discard invalid resource update transactions due to namespace changes. r=jrmuizel

When we change the namespace, we discard all cached resources and their
associated keys from the WebRender cache. As such if any transaction
comes in with the old namespace ID, we can safefully discard the entire
update, since we will need to recreate any that we are using anyways.

This patch also adds new asserts to ensure we never get old namespace
IDs for individual keys in a valid resource update. This should never
happen in practice.

Differential Revision: https://phabricator.services.mozilla.com/D104236
This commit is contained in:
Andrew Osmond
2021-02-05 16:32:53 +00:00
parent ca733704c4
commit 25c0854faf
6 changed files with 128 additions and 55 deletions

View File

@@ -285,6 +285,7 @@ bool WebRenderLayerManager::EndEmptyTransaction(EndTransactionFlags aFlags) {
if (mStateManager.mAsyncResourceUpdates || !mPendingScrollUpdates.IsEmpty() ||
WrBridge()->HasWebRenderParentCommands()) {
transactionData.emplace();
transactionData->mIdNamespace = WrBridge()->GetNamespace();
transactionData->mPaintSequenceNumber = mPaintSequenceNumber;
if (mStateManager.mAsyncResourceUpdates) {
mStateManager.mAsyncResourceUpdates->Flush(