Title: [261169] trunk/Source
Revision
261169
Author
[email protected]
Date
2020-05-05 07:50:57 -0700 (Tue, 05 May 2020)

Log Message

Remove LegacySchemeRegistry::canServiceWorkersHandleURLScheme
https://bugs.webkit.org/show_bug.cgi?id=211170

Reviewed by Alex Christensen.

Source/WebCore:

Since we no longer use custom service worker schemes in API tests,
we no longer need custom schemes in web process, given they are not supported in network process anyway.
Remove related code.

* Modules/cache/DOMWindowCaches.idl:
* bindings/scripts/CodeGeneratorJS.pm:
(NeedsRuntimeCheck):
(GenerateRuntimeEnableConditionalString):
* bindings/scripts/IDLAttributes.json:
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::hasServiceWorkerScheme const): Deleted.
* dom/ScriptExecutionContext.h:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::matchRegistration):
(WebCore::DocumentLoader::commitData):
* page/NavigatorServiceWorker.idl:
* platform/LegacySchemeRegistry.cpp:
(WebCore::serviceWorkerSchemes): Deleted.
(WebCore::LegacySchemeRegistry::registerURLSchemeServiceWorkersCanHandle): Deleted.
(WebCore::LegacySchemeRegistry::canServiceWorkersHandleURLScheme): Deleted.
(WebCore::LegacySchemeRegistry::isServiceWorkerContainerCustomScheme): Deleted.
* platform/LegacySchemeRegistry.h:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::addRegistration):

Source/WebKit:

Remove unused parameters since they are no longer being set in UIProcess.

* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
* NetworkProcess/NetworkProcessCreationParameters.h:
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (261168 => 261169)


--- trunk/Source/WebCore/ChangeLog	2020-05-05 14:43:20 UTC (rev 261168)
+++ trunk/Source/WebCore/ChangeLog	2020-05-05 14:50:57 UTC (rev 261169)
@@ -1,3 +1,35 @@
+2020-05-05  Youenn Fablet  <[email protected]>
+
+        Remove LegacySchemeRegistry::canServiceWorkersHandleURLScheme
+        https://bugs.webkit.org/show_bug.cgi?id=211170
+
+        Reviewed by Alex Christensen.
+
+        Since we no longer use custom service worker schemes in API tests,
+        we no longer need custom schemes in web process, given they are not supported in network process anyway.
+        Remove related code.
+
+        * Modules/cache/DOMWindowCaches.idl:
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (NeedsRuntimeCheck):
+        (GenerateRuntimeEnableConditionalString):
+        * bindings/scripts/IDLAttributes.json:
+        * dom/ScriptExecutionContext.cpp:
+        (WebCore::ScriptExecutionContext::hasServiceWorkerScheme const): Deleted.
+        * dom/ScriptExecutionContext.h:
+        * loader/DocumentLoader.cpp:
+        (WebCore::DocumentLoader::matchRegistration):
+        (WebCore::DocumentLoader::commitData):
+        * page/NavigatorServiceWorker.idl:
+        * platform/LegacySchemeRegistry.cpp:
+        (WebCore::serviceWorkerSchemes): Deleted.
+        (WebCore::LegacySchemeRegistry::registerURLSchemeServiceWorkersCanHandle): Deleted.
+        (WebCore::LegacySchemeRegistry::canServiceWorkersHandleURLScheme): Deleted.
+        (WebCore::LegacySchemeRegistry::isServiceWorkerContainerCustomScheme): Deleted.
+        * platform/LegacySchemeRegistry.h:
+        * workers/service/ServiceWorkerContainer.cpp:
+        (WebCore::ServiceWorkerContainer::addRegistration):
+
 2020-05-05  Darin Adler  <[email protected]>
 
         Remove now-unneeded HAVE(DISALLOWABLE_USER_INSTALLED_FONTS)

Modified: trunk/Source/WebCore/Modules/cache/DOMWindowCaches.idl (261168 => 261169)


