Allow posting a SharedArrayBuffer to AudioWorklet #13445
Merged
+120
−0
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.
The HTML spec only allows passing SharedArrayBuffers to an agent in the
same agent cluster. Worklets currently do not belong to any agent
cluster, so a SharedArrayBuffer can not be shared with a worklet.
However, it is intended that this is possible; see, for example,
w3c/css-houdini-drafts#380 and the
AudioWorklet article here:
https://developers.google.com/web/updates/2018/06/audio-worklet-design-pattern#webaudio_powerhouse_audio_worklet_and_sharedarraybuffer
This change funnels the agent cluster ID through when creating a
ThreadedWorklet, so a SharedArrayBuffer can be shared as long as the
creator of the Worklet's thread is in the same agent cluster. It is not
clear that this is the behavior that will be specified, however.
Bug: chromium:892067
Change-Id: If1a2187ae38da41f2389538c07e7b04921c6128f
Reviewed-on: https://chromium-review.googlesource.com/c/1262932
Commit-Queue: Ben Smith <binji@chromium.org>
Reviewed-by: Hongchan Choi <hongchan@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#598619}