MSE-in-Workers: Switch getHandle() to simpler [SameObject] handle attr #34827
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Following discussion in the spec PR #306 [1], this change updates the
way to obtain a MediaSourceHandle to be via a "handle" attribute on the
MediaSource instance that is both readonly and always returns the same
object (or throws exception, if for instance, it is attempted to be read
from a main-thread-owned MediaSource instance instead of a dedicated-
worker-owned MediaSource instance).
Also included is the removal of the readyState check when attempting to
obtain this handle (since it is now never expected to be changeable; no
sequence of distinct handles is ever expected to be obtainable from a
worker MediaSource). Also removed is the prevention of retrieving such a
handle from an instance more than once.
Multiple tests are added or updated to ensure correct behavior.
[1] w3c/media-source#306
BUG=878133
Change-Id: Ic07095d6d1dc95b8e6be818027984600aa7ab334
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3750140
Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org>
Reviewed-by: Will Cassella <cassew@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1024034}