--- trunk/Source/WebCore/Modules/cache/DOMWindowCaches.idl	2020-05-05 14:43:20 UTC (rev 261168)
+++ trunk/Source/WebCore/Modules/cache/DOMWindowCaches.idl	2020-05-05 14:50:57 UTC (rev 261169)
@@ -26,5 +26,5 @@
 [
     EnabledAtRuntime=CacheAPI,
 ] partial interface DOMWindow {
-    [CallWith=ScriptExecutionContext, MayThrowException, SecureContext, ContextHasServiceWorkerScheme, SameObject] readonly attribute DOMCacheStorage caches;
+    [CallWith=ScriptExecutionContext, MayThrowException, SecureContext, SameObject] readonly attribute DOMCacheStorage caches;
 };

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (261168 => 261169)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2020-05-05 14:43:20 UTC (rev 261168)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2020-05-05 14:50:57 UTC (rev 261169)
@@ -1726,7 +1726,6 @@
         || $context->extendedAttributes->{EnabledBySetting}
         || $context->extendedAttributes->{DisabledByQuirk}
         || $context->extendedAttributes->{SecureContext}
-        || $context->extendedAttributes->{ContextHasServiceWorkerScheme}
         || $context->extendedAttributes->{CustomEnabled};
 }
 
@@ -3765,21 +3764,12 @@
     if ($context->extendedAttributes->{SecureContext}) {
         AddToImplIncludes("ScriptExecutionContext.h");
 
-        if ($context->extendedAttributes->{ContextHasServiceWorkerScheme}) {
+        if ($context->extendedAttributes->{ContextAllowsMediaDevices}) {
             push(@conjuncts, "(jsCast<JSDOMGlobalObject*>(" . $globalObjectPtr . ")->scriptExecutionContext()->isSecureContext()"
-                . "|| jsCast<JSDOMGlobalObject*>(" . $globalObjectPtr . ")->scriptExecutionContext()->hasServiceWorkerScheme())");
-        } elsif ($context->extendedAttributes->{ContextAllowsMediaDevices}) {
-            push(@conjuncts, "(jsCast<JSDOMGlobalObject*>(" . $globalObjectPtr . ")->scriptExecutionContext()->isSecureContext()"
                 . "|| jsCast<JSDOMGlobalObject*>(" . $globalObjectPtr . ")->scriptExecutionContext()->allowsMediaDevices())");
         } else {
             push(@conjuncts, "jsCast<JSDOMGlobalObject*>(globalObject())->scriptExecutionContext()->isSecureContext()");
         }
-    } else {
-        if ($context->extendedAttributes->{ContextHasServiceWorkerScheme}) {
-            AddToImplIncludes("ScriptExecutionContext.h");
-
-            push(@conjuncts, "jsCast<JSDOMGlobalObject*>(" . $globalObjectPtr . ")->scriptExecutionContext()->hasServiceWorkerScheme()");
-        }
     }
 
     if ($context->extendedAttributes->{Exposed}) {

Modified: trunk/Source/WebCore/bindings/scripts/IDLAttributes.json (261168 => 261169)


--- trunk/Source/WebCore/bindings/scripts/IDLAttributes.json	2020-05-05 14:43:20 UTC (rev 261168)
+++ trunk/Source/WebCore/bindings/scripts/IDLAttributes.json	2020-05-05 14:50:57 UTC (rev 261169)
@@ -92,9 +92,6 @@
         "ContextAllowsMediaDevices": {
             "contextsAllowed": ["attribute"]
         },
-        "ContextHasServiceWorkerScheme": {
-            "contextsAllowed": ["attribute"]
-        },
         "Custom": {
             "contextsAllowed": ["attribute", "operation"]
         },

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (261168 => 261169)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp	2020-05-05 14:43:20 UTC (rev 261168)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp	2020-05-05 14:50:57 UTC (rev 261169)
@@ -67,7 +67,6 @@
 #include "JSNode.h"
 #include "JSSVGDocument.h"
 #include "JSSVGPoint.h"
-#include "JSServiceWorker.h"
 #include "JSTestCallbackFunction.h"
 #include "JSTestCallbackInterface.h"
 #include "JSTestInterface.h"
@@ -1669,7 +1668,6 @@
 JSC::EncodedJSValue jsTestObjImplementationEnumAttr(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::PropertyName);
 bool setJSTestObjImplementationEnumAttr(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::EncodedJSValue);
 JSC::EncodedJSValue jsTestObjMediaDevices(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::PropertyName);
-JSC::EncodedJSValue jsTestObjServiceWorkers(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::PropertyName);
 JSC::EncodedJSValue jsTestObjXMLObjAttr(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::PropertyName);
 bool setJSTestObjXMLObjAttr(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::EncodedJSValue);
 JSC::EncodedJSValue jsTestObjCreate(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::PropertyName);
@@ -2049,7 +2047,6 @@
     { "annotatedTypeInSequenceAttr", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAnnotatedTypeInSequenceAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjAnnotatedTypeInSequenceAttr) } },
     { "implementationEnumAttr", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjImplementationEnumAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjImplementationEnumAttr) } },
     { "mediaDevices", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjMediaDevices), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
