Bug 1852740: add tests for the `fetchpriority` attribute in Link headers. r=necko...
[gecko.git] / dom / payments / PaymentAddress.cpp
blob86e3b446c73ca2b062d605f4ab2de081fec45656
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/PaymentAddress.h"
8 #include "mozilla/dom/PaymentAddressBinding.h"
10 namespace mozilla::dom {
12 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(PaymentAddress, mOwner)
14 NS_IMPL_CYCLE_COLLECTING_ADDREF(PaymentAddress)
15 NS_IMPL_CYCLE_COLLECTING_RELEASE(PaymentAddress)
17 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(PaymentAddress)
18 NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
19 NS_INTERFACE_MAP_ENTRY(nsISupports)
20 NS_INTERFACE_MAP_END
22 PaymentAddress::PaymentAddress(
23 nsPIDOMWindowInner* aWindow, const nsAString& aCountry,
24 const nsTArray<nsString>& aAddressLine, const nsAString& aRegion,
25 const nsAString& aRegionCode, const nsAString& aCity,
26 const nsAString& aDependentLocality, const nsAString& aPostalCode,
27 const nsAString& aSortingCode, const nsAString& aOrganization,
28 const nsAString& aRecipient, const nsAString& aPhone)
29 : mCountry(aCountry),
30 mAddressLine(aAddressLine.Clone()),
31 mRegion(aRegion),
32 mRegionCode(aRegionCode),
33 mCity(aCity),
34 mDependentLocality(aDependentLocality),
35 mPostalCode(aPostalCode),
36 mSortingCode(aSortingCode),
37 mOrganization(aOrganization),
38 mRecipient(aRecipient),
39 mPhone(aPhone),
40 mOwner(aWindow) {}
42 void PaymentAddress::GetCountry(nsAString& aRetVal) const {
43 aRetVal = mCountry;
46 void PaymentAddress::GetAddressLine(nsTArray<nsString>& aRetVal) const {
47 aRetVal = mAddressLine.Clone();
50 void PaymentAddress::GetRegion(nsAString& aRetVal) const { aRetVal = mRegion; }
52 void PaymentAddress::GetRegionCode(nsAString& aRetVal) const {
53 aRetVal = mRegionCode;
56 void PaymentAddress::GetCity(nsAString& aRetVal) const { aRetVal = mCity; }
58 void PaymentAddress::GetDependentLocality(nsAString& aRetVal) const {
59 aRetVal = mDependentLocality;
62 void PaymentAddress::GetPostalCode(nsAString& aRetVal) const {
63 aRetVal = mPostalCode;
66 void PaymentAddress::GetSortingCode(nsAString& aRetVal) const {
67 aRetVal = mSortingCode;
70 void PaymentAddress::GetOrganization(nsAString& aRetVal) const {
71 aRetVal = mOrganization;
74 void PaymentAddress::GetRecipient(nsAString& aRetVal) const {
75 aRetVal = mRecipient;
78 void PaymentAddress::GetPhone(nsAString& aRetVal) const { aRetVal = mPhone; }
80 PaymentAddress::~PaymentAddress() = default;
82 JSObject* PaymentAddress::WrapObject(JSContext* aCx,
83 JS::Handle<JSObject*> aGivenProto) {
84 return PaymentAddress_Binding::Wrap(aCx, this, aGivenProto);
87 } // namespace mozilla::dom