Backed out changeset 2bbc01486e2f (bug 1910796) for causing multiple failures. CLOSED...
[gecko.git] / dom / webtransport / shared / PWebTransport.ipdl
blob6256322425995f5239e5b1f765f6dd09ee62a440
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 [ChildProc=anydom]
49 async protocol PWebTransport
51  parent:
52   /**
53    * TODO: documentation
54    */
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);
61   /**
62   * IPC for sending webtransport datagrams
63   * @param expirationTime time at which the datagram expires
64   * @param data represents the datagram to be transferred
65   */
66   async OutgoingDatagram(uint8_t[] data, TimeStamp expirationTime)
67     returns(nsresult response);
69   /**
70   * Get the maximum supported datagram size from necko stack
71   */
72   async GetMaxDatagramSize()
73     returns(uint64_t maxDatagramSize);
75   /**
76   * Set the sendOrder for an existing stream
77   */
78   async SetSendOrder(uint64_t streamId, int64_t? sendOrder);
80  child:
82   async IncomingUnidirectionalStream(uint64_t streamId, nullable DataPipeReceiver receive);
83   async IncomingBidirectionalStream(uint64_t streamId, nullable DataPipeReceiver receive, nullable DataPipeSender send);
85   /**
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
89   */
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);
97   async CloseAll()
98       returns(nsresult rv);
101 } // namespace dom
102 } // namespace mozilla