-    { "serviceWorkers", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjServiceWorkers), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
     { "XMLObjAttr", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjXMLObjAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjXMLObjAttr) } },
     { "create", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCreate), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjCreate) } },
     { "reflectedStringAttr", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedStringAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjReflectedStringAttr) } },
@@ -2422,13 +2419,6 @@
         DeletePropertySlot slot;
         JSObject::deleteProperty(this, globalObject(), propertyName, slot);
     }
-    if (!(jsCast<JSDOMGlobalObject*>(globalObject())->scriptExecutionContext()->isSecureContext()|| jsCast<JSDOMGlobalObject*>(globalObject())->scriptExecutionContext()->hasServiceWorkerScheme())) {
-        hasDisabledRuntimeProperties = true;
-        auto propertyName = Identifier::fromString(vm, reinterpret_cast<const LChar*>("serviceWorkers"), strlen("serviceWorkers"));
-        VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable);
-        DeletePropertySlot slot;
-        JSObject::deleteProperty(this, globalObject(), propertyName, slot);
-    }
 #if ENABLE(TEST_FEATURE)
     if (!(RuntimeEnabledFeatures::sharedFeatures().testFeatureEnabled() && RuntimeEnabledFeatures::sharedFeatures().testFeature1Enabled())) {
         hasDisabledRuntimeProperties = true;
@@ -3728,20 +3718,6 @@
     return IDLAttribute<JSTestObj>::get<jsTestObjMediaDevicesGetter, CastedThisErrorBehavior::Assert>(*lexicalGlobalObject, thisValue, "mediaDevices");
 }
 
-static inline JSValue jsTestObjServiceWorkersGetter(JSGlobalObject& lexicalGlobalObject, JSTestObj& thisObject, ThrowScope& throwScope)
-{
-    UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(lexicalGlobalObject);
-    auto& impl = thisObject.wrapped();
-    JSValue result = toJS<IDLInterface<ServiceWorker>>(lexicalGlobalObject, *thisObject.globalObject(), throwScope, impl.serviceWorkers());
-    return result;
-}
-
-EncodedJSValue jsTestObjServiceWorkers(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName)
-{
-    return IDLAttribute<JSTestObj>::get<jsTestObjServiceWorkersGetter, CastedThisErrorBehavior::Assert>(*lexicalGlobalObject, thisValue, "serviceWorkers");
-}
-
 static inline JSValue jsTestObjXMLObjAttrGetter(JSGlobalObject& lexicalGlobalObject, JSTestObj& thisObject, ThrowScope& throwScope)
 {
     UNUSED_PARAM(throwScope);

Modified: trunk/Source/WebCore/bindings/scripts/test/TestObj.idl (261168 => 261169)


--- trunk/Source/WebCore/bindings/scripts/test/TestObj.idl	2020-05-05 14:43:20 UTC (rev 261168)
+++ trunk/Source/WebCore/bindings/scripts/test/TestObj.idl	2020-05-05 14:50:57 UTC (rev 261169)
@@ -92,7 +92,6 @@
     attribute TestEnumTypeWithAlternateImplementationName implementationEnumAttr;
 
     [SecureContext, ContextAllowsMediaDevices] readonly attribute MediaDevices mediaDevices;
-    [SecureContext, ContextHasServiceWorkerScheme] readonly attribute ServiceWorker serviceWorkers;
 
     // WK_ucfirst, WK_lcfirst exceptional cases.
     attribute TestObj                  XMLObjAttr;

Modified: trunk/Source/WebCore/dom/ScriptExecutionContext.cpp (261168 => 261169)


--- trunk/Source/WebCore/dom/ScriptExecutionContext.cpp	2020-05-05 14:43:20 UTC (rev 261168)
+++ trunk/Source/WebCore/dom/ScriptExecutionContext.cpp	2020-05-05 14:50:57 UTC (rev 261169)
@@ -545,12 +545,6 @@
 #endif
 }
 
-bool ScriptExecutionContext::hasServiceWorkerScheme() const
-{
-    ASSERT(securityOrigin());
-    return LegacySchemeRegistry::isServiceWorkerContainerCustomScheme(securityOrigin()->protocol());
-}
-
 #if ENABLE(SERVICE_WORKER)
 
 ServiceWorker* ScriptExecutionContext::activeServiceWorker() const

Modified: trunk/Source/WebCore/dom/ScriptExecutionContext.h (261168 => 261169)


--- trunk/Source/WebCore/dom/ScriptExecutionContext.h	2020-05-05 14:43:20 UTC (rev 261168)
+++ trunk/Source/WebCore/dom/ScriptExecutionContext.h	2020-05-05 14:50:57 UTC (rev 261169)
@@ -245,7 +245,6 @@
     void setDomainForCachePartition(String&& domain) { m_domainForCachePartition = WTFMove(domain); }
 
     bool allowsMediaDevices() const;
-    bool hasServiceWorkerScheme() const;
 #if ENABLE(SERVICE_WORKER)
     ServiceWorker* activeServiceWorker() const;
     void setActiveServiceWorker(RefPtr<ServiceWorker>&&);

Modified: trunk/Source/WebCore/loader/DocumentLoader.cpp (261168 => 261169)


--- trunk/Source/WebCore/loader/DocumentLoader.cpp	2020-05-05 14:43:20 UTC (rev 261168)
+++ trunk/Source/WebCore/loader/DocumentLoader.cpp	2020-05-05 14:50:57 UTC (rev 261169)
@@ -514,7 +514,7 @@
 
 void DocumentLoader::matchRegistration(const URL& url, SWClientConnection::RegistrationCallback&& callback)
 {
-    auto shouldTryLoadingThroughServiceWorker = !frameLoader()->isReloadingFromOrigin() && m_frame->page() && RuntimeEnabledFeatures::sharedFeatures().serviceWorkerEnabled() && LegacySchemeRegistry::canServiceWorkersHandleURLScheme(url.protocol().toStringWithoutCopying());
+    auto shouldTryLoadingThroughServiceWorker = !frameLoader()->isReloadingFromOrigin() && m_frame->page() && RuntimeEnabledFeatures::sharedFeatures().serviceWorkerEnabled() && url.protocolIsInHTTPFamily();
     if (!shouldTryLoadingThroughServiceWorker) {
         callback(WTF::nullopt);
         return;
@@ -1107,7 +1107,7 @@
                     document.setActiveServiceWorker(parent->activeServiceWorker());
             }
 
-            if (m_frame->document()->activeServiceWorker() || LegacySchemeRegistry::canServiceWorkersHandleURLScheme(document.url().protocol().toStringWithoutCopying()))
+            if (m_frame->document()->activeServiceWorker() || document.url().protocolIsInHTTPFamily())
                 document.setServiceWorkerConnection(&ServiceWorkerProvider::singleton().serviceWorkerConnection());
 
             // We currently unregister the temporary service worker client since we now registered the real document.

Modified: trunk/Source/WebCore/page/NavigatorServiceWorker.idl (261168 => 261169)


--- trunk/Source/WebCore/page/NavigatorServiceWorker.idl	2020-05-05 14:43:20 UTC (rev 261168)
+++ trunk/Source/WebCore/page/NavigatorServiceWorker.idl	2020-05-05 14:50:57 UTC (rev 261169)
@@ -28,5 +28,5 @@
     Conditional=SERVICE_WORKER,
     EnabledAtRuntime=ServiceWorker
 ] interface NavigatorServiceWorker {
-    [CallWith=ScriptExecutionContext, MayThrowException, SecureContext, ContextHasServiceWorkerScheme, SameObject] readonly attribute ServiceWorkerContainer serviceWorker;
+    [CallWith=ScriptExecutionContext, MayThrowException, SecureContext, SameObject] readonly attribute ServiceWorkerContainer serviceWorker;
 };

