New issue
Advanced search Search tips

Issue 704676 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 3
Type: Bug

Blocking:
issue 704706



Sign in to add a comment

[Payments] Desktop - implement query quota for canMakePayment

Project Member Reported by ma...@chromium.org, Mar 23 2017

Issue description

Implement a quota policy for canMakePayment, and return QUERY_QUOTA_EXCEEDED accordingly.
 

Comment 1 by ma...@chromium.org, Mar 23 2017

Blocking: 704706

Comment 2 by ma...@chromium.org, May 2 2017

Cc: ma...@chromium.org
Owner: rouslan@chromium.org
Thanks Rouslan for taking this on
:-O
Status: Started (was: Assigned)

Comment 6 Deleted

Project Member

Comment 7 by bugdroid1@chromium.org, May 9 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/690997683fffaf201782981ab91701653a0a6a90

commit 690997683fffaf201782981ab91701653a0a6a90
Author: rouslan <rouslan@chromium.org>
Date: Tue May 09 18:07:39 2017

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}

[modify] https://crrev.com/690997683fffaf201782981ab91701653a0a6a90/chrome/browser/chrome_content_browser_client.cc
[modify] https://crrev.com/690997683fffaf201782981ab91701653a0a6a90/chrome/browser/payments/payment_request_factory.cc
[modify] https://crrev.com/690997683fffaf201782981ab91701653a0a6a90/chrome/browser/payments/payment_request_factory.h
[modify] https://crrev.com/690997683fffaf201782981ab91701653a0a6a90/chrome/browser/ui/views/payments/payment_request_browsertest_base.cc
[modify] https://crrev.com/690997683fffaf201782981ab91701653a0a6a90/chrome/browser/ui/views/payments/payment_request_browsertest_base.h
[modify] https://crrev.com/690997683fffaf201782981ab91701653a0a6a90/chrome/browser/ui/views/payments/payment_request_can_make_payment_browsertest.cc
[modify] https://crrev.com/690997683fffaf201782981ab91701653a0a6a90/chrome/test/data/payments/can_make_payment_query_cc.js
[modify] https://crrev.com/690997683fffaf201782981ab91701653a0a6a90/components/payments/content/BUILD.gn
[modify] https://crrev.com/690997683fffaf201782981ab91701653a0a6a90/components/payments/content/DEPS
[add] https://crrev.com/690997683fffaf201782981ab91701653a0a6a90/components/payments/content/can_make_payment_query_factory.cc
[add] https://crrev.com/690997683fffaf201782981ab91701653a0a6a90/components/payments/content/can_make_payment_query_factory.h
[modify] https://crrev.com/690997683fffaf201782981ab91701653a0a6a90/components/payments/content/payment_request.cc
[modify] https://crrev.com/690997683fffaf201782981ab91701653a0a6a90/components/payments/content/payment_request.h
[modify] https://crrev.com/690997683fffaf201782981ab91701653a0a6a90/components/payments/content/payment_request_spec.cc
[modify] https://crrev.com/690997683fffaf201782981ab91701653a0a6a90/components/payments/content/payment_request_spec.h
[modify] https://crrev.com/690997683fffaf201782981ab91701653a0a6a90/components/payments/content/payment_request_web_contents_manager.cc
[modify] https://crrev.com/690997683fffaf201782981ab91701653a0a6a90/components/payments/content/payment_request_web_contents_manager.h
[modify] https://crrev.com/690997683fffaf201782981ab91701653a0a6a90/components/payments/core/BUILD.gn
[modify] https://crrev.com/690997683fffaf201782981ab91701653a0a6a90/components/payments/core/DEPS
[add] https://crrev.com/690997683fffaf201782981ab91701653a0a6a90/components/payments/core/can_make_payment_query.cc
[add] https://crrev.com/690997683fffaf201782981ab91701653a0a6a90/components/payments/core/can_make_payment_query.h

Status: Fixed (was: Started)
Components: -UI>Browser>Autofill>Payments UI>Browser>Payments

Sign in to add a comment