Skip to content

Commit

Permalink
Bug 1435155 - Redact the shipping address as it is visible before the…
Browse files Browse the repository at this point in the history
… promise from PaymentRequest.show() resolves successfully. r=baku

Spec PR: w3c/payment-request#654

MozReview-Commit-ID: 2AiKI7htRhk

UltraBlame original commit: fbc6dec319be8067e0d26055e9c93a5fca74d718
  • Loading branch information
marco-c committed Oct 2, 2019
1 parent a568c1c commit 3c9b818
Show file tree
Hide file tree
Showing 4 changed files with 823 additions and 155 deletions.
52 changes: 52 additions & 0 deletions dom/payments/PaymentRequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE
(
mShippingAddress
)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE
(
mFullShippingAddress
)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED
(
Expand All @@ -133,6 +137,10 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK
(
mShippingAddress
)
NS_IMPL_CYCLE_COLLECTION_UNLINK
(
mFullShippingAddress
)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION
(
Expand Down Expand Up @@ -3775,6 +3783,17 @@ aRv
return
;
}
mShippingAddress
.
swap
(
mFullShippingAddress
)
;
mFullShippingAddress
=
nullptr
;
RefPtr
<
PaymentResponse
Expand Down Expand Up @@ -4533,6 +4552,12 @@ nsAString
aPhone
)
{
nsTArray
<
nsString
>
emptyArray
;
mShippingAddress
=
new
Expand All @@ -4542,6 +4567,33 @@ GetOwner
(
)
aCountry
emptyArray
aRegion
aCity
aDependentLocality
aPostalCode
aSortingCode
aLanguageCode
EmptyString
(
)
EmptyString
(
)
EmptyString
(
)
)
;
mFullShippingAddress
=
new
PaymentAddress
(
GetOwner
(
)
aCountry
aAddressLine
aRegion
aCity
Expand Down
6 changes: 6 additions & 0 deletions dom/payments/PaymentRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,12 @@ PaymentAddress
>
mShippingAddress
;
RefPtr
<
PaymentAddress
>
mFullShippingAddress
;
nsString
mShippingOption
;
Expand Down
4 changes: 4 additions & 0 deletions dom/payments/test/ShowPaymentChromeScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ San
Bruno
"
"
Test
locality
"
"
94066
Expand All @@ -195,6 +197,8 @@ Bruno
en
"
"
Testing
Org
"
"
Bill
Expand Down
Loading

0 comments on commit 3c9b818

Please sign in to comment.