tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

Credential.cpp (1393B)


      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 #include "mozilla/dom/Credential.h"
      8 
      9 #include "mozilla/dom/CredentialManagementBinding.h"
     10 #include "nsCycleCollectionParticipant.h"
     11 
     12 namespace mozilla::dom {
     13 
     14 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(Credential, mParent)
     15 
     16 NS_IMPL_CYCLE_COLLECTING_ADDREF(Credential)
     17 NS_IMPL_CYCLE_COLLECTING_RELEASE(Credential)
     18 
     19 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(Credential)
     20  NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
     21  NS_INTERFACE_MAP_ENTRY(nsISupports)
     22 NS_INTERFACE_MAP_END
     23 
     24 Credential::Credential(nsPIDOMWindowInner* aParent) : mParent(aParent) {}
     25 
     26 Credential::~Credential() = default;
     27 
     28 JSObject* Credential::WrapObject(JSContext* aCx,
     29                                 JS::Handle<JSObject*> aGivenProto) {
     30  return Credential_Binding::Wrap(aCx, this, aGivenProto);
     31 }
     32 
     33 void Credential::GetId(nsAString& aId) const { aId.Assign(mId); }
     34 
     35 void Credential::GetType(nsAString& aType) const { aType.Assign(mType); }
     36 
     37 void Credential::SetId(const nsAString& aId) { mId.Assign(aId); }
     38 
     39 void Credential::SetType(const nsAString& aType) { mType.Assign(aType); }
     40 
     41 }  // namespace mozilla::dom