Autogenerated with:
cp dom/.clang-format netwerk/ && mach format netwerk/**.{cpp,h,mm}
Manual fixes:
* mozurl/cbindgen.toml (including headers earlier)
* NetlinkService.h (forward-declaring a necessary struct)
* nsIWebSocketChannel.idl (forward-declaring OriginAttributes).
* nsAsyncRedirectVerifyHelper.h (forward-declaring nsIEventTarget)
* CapsuleEncoder.h gets a missing Capsule forward-decl.
* WebSocketConnectionBase.h gets some missing includes.
* HappyEyeballsConnectionAttempt gets some missing includes.
* nsUDPSocket missed nsSocketTransportService2.h for OnSocketThread().
* HttpInfo missed a forward declaration.
* MockHttpAuth missed an nsCOMPtr include.
* nsHttpAuthManager missed a forward declaration for nsIHttpAuthCache.
* WebTransportSessionProxy was using mozilla::Mutex in a member without
including it.
* win32 fixes to keep include order because windows headers suck.
* nsInputStreamPump needs an Atomics.h include.
Differential Revision: https://phabricator.services.mozilla.com/D311696
83 lines
2.4 KiB
C++
83 lines
2.4 KiB
C++
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#ifndef mozilla_net_WebTransportStreamProxy_h
|
|
#define mozilla_net_WebTransportStreamProxy_h
|
|
|
|
#include "WebTransportStreamBase.h"
|
|
#include "nsCOMPtr.h"
|
|
#include "nsIAsyncInputStream.h"
|
|
#include "nsIAsyncOutputStream.h"
|
|
#include "nsIWebTransportStream.h"
|
|
|
|
namespace mozilla::net {
|
|
|
|
class WebTransportStreamProxy final
|
|
: public nsIWebTransportReceiveStream,
|
|
public nsIWebTransportSendStream,
|
|
public nsIWebTransportBidirectionalStream {
|
|
public:
|
|
NS_DECL_THREADSAFE_ISUPPORTS
|
|
|
|
explicit WebTransportStreamProxy(WebTransportStreamBase* aStream);
|
|
|
|
NS_IMETHOD SendStopSending(uint8_t aError) override;
|
|
NS_IMETHOD SendFin() override;
|
|
NS_IMETHOD Reset(uint8_t aErrorCode) override;
|
|
NS_IMETHOD GetSendStreamStats(
|
|
nsIWebTransportStreamStatsCallback* aCallback) override;
|
|
NS_IMETHOD GetReceiveStreamStats(
|
|
nsIWebTransportStreamStatsCallback* aCallback) override;
|
|
|
|
NS_IMETHOD GetHasReceivedFIN(bool* aHasReceivedFIN) override;
|
|
|
|
NS_IMETHOD GetInputStream(nsIAsyncInputStream** aOut) override;
|
|
NS_IMETHOD GetOutputStream(nsIAsyncOutputStream** aOut) override;
|
|
|
|
NS_IMETHOD GetStreamId(uint64_t* aId) override;
|
|
NS_IMETHOD SetSendOrder(Maybe<int64_t> aSendOrder) override;
|
|
|
|
private:
|
|
virtual ~WebTransportStreamProxy();
|
|
|
|
class AsyncInputStreamWrapper : public nsIAsyncInputStream {
|
|
public:
|
|
NS_DECL_THREADSAFE_ISUPPORTS
|
|
NS_DECL_NSIINPUTSTREAM
|
|
NS_DECL_NSIASYNCINPUTSTREAM
|
|
|
|
AsyncInputStreamWrapper(nsIAsyncInputStream* aStream,
|
|
WebTransportStreamBase* aWebTransportStream);
|
|
|
|
private:
|
|
virtual ~AsyncInputStreamWrapper();
|
|
void MaybeCloseStream();
|
|
|
|
nsCOMPtr<nsIAsyncInputStream> mStream;
|
|
RefPtr<WebTransportStreamBase> mWebTransportStream;
|
|
};
|
|
|
|
class AsyncOutputStreamWrapper : public nsIAsyncOutputStream {
|
|
public:
|
|
NS_DECL_THREADSAFE_ISUPPORTS
|
|
NS_DECL_NSIOUTPUTSTREAM
|
|
NS_DECL_NSIASYNCOUTPUTSTREAM
|
|
|
|
explicit AsyncOutputStreamWrapper(nsIAsyncOutputStream* aStream);
|
|
|
|
private:
|
|
virtual ~AsyncOutputStreamWrapper();
|
|
|
|
nsCOMPtr<nsIAsyncOutputStream> mStream;
|
|
};
|
|
|
|
RefPtr<WebTransportStreamBase> mWebTransportStream;
|
|
RefPtr<AsyncOutputStreamWrapper> mWriter;
|
|
RefPtr<AsyncInputStreamWrapper> mReader;
|
|
};
|
|
|
|
} // namespace mozilla::net
|
|
|
|
#endif
|