New issue
Advanced search Search tips

Issue 922718 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Fuchsia
Pri: 2
Type: Bug



Sign in to add a comment

Simplify NamedMessagePortConnector implementation

Project Member Reported by w...@chromium.org, Jan 16 (6 days ago)

Issue description

NamedMessagePortConnector proactively creates & passes a new MessagePort to the JS window.onmessage handler for each configured named port.

We should refactor it to:
1. Post a single "control" port to window.onmessage.
2. Have the JS side create a new MessagePort for each connect(), and post that back to the C++ side over the control port.
3. Allow JS callers to connect() multiple times to the same name, if they want.

There will need to be buffering for connect() calls made before the window.onmessage handler receives the control port, but all postMessage() calls to ports returned by connect() should be buffered "for free" in the ports themselves.
 

Sign in to add a comment