Re: [streams] can streams be transferred via postMessage()? (#276)

I was talking with @sicking today and he raised an interesting point.  What do we do in this situation:

1) Script gets a ReadableStream for a native resource like a file or something.
2) Script overrides ReadableStream.read() with stream.read = function() {...}
3) Script tries to transfer the stream to a worker with postMessage()

Ideally the worker would have access to the stream data without all the buffers going through the original thread, but that seems impossible if .read() is JS implemented in the original context.

Can we make the .read() and .writer() methods unforgeable?  Or should postMessage() just throw in this situation?

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/issues/276#issuecomment-85676889

Received on Tuesday, 24 March 2015 20:21:39 UTC