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

Unified Diff: third_party/WebKit/Source/platform/weborigin/SecurityPolicy.cpp

Issue 2417883002: Avoid initializing a SecurityOrigin from a KURL for isSecure() check. (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « third_party/WebKit/Source/platform/weborigin/SecurityPolicy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/weborigin/SecurityPolicy.cpp
diff --git a/third_party/WebKit/Source/platform/weborigin/SecurityPolicy.cpp b/third_party/WebKit/Source/platform/weborigin/SecurityPolicy.cpp
index ee60b12d53d92d8dbe4b922e3f740a015c5c41bf..2971d499926ac889ac8f29890296148f4ca0f9f5 100644
--- a/third_party/WebKit/Source/platform/weborigin/SecurityPolicy.cpp
+++ b/third_party/WebKit/Source/platform/weborigin/SecurityPolicy.cpp
@@ -207,6 +207,13 @@ bool SecurityPolicy::isOriginWhiteListedTrustworthy(
return trustworthyOriginSet().contains(origin.toRawString());
}
+bool SecurityPolicy::isUrlWhiteListedTrustworthy(const KURL& url) {
+ // Early return to avoid initializing the SecurityOrigin.
+ if (trustworthyOriginSet().isEmpty())
+ return false;
+ return isOriginWhiteListedTrustworthy(*SecurityOrigin::create(url).get());
+}
+
bool SecurityPolicy::isAccessWhiteListed(const SecurityOrigin* activeOrigin,
const SecurityOrigin* targetOrigin) {
if (OriginAccessWhiteList* list =
« no previous file with comments | « third_party/WebKit/Source/platform/weborigin/SecurityPolicy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698