Modified: trunk/Source/WebCore/platform/LegacySchemeRegistry.cpp (261168 => 261169)


--- trunk/Source/WebCore/platform/LegacySchemeRegistry.cpp	2020-05-05 14:43:20 UTC (rev 261168)
+++ trunk/Source/WebCore/platform/LegacySchemeRegistry.cpp	2020-05-05 14:50:57 UTC (rev 261169)
@@ -274,13 +274,6 @@
     return schemes;
 }
 
-static URLSchemesMap& serviceWorkerSchemes()
-{
-    ASSERT(schemeRegistryLock.isHeld());
-    static NeverDestroyed<URLSchemesMap> schemes;
-    return schemes;
-}
-
 static URLSchemesMap& alwaysRevalidatedSchemes()
 {
     ASSERT(isMainThread());
@@ -500,37 +493,6 @@
     return cachePartitioningSchemes().contains(scheme);
 }
 
-void LegacySchemeRegistry::registerURLSchemeServiceWorkersCanHandle(const String& scheme)
-{
-    if (scheme.isNull())
-        return;
-
-    Locker<Lock> locker(schemeRegistryLock);
-    serviceWorkerSchemes().add(scheme);
-}
-
-bool LegacySchemeRegistry::canServiceWorkersHandleURLScheme(const String& scheme)
-{
-    if (scheme.isNull())
-        return false;
-
-    if (scheme.startsWithIgnoringASCIICase("http"_s)) {
-        if (scheme.length() == 4)
-            return true;
-        if (scheme.length() == 5 && isASCIIAlphaCaselessEqual(scheme[4], 's'))
-            return true;
-    }
-
-    Locker<Lock> locker(schemeRegistryLock);
-    return serviceWorkerSchemes().contains(scheme);
-}
-
-bool LegacySchemeRegistry::isServiceWorkerContainerCustomScheme(const String& scheme)
-{
-    Locker<Lock> locker(schemeRegistryLock);
-    return !scheme.isNull() && serviceWorkerSchemes().contains(scheme);
-}
-
 bool LegacySchemeRegistry::isUserExtensionScheme(const String& scheme)
 {
     // FIXME: Remove this once Safari has adopted WKWebViewConfiguration._corsDisablingPatterns

Modified: trunk/Source/WebCore/platform/LegacySchemeRegistry.h (261168 => 261169)


--- trunk/Source/WebCore/platform/LegacySchemeRegistry.h	2020-05-05 14:43:20 UTC (rev 261168)
+++ trunk/Source/WebCore/platform/LegacySchemeRegistry.h	2020-05-05 14:50:57 UTC (rev 261169)
@@ -97,11 +97,6 @@
     WEBCORE_EXPORT static void registerURLSchemeAsCachePartitioned(const String& scheme); // Thread safe.
     static bool shouldPartitionCacheForURLScheme(const String& scheme); // Thread safe.
 
-    // Schemes besides http(s) that service workers are allowed to handle
-    WEBCORE_EXPORT static void registerURLSchemeServiceWorkersCanHandle(const String& scheme); // Thread safe.
-    WEBCORE_EXPORT static bool canServiceWorkersHandleURLScheme(const String& scheme); // Thread safe.
-    static bool isServiceWorkerContainerCustomScheme(const String& scheme); // Thread safe.
-
     static bool isUserExtensionScheme(const String& scheme);
 };
 

Modified: trunk/Source/WebCore/workers/service/ServiceWorkerContainer.cpp (261168 => 261169)


--- trunk/Source/WebCore/workers/service/ServiceWorkerContainer.cpp	2020-05-05 14:43:20 UTC (rev 261168)
+++ trunk/Source/WebCore/workers/service/ServiceWorkerContainer.cpp	2020-05-05 14:50:57 UTC (rev 261169)
@@ -146,7 +146,7 @@
         return;
     }
 
-    if (!LegacySchemeRegistry::canServiceWorkersHandleURLScheme(jobData.scriptURL.protocol().toStringWithoutCopying())) {
+    if (!jobData.scriptURL.protocolIsInHTTPFamily()) {
         CONTAINER_RELEASE_LOG_ERROR_IF_ALLOWED("addRegistration: Invalid scriptURL scheme is not HTTP or HTTPS");
         promise->reject(Exception { TypeError, "serviceWorker.register() must be called with a script URL whose protocol is either HTTP or HTTPS"_s });
         return;
@@ -164,7 +164,7 @@
     else
         jobData.scopeURL = URL(jobData.scriptURL, "./");
 
-    if (!jobData.scopeURL.isNull() && !LegacySchemeRegistry::canServiceWorkersHandleURLScheme(jobData.scopeURL.protocol().toStringWithoutCopying())) {
+    if (!jobData.scopeURL.isNull() && !jobData.scopeURL.protocolIsInHTTPFamily()) {
         CONTAINER_RELEASE_LOG_ERROR_IF_ALLOWED("addRegistration: scopeURL scheme is not HTTP or HTTPS");
         promise->reject(Exception { TypeError, "Scope URL provided to serviceWorker.register() must be either HTTP or HTTPS"_s });
         return;

Modified: trunk/Source/WebKit/ChangeLog (261168 => 261169)


--- trunk/Source/WebKit/ChangeLog	2020-05-05 14:43:20 UTC (rev 261168)
+++ trunk/Source/WebKit/ChangeLog	2020-05-05 14:50:57 UTC (rev 261169)
@@ -1,3 +1,21 @@
+2020-05-05  Youenn Fablet  <[email protected]>
+
+        Remove LegacySchemeRegistry::canServiceWorkersHandleURLScheme
+        https://bugs.webkit.org/show_bug.cgi?id=211170
+
+        Reviewed by Alex Christensen.
+
+        Remove unused parameters since they are no longer being set in UIProcess.
+
+        * NetworkProcess/NetworkProcessCreationParameters.cpp:
+        (WebKit::NetworkProcessCreationParameters::encode const):
+        * NetworkProcess/NetworkProcessCreationParameters.h:
+        * Shared/WebProcessCreationParameters.cpp:
+        (WebKit::WebProcessCreationParameters::decode):
+        * Shared/WebProcessCreationParameters.h:
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::initializeWebProcess):
+
 2020-05-05  Darin Adler  <[email protected]>
 
         Remove now-uneeded HAVE macros related to PDF

Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp (261168 => 261169)


--- trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp	2020-05-05 14:43:20 UTC (rev 261168)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp	2020-05-05 14:50:57 UTC (rev 261169)
@@ -70,7 +70,7 @@
     encoder << urlSchemesRegisteredAsNoAccess;
 
 #if ENABLE(SERVICE_WORKER)
-    encoder << serviceWorkerRegistrationDirectory << serviceWorkerRegistrationDirectoryExtensionHandle << urlSchemesServiceWorkersCanHandle << shouldDisableServiceWorkerProcessTerminationDelay;
+    encoder << serviceWorkerRegistrationDirectory << serviceWorkerRegistrationDirectoryExtensionHandle << shouldDisableServiceWorkerProcessTerminationDelay;
 #endif
     encoder << shouldEnableITPDatabase;
     encoder << enableAdClickAttributionDebugMode;
@@ -156,10 +156,7 @@
     if (!serviceWorkerRegistrationDirectoryExtensionHandle)
         return false;
     result.serviceWorkerRegistrationDirectoryExtensionHandle = WTFMove(*serviceWorkerRegistrationDirectoryExtensionHandle);
-    
-    if (!decoder.decode(result.urlSchemesServiceWorkersCanHandle))
-        return false;
-    
+
     if (!decoder.decode(result.shouldDisableServiceWorkerProcessTerminationDelay))
         return false;
 #endif

Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h (261168 => 261169)


--- trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h	2020-05-05 14:43:20 UTC (rev 261168)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h	2020-05-05 14:50:57 UTC (rev 261169)
@@ -89,7 +89,6 @@
 #if ENABLE(SERVICE_WORKER)
     String serviceWorkerRegistrationDirectory;
     SandboxExtension::Handle serviceWorkerRegistrationDirectoryExtensionHandle;
-    Vector<String> urlSchemesServiceWorkersCanHandle;
     bool shouldDisableServiceWorkerProcessTerminationDelay { false };
 #endif
     bool shouldEnableITPDatabase { false };

Modified: trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp (261168 => 261169)


--- trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp	2020-05-05 14:43:20 UTC (rev 261168)
+++ trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp	2020-05-05 14:50:57 UTC (rev 261169)
@@ -71,7 +71,6 @@
     encoder << urlSchemesRegisteredAsCORSEnabled;
     encoder << urlSchemesRegisteredAsAlwaysRevalidated;
     encoder << urlSchemesRegisteredAsCachePartitioned;
-    encoder << urlSchemesServiceWorkersCanHandle;
     encoder << urlSchemesRegisteredAsCanDisplayOnlyIfCanRequest;
     encoder.encodeEnum(cacheModel);
     encoder << shouldAlwaysUseComplexTextCodePath;
@@ -271,8 +270,6 @@
         return false;
     if (!decoder.decode(parameters.urlSchemesRegisteredAsCachePartitioned))
         return false;
-    if (!decoder.decode(parameters.urlSchemesServiceWorkersCanHandle))
-        return false;
     if (!decoder.decode(parameters.urlSchemesRegisteredAsCanDisplayOnlyIfCanRequest))
         return false;
     if (!decoder.decodeEnum(parameters.cacheModel))

Modified: trunk/Source/WebKit/Shared/WebProcessCreationParameters.h (261168 => 261169)


--- trunk/Source/WebKit/Shared/WebProcessCreationParameters.h	2020-05-05 14:43:20 UTC (rev 261168)
+++ trunk/Source/WebKit/Shared/WebProcessCreationParameters.h	2020-05-05 14:50:57 UTC (rev 261169)
@@ -100,7 +100,6 @@
     Vector<String> urlSchemesRegisteredAsCORSEnabled;
     Vector<String> urlSchemesRegisteredAsAlwaysRevalidated;
     Vector<String> urlSchemesRegisteredAsCachePartitioned;
-    Vector<String> urlSchemesServiceWorkersCanHandle;
     Vector<String> urlSchemesRegisteredAsCanDisplayOnlyIfCanRequest;
 
     Vector<String> fontWhitelist;

Modified: trunk/Source/WebKit/WebProcess/WebProcess.cpp (261168 => 261169)


--- trunk/Source/WebKit/WebProcess/WebProcess.cpp	2020-05-05 14:43:20 UTC (rev 261168)
+++ trunk/Source/WebKit/WebProcess/WebProcess.cpp	2020-05-05 14:50:57 UTC (rev 261169)
@@ -420,9 +420,6 @@
     for (auto& scheme : parameters.urlSchemesRegisteredAsCachePartitioned)
         registerURLSchemeAsCachePartitioned(scheme);
 
-    for (auto& scheme : parameters.urlSchemesServiceWorkersCanHandle)
-        WebCore::LegacySchemeRegistry::registerURLSchemeServiceWorkersCanHandle(scheme);
-
     for (auto& scheme : parameters.urlSchemesRegisteredAsCanDisplayOnlyIfCanRequest)
         registerURLSchemeAsCanDisplayOnlyIfCanRequest(scheme);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to