Closed Bug 1712232 Opened 4 years ago Closed 4 years ago

[wpt-sync] Sync PR 29068 - MSE-in-Workers: Make MediaSource.duration acquire lock to access demuxer

Categories

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

task

Tracking

()

RESOLVED FIXED
90 Branch
Tracking Status
firefox90 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 29068 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/29068
Details from upstream follow.

b'Matt Wolenetz <wolenetz@chromium.org>' wrote:

MSE-in-Workers: Make MediaSource.duration acquire lock to access demuxer

Worker JS accessing MediaSource.duration wasn't taking the necessary
CrossThreadAttachment lock. It should, so that it can safely access the
underlying main-thread-owned demuxer to retrieve its duration.

This change refactors MediaSource::duration() so that only the IDL calls
it, and both it and all other previous callers of duration() are updated
to instead call GetDuration_Locked. duration() calls GetDuration_Locked
via the existing MediaSource::RunUnlessElementGoneOrClosingUs()
machinery that ensures the call only occurs while it is safe to access
the underlying demuxer. Other callers of MediaSource::duration() were
already running in the context of that machinery, and are updated to
provide the appropriate ExclusiveKey to confirm that contract statically
during build (like all the other paths already using that machinery).

Bug: 1211551,878133

Change-Id: I44b97e63e2a2bd9473f4cd0fc07bc734b344bf2d

Reviewed-on: https://chromium-review.googlesource.com/2909389
WPT-Export-Revision: 67aa3041a30213ddefda3444ee700b5b87f6e287

Component: web-platform-tests → Audio/Video: Playback
Product: Testing → Core

CI Results

Ran 15 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 2 tests and 1 subtests

Status Summary

Firefox

OK : 2
PASS: 1
FAIL: 2

Chrome

OK : 2
PASS: 6

Safari

OK : 2
PASS: 1
FAIL: 2

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

/media-source/dedicated-worker/mediasource-worker-objecturl.html
Test main context revocation of DedicatedWorker MediaSource object URL: FAIL (Chrome: PASS, Safari: FAIL)
/media-source/dedicated-worker/mediasource-worker-play.html
Test worker MediaSource construction, attachment, buffering and basic playback: FAIL (Chrome: PASS, Safari: FAIL)

Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/638ded001a60 [wpt PR 29068] - MSE-in-Workers: Make MediaSource.duration acquire lock to access demuxer, a=testonly
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b1073fb33cca [wpt PR 29068] - MSE-in-Workers: Make MediaSource.duration acquire lock to access demuxer, a=testonly
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ef6d10bd07b7 [wpt PR 29068] - MSE-in-Workers: Make MediaSource.duration acquire lock to access demuxer, a=testonly
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch
You need to log in before you can comment on or make changes to this bug.