Closed Bug 1865376 Opened 2 years ago Closed 2 years ago

Call the error callback synchronously from the configure error task, and block the message queue processing at the right time

Categories

(Core :: Audio/Video: Web Codecs, defect)

defect

Tracking

()

RESOLVED FIXED
122 Branch
Tracking Status
firefox122 --- fixed

People

(Reporter: padenot, Assigned: padenot)

References

Details

Attachments

(12 files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

Fixes this: https://wpt.live/webcodecs/video-decoder.https.any.html and various other tests that were using the same pattern.

Two problems:

  • This was calling the error callback by queueing another task, which isn't what
    the spec says (we're already in a task at this point, the callback needs to be
    called directly).
  • The message queue was blocked too late, so the flush message was being
    processed, and this caused the timeout.

Depends on D193923

When the spec says "Queue a task to do X and Y", there needs to be exactly a
single task doing X and Y without anything possible in between.

This can probably be observed by spamming e.g. the main thread with tasks, and
seeing that two steps aren't atomic.

Depends on D194139

Sometimes, the promise and something else need to happen in the same steps, etc.
Generally this removes a bunch of indirection and makes things very clear.

This gets rid of various explicit runnables, preferring simple lambdas, and
generally follows a simple rule: things that are conceptually consequences from
an operation (what we have in the Thenable of our PDM MozPromise) queue a single
task, and that does the steps.

I've removed methods called "ScheduleXXXX(...)", preferring clear calls to
QueueATask with a lambda, so it's clear what is going to run. This usually
runs the synchronous version "XXXXInternal(...)", but not always.

Exceptions are:

  • ScheduleDequeueEvent (handled later in this series)
  • Calling the output callback (also handled later)

This also removes calls to ProcessMessageQueue that shouldn't have been there.

Depends on D194140

Simple compilation fix for the previous patch, but orthogonal so I split it out.

Depends on D194141

This makes it clear that it has some logic.

Depends on D194142

We can't have this happen.

Depends on D194869

The severity field is not set for this bug.
:padenot, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(padenot)
Pushed by padenot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8b5620d3d4bb Call the error callback synchronously from the configure error task, and block the message queue processing at the right time. r=chunmin https://hg.mozilla.org/integration/autoland/rev/0da850525973 Make it clear what closing a decoder with an abort error doesn't call the error callback. r=chunmin https://hg.mozilla.org/integration/autoland/rev/f69dd666d809 Don't tolerate failures in CloseInternal. r=chunmin https://hg.mozilla.org/integration/autoland/rev/8c58b7ec90c3 Introduce QueueATask on DecoderTemplate. r=chunmin https://hg.mozilla.org/integration/autoland/rev/506426f7bfe2 Use QueueATask to run each step precisely per spec. r=chunmin https://hg.mozilla.org/integration/autoland/rev/9295d457356a Fix const-correctness around output callback. r=chunmin https://hg.mozilla.org/integration/autoland/rev/ddf76cb4720b Simplify and rename ScheduleDequeueEvent. r=chunmin https://hg.mozilla.org/integration/autoland/rev/9a7b12e28ca1 Adjust WPT expectations. r=chunmin https://hg.mozilla.org/integration/autoland/rev/c3aa798b2c66 Sprinkle annotations to sidestep issues related to MOZ_CAN_RUN_SCRIPT and lambdas. r=chunmin https://hg.mozilla.org/integration/autoland/rev/995679e8b389 Format after all the lambda changes. r=chunmin https://hg.mozilla.org/integration/autoland/rev/9da42c9589eb Fix warning: don't copy argument. r=chunmin https://hg.mozilla.org/integration/autoland/rev/ea68e617ec80 Don't do meaningful work in VideoDecoder's dtor. r=chunmin https://hg.mozilla.org/integration/autoland/rev/51d7fee3bc89 apply code formatting via Lando
Regressions: 1870201
Blocks: 1872951
Flags: needinfo?(padenot)
Pushed by padenot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7584c2f834c2 1881079: apply code formatting via Lando
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: