MessagePort should support wasm modules and SharedArrayBuffer when possible
Categories
(Core :: DOM: postMessage, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox74 | --- | fixed |
People
(Reporter: baku, Assigned: baku)
References
Details
Attachments
(5 files, 7 obsolete files)
Bug 1605566 - MessagePort + wasm - part 1 - access scope via method in StructuredClone code, r?sfink
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
We don't support the sending of WasmModules and SharedArrayBuffer via MessagePort because, in theory, ports work between processes. But this scenario is extremely rare and it requires the user sharedWorkers, which are not so common yet.
I want to suggest a different approach where we support the serialization of everything for normal scenarios and, on the remote occasion the messaging is cross-process, we dispatch a messageerror event.
This is compatible with the current spec definition.
Assignee | ||
Comment 1•4 years ago
|
||
Updated•4 years ago
|
Assignee | ||
Comment 2•4 years ago
|
||
Depends on D58077
Assignee | ||
Comment 3•4 years ago
|
||
Depends on D58078
Assignee | ||
Comment 4•4 years ago
|
||
Depends on D58079
Assignee | ||
Comment 5•4 years ago
|
||
Depends on D58080
Comment 6•4 years ago
|
||
Could you explain where messageerror gets dispatched?
Assignee | ||
Comment 7•4 years ago
|
||
By spec, messageerror is dispatched if the deserialization fails:
https://html.spec.whatwg.org/multipage/web-messaging.html#message-port-post-message-steps
7.3:
Let deserializeRecord be StructuredDeserializeWithTransfer(serializeWithTransferResult, targetRealm).
If this throws an exception, catch it, fire an event named messageerror at finalTargetPort, using MessageEvent, and then return.
In my code, this happens when the MessagePort receives a RefMessageBody ID from a different process.
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Comment 8•4 years ago
|
||
Assignee | ||
Comment 9•4 years ago
|
||
Depends on D59612
Assignee | ||
Comment 10•4 years ago
|
||
Depends on D59613
Assignee | ||
Comment 11•4 years ago
|
||
Depends on D59614
Assignee | ||
Comment 12•4 years ago
|
||
Depends on D59615
Comment 13•4 years ago
|
||
Pushed by amarchesini@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/37026beadbd8 MessagePort + wasm - part 1 - access scope via method in StructuredClone code, r=sfink https://hg.mozilla.org/integration/autoland/rev/554b2bdce66c MessagePort + wasm - part 2 - implement JS::StructuredCloneScope::UnknownDestination, r=sfink https://hg.mozilla.org/integration/autoland/rev/36631ec96f1f MessagePort + wasm - part 3 - MessagePort serializes objects using MessageData union, r=smaug https://hg.mozilla.org/integration/autoland/rev/3427a92445c8 MessagePort + wasm - part 4 - Implement RefMessageBodyService, r=smaug https://hg.mozilla.org/integration/autoland/rev/39f34852842e MessagePort + wasm - part 5 - tests, r=smaug
Comment 14•4 years ago
•
|
||
Backed out 9 changesets (Bug 1607791, Bug 1605566) for causing multiple wpt failures.
Backout link: https://hg.mozilla.org/integration/autoland/rev/0bb7d315058732b15df19fb8648fa634d92a481e
Failure logs:
Assignee | ||
Comment 15•4 years ago
|
||
Updated•4 years ago
|
Assignee | ||
Comment 16•4 years ago
|
||
Updated•4 years ago
|
Comment 18•4 years ago
|
||
Pushed by amarchesini@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/77bdf4f86052 MessagePort + wasm - part 1 - access scope via method in StructuredClone code, r=sfink https://hg.mozilla.org/integration/autoland/rev/99f61f25ed86 MessagePort + wasm - part 2 - implement JS::StructuredCloneScope::UnknownDestination, r=sfink https://hg.mozilla.org/integration/autoland/rev/7eab8fd2b62e MessagePort + wasm - part 3 - MessagePort serializes objects using MessageData union, r=smaug https://hg.mozilla.org/integration/autoland/rev/ab98304e6c84 MessagePort + wasm - part 4 - Implement RefMessageBodyService, r=smaug https://hg.mozilla.org/integration/autoland/rev/622939cef438 MessagePort + wasm - part 5 - tests, r=smaug
Comment 19•4 years ago
|
||
Backed out 5 changesets (bug 1605566) for wpt failures on shared.html
Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=285934381&repo=autoland&lineNumber=5039
Backout: https://hg.mozilla.org/integration/autoland/rev/74493854a1b6478d5a9c3674df1369788783eeee
Assignee | ||
Updated•4 years ago
|
Comment 20•4 years ago
|
||
Pushed by amarchesini@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d0f4082f969d MessagePort + wasm - part 1 - access scope via method in StructuredClone code, r=sfink https://hg.mozilla.org/integration/autoland/rev/9ccdf46d9dd4 MessagePort + wasm - part 2 - implement JS::StructuredCloneScope::UnknownDestination, r=sfink https://hg.mozilla.org/integration/autoland/rev/b55456d966a4 MessagePort + wasm - part 3 - MessagePort serializes objects using MessageData union, r=smaug https://hg.mozilla.org/integration/autoland/rev/be8a9e4029f6 MessagePort + wasm - part 4 - Implement RefMessageBodyService, r=smaug https://hg.mozilla.org/integration/autoland/rev/a7d7f6d229c8 MessagePort + wasm - part 5 - tests, r=smaug
Comment 21•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/d0f4082f969d
https://hg.mozilla.org/mozilla-central/rev/9ccdf46d9dd4
https://hg.mozilla.org/mozilla-central/rev/b55456d966a4
https://hg.mozilla.org/mozilla-central/rev/be8a9e4029f6
https://hg.mozilla.org/mozilla-central/rev/a7d7f6d229c8
Description
•