Closed Bug 1999383 Opened 7 months ago Closed 7 months ago

Typed serialization for JS actor messages

Categories

(Core :: DOM: Content Processes, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
147 Branch
Tracking Status
firefox147 --- fixed

People

(Reporter: mccr8, Assigned: mccr8)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

My first patch in bug 1885221 replaces the serialization method currently used for JS actor messages (based on structured clone) with a new one that uses IPDL structures, at least for messages from the child process to the parent process. I think Nika suggested that it get landed separately, and I think that's a good idea. The current serialization has some weird behavior when structured cloning fails, that goes through JSON. We should land and enable the new serializer before we try to do typing, to shake out any problems there.

The actual patch here does not actually use the new serializer in any deep way. Instead, all messages values are serialized using StructuredClone and put in a thin "wrapper". Actually enabling the new serializer will be in a followup once it has settled, via a pref flip. That will make it easier to disable if something goes wrong.

Blocks: 1999397

This patch implements serialization and deserialization of JS values using IPDL.
This is similar to the structured clone algorithm, but the target is chrome JS,
so it does not need to be standards compliant. The idea is that by serializing
to a data type, it is easier to write a type checking algorithm in later patches
in bug 1885221 by traversing the data structure. This also allows us to tightly
control what is allowed to be sent.

This patch removes MMPrinter::Print logging for JS IPC messages, but a more
sophisticated logging will be added in bug 1885221 part 5, once the type
infrastructure is in place.

Try looks green. Also with the pref flipped, as seen in bug 1999397.

Status: NEW → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 147 Branch
QA Whiteboard: [qa-triage-done-c148/b147]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: