-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Request and Response blob methods #177
Add Request and Response blob methods #177
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So many more passing tests! ❤️
d140a41
to
43f2f91
Compare
This patch allows creating buffer from owned memory by simply transfering the ownership rather than copying memory.
7946178
to
2f697a3
Compare
It would also be nice to see in this PR for Update: I was able to implement these for Fastly here - fastly/js-compute-runtime@9b59afa |
I've also posted #182 as a further follow-up. |
Nice! This looks to me like an equivalent of doing: RootedValue blob_stream(cx);
Call(cx, body_obj, "stream", HandleValueArray::empty(), &blob_stream); Is there a reason we don't want to use |
I've also added support for |
@andreiltd yeah in general I'd avoid running through the high-level call for performance - we very much need to always keep performance top of mind in development on StarlingMonkey, because by default we are running at a performance penalty compared to other JS platforms, performance is of critical performance for this codebase. |
That makes sense. I will make sure to add interface for calling Blob functions directly in the File API PR. |
This patch adds
blob
API toRequest
andResponse
methods.The patch also refactors the internal blob storage, changing it from
std::vector
tomozilla::Vector
. This optimization allows theBlob
to be created without copying data by transferring buffer ownership, as is the case for bothResponse
andRequest
objects.Closes: #121