Bug 1890844 - Tiny cleanup of classes implementing nsDOMCSSDeclaration r=layout-revie...
[gecko.git] / dom / credentialmanagement / Credential.h
blobbb5fbd9539b0e922ae8d8f0e3cdd23e9c2c26a7e
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/. */
7 #ifndef mozilla_dom_Credential_h
8 #define mozilla_dom_Credential_h
10 #include "mozilla/dom/CredentialManagementBinding.h"
11 #include "nsCycleCollectionParticipant.h"
12 #include "nsPIDOMWindow.h"
13 #include "nsWrapperCache.h"
15 namespace mozilla::dom {
17 class Credential : public nsISupports, public nsWrapperCache {
18 public:
19 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
20 NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Credential)
22 public:
23 explicit Credential(nsPIDOMWindowInner* aParent);
25 protected:
26 virtual ~Credential();
28 public:
29 nsISupports* GetParentObject() const { return mParent; }
31 JSObject* WrapObject(JSContext* aCx,
32 JS::Handle<JSObject*> aGivenProto) override;
34 void GetId(nsAString& aId) const;
36 void GetType(nsAString& aType) const;
38 void SetId(const nsAString& aId);
40 void SetType(const nsAString& aType);
42 private:
43 nsCOMPtr<nsPIDOMWindowInner> mParent;
44 nsAutoString mId;
45 nsAutoString mType;
48 } // namespace mozilla::dom
50 #endif // mozilla_dom_Credential_h