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

Unified Diff: content/common/origin_util.cc

Issue 1905033002: PlzNavigate: Move navigation-level mixed content checks to the browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@console-security-message
Patch Set: Overall code cleanup to request reviewers to PTAL. Created 4 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 side-by-side diff with in-line comments
Download patch
Index: content/common/origin_util.cc
diff --git a/content/common/origin_util.cc b/content/common/origin_util.cc
index 4dfdc6ce8caf7efae0598c82dace3bc6171e8b65..268fe43b74743bb37f4cf058201569e81611744b 100644
--- a/content/common/origin_util.cc
+++ b/content/common/origin_util.cc
@@ -62,10 +62,8 @@ bool IsOriginSecure(const GURL& url) {
if (ContainsKey(g_trustworthy_whitelist.Get().secure_schemes(), url.scheme()))
return true;
- if (ContainsKey(g_trustworthy_whitelist.Get().secure_origins(),
- url.GetOrigin())) {
+ if (IsOriginWhiteListedTrustworthy(url))
return true;
- }
return false;
}
@@ -82,6 +80,11 @@ bool OriginCanAccessServiceWorkers(const GURL& url) {
return false;
}
+bool IsOriginWhiteListedTrustworthy(const GURL& url) {
+ return ContainsKey(g_trustworthy_whitelist.Get().secure_origins(),
+ url.GetOrigin());
+}
+
void ResetSchemesAndOriginsWhitelistForTesting() {
g_trustworthy_whitelist.Get().Reset();
}

Powered by Google App Engine
This is Rietveld 408576698