Implement loading for the Blob type for streaming API, currently implemented SharedBuffer
You mean this: https://developer.mozilla.org/en-US/docs/Web/API/Blob ?
(In reply to JF Bastien from comment #1) > You mean this: https://developer.mozilla.org/en-US/docs/Web/API/Blob ? Yeah, this currently fails: ``` const blob = new Blob(...); WebAssembly.instantiateStreaming(new Response(blob, { headers: { "Content-Type" : "application/wasm" }})); ``` currently my patch support only Responses manually created from ReadableStream: ``` const stream = new ReadableStream(...); WebAssembly.instantiateStreaming(new Response(stream, { headers: { "Content-Type" : "application/wasm" }})); ```
Will do at the same time. *** This bug has been marked as a duplicate of bug 173105 ***
Initially, we do not support it.
@Youenn Would you mind telling me the best way to load bytes from FormData? FetchResponse can have FormData as its body, and we would like to load byte streams from that to pass this data to Wasm streaming compiler.
Created attachment 418968 [details] Patch
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Comment on attachment 418968 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=418968&action=review > Source/WebCore/bindings/js/JSDOMGlobalObject.cpp:349 > + } Sounds good like this. Or maybe we could introduce a utility method that would handle blob through consumeBodyReceivedByChunk, since the same thing is used in DOMCache. > LayoutTests/imported/w3c/web-platform-tests/wasm/wasm_stream_instantiate_test.html:113 > + }, "instantiateStreaming using blob"); Might be worth adding a test with form data even though we fail it for now?
Comment on attachment 418968 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=418968&action=review >> Source/WebCore/bindings/js/JSDOMGlobalObject.cpp:349 >> + } > > Sounds good like this. > Or maybe we could introduce a utility method that would handle blob through consumeBodyReceivedByChunk, since the same thing is used in DOMCache. For now, I want to have this separate from consumeBodyReceivedByChunk (first, making it ReadableStream, and then use it in consumeBodyReceivedByChunk), because creating ReadableStream can cause exception. And we need JSGlobalObject, while the other ones are not requiring it in consumeBodyReceivedByChunk. I think, possibly, in the future change, we could just call consumeBodyReceivedByChunk without making Blob to ReadableStream (using BlobLoader). >> LayoutTests/imported/w3c/web-platform-tests/wasm/wasm_stream_instantiate_test.html:113 >> + }, "instantiateStreaming using blob"); > > Might be worth adding a test with form data even though we fail it for now? Sounds good! Added.
Committed r272221: <https://trac.webkit.org/changeset/272221>
<rdar://problem/73886641>
(In reply to Yusuke Suzuki from comment #11) > Committed r272221: <https://trac.webkit.org/changeset/272221> This seems to have broken two layout tests: https://results.webkit.org/?suite=layout-tests&suite=layout-tests&test=imported%2Fw3c%2Fweb-platform-tests%2Fwasm%2Fwasm_stream_instantiate_test.html&test=imported%2Fw3c%2Fweb-platform-tests%2Fwasm%2Fwasm_stream_instantiate_test.html
(In reply to Aakash Jain from comment #13) > (In reply to Yusuke Suzuki from comment #11) > > Committed r272221: <https://trac.webkit.org/changeset/272221> > This seems to have broken two layout tests: > https://results.webkit.org/?suite=layout-tests&suite=layout- > tests&test=imported%2Fw3c%2Fweb-platform- > tests%2Fwasm%2Fwasm_stream_instantiate_test.html&test=imported%2Fw3c%2Fweb- > platform-tests%2Fwasm%2Fwasm_stream_instantiate_test.html Fixed in https://bugs.webkit.org/show_bug.cgi?id=221281