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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/payments/content/origin_security_checker.h" 5 #include "components/payments/content/origin_security_checker.h"
6 6
7 #include "content/public/common/origin_util.h" 7 #include "content/public/common/origin_util.h"
8 #include "net/base/url_util.h"
8 #include "url/gurl.h" 9 #include "url/gurl.h"
9 10
10 namespace payments { 11 namespace payments {
11 12
12 // static 13 // static
13 bool OriginSecurityChecker::IsOriginSecure(const GURL& url) { 14 bool OriginSecurityChecker::IsOriginSecure(const GURL& url) {
14 return url.is_valid() && content::IsOriginSecure(url); 15 return url.is_valid() && content::IsOriginSecure(url);
15 } 16 }
16 17
17 // static 18 // static
18 bool OriginSecurityChecker::IsSchemeCryptographic(const GURL& url) { 19 bool OriginSecurityChecker::IsSchemeCryptographic(const GURL& url) {
19 return url.is_valid() && url.SchemeIsCryptographic(); 20 return url.is_valid() && url.SchemeIsCryptographic();
20 } 21 }
21 22
23 // static
24 bool OriginSecurityChecker::IsOriginLocalhostOrFile(const GURL& url) {
25 return url.is_valid() &&
26 (net::IsLocalhost(url.HostNoBrackets()) || url.SchemeIsFile());
27 }
28
22 } // namespace payments 29 } // namespace payments
OLDNEW
« 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