Commit b93a3115 authored by Andrew Osmond's avatar Andrew Osmond
Browse files

Bug 1763642 - Fix assertion where we try to free stale blob keys. r=gfx-reviewers,lsalzman

We get consistent crashtest failures in CI when image.svg.blob-image
is set to true. This is because on some teardown paths, we don't verify
to see if the layer manager still owns the namespace used for the blob
keys.

Differential Revision: https://phabricator.services.mozilla.com/D143189
parent a4f19fdd
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -47,12 +47,19 @@ BlobSurfaceProvider::~BlobSurfaceProvider() {
/* static */ void BlobSurfaceProvider::DestroyKeys(
    const AutoTArray<BlobImageKeyData, 1>& aKeys) {
  for (const auto& entry : aKeys) {
    if (!entry.mManager->IsDestroyed()) {
    if (entry.mManager->IsDestroyed()) {
      continue;
    }

    WebRenderBridgeChild* wrBridge = entry.mManager->WrBridge();
    if (!wrBridge || !wrBridge->MatchesNamespace(entry.mBlobKey)) {
      continue;
    }

    entry.mManager->GetRenderRootStateManager()->AddBlobImageKeyForDiscard(
        entry.mBlobKey);
  }
}
}

nsresult BlobSurfaceProvider::UpdateKey(
    layers::RenderRootStateManager* aManager,