Rename SchemeRegistry to LegacySchemeRegistry
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Oct 2019 19:30:08 +0000 (19:30 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Oct 2019 19:30:08 +0000 (19:30 +0000)
https://bugs.webkit.org/show_bug.cgi?id=202586

Reviewed by Tim Horton.

Source/WebCore:

SchemeRegistry is process-global.  We need to replace it with a non-process-global registry, but Rome wasn't built in a day.
This rename allows me to call the replacement object that will have ownership and configuration "SchemeRegistry"
and it also indicates that new development should use the owned object instead of the global object.

* Headers.cmake:
* Modules/mediastream/UserMediaController.cpp:
(WebCore::isSecure):
* Modules/mediastream/UserMediaRequest.cpp:
* Modules/webauthn/AuthenticatorCoordinator.cpp:
(WebCore::AuthenticatorCoordinatorInternal::processAppIdExtension):
* Modules/webdatabase/DatabaseContext.cpp:
(WebCore::DatabaseContext::allowDatabaseAccess const):
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::setDomain):
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::hasServiceWorkerScheme const):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::userDidClickSnapshot):
(WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn):
* loader/CrossOriginAccessControl.cpp:
(WebCore::isValidCrossOriginRedirectionURL):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::matchRegistration):
(WebCore::DocumentLoader::disallowWebArchive const):
(WebCore::DocumentLoader::commitData):
(WebCore::DocumentLoader::maybeLoadEmpty):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
(WebCore::DocumentThreadableLoader::checkURLSchemeAsCORSEnabled):
* loader/archive/mhtml/MHTMLArchive.cpp:
(WebCore::MHTMLArchive::create):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::freshnessLifetime const):
* page/Page.cpp:
(WebCore::Page::userStyleSheetLocationChanged):
* page/SecurityOrigin.cpp:
(WebCore::shouldTreatAsUniqueOrigin):
(WebCore::shouldTreatAsPotentiallyTrustworthy):
(WebCore::SecurityOrigin::SecurityOrigin):
(WebCore::SecurityOrigin::isSecure):
(WebCore::SecurityOrigin::canDisplay const):
(WebCore::SecurityOrigin::domainForCachePartition const):
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::allowObjectFromSource const):
(WebCore::ContentSecurityPolicy::allowChildFrameFromSource const):
(WebCore::ContentSecurityPolicy::allowResourceFromSource const):
(WebCore::ContentSecurityPolicy::allowConnectToSource const):
(WebCore::ContentSecurityPolicy::allowBaseURI const):
* platform/LegacySchemeRegistry.cpp: Copied from Source/WebCore/platform/SchemeRegistry.cpp.
(WebCore::allBuiltinSchemes):
(WebCore::LegacySchemeRegistry::registerURLSchemeAsLocal):
(WebCore::LegacySchemeRegistry::removeURLSchemeRegisteredAsLocal):
(WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsLocal):
(WebCore::LegacySchemeRegistry::registerURLSchemeAsNoAccess):
(WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsNoAccess):
(WebCore::LegacySchemeRegistry::registerURLSchemeAsDisplayIsolated):
(WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsDisplayIsolated):
(WebCore::LegacySchemeRegistry::registerURLSchemeAsSecure):
(WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsSecure):
(WebCore::LegacySchemeRegistry::registerURLSchemeAsEmptyDocument):
(WebCore::LegacySchemeRegistry::shouldLoadURLSchemeAsEmptyDocument):
(WebCore::LegacySchemeRegistry::setDomainRelaxationForbiddenForURLScheme):
(WebCore::LegacySchemeRegistry::isDomainRelaxationForbiddenForURLScheme):
(WebCore::LegacySchemeRegistry::canDisplayOnlyIfCanRequest):
(WebCore::LegacySchemeRegistry::registerAsCanDisplayOnlyIfCanRequest):
(WebCore::LegacySchemeRegistry::registerURLSchemeAsNotAllowingJavascriptURLs):
(WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsNotAllowingJavascriptURLs):
(WebCore::LegacySchemeRegistry::registerURLSchemeAsAllowingDatabaseAccessInPrivateBrowsing):
(WebCore::LegacySchemeRegistry::allowsDatabaseAccessInPrivateBrowsing):
(WebCore::LegacySchemeRegistry::registerURLSchemeAsCORSEnabled):
(WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsCORSEnabled):
(WebCore::LegacySchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy):
(WebCore::LegacySchemeRegistry::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy):
(WebCore::LegacySchemeRegistry::schemeShouldBypassContentSecurityPolicy):
(WebCore::LegacySchemeRegistry::registerURLSchemeAsAlwaysRevalidated):
(WebCore::LegacySchemeRegistry::shouldAlwaysRevalidateURLScheme):
(WebCore::LegacySchemeRegistry::registerURLSchemeAsCachePartitioned):
(WebCore::LegacySchemeRegistry::shouldPartitionCacheForURLScheme):
(WebCore::LegacySchemeRegistry::registerURLSchemeServiceWorkersCanHandle):
(WebCore::LegacySchemeRegistry::canServiceWorkersHandleURLScheme):
(WebCore::LegacySchemeRegistry::isServiceWorkerContainerCustomScheme):
(WebCore::LegacySchemeRegistry::isUserExtensionScheme):
(WebCore::LegacySchemeRegistry::isBuiltinScheme):
(WebCore::SchemeRegistry::registerURLSchemeAsLocal): Deleted.
(WebCore::SchemeRegistry::removeURLSchemeRegisteredAsLocal): Deleted.
(WebCore::SchemeRegistry::shouldTreatURLSchemeAsLocal): Deleted.
(WebCore::SchemeRegistry::registerURLSchemeAsNoAccess): Deleted.
(WebCore::SchemeRegistry::shouldTreatURLSchemeAsNoAccess): Deleted.
(WebCore::SchemeRegistry::registerURLSchemeAsDisplayIsolated): Deleted.
(WebCore::SchemeRegistry::shouldTreatURLSchemeAsDisplayIsolated): Deleted.
(WebCore::SchemeRegistry::registerURLSchemeAsSecure): Deleted.
(WebCore::SchemeRegistry::shouldTreatURLSchemeAsSecure): Deleted.
(WebCore::SchemeRegistry::registerURLSchemeAsEmptyDocument): Deleted.
(WebCore::SchemeRegistry::shouldLoadURLSchemeAsEmptyDocument): Deleted.
(WebCore::SchemeRegistry::setDomainRelaxationForbiddenForURLScheme): Deleted.
(WebCore::SchemeRegistry::isDomainRelaxationForbiddenForURLScheme): Deleted.
(WebCore::SchemeRegistry::canDisplayOnlyIfCanRequest): Deleted.
(WebCore::SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest): Deleted.
(WebCore::SchemeRegistry::registerURLSchemeAsNotAllowingJavascriptURLs): Deleted.
(WebCore::SchemeRegistry::shouldTreatURLSchemeAsNotAllowingJavascriptURLs): Deleted.
(WebCore::SchemeRegistry::registerURLSchemeAsAllowingDatabaseAccessInPrivateBrowsing): Deleted.
(WebCore::SchemeRegistry::allowsDatabaseAccessInPrivateBrowsing): Deleted.
(WebCore::SchemeRegistry::registerURLSchemeAsCORSEnabled): Deleted.
(WebCore::SchemeRegistry::shouldTreatURLSchemeAsCORSEnabled): Deleted.
(WebCore::SchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy): Deleted.
(WebCore::SchemeRegistry::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy): Deleted.
(WebCore::SchemeRegistry::schemeShouldBypassContentSecurityPolicy): Deleted.
(WebCore::SchemeRegistry::registerURLSchemeAsAlwaysRevalidated): Deleted.
(WebCore::SchemeRegistry::shouldAlwaysRevalidateURLScheme): Deleted.
(WebCore::SchemeRegistry::registerURLSchemeAsCachePartitioned): Deleted.
(WebCore::SchemeRegistry::shouldPartitionCacheForURLScheme): Deleted.
(WebCore::SchemeRegistry::registerURLSchemeServiceWorkersCanHandle): Deleted.
(WebCore::SchemeRegistry::canServiceWorkersHandleURLScheme): Deleted.
(WebCore::SchemeRegistry::isServiceWorkerContainerCustomScheme): Deleted.
(WebCore::SchemeRegistry::isUserExtensionScheme): Deleted.
(WebCore::SchemeRegistry::isBuiltinScheme): Deleted.
* platform/LegacySchemeRegistry.h: Copied from Source/WebCore/platform/SchemeRegistry.h.
* platform/SchemeRegistry.cpp: Removed.
* platform/SchemeRegistry.h: Removed.
* platform/ios/QuickLook.mm:
* storage/Storage.cpp:
* testing/Internals.cpp:
(WebCore::Internals::registerURLSchemeAsBypassingContentSecurityPolicy):
(WebCore::Internals::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy):
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::addRegistration):
* workers/service/ServiceWorkerProvider.cpp:
(WebCore::ServiceWorkerProvider::registerServiceWorkerClients):
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::runRegisterJob):

Source/WebKit:

* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::doesNotNeedCORSCheck const):
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::registerURLSchemeAsSecure const):
(WebKit::NetworkProcess::registerURLSchemeAsBypassingContentSecurityPolicy const):
(WebKit::NetworkProcess::registerURLSchemeAsLocal const):
(WebKit::NetworkProcess::registerURLSchemeAsNoAccess const):
(WebKit::NetworkProcess::registerURLSchemeAsDisplayIsolated const):
(WebKit::NetworkProcess::registerURLSchemeAsCORSEnabled const):
(WebKit::NetworkProcess::registerURLSchemeAsCanDisplayOnlyIfCanRequest const):
* Shared/AuxiliaryProcess.cpp:
(WebKit::AuxiliaryProcess::registerURLSchemeServiceWorkersCanHandle const):
* UIProcess/API/Cocoa/WKWebView.mm:
(+[WKWebView handlesURLScheme:]):
* UIProcess/API/glib/WebKitSecurityManager.cpp:
(registerSecurityPolicyForURIScheme):
(checkSecurityPolicyForURIScheme):
* WebProcess/Plugins/WebPluginInfoProvider.cpp:
(WebKit::WebPluginInfoProvider::webVisiblePluginInfo):
* WebProcess/Storage/WebServiceWorkerProvider.cpp:
(WebKit::WebServiceWorkerProvider::handleFetch):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::canHandleRequest):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::registerURLSchemeAsEmptyDocument):
(WebKit::WebProcess::registerURLSchemeAsSecure const):
(WebKit::WebProcess::registerURLSchemeAsBypassingContentSecurityPolicy const):
(WebKit::WebProcess::setDomainRelaxationForbiddenForURLScheme const):
(WebKit::WebProcess::registerURLSchemeAsLocal const):
(WebKit::WebProcess::registerURLSchemeAsNoAccess const):
(WebKit::WebProcess::registerURLSchemeAsDisplayIsolated const):
(WebKit::WebProcess::registerURLSchemeAsCORSEnabled const):
(WebKit::WebProcess::registerURLSchemeAsAlwaysRevalidated const):
(WebKit::WebProcess::registerURLSchemeAsCachePartitioned const):
(WebKit::WebProcess::registerURLSchemeAsCanDisplayOnlyIfCanRequest const):
* WebProcess/WebStorage/StorageAreaImpl.cpp:

Source/WebKitLegacy/mac:

* WebView/WebView.mm:
(+[WebView _setDomainRelaxationForbidden:forURLScheme:]):
(+[WebView _registerURLSchemeAsSecure:]):
(+[WebView _registerURLSchemeAsAllowingDatabaseAccessInPrivateBrowsing:]):
(+[WebView registerURLSchemeAsLocal:]):

Source/WebKitLegacy/win:

* WebView.cpp:
(WebView::registerURLSchemeAsLocal):
(WebView::setDomainRelaxationForbiddenForURLScheme):
(WebView::registerURLSchemeAsSecure):
(WebView::registerURLSchemeAsAllowingDatabaseAccessInPrivateBrowsing):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250738 268f45cc-cd09-0410-ab3c-d52691b4dbfc

42 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Headers.cmake
Source/WebCore/Modules/mediastream/UserMediaController.cpp
Source/WebCore/Modules/mediastream/UserMediaRequest.cpp
Source/WebCore/Modules/webauthn/AuthenticatorCoordinator.cpp
Source/WebCore/Modules/webdatabase/DatabaseContext.cpp
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/ScriptExecutionContext.cpp
Source/WebCore/html/HTMLPlugInImageElement.cpp
Source/WebCore/loader/CrossOriginAccessControl.cpp
Source/WebCore/loader/DocumentLoader.cpp
Source/WebCore/loader/DocumentThreadableLoader.cpp
Source/WebCore/loader/archive/mhtml/MHTMLArchive.cpp
Source/WebCore/loader/cache/CachedResource.cpp
Source/WebCore/page/Page.cpp
Source/WebCore/page/SecurityOrigin.cpp
Source/WebCore/page/csp/ContentSecurityPolicy.cpp
Source/WebCore/platform/LegacySchemeRegistry.cpp [moved from Source/WebCore/platform/SchemeRegistry.cpp with 81% similarity]
Source/WebCore/platform/LegacySchemeRegistry.h [moved from Source/WebCore/platform/SchemeRegistry.h with 99% similarity]
Source/WebCore/platform/ios/QuickLook.mm
Source/WebCore/storage/Storage.cpp
Source/WebCore/testing/Internals.cpp
Source/WebCore/workers/service/ServiceWorkerContainer.cpp
Source/WebCore/workers/service/ServiceWorkerProvider.cpp
Source/WebCore/workers/service/server/SWServerJobQueue.cpp
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/NetworkLoadChecker.cpp
Source/WebKit/NetworkProcess/NetworkProcess.cpp
Source/WebKit/Shared/AuxiliaryProcess.cpp
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit/UIProcess/API/glib/WebKitSecurityManager.cpp
Source/WebKit/WebProcess/Plugins/WebPluginInfoProvider.cpp
Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.cpp
Source/WebKit/WebProcess/WebPage/WebPage.cpp
Source/WebKit/WebProcess/WebProcess.cpp
Source/WebKit/WebProcess/WebStorage/StorageAreaImpl.cpp
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebView/WebView.mm
Source/WebKitLegacy/win/ChangeLog
Source/WebKitLegacy/win/WebView.cpp

index 66afd36..8f73dd4 100644 (file)
@@ -1,3 +1,143 @@
+2019-10-04  Alex Christensen  <achristensen@webkit.org>
+
+        Rename SchemeRegistry to LegacySchemeRegistry
+        https://bugs.webkit.org/show_bug.cgi?id=202586
+
+        Reviewed by Tim Horton.
+
+        SchemeRegistry is process-global.  We need to replace it with a non-process-global registry, but Rome wasn't built in a day.
+        This rename allows me to call the replacement object that will have ownership and configuration "SchemeRegistry"
+        and it also indicates that new development should use the owned object instead of the global object.
+
+        * Headers.cmake:
+        * Modules/mediastream/UserMediaController.cpp:
+        (WebCore::isSecure):
+        * Modules/mediastream/UserMediaRequest.cpp:
+        * Modules/webauthn/AuthenticatorCoordinator.cpp:
+        (WebCore::AuthenticatorCoordinatorInternal::processAppIdExtension):
+        * Modules/webdatabase/DatabaseContext.cpp:
+        (WebCore::DatabaseContext::allowDatabaseAccess const):
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * dom/Document.cpp:
+        (WebCore::Document::setDomain):
+        * dom/ScriptExecutionContext.cpp:
+        (WebCore::ScriptExecutionContext::hasServiceWorkerScheme const):
+        * html/HTMLPlugInImageElement.cpp:
+        (WebCore::HTMLPlugInImageElement::userDidClickSnapshot):
+        (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn):
+        * loader/CrossOriginAccessControl.cpp:
+        (WebCore::isValidCrossOriginRedirectionURL):
+        * loader/DocumentLoader.cpp:
+        (WebCore::DocumentLoader::matchRegistration):
+        (WebCore::DocumentLoader::disallowWebArchive const):
+        (WebCore::DocumentLoader::commitData):
+        (WebCore::DocumentLoader::maybeLoadEmpty):
+        * loader/DocumentThreadableLoader.cpp:
+        (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
+        (WebCore::DocumentThreadableLoader::checkURLSchemeAsCORSEnabled):
+        * loader/archive/mhtml/MHTMLArchive.cpp:
+        (WebCore::MHTMLArchive::create):
+        * loader/cache/CachedResource.cpp:
+        (WebCore::CachedResource::freshnessLifetime const):
+        * page/Page.cpp:
+        (WebCore::Page::userStyleSheetLocationChanged):
+        * page/SecurityOrigin.cpp:
+        (WebCore::shouldTreatAsUniqueOrigin):
+        (WebCore::shouldTreatAsPotentiallyTrustworthy):
+        (WebCore::SecurityOrigin::SecurityOrigin):
+        (WebCore::SecurityOrigin::isSecure):
+        (WebCore::SecurityOrigin::canDisplay const):
+        (WebCore::SecurityOrigin::domainForCachePartition const):
+        * page/csp/ContentSecurityPolicy.cpp:
+        (WebCore::ContentSecurityPolicy::allowObjectFromSource const):
+        (WebCore::ContentSecurityPolicy::allowChildFrameFromSource const):
+        (WebCore::ContentSecurityPolicy::allowResourceFromSource const):
+        (WebCore::ContentSecurityPolicy::allowConnectToSource const):
+        (WebCore::ContentSecurityPolicy::allowBaseURI const):
+        * platform/LegacySchemeRegistry.cpp: Copied from Source/WebCore/platform/SchemeRegistry.cpp.
+        (WebCore::allBuiltinSchemes):
+        (WebCore::LegacySchemeRegistry::registerURLSchemeAsLocal):
+        (WebCore::LegacySchemeRegistry::removeURLSchemeRegisteredAsLocal):
+        (WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsLocal):
+        (WebCore::LegacySchemeRegistry::registerURLSchemeAsNoAccess):
+        (WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsNoAccess):
+        (WebCore::LegacySchemeRegistry::registerURLSchemeAsDisplayIsolated):
+        (WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsDisplayIsolated):
+        (WebCore::LegacySchemeRegistry::registerURLSchemeAsSecure):
+        (WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsSecure):
+        (WebCore::LegacySchemeRegistry::registerURLSchemeAsEmptyDocument):
+        (WebCore::LegacySchemeRegistry::shouldLoadURLSchemeAsEmptyDocument):
+        (WebCore::LegacySchemeRegistry::setDomainRelaxationForbiddenForURLScheme):
+        (WebCore::LegacySchemeRegistry::isDomainRelaxationForbiddenForURLScheme):
+        (WebCore::LegacySchemeRegistry::canDisplayOnlyIfCanRequest):
+        (WebCore::LegacySchemeRegistry::registerAsCanDisplayOnlyIfCanRequest):
+        (WebCore::LegacySchemeRegistry::registerURLSchemeAsNotAllowingJavascriptURLs):
+        (WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsNotAllowingJavascriptURLs):
+        (WebCore::LegacySchemeRegistry::registerURLSchemeAsAllowingDatabaseAccessInPrivateBrowsing):
+        (WebCore::LegacySchemeRegistry::allowsDatabaseAccessInPrivateBrowsing):
+        (WebCore::LegacySchemeRegistry::registerURLSchemeAsCORSEnabled):
+        (WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsCORSEnabled):
+        (WebCore::LegacySchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy):
+        (WebCore::LegacySchemeRegistry::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy):
+        (WebCore::LegacySchemeRegistry::schemeShouldBypassContentSecurityPolicy):
+        (WebCore::LegacySchemeRegistry::registerURLSchemeAsAlwaysRevalidated):
+        (WebCore::LegacySchemeRegistry::shouldAlwaysRevalidateURLScheme):
+        (WebCore::LegacySchemeRegistry::registerURLSchemeAsCachePartitioned):
+        (WebCore::LegacySchemeRegistry::shouldPartitionCacheForURLScheme):
+        (WebCore::LegacySchemeRegistry::registerURLSchemeServiceWorkersCanHandle):
+        (WebCore::LegacySchemeRegistry::canServiceWorkersHandleURLScheme):
+        (WebCore::LegacySchemeRegistry::isServiceWorkerContainerCustomScheme):
+        (WebCore::LegacySchemeRegistry::isUserExtensionScheme):
+        (WebCore::LegacySchemeRegistry::isBuiltinScheme):
+        (WebCore::SchemeRegistry::registerURLSchemeAsLocal): Deleted.
+        (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsLocal): Deleted.
+        (WebCore::SchemeRegistry::shouldTreatURLSchemeAsLocal): Deleted.
+        (WebCore::SchemeRegistry::registerURLSchemeAsNoAccess): Deleted.
+        (WebCore::SchemeRegistry::shouldTreatURLSchemeAsNoAccess): Deleted.
+        (WebCore::SchemeRegistry::registerURLSchemeAsDisplayIsolated): Deleted.
+        (WebCore::SchemeRegistry::shouldTreatURLSchemeAsDisplayIsolated): Deleted.
+        (WebCore::SchemeRegistry::registerURLSchemeAsSecure): Deleted.
+        (WebCore::SchemeRegistry::shouldTreatURLSchemeAsSecure): Deleted.
+        (WebCore::SchemeRegistry::registerURLSchemeAsEmptyDocument): Deleted.
+        (WebCore::SchemeRegistry::shouldLoadURLSchemeAsEmptyDocument): Deleted.
+        (WebCore::SchemeRegistry::setDomainRelaxationForbiddenForURLScheme): Deleted.
+        (WebCore::SchemeRegistry::isDomainRelaxationForbiddenForURLScheme): Deleted.
+        (WebCore::SchemeRegistry::canDisplayOnlyIfCanRequest): Deleted.
+        (WebCore::SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest): Deleted.
+        (WebCore::SchemeRegistry::registerURLSchemeAsNotAllowingJavascriptURLs): Deleted.
+        (WebCore::SchemeRegistry::shouldTreatURLSchemeAsNotAllowingJavascriptURLs): Deleted.
+        (WebCore::SchemeRegistry::registerURLSchemeAsAllowingDatabaseAccessInPrivateBrowsing): Deleted.
+        (WebCore::SchemeRegistry::allowsDatabaseAccessInPrivateBrowsing): Deleted.
+        (WebCore::SchemeRegistry::registerURLSchemeAsCORSEnabled): Deleted.
+        (WebCore::SchemeRegistry::shouldTreatURLSchemeAsCORSEnabled): Deleted.
+        (WebCore::SchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy): Deleted.
+        (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy): Deleted.
+        (WebCore::SchemeRegistry::schemeShouldBypassContentSecurityPolicy): Deleted.
+        (WebCore::SchemeRegistry::registerURLSchemeAsAlwaysRevalidated): Deleted.
+        (WebCore::SchemeRegistry::shouldAlwaysRevalidateURLScheme): Deleted.
+        (WebCore::SchemeRegistry::registerURLSchemeAsCachePartitioned): Deleted.
+        (WebCore::SchemeRegistry::shouldPartitionCacheForURLScheme): Deleted.
+        (WebCore::SchemeRegistry::registerURLSchemeServiceWorkersCanHandle): Deleted.
+        (WebCore::SchemeRegistry::canServiceWorkersHandleURLScheme): Deleted.
+        (WebCore::SchemeRegistry::isServiceWorkerContainerCustomScheme): Deleted.
+        (WebCore::SchemeRegistry::isUserExtensionScheme): Deleted.
+        (WebCore::SchemeRegistry::isBuiltinScheme): Deleted.
+        * platform/LegacySchemeRegistry.h: Copied from Source/WebCore/platform/SchemeRegistry.h.
+        * platform/SchemeRegistry.cpp: Removed.
+        * platform/SchemeRegistry.h: Removed.
+        * platform/ios/QuickLook.mm:
+        * storage/Storage.cpp:
+        * testing/Internals.cpp:
+        (WebCore::Internals::registerURLSchemeAsBypassingContentSecurityPolicy):
+        (WebCore::Internals::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy):
+        * workers/service/ServiceWorkerContainer.cpp:
+        (WebCore::ServiceWorkerContainer::addRegistration):
+        * workers/service/ServiceWorkerProvider.cpp:
+        (WebCore::ServiceWorkerProvider::registerServiceWorkerClients):
+        * workers/service/server/SWServerJobQueue.cpp:
+        (WebCore::SWServerJobQueue::runRegisterJob):
+
 2019-10-04  Antoine Quint  <graouts@apple.com>
 
         Crash in debug build with imported/w3c/web-platform-tests/web-animations/timing-model/timelines/update-and-send-events-replacement.html
index ddb359e..5b2f53b 100644 (file)
@@ -910,6 +910,7 @@ set(WebCore_PRIVATE_FRAMEWORK_HEADERS
     platform/KeyedCoding.h
     platform/KeypressCommand.h
     platform/LayoutUnit.h
+    platform/LegacySchemeRegistry.h
     platform/Length.h
     platform/LengthBox.h
     platform/LengthPoint.h
@@ -957,7 +958,6 @@ set(WebCore_PRIVATE_FRAMEWORK_HEADERS
     platform/RemoteCommandListener.h
     platform/RuntimeApplicationChecks.h
     platform/SSLKeyGenerator.h
-    platform/SchemeRegistry.h
     platform/ScreenProperties.h
     platform/ScrollAnimator.h
     platform/ScrollTypes.h
index 98aa36d..6a649ff 100644 (file)
@@ -35,7 +35,7 @@
 #include "Frame.h"
 #include "HTMLIFrameElement.h"
 #include "HTMLParserIdioms.h"
-#include "SchemeRegistry.h"
+#include "LegacySchemeRegistry.h"
 #include "Settings.h"
 #include "UserMediaRequest.h"
 
@@ -66,7 +66,7 @@ static inline bool isSecure(DocumentLoader& documentLoader)
     auto& response = documentLoader.response();
     if (SecurityOrigin::isLocalHostOrLoopbackIPAddress(documentLoader.response().url().host()))
         return true;
-    return SchemeRegistry::shouldTreatURLSchemeAsSecure(response.url().protocol().toStringWithoutCopying())
+    return LegacySchemeRegistry::shouldTreatURLSchemeAsSecure(response.url().protocol().toStringWithoutCopying())
         && response.certificateInfo()
         && !response.certificateInfo()->containsNonRootSHA1SignedCertificate();
 }
index 4f2517e..77a52da 100644 (file)
@@ -45,7 +45,6 @@
 #include "MediaConstraints.h"
 #include "PlatformMediaSessionManager.h"
 #include "RealtimeMediaSourceCenter.h"
-#include "SchemeRegistry.h"
 #include "Settings.h"
 #include "UserMediaController.h"
 #include <wtf/Scope.h>
index 847d266..43a3df4 100644 (file)
@@ -39,7 +39,7 @@
 #include "PublicKeyCredentialData.h"
 #include "PublicKeyCredentialRequestOptions.h"
 #include "RegistrableDomain.h"
-#include "SchemeRegistry.h"
+#include "LegacySchemeRegistry.h"
 #include "SecurityOrigin.h"
 #include <pal/crypto/CryptoDigest.h>
 #include <wtf/JSONValues.h>
@@ -100,7 +100,7 @@ static bool needsAppIdQuirks(const String& host, const String& appId)
 static String processAppIdExtension(const SecurityOrigin& facetId, const String& appId)
 {
     // Step 1. Skipped since facetId should always be secure origins.
-    ASSERT(SchemeRegistry::shouldTreatURLSchemeAsSecure(facetId.protocol()));
+    ASSERT(LegacySchemeRegistry::shouldTreatURLSchemeAsSecure(facetId.protocol()));
 
     // Step 2. Follow Chrome and Firefox to use the origin directly without adding a trailing slash.
     if (appId.isEmpty())
index 482204e..2012f75 100644 (file)
@@ -35,8 +35,8 @@
 #include "DatabaseTask.h"
 #include "DatabaseThread.h"
 #include "Document.h"
+#include "LegacySchemeRegistry.h"
 #include "Page.h"
-#include "SchemeRegistry.h"
 #include "ScriptExecutionContext.h"
 #include "SecurityOrigin.h"
 #include "SecurityOriginData.h"
@@ -189,7 +189,7 @@ bool DatabaseContext::allowDatabaseAccess() const
 {
     if (is<Document>(*m_scriptExecutionContext)) {
         Document& document = downcast<Document>(*m_scriptExecutionContext);
-        if (!document.page() || (document.page()->usesEphemeralSession() && !SchemeRegistry::allowsDatabaseAccessInPrivateBrowsing(document.securityOrigin().protocol())))
+        if (!document.page() || (document.page()->usesEphemeralSession() && !LegacySchemeRegistry::allowsDatabaseAccessInPrivateBrowsing(document.securityOrigin().protocol())))
             return false;
         return true;
     }
index e6e0958..2cc65b9 100644 (file)
@@ -1704,6 +1704,7 @@ platform/FileMonitor.cpp
 platform/FileStream.cpp
 platform/GenericTaskQueue.cpp
 platform/LayoutUnit.cpp
+platform/LegacySchemeRegistry.cpp
 platform/Length.cpp
 platform/LengthBox.cpp
 platform/LengthPoint.cpp
@@ -1726,7 +1727,6 @@ platform/ReferrerPolicy.cpp
 platform/RemoteCommandListener.cpp
 platform/RuntimeApplicationChecks.cpp
 platform/SSLKeyGenerator.cpp
-platform/SchemeRegistry.cpp
 platform/ScrollAnimator.cpp
 platform/ScrollView.cpp
 platform/ScrollableArea.cpp
index e95a5cd..3c40260 100644 (file)
                5160712F1BD8307800DBC4F2 /* IDBObjectStoreInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 5160712D1BD8307200DBC4F2 /* IDBObjectStoreInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
                516071321BD8308B00DBC4F2 /* TransactionOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 5160712B1BD8305300DBC4F2 /* TransactionOperation.h */; settings = {ATTRIBUTES = (Private, ); }; };
                516103AF1CADBA770016B4C7 /* IDBValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 516103AE1CADB9A30016B4C7 /* IDBValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               5162C7F511F77EFB00612EFE /* SchemeRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 5162C7F311F77EFB00612EFE /* SchemeRegistry.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               5162C7F511F77EFB00612EFE /* LegacySchemeRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 5162C7F311F77EFB00612EFE /* LegacySchemeRegistry.h */; settings = {ATTRIBUTES = (Private, ); }; };
                5166D3CD1E8ED48F00AD62E3 /* StorageType.h in Headers */ = {isa = PBXBuildFile; fileRef = 5166D3CC1E8ED41100AD62E3 /* StorageType.h */; settings = {ATTRIBUTES = (Private, ); }; };
                516C62201950D48700337E75 /* GamepadEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 516C621D1950D48700337E75 /* GamepadEvent.cpp */; };
                516C62211950D48700337E75 /* GamepadEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 516C621E1950D48700337E75 /* GamepadEvent.h */; };
                5160F4970B0AA75F00C1D2AF /* HistoryItemMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HistoryItemMac.mm; sourceTree = "<group>"; };
                516103AD1CADB9A30016B4C7 /* IDBValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBValue.cpp; sourceTree = "<group>"; };
                516103AE1CADB9A30016B4C7 /* IDBValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBValue.h; sourceTree = "<group>"; };
-               5162C7F211F77EFA00612EFE /* SchemeRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SchemeRegistry.cpp; sourceTree = "<group>"; };
-               5162C7F311F77EFB00612EFE /* SchemeRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SchemeRegistry.h; sourceTree = "<group>"; };
+               5162C7F211F77EFA00612EFE /* LegacySchemeRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LegacySchemeRegistry.cpp; sourceTree = "<group>"; };
+               5162C7F311F77EFB00612EFE /* LegacySchemeRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacySchemeRegistry.h; sourceTree = "<group>"; };
                51645B411B9F889B00F789CE /* IDBCursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBCursor.h; sourceTree = "<group>"; };
                51645B421B9F889B00F789CE /* IDBCursorWithValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBCursorWithValue.cpp; sourceTree = "<group>"; };
                51645B431B9F889B00F789CE /* IDBCursorWithValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBCursorWithValue.h; sourceTree = "<group>"; };
                                E15FF7D418C9553800FE4C87 /* KeypressCommand.h */,
                                A3D42A841F33BA3600A64B62 /* LayoutUnit.cpp */,
                                141DC0471648348F00371E5A /* LayoutUnit.h */,
+                               5162C7F211F77EFA00612EFE /* LegacySchemeRegistry.cpp */,
+                               5162C7F311F77EFB00612EFE /* LegacySchemeRegistry.h */,
                                BCE65BE80EACDF16007E4533 /* Length.cpp */,
                                BCE65BE90EACDF16007E4533 /* Length.h */,
                                0FE95F1A1CD540D000D2F45A /* LengthBox.cpp */,
                                CDFC360418CA61C20026E56F /* RemoteCommandListener.h */,
                                A18F7A351ECA73640059E1E1 /* RuntimeApplicationChecks.cpp */,
                                293EAE1E1356B2FE0067ACF9 /* RuntimeApplicationChecks.h */,
-                               5162C7F211F77EFA00612EFE /* SchemeRegistry.cpp */,
-                               5162C7F311F77EFB00612EFE /* SchemeRegistry.h */,
                                C1E1D235203DF15400584665 /* ScreenProperties.h */,
                                BC8AE34C12EA096A00EB3AE6 /* ScrollableArea.cpp */,
                                BC8AE34D12EA096A00EB3AE6 /* ScrollableArea.h */,
                                CDF4B7121E0087AE00E235A2 /* LegacyCDMSession.h in Headers */,
                                CDE8B5F11A69778B00B4B66A /* LegacyCDMSessionClearKey.h in Headers */,
                                F44A5F591FED38F2007F5944 /* LegacyNSPasteboardTypes.h in Headers */,
+                               5162C7F511F77EFB00612EFE /* LegacySchemeRegistry.h in Headers */,
                                E4C3B1FA0F0E4161009693F6 /* LegacyTileCache.h in Headers */,
                                E4B65A58132FA8E70070E7BE /* LegacyTileGrid.h in Headers */,
                                E424A39E1330DF0100CF6DC9 /* LegacyTileGridTile.h in Headers */,
                                CDD7089718359F6F002B3DC6 /* SampleMap.h in Headers */,
                                49E911CB0EF86D47009D0CAF /* ScaleTransformOperation.h in Headers */,
                                5DFE8F570D16477C0076E937 /* ScheduledAction.h in Headers */,
-                               5162C7F511F77EFB00612EFE /* SchemeRegistry.h in Headers */,
                                9BD0BF9312A42BF50072FD43 /* ScopedEventQueue.h in Headers */,
                                BCEC01BE0C274DAC009F4EC9 /* Screen.h in Headers */,
                                C1E1D236203DF15400584665 /* ScreenProperties.h in Headers */,
index 0fd0fa0..2443e24 100644 (file)
 #include "KeyboardEvent.h"
 #include "KeyframeEffect.h"
 #include "LayoutDisallowedScope.h"
+#include "LegacySchemeRegistry.h"
 #include "LibWebRTCProvider.h"
 #include "LoaderStrategy.h"
 #include "Logging.h"
 #include "SVGUseElement.h"
 #include "SVGZoomEvent.h"
 #include "SWClientConnection.h"
-#include "SchemeRegistry.h"
 #include "ScopedEventQueue.h"
 #include "ScriptController.h"
 #include "ScriptDisallowedScope.h"
@@ -4883,7 +4883,7 @@ ExceptionOr<void> Document::setDomain(const String& newDomain)
     if (isSandboxed(SandboxDocumentDomain))
         return Exception { SecurityError, "Assignment is forbidden for sandboxed iframes." };
 
-    if (SchemeRegistry::isDomainRelaxationForbiddenForURLScheme(securityOrigin().protocol()))
+    if (LegacySchemeRegistry::isDomainRelaxationForbiddenForURLScheme(securityOrigin().protocol()))
         return Exception { SecurityError };
 
     // FIXME: We should add logging indicating why a domain was not allowed.
index a9d820f..0010387 100644 (file)
@@ -37,6 +37,7 @@
 #include "ErrorEvent.h"
 #include "JSDOMExceptionHandling.h"
 #include "JSDOMWindow.h"
+#include "LegacySchemeRegistry.h"
 #include "MessagePort.h"
 #include "Navigator.h"
 #include "Page.h"
@@ -45,7 +46,6 @@
 #include "ResourceRequest.h"
 #include "SWClientConnection.h"
 #include "SWContextManager.h"
-#include "SchemeRegistry.h"
 #include "ScriptController.h"
 #include "ScriptDisallowedScope.h"
 #include "ScriptState.h"
@@ -574,7 +574,7 @@ bool ScriptExecutionContext::allowsMediaDevices() const
 bool ScriptExecutionContext::hasServiceWorkerScheme() const
 {
     ASSERT(securityOrigin());
-    return SchemeRegistry::isServiceWorkerContainerCustomScheme(securityOrigin()->protocol());
+    return LegacySchemeRegistry::isServiceWorkerContainerCustomScheme(securityOrigin()->protocol());
 }
 
 #if ENABLE(SERVICE_WORKER)
index f81f1ab..c56c3c4 100644 (file)
@@ -33,6 +33,7 @@
 #include "JSDOMConvertInterface.h"
 #include "JSDOMConvertStrings.h"
 #include "JSShadowRoot.h"
+#include "LegacySchemeRegistry.h"
 #include "LocalizedStrings.h"
 #include "Logging.h"
 #include "MouseEvent.h"
@@ -43,7 +44,6 @@
 #include "RenderImage.h"
 #include "RenderSnapshottedPlugIn.h"
 #include "RenderTreeUpdater.h"
-#include "SchemeRegistry.h"
 #include "ScriptController.h"
 #include "SecurityOrigin.h"
 #include "Settings.h"
@@ -484,7 +484,7 @@ void HTMLPlugInImageElement::userDidClickSnapshot(MouseEvent& event, bool forwar
         m_pendingClickEventFromSnapshot = &event;
 
     auto plugInOrigin = m_loadedUrl.host();
-    if (document().page() && !SchemeRegistry::shouldTreatURLSchemeAsLocal(document().page()->mainFrame().document()->baseURL().protocol().toStringWithoutCopying()) && document().page()->settings().autostartOriginPlugInSnapshottingEnabled())
+    if (document().page() && !LegacySchemeRegistry::shouldTreatURLSchemeAsLocal(document().page()->mainFrame().document()->baseURL().protocol().toStringWithoutCopying()) && document().page()->settings().autostartOriginPlugInSnapshottingEnabled())
         document().page()->plugInClient()->didStartFromOrigin(document().page()->mainFrame().document()->baseURL().host().toString(), plugInOrigin.toString(), serviceType());
 
     LOG(Plugins, "%p User clicked on snapshotted plug-in. Restart.", this);
@@ -701,7 +701,7 @@ void HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn(const URL& url)
         return;
     }
 
-    if (!SchemeRegistry::shouldTreatURLSchemeAsLocal(m_loadedUrl.protocol().toStringWithoutCopying()) && !m_loadedUrl.host().isEmpty() && m_loadedUrl.host() == document().page()->mainFrame().document()->baseURL().host()) {
+    if (!LegacySchemeRegistry::shouldTreatURLSchemeAsLocal(m_loadedUrl.protocol().toStringWithoutCopying()) && !m_loadedUrl.host().isEmpty() && m_loadedUrl.host() == document().page()->mainFrame().document()->baseURL().host()) {
         LOG(Plugins, "%p Plug-in is served from page's domain, set to play", this);
         m_snapshotDecision = NeverSnapshot;
         return;
index c4ce5f5..224b1b5 100644 (file)
@@ -31,9 +31,9 @@
 #include "CrossOriginPreflightResultCache.h"
 #include "HTTPHeaderNames.h"
 #include "HTTPParsers.h"
+#include "LegacySchemeRegistry.h"
 #include "ResourceRequest.h"
 #include "ResourceResponse.h"
-#include "SchemeRegistry.h"
 #include "SecurityOrigin.h"
 #include "SecurityPolicy.h"
 #include <mutex>
@@ -129,7 +129,7 @@ CachedResourceRequest createPotentialAccessControlRequest(ResourceRequest&& requ
 
 bool isValidCrossOriginRedirectionURL(const URL& redirectURL)
 {
-    return SchemeRegistry::shouldTreatURLSchemeAsCORSEnabled(redirectURL.protocol().toStringWithoutCopying())
+    return LegacySchemeRegistry::shouldTreatURLSchemeAsCORSEnabled(redirectURL.protocol().toStringWithoutCopying())
         && redirectURL.user().isEmpty()
         && redirectURL.pass().isEmpty();
 }
index c4816d4..6a63023 100644 (file)
@@ -59,6 +59,7 @@
 #include "HistoryController.h"
 #include "IconLoader.h"
 #include "InspectorInstrumentation.h"
+#include "LegacySchemeRegistry.h"
 #include "LinkIconCollector.h"
 #include "LinkIconType.h"
 #include "LoaderStrategy.h"
@@ -74,7 +75,6 @@
 #include "ResourceLoadObserver.h"
 #include "RuntimeEnabledFeatures.h"
 #include "SWClientConnection.h"
-#include "SchemeRegistry.h"
 #include "ScriptableDocumentParser.h"
 #include "SecurityPolicy.h"
 #include "ServiceWorker.h"
@@ -470,7 +470,7 @@ void DocumentLoader::startDataLoadTimer()
 #if ENABLE(SERVICE_WORKER)
 void DocumentLoader::matchRegistration(const URL& url, SWClientConnection::RegistrationCallback&& callback)
 {
-    auto shouldTryLoadingThroughServiceWorker = !frameLoader()->isReloadingFromOrigin() && m_frame->page() && RuntimeEnabledFeatures::sharedFeatures().serviceWorkerEnabled() && SchemeRegistry::canServiceWorkersHandleURLScheme(url.protocol().toStringWithoutCopying());
+    auto shouldTryLoadingThroughServiceWorker = !frameLoader()->isReloadingFromOrigin() && m_frame->page() && RuntimeEnabledFeatures::sharedFeatures().serviceWorkerEnabled() && LegacySchemeRegistry::canServiceWorkersHandleURLScheme(url.protocol().toStringWithoutCopying());
     if (!shouldTryLoadingThroughServiceWorker) {
         callback(WTF::nullopt);
         return;
@@ -861,7 +861,7 @@ bool DocumentLoader::disallowWebArchive() const
     if (m_substituteData.isValid())
         return false;
 
-    if (!SchemeRegistry::shouldTreatURLSchemeAsLocal(m_request.url().protocol().toStringWithoutCopying()))
+    if (!LegacySchemeRegistry::shouldTreatURLSchemeAsLocal(m_request.url().protocol().toStringWithoutCopying()))
         return true;
 
     if (!frame() || (frame()->isMainFrame() && m_allowsWebArchiveForMainFrame))
@@ -1037,7 +1037,7 @@ void DocumentLoader::commitData(const char* bytes, size_t length)
                     m_frame->document()->setActiveServiceWorker(parent->activeServiceWorker());
             }
 
-            if (m_frame->document()->activeServiceWorker() || SchemeRegistry::canServiceWorkersHandleURLScheme(m_frame->document()->url().protocol().toStringWithoutCopying()))
+            if (m_frame->document()->activeServiceWorker() || LegacySchemeRegistry::canServiceWorkersHandleURLScheme(m_frame->document()->url().protocol().toStringWithoutCopying()))
                 m_frame->document()->setServiceWorkerConnection(ServiceWorkerProvider::singleton().existingServiceWorkerConnection());
 
             // We currently unregister the temporary service worker client since we now registered the real document.
@@ -1709,7 +1709,7 @@ bool DocumentLoader::isMultipartReplacingLoad() const
 
 bool DocumentLoader::maybeLoadEmpty()
 {
-    bool shouldLoadEmpty = !m_substituteData.isValid() && (m_request.url().isEmpty() || SchemeRegistry::shouldLoadURLSchemeAsEmptyDocument(m_request.url().protocol().toStringWithoutCopying()));
+    bool shouldLoadEmpty = !m_substituteData.isValid() && (m_request.url().isEmpty() || LegacySchemeRegistry::shouldLoadURLSchemeAsEmptyDocument(m_request.url().protocol().toStringWithoutCopying()));
     if (!shouldLoadEmpty && !frameLoader()->client().representationExistsForURLScheme(m_request.url().protocol().toStringWithoutCopying()))
         return false;
 
index a9bf4b7..31e3184 100644 (file)
@@ -43,6 +43,7 @@
 #include "Frame.h"
 #include "FrameLoader.h"
 #include "InspectorInstrumentation.h"
+#include "LegacySchemeRegistry.h"
 #include "LoadTiming.h"
 #include "LoaderStrategy.h"
 #include "Performance.h"
@@ -53,7 +54,6 @@
 #include "ResourceTiming.h"
 #include "RuntimeApplicationChecks.h"
 #include "RuntimeEnabledFeatures.h"
-#include "SchemeRegistry.h"
 #include "SecurityOrigin.h"
 #include "SharedBuffer.h"
 #include "SubresourceIntegrity.h"
@@ -147,7 +147,7 @@ DocumentThreadableLoader::DocumentThreadableLoader(Document& document, Threadabl
     if (shouldSetHTTPHeadersToKeep())
         m_options.httpHeadersToKeep = httpHeadersToKeepFromCleaning(request.httpHeaderFields());
 
-    if (document.isRunningUserScripts() && SchemeRegistry::isUserExtensionScheme(request.url().protocol().toStringWithoutCopying())) {
+    if (document.isRunningUserScripts() && LegacySchemeRegistry::isUserExtensionScheme(request.url().protocol().toStringWithoutCopying())) {
         m_options.mode = FetchOptions::Mode::NoCors;
         m_options.filteringPolicy = ResponseFilteringPolicy::Disable;
     }
@@ -174,7 +174,7 @@ DocumentThreadableLoader::DocumentThreadableLoader(Document& document, Threadabl
 bool DocumentThreadableLoader::checkURLSchemeAsCORSEnabled(const URL& url)
 {
     // Cross-origin requests are only allowed for HTTP and registered schemes. We would catch this when checking response headers later, but there is no reason to send a request that's guaranteed to be denied.
-    if (!SchemeRegistry::shouldTreatURLSchemeAsCORSEnabled(url.protocol().toStringWithoutCopying())) {
+    if (!LegacySchemeRegistry::shouldTreatURLSchemeAsCORSEnabled(url.protocol().toStringWithoutCopying())) {
         logErrorAndFail(ResourceError(errorDomainWebKitInternal, 0, url, "Cross origin requests are only supported for HTTP.", ResourceError::Type::AccessControl));
         return false;
     }
index 0a1e00e..c997b31 100644 (file)
 
 #include "Document.h"
 #include "Frame.h"
+#include "LegacySchemeRegistry.h"
 #include "MHTMLParser.h"
 #include "MIMETypeRegistry.h"
 #include "Page.h"
 #include "PageSerializer.h"
 #include "QuotedPrintable.h"
-#include "SchemeRegistry.h"
 #include "SharedBuffer.h"
 #include <time.h>
 #include <wtf/CryptographicallyRandomNumber.h>
@@ -109,7 +109,7 @@ Ref<MHTMLArchive> MHTMLArchive::create()
 RefPtr<MHTMLArchive> MHTMLArchive::create(const URL& url, SharedBuffer& data)
 {
     // For security reasons we only load MHTML pages from local URLs.
-    if (!SchemeRegistry::shouldTreatURLSchemeAsLocal(url.protocol().toString()))
+    if (!LegacySchemeRegistry::shouldTreatURLSchemeAsLocal(url.protocol().toString()))
         return nullptr;
 
     MHTMLParser parser(&data);
index 7033c51..8722455 100644 (file)
 #include "FrameLoaderClient.h"
 #include "HTTPHeaderNames.h"
 #include "InspectorInstrumentation.h"
+#include "LegacySchemeRegistry.h"
 #include "LoaderStrategy.h"
 #include "Logging.h"
 #include "MemoryCache.h"
 #include "PlatformStrategies.h"
 #include "ProgressTracker.h"
 #include "ResourceHandle.h"
-#include "SchemeRegistry.h"
 #include "SecurityOrigin.h"
 #include "SubresourceLoader.h"
 #include <wtf/CompletionHandler.h>
@@ -454,7 +454,7 @@ Seconds CachedResource::freshnessLifetime(const ResourceResponse& response) cons
             // Don't cache non-HTTP main resources since we can't check for freshness.
             // FIXME: We should not cache subresources either, but when we tried this
             // it caused performance and flakiness issues in our test infrastructure.
-            if (m_type == Type::MainResource || SchemeRegistry::shouldAlwaysRevalidateURLScheme(protocol.toStringWithoutCopying()))
+            if (m_type == Type::MainResource || LegacySchemeRegistry::shouldAlwaysRevalidateURLScheme(protocol.toStringWithoutCopying()))
                 return 0_us;
         }
 
index 715859f..74697c9 100644 (file)
@@ -66,6 +66,7 @@
 #include "InspectorClient.h"
 #include "InspectorController.h"
 #include "InspectorInstrumentation.h"
+#include "LegacySchemeRegistry.h"
 #include "LibWebRTCProvider.h"
 #include "LoaderStrategy.h"
 #include "Logging.h"
 #include "ResourceUsageOverlay.h"
 #include "RuntimeEnabledFeatures.h"
 #include "SVGDocumentExtensions.h"
-#include "SchemeRegistry.h"
 #include "ScriptController.h"
 #include "ScriptedAnimationController.h"
 #include "ScrollLatchingState.h"
@@ -1381,7 +1381,7 @@ void Page::userStyleSheetLocationChanged()
     URL url = m_settings->userStyleSheetLocation();
     
     // Allow any local file URL scheme to be loaded.
-    if (SchemeRegistry::shouldTreatURLSchemeAsLocal(url.protocol().toStringWithoutCopying()))
+    if (LegacySchemeRegistry::shouldTreatURLSchemeAsLocal(url.protocol().toStringWithoutCopying()))
         m_userStyleSheetPath = url.fileSystemPath();
     else
         m_userStyleSheetPath = String();
index 5c3d507..bbe291e 100644 (file)
@@ -30,9 +30,9 @@
 #include "SecurityOrigin.h"
 
 #include "BlobURL.h"
+#include "LegacySchemeRegistry.h"
 #include "OriginAccessEntry.h"
 #include "PublicSuffix.h"
-#include "SchemeRegistry.h"
 #include "SecurityPolicy.h"
 #include "TextEncoding.h"
 #include "ThreadableBlobRegistry.h"
@@ -95,7 +95,7 @@ static bool shouldTreatAsUniqueOrigin(const URL& url)
     if (schemeRequiresHost(innerURL) && innerURL.host().isEmpty())
         return true;
 
-    if (SchemeRegistry::shouldTreatURLSchemeAsNoAccess(innerURL.protocol().toStringWithoutCopying()))
+    if (LegacySchemeRegistry::shouldTreatURLSchemeAsNoAccess(innerURL.protocol().toStringWithoutCopying()))
         return true;
 
     // This is the common case.
@@ -126,13 +126,13 @@ static bool isLoopbackIPAddress(StringView host)
 // https://w3c.github.io/webappsec-secure-contexts/#is-origin-trustworthy (Editor's Draft, 17 November 2016)
 static bool shouldTreatAsPotentiallyTrustworthy(const String& protocol, const String& host)
 {
-    if (SchemeRegistry::shouldTreatURLSchemeAsSecure(protocol))
+    if (LegacySchemeRegistry::shouldTreatURLSchemeAsSecure(protocol))
         return true;
 
     if (SecurityOrigin::isLocalHostOrLoopbackIPAddress(host))
         return true;
 
-    if (SchemeRegistry::shouldTreatURLSchemeAsLocal(protocol))
+    if (LegacySchemeRegistry::shouldTreatURLSchemeAsLocal(protocol))
         return true;
 
     return false;
@@ -145,7 +145,7 @@ bool shouldTreatAsPotentiallyTrustworthy(const URL& url)
 
 SecurityOrigin::SecurityOrigin(const URL& url)
     : m_data(SecurityOriginData::fromURL(url))
-    , m_isLocal(SchemeRegistry::shouldTreatURLSchemeAsLocal(m_data.protocol))
+    , m_isLocal(LegacySchemeRegistry::shouldTreatURLSchemeAsLocal(m_data.protocol))
 {
     // document.domain starts as m_data.host, but can be set by the DOM.
     m_domain = m_data.host;
@@ -229,11 +229,11 @@ void SecurityOrigin::setDomainFromDOM(const String& newDomain)
 bool SecurityOrigin::isSecure(const URL& url)
 {
     // Invalid URLs are secure, as are URLs which have a secure protocol.
-    if (!url.isValid() || SchemeRegistry::shouldTreatURLSchemeAsSecure(url.protocol().toStringWithoutCopying()))
+    if (!url.isValid() || LegacySchemeRegistry::shouldTreatURLSchemeAsSecure(url.protocol().toStringWithoutCopying()))
         return true;
 
     // URLs that wrap inner URLs are secure if those inner URLs are secure.
-    if (shouldUseInnerURL(url) && SchemeRegistry::shouldTreatURLSchemeAsSecure(extractInnerURL(url).protocol().toStringWithoutCopying()))
+    if (shouldUseInnerURL(url) && LegacySchemeRegistry::shouldTreatURLSchemeAsSecure(extractInnerURL(url).protocol().toStringWithoutCopying()))
         return true;
 
     return false;
@@ -366,10 +366,10 @@ bool SecurityOrigin::canDisplay(const URL& url) const
 
     String protocol = url.protocol().toString();
 
-    if (SchemeRegistry::canDisplayOnlyIfCanRequest(protocol))
+    if (LegacySchemeRegistry::canDisplayOnlyIfCanRequest(protocol))
         return canRequest(url);
 
-    if (SchemeRegistry::shouldTreatURLSchemeAsDisplayIsolated(protocol))
+    if (LegacySchemeRegistry::shouldTreatURLSchemeAsDisplayIsolated(protocol))
         return equalIgnoringASCIICase(m_data.protocol, protocol) || SecurityPolicy::isAccessToURLWhiteListed(this, url);
 
     if (!SecurityPolicy::restrictAccessToLocal())
@@ -378,7 +378,7 @@ bool SecurityOrigin::canDisplay(const URL& url) const
     if (url.isLocalFile() && url.fileSystemPath() == m_filePath)
         return true;
 
-    if (SchemeRegistry::shouldTreatURLSchemeAsLocal(protocol))
+    if (LegacySchemeRegistry::shouldTreatURLSchemeAsLocal(protocol))
         return canLoadLocalResources() || SecurityPolicy::isAccessToURLWhiteListed(this, url);
 
     return true;
@@ -482,7 +482,7 @@ String SecurityOrigin::domainForCachePartition() const
     if (isHTTPFamily())
         return host();
 
-    if (SchemeRegistry::shouldPartitionCacheForURLScheme(m_data.protocol))
+    if (LegacySchemeRegistry::shouldPartitionCacheForURLScheme(m_data.protocol))
         return host();
 
     return emptyString();
index 8f0f6bf..ae31106 100644 (file)
 #include "InspectorInstrumentation.h"
 #include "JSExecState.h"
 #include "JSWindowProxy.h"
+#include "LegacySchemeRegistry.h"
 #include "ParsingUtilities.h"
 #include "PingLoader.h"
 #include "ResourceRequest.h"
 #include "RuntimeEnabledFeatures.h"
-#include "SchemeRegistry.h"
 #include "SecurityOrigin.h"
 #include "SecurityPolicyViolationEvent.h"
 #include "Settings.h"
@@ -540,7 +540,7 @@ bool ContentSecurityPolicy::allowPluginType(const String& type, const String& ty
 
 bool ContentSecurityPolicy::allowObjectFromSource(const URL& url, RedirectResponseReceived redirectResponseReceived) const
 {
-    if (SchemeRegistry::schemeShouldBypassContentSecurityPolicy(url.protocol().toStringWithoutCopying()))
+    if (LegacySchemeRegistry::schemeShouldBypassContentSecurityPolicy(url.protocol().toStringWithoutCopying()))
         return true;
     // As per section object-src of the Content Security Policy Level 3 spec., <http://w3c.github.io/webappsec-csp> (Editor's Draft, 29 February 2016),
     // "If plugin content is loaded without an associated URL (perhaps an object element lacks a data attribute, but loads some default plugin based
@@ -556,7 +556,7 @@ bool ContentSecurityPolicy::allowObjectFromSource(const URL& url, RedirectRespon
 
 bool ContentSecurityPolicy::allowChildFrameFromSource(const URL& url, RedirectResponseReceived redirectResponseReceived) const
 {
-    if (SchemeRegistry::schemeShouldBypassContentSecurityPolicy(url.protocol().toStringWithoutCopying()))
+    if (LegacySchemeRegistry::schemeShouldBypassContentSecurityPolicy(url.protocol().toStringWithoutCopying()))
         return true;
     String sourceURL;
     TextPosition sourcePosition(WTF::OrdinalNumber::beforeFirst(), WTF::OrdinalNumber());
@@ -570,7 +570,7 @@ bool ContentSecurityPolicy::allowChildFrameFromSource(const URL& url, RedirectRe
 
 bool ContentSecurityPolicy::allowResourceFromSource(const URL& url, RedirectResponseReceived redirectResponseReceived, const char* name, ResourcePredicate resourcePredicate) const
 {
-    if (SchemeRegistry::schemeShouldBypassContentSecurityPolicy(url.protocol().toStringWithoutCopying()))
+    if (LegacySchemeRegistry::schemeShouldBypassContentSecurityPolicy(url.protocol().toStringWithoutCopying()))
         return true;
     String sourceURL;
     TextPosition sourcePosition(WTF::OrdinalNumber::beforeFirst(), WTF::OrdinalNumber());
@@ -620,7 +620,7 @@ bool ContentSecurityPolicy::allowMediaFromSource(const URL& url, RedirectRespons
 
 bool ContentSecurityPolicy::allowConnectToSource(const URL& url, RedirectResponseReceived redirectResponseReceived) const
 {
-    if (SchemeRegistry::schemeShouldBypassContentSecurityPolicy(url.protocol().toStringWithoutCopying()))
+    if (LegacySchemeRegistry::schemeShouldBypassContentSecurityPolicy(url.protocol().toStringWithoutCopying()))
         return true;
     String sourceURL;
     TextPosition sourcePosition(WTF::OrdinalNumber::beforeFirst(), WTF::OrdinalNumber());
@@ -640,7 +640,7 @@ bool ContentSecurityPolicy::allowBaseURI(const URL& url, bool overrideContentSec
 {
     if (overrideContentSecurityPolicy)
         return true;
-    if (SchemeRegistry::schemeShouldBypassContentSecurityPolicy(url.protocol().toStringWithoutCopying()))
+    if (LegacySchemeRegistry::schemeShouldBypassContentSecurityPolicy(url.protocol().toStringWithoutCopying()))
         return true;
     String sourceURL;
     TextPosition sourcePosition(WTF::OrdinalNumber::beforeFirst(), WTF::OrdinalNumber());
@@ -24,7 +24,7 @@
  *
  */
 #include "config.h"
-#include "SchemeRegistry.h"
+#include "LegacySchemeRegistry.h"
 
 #include <wtf/Lock.h>
 #include <wtf/Locker.h>
@@ -78,7 +78,7 @@ static const URLSchemesMap& allBuiltinSchemes()
             builtinCORSEnabledSchemes,
         };
 
-        // Other misc schemes that the SchemeRegistry doesn't know about.
+        // Other misc schemes that the LegacySchemeRegistry doesn't know about.
         static const char* const otherSchemes[] = {
             "webkit-fake-url",
 #if PLATFORM(MAC)
@@ -218,7 +218,7 @@ static URLSchemesMap& notAllowingJavascriptURLsSchemes()
     return notAllowingJavascriptURLsSchemes;
 }
 
-void SchemeRegistry::registerURLSchemeAsLocal(const String& scheme)
+void LegacySchemeRegistry::registerURLSchemeAsLocal(const String& scheme)
 {
     if (scheme.isNull())
         return;
@@ -227,7 +227,7 @@ void SchemeRegistry::registerURLSchemeAsLocal(const String& scheme)
     localURLSchemes().add(scheme);
 }
 
-void SchemeRegistry::removeURLSchemeRegisteredAsLocal(const String& scheme)
+void LegacySchemeRegistry::removeURLSchemeRegisteredAsLocal(const String& scheme)
 {
     Locker<Lock> locker(schemeRegistryLock);
     if (builtinLocalURLSchemes().contains(scheme))
@@ -286,7 +286,7 @@ static URLSchemesMap& alwaysRevalidatedSchemes()
     return schemes;
 }
 
-bool SchemeRegistry::shouldTreatURLSchemeAsLocal(const String& scheme)
+bool LegacySchemeRegistry::shouldTreatURLSchemeAsLocal(const String& scheme)
 {
     if (scheme.isNull())
         return false;
@@ -295,7 +295,7 @@ bool SchemeRegistry::shouldTreatURLSchemeAsLocal(const String& scheme)
     return localURLSchemes().contains(scheme);
 }
 
-void SchemeRegistry::registerURLSchemeAsNoAccess(const String& scheme)
+void LegacySchemeRegistry::registerURLSchemeAsNoAccess(const String& scheme)
 {
     if (scheme.isNull())
         return;
@@ -304,7 +304,7 @@ void SchemeRegistry::registerURLSchemeAsNoAccess(const String& scheme)
     schemesWithUniqueOrigins().add(scheme);
 }
 
-bool SchemeRegistry::shouldTreatURLSchemeAsNoAccess(const String& scheme)
+bool LegacySchemeRegistry::shouldTreatURLSchemeAsNoAccess(const String& scheme)
 {
     if (scheme.isNull())
         return false;
@@ -313,7 +313,7 @@ bool SchemeRegistry::shouldTreatURLSchemeAsNoAccess(const String& scheme)
     return schemesWithUniqueOrigins().contains(scheme);
 }
 
-void SchemeRegistry::registerURLSchemeAsDisplayIsolated(const String& scheme)
+void LegacySchemeRegistry::registerURLSchemeAsDisplayIsolated(const String& scheme)
 {
     if (scheme.isNull())
         return;
@@ -322,7 +322,7 @@ void SchemeRegistry::registerURLSchemeAsDisplayIsolated(const String& scheme)
     displayIsolatedURLSchemes().add(scheme);
 }
 
-bool SchemeRegistry::shouldTreatURLSchemeAsDisplayIsolated(const String& scheme)
+bool LegacySchemeRegistry::shouldTreatURLSchemeAsDisplayIsolated(const String& scheme)
 {
     if (scheme.isNull())
         return false;
@@ -331,7 +331,7 @@ bool SchemeRegistry::shouldTreatURLSchemeAsDisplayIsolated(const String& scheme)
     return displayIsolatedURLSchemes().contains(scheme);
 }
 
-void SchemeRegistry::registerURLSchemeAsSecure(const String& scheme)
+void LegacySchemeRegistry::registerURLSchemeAsSecure(const String& scheme)
 {
     if (scheme.isNull())
         return;
@@ -340,7 +340,7 @@ void SchemeRegistry::registerURLSchemeAsSecure(const String& scheme)
     secureSchemes().add(scheme);
 }
 
-bool SchemeRegistry::shouldTreatURLSchemeAsSecure(const String& scheme)
+bool LegacySchemeRegistry::shouldTreatURLSchemeAsSecure(const String& scheme)
 {
     if (scheme.isNull())
         return false;
@@ -349,19 +349,19 @@ bool SchemeRegistry::shouldTreatURLSchemeAsSecure(const String& scheme)
     return secureSchemes().contains(scheme);
 }
 
-void SchemeRegistry::registerURLSchemeAsEmptyDocument(const String& scheme)
+void LegacySchemeRegistry::registerURLSchemeAsEmptyDocument(const String& scheme)
 {
     if (scheme.isNull())
         return;
     emptyDocumentSchemes().add(scheme);
 }
 
-bool SchemeRegistry::shouldLoadURLSchemeAsEmptyDocument(const String& scheme)
+bool LegacySchemeRegistry::shouldLoadURLSchemeAsEmptyDocument(const String& scheme)
 {
     return !scheme.isNull() && emptyDocumentSchemes().contains(scheme);
 }
 
-void SchemeRegistry::setDomainRelaxationForbiddenForURLScheme(bool forbidden, const String& scheme)
+void LegacySchemeRegistry::setDomainRelaxationForbiddenForURLScheme(bool forbidden, const String& scheme)
 {
     if (scheme.isNull())
         return;
@@ -372,12 +372,12 @@ void SchemeRegistry::setDomainRelaxationForbiddenForURLScheme(bool forbidden, co
         schemesForbiddenFromDomainRelaxation().remove(scheme);
 }
 
-bool SchemeRegistry::isDomainRelaxationForbiddenForURLScheme(const String& scheme)
+bool LegacySchemeRegistry::isDomainRelaxationForbiddenForURLScheme(const String& scheme)
 {
     return !scheme.isNull() && schemesForbiddenFromDomainRelaxation().contains(scheme);
 }
 
-bool SchemeRegistry::canDisplayOnlyIfCanRequest(const String& scheme)
+bool LegacySchemeRegistry::canDisplayOnlyIfCanRequest(const String& scheme)
 {
     if (scheme.isNull())
         return false;
@@ -386,7 +386,7 @@ bool SchemeRegistry::canDisplayOnlyIfCanRequest(const String& scheme)
     return canDisplayOnlyIfCanRequestSchemes().contains(scheme);
 }
 
-void SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest(const String& scheme)
+void LegacySchemeRegistry::registerAsCanDisplayOnlyIfCanRequest(const String& scheme)
 {
     if (scheme.isNull())
         return;
@@ -395,43 +395,43 @@ void SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest(const String& scheme)
     canDisplayOnlyIfCanRequestSchemes().add(scheme);
 }
 
-void SchemeRegistry::registerURLSchemeAsNotAllowingJavascriptURLs(const String& scheme)
+void LegacySchemeRegistry::registerURLSchemeAsNotAllowingJavascriptURLs(const String& scheme)
 {
     if (scheme.isNull())
         return;
     notAllowingJavascriptURLsSchemes().add(scheme);
 }
 
-bool SchemeRegistry::shouldTreatURLSchemeAsNotAllowingJavascriptURLs(const String& scheme)
+bool LegacySchemeRegistry::shouldTreatURLSchemeAsNotAllowingJavascriptURLs(const String& scheme)
 {
     return !scheme.isNull() && notAllowingJavascriptURLsSchemes().contains(scheme);
 }
 
-void SchemeRegistry::registerURLSchemeAsAllowingDatabaseAccessInPrivateBrowsing(const String& scheme)
+void LegacySchemeRegistry::registerURLSchemeAsAllowingDatabaseAccessInPrivateBrowsing(const String& scheme)
 {
     if (scheme.isNull())
         return;
     schemesAllowingDatabaseAccessInPrivateBrowsing().add(scheme);
 }
 
-bool SchemeRegistry::allowsDatabaseAccessInPrivateBrowsing(const String& scheme)
+bool LegacySchemeRegistry::allowsDatabaseAccessInPrivateBrowsing(const String& scheme)
 {
     return !scheme.isNull() && schemesAllowingDatabaseAccessInPrivateBrowsing().contains(scheme);
 }
 
-void SchemeRegistry::registerURLSchemeAsCORSEnabled(const String& scheme)
+void LegacySchemeRegistry::registerURLSchemeAsCORSEnabled(const String& scheme)
 {
     if (scheme.isNull())
         return;
     CORSEnabledSchemes().add(scheme);
 }
 
-bool SchemeRegistry::shouldTreatURLSchemeAsCORSEnabled(const String& scheme)
+bool LegacySchemeRegistry::shouldTreatURLSchemeAsCORSEnabled(const String& scheme)
 {
     return !scheme.isNull() && CORSEnabledSchemes().contains(scheme);
 }
 
-void SchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy(const String& scheme)
+void LegacySchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy(const String& scheme)
 {
     if (scheme.isNull())
         return;
@@ -440,7 +440,7 @@ void SchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy(const Str
     ContentSecurityPolicyBypassingSchemes().add(scheme);
 }
 
-void SchemeRegistry::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(const String& scheme)
+void LegacySchemeRegistry::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(const String& scheme)
 {
     if (scheme.isNull())
         return;
@@ -449,7 +449,7 @@ void SchemeRegistry::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(c
     ContentSecurityPolicyBypassingSchemes().remove(scheme);
 }
 
-bool SchemeRegistry::schemeShouldBypassContentSecurityPolicy(const String& scheme)
+bool LegacySchemeRegistry::schemeShouldBypassContentSecurityPolicy(const String& scheme)
 {
     if (scheme.isNull())
         return false;
@@ -458,19 +458,19 @@ bool SchemeRegistry::schemeShouldBypassContentSecurityPolicy(const String& schem
     return ContentSecurityPolicyBypassingSchemes().contains(scheme);
 }
 
-void SchemeRegistry::registerURLSchemeAsAlwaysRevalidated(const String& scheme)
+void LegacySchemeRegistry::registerURLSchemeAsAlwaysRevalidated(const String& scheme)
 {
     if (scheme.isNull())
         return;
     alwaysRevalidatedSchemes().add(scheme);
 }
 
-bool SchemeRegistry::shouldAlwaysRevalidateURLScheme(const String& scheme)
+bool LegacySchemeRegistry::shouldAlwaysRevalidateURLScheme(const String& scheme)
 {
     return !scheme.isNull() && alwaysRevalidatedSchemes().contains(scheme);
 }
 
-void SchemeRegistry::registerURLSchemeAsCachePartitioned(const String& scheme)
+void LegacySchemeRegistry::registerURLSchemeAsCachePartitioned(const String& scheme)
 {
     if (scheme.isNull())
         return;
@@ -479,7 +479,7 @@ void SchemeRegistry::registerURLSchemeAsCachePartitioned(const String& scheme)
     cachePartitioningSchemes().add(scheme);
 }
 
-bool SchemeRegistry::shouldPartitionCacheForURLScheme(const String& scheme)
+bool LegacySchemeRegistry::shouldPartitionCacheForURLScheme(const String& scheme)
 {
     if (scheme.isNull())
         return false;
@@ -488,7 +488,7 @@ bool SchemeRegistry::shouldPartitionCacheForURLScheme(const String& scheme)
     return cachePartitioningSchemes().contains(scheme);
 }
 
-void SchemeRegistry::registerURLSchemeServiceWorkersCanHandle(const String& scheme)
+void LegacySchemeRegistry::registerURLSchemeServiceWorkersCanHandle(const String& scheme)
 {
     if (scheme.isNull())
         return;
@@ -497,7 +497,7 @@ void SchemeRegistry::registerURLSchemeServiceWorkersCanHandle(const String& sche
     serviceWorkerSchemes().add(scheme);
 }
 
-bool SchemeRegistry::canServiceWorkersHandleURLScheme(const String& scheme)
+bool LegacySchemeRegistry::canServiceWorkersHandleURLScheme(const String& scheme)
 {
     if (scheme.isNull())
         return false;
@@ -513,13 +513,13 @@ bool SchemeRegistry::canServiceWorkersHandleURLScheme(const String& scheme)
     return serviceWorkerSchemes().contains(scheme);
 }
 
-bool SchemeRegistry::isServiceWorkerContainerCustomScheme(const String& scheme)
+bool LegacySchemeRegistry::isServiceWorkerContainerCustomScheme(const String& scheme)
 {
     Locker<Lock> locker(schemeRegistryLock);
     return !scheme.isNull() && serviceWorkerSchemes().contains(scheme);
 }
 
-bool SchemeRegistry::isUserExtensionScheme(const String& scheme)
+bool LegacySchemeRegistry::isUserExtensionScheme(const String& scheme)
 {
 #if PLATFORM(MAC)
     if (scheme == "safari-extension")
@@ -530,7 +530,7 @@ bool SchemeRegistry::isUserExtensionScheme(const String& scheme)
     return false;
 }
 
-bool SchemeRegistry::isBuiltinScheme(const String& scheme)
+bool LegacySchemeRegistry::isBuiltinScheme(const String& scheme)
 {
     return !scheme.isNull() && (allBuiltinSchemes().contains(scheme) || WTF::URLParser::isSpecialScheme(scheme));
 }
similarity index 99%
rename from Source/WebCore/platform/SchemeRegistry.h
rename to Source/WebCore/platform/LegacySchemeRegistry.h
index cf93e7b..273c5b1 100644 (file)
@@ -35,7 +35,7 @@ namespace WebCore {
 // FIXME: Make HashSet<String>::contains(StringView) work and use StringViews here.
 using URLSchemesMap = HashSet<String, ASCIICaseInsensitiveHash>;
 
-class SchemeRegistry {
+class LegacySchemeRegistry {
 public:
     WEBCORE_EXPORT static void registerURLSchemeAsLocal(const String&); // Thread safe.
     static void removeURLSchemeRegisteredAsLocal(const String&); // Thread safe.
index c2b5a0b..15ae2ff 100644 (file)
@@ -30,7 +30,6 @@
 
 #import "PreviewConverter.h"
 #import "ResourceRequest.h"
-#import "SchemeRegistry.h"
 #import <pal/ios/QuickLookSoftLink.h>
 #import <pal/spi/cocoa/NSFileManagerSPI.h>
 #import <wtf/FileSystem.h>
index 47dbb17..6c939af 100644 (file)
@@ -28,8 +28,8 @@
 
 #include "Document.h"
 #include "Frame.h"
+#include "LegacySchemeRegistry.h"
 #include "Page.h"
-#include "SchemeRegistry.h"
 #include "SecurityOrigin.h"
 #include "StorageArea.h"
 #include "StorageType.h"
index 1807870..ff40969 100644 (file)
 #include "InternalSettings.h"
 #include "JSDOMPromiseDeferred.h"
 #include "JSImageData.h"
+#include "LegacySchemeRegistry.h"
 #include "LibWebRTCProvider.h"
 #include "LoaderStrategy.h"
 #include "MallocStatistics.h"
 #include "SVGPathStringBuilder.h"
 #include "SVGSVGElement.h"
 #include "SWClientConnection.h"
-#include "SchemeRegistry.h"
 #include "ScriptedAnimationController.h"
 #include "ScrollingCoordinator.h"
 #include "ScrollingMomentumCalculator.h"
@@ -3173,12 +3173,12 @@ void Internals::setApplicationCacheOriginQuota(unsigned long long quota)
 
 void Internals::registerURLSchemeAsBypassingContentSecurityPolicy(const String& scheme)
 {
-    SchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy(scheme);
+    LegacySchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy(scheme);
 }
 
 void Internals::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(const String& scheme)
 {
-    SchemeRegistry::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(scheme);
+    LegacySchemeRegistry::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(scheme);
 }
 
 void Internals::registerDefaultPortForProtocol(unsigned short port, const String& protocol)
index 6d807eb..310e40f 100644 (file)
 #include "IDLTypes.h"
 #include "JSDOMPromiseDeferred.h"
 #include "JSServiceWorkerRegistration.h"
+#include "LegacySchemeRegistry.h"
 #include "Logging.h"
 #include "MessageEvent.h"
 #include "NavigatorBase.h"
 #include "ResourceError.h"
-#include "SchemeRegistry.h"
 #include "ScriptExecutionContext.h"
 #include "SecurityOrigin.h"
 #include "ServiceWorker.h"
@@ -146,7 +146,7 @@ void ServiceWorkerContainer::addRegistration(const String& relativeScriptURL, co
         return;
     }
 
-    if (!SchemeRegistry::canServiceWorkersHandleURLScheme(jobData.scriptURL.protocol().toStringWithoutCopying())) {
+    if (!LegacySchemeRegistry::canServiceWorkersHandleURLScheme(jobData.scriptURL.protocol().toStringWithoutCopying())) {
         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 @@ void ServiceWorkerContainer::addRegistration(const String& relativeScriptURL, co
     else
         jobData.scopeURL = URL(jobData.scriptURL, "./");
 
-    if (!jobData.scopeURL.isNull() && !SchemeRegistry::canServiceWorkersHandleURLScheme(jobData.scopeURL.protocol().toStringWithoutCopying())) {
+    if (!jobData.scopeURL.isNull() && !LegacySchemeRegistry::canServiceWorkersHandleURLScheme(jobData.scopeURL.protocol().toStringWithoutCopying())) {
         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;
index eed266d..a713454 100644 (file)
@@ -29,8 +29,8 @@
 #if ENABLE(SERVICE_WORKER)
 
 #include "Document.h"
+#include "LegacySchemeRegistry.h"
 #include "SWClientConnection.h"
-#include "SchemeRegistry.h"
 
 namespace WebCore {
 
@@ -64,7 +64,7 @@ void ServiceWorkerProvider::registerServiceWorkerClients()
 {
     setMayHaveRegisteredServiceWorkers();
     for (auto* document : Document::allDocuments()) {
-        if (SchemeRegistry::canServiceWorkersHandleURLScheme(document->url().protocol().toStringWithoutCopying()))
+        if (LegacySchemeRegistry::canServiceWorkersHandleURLScheme(document->url().protocol().toStringWithoutCopying()))
             document->setServiceWorkerConnection(&serviceWorkerConnection());
     }
 }
index 503e328..778ae7d 100644 (file)
@@ -32,7 +32,6 @@
 #include "SWServer.h"
 #include "SWServerRegistration.h"
 #include "SWServerWorker.h"
-#include "SchemeRegistry.h"
 #include "SecurityOrigin.h"
 #include "ServiceWorkerFetchResult.h"
 #include "ServiceWorkerRegistrationData.h"
index a178800..689c672 100644 (file)
@@ -1,3 +1,47 @@
+2019-10-04  Alex Christensen  <achristensen@webkit.org>
+
+        Rename SchemeRegistry to LegacySchemeRegistry
+        https://bugs.webkit.org/show_bug.cgi?id=202586
+
+        Reviewed by Tim Horton.
+
+        * NetworkProcess/NetworkLoadChecker.cpp:
+        (WebKit::NetworkLoadChecker::doesNotNeedCORSCheck const):
+        * NetworkProcess/NetworkProcess.cpp:
+        (WebKit::NetworkProcess::registerURLSchemeAsSecure const):
+        (WebKit::NetworkProcess::registerURLSchemeAsBypassingContentSecurityPolicy const):
+        (WebKit::NetworkProcess::registerURLSchemeAsLocal const):
+        (WebKit::NetworkProcess::registerURLSchemeAsNoAccess const):
+        (WebKit::NetworkProcess::registerURLSchemeAsDisplayIsolated const):
+        (WebKit::NetworkProcess::registerURLSchemeAsCORSEnabled const):
+        (WebKit::NetworkProcess::registerURLSchemeAsCanDisplayOnlyIfCanRequest const):
+        * Shared/AuxiliaryProcess.cpp:
+        (WebKit::AuxiliaryProcess::registerURLSchemeServiceWorkersCanHandle const):
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (+[WKWebView handlesURLScheme:]):
+        * UIProcess/API/glib/WebKitSecurityManager.cpp:
+        (registerSecurityPolicyForURIScheme):
+        (checkSecurityPolicyForURIScheme):
+        * WebProcess/Plugins/WebPluginInfoProvider.cpp:
+        (WebKit::WebPluginInfoProvider::webVisiblePluginInfo):
+        * WebProcess/Storage/WebServiceWorkerProvider.cpp:
+        (WebKit::WebServiceWorkerProvider::handleFetch):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::canHandleRequest):
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::registerURLSchemeAsEmptyDocument):
+        (WebKit::WebProcess::registerURLSchemeAsSecure const):
+        (WebKit::WebProcess::registerURLSchemeAsBypassingContentSecurityPolicy const):
+        (WebKit::WebProcess::setDomainRelaxationForbiddenForURLScheme const):
+        (WebKit::WebProcess::registerURLSchemeAsLocal const):
+        (WebKit::WebProcess::registerURLSchemeAsNoAccess const):
+        (WebKit::WebProcess::registerURLSchemeAsDisplayIsolated const):
+        (WebKit::WebProcess::registerURLSchemeAsCORSEnabled const):
+        (WebKit::WebProcess::registerURLSchemeAsAlwaysRevalidated const):
+        (WebKit::WebProcess::registerURLSchemeAsCachePartitioned const):
+        (WebKit::WebProcess::registerURLSchemeAsCanDisplayOnlyIfCanRequest const):
+        * WebProcess/WebStorage/StorageAreaImpl.cpp:
+
 2019-10-04  Jiewen Tan  <jiewen_tan@apple.com>
 
         [WebAuthn] Implement _WKWebAuthenticationPanel SPI
index e163767..dc9fd8f 100644 (file)
@@ -34,7 +34,7 @@
 #include <WebCore/ContentSecurityPolicy.h>
 #include <WebCore/CrossOriginAccessControl.h>
 #include <WebCore/CrossOriginPreflightResultCache.h>
-#include <WebCore/SchemeRegistry.h>
+#include <WebCore/LegacySchemeRegistry.h>
 #include <wtf/Scope.h>
 
 #define RELEASE_LOG_IF_ALLOWED(fmt, ...) RELEASE_LOG_IF(m_sessionID.isAlwaysOnLoggingAllowed(), Network, "%p - NetworkLoadChecker::" fmt, this, ##__VA_ARGS__)
@@ -436,7 +436,7 @@ bool NetworkLoadChecker::doesNotNeedCORSCheck(const URL& url) const
     if (m_options.mode == FetchOptions::Mode::NoCors || m_options.mode == FetchOptions::Mode::Navigate)
         return true;
 
-    if (!SchemeRegistry::shouldTreatURLSchemeAsCORSEnabled(url.protocol().toStringWithoutCopying()))
+    if (!LegacySchemeRegistry::shouldTreatURLSchemeAsCORSEnabled(url.protocol().toStringWithoutCopying()))
         return true;
 
     return m_isSameOriginRequest;
index b430488..6e9b400 100644 (file)
@@ -69,6 +69,7 @@
 #include <WebCore/DNS.h>
 #include <WebCore/DeprecatedGlobalSettings.h>
 #include <WebCore/DiagnosticLoggingClient.h>
+#include <WebCore/LegacySchemeRegistry.h>
 #include <WebCore/LogInitialization.h>
 #include <WebCore/MIMETypeRegistry.h>
 #include <WebCore/NetworkStateNotifier.h>
@@ -76,7 +77,6 @@
 #include <WebCore/ResourceRequest.h>
 #include <WebCore/RuntimeApplicationChecks.h>
 #include <WebCore/RuntimeEnabledFeatures.h>
-#include <WebCore/SchemeRegistry.h>
 #include <WebCore/SecurityOriginData.h>
 #include <WebCore/StorageQuotaManager.h>
 #include <wtf/Algorithms.h>
@@ -2203,37 +2203,37 @@ void NetworkProcess::setCacheStorageParameters(PAL::SessionID sessionID, String&
 
 void NetworkProcess::registerURLSchemeAsSecure(const String& scheme) const
 {
-    SchemeRegistry::registerURLSchemeAsSecure(scheme);
+    LegacySchemeRegistry::registerURLSchemeAsSecure(scheme);
 }
 
 void NetworkProcess::registerURLSchemeAsBypassingContentSecurityPolicy(const String& scheme) const
 {
-    SchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy(scheme);
+    LegacySchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy(scheme);
 }
 
 void NetworkProcess::registerURLSchemeAsLocal(const String& scheme) const
 {
-    SchemeRegistry::registerURLSchemeAsLocal(scheme);
+    LegacySchemeRegistry::registerURLSchemeAsLocal(scheme);
 }
 
 void NetworkProcess::registerURLSchemeAsNoAccess(const String& scheme) const
 {
-    SchemeRegistry::registerURLSchemeAsNoAccess(scheme);
+    LegacySchemeRegistry::registerURLSchemeAsNoAccess(scheme);
 }
 
 void NetworkProcess::registerURLSchemeAsDisplayIsolated(const String& scheme) const
 {
-    SchemeRegistry::registerURLSchemeAsDisplayIsolated(scheme);
+    LegacySchemeRegistry::registerURLSchemeAsDisplayIsolated(scheme);
 }
 
 void NetworkProcess::registerURLSchemeAsCORSEnabled(const String& scheme) const
 {
-    SchemeRegistry::registerURLSchemeAsCORSEnabled(scheme);
+    LegacySchemeRegistry::registerURLSchemeAsCORSEnabled(scheme);
 }
 
 void NetworkProcess::registerURLSchemeAsCanDisplayOnlyIfCanRequest(const String& scheme) const
 {
-    SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest(scheme);
+    LegacySchemeRegistry::registerAsCanDisplayOnlyIfCanRequest(scheme);
 }
 
 void NetworkProcess::didSyncAllCookies()
index 14ea5e4..02cb76c 100644 (file)
@@ -28,7 +28,6 @@
 
 #include "Logging.h"
 #include "SandboxInitializationParameters.h"
-#include <WebCore/SchemeRegistry.h>
 #include <pal/SessionID.h>
 
 #if !OS(WINDOWS)
index 7ec1c0c..4fec750 100644 (file)
 #import <WebCore/IOSurface.h>
 #import <WebCore/JSDOMBinding.h>
 #import <WebCore/JSDOMExceptionHandling.h>
+#import <WebCore/LegacySchemeRegistry.h>
 #import <WebCore/MIMETypeRegistry.h>
 #import <WebCore/PlatformScreen.h>
 #import <WebCore/RuntimeApplicationChecks.h>
 #import <WebCore/SQLiteDatabaseTracker.h>
-#import <WebCore/SchemeRegistry.h>
 #import <WebCore/Settings.h>
 #import <WebCore/SharedBuffer.h>
 #import <WebCore/StringUtilities.h>
@@ -4651,7 +4651,7 @@ ALLOW_DEPRECATED_IMPLEMENTATIONS_END
 
 + (BOOL)handlesURLScheme:(NSString *)urlScheme
 {
-    return WebCore::SchemeRegistry::isBuiltinScheme(urlScheme);
+    return WebCore::LegacySchemeRegistry::isBuiltinScheme(urlScheme);
 }
 
 - (Optional<BOOL>)_resolutionForShareSheetImmediateCompletionForTesting
index eb5feea..437a250 100644 (file)
@@ -23,7 +23,7 @@
 #include "WebKitSecurityManagerPrivate.h"
 #include "WebKitWebContextPrivate.h"
 #include "WebProcessPool.h"
-#include <WebCore/SchemeRegistry.h>
+#include <WebCore/LegacySchemeRegistry.h>
 #include <wtf/glib/WTFGType.h>
 
 using namespace WebKit;
@@ -72,32 +72,32 @@ static void registerSecurityPolicyForURIScheme(WebKitSecurityManager* manager, c
     String urlScheme = String::fromUTF8(scheme);
     auto& processPool = webkitWebContextGetProcessPool(manager->priv->webContext);
 
-    // We keep the WebCore::SchemeRegistry of the UI process in sync with the
+    // We keep the WebCore::LegacySchemeRegistry of the UI process in sync with the
     // web process one, so that we can return the SecurityPolicy for
     // a given URI scheme synchronously without blocking.
     switch (policy) {
     case SecurityPolicyLocal:
-        WebCore::SchemeRegistry::registerURLSchemeAsLocal(urlScheme);
+        WebCore::LegacySchemeRegistry::registerURLSchemeAsLocal(urlScheme);
         processPool.registerURLSchemeAsLocal(urlScheme);
         break;
     case SecurityPolicyNoAccess:
-        WebCore::SchemeRegistry::registerURLSchemeAsNoAccess(urlScheme);
+        WebCore::LegacySchemeRegistry::registerURLSchemeAsNoAccess(urlScheme);
         processPool.registerURLSchemeAsNoAccess(urlScheme);
         break;
     case SecurityPolicyDisplayIsolated:
-        WebCore::SchemeRegistry::registerURLSchemeAsDisplayIsolated(urlScheme);
+        WebCore::LegacySchemeRegistry::registerURLSchemeAsDisplayIsolated(urlScheme);
         processPool.registerURLSchemeAsDisplayIsolated(urlScheme);
         break;
     case SecurityPolicySecure:
-        WebCore::SchemeRegistry::registerURLSchemeAsSecure(urlScheme);
+        WebCore::LegacySchemeRegistry::registerURLSchemeAsSecure(urlScheme);
         processPool.registerURLSchemeAsSecure(urlScheme);
         break;
     case SecurityPolicyCORSEnabled:
-        WebCore::SchemeRegistry::registerURLSchemeAsCORSEnabled(urlScheme);
+        WebCore::LegacySchemeRegistry::registerURLSchemeAsCORSEnabled(urlScheme);
         processPool.registerURLSchemeAsCORSEnabled(urlScheme);
         break;
     case SecurityPolicyEmptyDocument:
-        WebCore::SchemeRegistry::registerURLSchemeAsEmptyDocument(urlScheme);
+        WebCore::LegacySchemeRegistry::registerURLSchemeAsEmptyDocument(urlScheme);
         processPool.registerURLSchemeAsEmptyDocument(urlScheme);
         break;
     }
@@ -109,17 +109,17 @@ static bool checkSecurityPolicyForURIScheme(const char* scheme, SecurityPolicy p
 
     switch (policy) {
     case SecurityPolicyLocal:
-        return WebCore::SchemeRegistry::shouldTreatURLSchemeAsLocal(urlScheme);
+        return WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsLocal(urlScheme);
     case SecurityPolicyNoAccess:
-        return WebCore::SchemeRegistry::shouldTreatURLSchemeAsNoAccess(urlScheme);
+        return WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsNoAccess(urlScheme);
     case SecurityPolicyDisplayIsolated:
-        return WebCore::SchemeRegistry::shouldTreatURLSchemeAsDisplayIsolated(urlScheme);
+        return WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsDisplayIsolated(urlScheme);
     case SecurityPolicySecure:
-        return WebCore::SchemeRegistry::shouldTreatURLSchemeAsSecure(urlScheme);
+        return WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsSecure(urlScheme);
     case SecurityPolicyCORSEnabled:
-        return WebCore::SchemeRegistry::shouldTreatURLSchemeAsCORSEnabled(urlScheme);
+        return WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsCORSEnabled(urlScheme);
     case SecurityPolicyEmptyDocument:
-        return WebCore::SchemeRegistry::shouldLoadURLSchemeAsEmptyDocument(urlScheme);
+        return WebCore::LegacySchemeRegistry::shouldLoadURLSchemeAsEmptyDocument(urlScheme);
     }
 
     return false;
index 6c1fdb1..b3574ca 100644 (file)
@@ -34,8 +34,8 @@
 #include <WebCore/DocumentLoader.h>
 #include <WebCore/Frame.h>
 #include <WebCore/FrameLoader.h>
+#include <WebCore/LegacySchemeRegistry.h>
 #include <WebCore/Page.h>
-#include <WebCore/SchemeRegistry.h>
 #include <WebCore/Settings.h>
 #include <WebCore/SubframeLoader.h>
 #include <wtf/text/StringHash.h>
@@ -126,7 +126,7 @@ Vector<WebCore::PluginInfo> WebPluginInfoProvider::webVisiblePluginInfo(Page& pa
     });
 
 #if PLATFORM(MAC)
-    if (SchemeRegistry::shouldTreatURLSchemeAsLocal(url.protocol().toString()))
+    if (LegacySchemeRegistry::shouldTreatURLSchemeAsLocal(url.protocol().toString()))
         return plugins;
 
     for (int32_t i = plugins.size() - 1; i >= 0; --i) {
index c5047fa..62a39b2 100644 (file)
@@ -35,7 +35,7 @@
 #include <WebCore/CachedResource.h>
 #include <WebCore/Exception.h>
 #include <WebCore/ExceptionCode.h>
-#include <WebCore/SchemeRegistry.h>
+#include <WebCore/LegacySchemeRegistry.h>
 #include <WebCore/ServiceWorkerJob.h>
 #include <wtf/text/WTFString.h>
 
@@ -79,7 +79,7 @@ static inline bool shouldHandleFetch(const ResourceLoaderOptions& options)
 
 void WebServiceWorkerProvider::handleFetch(ResourceLoader& loader, bool shouldClearReferrerOnHTTPSToHTTPRedirect, ServiceWorkerClientFetch::Callback&& callback)
 {
-    if (!SchemeRegistry::canServiceWorkersHandleURLScheme(loader.request().url().protocol().toStringWithoutCopying()) || !shouldHandleFetch(loader.options())) {
+    if (!LegacySchemeRegistry::canServiceWorkersHandleURLScheme(loader.request().url().protocol().toStringWithoutCopying()) || !shouldHandleFetch(loader.options())) {
         callback(ServiceWorkerClientFetch::Result::Unhandled);
         return;
     }
index 881f778..210a46e 100644 (file)
 #include <WebCore/JSDOMExceptionHandling.h>
 #include <WebCore/JSDOMWindow.h>
 #include <WebCore/KeyboardEvent.h>
+#include <WebCore/LegacySchemeRegistry.h>
 #include <WebCore/LocalizedStrings.h>
 #include <WebCore/MIMETypeRegistry.h>
 #include <WebCore/MouseEvent.h>
 #include <WebCore/ResourceResponse.h>
 #include <WebCore/RuntimeEnabledFeatures.h>
 #include <WebCore/SWClientConnection.h>
-#include <WebCore/SchemeRegistry.h>
 #include <WebCore/ScriptController.h>
 #include <WebCore/SerializedScriptValue.h>
 #include <WebCore/ServiceWorkerProvider.h>
@@ -4966,7 +4966,7 @@ void WebPage::runModal()
 
 bool WebPage::canHandleRequest(const WebCore::ResourceRequest& request)
 {
-    if (SchemeRegistry::shouldLoadURLSchemeAsEmptyDocument(request.url().protocol().toStringWithoutCopying()))
+    if (LegacySchemeRegistry::shouldLoadURLSchemeAsEmptyDocument(request.url().protocol().toStringWithoutCopying()))
         return true;
 
     if (request.url().protocolIsBlob())
index e9af2c7..340c9c4 100644 (file)
 #include <WebCore/GlyphPage.h>
 #include <WebCore/HTMLMediaElement.h>
 #include <WebCore/JSDOMWindow.h>
+#include <WebCore/LegacySchemeRegistry.h>
 #include <WebCore/MemoryCache.h>
 #include <WebCore/MemoryRelease.h>
 #include <WebCore/MessagePort.h>
 #include <WebCore/ResourceLoadStatistics.h>
 #include <WebCore/RuntimeApplicationChecks.h>
 #include <WebCore/RuntimeEnabledFeatures.h>
-#include <WebCore/SchemeRegistry.h>
 #include <WebCore/SecurityOrigin.h>
 #include <WebCore/ServiceWorkerContextData.h>
 #include <WebCore/Settings.h>
@@ -379,7 +379,7 @@ void WebProcess::initializeWebProcess(WebProcessCreationParameters&& parameters)
         registerURLSchemeAsCachePartitioned(scheme);
 
     for (auto& scheme : parameters.urlSchemesServiceWorkersCanHandle)
-        WebCore::SchemeRegistry::registerURLSchemeServiceWorkersCanHandle(scheme);
+        WebCore::LegacySchemeRegistry::registerURLSchemeServiceWorkersCanHandle(scheme);
 
     for (auto& scheme : parameters.urlSchemesRegisteredAsCanDisplayOnlyIfCanRequest)
         registerURLSchemeAsCanDisplayOnlyIfCanRequest(scheme);
@@ -532,57 +532,57 @@ void WebProcess::prewarmWithDomainInformation(const WebCore::PrewarmInformation&
 
 void WebProcess::registerURLSchemeAsEmptyDocument(const String& urlScheme)
 {
-    SchemeRegistry::registerURLSchemeAsEmptyDocument(urlScheme);
+    LegacySchemeRegistry::registerURLSchemeAsEmptyDocument(urlScheme);
 }
 
 void WebProcess::registerURLSchemeAsSecure(const String& urlScheme) const
 {
-    SchemeRegistry::registerURLSchemeAsSecure(urlScheme);
+    LegacySchemeRegistry::registerURLSchemeAsSecure(urlScheme);
 }
 
 void WebProcess::registerURLSchemeAsBypassingContentSecurityPolicy(const String& urlScheme) const
 {
-    SchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy(urlScheme);
+    LegacySchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy(urlScheme);
 }
 
 void WebProcess::setDomainRelaxationForbiddenForURLScheme(const String& urlScheme) const
 {
-    SchemeRegistry::setDomainRelaxationForbiddenForURLScheme(true, urlScheme);
+    LegacySchemeRegistry::setDomainRelaxationForbiddenForURLScheme(true, urlScheme);
 }
 
 void WebProcess::registerURLSchemeAsLocal(const String& urlScheme) const
 {
-    SchemeRegistry::registerURLSchemeAsLocal(urlScheme);
+    LegacySchemeRegistry::registerURLSchemeAsLocal(urlScheme);
 }
 
 void WebProcess::registerURLSchemeAsNoAccess(const String& urlScheme) const
 {
-    SchemeRegistry::registerURLSchemeAsNoAccess(urlScheme);
+    LegacySchemeRegistry::registerURLSchemeAsNoAccess(urlScheme);
 }
 
 void WebProcess::registerURLSchemeAsDisplayIsolated(const String& urlScheme) const
 {
-    SchemeRegistry::registerURLSchemeAsDisplayIsolated(urlScheme);
+    LegacySchemeRegistry::registerURLSchemeAsDisplayIsolated(urlScheme);
 }
 
 void WebProcess::registerURLSchemeAsCORSEnabled(const String& urlScheme) const
 {
-    SchemeRegistry::registerURLSchemeAsCORSEnabled(urlScheme);
+    LegacySchemeRegistry::registerURLSchemeAsCORSEnabled(urlScheme);
 }
 
 void WebProcess::registerURLSchemeAsAlwaysRevalidated(const String& urlScheme) const
 {
-    SchemeRegistry::registerURLSchemeAsAlwaysRevalidated(urlScheme);
+    LegacySchemeRegistry::registerURLSchemeAsAlwaysRevalidated(urlScheme);
 }
 
 void WebProcess::registerURLSchemeAsCachePartitioned(const String& urlScheme) const
 {
-    SchemeRegistry::registerURLSchemeAsCachePartitioned(urlScheme);
+    LegacySchemeRegistry::registerURLSchemeAsCachePartitioned(urlScheme);
 }
 
 void WebProcess::registerURLSchemeAsCanDisplayOnlyIfCanRequest(const String& urlScheme) const
 {
-    SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest(urlScheme);
+    LegacySchemeRegistry::registerAsCanDisplayOnlyIfCanRequest(urlScheme);
 }
 
 void WebProcess::setDefaultRequestTimeoutInterval(double timeoutInterval)
index 11bc621..bd3a13b 100644 (file)
@@ -30,7 +30,6 @@
 #include <WebCore/Document.h>
 #include <WebCore/Frame.h>
 #include <WebCore/Page.h>
-#include <WebCore/SchemeRegistry.h>
 #include <WebCore/SecurityOriginData.h>
 #include <WebCore/Settings.h>
 #include <WebCore/StorageType.h>
index 9ab3052..8519d3c 100644 (file)
@@ -1,5 +1,18 @@
 2019-10-04  Alex Christensen  <achristensen@webkit.org>
 
+        Rename SchemeRegistry to LegacySchemeRegistry
+        https://bugs.webkit.org/show_bug.cgi?id=202586
+
+        Reviewed by Tim Horton.
+
+        * WebView/WebView.mm:
+        (+[WebView _setDomainRelaxationForbidden:forURLScheme:]):
+        (+[WebView _registerURLSchemeAsSecure:]):
+        (+[WebView _registerURLSchemeAsAllowingDatabaseAccessInPrivateBrowsing:]):
+        (+[WebView registerURLSchemeAsLocal:]):
+
+2019-10-04  Alex Christensen  <achristensen@webkit.org>
+
         Simplify sandbox enabling macros
         https://bugs.webkit.org/show_bug.cgi?id=202536
 
index d8dacd9..11c683e 100644 (file)
 #import <WebCore/JSNodeList.h>
 #import <WebCore/JSNotification.h>
 #import <WebCore/LegacyNSPasteboardTypes.h>
+#import <WebCore/LegacySchemeRegistry.h>
 #import <WebCore/LibWebRTCProvider.h>
 #import <WebCore/LocalizedStrings.h>
 #import <WebCore/LogInitialization.h>
 #import <WebCore/ResourceRequest.h>
 #import <WebCore/RuntimeApplicationChecks.h>
 #import <WebCore/RuntimeEnabledFeatures.h>
-#import <WebCore/SchemeRegistry.h>
 #import <WebCore/ScriptController.h>
 #import <WebCore/SecurityOrigin.h>
 #import <WebCore/SecurityPolicy.h>
@@ -4777,12 +4777,12 @@ static Vector<String> toStringVector(NSArray* patterns)
 
 + (void)_setDomainRelaxationForbidden:(BOOL)forbidden forURLScheme:(NSString *)scheme
 {
-    WebCore::SchemeRegistry::setDomainRelaxationForbiddenForURLScheme(forbidden, scheme);
+    WebCore::LegacySchemeRegistry::setDomainRelaxationForbiddenForURLScheme(forbidden, scheme);
 }
 
 + (void)_registerURLSchemeAsSecure:(NSString *)scheme
 {
-    WebCore::SchemeRegistry::registerURLSchemeAsSecure(scheme);
+    WebCore::LegacySchemeRegistry::registerURLSchemeAsSecure(scheme);
 }
 
 + (void)_registerURLSchemeAsAllowingLocalStorageAccessInPrivateBrowsing:(NSString *)scheme
@@ -4791,7 +4791,7 @@ static Vector<String> toStringVector(NSArray* patterns)
 
 + (void)_registerURLSchemeAsAllowingDatabaseAccessInPrivateBrowsing:(NSString *)scheme
 {
-    WebCore::SchemeRegistry::registerURLSchemeAsAllowingDatabaseAccessInPrivateBrowsing(scheme);
+    WebCore::LegacySchemeRegistry::registerURLSchemeAsAllowingDatabaseAccessInPrivateBrowsing(scheme);
 }
 
 - (void)_scaleWebView:(float)scale atOrigin:(NSPoint)origin
@@ -5670,7 +5670,7 @@ static Vector<String> toStringVector(NSArray* patterns)
 
 + (void)registerURLSchemeAsLocal:(NSString *)protocol
 {
-    WebCore::SchemeRegistry::registerURLSchemeAsLocal(protocol);
+    WebCore::LegacySchemeRegistry::registerURLSchemeAsLocal(protocol);
 }
 
 - (id)_initWithArguments:(NSDictionary *) arguments
index dce9dc3..f9710bc 100644 (file)
@@ -1,3 +1,16 @@
+2019-10-04  Alex Christensen  <achristensen@webkit.org>
+
+        Rename SchemeRegistry to LegacySchemeRegistry
+        https://bugs.webkit.org/show_bug.cgi?id=202586
+
+        Reviewed by Tim Horton.
+
+        * WebView.cpp:
+        (WebView::registerURLSchemeAsLocal):
+        (WebView::setDomainRelaxationForbiddenForURLScheme):
+        (WebView::registerURLSchemeAsSecure):
+        (WebView::registerURLSchemeAsAllowingDatabaseAccessInPrivateBrowsing):
+
 2019-09-27  Chris Dumez  <cdumez@apple.com>
 
         Pages using WebGLRenderingContext fail to enter the back/forward cache
index eeb49ae..713088e 100644 (file)
 #include <WebCore/IntRect.h>
 #include <WebCore/JSElement.h>
 #include <WebCore/KeyboardEvent.h>
+#include <WebCore/LegacySchemeRegistry.h>
 #include <WebCore/LibWebRTCProvider.h>
 #include <WebCore/LogInitialization.h>
 #include <WebCore/Logging.h>
 #include <WebCore/ResourceHandleClient.h>
 #include <WebCore/ResourceRequest.h>
 #include <WebCore/RuntimeEnabledFeatures.h>
-#include <WebCore/SchemeRegistry.h>
 #include <WebCore/ScriptController.h>
 #include <WebCore/Scrollbar.h>
 #include <WebCore/ScrollbarTheme.h>
@@ -4240,7 +4240,7 @@ HRESULT WebView::registerURLSchemeAsLocal(_In_ BSTR scheme)
     if (!scheme)
         return E_POINTER;
 
-    SchemeRegistry::registerURLSchemeAsLocal(toString(scheme));
+    LegacySchemeRegistry::registerURLSchemeAsLocal(toString(scheme));
 
     return S_OK;
 }
@@ -7327,13 +7327,13 @@ HRESULT WebView::geolocationDidFailWithError(_In_opt_ IWebError* error)
 
 HRESULT WebView::setDomainRelaxationForbiddenForURLScheme(BOOL forbidden, _In_ BSTR scheme)
 {
-    SchemeRegistry::setDomainRelaxationForbiddenForURLScheme(forbidden, toString(scheme));
+    LegacySchemeRegistry::setDomainRelaxationForbiddenForURLScheme(forbidden, toString(scheme));
     return S_OK;
 }
 
 HRESULT WebView::registerURLSchemeAsSecure(_In_ BSTR scheme)
 {
-    SchemeRegistry::registerURLSchemeAsSecure(toString(scheme));
+    LegacySchemeRegistry::registerURLSchemeAsSecure(toString(scheme));
     return S_OK;
 }
 
@@ -7344,7 +7344,7 @@ HRESULT WebView::registerURLSchemeAsAllowingLocalStorageAccessInPrivateBrowsing(
 
 HRESULT WebView::registerURLSchemeAsAllowingDatabaseAccessInPrivateBrowsing(_In_ BSTR scheme)
 {
-    SchemeRegistry::registerURLSchemeAsAllowingDatabaseAccessInPrivateBrowsing(toString(scheme));
+    LegacySchemeRegistry::registerURLSchemeAsAllowingDatabaseAccessInPrivateBrowsing(toString(scheme));
     return S_OK;
 }