Index: Source/platform/weborigin/SchemeRegistry.cpp |
diff --git a/Source/platform/weborigin/SchemeRegistry.cpp b/Source/platform/weborigin/SchemeRegistry.cpp |
index 84363e578936ba3948e1f84d720e8c8dbb11bb8a..db63e6d1a46a2e601e933b388f80709c00c2dff7 100644 |
--- a/Source/platform/weborigin/SchemeRegistry.cpp |
+++ b/Source/platform/weborigin/SchemeRegistry.cpp |
@@ -160,6 +160,20 @@ static URLSchemesSet& CORSEnabledSchemes() |
return CORSEnabledSchemes; |
} |
+static URLSchemesSet& serviceWorkerSchemes() |
+{ |
+ assertLockHeld(); |
+ DEFINE_STATIC_LOCAL_NOASSERT(URLSchemesSet, serviceWorkerSchemes, ()); |
+ |
+ if (serviceWorkerSchemes.isEmpty()) { |
+ serviceWorkerSchemes.add("http"); |
+ serviceWorkerSchemes.add("https"); |
+ serviceWorkerSchemes.add("chrome-extension"); |
Devlin
2015/06/23 17:52:31
This shouldn't be added here (it's a layering viol
|
+ } |
+ |
+ return serviceWorkerSchemes; |
+} |
+ |
static URLSchemesMap<SchemeRegistry::PolicyAreas>& ContentSecurityPolicyBypassingSchemes() |
{ |
assertLockHeld(); |
@@ -323,6 +337,14 @@ bool SchemeRegistry::shouldTreatURLSchemeAsLegacy(const String& scheme) |
return equalIgnoringCase("ftp", scheme) || equalIgnoringCase("gopher", scheme); |
} |
+bool SchemeRegistry::shouldAllowServiceWorkers(const String& scheme) |
+{ |
+ if (scheme.isEmpty()) |
+ return false; |
+ MutexLocker lock(mutex()); |
+ return serviceWorkerSchemes().contains(scheme); |
+} |
+ |
void SchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy(const String& scheme, PolicyAreas policyAreas) |
{ |
MutexLocker locker(mutex()); |