Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 942f69a02db6c501d20cf967d23cd7a30ff642d1
      
https://github.com/WebKit/WebKit/commit/942f69a02db6c501d20cf967d23cd7a30ff642d1
  Author: Anne van Kesteren <[email protected]>
  Date:   2026-10-13 (Tue, 13 Oct 2026)

  Changed paths:
    M LayoutTests/imported/w3c/resources/resource-files.json
    A 
LayoutTests/imported/w3c/web-platform-tests/mediacapture-insertable-streams/MediaStreamTrackHandle-transfer-cross-agent-cluster.https-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/mediacapture-insertable-streams/MediaStreamTrackHandle-transfer-cross-agent-cluster.https.html
    M 
LayoutTests/imported/w3c/web-platform-tests/mediacapture-insertable-streams/w3c-import.log
    A 
LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaStreamTrack-transfer-cross-agent-cluster.https-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaStreamTrack-transfer-cross-agent-cluster.https.html
    A 
LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/resources/cross-agent-cluster-receiver.html
    A 
LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/resources/w3c-import.log
    M 
LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/w3c-import.log
    A 
LayoutTests/imported/w3c/web-platform-tests/webcodecs/audio-serialization.crossAgentCluster.helper.html
    A 
LayoutTests/imported/w3c/web-platform-tests/webcodecs/audio-serialization.crossAgentCluster.https-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/webcodecs/audio-serialization.crossAgentCluster.https.html
    M 
LayoutTests/imported/w3c/web-platform-tests/webcodecs/encodedVideoChunk-serialization.crossAgentCluster.https-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoFrame-serialization.crossAgentCluster.https-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/webcodecs/w3c-import.log
    M Source/WebCore/Modules/mediastream/MediaStreamTrack.idl
    M Source/WebCore/Modules/mediastream/MediaStreamTrackHandle.idl
    M Source/WebCore/Modules/webcodecs/WebCodecsAudioData.idl
    M Source/WebCore/Modules/webcodecs/WebCodecsEncodedAudioChunk.idl
    M Source/WebCore/Modules/webcodecs/WebCodecsEncodedVideoChunk.idl
    M Source/WebCore/Modules/webcodecs/WebCodecsVideoFrame.idl
    M Source/WebCore/bindings/js/SerializedScriptValue.cpp
    M Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
    M Source/WebCore/bindings/scripts/IDLAttributes.json
    M Source/WebCore/bindings/scripts/test/JS/JSExposedStar.h
    M Source/WebCore/bindings/scripts/test/JS/JSTestSerializable.h
    M Source/WebCore/bindings/scripts/test/TestSerializable.idl

  Log Message:
  -----------
  Implement [SameAgentCluster] for WebCodecs objects and MediaStreamTrack
https://bugs.webkit.org/show_bug.cgi?id=327156
rdar://189747796

Reviewed by Youenn Fablet.

https://github.com/whatwg/html/pull/13055 adds the [SameAgentCluster]
extended attribute: serializing or transferring an object implementing
such an interface restricts the result to the agent cluster it came from,
deserializing it in another agent cluster throws a DataCloneError, and
serializing it for storage throws as well. This is what
https://github.com/w3c/webcodecs/issues/717 needs for EncodedVideoChunk,
VideoFrame, EncodedAudioChunk, and AudioData, and what the WebCodecs
crossAgentCluster tests already expect. MediaStreamTrack and
MediaStreamTrackHandle are transferred the same way, so restrict them
too.

The bindings generator now emits isRestrictedToSameAgentCluster for
[Serializable] and [Transferable] interfaces. SerializedScriptValue maps
each serialization tag to the PlatformObjectSerializationTraits of its
interface in one place, platformObjectSerializationTraitsForTag(), which
both the exposure check and the new isTagRestrictedToSameAgentCluster()
use. When CloneSerializer writes a restricted tag it writes the agent
cluster ID after it, as JSC already does for SharedArrayBuffer, and
CloneDeserializer checks that ID before reading the object. All of these
objects already refuse to be serialized for storage, before their tag is
written.

The existing tests only cover the video types, so add tests for
AudioData, EncodedAudioChunk, MediaStreamTrack, and
MediaStreamTrackHandle.

Tests: 
imported/w3c/web-platform-tests/mediacapture-insertable-streams/MediaStreamTrackHandle-transfer-cross-agent-cluster.https.html
       
imported/w3c/web-platform-tests/mediacapture-streams/MediaStreamTrack-transfer-cross-agent-cluster.https.html
       
imported/w3c/web-platform-tests/webcodecs/audio-serialization.crossAgentCluster.https.html

Canonical link: https://commits.webkit.org/323558@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to