-
Notifications
You must be signed in to change notification settings - Fork 139
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
SharedWorker support? #635
Comments
Ah, VideoFrame is interesting since it is transferable/serializable but is only exposed in window/DedicatedWorker. I do not see anything particularly wrong in having VideoFrames in all workers, except the use cases are probably smaller in non dedicated workers.
For VideoFrame or for all WebCodecs, i.e. encoders/decoders? |
I think it would make sense to expose everything if we can for consistency. I'd be fine with just VideoFrame if there's reasons we shouldn't for the codecs though. |
You'll get a
A more conservative approach would be to only expose what we need for the use cases we know of. I'd favor that since exposing more later is cheap, but once we've exposed something, it's much harder if not impossible to put back in the bottle. For instance, the wpt mentioned verifies that "frames cannot be transferred to serviceworker". |
For instance, VideoFrames may hold on to physical resources. So preventing their spread to realms that outlast where they came from may have consequences we haven't thought of. |
Yeah, ServiceWorker exposure seems questionable, but SharedWorker seems like a logical extension and doesn't seem to have any consequences that two DedicatedWorker instances wouldn't have. |
Well, DedicatedWorkers go away with the document, whereas a SharedWorker might outlive it. I also don't know for sure if it adds out of process requirements or not sometimes? Or are SharedWorkers implicitly same process? That said, since the WPT from Mozilla allowed it, maybe @padenot has thoughts on it? |
That's fair. Out of process requirements might be why we didn't add it originally since not all frames a backed in a way that's shareable without readback/copy. |
If we decide we shouldn't have SharedWorker (or at least not yet) I'll land https://chromium-review.googlesource.com/c/chromium/src/+/4216102 to fix the wpt test. |
Thanks for the link, this is good to know!
It is already a problem without workers.
Given you can post message a video frame to another tab, or a third-party iframe, the spec already mandates out of process support (implementations may lag though, Safari does not yet support this). So far, I haven't seen any new issue/requirement related to SharedWorker/ServiceWorker exposure.
That sounds good to me. |
We've had only a single request for SharedWorker: I think the use case can be handled in other ways though. I'll wait to hear from @padenot before landing the test change. |
I think this is a mistake on our side. This shouldn't work in |
Thanks Paul. I'll go ahead and land the test fix then. I'll close this for now and devs can +1 or chime in on it if this is something they'd like to see added. |
Test incorrectly assumes SharedWorker support, so ensure it instead tests that passing to a shared worker is unsupported. Fixes w3c/webcodecs#635 Bug: 1412203 Change-Id: I596fa79508a3cd8e2ed253d9be378b142edca4d4
Test incorrectly assumes SharedWorker support, so ensure it instead tests that passing to a shared worker is unsupported. Fixes w3c/webcodecs#635 Bug: 1412203 Change-Id: I596fa79508a3cd8e2ed253d9be378b142edca4d4
Test incorrectly assumes SharedWorker support, so ensure it instead tests that passing to a shared worker is unsupported. Fixes w3c/webcodecs#635 Bug: 1412203 Change-Id: I596fa79508a3cd8e2ed253d9be378b142edca4d4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4216102 Reviewed-by: Thomas Guilbert <tguilbert@chromium.org> Commit-Queue: Dale Curtis <dalecurtis@chromium.org> Cr-Commit-Position: refs/heads/main@{#1101160}
Test incorrectly assumes SharedWorker support, so ensure it instead tests that passing to a shared worker is unsupported. Fixes w3c/webcodecs#635 Bug: 1412203 Change-Id: I596fa79508a3cd8e2ed253d9be378b142edca4d4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4216102 Reviewed-by: Thomas Guilbert <tguilbert@chromium.org> Commit-Queue: Dale Curtis <dalecurtis@chromium.org> Cr-Commit-Position: refs/heads/main@{#1101160}
Test incorrectly assumes SharedWorker support, so ensure it instead tests that passing to a shared worker is unsupported. Fixes w3c/webcodecs#635 Bug: 1412203 Change-Id: I596fa79508a3cd8e2ed253d9be378b142edca4d4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4216102 Reviewed-by: Thomas Guilbert <tguilbert@chromium.org> Commit-Queue: Dale Curtis <dalecurtis@chromium.org> Cr-Commit-Position: refs/heads/main@{#1101160}
…rted in serialization., a=testonly Automatic update from web-platform-tests [WebCodecs] Mark SharedWorker as unsupported in serialization. Test incorrectly assumes SharedWorker support, so ensure it instead tests that passing to a shared worker is unsupported. Fixes w3c/webcodecs#635 Bug: 1412203 Change-Id: I596fa79508a3cd8e2ed253d9be378b142edca4d4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4216102 Reviewed-by: Thomas Guilbert <tguilbert@chromium.org> Commit-Queue: Dale Curtis <dalecurtis@chromium.org> Cr-Commit-Position: refs/heads/main@{#1101160} -- wpt-commits: 5d401863b2d8363e1ea35558d5c10a9b38c557a6 wpt-pr: 38351
…rted in serialization., a=testonly Automatic update from web-platform-tests [WebCodecs] Mark SharedWorker as unsupported in serialization. Test incorrectly assumes SharedWorker support, so ensure it instead tests that passing to a shared worker is unsupported. Fixes w3c/webcodecs#635 Bug: 1412203 Change-Id: I596fa79508a3cd8e2ed253d9be378b142edca4d4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4216102 Reviewed-by: Thomas Guilbert <tguilbert@chromium.org> Commit-Queue: Dale Curtis <dalecurtis@chromium.org> Cr-Commit-Position: refs/heads/main@{#1101160} -- wpt-commits: 5d401863b2d8363e1ea35558d5c10a9b38c557a6 wpt-pr: 38351
Test incorrectly assumes SharedWorker support, so ensure it instead tests that passing to a shared worker is unsupported. Fixes w3c/webcodecs#635 Bug: 1412203 Change-Id: I596fa79508a3cd8e2ed253d9be378b142edca4d4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4216102 Reviewed-by: Thomas Guilbert <tguilbert@chromium.org> Commit-Queue: Dale Curtis <dalecurtis@chromium.org> Cr-Commit-Position: refs/heads/main@{#1101160}
I just noticed we have a WPT test checking for SharedWorker support:
https://wpt.fyi/results/webcodecs/videoFrame-serialization.crossAgentCluster.https.html?label=experimental&label=master&aligned
It looks like it was added by Firefox here:
https://hg.mozilla.org/integration/autoland/rev/5a2fc97cac78
@padenot @youennf should we enable SharedWorker support? No objections off hand on the Chromium side. I'm not very familiar with the technical limitations around SharedWorkers though.
The text was updated successfully, but these errors were encountered: