Open
Bug 2051477
Opened 1 month ago
Updated 1 month ago
Align WebTransport datagrams-writable algorithm state with the spec's internal-slot model
Categories
(Core :: Networking, task, P3)
Core
Networking
Tracking
()
NEW
People
(Reporter: jesup, Assigned: jesup)
References
Details
(Whiteboard: [necko-triaged])
Follow-up from review of D286306 (Bug 2007165). In the WebTransport spec, the datagrams writable's algorithms are stateless actions that read internal slots on the stream object itself ([[SendGroup]], [[SendOrder]], [[OutgoingDatagramsQueue]]). Our implementation instead models them as a refcounted OutgoingDatagramStreamAlgorithms object that carries its own copy of that state, which diverges from the spec and duplicates state across two objects.
Current shape (dom/webtransport/api/WebTransportDatagramsWritable.{h,cpp},
dom/webtransport/api/WebTransportDatagramDuplexStream.h):
WebTransportDatagramsWritableholdsmSendGroup/mSendOrder, and keeps a
separatemAlgorithmsback-pointer to theOutgoingDatagramStreamAlgorithms.OutgoingDatagramStreamAlgorithmsindependently ownsmSendGroup,mSendOrder,
mChild,mDatagrams, andmPendingDatagramPromises.SetSendGroup/SetSendOrderwrite the stream's members and forward to the
algorithms object's copies, keeping two sources of truth in sync by hand.
Desired shape (spec-aligned):
- Move the per-writable state (sendGroup, sendOrder, child, outgoing-datagram queue, pending-datagram promise map) to live only on
WebTransportDatagramsWritable, mirroring the spec's stream internal slots. - Make
OutgoingDatagramStreamAlgorithmsstateless: itswriteDatagramsaction reads those slots from the stream it was created for. - Drop the redundant
mAlgorithmsmember (theWritableStreamDefaultControlleralready owns the algorithms; reach them viaController()->GetAlgorithms()only where needed - see comment 2 on D286306). - Collapse
SetSendGroup/SetSendOrderto a single slot write, removing the hand-maintained forwarding.
No observable behavior change; makes the code track the spec algorithm structure and removes the state duplication.
You need to log in
before you can comment on or make changes to this bug.
Description
•