IdentityProvider.h (1490B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 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 mozilla_dom_IdentityProvider_h 8 #define mozilla_dom_IdentityProvider_h 9 10 #include "ErrorList.h" 11 #include "mozilla/dom/CanonicalBrowsingContext.h" 12 #include "mozilla/dom/IdentityCredentialBinding.h" 13 #include "nsCOMPtr.h" 14 #include "nsIGlobalObject.h" 15 #include "nsISupports.h" 16 #include "nsWrapperCache.h" 17 18 namespace mozilla::dom { 19 20 class IdentityProvider : public nsWrapperCache { 21 public: 22 NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(IdentityProvider) 23 NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(IdentityProvider) 24 25 explicit IdentityProvider(nsIGlobalObject* aGlobal); 26 nsIGlobalObject* GetParentObject() const { return mOwner; } 27 virtual JSObject* WrapObject(JSContext* aCx, 28 JS::Handle<JSObject*> aGivenProto) override; 29 30 static void Close(const GlobalObject& aGlobal); 31 static already_AddRefed<Promise> Resolve( 32 const GlobalObject& aGlobal, const nsACString& aToken, 33 const IdentityResolveOptions& aOptions, ErrorResult& aRv); 34 35 protected: 36 virtual ~IdentityProvider(); 37 38 private: 39 nsCOMPtr<nsIGlobalObject> mOwner; 40 }; 41 42 } // namespace mozilla::dom 43 44 #endif // mozilla_dom_IdentityProvider_h