Backed out changeset a47a1ff34d2a (bug 1853444) for causing failures on /webtransport...
[gecko.git] / dom / webtransport / shared / PWebTransport.ipdl
blob56033ec189c90e5d2545428c5139a1058de6d04b
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";
11 namespace mozilla {
12 namespace dom {
14 struct UnidirectionalStream {
15   uint64_t streamId;
16   nullable DataPipeSender outStream;
19 union UnidirectionalStreamResponse {
20   nsresult;
21   UnidirectionalStream;
24 struct BidirectionalStream {
25   uint64_t streamId;
26   nullable DataPipeReceiver inStream;
27   nullable DataPipeSender outStream;
30 union BidirectionalStreamResponse {
31   nsresult;
32   BidirectionalStream;
35 struct ResetError {
36   nsresult error;
39 struct StopSendingError {
40   nsresult error;
43 union StreamResetOrStopSendingError {
44   ResetError;
45   StopSendingError;
48 async protocol PWebTransport
50  parent:
51   /**
52    * TODO: documentation
53    */
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);
60   /**
61   * IPC for sending webtransport datagrams
62   * @param expirationTime time at which the datagram expires
63   * @param data represents the datagram to be transferred
64   */
65   async OutgoingDatagram(uint8_t[] data, TimeStamp expirationTime)
66     returns(nsresult response);
68   /**
69   * Get the maximum supported datagram size from necko stack
70   */
71   async GetMaxDatagramSize()
72     returns(uint64_t maxDatagramSize);
74  child:
76   async IncomingUnidirectionalStream(uint64_t streamId, nullable DataPipeReceiver receive);
77   async IncomingBidirectionalStream(uint64_t streamId, nullable DataPipeReceiver receive, nullable DataPipeSender send);
79   /**
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
83   */
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);
91   async CloseAll()
92       returns(nsresult rv);
95 } // namespace dom
96 } // namespace mozilla