Chromium Code Reviews
DescriptionPaymentRequest.canMakePayment() query quota on desktop.
Before this patch, Chrome on Android would restrict canMakePayment()
queries to 1 per 30 minutes per iframe origin. Desktop did not have this
restriction.
This patch adds a browser-wide service CanMakePaymentQuery that keeps
track of canMakePayment() queries in iframes. The first call to
canMakePayment() from an iframe saves the query in memory and starts a
30 minute timer that, after ending, forgets the query. During these 30
minutes, the iframe origin is allowed to call canMakePayment() only with
its original query. This restriction is lifted for localhost and file://
scheme origins for web developer convenience, but a warning is printed
in the developer console. This patch switches PaymentRequest browser
tests from https://127.0.0.1 to use https://a.com instead to simulate
usage in production.
After this patch, Chrome on desktop behaves in the same way as on
Android: each iframe origin can call canMakePayment() with 1 query per
30 minutes.
TEST=PaymentRequestCanMakePaymentCCQuery.QueryQuota
TBR=erg@chromium.org
BUG=704676
Review-Url: https://codereview.chromium.org/2866623003
Cr-Commit-Position: refs/heads/master@{#470382}
Committed: https://chromium.googlesource.com/chromium/src/+/690997683fffaf201782981ab91701653a0a6a90
Patch Set 1 #
Total comments: 18
Patch Set 2 : Address comments #
Total comments: 2
Patch Set 3 : frame #Messages
Total messages: 40 (32 generated)
|