Bug 1890277: part 2) Add `require-trusted-types-for` directive to CSP parser, guarded...
[gecko.git] / dom / credentialmanagement / Credential.cpp
blob5314008944cd9949f342fd1ba37705f404ce67f7
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 #include "mozilla/dom/Credential.h"
8 #include "mozilla/dom/CredentialManagementBinding.h"
9 #include "nsCycleCollectionParticipant.h"
11 namespace mozilla::dom {
13 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(Credential, mParent)
15 NS_IMPL_CYCLE_COLLECTING_ADDREF(Credential)
16 NS_IMPL_CYCLE_COLLECTING_RELEASE(Credential)
18 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(Credential)
19 NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
20 NS_INTERFACE_MAP_ENTRY(nsISupports)
21 NS_INTERFACE_MAP_END
23 Credential::Credential(nsPIDOMWindowInner* aParent) : mParent(aParent) {}
25 Credential::~Credential() = default;
27 JSObject* Credential::WrapObject(JSContext* aCx,
28 JS::Handle<JSObject*> aGivenProto) {
29 return Credential_Binding::Wrap(aCx, this, aGivenProto);
32 void Credential::GetId(nsAString& aId) const { aId.Assign(mId); }
34 void Credential::GetType(nsAString& aType) const { aType.Assign(mType); }
36 void Credential::SetId(const nsAString& aId) { mId.Assign(aId); }
38 void Credential::SetType(const nsAString& aType) { mType.Assign(aType); }
40 } // namespace mozilla::dom