PoC: #84
We can have the kernel and its vats communicate directly over a message port, without proxying through the offscreen glue code.
Regarding kernel <--> vat communications, the offscreen document is responsible for:
- creating new vat workers
- providing an introduction between the kernel and the vat
- destroying vat workers
All other interactions between the kernel and its vats can take place directly over message ports.
Communication Diagram (Draft)
Suggested Implementation
Since it is possible to send a MessagePort over a MessagePort, we could have the kernel initialize a MessageChannel, send one end of the channel to the Glue code as part of the requests to make a new vat, immediately add the Vat abstraction to its records, and carry on as usual. As a bonus, this implementation does not require first getting the kernel into its own iframe (#57).