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

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

Issue 1383483007: Add scheme exceptions for isSecureContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Fixes Created 5 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
Index: third_party/WebKit/Source/platform/weborigin/SchemeRegistry.cpp
diff --git a/third_party/WebKit/Source/platform/weborigin/SchemeRegistry.cpp b/third_party/WebKit/Source/platform/weborigin/SchemeRegistry.cpp
index 46964fa41cf75e84717c4e74ee3e34721516e65c..9ed54cd0961078b5b37ebe2aae8f692b998805fa 100644
--- a/third_party/WebKit/Source/platform/weborigin/SchemeRegistry.cpp
+++ b/third_party/WebKit/Source/platform/weborigin/SchemeRegistry.cpp
@@ -203,6 +203,13 @@ static URLSchemesMap<SchemeRegistry::PolicyAreas>& ContentSecurityPolicyBypassin
return schemes;
}
+static URLSchemesSet& secureContextBypassingSchemes()
+{
+ assertLockHeld();
+ DEFINE_STATIC_LOCAL_NOASSERT(URLSchemesSet, secureContextBypassingSchemes, ());
+ return secureContextBypassingSchemes;
+}
+
bool SchemeRegistry::shouldTreatURLSchemeAsLocal(const String& scheme)
{
if (scheme.isEmpty())
@@ -425,4 +432,18 @@ bool SchemeRegistry::schemeShouldBypassContentSecurityPolicy(const String& schem
return (ContentSecurityPolicyBypassingSchemes().get(scheme) & policyAreas) == policyAreas;
}
+void SchemeRegistry::registerURLSchemeBypassingSecureContextCheck(const String& scheme)
+{
+ MutexLocker locker(mutex());
+ secureContextBypassingSchemes().add(scheme.lower());
+}
+
+bool SchemeRegistry::schemeShouldBypassSecureContextCheck(const String& scheme)
+{
+ if (scheme.isEmpty())
+ return false;
+ MutexLocker locker(mutex());
+ return secureContextBypassingSchemes().contains(scheme.lower());
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698