Closed Bug 1829439 Opened 2 years ago Closed 1 year ago

[wmfme] modify `MFCDMChild::XXXSession` to make them return independent promise

Categories

(Core :: Audio/Video: Playback, task, P2)

task

Tracking

()

RESOLVED FIXED
114 Branch
Tracking Status
firefox114 --- fixed

People

(Reporter: alwu, Assigned: alwu)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Our current implementation for these functions are wrong. If the returned promise from the former call hasn't been resolved/rejected, then we can't call the same function again.

The next function call should be able to run without waiting the previous one, because they are based on the different promise Id.

Eg. we can call MFCDMChild::UpdateSession first for the audio session, and then call MFCDMChild::UpdateSession later again for the video session. As they are not related so the latter one shouldn't need to wait the former one finished.

If above situation happens under current implementation, it would trigger the assertion because the GenericPromise is not exclusive. Those two function calls should have their own returned promise, instead of reusing the same one.

Our current implementation for these functions are wrong. If the
returned promise from the former call hasn't been resolved/rejected, then
we can't call the same function again. The next function call should
be able to run no matter if there are any pending promises, because they
are based on the different promise Id.

Eg. we can call MFCDMChild::UpdateSession first for an audio session,
and then call the same function later again for a video session. As
they are not related so the latter one shouldn't need to wait the
former one finished.

When above situation happens under current implementation, it would
trigger the assertion because the GenericPromise is not exclusive.
Those function calls should have their own returned promise, instead of
reusing the same one.

Pushed by alwu@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/04f9336c6283 make `MFCDMChild::XXXSession` to return independent promise r=jolin
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 114 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: