Skip to content

Commit

Permalink
MSE-in-Workers: Relaunch with flag guards and handle visibility restr…
Browse files Browse the repository at this point in the history
…icted

This undoes the previous launch revert commit 887a8c4e3d5203b0528e7c911b24be3aa67d2b4e, and includes multiple fixes.

Switches the two RuntimeEnabled features that enable MSE-in-Workers
from experimental to stable status:
  MediaSourceInWorkers: Basic support, still using legacy object
    URLs for attachment
  MediaSourceInWorkersUsingHandle: Upgraded to match updated MSE spec, final PR linked below.

Updates the stable webexposed expectations for both the Main/Window
context and the DedicatedWorker context.

MSE spec PRs with handle usage refinements:
  * w3c/media-source#306
  * this relaunch also includes implementation of spec fix from
    w3c/media-source#317

Intent-to-ship=https://groups.google.com/a/chromium.org/g/blink-dev/c/FRY3F1v6Two

Versus the original launch, this relaunch:
* adds base::Feature (aka flag-guards) for each of the two
  RuntimeEnabledFeatures, above (with same feature name strings).
  This is to comply with mandatory flag-guarding PSA process update,
  and is meant to mitigate possible binary respins in the event this
  feature pair yet again needs to be disabled.
* updates the MediaSource.handle attribute getter to fix the
  regression responsible for the previous revert, complying with
  MSE spec that was fixed to prevent that regression (see PR #317
  linked above):
  * Removes NotSupportedError exception throwing logic from the
    handle attribute getter.
  * Restricts visibility of the handle attribute to only dedicated
    worker contexts (removes visibility of it from the main/Window
    context versus previous launch attempt), along with corresponding
    webexposed stable web_tests expectations matching this change.
  * Updates mediasource-worker-handle.html web_test to no longer
    expect NotSupportedError exception, nor even ability to access the
    handle attribute of a MediaSource object on the main/window
    context.

BUG=878133

Change-Id: Id34a07254b9b98e79c495429f8ed79555b0c4580
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3910706
Commit-Queue: Will Cassella <cassew@chromium.org>
Reviewed-by: Mike Taylor <miketaylr@chromium.org>
Reviewed-by: Will Cassella <cassew@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1053854}
  • Loading branch information
wolenetz authored and chromium-wpt-export-bot committed Oct 1, 2022
1 parent 80e14d0 commit 2108f20
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions media-source/dedicated-worker/mediasource-worker-handle.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,17 @@
}, "Test main context receipt of postMessage'd MediaSourceHandle from DedicatedWorker MediaSource");

test(t => {
assert_true(window.hasOwnProperty("MediaSourceHandle"), "window must have MediaSourceHandle visibility");
assert_true(window.hasOwnProperty("MediaSourceHandle"), "window must have MediaSourceHandle");
}, "Test main-thread has MediaSourceHandle defined");

test(t => {
// Note, MSE spec may eventually describe how a main-thread MediaSource can
// attach to an HTMLMediaElement using a MediaSourceHandle. For now, we
// ensure that the implementation of this is not available.
assert_throws_dom('NotSupportedError', function() {
let h = new MediaSource().handle;
}, 'main thread MediaSource instance cannot (yet) create a usable MediaSourceHandle');
}, "Test main-thread-owned MediaSource instance cannot create a MediaSourceHandle");
// ensure that the implementation of this is not available per current spec.
assert_false(
"handle" in MediaSource.prototype,
"window MediaSource must not have handle in prototype");
}, "Test main-thread MediaSource does not have handle getter");

if (MediaSource.hasOwnProperty("canConstructInDedicatedWorker") && MediaSource.canConstructInDedicatedWorker === true) {
// If implementation claims support for MSE-in-Workers, then fetch and run
Expand Down

0 comments on commit 2108f20

Please sign in to comment.