Credential.h (1334B)
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_Credential_h 8 #define mozilla_dom_Credential_h 9 10 #include "mozilla/dom/CredentialManagementBinding.h" 11 #include "nsCycleCollectionParticipant.h" 12 #include "nsPIDOMWindow.h" 13 #include "nsWrapperCache.h" 14 15 namespace mozilla::dom { 16 17 class Credential : public nsISupports, public nsWrapperCache { 18 public: 19 NS_DECL_CYCLE_COLLECTING_ISUPPORTS 20 NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Credential) 21 22 public: 23 explicit Credential(nsPIDOMWindowInner* aParent); 24 25 protected: 26 virtual ~Credential(); 27 28 public: 29 nsISupports* GetParentObject() const { return mParent; } 30 31 JSObject* WrapObject(JSContext* aCx, 32 JS::Handle<JSObject*> aGivenProto) override; 33 34 void GetId(nsAString& aId) const; 35 36 void GetType(nsAString& aType) const; 37 38 void SetId(const nsAString& aId); 39 40 void SetType(const nsAString& aType); 41 42 private: 43 nsCOMPtr<nsPIDOMWindowInner> mParent; 44 nsAutoString mId; 45 nsAutoString mType; 46 }; 47 48 } // namespace mozilla::dom 49 50 #endif // mozilla_dom_Credential_h