Index: Source/platform/weborigin/SchemeRegistry.cpp |
diff --git a/Source/platform/weborigin/SchemeRegistry.cpp b/Source/platform/weborigin/SchemeRegistry.cpp |
index 822ae67a5fe8b98591ec9a7d7fae47c79435fcb1..099dbbb17a03895397bf9870779e686e6c41353c 100644 |
--- a/Source/platform/weborigin/SchemeRegistry.cpp |
+++ b/Source/platform/weborigin/SchemeRegistry.cpp |
@@ -176,6 +176,19 @@ static URLSchemesSet& serviceWorkerSchemes() |
return serviceWorkerSchemes; |
} |
+static URLSchemesSet& fetchAPISchemes() |
+{ |
+ assertLockHeld(); |
+ DEFINE_STATIC_LOCAL_NOASSERT(URLSchemesSet, fetchAPISchemes, ()); |
+ |
+ if (fetchAPISchemes.isEmpty()) { |
+ fetchAPISchemes.add("http"); |
+ fetchAPISchemes.add("https"); |
+ } |
+ |
+ return fetchAPISchemes; |
+} |
+ |
static URLSchemesMap<SchemeRegistry::PolicyAreas>& ContentSecurityPolicyBypassingSchemes() |
{ |
assertLockHeld(); |
@@ -353,6 +366,20 @@ bool SchemeRegistry::shouldTreatURLSchemeAsAllowingServiceWorkers(const String& |
return serviceWorkerSchemes().contains(scheme); |
} |
+void SchemeRegistry::registerURLSchemeAsSupportingFetchAPI(const String& scheme) |
+{ |
+ MutexLocker locker(mutex()); |
+ fetchAPISchemes().add(scheme); |
+} |
+ |
+bool SchemeRegistry::shouldTreatURLSchemeAsSupportingFetchAPI(const String& scheme) |
+{ |
+ if (scheme.isEmpty()) |
+ return false; |
+ MutexLocker locker(mutex()); |
+ return fetchAPISchemes().contains(scheme); |
+} |
+ |
void SchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy(const String& scheme, PolicyAreas policyAreas) |
{ |
MutexLocker locker(mutex()); |