Chromium Code Reviews| Index: Source/platform/weborigin/SchemeRegistry.cpp |
| diff --git a/Source/platform/weborigin/SchemeRegistry.cpp b/Source/platform/weborigin/SchemeRegistry.cpp |
| index 84363e578936ba3948e1f84d720e8c8dbb11bb8a..6e06498c5857142a4a213c12e1bb752051c7f448 100644 |
| --- a/Source/platform/weborigin/SchemeRegistry.cpp |
| +++ b/Source/platform/weborigin/SchemeRegistry.cpp |
| @@ -160,6 +160,19 @@ static URLSchemesSet& CORSEnabledSchemes() |
| return CORSEnabledSchemes; |
| } |
| +static URLSchemesSet& serviceWorkerSchemes() |
| +{ |
| + assertLockHeld(); |
| + DEFINE_STATIC_LOCAL_NOASSERT(URLSchemesSet, serviceWorkerSchemes, ()); |
| + |
| + if (serviceWorkerSchemes.isEmpty()) { |
| + serviceWorkerSchemes.add("http"); |
|
dcheng
2015/06/24 20:20:15
Why is http in this list?
palmer
2015/06/24 20:26:02
It must not be.
michaeln
2015/06/25 23:03:19
Isn't http://localhost/ secure and fine-n-good to
|
| + serviceWorkerSchemes.add("https"); |
| + } |
| + |
| + return serviceWorkerSchemes; |
| +} |
| + |
| static URLSchemesMap<SchemeRegistry::PolicyAreas>& ContentSecurityPolicyBypassingSchemes() |
| { |
| assertLockHeld(); |
| @@ -323,6 +336,20 @@ bool SchemeRegistry::shouldTreatURLSchemeAsLegacy(const String& scheme) |
| return equalIgnoringCase("ftp", scheme) || equalIgnoringCase("gopher", scheme); |
| } |
| +void SchemeRegistry::registerURLSchemeAsAllowingServiceWorkers(const String& scheme) |
| +{ |
| + MutexLocker locker(mutex()); |
| + serviceWorkerSchemes().add(scheme); |
| +} |
| + |
| +bool SchemeRegistry::shouldTreatURLSchemeAsAllowingServiceWorkers(const String& scheme) |
| +{ |
| + if (scheme.isEmpty()) |
| + return false; |
| + MutexLocker locker(mutex()); |
| + return serviceWorkerSchemes().contains(scheme); |
| +} |
| + |
| void SchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy(const String& scheme, PolicyAreas policyAreas) |
| { |
| MutexLocker locker(mutex()); |