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 {
48 async protocol PWebTransport
54 async Close(uint32_t code, nsCString reason);
55 async CreateUnidirectionalStream(int64_t? sendOrder)
56 returns(UnidirectionalStreamResponse response);
57 async CreateBidirectionalStream(int64_t? sendOrder)
58 returns(BidirectionalStreamResponse response);
61 * IPC for sending webtransport datagrams
62 * @param expirationTime time at which the datagram expires
63 * @param data represents the datagram to be transferred
65 async OutgoingDatagram(uint8_t[] data, TimeStamp expirationTime)
66 returns(nsresult response);
69 * Get the maximum supported datagram size from necko stack
71 async GetMaxDatagramSize()
72 returns(uint64_t maxDatagramSize);
76 async IncomingUnidirectionalStream(uint64_t streamId, nullable DataPipeReceiver receive);
77 async IncomingBidirectionalStream(uint64_t streamId, nullable DataPipeReceiver receive, nullable DataPipeSender send);
80 * IPC for receiving webtransport datagrams
81 * @param receivedTime is the time at which the parent received the datagram
82 * @param data is the datagram received
84 async IncomingDatagram(uint8_t[] data, TimeStamp receivedTime);
86 async RemoteClosed(bool cleanly, uint32_t code, nsCString reason);
88 async OnStreamResetOrStopSending(uint64_t streamId,
89 StreamResetOrStopSendingError error);
96 } // namespace mozilla