PWebTransport.ipdl (2795B)
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/. */ 4 5 include PBackgroundSharedTypes; 6 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"; 10 11 namespace mozilla { 12 namespace dom { 13 14 struct UnidirectionalStream { 15 uint64_t streamId; 16 nullable DataPipeSender outStream; 17 }; 18 19 union UnidirectionalStreamResponse { 20 nsresult; 21 UnidirectionalStream; 22 }; 23 24 struct BidirectionalStream { 25 uint64_t streamId; 26 nullable DataPipeReceiver inStream; 27 nullable DataPipeSender outStream; 28 }; 29 30 union BidirectionalStreamResponse { 31 nsresult; 32 BidirectionalStream; 33 }; 34 35 struct ResetError { 36 nsresult error; 37 }; 38 39 struct StopSendingError { 40 nsresult error; 41 }; 42 43 union StreamResetOrStopSendingError { 44 ResetError; 45 StopSendingError; 46 }; 47 48 [ChildProc=anydom] 49 async protocol PWebTransport 50 { 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); 60 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); 68 69 /** 70 * Get the maximum supported datagram size from necko stack 71 */ 72 async GetMaxDatagramSize() 73 returns(uint64_t maxDatagramSize); 74 75 /** 76 * Get the http channel id 77 */ 78 async GetHttpChannelID() 79 returns(uint64_t httpChannelID); 80 81 /** 82 * Set the sendOrder for an existing stream 83 */ 84 async SetSendOrder(uint64_t streamId, int64_t? sendOrder); 85 86 child: 87 88 async IncomingUnidirectionalStream(uint64_t streamId, nullable DataPipeReceiver receive); 89 async IncomingBidirectionalStream(uint64_t streamId, nullable DataPipeReceiver receive, nullable DataPipeSender send); 90 91 /** 92 * IPC for receiving webtransport datagrams 93 * @param receivedTime is the time at which the parent received the datagram 94 * @param data is the datagram received 95 */ 96 async IncomingDatagram(uint8_t[] data, TimeStamp receivedTime); 97 98 async RemoteClosed(bool cleanly, uint32_t code, nsCString reason); 99 100 async OnStreamResetOrStopSending(uint64_t streamId, 101 StreamResetOrStopSendingError error); 102 103 async CloseAll() 104 returns(nsresult rv); 105 }; 106 107 } // namespace dom 108 } // namespace mozilla