-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refine srcObject's MediaSourceHandle behavior #306
Refine srcObject's MediaSourceHandle behavior #306
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not clear on the best way to deal with a transfer of the MediaSourceHandle
while it is set on a srcObject
attribute. Alternatives to consider:
- Allow the transfer and error on the media element.
- Block transfer while on the
srcObject
attribute.
The "transfer steps" caller is expecting a possible exception fromDetachArrayBuffer(transferable)
in the [[ArrayBufferData]] case, so I guess "transfer steps" could also throw an exception. - Set [[Detached]] to true and transfer the underlying
MediaSource
reference "during setup worker attachment communication".
This approach might be tricky to extend to the scenario of unsetting from this media element attribute and setting on another media element. - Transfer the underlying
MediaSource
reference in thesrcObject
setter and transfer back when unset.
There is a slight difference in timing of options 3 and 4 due to awaiting stable state in the resource selection algorithm, and either of these timings could be applied to option 2.
media-source-respec.html
Outdated
<dt>If the media provider object is a {{MediaSourceHandle}} or a {{MediaSource}} that is already being used | ||
beyond this point as the media provider object in a different {{HTMLMediaElement}}'s | ||
<a def-id="resource-fetch-algorithm"></a></dt> | ||
<dd>Run the <a def-id="media-data-cannot-be-fetched"></a> steps of the <a | ||
def-id="resource-fetch-algorithm"></a>'s <a def-id="media-data-processing-steps-list"></a>.</dd> | ||
<dt>If {{MediaSource/readyState}} is NOT set to {{ReadyState/""closed""}}</dt> | ||
<dd>Run the <a def-id="media-data-cannot-be-fetched"></a> steps of the <a | ||
def-id="resource-fetch-algorithm"></a>'s <a def-id="media-data-processing-steps-list"></a>.</dd> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having the same kind of error path, as you describe, for multiple attachments of a single MediaSource
, regardless of whether from Window or Worker context, makes sense.
If a MediaSourceHandle
's [[Detached]] slot is true, then would this same path be taken?
(Consider transfer out of this Window context.)
If so, then explicitly saying here would be helpful.
But the decision here may depend on the choice of direction with the transfer-while-attached scenario.
I guess the alternative is to throw in the srcObject
setter, but there is no precedent for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your analysis and presentation of options. While I think each of those options are viable, I like options 1 and 2 best. They seem to be the simplest in concept and in implementation complexity. For option 1, the resulting MediaError.message could more readily indicate the reason for the error in that case. What are the timing considerations you mentioned might apply to option 2?
Note that initial prototype implementation in Chrome might just forgo some of the complexity involved in allowed sequential re-use of the same MediaSourceHandle (and add that later). The app can always create one or more extra MediaSource instances in the worker and get those handle(s) over to the main thread for readiness to use later as a workaround in the interim.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider the following two commands running under the same event (i.e. without a stable state between them):
video.srcObject = handle;
port.postMessage(null, [handle]);
With option 4, the postMessage()
would fail and the video would keep playing.
With option 3, [[Detached]] is not set to true until the next stable state, and so the postMessage()
would succeed and the video would error.
Option 2 may be spec'd by marking the handle as in use either in the srcObject
setter for similar behavior to option 4 or in the "setup worker attachment communication" steps for similar behavior to option 3.
I haven't looked into the when exactly the handle would become unused if unset from srcObject
, so there may be similar timing issues there for
video.srcObject = null; // previous value was handle
port.postMessage(null, [handle]);
Perhaps option 1 is immune to these subtleties.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ #306 (comment) :
I haven't looked into the when exactly the handle would become unused if unset from
srcObject
, so there may be similar timing issues there for. [...]
Examining the current html5 spec, upon setting srcObject, synchronous execution of the media element load algorithm is done, which has a step that synchronously detaches MediaSource
if one is the current assigned media provider object
. So it seems that an implementation could readily know on the main/window thread whether or not a particular MediaSourceHandle
object is currently assigned to any HTMLMediaElement
as srcObject
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yes. Thanks for identifying that.
So, if choosing to block transfer while in use (i.e. not option 1), then for some consistency with main-thread MediaSource detach, I guess a postMessage()
should succeed immediately after a handle is unset through srcObject
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@karlt, yes, I think I would prefer that.
I discussed this during today's Media Working Group Call, and also have shared this thread on the media WG mailing list to get wider input.
Previously, my preference was option 2 (throw exception if currently in use as srcObject
value), however I have just now observed an issue with that option (perhaps this is what you were trying to point out, too):
video.srcObject = handle;
port.postMessage(null, [handle]);
While the handle is immediately set to be the media element's assigned media provider object
, the synchronous portion of this setter (which runs the load algorithm, which then starts the resource selection algorithm) begins the actual attachment in an asynchronous set of steps once the next stable state has been reached. Therefore, the postMessage transfer mechanism, invoked synchronously before that stable state has been reached, does not know that handle
is in a state preventing transfer. So neither option 3 or 4 can enable option 2 to prevent transfer before that stable state has been reached.
Does this mean option 2 is infeasible? Maybe, unless we update the srcObject setter spec for when a MediaSourceHandle
is set as the assigned media provider object in the synchronous section of the steps following that assignment (for example, in the load algorithm). If we did that, then we could reliably know when the handle is assigned (or not) at any attempt to transfer it. (Note, unsetting the handle as assigned media provider object is already synchronously running MSE detachment as I noted earlier today.)
Overall, my preference is to lean towards giving application synchronous awareness of failure to transfer due to handle being in-use as srcObject already. I think this would help web authors avoid having to debug additional asynchronous error transitions that are already quite overloaded with various kinds of HTMLMediaElement and MSE errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that, if choosing to block transfer while in use, then marking the handle as in use synchronously from the srcObject
setter would produce the behavior with probably the least surprise.
@ #306 (comment) :
Examining the current html5 spec, upon setting srcObject, synchronous execution of the media element load algorithm is done, which has a step that synchronously detachesMediaSource
if one is the currentassigned media provider object
.
FWIW I was assuming this detach was for the old/previous assigned media provider object
. Perhaps that was intended, but that's not what the spec currently says. The srcObject
setter "must set the element's assigned media provider object
to the new value, and then invoke the element's media element load algorithm.", so the media element load algorithm detaches the new MediaSource
object.
Still a synchronous release of the handle from in use when cleared from srcObject
would be the least surprise behavior here.
media-source-respec.html
Outdated
<p class="note">For example, once a worker transfers a {{MediaSourceHandle}} to another context, it cannot | ||
transfer that handle again unless the another context first transfers it back to the worker. This prevents | ||
ability to clone {{MediaSourceHandle}} objects and helps prevent simultaneous attachment to distinct media | ||
elements using handles to the same underlying {{MediaSource}}.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The [[Detached]] internal slot provides single transfer for us, so your choice as to whether to have additional text here or not.
The intent is to prevent making more than one usable copy of a MediaSourceHandle for each MediaSource. Transfer semantics restrictions may not be sufficient, since basic serialization without transfer might be attempted. I propose trying something like this (adding to my current rough prototype in Chrome):
Hopefully this adds clarity to the intent. I'll now try updating the Chrome prototype to do this and see how it goes and respond further here. @karlt and others, if you see any blockers or concerns, please report them here ASAP. Thanks! |
Note the HTMLMediaElement.srcObject setter doesn't have option to throw exception, but we need to synchronously let the handle know it's in the process of starting a load even before the asynchronous load operation starts. We also need to be careful to protect against the following situation:
Based on that example, I propose changing [[CurrentlyAttached]] to be a counter |
While I assume it is possible to specify a serialize-once behavior, I always thought of such a behavior where the object becomes unusable after message passing to fit better with the [Transferable] concept rather than [Serializable]. "Transferring is effectively recreating the object while sharing a reference to the underlying data and then detaching the object being transferred." Serialization "allows them to be stored on disk and later restored". Was there a benefit to making the object [Serializable] rather than [Transferable]? |
Mostly this was due to the existing Chrome transferable infrastructure is clunky and might not do the required transfer steps in a completely interoperable order (from my brief reading). |
Regarding the specific postMessage exception: |
I've updated the chromium prototype change for this (circa patch set 28):
I've tested the basic scenarios manually and it seems to be working. |
@jernoble @karlt - I plan to proceed with getting the prototype in Chromium landed in parallel with updating this PR per the details as of #306 (comment) |
Thanks to @sandersdan I am now aware of potential further complications: |
Browser implementations are free to use different approaches if they can produce the same observable behavior. Extensions can modify behavior in any way the browser lets them, if they are prepared to expect consequences, so browsers can't expect to maintain interoperable behavior in the presence of arbitrary extensions. But what behavior would content see from passing a While merely transferable and not serializable, |
As I understand it, all major browser implement the same behavior for message posting, which is broadcasting to all content script realms. In WebCodecs we wanted to be able to have move semantics for The situation with
I would recommend that each receiver gets a valid handle, and that all valid handles are invalidated when one is attached.
I don't think this is an option. If there is a way to accomplish this combination, note that it would also prevent passing these handles through a |
I agree. Further, for a particular handle instance, if it has ever been assigned to an HTMLMediaElement srcObject (even if the subsequent asynchronous load was interrupted and the underlying MediaSource hadn't ever been attached successfully), then that handle instance can never be successfully serialized again. However, I think instantaneous serialization prevention of any handle instance in any realm with the same underlying MediaSource (such multiple instances can happen if extensions/broadcasts cause clones of the original single handle retrieved from MediaSource.getHandle()) upon any of those handles ever being assigned as srcObject to an HTMLMediaElement would risk security (could enable malicious high-resolution timer attacks). So I think the following may be the best approach. If we find later that these restrictions can be relaxed, we can update the spec and implementations further:
|
Adds core MediaSourceHandle interface and modules implementation. Later changes will enable apps to get a handle from a dedicated worker MediaSource, post it to the main thread and attach it to an HTMLMediaElement via the srcObject attribute; they will also include test updates. References: Full prototype CL: https://chromium-review.googlesource.com/c/chromium/src/+/3515334 MSE spec issue: w3c/media-source#175 MSE spec feature updates switching from worker MSE attachment via object URL to attachment via srcObject MediaSourceHandle: * w3c/media-source#305 * further clarifications in discussion at w3c/media-source#306 (comment) BUG=878133 Change-Id: I9a3b47ea02d2755a9860999e245eafc26f864977 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3687146 Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org> Reviewed-by: Kentaro Hara <haraken@chromium.org> Reviewed-by: Dale Curtis <dalecurtis@chromium.org> Cr-Commit-Position: refs/heads/main@{#1012115}
Adds ability for apps to get a MediaSourceHandle from a dedicated worker MediaSource instance, gated by RuntimeEnabledFeature "MediaSourceInWorkersUsingHandle". Updates the PassKey required for creation of a concrete MediaSourceAttachmentSupplement to allow that only from either URLMediaSource::createObjectURL or the new MediaSource::getHandle method. This specificity is enabled by a new AttachmentCreationPassKeyProvider type. Later changes will enable apps to post the handle to the main thread and attach it to an HTMLMediaElement via the srcObject attribute; they will also include test updates. References: Full prototype CL: https://chromium-review.googlesource.com/c/chromium/src/+/3515334 MSE spec issue: w3c/media-source#175 MSE spec feature updates switching from worker MSE attachment via object URL to attachment via srcObject MediaSourceHandle: * w3c/media-source#305 * further clarifications in discussion at w3c/media-source#306 (comment) crbug.com/506273 is somewhat related, but not fixed by this change (it refers to directly setting MediaSource on Window context to the media element's srcObject attribute.) This change sequence is specific to enabling MSE-in-Worker attachment via srcObject using a handle object. BUG=878133,506273 Change-Id: Ic61f4cc4193080bdbc39234b98897d9a789778d6 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3688613 Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org> Reviewed-by: Will Cassella <cassew@chromium.org> Cr-Commit-Position: refs/heads/main@{#1012129}
Adds ability to serialize a MediaSourceHandleImpl, conditionally failing with DataCloneError if the handle is_serialized() already or if the handle is_used() (both of those are initialized to be false in the new instance created during deserialization.) Later changes will enable apps to attach the handle to a main thread HTMLMediaElement via the srcObject attribute; they will also include test updates. References: Full prototype CL: https://chromium-review.googlesource.com/c/chromium/src/+/3515334 MSE spec issue: w3c/media-source#175 MSE spec feature updates switching from worker MSE attachment via object URL to attachment via srcObject MediaSourceHandle: * w3c/media-source#305 * further clarifications in discussion at w3c/media-source#306 (comment) BUG=878133 Change-Id: I19cc8a450423964aef78e8e468776e8cd912503a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3688599 Reviewed-by: Will Cassella <cassew@chromium.org> Reviewed-by: Kentaro Hara <haraken@chromium.org> Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org> Cr-Commit-Position: refs/heads/main@{#1012132}
Adds ability to attach a dedicated-worker-owned MediaSource to an HTMLMediaElement using a MediaSourceHandle for that MediaSource instance that the app has posted over to the main thread and assigned to the srcObject attribute on the media element. Previously, only a MediaStream could be set as a srcObject in Chrome. This change adds the relevant MediaProvider IDL union type and makes it the type of that srcObject attribute. For historical reasons, the srcObject attribute of an HTMLMediaElement is implemented in modules as a partial interface; this change updates that partial interface as well as the media element implementation to enable the scenario without regressing existing ability to use MediaStream as media element's srcObject. The attachment of the worker MediaSource using the handle does not involve lookup into a URL registry; rather, an internal blob URL is built into the handle when it was retrieved from the MediaSource and that URL is used to satisfy existing media element load safety checks as well as provide the underlying WebMediaPlayer a URL that it can use when logging to devtools. Later changes will add further test updates and remove the previous ability to attach a worker MediaSource using a registered object URL. References: Full prototype CL: https://chromium-review.googlesource.com/c/chromium/src/+/3515334 MSE spec issue: w3c/media-source#175 MSE spec feature updates switching from worker MSE attachment via object URL to attachment via srcObject MediaSourceHandle: * w3c/media-source#305 * further clarifications in discussion at w3c/media-source#306 (comment) crbug.com/506273 is somewhat related, but not fixed by this change (it refers to directly setting MediaSource on Window context to the media element's srcObject attribute.) This change sequence is specific to enabling MSE-in-Worker attachment via srcObject using a handle object. BUG=878133,506273 Change-Id: I86cddd87bafae1c7cbae9e94ea4614418067012f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3688740 Reviewed-by: Kentaro Hara <haraken@chromium.org> Reviewed-by: Elad Alon <eladalon@chromium.org> Reviewed-by: Dale Curtis <dalecurtis@chromium.org> Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org> Cr-Commit-Position: refs/heads/main@{#1012202}
If the MediaSourceInWorkersUsingHandle feature is enabled, this change prevents successful ability of obtaining an objectURL that would succeed in loading a worker-owned MediaSource. It changes the wpt tests to use handle for attachment and verifies expected new behavior of getHandle and that worker objectURL attachment fails (these tests run on experimental builds of Chromium with currently-experimental MediaSourceInWorkersUsingHandle feature enabled, just like the currently-experimental MediaSourceInWorkers feature.) References: Full prototype CL for the parts 1-4 that have already landed: https://chromium-review.googlesource.com/c/chromium/src/+/3515334 MSE spec issue: w3c/media-source#175 MSE spec feature updates switching from worker MSE attachment via object URL to attachment via srcObject MediaSourceHandle: * w3c/media-source#305 * further clarifications in discussion at w3c/media-source#306 (comment) BUG=878133 Change-Id: I60ddca79ee0f95c87b6d84e4f44ad9c283f359a3
If the MediaSourceInWorkersUsingHandle feature is enabled, this change prevents successful ability of obtaining an objectURL that would succeed in loading a worker-owned MediaSource. It changes the wpt tests to use handle for attachment and verifies expected new behavior of getHandle and that worker objectURL attachment fails (these tests run on experimental builds of Chromium with currently-experimental MediaSourceInWorkersUsingHandle feature enabled, just like the currently-experimental MediaSourceInWorkers feature.) References: Full prototype CL for the parts 1-4 that have already landed: https://chromium-review.googlesource.com/c/chromium/src/+/3515334 MSE spec issue: w3c/media-source#175 MSE spec feature updates switching from worker MSE attachment via object URL to attachment via srcObject MediaSourceHandle: * w3c/media-source#305 * further clarifications in discussion at w3c/media-source#306 (comment) BUG=878133 Change-Id: I60ddca79ee0f95c87b6d84e4f44ad9c283f359a3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3698231 Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org> Auto-Submit: Matthew Wolenetz <wolenetz@chromium.org> Reviewed-by: Will Cassella <cassew@chromium.org> Cr-Commit-Position: refs/heads/main@{#1012712}
If the MediaSourceInWorkersUsingHandle feature is enabled, this change prevents successful ability of obtaining an objectURL that would succeed in loading a worker-owned MediaSource. It changes the wpt tests to use handle for attachment and verifies expected new behavior of getHandle and that worker objectURL attachment fails (these tests run on experimental builds of Chromium with currently-experimental MediaSourceInWorkersUsingHandle feature enabled, just like the currently-experimental MediaSourceInWorkers feature.) References: Full prototype CL for the parts 1-4 that have already landed: https://chromium-review.googlesource.com/c/chromium/src/+/3515334 MSE spec issue: w3c/media-source#175 MSE spec feature updates switching from worker MSE attachment via object URL to attachment via srcObject MediaSourceHandle: * w3c/media-source#305 * further clarifications in discussion at w3c/media-source#306 (comment) BUG=878133 Change-Id: I60ddca79ee0f95c87b6d84e4f44ad9c283f359a3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3698231 Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org> Auto-Submit: Matthew Wolenetz <wolenetz@chromium.org> Reviewed-by: Will Cassella <cassew@chromium.org> Cr-Commit-Position: refs/heads/main@{#1012712}
If the MediaSourceInWorkersUsingHandle feature is enabled, this change prevents successful ability of obtaining an objectURL that would succeed in loading a worker-owned MediaSource. It changes the wpt tests to use handle for attachment and verifies expected new behavior of getHandle and that worker objectURL attachment fails (these tests run on experimental builds of Chromium with currently-experimental MediaSourceInWorkersUsingHandle feature enabled, just like the currently-experimental MediaSourceInWorkers feature.) References: Full prototype CL for the parts 1-4 that have already landed: https://chromium-review.googlesource.com/c/chromium/src/+/3515334 MSE spec issue: w3c/media-source#175 MSE spec feature updates switching from worker MSE attachment via object URL to attachment via srcObject MediaSourceHandle: * w3c/media-source#305 * further clarifications in discussion at w3c/media-source#306 (comment) BUG=878133 Change-Id: I60ddca79ee0f95c87b6d84e4f44ad9c283f359a3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3698231 Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org> Auto-Submit: Matthew Wolenetz <wolenetz@chromium.org> Reviewed-by: Will Cassella <cassew@chromium.org> Cr-Commit-Position: refs/heads/main@{#1012712}
…bjectURL" This reverts commit 6315549. Reason for revert: This is causing failures on the WebKit Linux Leak builder i.e. https://ci.chromium.org/ui/p/chromium/builders/ci/WebKit%20Linux%20Leak/39394/overview Original change's description: > MSE-in-Workers: srcObject part 5: Conditionally fail worker objectURL > > If the MediaSourceInWorkersUsingHandle feature is enabled, this change > prevents successful ability of obtaining an objectURL that would succeed > in loading a worker-owned MediaSource. > > It changes the wpt tests to use handle for attachment and verifies > expected new behavior of getHandle and that worker objectURL attachment > fails (these tests run on experimental builds of Chromium with > currently-experimental MediaSourceInWorkersUsingHandle feature enabled, > just like the currently-experimental MediaSourceInWorkers feature.) > > References: > Full prototype CL for the parts 1-4 that have already landed: > https://chromium-review.googlesource.com/c/chromium/src/+/3515334 > MSE spec issue: > w3c/media-source#175 > MSE spec feature updates switching from worker MSE attachment via > object URL to attachment via srcObject MediaSourceHandle: > * w3c/media-source#305 > * further clarifications in discussion at > w3c/media-source#306 (comment) > > BUG=878133 > > Change-Id: I60ddca79ee0f95c87b6d84e4f44ad9c283f359a3 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3698231 > Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org> > Auto-Submit: Matthew Wolenetz <wolenetz@chromium.org> > Reviewed-by: Will Cassella <cassew@chromium.org> > Cr-Commit-Position: refs/heads/main@{#1012712} Bug: 878133 Change-Id: I1e405ae1de146d1f3183592b00a43bd3c38d849d No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3695890 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Nidhi Jaju <nidhijaju@chromium.org> Owners-Override: Nidhi Jaju <nidhijaju@chromium.org> Cr-Commit-Position: refs/heads/main@{#1012823}
…bjectURL" This reverts commit 6315549b8c2ece3dbbf3062c1a87347589a5e115. Reason for revert: This is causing failures on the WebKit Linux Leak builder i.e. https://ci.chromium.org/ui/p/chromium/builders/ci/WebKit%20Linux%20Leak/39394/overview Original change's description: > MSE-in-Workers: srcObject part 5: Conditionally fail worker objectURL > > If the MediaSourceInWorkersUsingHandle feature is enabled, this change > prevents successful ability of obtaining an objectURL that would succeed > in loading a worker-owned MediaSource. > > It changes the wpt tests to use handle for attachment and verifies > expected new behavior of getHandle and that worker objectURL attachment > fails (these tests run on experimental builds of Chromium with > currently-experimental MediaSourceInWorkersUsingHandle feature enabled, > just like the currently-experimental MediaSourceInWorkers feature.) > > References: > Full prototype CL for the parts 1-4 that have already landed: > https://chromium-review.googlesource.com/c/chromium/src/+/3515334 > MSE spec issue: > w3c/media-source#175 > MSE spec feature updates switching from worker MSE attachment via > object URL to attachment via srcObject MediaSourceHandle: > * w3c/media-source#305 > * further clarifications in discussion at > w3c/media-source#306 (comment) > > BUG=878133 > > Change-Id: I60ddca79ee0f95c87b6d84e4f44ad9c283f359a3 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3698231 > Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org> > Auto-Submit: Matthew Wolenetz <wolenetz@chromium.org> > Reviewed-by: Will Cassella <cassew@chromium.org> > Cr-Commit-Position: refs/heads/main@{#1012712} Bug: 878133 Change-Id: I1e405ae1de146d1f3183592b00a43bd3c38d849d No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3695890 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Nidhi Jaju <nidhijaju@chromium.org> Owners-Override: Nidhi Jaju <nidhijaju@chromium.org> Cr-Commit-Position: refs/heads/main@{#1012823}
…bjectURL" This reverts commit 6315549b8c2ece3dbbf3062c1a87347589a5e115. Reason for revert: This is causing failures on the WebKit Linux Leak builder i.e. https://ci.chromium.org/ui/p/chromium/builders/ci/WebKit%20Linux%20Leak/39394/overview Original change's description: > MSE-in-Workers: srcObject part 5: Conditionally fail worker objectURL > > If the MediaSourceInWorkersUsingHandle feature is enabled, this change > prevents successful ability of obtaining an objectURL that would succeed > in loading a worker-owned MediaSource. > > It changes the wpt tests to use handle for attachment and verifies > expected new behavior of getHandle and that worker objectURL attachment > fails (these tests run on experimental builds of Chromium with > currently-experimental MediaSourceInWorkersUsingHandle feature enabled, > just like the currently-experimental MediaSourceInWorkers feature.) > > References: > Full prototype CL for the parts 1-4 that have already landed: > https://chromium-review.googlesource.com/c/chromium/src/+/3515334 > MSE spec issue: > w3c/media-source#175 > MSE spec feature updates switching from worker MSE attachment via > object URL to attachment via srcObject MediaSourceHandle: > * w3c/media-source#305 > * further clarifications in discussion at > w3c/media-source#306 (comment) > > BUG=878133 > > Change-Id: I60ddca79ee0f95c87b6d84e4f44ad9c283f359a3 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3698231 > Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org> > Auto-Submit: Matthew Wolenetz <wolenetz@chromium.org> > Reviewed-by: Will Cassella <cassew@chromium.org> > Cr-Commit-Position: refs/heads/main@{#1012712} Bug: 878133 Change-Id: I1e405ae1de146d1f3183592b00a43bd3c38d849d No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3695890 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Nidhi Jaju <nidhijaju@chromium.org> Owners-Override: Nidhi Jaju <nidhijaju@chromium.org> Cr-Commit-Position: refs/heads/main@{#1012823}
…ionally fail worker objectURL, a=testonly Automatic update from web-platform-tests MSE-in-Workers: srcObject part 5: Conditionally fail worker objectURL If the MediaSourceInWorkersUsingHandle feature is enabled, this change prevents successful ability of obtaining an objectURL that would succeed in loading a worker-owned MediaSource. It changes the wpt tests to use handle for attachment and verifies expected new behavior of getHandle and that worker objectURL attachment fails (these tests run on experimental builds of Chromium with currently-experimental MediaSourceInWorkersUsingHandle feature enabled, just like the currently-experimental MediaSourceInWorkers feature.) References: Full prototype CL for the parts 1-4 that have already landed: https://chromium-review.googlesource.com/c/chromium/src/+/3515334 MSE spec issue: w3c/media-source#175 MSE spec feature updates switching from worker MSE attachment via object URL to attachment via srcObject MediaSourceHandle: * w3c/media-source#305 * further clarifications in discussion at w3c/media-source#306 (comment) BUG=878133 Change-Id: I60ddca79ee0f95c87b6d84e4f44ad9c283f359a3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3698231 Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org> Auto-Submit: Matthew Wolenetz <wolenetz@chromium.org> Reviewed-by: Will Cassella <cassew@chromium.org> Cr-Commit-Position: refs/heads/main@{#1012712} -- wpt-commits: 3fec1e386568b78c390acee2307b5a07b75e3d30 wpt-pr: 34364
…: Conditionally fail worker objectURL", a=testonly Automatic update from web-platform-tests Revert "MSE-in-Workers: srcObject part 5: Conditionally fail worker objectURL" This reverts commit 6315549b8c2ece3dbbf3062c1a87347589a5e115. Reason for revert: This is causing failures on the WebKit Linux Leak builder i.e. https://ci.chromium.org/ui/p/chromium/builders/ci/WebKit%20Linux%20Leak/39394/overview Original change's description: > MSE-in-Workers: srcObject part 5: Conditionally fail worker objectURL > > If the MediaSourceInWorkersUsingHandle feature is enabled, this change > prevents successful ability of obtaining an objectURL that would succeed > in loading a worker-owned MediaSource. > > It changes the wpt tests to use handle for attachment and verifies > expected new behavior of getHandle and that worker objectURL attachment > fails (these tests run on experimental builds of Chromium with > currently-experimental MediaSourceInWorkersUsingHandle feature enabled, > just like the currently-experimental MediaSourceInWorkers feature.) > > References: > Full prototype CL for the parts 1-4 that have already landed: > https://chromium-review.googlesource.com/c/chromium/src/+/3515334 > MSE spec issue: > w3c/media-source#175 > MSE spec feature updates switching from worker MSE attachment via > object URL to attachment via srcObject MediaSourceHandle: > * w3c/media-source#305 > * further clarifications in discussion at > w3c/media-source#306 (comment) > > BUG=878133 > > Change-Id: I60ddca79ee0f95c87b6d84e4f44ad9c283f359a3 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3698231 > Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org> > Auto-Submit: Matthew Wolenetz <wolenetz@chromium.org> > Reviewed-by: Will Cassella <cassew@chromium.org> > Cr-Commit-Position: refs/heads/main@{#1012712} Bug: 878133 Change-Id: I1e405ae1de146d1f3183592b00a43bd3c38d849d No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3695890 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Nidhi Jaju <nidhijaju@chromium.org> Owners-Override: Nidhi Jaju <nidhijaju@chromium.org> Cr-Commit-Position: refs/heads/main@{#1012823} -- wpt-commits: 9589b7d7210eb65f30af294f454912a5e90a7d53 wpt-pr: 34371
That sounds very inefficient, especially for something large like a
I would guess that
There is no new object ownership model proposed here.
Transferable objects already exist without any need to be Serializable: All these objects serve a similar purpose to
A sensible way to implement and even spec
What do you mean by We don't have any need to pass |
…mpler [SameObject] handle attr, a=testonly Automatic update from web-platform-tests MSE-in-Workers: Switch getHandle() to simpler [SameObject] handle attr 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} -- wpt-commits: 5d309d6f31a279218ff15302e8cfa22c95028267 wpt-pr: 34827
With [spec PR #306](w3c/media-source#306) merged and with implementation landed corresponding to that spec already landed in Chromium as of 105.0.5180, MSE-in-Workers requires a MediaSourceHandle transferred from a dedicated worker to attach a worker MediaSource to a media element. This change updates the demo to check for the necessary support and, use handle and srcObject for worker mediasource attachment (still leaving legacy MediaSource object URL for main thread mediasource attachments), and updates various instructions and READMEs accordingly.
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 PR with handle usage refinements: w3c/media-source#306 Intent-to-ship=https://groups.google.com/a/chromium.org/g/blink-dev/c/FRY3F1v6Two (Initial CL landed in trunk. Expectation is to land this cherry pick merge in M105 branch upon approval of merge following bake in Canary, to meet the intent of shipping in M105.) BUG=878133 (cherry picked from commit d32d977) Change-Id: If8c429b3615a6539699c4fb0e744e9f848ab1226 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3781750 Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org> Commit-Queue: Mike Taylor <miketaylr@chromium.org> Auto-Submit: Matthew Wolenetz <wolenetz@chromium.org> Reviewed-by: Mike Taylor <miketaylr@chromium.org> Cr-Original-Commit-Position: refs/heads/main@{#1030243} Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3795560 Cr-Commit-Position: refs/branch-heads/5195@{#170} Cr-Branched-From: 7aa3f07-refs/heads/main@{#1027018}
…y switching features to stable" This reverts commit aa0e398. Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=1358542 Original change's description: > [To M105] MSE-in-Workers: Launch by switching features to stable > > 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 PR with handle usage refinements: > w3c/media-source#306 > > Intent-to-ship=https://groups.google.com/a/chromium.org/g/blink-dev/c/FRY3F1v6Two > > (Initial CL landed in trunk. Expectation is to land this cherry pick > merge in M105 branch upon approval of merge following bake in Canary, > to meet the intent of shipping in M105.) > > BUG=878133 > > (cherry picked from commit d32d977) > > Change-Id: If8c429b3615a6539699c4fb0e744e9f848ab1226 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3781750 > Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org> > Commit-Queue: Mike Taylor <miketaylr@chromium.org> > Auto-Submit: Matthew Wolenetz <wolenetz@chromium.org> > Reviewed-by: Mike Taylor <miketaylr@chromium.org> > Cr-Original-Commit-Position: refs/heads/main@{#1030243} > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3795560 > Cr-Commit-Position: refs/branch-heads/5195@{chromium#170} > Cr-Branched-From: 7aa3f07-refs/heads/main@{#1027018} (cherry picked from commit d5cef2e) (cherry picked from commit 23866ed) Bug: 878133 Change-Id: Ida6148ddd29efdd0fe1944cda2a8aee1e8675894 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3869184 Owners-Override: Prudhvikumar Bommana <pbommana@google.com> Reviewed-by: Prudhvikumar Bommana <pbommana@google.com> Commit-Queue: Dale Curtis <dalecurtis@chromium.org> Cr-Original-Original-Commit-Position: refs/branch-heads/5195@{#1039} Cr-Original-Original-Branched-From: 7aa3f07-refs/heads/main@{#1027018} Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3864081 Owners-Override: Srinivas Sista <srinivassista@chromium.org> Reviewed-by: Srinivas Sista <srinivassista@chromium.org> Commit-Queue: Srinivas Sista <srinivassista@chromium.org> Cr-Original-Commit-Position: refs/branch-heads/5195_55@{#3} Cr-Original-Branched-From: 14225de-refs/branch-heads/5195@{#856} Cr-Original-Branched-From: 7aa3f07-refs/heads/main@{#1027018} Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3871976 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Reviewed-by: Krishna Govind <govind@chromium.org> Owners-Override: Krishna Govind <govind@chromium.org> Cr-Commit-Position: refs/branch-heads/5195_68@{#8} Cr-Branched-From: ad13e82-refs/branch-heads/5195@{#903} Cr-Branched-From: 7aa3f07-refs/heads/main@{#1027018}
…stable" This reverts commit d32d977. Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=1358542 Original change's description: > MSE-in-Workers: Launch by switching features to stable > > 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 PR with handle usage refinements: > w3c/media-source#306 > > Intent-to-ship=https://groups.google.com/a/chromium.org/g/blink-dev/c/FRY3F1v6Two > Though this is landing in trunk, expectation is to request merge of > this to M105 branch ASAP once landed and baked, to meet the intent of > shipping in M105. > > BUG=878133 > > Change-Id: If8c429b3615a6539699c4fb0e744e9f848ab1226 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3781750 > Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org> > Commit-Queue: Mike Taylor <miketaylr@chromium.org> > Auto-Submit: Matthew Wolenetz <wolenetz@chromium.org> > Reviewed-by: Mike Taylor <miketaylr@chromium.org> > Cr-Commit-Position: refs/heads/main@{#1030243} Bug: 878133, 1358542 Change-Id: I5b15b0f244962c727099132a7d1e70d67e1d247e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3905489 Reviewed-by: Mike Taylor <miketaylr@chromium.org> Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org> Cr-Commit-Position: refs/heads/main@{#1048799}
…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
This reverts commit aa0e398. Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=1358542 Original change's description: > [To M105] MSE-in-Workers: Launch by switching features to stable > > 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 PR with handle usage refinements: > w3c/media-source#306 > > Intent-to-ship=https://groups.google.com/a/chromium.org/g/blink-dev/c/FRY3F1v6Two > > (Initial CL landed in trunk. Expectation is to land this cherry pick > merge in M105 branch upon approval of merge following bake in Canary, > to meet the intent of shipping in M105.) > > BUG=878133 > > (cherry picked from commit d32d977) > > Change-Id: If8c429b3615a6539699c4fb0e744e9f848ab1226 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3781750 > Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org> > Commit-Queue: Mike Taylor <miketaylr@chromium.org> > Auto-Submit: Matthew Wolenetz <wolenetz@chromium.org> > Reviewed-by: Mike Taylor <miketaylr@chromium.org> > Cr-Original-Commit-Position: refs/heads/main@{#1030243} > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3795560 > Cr-Commit-Position: refs/branch-heads/5195@{#170} > Cr-Branched-From: 7aa3f07-refs/heads/main@{#1027018} (cherry picked from commit d5cef2e) Bug: 878133 Change-Id: Ida6148ddd29efdd0fe1944cda2a8aee1e8675894 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3869184 Owners-Override: Prudhvikumar Bommana <pbommana@google.com> Reviewed-by: Prudhvikumar Bommana <pbommana@google.com> Commit-Queue: Dale Curtis <dalecurtis@chromium.org> Cr-Original-Commit-Position: refs/branch-heads/5195@{#1039} Cr-Original-Branched-From: 7aa3f07-refs/heads/main@{#1027018} Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3868458 Reviewed-by: Thomas Guilbert <tguilbert@chromium.org> Reviewed-by: Frank Liberato <liberato@chromium.org> Commit-Queue: Frank Liberato <liberato@chromium.org> Auto-Submit: Dale Curtis <dalecurtis@chromium.org> Commit-Queue: Thomas Guilbert <tguilbert@chromium.org> Cr-Commit-Position: refs/branch-heads/5249@{#310} Cr-Branched-From: 4f7bea5-refs/heads/main@{#1036826}
…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}
…icted This undoes the previous launch revert commit 887a8c4, 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}
…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}
Adds core MediaSourceHandle interface and modules implementation. Later changes will enable apps to get a handle from a dedicated worker MediaSource, post it to the main thread and attach it to an HTMLMediaElement via the srcObject attribute; they will also include test updates. References: Full prototype CL: https://chromium-review.googlesource.com/c/chromium/src/+/3515334 MSE spec issue: w3c/media-source#175 MSE spec feature updates switching from worker MSE attachment via object URL to attachment via srcObject MediaSourceHandle: * w3c/media-source#305 * further clarifications in discussion at w3c/media-source#306 (comment) BUG=878133 Change-Id: I9a3b47ea02d2755a9860999e245eafc26f864977 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3687146 Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org> Reviewed-by: Kentaro Hara <haraken@chromium.org> Reviewed-by: Dale Curtis <dalecurtis@chromium.org> Cr-Commit-Position: refs/heads/main@{#1012115} NOKEYCHECK=True GitOrigin-RevId: 2813392442e5ff5cc8702a743bdd52a1bab82be4
Adds ability for apps to get a MediaSourceHandle from a dedicated worker MediaSource instance, gated by RuntimeEnabledFeature "MediaSourceInWorkersUsingHandle". Updates the PassKey required for creation of a concrete MediaSourceAttachmentSupplement to allow that only from either URLMediaSource::createObjectURL or the new MediaSource::getHandle method. This specificity is enabled by a new AttachmentCreationPassKeyProvider type. Later changes will enable apps to post the handle to the main thread and attach it to an HTMLMediaElement via the srcObject attribute; they will also include test updates. References: Full prototype CL: https://chromium-review.googlesource.com/c/chromium/src/+/3515334 MSE spec issue: w3c/media-source#175 MSE spec feature updates switching from worker MSE attachment via object URL to attachment via srcObject MediaSourceHandle: * w3c/media-source#305 * further clarifications in discussion at w3c/media-source#306 (comment) crbug.com/506273 is somewhat related, but not fixed by this change (it refers to directly setting MediaSource on Window context to the media element's srcObject attribute.) This change sequence is specific to enabling MSE-in-Worker attachment via srcObject using a handle object. BUG=878133,506273 Change-Id: Ic61f4cc4193080bdbc39234b98897d9a789778d6 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3688613 Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org> Reviewed-by: Will Cassella <cassew@chromium.org> Cr-Commit-Position: refs/heads/main@{#1012129} NOKEYCHECK=True GitOrigin-RevId: 09e5fb1a68416f65ef2255c846b81a46f6aa8e52
Adds ability to serialize a MediaSourceHandleImpl, conditionally failing with DataCloneError if the handle is_serialized() already or if the handle is_used() (both of those are initialized to be false in the new instance created during deserialization.) Later changes will enable apps to attach the handle to a main thread HTMLMediaElement via the srcObject attribute; they will also include test updates. References: Full prototype CL: https://chromium-review.googlesource.com/c/chromium/src/+/3515334 MSE spec issue: w3c/media-source#175 MSE spec feature updates switching from worker MSE attachment via object URL to attachment via srcObject MediaSourceHandle: * w3c/media-source#305 * further clarifications in discussion at w3c/media-source#306 (comment) BUG=878133 Change-Id: I19cc8a450423964aef78e8e468776e8cd912503a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3688599 Reviewed-by: Will Cassella <cassew@chromium.org> Reviewed-by: Kentaro Hara <haraken@chromium.org> Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org> Cr-Commit-Position: refs/heads/main@{#1012132} NOKEYCHECK=True GitOrigin-RevId: d5d391975da969d6242e5785c68609d6cd15fda3
Adds ability to attach a dedicated-worker-owned MediaSource to an HTMLMediaElement using a MediaSourceHandle for that MediaSource instance that the app has posted over to the main thread and assigned to the srcObject attribute on the media element. Previously, only a MediaStream could be set as a srcObject in Chrome. This change adds the relevant MediaProvider IDL union type and makes it the type of that srcObject attribute. For historical reasons, the srcObject attribute of an HTMLMediaElement is implemented in modules as a partial interface; this change updates that partial interface as well as the media element implementation to enable the scenario without regressing existing ability to use MediaStream as media element's srcObject. The attachment of the worker MediaSource using the handle does not involve lookup into a URL registry; rather, an internal blob URL is built into the handle when it was retrieved from the MediaSource and that URL is used to satisfy existing media element load safety checks as well as provide the underlying WebMediaPlayer a URL that it can use when logging to devtools. Later changes will add further test updates and remove the previous ability to attach a worker MediaSource using a registered object URL. References: Full prototype CL: https://chromium-review.googlesource.com/c/chromium/src/+/3515334 MSE spec issue: w3c/media-source#175 MSE spec feature updates switching from worker MSE attachment via object URL to attachment via srcObject MediaSourceHandle: * w3c/media-source#305 * further clarifications in discussion at w3c/media-source#306 (comment) crbug.com/506273 is somewhat related, but not fixed by this change (it refers to directly setting MediaSource on Window context to the media element's srcObject attribute.) This change sequence is specific to enabling MSE-in-Worker attachment via srcObject using a handle object. BUG=878133,506273 Change-Id: I86cddd87bafae1c7cbae9e94ea4614418067012f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3688740 Reviewed-by: Kentaro Hara <haraken@chromium.org> Reviewed-by: Elad Alon <eladalon@chromium.org> Reviewed-by: Dale Curtis <dalecurtis@chromium.org> Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org> Cr-Commit-Position: refs/heads/main@{#1012202} NOKEYCHECK=True GitOrigin-RevId: 756af69b67c9e40e0a0c92cb6c0a911c96ea6835
If the MediaSourceInWorkersUsingHandle feature is enabled, this change prevents successful ability of obtaining an objectURL that would succeed in loading a worker-owned MediaSource. It changes the wpt tests to use handle for attachment and verifies expected new behavior of getHandle and that worker objectURL attachment fails (these tests run on experimental builds of Chromium with currently-experimental MediaSourceInWorkersUsingHandle feature enabled, just like the currently-experimental MediaSourceInWorkers feature.) References: Full prototype CL for the parts 1-4 that have already landed: https://chromium-review.googlesource.com/c/chromium/src/+/3515334 MSE spec issue: w3c/media-source#175 MSE spec feature updates switching from worker MSE attachment via object URL to attachment via srcObject MediaSourceHandle: * w3c/media-source#305 * further clarifications in discussion at w3c/media-source#306 (comment) BUG=878133 Change-Id: I60ddca79ee0f95c87b6d84e4f44ad9c283f359a3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3698231 Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org> Auto-Submit: Matthew Wolenetz <wolenetz@chromium.org> Reviewed-by: Will Cassella <cassew@chromium.org> Cr-Commit-Position: refs/heads/main@{#1012712} NOKEYCHECK=True GitOrigin-RevId: 6315549b8c2ece3dbbf3062c1a87347589a5e115
…bjectURL" This reverts commit 6315549b8c2ece3dbbf3062c1a87347589a5e115. Reason for revert: This is causing failures on the WebKit Linux Leak builder i.e. https://ci.chromium.org/ui/p/chromium/builders/ci/WebKit%20Linux%20Leak/39394/overview Original change's description: > MSE-in-Workers: srcObject part 5: Conditionally fail worker objectURL > > If the MediaSourceInWorkersUsingHandle feature is enabled, this change > prevents successful ability of obtaining an objectURL that would succeed > in loading a worker-owned MediaSource. > > It changes the wpt tests to use handle for attachment and verifies > expected new behavior of getHandle and that worker objectURL attachment > fails (these tests run on experimental builds of Chromium with > currently-experimental MediaSourceInWorkersUsingHandle feature enabled, > just like the currently-experimental MediaSourceInWorkers feature.) > > References: > Full prototype CL for the parts 1-4 that have already landed: > https://chromium-review.googlesource.com/c/chromium/src/+/3515334 > MSE spec issue: > w3c/media-source#175 > MSE spec feature updates switching from worker MSE attachment via > object URL to attachment via srcObject MediaSourceHandle: > * w3c/media-source#305 > * further clarifications in discussion at > w3c/media-source#306 (comment) > > BUG=878133 > > Change-Id: I60ddca79ee0f95c87b6d84e4f44ad9c283f359a3 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3698231 > Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org> > Auto-Submit: Matthew Wolenetz <wolenetz@chromium.org> > Reviewed-by: Will Cassella <cassew@chromium.org> > Cr-Commit-Position: refs/heads/main@{#1012712} Bug: 878133 Change-Id: I1e405ae1de146d1f3183592b00a43bd3c38d849d No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3695890 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Nidhi Jaju <nidhijaju@chromium.org> Owners-Override: Nidhi Jaju <nidhijaju@chromium.org> Cr-Commit-Position: refs/heads/main@{#1012823} NOKEYCHECK=True GitOrigin-RevId: f438823c5527e6499b8dedb4eef7bb8ed43f4371
…bjectURL With the underlying leak fixed by https://chromium-review.googlesource.com/c/chromium/src/+/3704191, this change can be relanded now. Previous revert: > Revert "MSE-in-Workers: srcObject part 5: Conditionally fail worker objectURL" > > This reverts commit 6315549b8c2ece3dbbf3062c1a87347589a5e115. > > Reason for revert: This is causing failures on the WebKit Linux Leak builder > i.e. https://ci.chromium.org/ui/p/chromium/builders/ci/WebKit%20Linux%20Leak/39394/overview > > Original change's description: > > MSE-in-Workers: srcObject part 5: Conditionally fail worker objectURL > > > > If the MediaSourceInWorkersUsingHandle feature is enabled, this change > > prevents successful ability of obtaining an objectURL that would succeed > > in loading a worker-owned MediaSource. > > > > It changes the wpt tests to use handle for attachment and verifies > > expected new behavior of getHandle and that worker objectURL attachment > > fails (these tests run on experimental builds of Chromium with > > currently-experimental MediaSourceInWorkersUsingHandle feature enabled, > > just like the currently-experimental MediaSourceInWorkers feature.) > > > > References: > > Full prototype CL for the parts 1-4 that have already landed: > > https://chromium-review.googlesource.com/c/chromium/src/+/3515334 > > MSE spec issue: > > w3c/media-source#175 > > MSE spec feature updates switching from worker MSE attachment via > > object URL to attachment via srcObject MediaSourceHandle: > > * w3c/media-source#305 > > * further clarifications in discussion at > > w3c/media-source#306 (comment) > > > > BUG=878133 > > > > Change-Id: I60ddca79ee0f95c87b6d84e4f44ad9c283f359a3 > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3698231 > > Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org> > > Auto-Submit: Matthew Wolenetz <wolenetz@chromium.org> > > Reviewed-by: Will Cassella <cassew@chromium.org> > > Cr-Commit-Position: refs/heads/main@{#1012712} > > Bug: 878133 > Change-Id: I1e405ae1de146d1f3183592b00a43bd3c38d849d > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3695890 > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > Commit-Queue: Nidhi Jaju <nidhijaju@chromium.org> > Owners-Override: Nidhi Jaju <nidhijaju@chromium.org> > Cr-Commit-Position: refs/heads/main@{#1012823} Bug: 878133 Change-Id: I56e4ecd4d8b58d9d58ed3c575b0fb52f596b6fae Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3708465 Reviewed-by: Will Cassella <cassew@chromium.org> Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org> Cr-Commit-Position: refs/heads/main@{#1014755} NOKEYCHECK=True GitOrigin-RevId: 39878163d3ff90baabd342ad784671a4b54262ed
Updates serialization logic to reflect current state of discussion of MediaSourceHandle refinement in spec [1]: * MediaSourceHandle was previously Serializable-only. With this change, it is now Transferable-only. Data clone exception will occur if it is attempted to be serialized without transfer. Data clone exception will also occur if it is transferred more than once in same postMessage, or if it has already been transferred. * Updates MediaSourceHandleImpl to use "[[Detached]]" internal slot semantic to know when a handle instance has already been transferred. This is necessary, beyond just knowing if it has been serialized, because otherwise the following scenario could not be enforced: postMessage(null, [handle]); // Should succeed and detach handle. // Then, this should fail because handle is already detached: postMessage(handle, [handle]); * Manual tests verified the scenario for the following matches similar existing behavior for MessagePort transfer: postMessage( {x: handle, y: handle}, [handle]); // should succeed // on receipt: e.data.x === e.data.y should be true. Existing handle-based MSE-in-Worker web-platform-tests are updated to use transfer instead of just serialization to communicate the handles. Later changes may add greater coverage, similar to coverage developed locally while vetting this scenario and precedents like MessagePort transfer. Later change(s) may update the IDL and getHandle() implementation according to similar spec discussion that has requested consideration of using: [SameObject] handle() instead of current at-most-once getHandle() success. No change is made to the [[has_ever_been_used_as_srcObject]] logic: it is still necessary to prevent transferring-away of a handle instance once it has been assigned to the srcObject attribute of a media element. [1] w3c/media-source#306 (comment) BUG=878133,1338956 Change-Id: Icb64aa712a0ce310984ca5fa0e9e02bd9ac428b8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3733664 Reviewed-by: Kentaro Hara <haraken@chromium.org> Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org> Reviewed-by: Will Cassella <cassew@chromium.org> Cr-Commit-Position: refs/heads/main@{#1019793} NOKEYCHECK=True GitOrigin-RevId: 905719605fcf5dbb76a80db2dac60d3528139a05
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} NOKEYCHECK=True GitOrigin-RevId: dcf5b5d0185160a4f93c4882801becf2397ab890
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 PR with handle usage refinements: w3c/media-source#306 Intent-to-ship=https://groups.google.com/a/chromium.org/g/blink-dev/c/FRY3F1v6Two Though this is landing in trunk, expectation is to request merge of this to M105 branch ASAP once landed and baked, to meet the intent of shipping in M105. BUG=878133 Change-Id: If8c429b3615a6539699c4fb0e744e9f848ab1226 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3781750 Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org> Commit-Queue: Mike Taylor <miketaylr@chromium.org> Auto-Submit: Matthew Wolenetz <wolenetz@chromium.org> Reviewed-by: Mike Taylor <miketaylr@chromium.org> Cr-Commit-Position: refs/heads/main@{#1030243} NOKEYCHECK=True GitOrigin-RevId: d32d977b567e153ae9a41379ab87000c51e60568
…stable" This reverts commit d32d977b567e153ae9a41379ab87000c51e60568. Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=1358542 Original change's description: > MSE-in-Workers: Launch by switching features to stable > > 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 PR with handle usage refinements: > w3c/media-source#306 > > Intent-to-ship=https://groups.google.com/a/chromium.org/g/blink-dev/c/FRY3F1v6Two > Though this is landing in trunk, expectation is to request merge of > this to M105 branch ASAP once landed and baked, to meet the intent of > shipping in M105. > > BUG=878133 > > Change-Id: If8c429b3615a6539699c4fb0e744e9f848ab1226 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3781750 > Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org> > Commit-Queue: Mike Taylor <miketaylr@chromium.org> > Auto-Submit: Matthew Wolenetz <wolenetz@chromium.org> > Reviewed-by: Mike Taylor <miketaylr@chromium.org> > Cr-Commit-Position: refs/heads/main@{#1030243} Bug: 878133, 1358542 Change-Id: I5b15b0f244962c727099132a7d1e70d67e1d247e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3905489 Reviewed-by: Mike Taylor <miketaylr@chromium.org> Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org> Cr-Commit-Position: refs/heads/main@{#1048799} NOKEYCHECK=True GitOrigin-RevId: 887a8c4e3d5203b0528e7c911b24be3aa67d2b4e
…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} NOKEYCHECK=True GitOrigin-RevId: f0a6df51caab2aec1ad24e6e638e84d922a60550
…s and handle visibility restricted, a=testonly Automatic update from web-platform-tests MSE-in-Workers: Relaunch with flag guards and handle visibility restricted 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} -- wpt-commits: 2108f20a92a4073b8a16d00899e976ac3dc48673 wpt-pr: 36117
…s and handle visibility restricted, a=testonly Automatic update from web-platform-tests MSE-in-Workers: Relaunch with flag guards and handle visibility restricted 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} -- wpt-commits: 2108f20a92a4073b8a16d00899e976ac3dc48673 wpt-pr: 36117
Current description of this PR:
Overall intent for a
MediaSourceHandle
is that it should be[Transferable], and be restricted to "at most one" successful attachment
to the underlying
MediaSource
by a handle. Further, if aWindow
MediaSource
was previously attached using a legacy MSE object URL,subsequent attempts to use that
MediaSource
instance'sMediaSourceHandle
for attachment must also fail.Changes
MediaSource.getHandle()
to be a[SameObject] readonly attribute
namedhandle
.Adds HTMLMediaElement.srcObject extension subsection.
Updates MediaSourceHandle transfer and related attachment text to more
clearly indicate that transferring a handle prevents re-transfer of
that instance due to the [[Detached]] internal slot's logic, and that
transfer is also synchronously prevented if the handle instance's
[[has ever been assigned as srcobject]] internal slot is true. Also
adds multiple notes to describe intent and to clarify.
Updates the "attaching to a media element" text to indicate that a
MediaSourceHandle
can be attached successfully to at most one mediaelement ever.
Note that legacy MSE object URL attachments similarly already achieve
the same intent in existing implementations. This change includes a
clarification for MSE object URL attachments, since it was never the
intent even for main-thread
MediaSource
attachments for them to besuccessfully attached to more than one
HTMLMediaElement
at a time.The switch to more clear
srcObject
usage for worker MSE attachmentaffords the spec an opportunity to be more clear about this intent.
This refinement originates from discussion on the previous PR with
@karlt (#305) and from lengthy
discussion on this change itself at
#306.
This work is associated with the MSE-in-Worker spec issue:
#175
Original description of this PR (updated more recently per #306 (comment)):
Adds text intending to help prevent using one or more
MediaSourceHandle
for the same underlyingMediaSource
forsimultaneous, concurrent attachments to media elements:
MediaSource.getHandle()
to succeed at most once perMediaSource
instance.MediaSourceHandle
transfer section to more clearly indicatethat transferring a handle out of a context makes that handle
unavailable for transferring again out of the same context (unless it
is first transferred back to that context).
MediaSourceHandle
can be attached successfully to at most one mediaelement at a time, and with the previous 2 clarifications, ensures
that the underlying worker context
MediaSource
can only be attachedsuccessfully to at most one media element at a time.
Note that legacy MSE object URL attachments similarly already achieve
the same intent in existing implementations. This change includes a
clarification for those similar to the third bullet, but for a
MediaSource
in the "attaching to a media element" text, since it wasnever the intent even for main-thread
MediaSource
attachments for themto be successfully attached to more than one
HTMLMediaElement
at atime. The switch to more clear
srcObject
usage for worker MSEattachment affords the spec an opportunity to be more clear about this
intent.
This refinement originates from discussion on the previous PR with
@karlt: #305
This work is associated with the MSE-in-Worker spec issue:
#175
Preview | Diff