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
{
19 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
20 NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Credential
)
23 explicit Credential(nsPIDOMWindowInner
* aParent
);
26 virtual ~Credential();
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
);
43 nsCOMPtr
<nsPIDOMWindowInner
> mParent
;
48 } // namespace mozilla::dom
50 #endif // mozilla_dom_Credential_h