tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

nsIWebTransportStream.idl (3086B)


      1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
      2 /* This Source Code Form is subject to the terms of the Mozilla Public
      3 * License, v. 2.0. If a copy of the MPL was not distributed with this
      4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      5 
      6 #include "nsISupports.idl"
      7 
      8 interface nsIAsyncInputStream;
      9 interface nsIAsyncOutputStream;
     10 interface nsIInputStreamCallback;
     11 interface nsIEventTarget;
     12 
     13 %{C++
     14 #include "mozilla/Maybe.h"
     15 
     16 namespace mozilla {
     17 class TimeStamp;
     18 }
     19 %}
     20 
     21 native TimeStamp(mozilla::TimeStamp);
     22 native MaybeInt64(mozilla::Maybe<int64_t>);
     23 
     24 [builtinclass, scriptable, uuid(ccc3e685-8411-48f0-8b3e-ff6d1fae4809)]
     25 interface nsIWebTransportSendStreamStats : nsISupports {
     26  [noscript] readonly attribute TimeStamp timestamp;
     27  readonly attribute unsigned long long bytesSent;
     28  readonly attribute unsigned long long bytesAcknowledged;
     29 };
     30 
     31 [builtinclass, scriptable, uuid(43ce1145-30ef-41a7-b97d-fa797f7f7d18)]
     32 interface nsIWebTransportReceiveStreamStats : nsISupports {
     33  [noscript] readonly attribute TimeStamp timestamp;
     34  readonly attribute unsigned long long bytesReceived;
     35 };
     36 
     37 [scriptable, uuid(9c1df3f5-bf04-46b6-9977-eb6389076db8)]
     38 interface nsIWebTransportStreamStatsCallback : nsISupports {
     39  void onSendStatsAvailable(in nsIWebTransportSendStreamStats aStats);
     40  void onReceiveStatsAvailable(in nsIWebTransportReceiveStreamStats aStats);
     41 };
     42 
     43 [builtinclass, scriptable, uuid(d461b235-6291-4817-adcc-a2a3b3dfc10b)]
     44 interface nsIWebTransportReceiveStream : nsISupports {
     45  // Sends the STOP_SENDING on the stream.
     46  void sendStopSending(in uint8_t aError);
     47 
     48  void getReceiveStreamStats(
     49    in nsIWebTransportStreamStatsCallback aCallback);
     50 
     51  // When true, this indicates that FIN had been received.
     52  readonly attribute boolean hasReceivedFIN;
     53  readonly attribute nsIAsyncInputStream inputStream;
     54  readonly attribute uint64_t streamId;
     55 };
     56 
     57 [builtinclass, scriptable, uuid(804f245c-52ea-403c-8a78-f751533bdd70)]
     58 interface nsIWebTransportSendStream : nsISupports {
     59  // Sends the FIN on the stream.
     60  void sendFin();
     61 
     62  // Reset the stream with the specified error code.
     63  void reset(in uint8_t aErrorCode);
     64 
     65  void getSendStreamStats(in nsIWebTransportStreamStatsCallback aCallback);
     66  readonly attribute nsIAsyncOutputStream outputStream;
     67  readonly attribute uint64_t streamId;
     68  [noscript] void setSendOrder(in MaybeInt64 aSendOrder);
     69 };
     70 
     71 [builtinclass, scriptable, uuid(f9ecb509-36db-4689-97d6-137639a08750)]
     72 interface nsIWebTransportBidirectionalStream : nsISupports {
     73  // Sends the STOP_SENDING on the stream.
     74  void sendStopSending(in uint8_t aError);
     75 
     76  // Sends the FIN on the stream.
     77  void sendFin();
     78 
     79  // Reset the stream with the specified error code.
     80  void reset(in uint8_t aErrorCode);
     81 
     82  // When true, this indicates that FIN had been received.
     83  readonly attribute boolean hasReceivedFIN;
     84 
     85  readonly attribute nsIAsyncInputStream inputStream;
     86  readonly attribute nsIAsyncOutputStream outputStream;
     87  readonly attribute uint64_t streamId;
     88  [noscript] void setSendOrder(in MaybeInt64 aSendOrder);
     89 };