Re: [whatwg/streams] Add URL.createObjectURL(stream) support (#480)

> The difference is there is no API img.response = response which would have to deal with those cases. There is, however, a img.src = url.

I don't see the distinction. A Response in a service worker effectively becomes the URL on the main thread. Can't createObjectURL just work on, and be limited to, byte streams? It would be a convenience function around the (still-unimplemented) transfer of the readablestream to the service worker on top of some kind of handshake where you set/receive the URL you can then retrieve the contents of said stream via. (Wait, you'd also need to find a way to keep the service worker instance 'alive' and containing the received readablestream up until it actually receives the request and can use it in the Response, so maybe those steps should be reversed.)

Although having a MIME type of anything but `octet-stream` would be difficult with passing just a stream by itself. Could `createObjectURL(new Response())` get specced instead, instead of requiring a full service worker? Would that be an issue to file with the fetch api, or is some other repo appropriate?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/issues/480#issuecomment-257130578

Received on Sunday, 30 October 2016 03:56:53 UTC