| Summary: | [WK2] Bypass NetworkProcess for MessagePort communication within a single WebProcess | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Chris Dumez <cdumez> | ||||||||
| Component: | WebKit2 | Assignee: | Chris Dumez <cdumez> | ||||||||
| Status: | RESOLVED WONTFIX | ||||||||||
| Severity: | Normal | CC: | annulen, esprehn+autocc, ews-watchlist, gyuyoung.kim, kangil.han, ryuan.choi, sergio, ysuzuki | ||||||||
| Priority: | P2 | ||||||||||
| Version: | WebKit Nightly Build | ||||||||||
| Hardware: | Unspecified | ||||||||||
| OS: | Unspecified | ||||||||||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=181454 | ||||||||||
| Bug Depends on: | |||||||||||
| Bug Blocks: | 220038 | ||||||||||
| Attachments: |
|
||||||||||
|
Description
Chris Dumez
2021-01-14 11:46:43 PST
Created attachment 417635 [details]
WIP Patch
Created attachment 417636 [details]
Patch
Created attachment 417639 [details]
Patch
Comment on attachment 417639 [details]
Patch
Sadly, this is not as easy as it looks. Current patch breaks cross-process communication (used by service workers). A given WebProcess does not seem to know if its remote MessagePort is within its process or not.
I tried a different approach but it is tricky. At the time a message is posted, we may not know yet if the destination MessagePort will be in the same WebProcess or not. You can send a MessagePort to a worker and call postMessage() on this MessagePort, before the Worker has received the port (so before entanglement has happened). Entanglement is when we know if both ends of the channel are in the same process. |