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

Unified Diff: components/payments/content/android/java/src/org/chromium/components/payments/OriginSecurityChecker.java

Issue 2836443002: No rate limit for canMakePayment() on localhost and file://. (Closed)
Patch Set: Comments Created 3 years, 8 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
Index: components/payments/content/android/java/src/org/chromium/components/payments/OriginSecurityChecker.java
diff --git a/components/payments/content/android/java/src/org/chromium/components/payments/OriginSecurityChecker.java b/components/payments/content/android/java/src/org/chromium/components/payments/OriginSecurityChecker.java
index 7896be16d758b744b0d989045ac116bcdb3743aa..5ec3c98625d37ffc6efe89707d655b94bb2effd5 100644
--- a/components/payments/content/android/java/src/org/chromium/components/payments/OriginSecurityChecker.java
+++ b/components/payments/content/android/java/src/org/chromium/components/payments/OriginSecurityChecker.java
@@ -10,8 +10,8 @@ import org.chromium.base.annotations.JNINamespace;
@JNINamespace("payments")
public class OriginSecurityChecker {
/**
- * Returns true for a valid URL from a secure origin, e.g., http://localhost, file://test.html,
- * https://bobpay.com.
+ * Returns true for a valid URL from a secure origin, e.g., http://localhost,
+ * file:///home/user/test.html, https://bobpay.com.
*
* @param url The URL to check.
* @return Whether the origin of the URL is secure.
@@ -30,8 +30,20 @@ public class OriginSecurityChecker {
return nativeIsSchemeCryptographic(url);
}
+ /**
+ * Returns true for a valid URL with localhost or file:// scheme origin, e.g., http://localhost,
+ * file:///home/user/test.html.
+ *
+ * @param url The URL to check.
+ * @return Whether the URL is localhost or file:// scheme origin.
+ */
+ public static boolean isOriginLocalhostOrFile(String url) {
+ return nativeIsOriginLocalhostOrFile(url);
+ }
+
private OriginSecurityChecker() {}
private static native boolean nativeIsOriginSecure(String url);
private static native boolean nativeIsSchemeCryptographic(String url);
+ private static native boolean nativeIsOriginLocalhostOrFile(String url);
}
« no previous file with comments | « chrome/browser/flag_descriptions.cc ('k') | components/payments/content/android/origin_security_checker_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698