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

Side by Side Diff: components/payments/content/origin_security_checker.cc

Issue 2956643002: Add GURL::HostNoBracketsPiece() (Closed)
Patch Set: Simplify test Created 3 years, 5 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 "net/base/url_util.h"
9 #include "url/gurl.h" 9 #include "url/gurl.h"
10 10
11 namespace payments { 11 namespace payments {
12 12
13 // static 13 // static
14 bool OriginSecurityChecker::IsOriginSecure(const GURL& url) { 14 bool OriginSecurityChecker::IsOriginSecure(const GURL& url) {
15 return url.is_valid() && content::IsOriginSecure(url); 15 return url.is_valid() && content::IsOriginSecure(url);
16 } 16 }
17 17
18 // static 18 // static
19 bool OriginSecurityChecker::IsSchemeCryptographic(const GURL& url) { 19 bool OriginSecurityChecker::IsSchemeCryptographic(const GURL& url) {
20 return url.is_valid() && url.SchemeIsCryptographic(); 20 return url.is_valid() && url.SchemeIsCryptographic();
21 } 21 }
22 22
23 // static 23 // static
24 bool OriginSecurityChecker::IsOriginLocalhostOrFile(const GURL& url) { 24 bool OriginSecurityChecker::IsOriginLocalhostOrFile(const GURL& url) {
25 return url.is_valid() && 25 return url.is_valid() &&
26 (net::IsLocalhost(url.HostNoBrackets()) || url.SchemeIsFile()); 26 (net::IsLocalhost(url.HostNoBracketsPiece()) || url.SchemeIsFile());
27 } 27 }
28 28
29 } // namespace payments 29 } // namespace payments
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/net/websocket.cc ('k') | content/browser/frame_host/mixed_content_navigation_throttle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698