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

Unified Diff: components/payments/content/origin_security_checker.cc

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/origin_security_checker.cc
diff --git a/components/payments/content/origin_security_checker.cc b/components/payments/content/origin_security_checker.cc
index 5cede98ca114cd9f025877949892d9c1a9a96c03..20986082d4796c4eeb7d7326ba6f1add2804dea1 100644
--- a/components/payments/content/origin_security_checker.cc
+++ b/components/payments/content/origin_security_checker.cc
@@ -5,6 +5,7 @@
#include "components/payments/content/origin_security_checker.h"
#include "content/public/common/origin_util.h"
+#include "net/base/url_util.h"
#include "url/gurl.h"
namespace payments {
@@ -19,4 +20,10 @@ bool OriginSecurityChecker::IsSchemeCryptographic(const GURL& url) {
return url.is_valid() && url.SchemeIsCryptographic();
}
+// static
+bool OriginSecurityChecker::IsOriginLocalhostOrFile(const GURL& url) {
+ return url.is_valid() &&
+ (net::IsLocalhost(url.HostNoBrackets()) || url.SchemeIsFile());
+}
+
} // namespace payments
« no previous file with comments | « components/payments/content/origin_security_checker.h ('k') | components/payments/mojom/payment_request.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698