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•6 years ago
|
||
Updated•6 years ago
|
| Assignee | ||
Comment 2•6 years ago
|
||
Depends on D58077
| Assignee | ||
Comment 3•6 years ago
|
||
Depends on D58078
| Assignee | ||
Comment 4•6 years ago
|
||
Depends on D58079
| Assignee | ||
Comment 5•6 years ago
|
||
Depends on D58080
Comment 6•6 years ago
|
||
Could you explain where messageerror gets dispatched?
| Assignee | ||
Comment 7•6 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•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
| Assignee | ||
Comment 8•6 years ago
|
||
| Assignee | ||
Comment 9•6 years ago
|
||
Depends on D59612
| Assignee | ||
Comment 10•6 years ago
|
||
Depends on D59613
| Assignee | ||
Comment 11•6 years ago
|
||
Depends on D59614
| Assignee | ||
Comment 12•6 years ago
|
||
Depends on D59615
Comment 13•6 years ago
|
||
Comment 14•6 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•6 years ago
|
||
Updated•6 years ago
|
| Assignee | ||
Comment 16•6 years ago
|
||
Updated•6 years ago
|
Comment 18•6 years ago
|
||
Comment 19•6 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•6 years ago
|
Comment 20•6 years ago
|
||
Comment 21•6 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
•