servo icon indicating copy to clipboard operation
servo copied to clipboard

WebIDL impl: remove unsafe JSObject when returning a ReadableStream

Open gterzian opened this issue 2 years ago • 4 comments

Part of https://github.com/servo/servo/issues/30862

Same as https://github.com/servo/servo/issues/30889

Depends on https://github.com/servo/servo/pull/29881

All the below should return a concrete, and safe, ReadableStream object.

https://github.com/servo/servo/blob/8bbcf0abafc22cd840cd03f36b5b3b7d2d815493/components/script/dom/blob.rs#L234

https://github.com/servo/servo/blob/8bbcf0abafc22cd840cd03f36b5b3b7d2d815493/components/script/dom/request.rs#L603

https://github.com/servo/servo/blob/8bbcf0abafc22cd840cd03f36b5b3b7d2d815493/components/script/dom/response.rs#L360

gterzian avatar Dec 19 '23 10:12 gterzian

@servo-highfive assign me

SummerGram avatar Feb 16 '24 06:02 SummerGram

Hey @SummerGram! Thanks for your interest in working on this issue. It's now assigned to you!

servo-highfive avatar Feb 16 '24 06:02 servo-highfive

@SummerGram Thank you for your interest! This one is complicated and there is already a WIP at https://github.com/servo/servo/pull/29881

I can help you find one that would match your current skillset better. I've messaged you in the relevant topic on zullip...

gterzian avatar Feb 16 '24 11:02 gterzian

For this, we need to implement:

Which would replace what is currently done via the js stream.

Note that the underlying source can be both one coming from the JS side of things, or a native one. We already have the native one via ExternalUnderlyingSourceController, which we can keep in some way, and remove the bindings to spidermonkey, since in this implementation the Rust would call into the native controller directly. So we need to essentially implement the JS part, via the WebIDL(we already have the "private" native one).

Besides the above, we also need to implement part of the public WebIDL, which currently is non-existent because managed by spidermonkey. Only a part of the interface is required, I believe SM did not do any of the writable stream stuff. So that means:

We also need to implement the reader, note that are two variants(again not sure if SM implemented all). This would replace what is currently done with js reader.

There are some other trivial WebIDL objects we need to implement as well to support the rest.

gterzian avatar Jun 13 '24 09:06 gterzian