зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1690857 - Add diagnostic assert to ensure we aren't using stale blob keys in the compositor process. r=jrmuizel
Similar to bug 1690821 in the content process, this adds an assert in the other side in case of a race condition. Differential Revision: https://phabricator.services.mozilla.com/D104086
This commit is contained in:
Родитель
e8ebbd9d35
Коммит
b4617507c5
|
@ -518,6 +518,8 @@ bool WebRenderBridgeParent::UpdateResources(
|
|||
}
|
||||
case OpUpdateResource::TOpAddBlobImage: {
|
||||
const auto& op = cmd.get_OpAddBlobImage();
|
||||
MOZ_DIAGNOSTIC_ASSERT(MatchesNamespace(op.key()),
|
||||
"stale blob key for add!");
|
||||
wr::Vec<uint8_t> bytes;
|
||||
if (!reader.Read(op.bytes(), bytes)) {
|
||||
gfxCriticalNote << "TOpAddBlobImage failed";
|
||||
|
@ -529,6 +531,8 @@ bool WebRenderBridgeParent::UpdateResources(
|
|||
}
|
||||
case OpUpdateResource::TOpUpdateBlobImage: {
|
||||
const auto& op = cmd.get_OpUpdateBlobImage();
|
||||
MOZ_DIAGNOSTIC_ASSERT(MatchesNamespace(op.key()),
|
||||
"stale blob key for update!");
|
||||
wr::Vec<uint8_t> bytes;
|
||||
if (!reader.Read(op.bytes(), bytes)) {
|
||||
gfxCriticalNote << "TOpUpdateBlobImage failed";
|
||||
|
@ -541,6 +545,8 @@ bool WebRenderBridgeParent::UpdateResources(
|
|||
}
|
||||
case OpUpdateResource::TOpSetBlobImageVisibleArea: {
|
||||
const auto& op = cmd.get_OpSetBlobImageVisibleArea();
|
||||
MOZ_DIAGNOSTIC_ASSERT(MatchesNamespace(op.key()),
|
||||
"stale blob key for visible area!");
|
||||
aUpdates.SetBlobImageVisibleArea(op.key(),
|
||||
wr::ToDeviceIntRect(op.area()));
|
||||
break;
|
||||
|
|
|
@ -220,6 +220,14 @@ class WebRenderBridgeParent final : public PWebRenderBridgeParent,
|
|||
wr::Epoch GetCurrentEpoch() const { return mWrEpoch; }
|
||||
wr::IdNamespace GetIdNamespace() { return mIdNamespace; }
|
||||
|
||||
bool MatchesNamespace(const wr::ImageKey& aImageKey) const {
|
||||
return aImageKey.mNamespace == mIdNamespace;
|
||||
}
|
||||
|
||||
bool MatchesNamespace(const wr::BlobImageKey& aBlobKey) const {
|
||||
return MatchesNamespace(aBlobKey._0);
|
||||
}
|
||||
|
||||
void FlushRendering(bool aWaitForPresent = true);
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче