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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java

Issue 2753773008: Limit canMakePayment per iframe (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
index edd54e6af079a05478b09f49d63e0d27fd7e5509..789b9f9e71bec3de3a63137bc8311759508c9910 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
@@ -224,10 +224,10 @@ public class PaymentRequestImpl
private static boolean sIsAnyPaymentRequestShowing;
/**
- * In-memory mapping of the origins of websites that have recently called canMakePayment()
- * to the list of the payment methods that were being queried. Used for throttling the usage of
- * this call. The mapping is shared among all instances of PaymentRequestImpl in the browser
- * process on UI thread. The user can reset the throttling mechanism by restarting the browser.
+ * In-memory mapping of the origins of iframes that have recently called canMakePayment() to the
+ * list of the payment methods that were being queried. Used for throttling the usage of this
+ * call. The mapping is shared among all instances of PaymentRequestImpl in the browser process
+ * on UI thread. The user can reset the throttling mechanism by restarting the browser.
*/
private static Map<String, CanMakePaymentQuery> sCanMakePaymentQueries;
@@ -649,7 +649,8 @@ public class PaymentRequestImpl
}
if (queryApps.isEmpty()) {
- CanMakePaymentQuery query = sCanMakePaymentQueries.get(mSchemelessOriginForPaymentApp);
+ CanMakePaymentQuery query =
+ sCanMakePaymentQueries.get(mSchemelessIFrameOriginForPaymentApp);
if (query != null && query.matchesPaymentMethods(mMethodData)) {
query.notifyObserversOfResponse(mCanMakePayment);
}
@@ -1272,14 +1273,15 @@ public class PaymentRequestImpl
public void canMakePayment() {
if (mClient == null) return;
- CanMakePaymentQuery query = sCanMakePaymentQueries.get(mSchemelessOriginForPaymentApp);
+ CanMakePaymentQuery query =
+ sCanMakePaymentQueries.get(mSchemelessIFrameOriginForPaymentApp);
if (query == null) {
query = new CanMakePaymentQuery(Collections.unmodifiableMap(mMethodData));
- sCanMakePaymentQueries.put(mSchemelessOriginForPaymentApp, query);
+ sCanMakePaymentQueries.put(mSchemelessIFrameOriginForPaymentApp, query);
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
- sCanMakePaymentQueries.remove(mSchemelessOriginForPaymentApp);
+ sCanMakePaymentQueries.remove(mSchemelessIFrameOriginForPaymentApp);
}
}, CAN_MAKE_PAYMENT_QUERY_PERIOD_MS);
} else if (!query.matchesPaymentMethods(Collections.unmodifiableMap(mMethodData))) {
@@ -1412,7 +1414,8 @@ public class PaymentRequestImpl
}
}
- CanMakePaymentQuery query = sCanMakePaymentQueries.get(mSchemelessOriginForPaymentApp);
+ CanMakePaymentQuery query =
+ sCanMakePaymentQueries.get(mSchemelessIFrameOriginForPaymentApp);
if (query != null && query.matchesPaymentMethods(mMethodData)) {
query.notifyObserversOfResponse(mCanMakePayment);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698