mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 23:38:38 +09:00
Bug 1920800 - Remove oldImages from check for flushed old principal handle
The logic should be equivalent when frame IDs on aImages are contiguously increasing from IDs on previously set frames. There are currently no callers passing empty aImages, but the logic in this case would now be as described in the documentation of UpdatePrincipalHandleForFrameID(): > We will notify mElement that aPrincipalHandle has been applied when all > FrameIDs prior to aFrameID have been flushed out.
This commit is contained in:
parent
5c0c0c02d9
commit
9ba1057e54
1 changed files with 6 additions and 12 deletions
|
|
@ -225,19 +225,13 @@ void VideoFrameContainer::SetCurrentFramesLocked(const gfx::IntSize& aIntrinsicS
|
|||
nsTArray<ImageContainer::OwningImage> oldImages;
|
||||
mImageContainer->GetCurrentImages(&oldImages);
|
||||
|
||||
ImageContainer::FrameID lastFrameIDForOldPrincipalHandle =
|
||||
mFrameIDForPendingPrincipalHandle - 1;
|
||||
if (mPendingPrincipalHandle != PRINCIPAL_HANDLE_NONE &&
|
||||
((!oldImages.IsEmpty() &&
|
||||
oldImages.LastElement().mFrameID >= lastFrameIDForOldPrincipalHandle) ||
|
||||
(!aImages.IsEmpty() &&
|
||||
aImages[0].mFrameID > lastFrameIDForOldPrincipalHandle))) {
|
||||
// We are releasing the last FrameID prior to `lastFrameIDForOldPrincipalHandle`
|
||||
// OR
|
||||
// there are no FrameIDs prior to `lastFrameIDForOldPrincipalHandle` in the new
|
||||
// set of images.
|
||||
// This means that the old principal handle has been flushed out and we can
|
||||
// notify our video element about this change.
|
||||
(aImages.IsEmpty() ||
|
||||
aImages[0].mFrameID >= mFrameIDForPendingPrincipalHandle)) {
|
||||
// There are no FrameIDs prior to `mFrameIDForPendingPrincipalHandle`
|
||||
// in the new set of images.
|
||||
// This means that the old principal handle has been flushed out and we
|
||||
// can notify our video element about this change.
|
||||
RefPtr<VideoFrameContainer> self = this;
|
||||
PrincipalHandle principalHandle = mPendingPrincipalHandle;
|
||||
mLastPrincipalHandle = mPendingPrincipalHandle;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue