/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* 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_dom_MLSGroup_h #define mozilla_dom_MLSGroup_h #include "mozilla/DOMEventTargetHelper.h" #include "mozilla/dom/Promise.h" #include "mozilla/dom/MLS.h" class nsIGlobalObject; namespace mozilla::dom { class MLSGroupView final : public nsISupports, public nsWrapperCache { public: NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MLSGroupView) explicit MLSGroupView(MLS* aMLS, nsTArray&& aGroupId, nsTArray&& aClientId); nsISupports* GetParentObject() const { return mMLS; } JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; void GetGroupId(JSContext* aCx, JS::MutableHandle aGroupId, ErrorResult& aRv); void GetClientId(JSContext* aCx, JS::MutableHandle aClientId, ErrorResult& aRv); already_AddRefed DeleteState(ErrorResult& aRv); already_AddRefed Add( const MLSBytesOrUint8Array& aJsKeyPackage, ErrorResult& aRv); already_AddRefed ProposeAdd( const MLSBytesOrUint8Array& aJsKeyPackage, ErrorResult& aRv); already_AddRefed Remove( const MLSBytesOrUint8Array& aJsRemClientIdentifier, ErrorResult& aRv); already_AddRefed ProposeRemove( const MLSBytesOrUint8Array& aJsRemClientIdentifier, ErrorResult& aRv); already_AddRefed Close(ErrorResult& aRv); already_AddRefed Details(ErrorResult& aRv); already_AddRefed Send( const MLSBytesOrUint8ArrayOrUTF8String& aJsMessage, ErrorResult& aRv); already_AddRefed Receive( const MLSBytesOrUint8Array& aJsMessage, ErrorResult& aRv); already_AddRefed HasPendingProposals(ErrorResult& aRv); already_AddRefed ClearPendingProposals( ErrorResult& aRv); already_AddRefed HasPendingCommit(ErrorResult& aRv); already_AddRefed ClearPendingCommit(ErrorResult& aRv); already_AddRefed ApplyPendingCommit(ErrorResult& aRv); already_AddRefed ExportSecret( const MLSBytesOrUint8ArrayOrUTF8String& aJsLabel, const MLSBytesOrUint8Array& aJsContext, const uint64_t aLen, ErrorResult& aRv); private: virtual ~MLSGroupView() { mozilla::DropJSObjects(this); } RefPtr mMLS; nsTArray mGroupId; nsTArray mClientId; JS::Heap mJsGroupId; JS::Heap mJsClientId; }; } // namespace mozilla::dom #endif