You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In that PR, when a Blob is used as the BodyInit of a Request, we get a ReadableStream from the blob(see impl Extractable for Blob), then later as part of transmitting the body over the network(see TransmitBodyConnectHandler), we read chunks from the stream through SpiderMonkey(unless the blob has already been read into memory).
There's a couple of problem with that:
It doesn't work with sync XHR(the event-loop is blocked so SM cannot read from the JS stream),
It's unnecessary to go though the JS stream, since there is in fact no user provided JS stream.
So we should look into building a native stream, or perhaps no stream at all, in such a case.
The "no stream at all" might be feasible, since the data is coming from the net component, and that's also where it's going. Perhaps we can just pass around the file ID and then read it directly when transmitting the body, in a way similar to what is done when doing a scheme_fetch (see net/fetch/method.rs)
The text was updated successfully, but these errors were encountered:
Follow-up on #25873
In that PR, when a
Blob
is used as theBodyInit
of aRequest
, we get aReadableStream
from the blob(seeimpl Extractable for Blob
), then later as part of transmitting the body over the network(seeTransmitBodyConnectHandler
), we read chunks from the stream through SpiderMonkey(unless the blob has already been read into memory).There's a couple of problem with that:
So we should look into building a native stream, or perhaps no stream at all, in such a case.
The "no stream at all" might be feasible, since the data is coming from the
net
component, and that's also where it's going. Perhaps we can just pass around the file ID and then read it directly when transmitting the body, in a way similar to what is done when doing ascheme_fetch
(seenet/fetch/method.rs
)The text was updated successfully, but these errors were encountered: