Closed Bug 1790408 Opened 2 years ago Closed 1 year ago

IPDL bridge for WebTransport features

Categories

(Core :: Networking, task, P2)

task

Tracking

()

RESOLVED FIXED

People

(Reporter: kershaw, Assigned: jesup)

References

(Blocks 1 open bug)

Details

(Whiteboard: [necko-triaged])

We will implement two IPDLs below.


async protocol PWebTransport
{
  manager PBackground;

parent:
  // Forward methods corresponding to methods on nsIWebTransport
  async AsyncConnect(nsIURI aURI,
                        OriginAttributes aOriginAttributes);
  async GetStats() returns (WebTransportStats aStats);
  async CloseSession(uint32_t aErrorCode, nsCString aReason);

  async SendDatagram(nsCString aMsg);

child:
  // Forward notifications corresponding to the WebTransportSessionEventListener interface
  async OnSessionReady(uint64_t aSessionId);
  async OnSessionClosed(uint32_t aErrorCode,
                        nsCString aReason);

  // When a new datagram has been received.
  async OnDatagramReceived(nsCString aDatagram);
both:
  // Send a message to create a PWebTransportStream
  // StreamType is either uini or bidi.
  async PWebTransportStream(uint64_t? aStreamId, StreamType aType);
};

async protocol PWebTransportStream
{
  manager PWebTransport;

parent:
  // Cancel the creation of this stream.
  async Cancel();

  async Write(nsCString aData) returns (nsresult aResult);

  async Read(uint32_t aMaxBytes) returns (nsCString aData, nsresult aResult);

  async GetReceiveStreamStats() returns (WebTransportReceiveStreamStats aStats);

  async GetSendStreamStats() returns (WebTransportSendStreamStats aStats);

  async SendFin();

  async SendStopSending(uint8_t aErrorCode);

  async Reset(uint8_t aErrorCode);

child:
 // When a stream is opened successfully.
 async OnOutgoingStreamReady(uint64_t aStreamId);

 async OnResetStreamReceived(in uint8_t aError);
 async OnStopSendingReceived(in uint8_t aError);

 // When we failed to open this stream.
 async OnStreamOpenError(uint8_t aError);
};

This will be done as a part of implementing Web API.

Blocks: 1790674
No longer blocks: 1789857

We'll probably use a top-level protocol with sub-protocols for each stream

Assignee: nobody → rjesup
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.