1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
5 include PBackgroundSharedTypes;
7 [RefCounted] using class mozilla::ipc::DataPipeReceiver from "mozilla/ipc/DataPipe.h";
8 [RefCounted] using class mozilla::ipc::DataPipeSender from "mozilla/ipc/DataPipe.h";
9 using mozilla::TimeStamp from "mozilla/TimeStamp.h";
14 struct UnidirectionalStream {
16 nullable DataPipeSender outStream;
19 union UnidirectionalStreamResponse {
24 struct BidirectionalStream {
26 nullable DataPipeReceiver inStream;
27 nullable DataPipeSender outStream;
30 union BidirectionalStreamResponse {
39 struct StopSendingError {
43 union StreamResetOrStopSendingError {
49 async protocol PWebTransport
55 async Close(uint32_t code, nsCString reason);
56 async CreateUnidirectionalStream(int64_t? sendOrder)
57 returns(UnidirectionalStreamResponse response);
58 async CreateBidirectionalStream(int64_t? sendOrder)
59 returns(BidirectionalStreamResponse response);
62 * IPC for sending webtransport datagrams
63 * @param expirationTime time at which the datagram expires
64 * @param data represents the datagram to be transferred
66 async OutgoingDatagram(uint8_t[] data, TimeStamp expirationTime)
67 returns(nsresult response);
70 * Get the maximum supported datagram size from necko stack
72 async GetMaxDatagramSize()
73 returns(uint64_t maxDatagramSize);
76 * Set the sendOrder for an existing stream
78 async SetSendOrder(uint64_t streamId, int64_t? sendOrder);
82 async IncomingUnidirectionalStream(uint64_t streamId, nullable DataPipeReceiver receive);
83 async IncomingBidirectionalStream(uint64_t streamId, nullable DataPipeReceiver receive, nullable DataPipeSender send);
86 * IPC for receiving webtransport datagrams
87 * @param receivedTime is the time at which the parent received the datagram
88 * @param data is the datagram received
90 async IncomingDatagram(uint8_t[] data, TimeStamp receivedTime);
92 async RemoteClosed(bool cleanly, uint32_t code, nsCString reason);
94 async OnStreamResetOrStopSending(uint64_t streamId,
95 StreamResetOrStopSendingError error);
102 } // namespace mozilla