Bug 1694842 [wpt PR 27772] - [webcodecs] Implement transfer semantics for VideoFrame, a=testonly

Automatic update from web-platform-tests
[webcodecs] Implement transfer semantics for VideoFrame

This CL adds paths for modules to implement transfer semantics:

  - ExtractTransferables() is split into the outer loop (stays in
    SerializedScriptValue) and the inner per-object processing which
    moves into V8ScriptValueSerializer. Modules can add implementations
    to V8ScriptValueSerializerForModules.

  - Transferables gains a generic TransferList map modelled after
    SerializedScriptValue::Attachment. The TransferList API includes a
    method for finalizing transfers, which is called from
    V8ScriptValueSerializer::FinalizeTransfer().

Using these APIs, transfer of VideoFrames is then implemented
straightforwardly.

Bug: 1178038
Change-Id: Iafdc02b368d09cdb04c6e48ef187a4733b14c0f5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2719085
Commit-Queue: Dan Sanders <sandersd@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Cr-Commit-Position: refs/heads/master@{#873099}

--

wpt-commits: 9dfd4b723781cf12e10810e2b758d56792b008ab
wpt-pr: 27772
This commit is contained in:
Dan Sanders 2021-04-23 10:20:14 +00:00 коммит произвёл moz-wptsync-bot
Родитель 37051bf2f2
Коммит 7e90bdd3c3
1 изменённых файлов: 17 добавлений и 1 удалений

Просмотреть файл

@ -72,9 +72,25 @@ async_test(t => {
})
localPort.postMessage(localFrame);
}, 'Verify closing frames does not propagate accross contexts.');
async_test(t => {
let localFrame = createDefaultVideoFrame();
let channel = new MessageChannel();
let localPort = channel.port1;
let externalPort = channel.port2;
externalPort.onmessage = t.step_func_done((e) => {
let externalFrame = e.data;
assert_equals(externalFrame.timestamp, defaultInit.timestamp);
externalFrame.close();
})
localPort.postMessage(localFrame, [localFrame]);
assert_not_equals(localFrame.timestamp, defaultInit.timestamp);
}, 'Verify transferring frames closes them.');
async_test(t => {
let localFrame = createDefaultVideoFrame();