Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(375)

Issue 2866623003: PaymentRequest.canMakePayment() query quota on desktop. (Closed)

Created:
3 years, 7 months ago by please use gerrit instead
Modified:
3 years, 7 months ago
CC:
chromium-reviews, droger+watchlist_chromium.org, tfarina, sdefresne+watchlist_chromium.org, jam, gogerald+paymentswatch_chromium.org, rouslan+payments_chromium.org, darin-cc_chromium.org, blundell+watchlist_chromium.org, mahmadi+paymentswatch_chromium.org, sebsg+paymentswatch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

PaymentRequest.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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+380 lines, -42 lines) Patch
M chrome/browser/chrome_content_browser_client.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/payments/payment_request_factory.h View 1 2 1 chunk +9 lines, -8 lines 0 comments Download
M chrome/browser/payments/payment_request_factory.cc View 1 chunk +6 lines, -8 lines 0 comments Download
M chrome/browser/ui/views/payments/payment_request_browsertest_base.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/views/payments/payment_request_browsertest_base.cc View 1 5 chunks +19 lines, -6 lines 0 comments Download
M chrome/browser/ui/views/payments/payment_request_can_make_payment_browsertest.cc View 1 1 chunk +98 lines, -0 lines 0 comments Download
M chrome/test/data/payments/can_make_payment_query_cc.js View 2 chunks +3 lines, -6 lines 0 comments Download
M components/payments/content/BUILD.gn View 2 chunks +3 lines, -0 lines 0 comments Download
M components/payments/content/DEPS View 1 chunk +1 line, -0 lines 0 comments Download
A components/payments/content/can_make_payment_query_factory.h View 1 chunk +46 lines, -0 lines 0 comments Download
A components/payments/content/can_make_payment_query_factory.cc View 1 chunk +36 lines, -0 lines 0 comments Download
M components/payments/content/payment_request.h View 1 3 chunks +8 lines, -1 line 0 comments Download
M components/payments/content/payment_request.cc View 1 3 chunks +29 lines, -8 lines 0 comments Download
M components/payments/content/payment_request_spec.h View 3 chunks +9 lines, -0 lines 0 comments Download
M components/payments/content/payment_request_spec.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M components/payments/content/payment_request_web_contents_manager.h View 1 2 chunks +4 lines, -1 line 0 comments Download
M components/payments/content/payment_request_web_contents_manager.cc View 1 1 chunk +3 lines, -2 lines 0 comments Download
M components/payments/core/BUILD.gn View 2 chunks +3 lines, -0 lines 0 comments Download
M components/payments/core/DEPS View 1 chunk +1 line, -0 lines 0 comments Download
A components/payments/core/can_make_payment_query.h View 1 1 chunk +50 lines, -0 lines 0 comments Download
A components/payments/core/can_make_payment_query.cc View 1 1 chunk +44 lines, -0 lines 0 comments Download

Messages

Total messages: 40 (32 generated)
please use gerrit instead
Mathieu, ptal.
3 years, 7 months ago (2017-05-08 14:49:46 UTC) #15
Mathieu
Great! Few comments https://codereview.chromium.org/2866623003/diff/40001/chrome/browser/payments/payment_request_factory.h File chrome/browser/payments/payment_request_factory.h (right): https://codereview.chromium.org/2866623003/diff/40001/chrome/browser/payments/payment_request_factory.h#newcode19 chrome/browser/payments/payment_request_factory.h:19: // Will create a PaymentRequest attached ...
3 years, 7 months ago (2017-05-08 15:28:12 UTC) #20
please use gerrit instead
Mathieu, PTAL patch 2. Elliot, I'm adding a dependency from //components/payments to //components/keyed_service. You're an ...
3 years, 7 months ago (2017-05-08 17:28:47 UTC) #26
Mathieu
lgtm https://codereview.chromium.org/2866623003/diff/60001/chrome/browser/payments/payment_request_factory.h File chrome/browser/payments/payment_request_factory.h (right): https://codereview.chromium.org/2866623003/diff/60001/chrome/browser/payments/payment_request_factory.h#newcode19 chrome/browser/payments/payment_request_factory.h:19: // |request| was initiated by the iframe hosted ...
3 years, 7 months ago (2017-05-08 18:03:51 UTC) #27
please use gerrit instead
https://codereview.chromium.org/2866623003/diff/60001/chrome/browser/payments/payment_request_factory.h File chrome/browser/payments/payment_request_factory.h (right): https://codereview.chromium.org/2866623003/diff/60001/chrome/browser/payments/payment_request_factory.h#newcode19 chrome/browser/payments/payment_request_factory.h:19: // |request| was initiated by the iframe hosted by ...
3 years, 7 months ago (2017-05-08 18:05:56 UTC) #28
please use gerrit instead
Elliot TBR.
3 years, 7 months ago (2017-05-09 17:49:27 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2866623003/80001
3 years, 7 months ago (2017-05-09 17:50:40 UTC) #37
commit-bot: I haz the power
3 years, 7 months ago (2017-05-09 18:09:00 UTC) #40
Message was sent while issue was closed.
Committed patchset #3 (id:80001) as
https://chromium.googlesource.com/chromium/src/+/690997683fffaf201782981ab917...

Powered by Google App Engine
This is Rietveld 408576698