• Matt Wolenetz's avatar
    MSE-in-Workers: Enable experimental proactive feature detection · 27d63ac8
    Matt Wolenetz authored
    Adds a readonly, boolean-valued, static attribute named
    `canConstructInDedicatedWorker` to the MediaSource interface.
    Currently, this attribute is only visible to web apps if the
    RunTimeEnabledFeature "MediaSourceInWorkers" is enabled. When visible,
    this attribute always returns true.
    
    The primary goal of having this attribute is to enable web app's main
    thread to proactively determine whether or not MSE is supported from a
    dedicated worker context *before* deciding whether or not to create or
    try using MSE from such a context.
    
    As an initial example of this use case, the existing MSE-in-Workers
    web_tests are updated to use this new attribute's existence and value
    to fail-fast rather than potentially flakily fail (e.g. previously, the
    ...worker-terminate test might flakily pass/fail some of its test cases
    on implementations lacking MSE-in-Workers support if the test completed
    before handling receipt of error message from worker.)
    
    A further test is added to ensure that, if the attribute is missing or
    exists but is not `true`, a dedicated worker does not have ability to
    construct a MediaSource instance. See also
    https://github.com/w3c/media-source/issues/175 for further discussion
    which led to this new attribute.
    
    BUG=878133
    
    Change-Id: I697ca6adc5b5dc65d5c5084ff67a541430a9237b
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2487834
    Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org>
    Reviewed-by: default avatarWill Cassella <cassew@google.com>
    Cr-Commit-Position: refs/heads/master@{#819564}
    27d63ac8
media_source.idl 3.22 KB