QuicSocketControl.h (1944B)
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- 2 * 3 * This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #ifndef QuicSocketControl_h 8 #define QuicSocketControl_h 9 10 #include "CommonSocketControl.h" 11 #include "nsIWeakReferenceUtils.h" 12 13 namespace mozilla { 14 namespace net { 15 16 class Http3Session; 17 18 // IID for the QuicSocketControl interface 19 #define NS_QUICSOCKETCONTROL_IID \ 20 {0xdbc67fd0, 0x1ac6, 0x457b, {0x91, 0x4e, 0x4c, 0x86, 0x60, 0xff, 0x00, 0x69}} 21 22 class QuicSocketControl final : public CommonSocketControl { 23 public: 24 NS_INLINE_DECL_STATIC_IID(NS_QUICSOCKETCONTROL_IID); 25 26 NS_INLINE_DECL_REFCOUNTING_INHERITED(QuicSocketControl, CommonSocketControl); 27 28 NS_IMETHOD GetSSLVersionOffered(int16_t* aSSLVersionOffered) override; 29 30 QuicSocketControl(const nsCString& aHostName, int32_t aPort, 31 uint32_t aProviderFlags, Http3Session* aHttp3Session); 32 33 void SetNegotiatedNPN(const nsACString& aValue); 34 void SetInfo(uint16_t aCipherSuite, uint16_t aProtocolVersion, 35 uint16_t aKeaGroup, uint16_t aSignatureScheme, 36 bool aEchAccepted); 37 38 void CallAuthenticated(); 39 40 void HandshakeCompleted(); 41 void SetCertVerificationResult(PRErrorCode errorCode) override; 42 43 NS_IMETHOD GetEchConfig(nsACString& aEchConfig) override; 44 NS_IMETHOD SetEchConfig(const nsACString& aEchConfig) override; 45 NS_IMETHOD GetRetryEchConfig(nsACString& aEchConfig) override; 46 void SetRetryEchConfig(const nsACString& aEchConfig); 47 bool IsBuiltCertChainRootBuiltInRoot() const; 48 49 private: 50 ~QuicSocketControl() = default; 51 52 // For Authentication done callback and echConfig. 53 nsWeakPtr mHttp3Session; 54 55 nsCString mEchConfig; 56 nsCString mRetryEchConfig; 57 }; 58 59 } // namespace net 60 } // namespace mozilla 61 62 #endif // QuicSocketControl_h