Rename SchemeRegistry to LegacySchemeRegistry
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: http://svn.webkit.org/repository/webkit/trunk@250738 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/loader/DocumentThreadableLoader.cpp b/Source/WebCore/loader/DocumentThreadableLoader.cpp
index a9bf4b7..31e3184 100644
--- a/Source/WebCore/loader/DocumentThreadableLoader.cpp
+++ b/Source/WebCore/loader/DocumentThreadableLoader.cpp
@@ -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 @@
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 @@
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;
}