Open
Bug 1956441
Opened 1 month ago
Updated 1 month ago
Investigate using structuredClone in worker-transport.js
Categories
(DevTools :: Framework, task)
DevTools
Framework
Tracking
(Not tracked)
NEW
People
(Reporter: nchevobbe, Unassigned)
References
Details
In worker transport, we're using JSON serialization to pass packets, which can potentially cause trouble if said packet isn't serializable (see Bug 1956197).
send(packet) {
this._dbg.postMessage(
JSON.stringify({
type: "message",
id: this._id,
message: packet,
})
);
}
...
_onMessage(message) {
const packet = JSON.parse(message);
...
}
We should investigate if we could switch to structuredClone
instead, so it would be more robust (and performant)
Reporter | ||
Comment 1•1 month ago
|
||
We're actually using WorkerDebugger#postMessage
, not the regular worker global one, which means passing an actual object isn't supported: https://searchfox.org/mozilla-release/rev/8363c885d2a47e07f741e89d1bc12066b4b751a6/dom/workers/nsIWorkerDebugger.idl#57
You need to log in
before you can comment on or make changes to this bug.
Description
•