WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
184886
WebAssembly: add support for stream APIs - JavaScript API: Implement loading for the Blob type
https://bugs.webkit.org/show_bug.cgi?id=184886
Summary
WebAssembly: add support for stream APIs - JavaScript API: Implement loading ...
GSkachkov
Reported
2018-04-23 09:34:26 PDT
Implement loading for the Blob type for streaming API, currently implemented SharedBuffer
Attachments
Patch
(7.68 KB, patch)
2021-02-02 00:21 PST
,
Yusuke Suzuki
youennf
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
JF Bastien
Comment 1
2018-04-23 09:38:59 PDT
You mean this:
https://developer.mozilla.org/en-US/docs/Web/API/Blob
?
GSkachkov
Comment 2
2018-04-23 09:49:22 PDT
(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" }})); ```
Yusuke Suzuki
Comment 4
2021-01-25 14:02:41 PST
Will do at the same time. *** This bug has been marked as a duplicate of
bug 173105
***
Yusuke Suzuki
Comment 5
2021-01-26 23:10:35 PST
Initially, we do not support it.
Yusuke Suzuki
Comment 6
2021-02-01 02:06:55 PST
@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.
Yusuke Suzuki
Comment 7
2021-02-02 00:21:37 PST
Created
attachment 418968
[details]
Patch
EWS Watchlist
Comment 8
2021-02-02 00:22:23 PST
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
youenn fablet
Comment 9
2021-02-02 01:28:01 PST
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?
Yusuke Suzuki
Comment 10
2021-02-02 10:27:39 PST
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.
Yusuke Suzuki
Comment 11
2021-02-02 10:30:50 PST
Committed
r272221
: <
https://trac.webkit.org/changeset/272221
>
Radar WebKit Bug Importer
Comment 12
2021-02-02 10:35:23 PST
<
rdar://problem/73886641
>
Aakash Jain
Comment 13
2021-02-02 13:31:30 PST
(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
Yusuke Suzuki
Comment 14
2021-02-02 13:45:42 PST
(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
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug