WebKit Bugzilla
Attachment 356272 Details for
Bug 190234
: Move URL from WebCore to WTF
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for landing
bug-190234-20181130173516.patch (text/plain), 1.25 MB, created by
Keith Miller
on 2018-11-30 17:35:17 PST
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Keith Miller
Created:
2018-11-30 17:35:17 PST
Size:
1.25 MB
patch
obsolete
>Subversion Revision: 238752 >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index 70e6d327c7182ea8d96268fc2af473dd2952251b..4af252ba5896eea6127d0e316c9289270f5b42ad 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,80 @@ >+2018-11-30 Alex Christensen <achristensen@webkit.org> >+ >+ Move URL from WebCore to WTF >+ https://bugs.webkit.org/show_bug.cgi?id=190234 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WTF.xcodeproj/project.pbxproj: >+ * wtf/CMakeLists.txt: >+ * wtf/Forward.h: >+ * wtf/PlatformGTK.cmake: >+ * wtf/PlatformMac.cmake: >+ * wtf/PlatformWPE.cmake: >+ * wtf/PlatformWin.cmake: >+ * wtf/URL.cpp: Renamed from Source/WebCore/platform/URL.cpp. >+ (WTF::URL::protocolIs): >+ * wtf/URL.h: Renamed from Source/WebCore/platform/URL.h. >+ * wtf/URLHash.h: Renamed from Source/WebCore/platform/URLHash.h. >+ (WTF::URLHash::hash): >+ (WTF::URLHash::equal): >+ * wtf/URLParser.cpp: Renamed from Source/WebCore/platform/URLParser.cpp. >+ (WTF::URLParser::isInUserInfoEncodeSet): >+ (WTF::URLParser::parseAuthority): >+ * wtf/URLParser.h: Renamed from Source/WebCore/platform/URLParser.h. >+ (WTF::URLParser::URLParser): >+ (WTF::URLParser::result): >+ * wtf/cf/CFURLExtras.cpp: Renamed from Source/WebCore/platform/cf/CFURLExtras.cpp. >+ * wtf/cf/CFURLExtras.h: Renamed from Source/WebCore/platform/cf/CFURLExtras.h. >+ * wtf/cf/URLCF.cpp: Renamed from Source/WebCore/platform/cf/URLCF.cpp. >+ * wtf/cocoa/NSURLExtras.h: Copied from Source/WebCore/loader/archive/ArchiveResourceCollection.h. >+ * wtf/cocoa/NSURLExtras.mm: Copied from Source/WebCore/platform/mac/WebCoreNSURLExtras.mm. >+ (WTF::isArmenianLookalikeCharacter): >+ (WTF::isArmenianScriptCharacter): >+ (WTF::isASCIIDigitOrValidHostCharacter): >+ (WTF::isLookalikeCharacter): >+ (WTF::whiteListIDNScript): >+ (WTF::readIDNScriptWhiteListFile): >+ (WTF::allCharactersInIDNScriptWhiteList): >+ (WTF::isSecondLevelDomainNameAllowedByTLDRules): >+ (WTF::isRussianDomainNameCharacter): >+ (WTF::allCharactersAllowedByTLDRules): >+ (WTF::mapHostNameWithRange): >+ (WTF::hostNameNeedsDecodingWithRange): >+ (WTF::hostNameNeedsEncodingWithRange): >+ (WTF::decodeHostNameWithRange): >+ (WTF::encodeHostNameWithRange): >+ (WTF::decodeHostName): >+ (WTF::encodeHostName): >+ (WTF::collectRangesThatNeedMapping): >+ (WTF::collectRangesThatNeedEncoding): >+ (WTF::collectRangesThatNeedDecoding): >+ (WTF::applyHostNameFunctionToMailToURLString): >+ (WTF::applyHostNameFunctionToURLString): >+ (WTF::mapHostNames): >+ (WTF::stringByTrimmingWhitespace): >+ (WTF::URLByTruncatingOneCharacterBeforeComponent): >+ (WTF::URLByRemovingResourceSpecifier): >+ (WTF::URLWithData): >+ (WTF::dataWithUserTypedString): >+ (WTF::URLWithUserTypedString): >+ (WTF::URLWithUserTypedStringDeprecated): >+ (WTF::hasQuestionMarkOnlyQueryString): >+ (WTF::dataForURLComponentType): >+ (WTF::URLByRemovingComponentAndSubsequentCharacter): >+ (WTF::URLByRemovingUserInfo): >+ (WTF::originalURLData): >+ (WTF::createStringWithEscapedUnsafeCharacters): >+ (WTF::userVisibleString): >+ (WTF::isUserVisibleURL): >+ (WTF::rangeOfURLScheme): >+ (WTF::looksLikeAbsoluteURL): >+ * wtf/cocoa/URLCocoa.mm: Renamed from Source/WebCore/platform/mac/URLMac.mm. >+ (WTF::URL::URL): >+ (WTF::URL::createCFURL const): >+ * wtf/glib/GUniquePtrSoup.h: Renamed from Source/WebCore/platform/network/soup/GUniquePtrSoup.h. >+ * wtf/glib/URLSoup.cpp: Renamed from Source/WebCore/platform/soup/URLSoup.cpp. >+ > 2018-11-30 Alexey Proskuryakov <ap@apple.com> > > Move USE_CFNETWORK_IGNORE_HSTS to its proper place >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 1e7fd6a965309747a92e1557dc384e713c5f8f79..857791e5ff3670f3731394af6f07c0df94df82cd 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,557 @@ >+2018-11-30 Alex Christensen <achristensen@webkit.org> >+ >+ Move URL from WebCore to WTF >+ https://bugs.webkit.org/show_bug.cgi?id=190234 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ A URL is a low-level concept that does not depend on other classes in WebCore. >+ We are starting to use URLs in JavaScriptCore for modules. >+ I need URL and URLParser in a place with fewer dependencies for rdar://problem/44119696 >+ >+ * Modules/applepay/ApplePaySession.h: >+ * Modules/applepay/ApplePayValidateMerchantEvent.h: >+ * Modules/applepay/PaymentCoordinator.cpp: >+ * Modules/applepay/PaymentCoordinator.h: >+ * Modules/applepay/PaymentCoordinatorClient.h: >+ * Modules/applepay/PaymentSession.h: >+ * Modules/applicationmanifest/ApplicationManifest.h: >+ * Modules/beacon/NavigatorBeacon.cpp: >+ * Modules/cache/DOMCache.cpp: >+ * Modules/fetch/FetchLoader.h: >+ * Modules/mediasession/MediaSessionMetadata.h: >+ * Modules/mediasource/MediaSourceRegistry.cpp: >+ * Modules/mediasource/MediaSourceRegistry.h: >+ * Modules/mediastream/MediaStream.cpp: >+ * Modules/mediastream/MediaStreamRegistry.cpp: >+ * Modules/mediastream/MediaStreamRegistry.h: >+ * Modules/navigatorcontentutils/NavigatorContentUtilsClient.h: >+ * Modules/notifications/Notification.h: >+ * Modules/paymentrequest/MerchantValidationEvent.h: >+ * Modules/paymentrequest/PaymentRequest.h: >+ * Modules/plugins/PluginReplacement.h: >+ * Modules/webaudio/AudioContext.h: >+ * Modules/websockets/ThreadableWebSocketChannel.h: >+ * Modules/websockets/WebSocket.h: >+ * Modules/websockets/WebSocketHandshake.cpp: >+ * Modules/websockets/WebSocketHandshake.h: >+ * Modules/websockets/WorkerThreadableWebSocketChannel.h: >+ * PlatformMac.cmake: >+ * PlatformWin.cmake: >+ * Sources.txt: >+ * SourcesCocoa.txt: >+ * WebCore.xcodeproj/project.pbxproj: >+ * bindings/js/CachedModuleScriptLoader.h: >+ * bindings/js/CachedScriptFetcher.h: >+ * bindings/js/ScriptController.cpp: >+ (WebCore::ScriptController::executeIfJavaScriptURL): >+ * bindings/js/ScriptController.h: >+ * bindings/js/ScriptModuleLoader.h: >+ * bindings/js/ScriptSourceCode.h: >+ * bindings/scripts/CodeGeneratorJS.pm: >+ (GenerateImplementation): >+ * bindings/scripts/test/JS/JSInterfaceName.cpp: >+ * bindings/scripts/test/JS/JSMapLike.cpp: >+ * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp: >+ * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: >+ * bindings/scripts/test/JS/JSTestCEReactions.cpp: >+ * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp: >+ * bindings/scripts/test/JS/JSTestCallTracer.cpp: >+ * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp: >+ * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: >+ * bindings/scripts/test/JS/JSTestDOMJIT.cpp: >+ * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp: >+ * bindings/scripts/test/JS/JSTestEventConstructor.cpp: >+ * bindings/scripts/test/JS/JSTestEventTarget.cpp: >+ * bindings/scripts/test/JS/JSTestException.cpp: >+ * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp: >+ * bindings/scripts/test/JS/JSTestGlobalObject.cpp: >+ * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp: >+ * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp: >+ * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp: >+ * bindings/scripts/test/JS/JSTestInterface.cpp: >+ * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp: >+ * bindings/scripts/test/JS/JSTestIterable.cpp: >+ * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: >+ * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp: >+ * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp: >+ * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp: >+ * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: >+ * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp: >+ * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp: >+ * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp: >+ * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp: >+ * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp: >+ * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp: >+ * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp: >+ * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp: >+ * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp: >+ * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp: >+ * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp: >+ * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp: >+ * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp: >+ * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp: >+ * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp: >+ * bindings/scripts/test/JS/JSTestNode.cpp: >+ * bindings/scripts/test/JS/JSTestObj.cpp: >+ * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: >+ * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp: >+ * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp: >+ * bindings/scripts/test/JS/JSTestPluginInterface.cpp: >+ * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp: >+ * bindings/scripts/test/JS/JSTestSerialization.cpp: >+ * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp: >+ * bindings/scripts/test/JS/JSTestSerializationInherit.cpp: >+ * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp: >+ * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: >+ * bindings/scripts/test/JS/JSTestStringifier.cpp: >+ * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp: >+ * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp: >+ * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp: >+ * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp: >+ * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp: >+ * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp: >+ * bindings/scripts/test/JS/JSTestTypedefs.cpp: >+ * contentextensions/ContentExtensionsBackend.cpp: >+ (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad): >+ (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForPingLoad): >+ (WebCore::ContentExtensions::applyBlockedStatusToRequest): >+ * contentextensions/ContentExtensionsBackend.h: >+ * css/CSSValue.h: >+ * css/StyleProperties.h: >+ * css/StyleResolver.h: >+ * css/StyleSheet.h: >+ * css/StyleSheetContents.h: >+ * css/parser/CSSParserContext.h: >+ (WebCore::CSSParserContextHash::hash): >+ (WTF::HashTraits<WebCore::CSSParserContext>::constructDeletedValue): >+ * css/parser/CSSParserIdioms.h: >+ * dom/DataTransfer.cpp: >+ (WebCore::DataTransfer::setDataFromItemList): >+ * dom/Document.cpp: >+ (WebCore::Document::setURL): >+ (WebCore::Document::processHttpEquiv): >+ (WebCore::Document::completeURL const): >+ (WebCore::Document::ensureTemplateDocument): >+ * dom/Document.h: >+ (WebCore::Document::urlForBindings const): >+ * dom/Element.cpp: >+ (WebCore::Element::isJavaScriptURLAttribute const): >+ * dom/InlineStyleSheetOwner.cpp: >+ (WebCore::parserContextForElement): >+ * dom/Node.cpp: >+ (WebCore::Node::baseURI const): >+ * dom/Node.h: >+ * dom/ScriptElement.h: >+ * dom/ScriptExecutionContext.h: >+ * dom/SecurityContext.h: >+ * editing/Editor.cpp: >+ (WebCore::Editor::pasteboardWriterURL): >+ * editing/Editor.h: >+ * editing/MarkupAccumulator.cpp: >+ (WebCore::MarkupAccumulator::appendQuotedURLAttributeValue): >+ * editing/cocoa/DataDetection.h: >+ * editing/cocoa/EditorCocoa.mm: >+ (WebCore::Editor::userVisibleString): >+ * editing/cocoa/WebContentReaderCocoa.mm: >+ (WebCore::replaceRichContentWithAttachments): >+ (WebCore::WebContentReader::readWebArchive): >+ * editing/mac/EditorMac.mm: >+ (WebCore::Editor::plainTextFromPasteboard): >+ (WebCore::Editor::writeImageToPasteboard): >+ * editing/markup.cpp: >+ (WebCore::removeSubresourceURLAttributes): >+ (WebCore::createFragmentFromMarkup): >+ * editing/markup.h: >+ * fileapi/AsyncFileStream.cpp: >+ * fileapi/AsyncFileStream.h: >+ * fileapi/Blob.h: >+ * fileapi/BlobURL.cpp: >+ * fileapi/BlobURL.h: >+ * fileapi/File.h: >+ * fileapi/FileReaderLoader.h: >+ * fileapi/ThreadableBlobRegistry.h: >+ * history/CachedFrame.h: >+ * history/HistoryItem.h: >+ * html/DOMURL.cpp: >+ (WebCore::DOMURL::create): >+ * html/DOMURL.h: >+ * html/HTMLAttachmentElement.cpp: >+ (WebCore::HTMLAttachmentElement::archiveResourceURL): >+ * html/HTMLFrameElementBase.cpp: >+ (WebCore::HTMLFrameElementBase::isURLAllowed const): >+ (WebCore::HTMLFrameElementBase::openURL): >+ (WebCore::HTMLFrameElementBase::setLocation): >+ * html/HTMLInputElement.h: >+ * html/HTMLLinkElement.h: >+ * html/HTMLMediaElement.cpp: >+ (WTF::LogArgument<URL>::toString): >+ (WTF::LogArgument<WebCore::URL>::toString): Deleted. >+ * html/HTMLPlugInImageElement.cpp: >+ (WebCore::HTMLPlugInImageElement::allowedToLoadFrameURL): >+ * html/ImageBitmap.h: >+ * html/MediaFragmentURIParser.h: >+ * html/PublicURLManager.cpp: >+ * html/PublicURLManager.h: >+ * html/URLInputType.cpp: >+ * html/URLRegistry.h: >+ * html/URLSearchParams.cpp: >+ (WebCore::URLSearchParams::URLSearchParams): >+ (WebCore::URLSearchParams::toString const): >+ (WebCore::URLSearchParams::updateURL): >+ (WebCore::URLSearchParams::updateFromAssociatedURL): >+ * html/URLUtils.h: >+ (WebCore::URLUtils<T>::setHost): >+ (WebCore::URLUtils<T>::setPort): >+ * html/canvas/CanvasRenderingContext.cpp: >+ * html/canvas/CanvasRenderingContext.h: >+ * html/parser/HTMLParserIdioms.cpp: >+ * html/parser/XSSAuditor.cpp: >+ (WebCore::semicolonSeparatedValueContainsJavaScriptURL): >+ (WebCore::XSSAuditor::filterScriptToken): >+ (WebCore::XSSAuditor::filterObjectToken): >+ (WebCore::XSSAuditor::filterParamToken): >+ (WebCore::XSSAuditor::filterEmbedToken): >+ (WebCore::XSSAuditor::filterFormToken): >+ (WebCore::XSSAuditor::filterInputToken): >+ (WebCore::XSSAuditor::filterButtonToken): >+ (WebCore::XSSAuditor::eraseDangerousAttributesIfInjected): >+ (WebCore::XSSAuditor::isLikelySafeResource): >+ * html/parser/XSSAuditor.h: >+ * html/parser/XSSAuditorDelegate.h: >+ * inspector/InspectorFrontendHost.cpp: >+ (WebCore::InspectorFrontendHost::openInNewTab): >+ * inspector/InspectorInstrumentation.h: >+ * inspector/agents/InspectorNetworkAgent.cpp: >+ * inspector/agents/InspectorNetworkAgent.h: >+ * inspector/agents/InspectorPageAgent.h: >+ * inspector/agents/InspectorWorkerAgent.h: >+ * loader/ApplicationManifestLoader.h: >+ * loader/CookieJar.h: >+ * loader/CrossOriginAccessControl.h: >+ * loader/CrossOriginPreflightResultCache.h: >+ * loader/DocumentLoader.cpp: >+ (WebCore::DocumentLoader::willSendRequest): >+ (WebCore::DocumentLoader::maybeLoadEmpty): >+ * loader/DocumentLoader.h: >+ (WebCore::DocumentLoader::serverRedirectSourceForHistory const): >+ * loader/DocumentWriter.h: >+ * loader/FormSubmission.h: >+ * loader/FrameLoader.cpp: >+ (WebCore::FrameLoader::submitForm): >+ (WebCore::FrameLoader::receivedFirstData): >+ (WebCore::FrameLoader::loadWithDocumentLoader): >+ (WebCore::FrameLoader::continueLoadAfterNavigationPolicy): >+ (WebCore::createWindow): >+ * loader/FrameLoaderClient.h: >+ * loader/HistoryController.cpp: >+ (WebCore::HistoryController::currentItemShouldBeReplaced const): >+ (WebCore::HistoryController::initializeItem): >+ * loader/LinkLoader.h: >+ * loader/LoadTiming.h: >+ * loader/LoaderStrategy.h: >+ * loader/MixedContentChecker.cpp: >+ (WebCore::MixedContentChecker::checkFormForMixedContent const): >+ * loader/MixedContentChecker.h: >+ * loader/NavigationScheduler.cpp: >+ (WebCore::NavigationScheduler::shouldScheduleNavigation const): >+ * loader/NavigationScheduler.h: >+ * loader/PingLoader.h: >+ * loader/PolicyChecker.cpp: >+ (WebCore::PolicyChecker::checkNavigationPolicy): >+ * loader/ResourceLoadInfo.h: >+ * loader/ResourceLoadObserver.cpp: >+ (WebCore::ResourceLoadObserver::requestStorageAccessUnderOpener): >+ * loader/ResourceLoadObserver.h: >+ * loader/ResourceLoadStatistics.h: >+ * loader/ResourceLoader.h: >+ * loader/ResourceTiming.h: >+ * loader/SubframeLoader.cpp: >+ (WebCore::SubframeLoader::requestFrame): >+ * loader/SubframeLoader.h: >+ * loader/SubstituteData.h: >+ * loader/appcache/ApplicationCache.h: >+ * loader/appcache/ApplicationCacheGroup.h: >+ * loader/appcache/ApplicationCacheHost.h: >+ * loader/appcache/ApplicationCacheStorage.cpp: >+ * loader/appcache/ApplicationCacheStorage.h: >+ * loader/appcache/ManifestParser.cpp: >+ * loader/appcache/ManifestParser.h: >+ * loader/archive/ArchiveResourceCollection.h: >+ * loader/archive/cf/LegacyWebArchive.cpp: >+ (WebCore::LegacyWebArchive::createFromSelection): >+ * loader/cache/CachedResource.cpp: >+ * loader/cache/CachedResourceLoader.h: >+ * loader/cache/CachedStyleSheetClient.h: >+ * loader/cache/MemoryCache.h: >+ * loader/icon/IconLoader.h: >+ * loader/mac/LoaderNSURLExtras.mm: >+ * page/CaptionUserPreferencesMediaAF.cpp: >+ * page/ChromeClient.h: >+ * page/ClientOrigin.h: >+ * page/ContextMenuClient.h: >+ * page/ContextMenuController.cpp: >+ (WebCore::ContextMenuController::checkOrEnableIfNeeded const): >+ * page/DOMWindow.cpp: >+ (WebCore::DOMWindow::isInsecureScriptAccess): >+ * page/DragController.cpp: >+ (WebCore::DragController::startDrag): >+ * page/DragController.h: >+ * page/EventSource.h: >+ * page/Frame.h: >+ * page/FrameView.h: >+ * page/History.h: >+ * page/Location.cpp: >+ (WebCore::Location::url const): >+ (WebCore::Location::reload): >+ * page/Location.h: >+ * page/Page.h: >+ * page/PageSerializer.h: >+ * page/Performance.h: >+ * page/PerformanceResourceTiming.cpp: >+ * page/SecurityOrigin.cpp: >+ (WebCore::SecurityOrigin::SecurityOrigin): >+ (WebCore::SecurityOrigin::create): >+ * page/SecurityOrigin.h: >+ * page/SecurityOriginData.h: >+ * page/SecurityOriginHash.h: >+ * page/SecurityPolicy.cpp: >+ (WebCore::SecurityPolicy::shouldInheritSecurityOriginFromOwner): >+ * page/SecurityPolicy.h: >+ * page/SettingsBase.h: >+ * page/ShareData.h: >+ * page/SocketProvider.h: >+ * page/UserContentProvider.h: >+ * page/UserContentURLPattern.cpp: >+ * page/UserContentURLPattern.h: >+ * page/UserScript.h: >+ * page/UserStyleSheet.h: >+ * page/VisitedLinkStore.h: >+ * page/csp/ContentSecurityPolicy.h: >+ * page/csp/ContentSecurityPolicyClient.h: >+ * page/csp/ContentSecurityPolicyDirectiveList.h: >+ * page/csp/ContentSecurityPolicySource.cpp: >+ (WebCore::ContentSecurityPolicySource::portMatches const): >+ * page/csp/ContentSecurityPolicySource.h: >+ * page/csp/ContentSecurityPolicySourceList.cpp: >+ * page/csp/ContentSecurityPolicySourceList.h: >+ * page/csp/ContentSecurityPolicySourceListDirective.cpp: >+ * platform/ContentFilterUnblockHandler.h: >+ * platform/ContextMenuItem.h: >+ * platform/Cookie.h: >+ * platform/CookiesStrategy.h: >+ * platform/DragData.h: >+ * platform/DragImage.h: >+ * platform/FileStream.h: >+ * platform/LinkIcon.h: >+ * platform/Pasteboard.cpp: >+ (WebCore::Pasteboard::canExposeURLToDOMWhenPasteboardContainsFiles): >+ * platform/Pasteboard.h: >+ * platform/PasteboardStrategy.h: >+ * platform/PasteboardWriterData.cpp: >+ (WebCore::PasteboardWriterData::setURLData): >+ (WebCore::PasteboardWriterData::setURL): Deleted. >+ * platform/PasteboardWriterData.h: >+ * platform/PlatformPasteboard.h: >+ * platform/PromisedAttachmentInfo.h: >+ * platform/SSLKeyGenerator.h: >+ * platform/SchemeRegistry.cpp: >+ (WebCore::SchemeRegistry::isBuiltinScheme): >+ * platform/SharedBuffer.h: >+ * platform/SharedStringHash.cpp: >+ * platform/SharedStringHash.h: >+ * platform/SourcesSoup.txt: >+ * platform/UserAgent.h: >+ * platform/UserAgentQuirks.cpp: >+ * platform/UserAgentQuirks.h: >+ * platform/cocoa/NetworkExtensionContentFilter.h: >+ * platform/cocoa/NetworkExtensionContentFilter.mm: >+ (WebCore::NetworkExtensionContentFilter::willSendRequest): >+ * platform/glib/SSLKeyGeneratorGLib.cpp: Copied from Source/WebCore/page/ShareData.h. >+ (WebCore::getSupportedKeySizes): >+ (WebCore::signedPublicKeyAndChallengeString): >+ * platform/glib/UserAgentGLib.cpp: >+ * platform/graphics/GraphicsContext.h: >+ * platform/graphics/Image.cpp: >+ * platform/graphics/Image.h: >+ * platform/graphics/ImageObserver.h: >+ * platform/graphics/ImageSource.cpp: >+ * platform/graphics/ImageSource.h: >+ * platform/graphics/MediaPlayer.h: >+ * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: >+ * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: >+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: >+ * platform/graphics/cg/GraphicsContextCG.cpp: >+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: >+ * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: >+ * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp: >+ (webKitMediaSrcSetUri): >+ * platform/graphics/iso/ISOVTTCue.cpp: >+ * platform/graphics/win/GraphicsContextDirect2D.cpp: >+ * platform/gtk/DragImageGtk.cpp: >+ * platform/gtk/PasteboardGtk.cpp: >+ * platform/gtk/PlatformPasteboardGtk.cpp: >+ * platform/gtk/SelectionData.h: >+ * platform/ios/PasteboardIOS.mm: >+ * platform/ios/PlatformPasteboardIOS.mm: >+ (WebCore::PlatformPasteboard::write): >+ * platform/ios/QuickLook.h: >+ * platform/mac/DragDataMac.mm: >+ (WebCore::DragData::asPlainText const): >+ * platform/mac/DragImageMac.mm: >+ * platform/mac/FileSystemMac.mm: >+ (WebCore::FileSystem::setMetadataURL): >+ * platform/mac/PasteboardMac.mm: >+ * platform/mac/PasteboardWriter.mm: >+ (WebCore::createPasteboardWriter): >+ * platform/mac/PlatformPasteboardMac.mm: >+ * platform/mac/PublicSuffixMac.mm: >+ (WebCore::decodeHostName): >+ * platform/mac/SSLKeyGeneratorMac.mm: >+ * platform/mac/WebCoreNSURLExtras.h: >+ * platform/mac/WebCoreNSURLExtras.mm: >+ (WebCore::isArmenianLookalikeCharacter): Deleted. >+ (WebCore::isArmenianScriptCharacter): Deleted. >+ (WebCore::isASCIIDigitOrValidHostCharacter): Deleted. >+ (WebCore::isLookalikeCharacter): Deleted. >+ (WebCore::whiteListIDNScript): Deleted. >+ (WebCore::readIDNScriptWhiteListFile): Deleted. >+ (WebCore::allCharactersInIDNScriptWhiteList): Deleted. >+ (WebCore::isSecondLevelDomainNameAllowedByTLDRules): Deleted. >+ (WebCore::isRussianDomainNameCharacter): Deleted. >+ (WebCore::allCharactersAllowedByTLDRules): Deleted. >+ (WebCore::mapHostNameWithRange): Deleted. >+ (WebCore::hostNameNeedsDecodingWithRange): Deleted. >+ (WebCore::hostNameNeedsEncodingWithRange): Deleted. >+ (WebCore::decodeHostNameWithRange): Deleted. >+ (WebCore::encodeHostNameWithRange): Deleted. >+ (WebCore::decodeHostName): Deleted. >+ (WebCore::encodeHostName): Deleted. >+ (WebCore::collectRangesThatNeedMapping): Deleted. >+ (WebCore::collectRangesThatNeedEncoding): Deleted. >+ (WebCore::collectRangesThatNeedDecoding): Deleted. >+ (WebCore::applyHostNameFunctionToMailToURLString): Deleted. >+ (WebCore::applyHostNameFunctionToURLString): Deleted. >+ (WebCore::mapHostNames): Deleted. >+ (WebCore::stringByTrimmingWhitespace): Deleted. >+ (WebCore::URLByTruncatingOneCharacterBeforeComponent): Deleted. >+ (WebCore::URLByRemovingResourceSpecifier): Deleted. >+ (WebCore::URLWithData): Deleted. >+ (WebCore::dataWithUserTypedString): Deleted. >+ (WebCore::URLWithUserTypedString): Deleted. >+ (WebCore::URLWithUserTypedStringDeprecated): Deleted. >+ (WebCore::hasQuestionMarkOnlyQueryString): Deleted. >+ (WebCore::dataForURLComponentType): Deleted. >+ (WebCore::URLByRemovingComponentAndSubsequentCharacter): Deleted. >+ (WebCore::URLByRemovingUserInfo): Deleted. >+ (WebCore::originalURLData): Deleted. >+ (WebCore::createStringWithEscapedUnsafeCharacters): Deleted. >+ (WebCore::userVisibleString): Deleted. >+ (WebCore::isUserVisibleURL): Deleted. >+ (WebCore::rangeOfURLScheme): Deleted. >+ (WebCore::looksLikeAbsoluteURL): Deleted. >+ * platform/mediastream/MediaEndpointConfiguration.h: >+ * platform/network/BlobPart.h: >+ * platform/network/BlobRegistry.h: >+ * platform/network/BlobRegistryImpl.h: >+ * platform/network/BlobResourceHandle.cpp: >+ * platform/network/CookieRequestHeaderFieldProxy.h: >+ * platform/network/CredentialStorage.cpp: >+ * platform/network/CredentialStorage.h: >+ * platform/network/DataURLDecoder.cpp: >+ * platform/network/DataURLDecoder.h: >+ * platform/network/FormData.h: >+ * platform/network/ProxyServer.h: >+ * platform/network/ResourceErrorBase.h: >+ * platform/network/ResourceHandle.cpp: >+ (WebCore::ResourceHandle::didReceiveResponse): >+ * platform/network/ResourceHandle.h: >+ * platform/network/ResourceHandleClient.h: >+ * platform/network/ResourceRequestBase.cpp: >+ (WebCore::ResourceRequestBase::redirectedRequest const): >+ * platform/network/ResourceRequestBase.h: >+ * platform/network/ResourceResponseBase.h: >+ * platform/network/SocketStreamHandle.h: >+ * platform/network/cf/DNSResolveQueueCFNet.cpp: >+ * platform/network/cf/NetworkStorageSessionCFNet.cpp: >+ * platform/network/cf/ProxyServerCFNet.cpp: >+ * platform/network/cf/ResourceErrorCF.cpp: >+ * platform/network/cocoa/NetworkStorageSessionCocoa.mm: >+ * platform/network/curl/CookieJarCurlDatabase.cpp: Added. >+ (WebCore::cookiesForSession): >+ (WebCore::CookieJarCurlDatabase::setCookiesFromDOM const): >+ (WebCore::CookieJarCurlDatabase::setCookiesFromHTTPResponse const): >+ (WebCore::CookieJarCurlDatabase::cookiesForDOM const): >+ (WebCore::CookieJarCurlDatabase::cookieRequestHeaderFieldValue const): >+ (WebCore::CookieJarCurlDatabase::cookiesEnabled const): >+ (WebCore::CookieJarCurlDatabase::getRawCookies const): >+ (WebCore::CookieJarCurlDatabase::deleteCookie const): >+ (WebCore::CookieJarCurlDatabase::getHostnamesWithCookies const): >+ (WebCore::CookieJarCurlDatabase::deleteCookiesForHostnames const): >+ (WebCore::CookieJarCurlDatabase::deleteAllCookies const): >+ (WebCore::CookieJarCurlDatabase::deleteAllCookiesModifiedSince const): >+ * platform/network/curl/CookieJarDB.cpp: >+ * platform/network/curl/CookieUtil.h: >+ * platform/network/curl/CurlContext.h: >+ * platform/network/curl/CurlProxySettings.h: >+ * platform/network/curl/CurlResponse.h: >+ * platform/network/curl/NetworkStorageSessionCurl.cpp: >+ * platform/network/curl/ProxyServerCurl.cpp: >+ * platform/network/curl/SocketStreamHandleImplCurl.cpp: >+ * platform/network/mac/ResourceErrorMac.mm: >+ * platform/network/soup/NetworkStorageSessionSoup.cpp: >+ * platform/network/soup/ProxyServerSoup.cpp: >+ * platform/network/soup/ResourceHandleSoup.cpp: >+ * platform/network/soup/ResourceRequest.h: >+ * platform/network/soup/ResourceRequestSoup.cpp: >+ * platform/network/soup/SocketStreamHandleImplSoup.cpp: >+ * platform/network/soup/SoupNetworkSession.cpp: >+ * platform/network/soup/SoupNetworkSession.h: >+ * platform/text/TextEncoding.h: >+ * platform/win/BString.cpp: >+ * platform/win/BString.h: >+ * platform/win/ClipboardUtilitiesWin.cpp: >+ (WebCore::markupToCFHTML): >+ * platform/win/ClipboardUtilitiesWin.h: >+ * platform/win/DragImageWin.cpp: >+ * platform/win/PasteboardWin.cpp: >+ * plugins/PluginData.h: >+ * rendering/HitTestResult.h: >+ * rendering/RenderAttachment.cpp: >+ * svg/SVGImageLoader.cpp: >+ (WebCore::SVGImageLoader::sourceURI const): >+ * svg/SVGURIReference.cpp: >+ * svg/graphics/SVGImage.h: >+ * svg/graphics/SVGImageCache.h: >+ * svg/graphics/SVGImageForContainer.h: >+ * testing/Internals.cpp: >+ (WebCore::Internals::resetToConsistentState): >+ * testing/Internals.mm: >+ (WebCore::Internals::userVisibleString): >+ * testing/MockContentFilter.cpp: >+ (WebCore::MockContentFilter::willSendRequest): >+ * testing/MockPaymentCoordinator.cpp: >+ * testing/js/WebCoreTestSupport.cpp: >+ * workers/AbstractWorker.h: >+ * workers/WorkerGlobalScope.h: >+ * workers/WorkerGlobalScopeProxy.h: >+ * workers/WorkerInspectorProxy.h: >+ * workers/WorkerLocation.h: >+ * workers/WorkerScriptLoader.h: >+ * workers/WorkerThread.cpp: >+ * workers/WorkerThread.h: >+ * workers/service/ServiceWorker.h: >+ * workers/service/ServiceWorkerClientData.h: >+ * workers/service/ServiceWorkerContainer.cpp: >+ * workers/service/ServiceWorkerContextData.h: >+ * workers/service/ServiceWorkerData.h: >+ * workers/service/ServiceWorkerJobData.h: >+ * workers/service/ServiceWorkerRegistrationKey.cpp: >+ * workers/service/ServiceWorkerRegistrationKey.h: >+ (WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>::constructDeletedValue): >+ * worklets/WorkletGlobalScope.h: >+ * xml/XMLHttpRequest.h: >+ > 2018-11-30 Wenson Hsieh <wenson_hsieh@apple.com> > > Replace "auto fill" with "AutoFill" in some localizable strings >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 8b0ba114dd20d31b98017377c2cb0e90d141fd74..b5be73a24be913ec3bba4d24104aada5dff43e66 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,434 @@ >+2018-11-30 Alex Christensen <achristensen@webkit.org> >+ >+ Move URL from WebCore to WTF >+ https://bugs.webkit.org/show_bug.cgi?id=190234 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * NetworkProcess/Cookies/WebCookieManager.cpp: >+ * NetworkProcess/Cookies/WebCookieManager.h: >+ * NetworkProcess/Cookies/WebCookieManager.messages.in: >+ * NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm: >+ * NetworkProcess/Downloads/Download.h: >+ * NetworkProcess/Downloads/DownloadManager.cpp: >+ (WebKit::DownloadManager::publishDownloadProgress): >+ * NetworkProcess/Downloads/DownloadManager.h: >+ * NetworkProcess/Downloads/PendingDownload.cpp: >+ (WebKit::PendingDownload::publishProgress): >+ * NetworkProcess/Downloads/PendingDownload.h: >+ * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm: >+ (WebKit::Download::publishProgress): >+ * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp: >+ (WebKit::NetworkBlobRegistry::registerBlobURL): >+ (WebKit::NetworkBlobRegistry::registerBlobURLForSlice): >+ (WebKit::NetworkBlobRegistry::unregisterBlobURL): >+ (WebKit::NetworkBlobRegistry::blobSize): >+ (WebKit::NetworkBlobRegistry::filesInBlob): >+ * NetworkProcess/FileAPI/NetworkBlobRegistry.h: >+ * NetworkProcess/NetworkConnectionToWebProcess.h: >+ * NetworkProcess/NetworkConnectionToWebProcess.messages.in: >+ * NetworkProcess/NetworkDataTask.cpp: >+ (WebKit::NetworkDataTask::didReceiveResponse): >+ * NetworkProcess/NetworkDataTaskBlob.cpp: >+ * NetworkProcess/NetworkLoadChecker.h: >+ (WebKit::NetworkLoadChecker::setContentExtensionController): >+ (WebKit::NetworkLoadChecker::url const): >+ * NetworkProcess/NetworkProcess.cpp: >+ (WebKit::NetworkProcess::writeBlobToFilePath): >+ (WebKit::NetworkProcess::publishDownloadProgress): >+ (WebKit::NetworkProcess::preconnectTo): >+ * NetworkProcess/NetworkProcess.h: >+ * NetworkProcess/NetworkProcess.messages.in: >+ * NetworkProcess/NetworkResourceLoadParameters.h: >+ * NetworkProcess/NetworkResourceLoader.cpp: >+ (WebKit::logBlockedCookieInformation): >+ (WebKit::logCookieInformationInternal): >+ * NetworkProcess/NetworkResourceLoader.h: >+ * NetworkProcess/NetworkSocketStream.cpp: >+ (WebKit::NetworkSocketStream::create): >+ * NetworkProcess/NetworkSocketStream.h: >+ * NetworkProcess/PingLoad.h: >+ * NetworkProcess/ServiceWorker/WebSWServerConnection.h: >+ * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in: >+ * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in: >+ * NetworkProcess/cache/CacheStorageEngine.cpp: >+ (WebKit::CacheStorage::Engine::retrieveRecords): >+ * NetworkProcess/cache/CacheStorageEngine.h: >+ * NetworkProcess/cache/CacheStorageEngineCache.h: >+ * NetworkProcess/cache/CacheStorageEngineConnection.cpp: >+ (WebKit::CacheStorageEngineConnection::retrieveRecords): >+ * NetworkProcess/cache/CacheStorageEngineConnection.h: >+ * NetworkProcess/cache/CacheStorageEngineConnection.messages.in: >+ * NetworkProcess/cache/NetworkCache.h: >+ * NetworkProcess/cache/NetworkCacheStatistics.cpp: >+ (WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry): >+ (WebKit::NetworkCache::Statistics::recordRevalidationSuccess): >+ * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h: >+ (WebKit::NetworkCache::SubresourceInfo::firstPartyForCookies const): >+ * NetworkProcess/capture/NetworkCaptureEvent.cpp: >+ (WebKit::NetworkCapture::Request::operator WebCore::ResourceRequest const): >+ (WebKit::NetworkCapture::Response::operator WebCore::ResourceResponse const): >+ (WebKit::NetworkCapture::Error::operator WebCore::ResourceError const): >+ * NetworkProcess/capture/NetworkCaptureManager.cpp: >+ (WebKit::NetworkCapture::Manager::findBestFuzzyMatch): >+ (WebKit::NetworkCapture::Manager::fuzzyMatchURLs): >+ (WebKit::NetworkCapture::Manager::urlIdentifyingCommonDomain): >+ * NetworkProcess/capture/NetworkCaptureManager.h: >+ * NetworkProcess/capture/NetworkCaptureResource.cpp: >+ (WebKit::NetworkCapture::Resource::url): >+ (WebKit::NetworkCapture::Resource::queryParameters): >+ * NetworkProcess/capture/NetworkCaptureResource.h: >+ * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: >+ (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection): >+ * NetworkProcess/cocoa/NetworkProcessCocoa.mm: >+ (WebKit::NetworkProcess::deleteHSTSCacheForHostNames): >+ * NetworkProcess/cocoa/NetworkSessionCocoa.mm: >+ (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]): >+ * PluginProcess/mac/PluginProcessMac.mm: >+ (WebKit::openCFURLRef): >+ (WebKit::replacedNSWorkspace_launchApplicationAtURL_options_configuration_error): >+ * Shared/API/APIURL.h: >+ (API::URL::create): >+ (API::URL::equals): >+ (API::URL::URL): >+ (API::URL::url const): >+ (API::URL::parseURLIfNecessary const): >+ * Shared/API/APIUserContentURLPattern.h: >+ (API::UserContentURLPattern::matchesURL const): >+ * Shared/API/c/WKURLRequest.cpp: >+ * Shared/API/c/WKURLResponse.cpp: >+ * Shared/API/c/cf/WKURLCF.mm: >+ (WKURLCreateWithCFURL): >+ (WKURLCopyCFURL): >+ * Shared/API/glib/WebKitURIRequest.cpp: >+ * Shared/API/glib/WebKitURIResponse.cpp: >+ * Shared/APIWebArchiveResource.mm: >+ (API::WebArchiveResource::WebArchiveResource): >+ * Shared/AssistedNodeInformation.h: >+ * Shared/Cocoa/WKNSURLExtras.mm: >+ (-[NSURL _web_originalDataAsWTFString]): >+ (): Deleted. >+ * Shared/SessionState.h: >+ * Shared/WebBackForwardListItem.cpp: >+ (WebKit::WebBackForwardListItem::itemIsInSameDocument const): >+ * Shared/WebCoreArgumentCoders.cpp: >+ * Shared/WebCoreArgumentCoders.h: >+ * Shared/WebErrors.h: >+ * Shared/WebHitTestResultData.cpp: >+ * Shared/cf/ArgumentCodersCF.cpp: >+ (IPC::encode): >+ (IPC::decode): >+ * Shared/gtk/WebErrorsGtk.cpp: >+ * Shared/ios/InteractionInformationAtPosition.h: >+ * UIProcess/API/APIHTTPCookieStore.h: >+ * UIProcess/API/APINavigation.cpp: >+ (API::Navigation::appendRedirectionURL): >+ * UIProcess/API/APINavigation.h: >+ (API::Navigation::takeRedirectChain): >+ * UIProcess/API/APINavigationAction.h: >+ * UIProcess/API/APINavigationClient.h: >+ (API::NavigationClient::signedPublicKeyAndChallengeString): >+ (API::NavigationClient::contentRuleListNotification): >+ (API::NavigationClient::webGLLoadPolicy const): >+ (API::NavigationClient::resolveWebGLLoadPolicy const): >+ * UIProcess/API/APIUIClient.h: >+ (API::UIClient::saveDataToFileInDownloadsFolder): >+ * UIProcess/API/APIUserScript.cpp: >+ (API::UserScript::generateUniqueURL): >+ * UIProcess/API/APIUserScript.h: >+ * UIProcess/API/APIUserStyleSheet.cpp: >+ (API::UserStyleSheet::generateUniqueURL): >+ * UIProcess/API/APIUserStyleSheet.h: >+ * UIProcess/API/C/WKOpenPanelResultListener.cpp: >+ (filePathsFromFileURLs): >+ * UIProcess/API/C/WKPage.cpp: >+ (WKPageLoadPlainTextStringWithUserData): >+ (WKPageSetPageUIClient): >+ (WKPageSetPageNavigationClient): >+ * UIProcess/API/C/WKPageGroup.cpp: >+ (WKPageGroupAddUserStyleSheet): >+ (WKPageGroupAddUserScript): >+ * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: >+ (WKWebsiteDataStoreSetResourceLoadStatisticsPrevalentResourceForDebugMode): >+ (WKWebsiteDataStoreSetStatisticsLastSeen): >+ (WKWebsiteDataStoreSetStatisticsPrevalentResource): >+ (WKWebsiteDataStoreSetStatisticsVeryPrevalentResource): >+ (WKWebsiteDataStoreIsStatisticsPrevalentResource): >+ (WKWebsiteDataStoreIsStatisticsVeryPrevalentResource): >+ (WKWebsiteDataStoreIsStatisticsRegisteredAsSubresourceUnder): >+ (WKWebsiteDataStoreIsStatisticsRegisteredAsSubFrameUnder): >+ (WKWebsiteDataStoreIsStatisticsRegisteredAsRedirectingTo): >+ (WKWebsiteDataStoreSetStatisticsHasHadUserInteraction): >+ (WKWebsiteDataStoreIsStatisticsHasHadUserInteraction): >+ (WKWebsiteDataStoreSetStatisticsGrandfathered): >+ (WKWebsiteDataStoreIsStatisticsGrandfathered): >+ (WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin): >+ (WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin): >+ (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectTo): >+ (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectFrom): >+ (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectTo): >+ (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectFrom): >+ * UIProcess/API/Cocoa/WKHTTPCookieStore.mm: >+ * UIProcess/API/Cocoa/WKUserScript.mm: >+ (-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:associatedURL:userContentWorld:]): >+ * UIProcess/API/Cocoa/WKWebView.mm: >+ (-[WKWebView _showSafeBrowsingWarning:completionHandler:]): >+ (-[WKWebView _showSafeBrowsingWarningWithTitle:warning:details:completionHandler:]): >+ * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: >+ (-[WKWebViewConfiguration setURLSchemeHandler:forURLScheme:]): >+ (-[WKWebViewConfiguration urlSchemeHandlerForURLScheme:]): >+ * UIProcess/API/Cocoa/WKWebViewInternal.h: >+ * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: >+ * UIProcess/API/Cocoa/_WKApplicationManifest.mm: >+ (-[_WKApplicationManifest initWithCoder:]): >+ (+[_WKApplicationManifest applicationManifestFromJSON:manifestURL:documentURL:]): >+ * UIProcess/API/Cocoa/_WKUserStyleSheet.mm: >+ (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:baseURL:userContentWorld:]): >+ * UIProcess/API/glib/IconDatabase.cpp: >+ * UIProcess/API/glib/WebKitCookieManager.cpp: >+ (webkit_cookie_manager_get_cookies): >+ * UIProcess/API/glib/WebKitFileChooserRequest.cpp: >+ * UIProcess/API/glib/WebKitSecurityOrigin.cpp: >+ (webkit_security_origin_new_for_uri): >+ * UIProcess/API/glib/WebKitUIClient.cpp: >+ * UIProcess/API/glib/WebKitURISchemeRequest.cpp: >+ * UIProcess/API/glib/WebKitWebView.cpp: >+ (webkit_web_view_load_plain_text): >+ * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp: >+ * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp: >+ (WebKit::WebPaymentCoordinatorProxy::showPaymentUI): >+ (WebKit::WebPaymentCoordinatorProxy::validateMerchant): >+ * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: >+ * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h: >+ * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: >+ (WebKit::toPKPaymentRequest): >+ * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm: >+ (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): >+ * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: >+ (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): >+ * UIProcess/Automation/WebAutomationSession.cpp: >+ (WebKit::WebAutomationSession::navigateBrowsingContext): >+ (WebKit::domainByAddingDotPrefixIfNeeded): >+ (WebKit::WebAutomationSession::addSingleCookie): >+ (WebKit::WebAutomationSession::deleteAllCookies): >+ * UIProcess/Cocoa/DownloadClient.mm: >+ (WebKit::DownloadClient::didFinish): >+ * UIProcess/Cocoa/NavigationState.h: >+ * UIProcess/Cocoa/NavigationState.mm: >+ (WebKit::NavigationState::NavigationClient::webGLLoadPolicy const): >+ (WebKit::NavigationState::NavigationClient::resolveWebGLLoadPolicy const): >+ (WebKit::NavigationState::NavigationClient::contentRuleListNotification): >+ (WebKit::NavigationState::NavigationClient::willPerformClientRedirect): >+ (WebKit::NavigationState::NavigationClient::didPerformClientRedirect): >+ (WebKit::NavigationState::NavigationClient::signedPublicKeyAndChallengeString): >+ * UIProcess/Cocoa/SafeBrowsingResultCocoa.mm: Copied from Source/WebKit/WebProcess/Network/WebSocketProvider.h. >+ (WebKit::SafeBrowsingResult::SafeBrowsingResult): >+ * UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm: >+ (WebKit::reportAnErrorURL): >+ (WebKit::malwareDetailsURL): >+ (WebKit::safeBrowsingDetailsText): >+ (WebKit::SafeBrowsingWarning::SafeBrowsingWarning): >+ * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: >+ (-[_WKPreviewControllerDataSource finish:]): >+ (WebKit::SystemPreviewController::finish): >+ * UIProcess/Cocoa/UIDelegate.h: >+ * UIProcess/Cocoa/UIDelegate.mm: >+ (WebKit::UIDelegate::UIClient::createNewPage): >+ (WebKit::UIDelegate::UIClient::saveDataToFileInDownloadsFolder): >+ (WebKit::requestUserMediaAuthorizationForDevices): >+ (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin): >+ * UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm: >+ (-[WKReloadFrameErrorRecoveryAttempter attemptRecovery]): >+ * UIProcess/Cocoa/WKSafeBrowsingWarning.h: >+ * UIProcess/Cocoa/WKSafeBrowsingWarning.mm: >+ (-[WKSafeBrowsingWarning initWithFrame:safeBrowsingWarning:completionHandler:]): >+ * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: >+ * UIProcess/Cocoa/WebViewImpl.h: >+ * UIProcess/Cocoa/WebViewImpl.mm: >+ (WebKit::WebViewImpl::showSafeBrowsingWarning): >+ (WebKit::WebViewImpl::writeToURLForFilePromiseProvider): >+ * UIProcess/Downloads/DownloadProxy.cpp: >+ (WebKit::DownloadProxy::publishProgress): >+ * UIProcess/Downloads/DownloadProxy.h: >+ (WebKit::DownloadProxy::setRedirectChain): >+ (WebKit::DownloadProxy::redirectChain const): >+ * UIProcess/FrameLoadState.cpp: >+ (WebKit::FrameLoadState::didStartProvisionalLoad): >+ (WebKit::FrameLoadState::didReceiveServerRedirectForProvisionalLoad): >+ (WebKit::FrameLoadState::didSameDocumentNotification): >+ (WebKit::FrameLoadState::setUnreachableURL): >+ * UIProcess/FrameLoadState.h: >+ (WebKit::FrameLoadState::url const): >+ (WebKit::FrameLoadState::setURL): >+ (WebKit::FrameLoadState::provisionalURL const): >+ (WebKit::FrameLoadState::unreachableURL const): >+ * UIProcess/Network/NetworkProcessProxy.cpp: >+ (WebKit::NetworkProcessProxy::writeBlobToFilePath): >+ * UIProcess/Network/NetworkProcessProxy.h: >+ * UIProcess/PageClient.h: >+ (WebKit::PageClient::showSafeBrowsingWarning): >+ * UIProcess/PageLoadState.cpp: >+ (WebKit::PageLoadState::hasOnlySecureContent): >+ * UIProcess/Plugins/PluginInfoStore.cpp: >+ * UIProcess/Plugins/PluginInfoStore.h: >+ * UIProcess/Plugins/mac/PluginProcessProxyMac.mm: >+ * UIProcess/SafeBrowsingResult.h: Copied from Source/WebKit/UIProcess/SystemPreviewController.h. >+ (WebKit::SafeBrowsingResult::create): >+ (WebKit::SafeBrowsingResult::url const): >+ (WebKit::SafeBrowsingResult::provider const): >+ (WebKit::SafeBrowsingResult::isPhishing const): >+ (WebKit::SafeBrowsingResult::isMalware const): >+ (WebKit::SafeBrowsingResult::isUnwantedSoftware const): >+ (WebKit::SafeBrowsingResult::isKnownToBeUnsafe const): >+ * UIProcess/SafeBrowsingWarning.h: >+ (WebKit::SafeBrowsingWarning::create): >+ * UIProcess/SuspendedPageProxy.cpp: >+ * UIProcess/SystemPreviewController.h: >+ * UIProcess/WebCookieManagerProxy.h: >+ * UIProcess/WebFrameProxy.h: >+ (WebKit::WebFrameProxy::url const): >+ (WebKit::WebFrameProxy::provisionalURL const): >+ (WebKit::WebFrameProxy::unreachableURL const): >+ * UIProcess/WebInspectorProxy.h: >+ * UIProcess/WebOpenPanelResultListenerProxy.cpp: >+ * UIProcess/WebPageProxy.cpp: >+ (WebKit::WebPageProxy::loadDataWithNavigation): >+ (WebKit::WebPageProxy::loadAlternateHTML): >+ (WebKit::WebPageProxy::loadWebArchiveData): >+ (WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick): >+ (WebKit::WebPageProxy::continueNavigationInNewProcess): >+ (WebKit::WebPageProxy::didStartProvisionalLoadForFrame): >+ (WebKit::WebPageProxy::didChangeProvisionalURLForFrame): >+ (WebKit::WebPageProxy::didSameDocumentNavigationForFrame): >+ (WebKit::WebPageProxy::contentRuleListNotification): >+ (WebKit::WebPageProxy::processDidTerminate): >+ (WebKit::WebPageProxy::signedPublicKeyAndChallengeString): >+ (WebKit::WebPageProxy::setURLSchemeHandlerForScheme): >+ * UIProcess/WebPageProxy.h: >+ * UIProcess/WebPageProxy.messages.in: >+ * UIProcess/WebProcessPool.cpp: >+ (WebKit::WebProcessPool::tryPrewarmWithDomainInformation): >+ * UIProcess/WebProcessPool.h: >+ * UIProcess/WebProcessProxy.cpp: >+ (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch): >+ * UIProcess/WebProcessProxy.h: >+ * UIProcess/WebResourceLoadStatisticsStore.cpp: >+ (WebKit::WebResourceLoadStatisticsStore::setPrevalentResourceForDebugMode): >+ (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation): >+ * UIProcess/WebResourceLoadStatisticsStore.h: >+ * UIProcess/ios/DragDropInteractionState.h: >+ * UIProcess/ios/PageClientImplIOS.h: >+ * UIProcess/ios/PageClientImplIOS.mm: >+ (WebKit::PageClientImpl::showSafeBrowsingWarning): >+ * UIProcess/ios/WKActionSheetAssistant.mm: >+ (-[WKActionSheetAssistant _createSheetWithElementActions:showLinkTitle:]): >+ * UIProcess/ios/WKContentViewInteraction.mm: >+ (-[WKContentView actionSheetAssistant:shareElementWithURL:rect:]): >+ (-[WKContentView _presentedViewControllerForPreviewItemController:]): >+ * UIProcess/ios/WKGeolocationProviderIOS.mm: >+ (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]): >+ * UIProcess/ios/WKLegacyPDFView.mm: >+ (-[WKLegacyPDFView actionSheetAssistant:shareElementWithURL:rect:]): >+ * UIProcess/ios/WKPDFView.mm: >+ (-[WKPDFView actionSheetAssistant:shareElementWithURL:rect:]): >+ * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm: >+ (-[WKFullScreenWindowController _updateLocationInfo]): >+ * UIProcess/mac/LegacySessionStateCoding.cpp: >+ (WebKit::decodeLegacySessionState): >+ * UIProcess/mac/PageClientImplMac.h: >+ * UIProcess/mac/PageClientImplMac.mm: >+ (WebKit::PageClientImpl::showSafeBrowsingWarning): >+ * UIProcess/mac/WKImmediateActionController.mm: >+ (-[WKImmediateActionController _defaultAnimationController]): >+ * UIProcess/win/WebInspectorProxyWin.cpp: >+ * WebProcess/ApplePay/WebPaymentCoordinator.cpp: >+ (WebKit::WebPaymentCoordinator::showPaymentUI): >+ (WebKit::WebPaymentCoordinator::validateMerchant): >+ * WebProcess/ApplePay/WebPaymentCoordinator.h: >+ * WebProcess/Cache/WebCacheStorageConnection.cpp: >+ (WebKit::WebCacheStorageConnection::doRetrieveRecords): >+ * WebProcess/Cache/WebCacheStorageConnection.h: >+ * WebProcess/FileAPI/BlobRegistryProxy.cpp: >+ (WebKit::BlobRegistryProxy::registerFileBlobURL): >+ * WebProcess/FileAPI/BlobRegistryProxy.h: >+ * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h: >+ (API::InjectedBundle::PageLoaderClient::willLoadDataRequest): >+ (API::InjectedBundle::PageLoaderClient::userAgentForURL const): >+ * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp: >+ (WKBundleFrameAllowsFollowingLink): >+ (WKBundleFrameCopySuggestedFilenameForResourceWithURL): >+ (WKBundleFrameCopyMIMETypeForResourceWithURL): >+ * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: >+ (WKBundlePageHasLocalDataForURL): >+ * WebProcess/InjectedBundle/API/gtk/DOM/ConvertToUTF8String.cpp: >+ (convertToUTF8String): >+ * WebProcess/InjectedBundle/API/gtk/DOM/ConvertToUTF8String.h: >+ * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp: >+ * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h: >+ * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp: >+ * WebProcess/Network/WebLoaderStrategy.cpp: >+ (WebKit::WebLoaderStrategy::preconnectTo): >+ * WebProcess/Network/WebLoaderStrategy.h: >+ * WebProcess/Network/WebSocketProvider.h: >+ * WebProcess/Network/WebSocketStream.cpp: >+ (WebKit::WebSocketStream::WebSocketStream): >+ * WebProcess/Network/WebSocketStream.h: >+ * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: >+ * WebProcess/Plugins/Netscape/NetscapePlugin.h: >+ * WebProcess/Plugins/Netscape/NetscapePluginStream.h: >+ * WebProcess/Plugins/PDF/PDFPlugin.h: >+ * WebProcess/Plugins/PDF/PDFPlugin.mm: >+ (WebKit::PDFPlugin::clickedLink): >+ * WebProcess/Plugins/Plugin.h: >+ * WebProcess/Plugins/PluginController.h: >+ * WebProcess/Plugins/PluginProxy.h: >+ * WebProcess/Plugins/PluginView.cpp: >+ (WebKit::PluginView::performURLRequest): >+ (WebKit::PluginView::performJavaScriptURLRequest): >+ * WebProcess/Plugins/WebPluginInfoProvider.cpp: >+ (WebKit::WebPluginInfoProvider::webVisiblePluginInfo): >+ * WebProcess/Plugins/WebPluginInfoProvider.h: >+ * WebProcess/Storage/WebSWClientConnection.h: >+ * WebProcess/Storage/WebSWContextManagerConnection.h: >+ * WebProcess/UserContent/WebUserContentController.h: >+ * WebProcess/WebCoreSupport/WebChromeClient.cpp: >+ (WebKit::WebChromeClient::signedPublicKeyAndChallengeString const): >+ * WebProcess/WebCoreSupport/WebChromeClient.h: >+ * WebProcess/WebCoreSupport/WebContextMenuClient.h: >+ * WebProcess/WebCoreSupport/WebDragClient.h: >+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: >+ (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): >+ (WebKit::WebFrameLoaderClient::shouldForceUniversalAccessFromLocalURL): >+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: >+ * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: >+ (WebKit::WebPlatformStrategies::readURLFromPasteboard): >+ * WebProcess/WebCoreSupport/WebPlatformStrategies.h: >+ * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: >+ (WebKit::WebDragClient::declareAndWriteDragImage): >+ * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm: >+ * WebProcess/WebPage/VisitedLinkTableController.h: >+ * WebProcess/WebPage/WebFrame.cpp: >+ (WebKit::WebFrame::allowsFollowingLink const): >+ * WebProcess/WebPage/WebFrame.h: >+ * WebProcess/WebPage/WebPage.cpp: >+ (WebKit::WebPage::loadURLInFrame): >+ (WebKit::WebPage::loadData): >+ (WebKit::WebPage::loadAlternateHTML): >+ (WebKit::WebPage::dumpHistoryForTesting): >+ (WebKit::WebPage::sendCSPViolationReport): >+ (WebKit::WebPage::addUserScript): >+ (WebKit::WebPage::addUserStyleSheet): >+ * WebProcess/WebPage/WebPage.h: >+ * WebProcess/WebPage/WebPage.messages.in: >+ * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp: >+ (WebKit::WebPrintOperationGtk::frameURL const): >+ * WebProcess/WebPage/gtk/WebPrintOperationGtk.h: >+ * WebProcess/WebProcess.cpp: >+ (WebKit::WebProcess::sendPrewarmInformation): >+ * WebProcess/WebProcess.h: >+ * WebProcess/cocoa/WebProcessCocoa.mm: >+ (WebKit::activePagesOrigins): >+ > 2018-11-30 Alexey Proskuryakov <ap@apple.com> > > Move USE_CFNETWORK_IGNORE_HSTS to its proper place >diff --git a/Source/WebKitLegacy/ChangeLog b/Source/WebKitLegacy/ChangeLog >index 87707292c49ccddc389528024db9cb7e9fd4b9eb..24d66b8fc93cc88969652e1d31179d0d865438c2 100644 >--- a/Source/WebKitLegacy/ChangeLog >+++ b/Source/WebKitLegacy/ChangeLog >@@ -1,3 +1,13 @@ >+2018-11-30 Alex Christensen <achristensen@webkit.org> >+ >+ Move URL from WebCore to WTF >+ https://bugs.webkit.org/show_bug.cgi?id=190234 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebCoreSupport/WebResourceLoadScheduler.cpp: >+ * WebCoreSupport/WebResourceLoadScheduler.h: >+ > 2018-11-26 Brent Fulgham <bfulgham@apple.com> > > [Win] Reduce the use of WKSI library calls: CoreAnimation >diff --git a/Source/WebKitLegacy/mac/ChangeLog b/Source/WebKitLegacy/mac/ChangeLog >index 50e01ad9b05f00401430b5fde58ae47a8045483c..9aa3236f241b05ed3f5a2e2f8433a00ee2937c5a 100644 >--- a/Source/WebKitLegacy/mac/ChangeLog >+++ b/Source/WebKitLegacy/mac/ChangeLog >@@ -1,3 +1,137 @@ >+2018-11-30 Alex Christensen <achristensen@webkit.org> >+ >+ Move URL from WebCore to WTF >+ https://bugs.webkit.org/show_bug.cgi?id=190234 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * DOM/DOMAttr.mm: >+ * DOM/DOMBlob.mm: >+ * DOM/DOMCSSCharsetRule.mm: >+ * DOM/DOMCSSImportRule.mm: >+ * DOM/DOMCSSMediaRule.mm: >+ * DOM/DOMCSSPageRule.mm: >+ * DOM/DOMCSSPrimitiveValue.mm: >+ * DOM/DOMCSSRule.mm: >+ * DOM/DOMCSSStyleDeclaration.mm: >+ * DOM/DOMCSSStyleRule.mm: >+ * DOM/DOMCSSStyleSheet.mm: >+ * DOM/DOMCSSValue.mm: >+ * DOM/DOMCharacterData.mm: >+ * DOM/DOMCounter.mm: >+ * DOM/DOMDocument.mm: >+ * DOM/DOMDocumentFragment.mm: >+ * DOM/DOMDocumentType.mm: >+ * DOM/DOMEvent.mm: >+ * DOM/DOMFile.mm: >+ * DOM/DOMHTMLAnchorElement.mm: >+ * DOM/DOMHTMLAppletElement.mm: >+ * DOM/DOMHTMLAreaElement.mm: >+ * DOM/DOMHTMLBRElement.mm: >+ * DOM/DOMHTMLBaseElement.mm: >+ * DOM/DOMHTMLBaseFontElement.mm: >+ * DOM/DOMHTMLBodyElement.mm: >+ * DOM/DOMHTMLButtonElement.mm: >+ * DOM/DOMHTMLCanvasElement.mm: >+ * DOM/DOMHTMLCollection.mm: >+ * DOM/DOMHTMLDivElement.mm: >+ * DOM/DOMHTMLDocument.mm: >+ * DOM/DOMHTMLElement.mm: >+ * DOM/DOMHTMLEmbedElement.mm: >+ * DOM/DOMHTMLFieldSetElement.mm: >+ * DOM/DOMHTMLFontElement.mm: >+ * DOM/DOMHTMLFormElement.mm: >+ * DOM/DOMHTMLFrameElement.mm: >+ * DOM/DOMHTMLFrameSetElement.mm: >+ * DOM/DOMHTMLHRElement.mm: >+ * DOM/DOMHTMLHeadElement.mm: >+ * DOM/DOMHTMLHeadingElement.mm: >+ * DOM/DOMHTMLHtmlElement.mm: >+ * DOM/DOMHTMLIFrameElement.mm: >+ * DOM/DOMHTMLImageElement.mm: >+ * DOM/DOMHTMLInputElement.mm: >+ * DOM/DOMHTMLLIElement.mm: >+ * DOM/DOMHTMLLabelElement.mm: >+ * DOM/DOMHTMLLegendElement.mm: >+ * DOM/DOMHTMLLinkElement.mm: >+ * DOM/DOMHTMLMapElement.mm: >+ * DOM/DOMHTMLMarqueeElement.mm: >+ * DOM/DOMHTMLMediaElement.mm: >+ * DOM/DOMHTMLMetaElement.mm: >+ * DOM/DOMHTMLModElement.mm: >+ * DOM/DOMHTMLOListElement.mm: >+ * DOM/DOMHTMLObjectElement.mm: >+ * DOM/DOMHTMLOptGroupElement.mm: >+ * DOM/DOMHTMLOptionElement.mm: >+ * DOM/DOMHTMLOptionsCollection.mm: >+ * DOM/DOMHTMLParagraphElement.mm: >+ * DOM/DOMHTMLParamElement.mm: >+ * DOM/DOMHTMLQuoteElement.mm: >+ * DOM/DOMHTMLScriptElement.mm: >+ * DOM/DOMHTMLSelectElement.mm: >+ * DOM/DOMHTMLStyleElement.mm: >+ * DOM/DOMHTMLTableCaptionElement.mm: >+ * DOM/DOMHTMLTableCellElement.mm: >+ * DOM/DOMHTMLTableColElement.mm: >+ * DOM/DOMHTMLTableElement.mm: >+ * DOM/DOMHTMLTableRowElement.mm: >+ * DOM/DOMHTMLTableSectionElement.mm: >+ * DOM/DOMHTMLTitleElement.mm: >+ * DOM/DOMHTMLUListElement.mm: >+ * DOM/DOMHTMLVideoElement.mm: >+ * DOM/DOMKeyboardEvent.mm: >+ * DOM/DOMMediaList.mm: >+ * DOM/DOMMouseEvent.mm: >+ * DOM/DOMMutationEvent.mm: >+ * DOM/DOMNamedNodeMap.mm: >+ * DOM/DOMProcessingInstruction.mm: >+ * DOM/DOMRange.mm: >+ * DOM/DOMStyleSheet.mm: >+ * DOM/DOMText.mm: >+ * DOM/DOMTextEvent.mm: >+ * DOM/DOMTokenList.mm: >+ * DOM/DOMUIEvent.mm: >+ * DOM/DOMXPathResult.mm: >+ * History/WebHistoryItem.mm: >+ * Misc/WebNSURLExtras.mm: >+ (-[NSURL _web_userVisibleString]): >+ (-[NSURL _web_URLByRemovingUserInfo]): >+ (-[NSURL _web_dataForURLComponentType:]): >+ (-[NSURL _web_schemeData]): >+ (-[NSURL _web_hostData]): >+ * Misc/WebUserContentURLPattern.mm: >+ * Plugins/Hosted/NetscapePluginInstanceProxy.mm: >+ * Plugins/WebNetscapePluginStream.h: >+ (WebNetscapePluginStream::setRequestURL): >+ * WebCoreSupport/WebChromeClient.h: >+ * WebCoreSupport/WebChromeClient.mm: >+ (WebChromeClient::signedPublicKeyAndChallengeString const): >+ * WebCoreSupport/WebContextMenuClient.h: >+ * WebCoreSupport/WebContextMenuClient.mm: >+ * WebCoreSupport/WebDragClient.h: >+ * WebCoreSupport/WebFrameLoaderClient.h: >+ * WebCoreSupport/WebFrameLoaderClient.mm: >+ (WebFrameLoaderClient::updateGlobalHistory): >+ * WebCoreSupport/WebPaymentCoordinatorClient.h: >+ * WebCoreSupport/WebPaymentCoordinatorClient.mm: >+ (WebPaymentCoordinatorClient::showPaymentUI): >+ * WebCoreSupport/WebPlatformStrategies.h: >+ * WebCoreSupport/WebPlatformStrategies.mm: >+ (WebPlatformStrategies::readURLFromPasteboard): >+ * WebCoreSupport/WebPluginInfoProvider.h: >+ * WebCoreSupport/WebPluginInfoProvider.mm: >+ (WebPluginInfoProvider::webVisiblePluginInfo): >+ * WebCoreSupport/WebSecurityOrigin.mm: >+ * WebCoreSupport/WebVisitedLinkStore.h: >+ * WebView/WebDataSource.mm: >+ * WebView/WebFrame.mm: >+ (-[WebFrame _loadData:MIMEType:textEncodingName:baseURL:unreachableURL:]): >+ * WebView/WebImmediateActionController.mm: >+ (-[WebImmediateActionController _defaultAnimationController]): >+ * WebView/WebPDFView.mm: >+ * WebView/WebScriptDebugger.mm: >+ * WebView/WebViewInternal.h: >+ > 2018-11-28 Alex Christensen <achristensen@webkit.org> > > Remove dead code from an earlier attempt at implementing safe browsing >diff --git a/Source/WebKitLegacy/win/ChangeLog b/Source/WebKitLegacy/win/ChangeLog >index 70242b4498fa204b7f65582ae878dfa3a13c5c71..66963a0c3b7ae5f22413519e46dfa70d274fed3b 100644 >--- a/Source/WebKitLegacy/win/ChangeLog >+++ b/Source/WebKitLegacy/win/ChangeLog >@@ -1,3 +1,42 @@ >+2018-11-30 Alex Christensen <achristensen@webkit.org> >+ >+ Move URL from WebCore to WTF >+ https://bugs.webkit.org/show_bug.cgi?id=190234 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * MarshallingHelpers.cpp: >+ * MarshallingHelpers.h: >+ * Plugins/PluginDatabase.cpp: >+ * Plugins/PluginDatabase.h: >+ * Plugins/PluginDatabaseWin.cpp: >+ * Plugins/PluginStream.h: >+ * Plugins/PluginView.h: >+ * WebCoreSupport/WebContextMenuClient.h: >+ * WebCoreSupport/WebDesktopNotificationsDelegate.cpp: >+ * WebCoreSupport/WebDesktopNotificationsDelegate.h: >+ * WebCoreSupport/WebFrameLoaderClient.h: >+ * WebCoreSupport/WebPlatformStrategies.h: >+ * WebCoreSupport/WebPluginInfoProvider.cpp: >+ (WebPluginInfoProvider::webVisiblePluginInfo): >+ * WebCoreSupport/WebPluginInfoProvider.h: >+ * WebCoreSupport/WebVisitedLinkStore.h: >+ * WebDataSource.cpp: >+ * WebDownload.h: >+ * WebElementPropertyBag.cpp: >+ * WebFrame.h: >+ * WebHistory.cpp: >+ * WebHistory.h: >+ * WebHistoryItem.cpp: >+ * WebResource.cpp: >+ (WebResource::WebResource): >+ * WebResource.h: >+ * WebSecurityOrigin.cpp: >+ * WebURLResponse.cpp: >+ (WebURLResponse::createInstance): >+ * WebUserContentURLPattern.cpp: >+ * WebView.h: >+ > 2018-11-28 Alex Christensen <achristensen@webkit.org> > > Remove dead code from an earlier attempt at implementing safe browsing >diff --git a/Source/WTF/WTF.xcodeproj/project.pbxproj b/Source/WTF/WTF.xcodeproj/project.pbxproj >index 67f5509a4b0dbe47448819692904a6e113beb940..a2239490d112dca46a5aa4bcded35fdbcaaec9e9 100644 >--- a/Source/WTF/WTF.xcodeproj/project.pbxproj >+++ b/Source/WTF/WTF.xcodeproj/project.pbxproj >@@ -72,6 +72,12 @@ > 5311BD531EA71CAD00525281 /* Signals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5311BD511EA71CAD00525281 /* Signals.cpp */; }; > 5311BD5C1EA822F900525281 /* ThreadMessage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5311BD5B1EA822F900525281 /* ThreadMessage.cpp */; }; > 53534F2A1EC0E10E00141B2F /* MachExceptions.defs in Sources */ = {isa = PBXBuildFile; fileRef = 53534F291EC0E10E00141B2F /* MachExceptions.defs */; settings = {ATTRIBUTES = (Client, Server, ); }; }; >+ 5C1F05932164356B0039302C /* CFURLExtras.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C1F05912164356B0039302C /* CFURLExtras.cpp */; }; >+ 5C1F0595216437B30039302C /* URLCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C1F0594216437B30039302C /* URLCF.cpp */; }; >+ 5CC0EE7521629F1900A1A842 /* URLParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5CC0EE7321629F1900A1A842 /* URLParser.cpp */; }; >+ 5CC0EE7621629F1900A1A842 /* URL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5CC0EE7421629F1900A1A842 /* URL.cpp */; }; >+ 5CC0EE892162BC2200A1A842 /* URLCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5CC0EE862162BC2200A1A842 /* URLCocoa.mm */; }; >+ 5CC0EE8A2162BC2200A1A842 /* NSURLExtras.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5CC0EE882162BC2200A1A842 /* NSURLExtras.mm */; }; > 70A993FE1AD7151300FA615B /* SymbolRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 70A993FC1AD7151300FA615B /* SymbolRegistry.cpp */; }; > 70ECA60D1B02426800449739 /* AtomicStringImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 70ECA60A1B02426800449739 /* AtomicStringImpl.cpp */; }; > 7A05093F1FB9DCC500B33FB8 /* JSONValues.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A05093E1FB9DCC500B33FB8 /* JSONValues.cpp */; }; >@@ -359,7 +365,19 @@ > 553071C91C40427200384898 /* TinyLRUCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TinyLRUCache.h; sourceTree = "<group>"; }; > 5597F82C1D94B9970066BC21 /* SynchronizedFixedQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SynchronizedFixedQueue.h; sourceTree = "<group>"; }; > 5B43383A5D0B463C9433D933 /* IndexMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IndexMap.h; sourceTree = "<group>"; }; >+ 5C1F05912164356B0039302C /* CFURLExtras.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CFURLExtras.cpp; sourceTree = "<group>"; }; >+ 5C1F05922164356B0039302C /* CFURLExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFURLExtras.h; sourceTree = "<group>"; }; >+ 5C1F0594216437B30039302C /* URLCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = URLCF.cpp; sourceTree = "<group>"; }; >+ 5C1F0597216439940039302C /* URLHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = URLHash.h; sourceTree = "<group>"; }; > 5C7C88D31D0A3A0A009D2F6D /* UniqueRef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UniqueRef.h; sourceTree = "<group>"; }; >+ 5CC0EE7121629F1800A1A842 /* URL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = URL.h; sourceTree = "<group>"; }; >+ 5CC0EE7221629F1900A1A842 /* URLParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = URLParser.h; sourceTree = "<group>"; }; >+ 5CC0EE7321629F1900A1A842 /* URLParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = URLParser.cpp; sourceTree = "<group>"; }; >+ 5CC0EE7421629F1900A1A842 /* URL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = URL.cpp; sourceTree = "<group>"; }; >+ 5CC0EE772162A01000A1A842 /* URLHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = URLHash.h; sourceTree = "<group>"; }; >+ 5CC0EE862162BC2200A1A842 /* URLCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = URLCocoa.mm; sourceTree = "<group>"; }; >+ 5CC0EE872162BC2200A1A842 /* NSURLExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSURLExtras.h; sourceTree = "<group>"; }; >+ 5CC0EE882162BC2200A1A842 /* NSURLExtras.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NSURLExtras.mm; sourceTree = "<group>"; }; > 5D247B6214689B8600E78B76 /* libWTF.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libWTF.a; sourceTree = BUILT_PRODUCTS_DIR; }; > 5D247B6E14689C4700E78B76 /* Base.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Base.xcconfig; sourceTree = "<group>"; }; > 5D247B7014689C4700E78B76 /* DebugRelease.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = DebugRelease.xcconfig; sourceTree = "<group>"; }; >@@ -697,9 +715,12 @@ > 2CDED0F018115C3F004DBA70 /* cf */ = { > isa = PBXGroup; > children = ( >+ 5C1F05912164356B0039302C /* CFURLExtras.cpp */, >+ 5C1F05922164356B0039302C /* CFURLExtras.h */, > C2BCFC411F61D61600C9222C /* LanguageCF.cpp */, > 2CDED0EE18115C38004DBA70 /* RunLoopCF.cpp */, > 1AFDE647195201C300C48FFA /* TypeCastsCF.h */, >+ 5C1F0594216437B30039302C /* URLCF.cpp */, > ); > path = cf; > sourceTree = "<group>"; >@@ -1106,6 +1127,12 @@ > E300E521203D645F00DA79BE /* UniqueArray.h */, > 5C7C88D31D0A3A0A009D2F6D /* UniqueRef.h */, > CD7600FF1F90A3CA00026E26 /* UnsafePointer.h */, >+ 5CC0EE7421629F1900A1A842 /* URL.cpp */, >+ 5CC0EE7121629F1800A1A842 /* URL.h */, >+ 5C1F0597216439940039302C /* URLHash.h */, >+ 5CC0EE772162A01000A1A842 /* URLHash.h */, >+ 5CC0EE7321629F1900A1A842 /* URLParser.cpp */, >+ 5CC0EE7221629F1900A1A842 /* URLParser.h */, > 7AFEC6B01EB22B5900DADE36 /* UUID.cpp */, > 7AFEC6AE1EB22AC600DADE36 /* UUID.h */, > A8A4736F151A825B004123FF /* ValueCheck.h */, >@@ -1328,7 +1355,10 @@ > A8A472C5151A825A004123FF /* MainThreadCocoa.mm */, > ADF2CE651E39F106006889DB /* MemoryFootprintCocoa.cpp */, > AD89B6B91E64150F0090707F /* MemoryPressureHandlerCocoa.mm */, >+ 5CC0EE872162BC2200A1A842 /* NSURLExtras.h */, >+ 5CC0EE882162BC2200A1A842 /* NSURLExtras.mm */, > A30D412C1F0DE0BA00B71954 /* SoftLinking.h */, >+ 5CC0EE862162BC2200A1A842 /* URLCocoa.mm */, > E4A0AD3C1A96253C00536DF6 /* WorkQueueCocoa.cpp */, > ); > path = cocoa; >@@ -1418,6 +1448,7 @@ > A8A4738B151A825B004123FF /* BitVector.cpp in Sources */, > DCEE22011CEA7551000C2396 /* BlockObjCExceptions.mm in Sources */, > A8A473AC151A825B004123FF /* cached-powers.cc in Sources */, >+ 5C1F05932164356B0039302C /* CFURLExtras.cpp in Sources */, > 0F66B28A1DC97BAB004A1D3F /* ClockType.cpp in Sources */, > A8A47460151A825B004123FF /* CollatorDefault.cpp in Sources */, > A8A47463151A825B004123FF /* CollatorICU.cpp in Sources */, >@@ -1469,6 +1500,7 @@ > AD89B6BA1E64150F0090707F /* MemoryPressureHandlerCocoa.mm in Sources */, > A8A473EC151A825B004123FF /* MetaAllocator.cpp in Sources */, > 0F66B28C1DC97BAB004A1D3F /* MonotonicTime.cpp in Sources */, >+ 5CC0EE8A2162BC2200A1A842 /* NSURLExtras.mm in Sources */, > A8A473F4151A825B004123FF /* NumberOfCores.cpp in Sources */, > A8A473F7151A825B004123FF /* OSAllocatorPosix.cpp in Sources */, > A8A473F9151A825B004123FF /* OSRandomSource.cpp in Sources */, >@@ -1523,6 +1555,10 @@ > 5311BD5C1EA822F900525281 /* ThreadMessage.cpp in Sources */, > 0F66B2901DC97BAB004A1D3F /* TimeWithDynamicClockType.cpp in Sources */, > 0F7075F51FBF53CD00489AF0 /* TimingScope.cpp in Sources */, >+ 5CC0EE7621629F1900A1A842 /* URL.cpp in Sources */, >+ 5C1F0595216437B30039302C /* URLCF.cpp in Sources */, >+ 5CC0EE892162BC2200A1A842 /* URLCocoa.mm in Sources */, >+ 5CC0EE7521629F1900A1A842 /* URLParser.cpp in Sources */, > 1C181C8F1D307AB800F5FA16 /* UTextProvider.cpp in Sources */, > 1C181C911D307AB800F5FA16 /* UTextProviderLatin1.cpp in Sources */, > 1C181C931D307AB800F5FA16 /* UTextProviderUTF16.cpp in Sources */, >diff --git a/Source/WTF/wtf/CMakeLists.txt b/Source/WTF/wtf/CMakeLists.txt >index 63c70701f08dccf1e4b3379edb92c660ee7a679d..cee1cce1e57184d13bd2cd519ef6a20dffb1a96a 100644 >--- a/Source/WTF/wtf/CMakeLists.txt >+++ b/Source/WTF/wtf/CMakeLists.txt >@@ -240,6 +240,9 @@ set(WTF_PUBLIC_HEADERS > TinyPtrSet.h > TriState.h > TypeCasts.h >+ URL.h >+ URLHash.h >+ URLParser.h > UUID.h > UnalignedAccess.h > Unexpected.h >@@ -394,6 +397,8 @@ set(WTF_SOURCES > Threading.cpp > TimeWithDynamicClockType.cpp > TimingScope.cpp >+ URL.cpp >+ URLParser.cpp > UUID.cpp > WTFAssertions.cpp > WallTime.cpp >diff --git a/Source/WTF/wtf/Forward.h b/Source/WTF/wtf/Forward.h >index 5fdb5928f87a6a5ffd52cd40c2de183f4b8dcf28..b83997c83a2c0bc1d7e8e2d1d8fa45de358352ae 100644 >--- a/Source/WTF/wtf/Forward.h >+++ b/Source/WTF/wtf/Forward.h >@@ -43,6 +43,7 @@ class StringView; > class TextPosition; > class TextStream; > class UniquedStringImpl; >+class URL; > class WallTime; > > struct FastMalloc; >@@ -112,6 +113,7 @@ using WTF::StringImpl; > using WTF::StringView; > using WTF::TextPosition; > using WTF::TextStream; >+using WTF::URL; > using WTF::Variant; > using WTF::Vector; > >diff --git a/Source/WTF/wtf/PlatformGTK.cmake b/Source/WTF/wtf/PlatformGTK.cmake >index 696a1babd62cb01f7629bbe92be8f49334960b62..006fc22d6162e5243713e4ada5d4d84a5d33dade 100644 >--- a/Source/WTF/wtf/PlatformGTK.cmake >+++ b/Source/WTF/wtf/PlatformGTK.cmake >@@ -6,6 +6,7 @@ list(APPEND WTF_PUBLIC_HEADERS > glib/GRefPtr.h > glib/GTypedefs.h > glib/GUniquePtr.h >+ glib/GUniquePtrSoup.h > glib/RunLoopSourcePriority.h > glib/WTFGType.h > ) >@@ -25,6 +26,7 @@ list(APPEND WTF_SOURCES > glib/GLibUtilities.cpp > glib/GRefPtr.cpp > glib/RunLoopGLib.cpp >+ glib/URLSoup.cpp > > text/unix/TextBreakIteratorInternalICUUnix.cpp > >@@ -50,9 +52,11 @@ list(APPEND WTF_LIBRARIES > ${GLIB_GIO_LIBRARIES} > ${GLIB_GOBJECT_LIBRARIES} > ${GLIB_LIBRARIES} >+ ${LIBSOUP_LIBRARIES} > ${ZLIB_LIBRARIES} > ) > > list(APPEND WTF_SYSTEM_INCLUDE_DIRECTORIES > ${GLIB_INCLUDE_DIRS} >+ ${LIBSOUP_INCLUDE_DIRS} > ) >diff --git a/Source/WTF/wtf/PlatformMac.cmake b/Source/WTF/wtf/PlatformMac.cmake >index d9bd48f7a5d3c27eef7c00e1870b88c7b14f6199..4795f8fa4caef23ee1a8c3825dd6d9ca8894c2e3 100644 >--- a/Source/WTF/wtf/PlatformMac.cmake >+++ b/Source/WTF/wtf/PlatformMac.cmake >@@ -8,10 +8,12 @@ list(APPEND WTF_LIBRARIES > ) > > list(APPEND WTF_PUBLIC_HEADERS >+ cf/CFURLExtras.h > cf/TypeCastsCF.h > > cocoa/Entitlements.h > cocoa/MachSendRight.h >+ cocoa/NSURLExtras.h > cocoa/SoftLinking.h > > darwin/WeakLinking.h >@@ -37,8 +39,10 @@ list(APPEND WTF_SOURCES > SchedulePairCF.cpp > SchedulePairMac.mm > >+ cf/CFURLExtras.cpp > cf/LanguageCF.cpp > cf/RunLoopCF.cpp >+ cf/URLCF.cpp > > cocoa/AutodrainedPool.cpp > cocoa/CPUTimeCocoa.cpp >@@ -47,6 +51,8 @@ list(APPEND WTF_SOURCES > cocoa/MainThreadCocoa.mm > cocoa/MemoryFootprintCocoa.cpp > cocoa/MemoryPressureHandlerCocoa.mm >+ cocoa/NSURLExtras.mm >+ cocoa/URLCocoa.mm > cocoa/WorkQueueCocoa.cpp > > mac/DeprecatedSymbolsUsedBySafari.mm >diff --git a/Source/WTF/wtf/PlatformWPE.cmake b/Source/WTF/wtf/PlatformWPE.cmake >index 752b5993148f1110a293c9da9e28adef08fee40c..a02da5278eeeab8db800bc8f96f89fb972f3e1e4 100644 >--- a/Source/WTF/wtf/PlatformWPE.cmake >+++ b/Source/WTF/wtf/PlatformWPE.cmake >@@ -4,6 +4,7 @@ list(APPEND WTF_PUBLIC_HEADERS > glib/GRefPtr.h > glib/GTypedefs.h > glib/GUniquePtr.h >+ glib/GUniquePtrSoup.h > glib/RunLoopSourcePriority.h > glib/WTFGType.h > >@@ -19,6 +20,7 @@ list(APPEND WTF_SOURCES > glib/GLibUtilities.cpp > glib/GRefPtr.cpp > glib/RunLoopGLib.cpp >+ glib/URLSoup.cpp > > linux/CurrentProcessMemoryStatus.cpp > linux/MemoryFootprintLinux.cpp >@@ -35,9 +37,11 @@ list(APPEND WTF_LIBRARIES > ${GLIB_GIO_LIBRARIES} > ${GLIB_GOBJECT_LIBRARIES} > ${GLIB_LIBRARIES} >+ ${LIBSOUP_LIBRARIES} > ${ZLIB_LIBRARIES} > ) > > list(APPEND WTF_SYSTEM_INCLUDE_DIRECTORIES > ${GLIB_INCLUDE_DIRS} >+ ${LIBSOUP_INCLUDE_DIRS} > ) >diff --git a/Source/WTF/wtf/PlatformWin.cmake b/Source/WTF/wtf/PlatformWin.cmake >index 5f2275a5bdff4e8a1e13e6b74678dd66644f29f8..2b8b5f8270eb5f24676072dd124576da9301f0ea 100644 >--- a/Source/WTF/wtf/PlatformWin.cmake >+++ b/Source/WTF/wtf/PlatformWin.cmake >@@ -22,11 +22,15 @@ list(APPEND WTF_SOURCES > > if (USE_CF) > list(APPEND WTF_PUBLIC_HEADERS >+ cf/CFURLExtras.h > cf/TypeCastsCF.h > > text/cf/TextBreakIteratorCF.h > ) > list(APPEND WTF_SOURCES >+ cf/CFURLExtras.cpp >+ cf/URLCF.cpp >+ > text/cf/AtomicStringImplCF.cpp > text/cf/StringCF.cpp > text/cf/StringImplCF.cpp >diff --git a/Source/WTF/wtf/URL.cpp b/Source/WTF/wtf/URL.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..5ce17cd9de921d6c9a6216caf7e88d2b46c7f35b >--- /dev/null >+++ b/Source/WTF/wtf/URL.cpp >@@ -0,0 +1,1109 @@ >+/* >+ * Copyright (C) 2004, 2007-2008, 2011-2013, 2015-2016 Apple Inc. All rights reserved. >+ * Copyright (C) 2012 Research In Motion Limited. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include <wtf/URL.h> >+ >+#include "URLParser.h" >+#include <stdio.h> >+#include <unicode/uidna.h> >+#include <wtf/HashMap.h> >+#include <wtf/HexNumber.h> >+#include <wtf/NeverDestroyed.h> >+#include <wtf/StdLibExtras.h> >+#include <wtf/UUID.h> >+#include <wtf/text/CString.h> >+#include <wtf/text/StringBuilder.h> >+#include <wtf/text/StringConcatenateNumbers.h> >+#include <wtf/text/StringHash.h> >+#include <wtf/text/TextStream.h> >+ >+// FIXME: This file makes too much use of the + operator on String. >+// We either have to optimize that operator so it doesn't involve >+// so many allocations, or change this to use StringBuffer instead. >+ >+ >+namespace WTF { >+ >+typedef Vector<char, 512> CharBuffer; >+typedef Vector<UChar, 512> UCharBuffer; >+ >+static const unsigned invalidPortNumber = 0xFFFF; >+ >+// Copies the source to the destination, assuming all the source characters are >+// ASCII. The destination buffer must be large enough. Null characters are allowed >+// in the source string, and no attempt is made to null-terminate the result. >+static void copyASCII(const String& string, char* dest) >+{ >+ if (string.isEmpty()) >+ return; >+ >+ if (string.is8Bit()) >+ memcpy(dest, string.characters8(), string.length()); >+ else { >+ const UChar* src = string.characters16(); >+ size_t length = string.length(); >+ for (size_t i = 0; i < length; i++) >+ dest[i] = static_cast<char>(src[i]); >+ } >+} >+ >+void URL::invalidate() >+{ >+ m_isValid = false; >+ m_protocolIsInHTTPFamily = false; >+ m_cannotBeABaseURL = false; >+ m_schemeEnd = 0; >+ m_userStart = 0; >+ m_userEnd = 0; >+ m_passwordEnd = 0; >+ m_hostEnd = 0; >+ m_portLength = 0; >+ m_pathEnd = 0; >+ m_pathAfterLastSlash = 0; >+ m_queryEnd = 0; >+} >+ >+URL::URL(const URL& base, const String& relative, const URLTextEncoding* encoding) >+{ >+ URLParser parser(relative, base, encoding); >+ *this = parser.result(); >+} >+ >+static bool shouldTrimFromURL(UChar c) >+{ >+ // Browsers ignore leading/trailing whitespace and control >+ // characters from URLs. Note that c is an *unsigned* char here >+ // so this comparison should only catch control characters. >+ return c <= ' '; >+} >+ >+URL URL::isolatedCopy() const >+{ >+ URL result = *this; >+ result.m_string = result.m_string.isolatedCopy(); >+ return result; >+} >+ >+String URL::lastPathComponent() const >+{ >+ if (!hasPath()) >+ return String(); >+ >+ unsigned end = m_pathEnd - 1; >+ if (m_string[end] == '/') >+ --end; >+ >+ size_t start = m_string.reverseFind('/', end); >+ if (start < static_cast<unsigned>(m_hostEnd + m_portLength)) >+ return String(); >+ ++start; >+ >+ return m_string.substring(start, end - start + 1); >+} >+ >+StringView URL::protocol() const >+{ >+ return StringView(m_string).substring(0, m_schemeEnd); >+} >+ >+StringView URL::host() const >+{ >+ unsigned start = hostStart(); >+ return StringView(m_string).substring(start, m_hostEnd - start); >+} >+ >+std::optional<uint16_t> URL::port() const >+{ >+ if (!m_portLength) >+ return std::nullopt; >+ >+ bool ok = false; >+ unsigned number; >+ if (m_string.is8Bit()) >+ number = charactersToUIntStrict(m_string.characters8() + m_hostEnd + 1, m_portLength - 1, &ok); >+ else >+ number = charactersToUIntStrict(m_string.characters16() + m_hostEnd + 1, m_portLength - 1, &ok); >+ if (!ok || number > std::numeric_limits<uint16_t>::max()) >+ return std::nullopt; >+ return number; >+} >+ >+String URL::hostAndPort() const >+{ >+ if (auto port = this->port()) >+ return makeString(host(), ':', static_cast<unsigned>(port.value())); >+ return host().toString(); >+} >+ >+String URL::protocolHostAndPort() const >+{ >+ String result = m_string.substring(0, m_hostEnd + m_portLength); >+ >+ if (m_passwordEnd - m_userStart > 0) { >+ const int allowForTrailingAtSign = 1; >+ result.remove(m_userStart, m_passwordEnd - m_userStart + allowForTrailingAtSign); >+ } >+ >+ return result; >+} >+ >+static String decodeEscapeSequencesFromParsedURL(StringView input) >+{ >+ auto inputLength = input.length(); >+ if (!inputLength) >+ return emptyString(); >+ Vector<LChar> percentDecoded; >+ percentDecoded.reserveInitialCapacity(inputLength); >+ for (unsigned i = 0; i < inputLength; ++i) { >+ if (input[i] == '%' >+ && inputLength > 2 >+ && i < inputLength - 2 >+ && isASCIIHexDigit(input[i + 1]) >+ && isASCIIHexDigit(input[i + 2])) { >+ percentDecoded.uncheckedAppend(toASCIIHexValue(input[i + 1], input[i + 2])); >+ i += 2; >+ } else >+ percentDecoded.uncheckedAppend(input[i]); >+ } >+ return String::fromUTF8(percentDecoded.data(), percentDecoded.size()); >+} >+ >+String URL::user() const >+{ >+ return decodeEscapeSequencesFromParsedURL(StringView(m_string).substring(m_userStart, m_userEnd - m_userStart)); >+} >+ >+String URL::pass() const >+{ >+ if (m_passwordEnd == m_userEnd) >+ return String(); >+ >+ return decodeEscapeSequencesFromParsedURL(StringView(m_string).substring(m_userEnd + 1, m_passwordEnd - m_userEnd - 1)); >+} >+ >+String URL::encodedUser() const >+{ >+ return m_string.substring(m_userStart, m_userEnd - m_userStart); >+} >+ >+String URL::encodedPass() const >+{ >+ if (m_passwordEnd == m_userEnd) >+ return String(); >+ >+ return m_string.substring(m_userEnd + 1, m_passwordEnd - m_userEnd - 1); >+} >+ >+String URL::fragmentIdentifier() const >+{ >+ if (!hasFragmentIdentifier()) >+ return String(); >+ >+ return m_string.substring(m_queryEnd + 1); >+} >+ >+bool URL::hasFragmentIdentifier() const >+{ >+ return m_isValid && m_string.length() != m_queryEnd; >+} >+ >+String URL::baseAsString() const >+{ >+ return m_string.left(m_pathAfterLastSlash); >+} >+ >+#if !USE(CF) >+ >+String URL::fileSystemPath() const >+{ >+ if (!isValid() || !isLocalFile()) >+ return String(); >+ >+ return decodeEscapeSequencesFromParsedURL(StringView(path())); >+} >+ >+#endif >+ >+#ifdef NDEBUG >+ >+static inline void assertProtocolIsGood(StringView) >+{ >+} >+ >+#else >+ >+static void assertProtocolIsGood(StringView protocol) >+{ >+ // FIXME: We probably don't need this function any more. >+ // The isASCIIAlphaCaselessEqual function asserts that passed-in characters >+ // are ones it can handle; the older code did not and relied on these checks. >+ for (auto character : protocol.codeUnits()) { >+ ASSERT(isASCII(character)); >+ ASSERT(character > ' '); >+ ASSERT(!isASCIIUpper(character)); >+ ASSERT(toASCIILowerUnchecked(character) == character); >+ } >+} >+ >+#endif >+ >+static Lock defaultPortForProtocolMapForTestingLock; >+ >+using DefaultPortForProtocolMapForTesting = HashMap<String, uint16_t>; >+static DefaultPortForProtocolMapForTesting*& defaultPortForProtocolMapForTesting() >+{ >+ static DefaultPortForProtocolMapForTesting* defaultPortForProtocolMap; >+ return defaultPortForProtocolMap; >+} >+ >+static DefaultPortForProtocolMapForTesting& ensureDefaultPortForProtocolMapForTesting() >+{ >+ DefaultPortForProtocolMapForTesting*& defaultPortForProtocolMap = defaultPortForProtocolMapForTesting(); >+ if (!defaultPortForProtocolMap) >+ defaultPortForProtocolMap = new DefaultPortForProtocolMapForTesting; >+ return *defaultPortForProtocolMap; >+} >+ >+void registerDefaultPortForProtocolForTesting(uint16_t port, const String& protocol) >+{ >+ auto locker = holdLock(defaultPortForProtocolMapForTestingLock); >+ ensureDefaultPortForProtocolMapForTesting().add(protocol, port); >+} >+ >+void clearDefaultPortForProtocolMapForTesting() >+{ >+ auto locker = holdLock(defaultPortForProtocolMapForTestingLock); >+ if (auto* map = defaultPortForProtocolMapForTesting()) >+ map->clear(); >+} >+ >+std::optional<uint16_t> defaultPortForProtocol(StringView protocol) >+{ >+ if (auto* overrideMap = defaultPortForProtocolMapForTesting()) { >+ auto locker = holdLock(defaultPortForProtocolMapForTestingLock); >+ ASSERT(overrideMap); // No need to null check again here since overrideMap cannot become null after being non-null. >+ auto iterator = overrideMap->find(protocol.toStringWithoutCopying()); >+ if (iterator != overrideMap->end()) >+ return iterator->value; >+ } >+ return URLParser::defaultPortForProtocol(protocol); >+} >+ >+bool isDefaultPortForProtocol(uint16_t port, StringView protocol) >+{ >+ return defaultPortForProtocol(protocol) == port; >+} >+ >+bool URL::protocolIs(const char* protocol) const >+{ >+ assertProtocolIsGood(StringView(reinterpret_cast<const LChar*>(protocol), strlen(protocol))); >+ >+ // JavaScript URLs are "valid" and should be executed even if URL decides they are invalid. >+ // The free function protocolIsJavaScript() should be used instead. >+ ASSERT(!equalLettersIgnoringASCIICase(StringView(protocol), "javascript")); >+ >+ if (!m_isValid) >+ return false; >+ >+ // Do the comparison without making a new string object. >+ for (unsigned i = 0; i < m_schemeEnd; ++i) { >+ if (!protocol[i] || !isASCIIAlphaCaselessEqual(m_string[i], protocol[i])) >+ return false; >+ } >+ return !protocol[m_schemeEnd]; // We should have consumed all characters in the argument. >+} >+ >+bool URL::protocolIs(StringView protocol) const >+{ >+ assertProtocolIsGood(protocol); >+ >+ if (!m_isValid) >+ return false; >+ >+ if (m_schemeEnd != protocol.length()) >+ return false; >+ >+ // Do the comparison without making a new string object. >+ for (unsigned i = 0; i < m_schemeEnd; ++i) { >+ if (!isASCIIAlphaCaselessEqual(m_string[i], protocol[i])) >+ return false; >+ } >+ return true; >+} >+ >+String URL::query() const >+{ >+ if (m_queryEnd == m_pathEnd) >+ return String(); >+ >+ return m_string.substring(m_pathEnd + 1, m_queryEnd - (m_pathEnd + 1)); >+} >+ >+String URL::path() const >+{ >+ unsigned portEnd = m_hostEnd + m_portLength; >+ return m_string.substring(portEnd, m_pathEnd - portEnd); >+} >+ >+bool URL::setProtocol(const String& s) >+{ >+ // Firefox and IE remove everything after the first ':'. >+ size_t separatorPosition = s.find(':'); >+ String newProtocol = s.substring(0, separatorPosition); >+ auto canonicalized = URLParser::maybeCanonicalizeScheme(newProtocol); >+ if (!canonicalized) >+ return false; >+ >+ if (!m_isValid) { >+ URLParser parser(makeString(*canonicalized, ":", m_string)); >+ *this = parser.result(); >+ return true; >+ } >+ >+ URLParser parser(makeString(*canonicalized, m_string.substring(m_schemeEnd))); >+ *this = parser.result(); >+ return true; >+} >+ >+static bool isAllASCII(StringView string) >+{ >+ if (string.is8Bit()) >+ return charactersAreAllASCII(string.characters8(), string.length()); >+ return charactersAreAllASCII(string.characters16(), string.length()); >+} >+ >+// Appends the punycoded hostname identified by the given string and length to >+// the output buffer. The result will not be null terminated. >+// Return value of false means error in encoding. >+static bool appendEncodedHostname(UCharBuffer& buffer, StringView string) >+{ >+ // Needs to be big enough to hold an IDN-encoded name. >+ // For host names bigger than this, we won't do IDN encoding, which is almost certainly OK. >+ const unsigned hostnameBufferLength = 2048; >+ >+ if (string.length() > hostnameBufferLength || isAllASCII(string)) { >+ append(buffer, string); >+ return true; >+ } >+ >+ UChar hostnameBuffer[hostnameBufferLength]; >+ UErrorCode error = U_ZERO_ERROR; >+ UIDNAInfo processingDetails = UIDNA_INFO_INITIALIZER; >+ int32_t numCharactersConverted = uidna_nameToASCII(&URLParser::internationalDomainNameTranscoder(), >+ string.upconvertedCharacters(), string.length(), hostnameBuffer, hostnameBufferLength, &processingDetails, &error); >+ >+ if (U_SUCCESS(error) && !processingDetails.errors) { >+ buffer.append(hostnameBuffer, numCharactersConverted); >+ return true; >+ } >+ return false; >+} >+ >+unsigned URL::hostStart() const >+{ >+ return (m_passwordEnd == m_userStart) ? m_passwordEnd : m_passwordEnd + 1; >+} >+ >+void URL::setHost(const String& s) >+{ >+ if (!m_isValid) >+ return; >+ >+ auto colonIndex = s.find(':'); >+ if (colonIndex != notFound) >+ return; >+ >+ UCharBuffer encodedHostName; >+ if (!appendEncodedHostname(encodedHostName, s)) >+ return; >+ >+ bool slashSlashNeeded = m_userStart == static_cast<unsigned>(m_schemeEnd + 1); >+ >+ StringBuilder builder; >+ builder.append(m_string.left(hostStart())); >+ if (slashSlashNeeded) >+ builder.appendLiteral("//"); >+ builder.append(StringView(encodedHostName.data(), encodedHostName.size())); >+ builder.append(m_string.substring(m_hostEnd)); >+ >+ URLParser parser(builder.toString()); >+ *this = parser.result(); >+} >+ >+void URL::removePort() >+{ >+ if (!m_portLength) >+ return; >+ URLParser parser(makeString(StringView(m_string).left(m_hostEnd), StringView(m_string).substring(m_hostEnd + m_portLength))); >+ *this = parser.result(); >+} >+ >+void URL::setPort(unsigned short i) >+{ >+ if (!m_isValid) >+ return; >+ >+ bool colonNeeded = !m_portLength; >+ unsigned portStart = (colonNeeded ? m_hostEnd : m_hostEnd + 1); >+ >+ URLParser parser(makeString(StringView(m_string).left(portStart), (colonNeeded ? ":" : ""), String::number(i), StringView(m_string).substring(m_hostEnd + m_portLength))); >+ *this = parser.result(); >+} >+ >+void URL::setHostAndPort(const String& hostAndPort) >+{ >+ if (!m_isValid) >+ return; >+ >+ StringView hostName(hostAndPort); >+ StringView port; >+ >+ auto colonIndex = hostName.find(':'); >+ if (colonIndex != notFound) { >+ port = hostName.substring(colonIndex + 1); >+ bool ok; >+ int portInt = port.toIntStrict(ok); >+ if (!ok || portInt < 0) >+ return; >+ hostName = hostName.substring(0, colonIndex); >+ } >+ >+ if (hostName.isEmpty()) >+ return; >+ >+ UCharBuffer encodedHostName; >+ if (!appendEncodedHostname(encodedHostName, hostName)) >+ return; >+ >+ bool slashSlashNeeded = m_userStart == static_cast<unsigned>(m_schemeEnd + 1); >+ >+ StringBuilder builder; >+ builder.append(m_string.left(hostStart())); >+ if (slashSlashNeeded) >+ builder.appendLiteral("//"); >+ builder.append(StringView(encodedHostName.data(), encodedHostName.size())); >+ if (!port.isEmpty()) { >+ builder.appendLiteral(":"); >+ builder.append(port); >+ } >+ builder.append(StringView(m_string).substring(m_hostEnd + m_portLength)); >+ >+ URLParser parser(builder.toString()); >+ *this = parser.result(); >+} >+ >+static String percentEncodeCharacters(const String& input, bool(*shouldEncode)(UChar)) >+{ >+ auto encode = [shouldEncode] (const String& input) { >+ CString utf8 = input.utf8(); >+ auto* data = utf8.data(); >+ StringBuilder builder; >+ auto length = utf8.length(); >+ for (unsigned j = 0; j < length; j++) { >+ auto c = data[j]; >+ if (shouldEncode(c)) { >+ builder.append('%'); >+ builder.append(upperNibbleToASCIIHexDigit(c)); >+ builder.append(lowerNibbleToASCIIHexDigit(c)); >+ } else >+ builder.append(c); >+ } >+ return builder.toString(); >+ }; >+ >+ for (size_t i = 0; i < input.length(); ++i) { >+ if (UNLIKELY(shouldEncode(input[i]))) >+ return encode(input); >+ } >+ return input; >+} >+ >+void URL::setUser(const String& user) >+{ >+ if (!m_isValid) >+ return; >+ >+ // FIXME: Non-ASCII characters must be encoded and escaped to match parse() expectations, >+ // and to avoid changing more than just the user login. >+ >+ unsigned end = m_userEnd; >+ if (!user.isEmpty()) { >+ String u = percentEncodeCharacters(user, URLParser::isInUserInfoEncodeSet); >+ if (m_userStart == static_cast<unsigned>(m_schemeEnd + 1)) >+ u = "//" + u; >+ // Add '@' if we didn't have one before. >+ if (end == m_hostEnd || (end == m_passwordEnd && m_string[end] != '@')) >+ u.append('@'); >+ URLParser parser(makeString(StringView(m_string).left(m_userStart), u, StringView(m_string).substring(end))); >+ *this = parser.result(); >+ } else { >+ // Remove '@' if we now have neither user nor password. >+ if (m_userEnd == m_passwordEnd && end != m_hostEnd && m_string[end] == '@') >+ end += 1; >+ // We don't want to parse in the extremely common case where we are not going to make a change. >+ if (m_userStart != end) { >+ URLParser parser(makeString(StringView(m_string).left(m_userStart), StringView(m_string).substring(end))); >+ *this = parser.result(); >+ } >+ } >+} >+ >+void URL::setPass(const String& password) >+{ >+ if (!m_isValid) >+ return; >+ >+ unsigned end = m_passwordEnd; >+ if (!password.isEmpty()) { >+ String p = ":" + percentEncodeCharacters(password, URLParser::isInUserInfoEncodeSet) + "@"; >+ if (m_userEnd == static_cast<unsigned>(m_schemeEnd + 1)) >+ p = "//" + p; >+ // Eat the existing '@' since we are going to add our own. >+ if (end != m_hostEnd && m_string[end] == '@') >+ end += 1; >+ URLParser parser(makeString(StringView(m_string).left(m_userEnd), p, StringView(m_string).substring(end))); >+ *this = parser.result(); >+ } else { >+ // Remove '@' if we now have neither user nor password. >+ if (m_userStart == m_userEnd && end != m_hostEnd && m_string[end] == '@') >+ end += 1; >+ // We don't want to parse in the extremely common case where we are not going to make a change. >+ if (m_userEnd != end) { >+ URLParser parser(makeString(StringView(m_string).left(m_userEnd), StringView(m_string).substring(end))); >+ *this = parser.result(); >+ } >+ } >+} >+ >+void URL::setFragmentIdentifier(StringView identifier) >+{ >+ if (!m_isValid) >+ return; >+ >+ // FIXME: Optimize the case where the identifier already happens to be equal to what was passed? >+ // FIXME: Is it correct to do this without encoding and escaping non-ASCII characters? >+ *this = URLParser { makeString(StringView { m_string }.substring(0, m_queryEnd), '#', identifier) }.result(); >+} >+ >+void URL::removeFragmentIdentifier() >+{ >+ if (!m_isValid) { >+ ASSERT(!m_queryEnd); >+ return; >+ } >+ if (m_isValid && m_string.length() > m_queryEnd) >+ m_string = m_string.left(m_queryEnd); >+} >+ >+void URL::removeQueryAndFragmentIdentifier() >+{ >+ if (!m_isValid) >+ return; >+ >+ m_string = m_string.left(m_pathEnd); >+ m_queryEnd = m_pathEnd; >+} >+ >+void URL::setQuery(const String& query) >+{ >+ if (!m_isValid) >+ return; >+ >+ // FIXME: '#' and non-ASCII characters must be encoded and escaped. >+ // Usually, the query is encoded using document encoding, not UTF-8, but we don't have >+ // access to the document in this function. >+ // https://webkit.org/b/161176 >+ if ((query.isEmpty() || query[0] != '?') && !query.isNull()) { >+ URLParser parser(makeString(StringView(m_string).left(m_pathEnd), "?", query, StringView(m_string).substring(m_queryEnd))); >+ *this = parser.result(); >+ } else { >+ URLParser parser(makeString(StringView(m_string).left(m_pathEnd), query, StringView(m_string).substring(m_queryEnd))); >+ *this = parser.result(); >+ } >+ >+} >+ >+void URL::setPath(const String& s) >+{ >+ if (!m_isValid) >+ return; >+ >+ String path = s; >+ if (path.isEmpty() || path[0] != '/') >+ path = "/" + path; >+ >+ auto questionMarkOrNumberSign = [] (UChar character) { >+ return character == '?' || character == '#'; >+ }; >+ URLParser parser(makeString(StringView(m_string).left(m_hostEnd + m_portLength), percentEncodeCharacters(path, questionMarkOrNumberSign), StringView(m_string).substring(m_pathEnd))); >+ *this = parser.result(); >+} >+ >+bool equalIgnoringFragmentIdentifier(const URL& a, const URL& b) >+{ >+ if (a.m_queryEnd != b.m_queryEnd) >+ return false; >+ unsigned queryLength = a.m_queryEnd; >+ for (unsigned i = 0; i < queryLength; ++i) >+ if (a.string()[i] != b.string()[i]) >+ return false; >+ return true; >+} >+ >+bool equalIgnoringQueryAndFragment(const URL& a, const URL& b) >+{ >+ if (a.pathEnd() != b.pathEnd()) >+ return false; >+ unsigned pathEnd = a.pathEnd(); >+ for (unsigned i = 0; i < pathEnd; ++i) { >+ if (a.string()[i] != b.string()[i]) >+ return false; >+ } >+ return true; >+} >+ >+bool protocolHostAndPortAreEqual(const URL& a, const URL& b) >+{ >+ if (a.m_schemeEnd != b.m_schemeEnd) >+ return false; >+ >+ unsigned hostStartA = a.hostStart(); >+ unsigned hostLengthA = a.m_hostEnd - hostStartA; >+ unsigned hostStartB = b.hostStart(); >+ unsigned hostLengthB = b.m_hostEnd - b.hostStart(); >+ if (hostLengthA != hostLengthB) >+ return false; >+ >+ // Check the scheme >+ for (unsigned i = 0; i < a.m_schemeEnd; ++i) { >+ if (a.string()[i] != b.string()[i]) >+ return false; >+ } >+ >+ // And the host >+ for (unsigned i = 0; i < hostLengthA; ++i) { >+ if (a.string()[hostStartA + i] != b.string()[hostStartB + i]) >+ return false; >+ } >+ >+ if (a.port() != b.port()) >+ return false; >+ >+ return true; >+} >+ >+bool hostsAreEqual(const URL& a, const URL& b) >+{ >+ unsigned hostStartA = a.hostStart(); >+ unsigned hostLengthA = a.m_hostEnd - hostStartA; >+ unsigned hostStartB = b.hostStart(); >+ unsigned hostLengthB = b.m_hostEnd - hostStartB; >+ if (hostLengthA != hostLengthB) >+ return false; >+ >+ for (unsigned i = 0; i < hostLengthA; ++i) { >+ if (a.string()[hostStartA + i] != b.string()[hostStartB + i]) >+ return false; >+ } >+ >+ return true; >+} >+ >+bool URL::isMatchingDomain(const String& domain) const >+{ >+ if (isNull()) >+ return false; >+ >+ if (domain.isEmpty()) >+ return true; >+ >+ if (!protocolIsInHTTPFamily()) >+ return false; >+ >+ auto host = this->host(); >+ if (!host.endsWith(domain)) >+ return false; >+ >+ return host.length() == domain.length() || host[host.length() - domain.length() - 1] == '.'; >+} >+ >+String encodeWithURLEscapeSequences(const String& input) >+{ >+ return percentEncodeCharacters(input, URLParser::isInUserInfoEncodeSet); >+} >+ >+bool URL::isHierarchical() const >+{ >+ if (!m_isValid) >+ return false; >+ ASSERT(m_string[m_schemeEnd] == ':'); >+ return m_string[m_schemeEnd + 1] == '/'; >+} >+ >+void URL::copyToBuffer(Vector<char, 512>& buffer) const >+{ >+ // FIXME: This throws away the high bytes of all the characters in the string! >+ // That's fine for a valid URL, which is all ASCII, but not for invalid URLs. >+ buffer.resize(m_string.length()); >+ copyASCII(m_string, buffer.data()); >+} >+ >+template<typename StringClass> >+bool protocolIsInternal(const StringClass& url, const char* protocol) >+{ >+ // Do the comparison without making a new string object. >+ assertProtocolIsGood(StringView(reinterpret_cast<const LChar*>(protocol), strlen(protocol))); >+ bool isLeading = true; >+ for (unsigned i = 0, j = 0; url[i]; ++i) { >+ // Skip leading whitespace and control characters. >+ if (isLeading && shouldTrimFromURL(url[i])) >+ continue; >+ isLeading = false; >+ >+ // Skip any tabs and newlines. >+ if (url[i] == '\t' || url[i] == '\r' || url[i] == '\n') >+ continue; >+ >+ if (!protocol[j]) >+ return url[i] == ':'; >+ if (!isASCIIAlphaCaselessEqual(url[i], protocol[j])) >+ return false; >+ >+ ++j; >+ } >+ >+ return false; >+} >+ >+bool protocolIs(const String& url, const char* protocol) >+{ >+ return protocolIsInternal(url, protocol); >+} >+ >+inline bool URL::protocolIs(const String& string, const char* protocol) >+{ >+ return WTF::protocolIsInternal(string, protocol); >+} >+ >+#ifndef NDEBUG >+ >+void URL::print() const >+{ >+ printf("%s\n", m_string.utf8().data()); >+} >+ >+#endif >+ >+String URL::strippedForUseAsReferrer() const >+{ >+ URL referrer(*this); >+ referrer.setUser(String()); >+ referrer.setPass(String()); >+ referrer.removeFragmentIdentifier(); >+ return referrer.string(); >+} >+ >+bool URL::isLocalFile() const >+{ >+ // Including feed here might be a bad idea since drag and drop uses this check >+ // and including feed would allow feeds to potentially let someone's blog >+ // read the contents of the clipboard on a drag, even without a drop. >+ // Likewise with using the FrameLoader::shouldTreatURLAsLocal() function. >+ return protocolIs("file"); >+} >+ >+bool protocolIsJavaScript(const String& url) >+{ >+ return protocolIsInternal(url, "javascript"); >+} >+ >+bool protocolIsJavaScript(StringView url) >+{ >+ return protocolIsInternal(url, "javascript"); >+} >+ >+bool protocolIsInHTTPFamily(const String& url) >+{ >+ auto length = url.length(); >+ // Do the comparison without making a new string object. >+ return length >= 5 >+ && isASCIIAlphaCaselessEqual(url[0], 'h') >+ && isASCIIAlphaCaselessEqual(url[1], 't') >+ && isASCIIAlphaCaselessEqual(url[2], 't') >+ && isASCIIAlphaCaselessEqual(url[3], 'p') >+ && (url[4] == ':' || (isASCIIAlphaCaselessEqual(url[4], 's') && length >= 6 && url[5] == ':')); >+} >+ >+const URL& blankURL() >+{ >+ static NeverDestroyed<URL> staticBlankURL(URL(), "about:blank"); >+ return staticBlankURL; >+} >+ >+bool URL::protocolIsAbout() const >+{ >+ return protocolIs("about"); >+} >+ >+bool portAllowed(const URL& url) >+{ >+ std::optional<uint16_t> port = url.port(); >+ >+ // Since most URLs don't have a port, return early for the "no port" case. >+ if (!port) >+ return true; >+ >+ // This blocked port list matches the port blocking that Mozilla implements. >+ // See http://www.mozilla.org/projects/netlib/PortBanning.html for more information. >+ static const uint16_t blockedPortList[] = { >+ 1, // tcpmux >+ 7, // echo >+ 9, // discard >+ 11, // systat >+ 13, // daytime >+ 15, // netstat >+ 17, // qotd >+ 19, // chargen >+ 20, // FTP-data >+ 21, // FTP-control >+ 22, // SSH >+ 23, // telnet >+ 25, // SMTP >+ 37, // time >+ 42, // name >+ 43, // nicname >+ 53, // domain >+ 77, // priv-rjs >+ 79, // finger >+ 87, // ttylink >+ 95, // supdup >+ 101, // hostriame >+ 102, // iso-tsap >+ 103, // gppitnp >+ 104, // acr-nema >+ 109, // POP2 >+ 110, // POP3 >+ 111, // sunrpc >+ 113, // auth >+ 115, // SFTP >+ 117, // uucp-path >+ 119, // nntp >+ 123, // NTP >+ 135, // loc-srv / epmap >+ 139, // netbios >+ 143, // IMAP2 >+ 179, // BGP >+ 389, // LDAP >+ 427, // SLP (Also used by Apple Filing Protocol) >+ 465, // SMTP+SSL >+ 512, // print / exec >+ 513, // login >+ 514, // shell >+ 515, // printer >+ 526, // tempo >+ 530, // courier >+ 531, // Chat >+ 532, // netnews >+ 540, // UUCP >+ 548, // afpovertcp [Apple addition] >+ 556, // remotefs >+ 563, // NNTP+SSL >+ 587, // ESMTP >+ 601, // syslog-conn >+ 636, // LDAP+SSL >+ 993, // IMAP+SSL >+ 995, // POP3+SSL >+ 2049, // NFS >+ 3659, // apple-sasl / PasswordServer [Apple addition] >+ 4045, // lockd >+ 4190, // ManageSieve [Apple addition] >+ 6000, // X11 >+ 6665, // Alternate IRC [Apple addition] >+ 6666, // Alternate IRC [Apple addition] >+ 6667, // Standard IRC [Apple addition] >+ 6668, // Alternate IRC [Apple addition] >+ 6669, // Alternate IRC [Apple addition] >+ 6679, // Alternate IRC SSL [Apple addition] >+ 6697, // IRC+SSL [Apple addition] >+ invalidPortNumber, // Used to block all invalid port numbers >+ }; >+ >+ // If the port is not in the blocked port list, allow it. >+ ASSERT(std::is_sorted(std::begin(blockedPortList), std::end(blockedPortList))); >+ if (!std::binary_search(std::begin(blockedPortList), std::end(blockedPortList), port.value())) >+ return true; >+ >+ // Allow ports 21 and 22 for FTP URLs, as Mozilla does. >+ if ((port.value() == 21 || port.value() == 22) && url.protocolIs("ftp")) >+ return true; >+ >+ // Allow any port number in a file URL, since the port number is ignored. >+ if (url.protocolIs("file")) >+ return true; >+ >+ return false; >+} >+ >+String mimeTypeFromDataURL(const String& url) >+{ >+ ASSERT(protocolIsInternal(url, "data")); >+ >+ // FIXME: What's the right behavior when the URL has a comma first, but a semicolon later? >+ // Currently this code will break at the semicolon in that case. Not sure that's correct. >+ auto index = url.find(';', 5); >+ if (index == notFound) >+ index = url.find(',', 5); >+ if (index == notFound) { >+ // FIXME: There was an old comment here that made it sound like this should be returning text/plain. >+ // But we have been returning empty string here for some time, so not changing its behavior at this time. >+ return emptyString(); >+ } >+ if (index == 5) >+ return "text/plain"_s; >+ ASSERT(index >= 5); >+ return url.substring(5, index - 5).convertToASCIILowercase(); >+} >+ >+String URL::stringCenterEllipsizedToLength(unsigned length) const >+{ >+ if (string().length() <= length) >+ return string(); >+ >+ return string().left(length / 2 - 1) + "..." + string().right(length / 2 - 2); >+} >+ >+URL URL::fakeURLWithRelativePart(const String& relativePart) >+{ >+ return URL(URL(), "webkit-fake-url://" + createCanonicalUUIDString() + '/' + relativePart); >+} >+ >+URL URL::fileURLWithFileSystemPath(const String& filePath) >+{ >+ return URL(URL(), "file:///" + filePath); >+} >+ >+TextStream& operator<<(TextStream& ts, const URL& url) >+{ >+ ts << url.string(); >+ return ts; >+} >+ >+#if !PLATFORM(COCOA) && !USE(SOUP) >+static bool isIPv4Address(StringView string) >+{ >+ auto count = 0; >+ >+ for (const auto octet : string.splitAllowingEmptyEntries('.')) { >+ if (count >= 4) >+ return false; >+ >+ const auto length = octet.length(); >+ if (!length || length > 3) >+ return false; >+ >+ auto value = 0; >+ for (auto i = 0u; i < length; ++i) { >+ const auto digit = octet[i]; >+ >+ // Prohibit leading zeroes. >+ if (digit > '9' || digit < (!i && length > 1 ? '1' : '0')) >+ return false; >+ >+ value = 10 * value + (digit - '0'); >+ } >+ >+ if (value > 255) >+ return false; >+ >+ count++; >+ } >+ >+ return (count == 4); >+} >+ >+static bool isIPv6Address(StringView string) >+{ >+ enum SkipState { None, WillSkip, Skipping, Skipped, Final }; >+ auto skipState = None; >+ auto count = 0; >+ >+ for (const auto hextet : string.splitAllowingEmptyEntries(':')) { >+ if (count >= 8 || skipState == Final) >+ return false; >+ >+ const auto length = hextet.length(); >+ if (!length) { >+ // :: may be used anywhere to skip 1 to 8 hextets, but only once. >+ if (skipState == Skipped) >+ return false; >+ >+ if (skipState == None) >+ skipState = !count ? WillSkip : Skipping; >+ else if (skipState == WillSkip) >+ skipState = Skipping; >+ else >+ skipState = Final; >+ continue; >+ } >+ >+ if (skipState == WillSkip) >+ return false; >+ >+ if (skipState == Skipping) >+ skipState = Skipped; >+ >+ if (length > 4) { >+ // An IPv4 address may be used in place of the final two hextets. >+ if ((skipState == None && count != 6) || (skipState == Skipped && count >= 6) || !isIPv4Address(hextet)) >+ return false; >+ >+ skipState = Final; >+ continue; >+ } >+ >+ for (const auto codeUnit : hextet.codeUnits()) { >+ // IPv6 allows leading zeroes. >+ if (!isASCIIHexDigit(codeUnit)) >+ return false; >+ } >+ >+ count++; >+ } >+ >+ return (count == 8 && skipState == None) || skipState == Skipped || skipState == Final; >+} >+ >+bool URL::hostIsIPAddress(StringView host) >+{ >+ if (host.find(':') == notFound) >+ return isIPv4Address(host); >+ >+ return isIPv6Address(host); >+} >+#endif >+ >+} // namespace WTF >diff --git a/Source/WTF/wtf/URL.h b/Source/WTF/wtf/URL.h >new file mode 100644 >index 0000000000000000000000000000000000000000..9979e69b096c5f05e718c6329ffb7e6f7267c8e8 >--- /dev/null >+++ b/Source/WTF/wtf/URL.h >@@ -0,0 +1,393 @@ >+/* >+ * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2011, 2012, 2013 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include <wtf/Forward.h> >+#include <wtf/RetainPtr.h> >+#include <wtf/text/WTFString.h> >+ >+#if USE(CF) >+typedef const struct __CFURL* CFURLRef; >+#endif >+ >+#if USE(SOUP) >+#include <wtf/glib/GUniquePtrSoup.h> >+#endif >+ >+#if USE(FOUNDATION) >+OBJC_CLASS NSURL; >+#endif >+ >+namespace WTF { >+class TextStream; >+ >+class URLTextEncoding { >+public: >+ virtual Vector<uint8_t> encodeForURLParsing(StringView) const = 0; >+ virtual ~URLTextEncoding() { }; >+}; >+ >+struct URLHash; >+ >+class WTF_EXPORT_PRIVATE URL { >+public: >+ // Generates a URL which contains a null string. >+ URL() { invalidate(); } >+ >+ explicit URL(WTF::HashTableDeletedValueType) : m_string(WTF::HashTableDeletedValue) { } >+ bool isHashTableDeletedValue() const { return string().isHashTableDeletedValue(); } >+ >+ // Resolves the relative URL with the given base URL. If provided, the >+ // URLTextEncoding is used to encode non-ASCII characers. The base URL can be >+ // null or empty, in which case the relative URL will be interpreted as >+ // absolute. >+ // FIXME: If the base URL is invalid, this always creates an invalid >+ // URL. Instead I think it would be better to treat all invalid base URLs >+ // the same way we treate null and empty base URLs. >+ URL(const URL& base, const String& relative, const URLTextEncoding* = nullptr); >+ >+ static URL fakeURLWithRelativePart(const String&); >+ static URL fileURLWithFileSystemPath(const String&); >+ >+ String strippedForUseAsReferrer() const; >+ >+ // FIXME: The above functions should be harmonized so that passing a >+ // base of null or the empty string gives the same result as the >+ // standard String constructor. >+ >+ // Makes a deep copy. Helpful only if you need to use a URL on another >+ // thread. Since the underlying StringImpl objects are immutable, there's >+ // no other reason to ever prefer isolatedCopy() over plain old assignment. >+ URL isolatedCopy() const; >+ >+ bool isNull() const; >+ bool isEmpty() const; >+ bool isValid() const; >+ >+ // Returns true if you can set the host and port for the URL. >+ // Non-hierarchical URLs don't have a host and port. >+ bool canSetHostOrPort() const { return isHierarchical(); } >+ >+ bool canSetPathname() const { return isHierarchical(); } >+ bool isHierarchical() const; >+ >+ const String& string() const { return m_string; } >+ >+ String stringCenterEllipsizedToLength(unsigned length = 1024) const; >+ >+ StringView protocol() const; >+ StringView host() const; >+ std::optional<uint16_t> port() const; >+ String hostAndPort() const; >+ String protocolHostAndPort() const; >+ String user() const; >+ String pass() const; >+ String path() const; >+ String lastPathComponent() const; >+ String query() const; >+ String fragmentIdentifier() const; >+ bool hasFragmentIdentifier() const; >+ >+ bool hasUsername() const; >+ bool hasPassword() const; >+ bool hasQuery() const; >+ bool hasFragment() const; >+ bool hasPath() const; >+ >+ // Unlike user() and pass(), these functions don't decode escape sequences. >+ // This is necessary for accurate round-tripping, because encoding doesn't encode '%' characters. >+ String encodedUser() const; >+ String encodedPass() const; >+ >+ String baseAsString() const; >+ >+ String fileSystemPath() const; >+ >+ // Returns true if the current URL's protocol is the same as the null- >+ // terminated ASCII argument. The argument must be lower-case. >+ bool protocolIs(const char*) const; >+ bool protocolIs(StringView) const; >+ bool protocolIsBlob() const { return protocolIs("blob"); } >+ bool protocolIsData() const { return protocolIs("data"); } >+ bool protocolIsAbout() const; >+ bool protocolIsInHTTPFamily() const; >+ bool isLocalFile() const; >+ bool isBlankURL() const; >+ bool cannotBeABaseURL() const { return m_cannotBeABaseURL; } >+ >+ bool isMatchingDomain(const String&) const; >+ >+ bool setProtocol(const String&); >+ void setHost(const String&); >+ >+ void removePort(); >+ void setPort(unsigned short); >+ >+ // Input is like "foo.com" or "foo.com:8000". >+ void setHostAndPort(const String&); >+ >+ void setUser(const String&); >+ void setPass(const String&); >+ >+ // If you pass an empty path for HTTP or HTTPS URLs, the resulting path >+ // will be "/". >+ void setPath(const String&); >+ >+ // The query may begin with a question mark, or, if not, one will be added >+ // for you. Setting the query to the empty string will leave a "?" in the >+ // URL (with nothing after it). To clear the query, pass a null string. >+ void setQuery(const String&); >+ >+ void setFragmentIdentifier(StringView); >+ void removeFragmentIdentifier(); >+ >+ void removeQueryAndFragmentIdentifier(); >+ >+ static bool hostIsIPAddress(StringView); >+ >+ unsigned pathStart() const; >+ unsigned pathEnd() const; >+ unsigned pathAfterLastSlash() const; >+ >+ operator const String&() const { return string(); } >+ >+#if USE(CF) >+ URL(CFURLRef); >+ RetainPtr<CFURLRef> createCFURL() const; >+#endif >+ >+#if USE(SOUP) >+ URL(SoupURI*); >+ GUniquePtr<SoupURI> createSoupURI() const; >+#endif >+ >+#if USE(FOUNDATION) >+ URL(NSURL*); >+ operator NSURL*() const; >+#endif >+#ifdef __OBJC__ >+ operator NSString*() const { return string(); } >+#endif >+ >+#ifndef NDEBUG >+ void print() const; >+#endif >+ >+ template <class Encoder> void encode(Encoder&) const; >+ template <class Decoder> static bool decode(Decoder&, URL&); >+ template <class Decoder> static std::optional<URL> decode(Decoder&); >+ >+private: >+ friend class URLParser; >+ void invalidate(); >+ static bool protocolIs(const String&, const char*); >+ void copyToBuffer(Vector<char, 512>& buffer) const; >+ unsigned hostStart() const; >+ >+ friend WTF_EXPORT_PRIVATE bool equalIgnoringFragmentIdentifier(const URL&, const URL&); >+ friend WTF_EXPORT_PRIVATE bool protocolHostAndPortAreEqual(const URL&, const URL&); >+ friend WTF_EXPORT_PRIVATE bool hostsAreEqual(const URL&, const URL&); >+ >+ String m_string; >+ >+ unsigned m_isValid : 1; >+ unsigned m_protocolIsInHTTPFamily : 1; >+ unsigned m_cannotBeABaseURL : 1; >+ >+ // This is out of order to align the bits better. The port is after the host. >+ unsigned m_portLength : 3; >+ static constexpr unsigned maxPortLength = (1 << 3) - 1; >+ >+ static constexpr unsigned maxSchemeLength = (1 << 26) - 1; >+ unsigned m_schemeEnd : 26; >+ unsigned m_userStart; >+ unsigned m_userEnd; >+ unsigned m_passwordEnd; >+ unsigned m_hostEnd; >+ unsigned m_pathAfterLastSlash; >+ unsigned m_pathEnd; >+ unsigned m_queryEnd; >+}; >+ >+static_assert(sizeof(URL) == sizeof(String) + 8 * sizeof(unsigned), "URL should stay small"); >+ >+template <class Encoder> >+void URL::encode(Encoder& encoder) const >+{ >+ encoder << m_string; >+} >+ >+template <class Decoder> >+bool URL::decode(Decoder& decoder, URL& url) >+{ >+ auto optionalURL = URL::decode(decoder); >+ if (!optionalURL) >+ return false; >+ url = WTFMove(*optionalURL); >+ return true; >+} >+ >+template <class Decoder> >+std::optional<URL> URL::decode(Decoder& decoder) >+{ >+ String string; >+ if (!decoder.decode(string)) >+ return std::nullopt; >+ return URL(URL(), string); >+} >+ >+WTF_EXPORT_PRIVATE bool equalIgnoringFragmentIdentifier(const URL&, const URL&); >+WTF_EXPORT_PRIVATE bool equalIgnoringQueryAndFragment(const URL&, const URL&); >+WTF_EXPORT_PRIVATE bool protocolHostAndPortAreEqual(const URL&, const URL&); >+WTF_EXPORT_PRIVATE bool hostsAreEqual(const URL&, const URL&); >+ >+WTF_EXPORT_PRIVATE const URL& blankURL(); >+ >+// Functions to do URL operations on strings. >+// These are operations that aren't faster on a parsed URL. >+// These are also different from the URL functions in that they don't require the string to be a valid and parsable URL. >+// This is especially important because valid javascript URLs are not necessarily considered valid by URL. >+ >+WTF_EXPORT_PRIVATE bool protocolIs(const String& url, const char* protocol); >+WTF_EXPORT_PRIVATE bool protocolIsJavaScript(const String& url); >+WTF_EXPORT_PRIVATE bool protocolIsJavaScript(StringView url); >+WTF_EXPORT_PRIVATE bool protocolIsInHTTPFamily(const String& url); >+ >+WTF_EXPORT_PRIVATE std::optional<uint16_t> defaultPortForProtocol(StringView protocol); >+WTF_EXPORT_PRIVATE bool isDefaultPortForProtocol(uint16_t port, StringView protocol); >+WTF_EXPORT_PRIVATE bool portAllowed(const URL&); // Blacklist ports that should never be used for Web resources. >+ >+WTF_EXPORT_PRIVATE void registerDefaultPortForProtocolForTesting(uint16_t port, const String& protocol); >+WTF_EXPORT_PRIVATE void clearDefaultPortForProtocolMapForTesting(); >+ >+WTF_EXPORT_PRIVATE bool isValidProtocol(const String&); >+ >+WTF_EXPORT_PRIVATE String mimeTypeFromDataURL(const String& url); >+ >+// FIXME: This is a wrong concept to expose, different parts of a URL need different escaping per the URL Standard. >+WTF_EXPORT_PRIVATE String encodeWithURLEscapeSequences(const String&); >+ >+// Inlines. >+ >+inline bool operator==(const URL& a, const URL& b) >+{ >+ return a.string() == b.string(); >+} >+ >+inline bool operator==(const URL& a, const String& b) >+{ >+ return a.string() == b; >+} >+ >+inline bool operator==(const String& a, const URL& b) >+{ >+ return a == b.string(); >+} >+ >+inline bool operator!=(const URL& a, const URL& b) >+{ >+ return a.string() != b.string(); >+} >+ >+inline bool operator!=(const URL& a, const String& b) >+{ >+ return a.string() != b; >+} >+ >+inline bool operator!=(const String& a, const URL& b) >+{ >+ return a != b.string(); >+} >+ >+// Inline versions of some non-GoogleURL functions so we can get inlining >+// without having to have a lot of ugly ifdefs in the class definition. >+ >+inline bool URL::isNull() const >+{ >+ return m_string.isNull(); >+} >+ >+inline bool URL::isEmpty() const >+{ >+ return m_string.isEmpty(); >+} >+ >+inline bool URL::isValid() const >+{ >+ return m_isValid; >+} >+ >+inline bool URL::hasPath() const >+{ >+ return m_pathEnd != m_hostEnd + m_portLength; >+} >+ >+inline bool URL::hasUsername() const >+{ >+ return m_userEnd > m_userStart; >+} >+ >+inline bool URL::hasPassword() const >+{ >+ return m_passwordEnd > (m_userEnd + 1); >+} >+ >+inline bool URL::hasQuery() const >+{ >+ return m_queryEnd > m_pathEnd; >+} >+ >+inline bool URL::hasFragment() const >+{ >+ return m_isValid && m_string.length() > m_queryEnd; >+} >+ >+inline bool URL::protocolIsInHTTPFamily() const >+{ >+ return m_protocolIsInHTTPFamily; >+} >+ >+inline unsigned URL::pathStart() const >+{ >+ return m_hostEnd + m_portLength; >+} >+ >+inline unsigned URL::pathEnd() const >+{ >+ return m_pathEnd; >+} >+ >+inline unsigned URL::pathAfterLastSlash() const >+{ >+ return m_pathAfterLastSlash; >+} >+ >+WTF_EXPORT_PRIVATE WTF::TextStream& operator<<(WTF::TextStream&, const URL&); >+ >+template<> struct DefaultHash<URL>; >+template<> struct HashTraits<URL>; >+ >+} // namespace WTF >diff --git a/Source/WTF/wtf/URLHash.h b/Source/WTF/wtf/URLHash.h >new file mode 100644 >index 0000000000000000000000000000000000000000..d02fa3dccf66100fc850866ec3547a3a86df9be3 >--- /dev/null >+++ b/Source/WTF/wtf/URLHash.h >@@ -0,0 +1,58 @@ >+/* >+ * Copyright (C) 2008 Apple Inc. All Rights Reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#ifndef URLHash_h >+#define URLHash_h >+ >+#include <wtf/URL.h> >+#include <wtf/text/StringHash.h> >+#include <wtf/text/WTFString.h> >+ >+namespace WTF { >+ >+struct URLHash { >+ static unsigned hash(const URL& key) >+ { >+ return key.string().impl()->hash(); >+ } >+ >+ static bool equal(const URL& a, const URL& b) >+ { >+ return StringHash::equal(a.string(), b.string()); >+ } >+ >+ static const bool safeToCompareToEmptyOrDeleted = false; >+}; >+ >+// URLHash is the default hash for String >+template<> struct DefaultHash<URL> { >+ using Hash = URLHash; >+}; >+ >+template<> struct HashTraits<URL> : SimpleClassHashTraits<URL> { }; >+ >+} // namespace WTF >+ >+#endif // URLHash_h >diff --git a/Source/WTF/wtf/URLParser.cpp b/Source/WTF/wtf/URLParser.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..509d4b81f98233ad4a99695b3e9da34cb1ce6c75 >--- /dev/null >+++ b/Source/WTF/wtf/URLParser.cpp >@@ -0,0 +1,2925 @@ >+/* >+ * Copyright (C) 2016-2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include <wtf/URLParser.h> >+ >+#include <array> >+#include <mutex> >+#include <unicode/uidna.h> >+#include <unicode/utf8.h> >+#include <unicode/utypes.h> >+ >+namespace WTF { >+ >+#define URL_PARSER_DEBUGGING 0 >+ >+#if URL_PARSER_DEBUGGING >+#define URL_PARSER_LOG(...) WTFLogAlways(__VA_ARGS__) >+#else >+#define URL_PARSER_LOG(...) >+#endif >+ >+template<typename CharacterType> >+class CodePointIterator { >+public: >+ ALWAYS_INLINE CodePointIterator() { } >+ ALWAYS_INLINE CodePointIterator(const CharacterType* begin, const CharacterType* end) >+ : m_begin(begin) >+ , m_end(end) >+ { >+ } >+ >+ ALWAYS_INLINE CodePointIterator(const CodePointIterator& begin, const CodePointIterator& end) >+ : CodePointIterator(begin.m_begin, end.m_begin) >+ { >+ ASSERT(end.m_begin >= begin.m_begin); >+ } >+ >+ ALWAYS_INLINE UChar32 operator*() const; >+ ALWAYS_INLINE CodePointIterator& operator++(); >+ >+ ALWAYS_INLINE bool operator==(const CodePointIterator& other) const >+ { >+ return m_begin == other.m_begin >+ && m_end == other.m_end; >+ } >+ ALWAYS_INLINE bool operator!=(const CodePointIterator& other) const { return !(*this == other); } >+ >+ ALWAYS_INLINE CodePointIterator& operator=(const CodePointIterator& other) >+ { >+ m_begin = other.m_begin; >+ m_end = other.m_end; >+ return *this; >+ } >+ >+ ALWAYS_INLINE bool atEnd() const >+ { >+ ASSERT(m_begin <= m_end); >+ return m_begin >= m_end; >+ } >+ >+ ALWAYS_INLINE size_t codeUnitsSince(const CharacterType* reference) const >+ { >+ ASSERT(m_begin >= reference); >+ return m_begin - reference; >+ } >+ >+ ALWAYS_INLINE size_t codeUnitsSince(const CodePointIterator& other) const >+ { >+ return codeUnitsSince(other.m_begin); >+ } >+ >+private: >+ const CharacterType* m_begin { nullptr }; >+ const CharacterType* m_end { nullptr }; >+}; >+ >+template<> >+ALWAYS_INLINE UChar32 CodePointIterator<LChar>::operator*() const >+{ >+ ASSERT(!atEnd()); >+ return *m_begin; >+} >+ >+template<> >+ALWAYS_INLINE auto CodePointIterator<LChar>::operator++() -> CodePointIterator& >+{ >+ m_begin++; >+ return *this; >+} >+ >+template<> >+ALWAYS_INLINE UChar32 CodePointIterator<UChar>::operator*() const >+{ >+ ASSERT(!atEnd()); >+ UChar32 c; >+ U16_GET(m_begin, 0, 0, m_end - m_begin, c); >+ return c; >+} >+ >+template<> >+ALWAYS_INLINE auto CodePointIterator<UChar>::operator++() -> CodePointIterator& >+{ >+ unsigned i = 0; >+ size_t length = m_end - m_begin; >+ U16_FWD_1(m_begin, i, length); >+ m_begin += i; >+ return *this; >+} >+ >+ALWAYS_INLINE static void appendCodePoint(Vector<UChar>& destination, UChar32 codePoint) >+{ >+ if (U_IS_BMP(codePoint)) { >+ destination.append(static_cast<UChar>(codePoint)); >+ return; >+ } >+ destination.reserveCapacity(destination.size() + 2); >+ destination.uncheckedAppend(U16_LEAD(codePoint)); >+ destination.uncheckedAppend(U16_TRAIL(codePoint)); >+} >+ >+enum URLCharacterClass { >+ UserInfo = 0x1, >+ Default = 0x2, >+ ForbiddenHost = 0x4, >+ QueryPercent = 0x8, >+ SlashQuestionOrHash = 0x10, >+ ValidScheme = 0x20, >+}; >+ >+static const uint8_t characterClassTable[256] = { >+ UserInfo | Default | QueryPercent | ForbiddenHost, // 0x0 >+ UserInfo | Default | QueryPercent, // 0x1 >+ UserInfo | Default | QueryPercent, // 0x2 >+ UserInfo | Default | QueryPercent, // 0x3 >+ UserInfo | Default | QueryPercent, // 0x4 >+ UserInfo | Default | QueryPercent, // 0x5 >+ UserInfo | Default | QueryPercent, // 0x6 >+ UserInfo | Default | QueryPercent, // 0x7 >+ UserInfo | Default | QueryPercent, // 0x8 >+ UserInfo | Default | QueryPercent | ForbiddenHost, // 0x9 >+ UserInfo | Default | QueryPercent | ForbiddenHost, // 0xA >+ UserInfo | Default | QueryPercent, // 0xB >+ UserInfo | Default | QueryPercent, // 0xC >+ UserInfo | Default | QueryPercent | ForbiddenHost, // 0xD >+ UserInfo | Default | QueryPercent, // 0xE >+ UserInfo | Default | QueryPercent, // 0xF >+ UserInfo | Default | QueryPercent, // 0x10 >+ UserInfo | Default | QueryPercent, // 0x11 >+ UserInfo | Default | QueryPercent, // 0x12 >+ UserInfo | Default | QueryPercent, // 0x13 >+ UserInfo | Default | QueryPercent, // 0x14 >+ UserInfo | Default | QueryPercent, // 0x15 >+ UserInfo | Default | QueryPercent, // 0x16 >+ UserInfo | Default | QueryPercent, // 0x17 >+ UserInfo | Default | QueryPercent, // 0x18 >+ UserInfo | Default | QueryPercent, // 0x19 >+ UserInfo | Default | QueryPercent, // 0x1A >+ UserInfo | Default | QueryPercent, // 0x1B >+ UserInfo | Default | QueryPercent, // 0x1C >+ UserInfo | Default | QueryPercent, // 0x1D >+ UserInfo | Default | QueryPercent, // 0x1E >+ UserInfo | Default | QueryPercent, // 0x1F >+ UserInfo | Default | QueryPercent | ForbiddenHost, // ' ' >+ 0, // '!' >+ UserInfo | Default | QueryPercent, // '"' >+ UserInfo | Default | QueryPercent | SlashQuestionOrHash | ForbiddenHost, // '#' >+ 0, // '$' >+ ForbiddenHost, // '%' >+ 0, // '&' >+ 0, // '\'' >+ 0, // '(' >+ 0, // ')' >+ 0, // '*' >+ ValidScheme, // '+' >+ 0, // ',' >+ ValidScheme, // '-' >+ ValidScheme, // '.' >+ UserInfo | SlashQuestionOrHash | ForbiddenHost, // '/' >+ ValidScheme, // '0' >+ ValidScheme, // '1' >+ ValidScheme, // '2' >+ ValidScheme, // '3' >+ ValidScheme, // '4' >+ ValidScheme, // '5' >+ ValidScheme, // '6' >+ ValidScheme, // '7' >+ ValidScheme, // '8' >+ ValidScheme, // '9' >+ UserInfo | ForbiddenHost, // ':' >+ UserInfo, // ';' >+ UserInfo | Default | QueryPercent | ForbiddenHost, // '<' >+ UserInfo, // '=' >+ UserInfo | Default | QueryPercent | ForbiddenHost, // '>' >+ UserInfo | Default | SlashQuestionOrHash | ForbiddenHost, // '?' >+ UserInfo | ForbiddenHost, // '@' >+ ValidScheme, // 'A' >+ ValidScheme, // 'B' >+ ValidScheme, // 'C' >+ ValidScheme, // 'D' >+ ValidScheme, // 'E' >+ ValidScheme, // 'F' >+ ValidScheme, // 'G' >+ ValidScheme, // 'H' >+ ValidScheme, // 'I' >+ ValidScheme, // 'J' >+ ValidScheme, // 'K' >+ ValidScheme, // 'L' >+ ValidScheme, // 'M' >+ ValidScheme, // 'N' >+ ValidScheme, // 'O' >+ ValidScheme, // 'P' >+ ValidScheme, // 'Q' >+ ValidScheme, // 'R' >+ ValidScheme, // 'S' >+ ValidScheme, // 'T' >+ ValidScheme, // 'U' >+ ValidScheme, // 'V' >+ ValidScheme, // 'W' >+ ValidScheme, // 'X' >+ ValidScheme, // 'Y' >+ ValidScheme, // 'Z' >+ UserInfo | ForbiddenHost, // '[' >+ UserInfo | SlashQuestionOrHash | ForbiddenHost, // '\\' >+ UserInfo | ForbiddenHost, // ']' >+ UserInfo, // '^' >+ 0, // '_' >+ UserInfo | Default, // '`' >+ ValidScheme, // 'a' >+ ValidScheme, // 'b' >+ ValidScheme, // 'c' >+ ValidScheme, // 'd' >+ ValidScheme, // 'e' >+ ValidScheme, // 'f' >+ ValidScheme, // 'g' >+ ValidScheme, // 'h' >+ ValidScheme, // 'i' >+ ValidScheme, // 'j' >+ ValidScheme, // 'k' >+ ValidScheme, // 'l' >+ ValidScheme, // 'm' >+ ValidScheme, // 'n' >+ ValidScheme, // 'o' >+ ValidScheme, // 'p' >+ ValidScheme, // 'q' >+ ValidScheme, // 'r' >+ ValidScheme, // 's' >+ ValidScheme, // 't' >+ ValidScheme, // 'u' >+ ValidScheme, // 'v' >+ ValidScheme, // 'w' >+ ValidScheme, // 'x' >+ ValidScheme, // 'y' >+ ValidScheme, // 'z' >+ UserInfo | Default, // '{' >+ UserInfo, // '|' >+ UserInfo | Default, // '}' >+ 0, // '~' >+ QueryPercent, // 0x7F >+ QueryPercent, // 0x80 >+ QueryPercent, // 0x81 >+ QueryPercent, // 0x82 >+ QueryPercent, // 0x83 >+ QueryPercent, // 0x84 >+ QueryPercent, // 0x85 >+ QueryPercent, // 0x86 >+ QueryPercent, // 0x87 >+ QueryPercent, // 0x88 >+ QueryPercent, // 0x89 >+ QueryPercent, // 0x8A >+ QueryPercent, // 0x8B >+ QueryPercent, // 0x8C >+ QueryPercent, // 0x8D >+ QueryPercent, // 0x8E >+ QueryPercent, // 0x8F >+ QueryPercent, // 0x90 >+ QueryPercent, // 0x91 >+ QueryPercent, // 0x92 >+ QueryPercent, // 0x93 >+ QueryPercent, // 0x94 >+ QueryPercent, // 0x95 >+ QueryPercent, // 0x96 >+ QueryPercent, // 0x97 >+ QueryPercent, // 0x98 >+ QueryPercent, // 0x99 >+ QueryPercent, // 0x9A >+ QueryPercent, // 0x9B >+ QueryPercent, // 0x9C >+ QueryPercent, // 0x9D >+ QueryPercent, // 0x9E >+ QueryPercent, // 0x9F >+ QueryPercent, // 0xA0 >+ QueryPercent, // 0xA1 >+ QueryPercent, // 0xA2 >+ QueryPercent, // 0xA3 >+ QueryPercent, // 0xA4 >+ QueryPercent, // 0xA5 >+ QueryPercent, // 0xA6 >+ QueryPercent, // 0xA7 >+ QueryPercent, // 0xA8 >+ QueryPercent, // 0xA9 >+ QueryPercent, // 0xAA >+ QueryPercent, // 0xAB >+ QueryPercent, // 0xAC >+ QueryPercent, // 0xAD >+ QueryPercent, // 0xAE >+ QueryPercent, // 0xAF >+ QueryPercent, // 0xB0 >+ QueryPercent, // 0xB1 >+ QueryPercent, // 0xB2 >+ QueryPercent, // 0xB3 >+ QueryPercent, // 0xB4 >+ QueryPercent, // 0xB5 >+ QueryPercent, // 0xB6 >+ QueryPercent, // 0xB7 >+ QueryPercent, // 0xB8 >+ QueryPercent, // 0xB9 >+ QueryPercent, // 0xBA >+ QueryPercent, // 0xBB >+ QueryPercent, // 0xBC >+ QueryPercent, // 0xBD >+ QueryPercent, // 0xBE >+ QueryPercent, // 0xBF >+ QueryPercent, // 0xC0 >+ QueryPercent, // 0xC1 >+ QueryPercent, // 0xC2 >+ QueryPercent, // 0xC3 >+ QueryPercent, // 0xC4 >+ QueryPercent, // 0xC5 >+ QueryPercent, // 0xC6 >+ QueryPercent, // 0xC7 >+ QueryPercent, // 0xC8 >+ QueryPercent, // 0xC9 >+ QueryPercent, // 0xCA >+ QueryPercent, // 0xCB >+ QueryPercent, // 0xCC >+ QueryPercent, // 0xCD >+ QueryPercent, // 0xCE >+ QueryPercent, // 0xCF >+ QueryPercent, // 0xD0 >+ QueryPercent, // 0xD1 >+ QueryPercent, // 0xD2 >+ QueryPercent, // 0xD3 >+ QueryPercent, // 0xD4 >+ QueryPercent, // 0xD5 >+ QueryPercent, // 0xD6 >+ QueryPercent, // 0xD7 >+ QueryPercent, // 0xD8 >+ QueryPercent, // 0xD9 >+ QueryPercent, // 0xDA >+ QueryPercent, // 0xDB >+ QueryPercent, // 0xDC >+ QueryPercent, // 0xDD >+ QueryPercent, // 0xDE >+ QueryPercent, // 0xDF >+ QueryPercent, // 0xE0 >+ QueryPercent, // 0xE1 >+ QueryPercent, // 0xE2 >+ QueryPercent, // 0xE3 >+ QueryPercent, // 0xE4 >+ QueryPercent, // 0xE5 >+ QueryPercent, // 0xE6 >+ QueryPercent, // 0xE7 >+ QueryPercent, // 0xE8 >+ QueryPercent, // 0xE9 >+ QueryPercent, // 0xEA >+ QueryPercent, // 0xEB >+ QueryPercent, // 0xEC >+ QueryPercent, // 0xED >+ QueryPercent, // 0xEE >+ QueryPercent, // 0xEF >+ QueryPercent, // 0xF0 >+ QueryPercent, // 0xF1 >+ QueryPercent, // 0xF2 >+ QueryPercent, // 0xF3 >+ QueryPercent, // 0xF4 >+ QueryPercent, // 0xF5 >+ QueryPercent, // 0xF6 >+ QueryPercent, // 0xF7 >+ QueryPercent, // 0xF8 >+ QueryPercent, // 0xF9 >+ QueryPercent, // 0xFA >+ QueryPercent, // 0xFB >+ QueryPercent, // 0xFC >+ QueryPercent, // 0xFD >+ QueryPercent, // 0xFE >+ QueryPercent, // 0xFF >+}; >+ >+template<typename CharacterType> ALWAYS_INLINE static bool isC0Control(CharacterType character) { return character <= 0x1F; } >+template<typename CharacterType> ALWAYS_INLINE static bool isC0ControlOrSpace(CharacterType character) { return character <= 0x20; } >+template<typename CharacterType> ALWAYS_INLINE static bool isTabOrNewline(CharacterType character) { return character <= 0xD && character >= 0x9 && character != 0xB && character != 0xC; } >+template<typename CharacterType> ALWAYS_INLINE static bool isInSimpleEncodeSet(CharacterType character) { return character > 0x7E || isC0Control(character); } >+template<typename CharacterType> ALWAYS_INLINE static bool isInDefaultEncodeSet(CharacterType character) { return character > 0x7E || characterClassTable[character] & Default; } >+template<typename CharacterType> ALWAYS_INLINE static bool isInUserInfoEncodeSet(CharacterType character) { return character > 0x7E || characterClassTable[character] & UserInfo; } >+template<typename CharacterType> ALWAYS_INLINE static bool isPercentOrNonASCII(CharacterType character) { return !isASCII(character) || character == '%'; } >+template<typename CharacterType> ALWAYS_INLINE static bool isSlashQuestionOrHash(CharacterType character) { return character <= '\\' && characterClassTable[character] & SlashQuestionOrHash; } >+template<typename CharacterType> ALWAYS_INLINE static bool isValidSchemeCharacter(CharacterType character) { return character <= 'z' && characterClassTable[character] & ValidScheme; } >+template<typename CharacterType> ALWAYS_INLINE static bool isForbiddenHostCodePoint(CharacterType character) { return character <= ']' && characterClassTable[character] & ForbiddenHost; } >+ALWAYS_INLINE static bool shouldPercentEncodeQueryByte(uint8_t byte, const bool& urlIsSpecial) >+{ >+ if (characterClassTable[byte] & QueryPercent) >+ return true; >+ if (byte == '\'' && urlIsSpecial) >+ return true; >+ return false; >+} >+ >+bool URLParser::isInUserInfoEncodeSet(UChar c) >+{ >+ return WTF::isInUserInfoEncodeSet(c); >+} >+ >+template<typename CharacterType, URLParser::ReportSyntaxViolation reportSyntaxViolation> >+ALWAYS_INLINE void URLParser::advance(CodePointIterator<CharacterType>& iterator, const CodePointIterator<CharacterType>& iteratorForSyntaxViolationPosition) >+{ >+ ++iterator; >+ while (UNLIKELY(!iterator.atEnd() && isTabOrNewline(*iterator))) { >+ if (reportSyntaxViolation == ReportSyntaxViolation::Yes) >+ syntaxViolation(iteratorForSyntaxViolationPosition); >+ ++iterator; >+ } >+} >+ >+template<typename CharacterType> >+bool URLParser::takesTwoAdvancesUntilEnd(CodePointIterator<CharacterType> iterator) >+{ >+ if (iterator.atEnd()) >+ return false; >+ advance<CharacterType, ReportSyntaxViolation::No>(iterator); >+ if (iterator.atEnd()) >+ return false; >+ advance<CharacterType, ReportSyntaxViolation::No>(iterator); >+ return iterator.atEnd(); >+} >+ >+template<typename CharacterType> >+ALWAYS_INLINE bool URLParser::isWindowsDriveLetter(CodePointIterator<CharacterType> iterator) >+{ >+ if (iterator.atEnd() || !isASCIIAlpha(*iterator)) >+ return false; >+ advance<CharacterType, ReportSyntaxViolation::No>(iterator); >+ if (iterator.atEnd()) >+ return false; >+ if (*iterator == ':') >+ return true; >+ if (UNLIKELY(*iterator == '|')) >+ return true; >+ return false; >+} >+ >+ALWAYS_INLINE void URLParser::appendToASCIIBuffer(UChar32 codePoint) >+{ >+ ASSERT(isASCII(codePoint)); >+ if (UNLIKELY(m_didSeeSyntaxViolation)) >+ m_asciiBuffer.append(codePoint); >+} >+ >+ALWAYS_INLINE void URLParser::appendToASCIIBuffer(const char* characters, size_t length) >+{ >+ if (UNLIKELY(m_didSeeSyntaxViolation)) >+ m_asciiBuffer.append(characters, length); >+} >+ >+template<typename CharacterType> >+void URLParser::appendWindowsDriveLetter(CodePointIterator<CharacterType>& iterator) >+{ >+ ASSERT(isWindowsDriveLetter(iterator)); >+ appendToASCIIBuffer(*iterator); >+ advance(iterator); >+ ASSERT(!iterator.atEnd()); >+ ASSERT(*iterator == ':' || *iterator == '|'); >+ if (*iterator == '|') >+ syntaxViolation(iterator); >+ appendToASCIIBuffer(':'); >+ advance(iterator); >+} >+ >+bool URLParser::copyBaseWindowsDriveLetter(const URL& base) >+{ >+ if (base.protocolIs("file")) { >+ RELEASE_ASSERT(base.m_hostEnd + base.m_portLength < base.m_string.length()); >+ if (base.m_string.is8Bit()) { >+ const LChar* begin = base.m_string.characters8(); >+ CodePointIterator<LChar> c(begin + base.m_hostEnd + base.m_portLength + 1, begin + base.m_string.length()); >+ if (isWindowsDriveLetter(c)) { >+ appendWindowsDriveLetter(c); >+ return true; >+ } >+ } else { >+ const UChar* begin = base.m_string.characters16(); >+ CodePointIterator<UChar> c(begin + base.m_hostEnd + base.m_portLength + 1, begin + base.m_string.length()); >+ if (isWindowsDriveLetter(c)) { >+ appendWindowsDriveLetter(c); >+ return true; >+ } >+ } >+ } >+ return false; >+} >+ >+template<typename CharacterType> >+bool URLParser::shouldCopyFileURL(CodePointIterator<CharacterType> iterator) >+{ >+ if (!isWindowsDriveLetter(iterator)) >+ return true; >+ if (iterator.atEnd()) >+ return false; >+ advance(iterator); >+ if (iterator.atEnd()) >+ return true; >+ advance(iterator); >+ if (iterator.atEnd()) >+ return true; >+ return !isSlashQuestionOrHash(*iterator); >+} >+ >+static void percentEncodeByte(uint8_t byte, Vector<LChar>& buffer) >+{ >+ buffer.append('%'); >+ buffer.append(upperNibbleToASCIIHexDigit(byte)); >+ buffer.append(lowerNibbleToASCIIHexDigit(byte)); >+} >+ >+void URLParser::percentEncodeByte(uint8_t byte) >+{ >+ ASSERT(m_didSeeSyntaxViolation); >+ appendToASCIIBuffer('%'); >+ appendToASCIIBuffer(upperNibbleToASCIIHexDigit(byte)); >+ appendToASCIIBuffer(lowerNibbleToASCIIHexDigit(byte)); >+} >+ >+const char replacementCharacterUTF8PercentEncoded[10] = "%EF%BF%BD"; >+const size_t replacementCharacterUTF8PercentEncodedLength = sizeof(replacementCharacterUTF8PercentEncoded) - 1; >+ >+template<bool(*isInCodeSet)(UChar32), typename CharacterType> >+ALWAYS_INLINE void URLParser::utf8PercentEncode(const CodePointIterator<CharacterType>& iterator) >+{ >+ ASSERT(!iterator.atEnd()); >+ UChar32 codePoint = *iterator; >+ if (LIKELY(isASCII(codePoint))) { >+ if (UNLIKELY(isInCodeSet(codePoint))) { >+ syntaxViolation(iterator); >+ percentEncodeByte(codePoint); >+ } else >+ appendToASCIIBuffer(codePoint); >+ return; >+ } >+ ASSERT_WITH_MESSAGE(isInCodeSet(codePoint), "isInCodeSet should always return true for non-ASCII characters"); >+ syntaxViolation(iterator); >+ >+ if (!U_IS_UNICODE_CHAR(codePoint)) { >+ appendToASCIIBuffer(replacementCharacterUTF8PercentEncoded, replacementCharacterUTF8PercentEncodedLength); >+ return; >+ } >+ >+ uint8_t buffer[U8_MAX_LENGTH]; >+ int32_t offset = 0; >+ U8_APPEND_UNSAFE(buffer, offset, codePoint); >+ for (int32_t i = 0; i < offset; ++i) >+ percentEncodeByte(buffer[i]); >+} >+ >+template<typename CharacterType> >+ALWAYS_INLINE void URLParser::utf8QueryEncode(const CodePointIterator<CharacterType>& iterator) >+{ >+ ASSERT(!iterator.atEnd()); >+ UChar32 codePoint = *iterator; >+ if (LIKELY(isASCII(codePoint))) { >+ if (UNLIKELY(shouldPercentEncodeQueryByte(codePoint, m_urlIsSpecial))) { >+ syntaxViolation(iterator); >+ percentEncodeByte(codePoint); >+ } else >+ appendToASCIIBuffer(codePoint); >+ return; >+ } >+ >+ syntaxViolation(iterator); >+ >+ if (!U_IS_UNICODE_CHAR(codePoint)) { >+ appendToASCIIBuffer(replacementCharacterUTF8PercentEncoded, replacementCharacterUTF8PercentEncodedLength); >+ return; >+ } >+ >+ uint8_t buffer[U8_MAX_LENGTH]; >+ int32_t offset = 0; >+ U8_APPEND_UNSAFE(buffer, offset, codePoint); >+ for (int32_t i = 0; i < offset; ++i) { >+ auto byte = buffer[i]; >+ if (shouldPercentEncodeQueryByte(byte, m_urlIsSpecial)) >+ percentEncodeByte(byte); >+ else >+ appendToASCIIBuffer(byte); >+ } >+} >+ >+template<typename CharacterType> >+void URLParser::encodeNonUTF8Query(const Vector<UChar>& source, const URLTextEncoding& encoding, CodePointIterator<CharacterType> iterator) >+{ >+ auto encoded = encoding.encodeForURLParsing(StringView(source.data(), source.size())); >+ auto* data = encoded.data(); >+ size_t length = encoded.size(); >+ >+ if (!length == !iterator.atEnd()) { >+ syntaxViolation(iterator); >+ return; >+ } >+ >+ size_t i = 0; >+ for (; i < length; ++i) { >+ ASSERT(!iterator.atEnd()); >+ uint8_t byte = data[i]; >+ if (UNLIKELY(byte != *iterator)) { >+ syntaxViolation(iterator); >+ break; >+ } >+ if (UNLIKELY(shouldPercentEncodeQueryByte(byte, m_urlIsSpecial))) { >+ syntaxViolation(iterator); >+ break; >+ } >+ appendToASCIIBuffer(byte); >+ ++iterator; >+ } >+ while (!iterator.atEnd() && isTabOrNewline(*iterator)) >+ ++iterator; >+ ASSERT((i == length) == iterator.atEnd()); >+ for (; i < length; ++i) { >+ ASSERT(m_didSeeSyntaxViolation); >+ uint8_t byte = data[i]; >+ if (shouldPercentEncodeQueryByte(byte, m_urlIsSpecial)) >+ percentEncodeByte(byte); >+ else >+ appendToASCIIBuffer(byte); >+ } >+} >+ >+std::optional<uint16_t> URLParser::defaultPortForProtocol(StringView scheme) >+{ >+ static const uint16_t ftpPort = 21; >+ static const uint16_t gopherPort = 70; >+ static const uint16_t httpPort = 80; >+ static const uint16_t httpsPort = 443; >+ static const uint16_t wsPort = 80; >+ static const uint16_t wssPort = 443; >+ >+ auto length = scheme.length(); >+ if (!length) >+ return std::nullopt; >+ switch (scheme[0]) { >+ case 'w': >+ switch (length) { >+ case 2: >+ if (scheme[1] == 's') >+ return wsPort; >+ return std::nullopt; >+ case 3: >+ if (scheme[1] == 's' >+ && scheme[2] == 's') >+ return wssPort; >+ return std::nullopt; >+ default: >+ return false; >+ } >+ case 'h': >+ switch (length) { >+ case 4: >+ if (scheme[1] == 't' >+ && scheme[2] == 't' >+ && scheme[3] == 'p') >+ return httpPort; >+ return std::nullopt; >+ case 5: >+ if (scheme[1] == 't' >+ && scheme[2] == 't' >+ && scheme[3] == 'p' >+ && scheme[4] == 's') >+ return httpsPort; >+ return std::nullopt; >+ default: >+ return std::nullopt; >+ } >+ case 'g': >+ if (length == 6 >+ && scheme[1] == 'o' >+ && scheme[2] == 'p' >+ && scheme[3] == 'h' >+ && scheme[4] == 'e' >+ && scheme[5] == 'r') >+ return gopherPort; >+ return std::nullopt; >+ case 'f': >+ if (length == 3 >+ && scheme[1] == 't' >+ && scheme[2] == 'p') >+ return ftpPort; >+ return std::nullopt; >+ default: >+ return std::nullopt; >+ } >+} >+ >+enum class Scheme { >+ WS, >+ WSS, >+ File, >+ FTP, >+ Gopher, >+ HTTP, >+ HTTPS, >+ NonSpecial >+}; >+ >+ALWAYS_INLINE static Scheme scheme(StringView scheme) >+{ >+ auto length = scheme.length(); >+ if (!length) >+ return Scheme::NonSpecial; >+ switch (scheme[0]) { >+ case 'f': >+ switch (length) { >+ case 3: >+ if (scheme[1] == 't' >+ && scheme[2] == 'p') >+ return Scheme::FTP; >+ return Scheme::NonSpecial; >+ case 4: >+ if (scheme[1] == 'i' >+ && scheme[2] == 'l' >+ && scheme[3] == 'e') >+ return Scheme::File; >+ return Scheme::NonSpecial; >+ default: >+ return Scheme::NonSpecial; >+ } >+ case 'g': >+ if (length == 6 >+ && scheme[1] == 'o' >+ && scheme[2] == 'p' >+ && scheme[3] == 'h' >+ && scheme[4] == 'e' >+ && scheme[5] == 'r') >+ return Scheme::Gopher; >+ return Scheme::NonSpecial; >+ case 'h': >+ switch (length) { >+ case 4: >+ if (scheme[1] == 't' >+ && scheme[2] == 't' >+ && scheme[3] == 'p') >+ return Scheme::HTTP; >+ return Scheme::NonSpecial; >+ case 5: >+ if (scheme[1] == 't' >+ && scheme[2] == 't' >+ && scheme[3] == 'p' >+ && scheme[4] == 's') >+ return Scheme::HTTPS; >+ return Scheme::NonSpecial; >+ default: >+ return Scheme::NonSpecial; >+ } >+ case 'w': >+ switch (length) { >+ case 2: >+ if (scheme[1] == 's') >+ return Scheme::WS; >+ return Scheme::NonSpecial; >+ case 3: >+ if (scheme[1] == 's' >+ && scheme[2] == 's') >+ return Scheme::WSS; >+ return Scheme::NonSpecial; >+ default: >+ return Scheme::NonSpecial; >+ } >+ default: >+ return Scheme::NonSpecial; >+ } >+} >+ >+std::optional<String> URLParser::maybeCanonicalizeScheme(const String& scheme) >+{ >+ if (scheme.isEmpty()) >+ return std::nullopt; >+ >+ if (!isASCIIAlpha(scheme[0])) >+ return std::nullopt; >+ >+ for (size_t i = 1; i < scheme.length(); ++i) { >+ if (isASCIIAlphanumeric(scheme[i]) || scheme[i] == '+' || scheme[i] == '-' || scheme[i] == '.') >+ continue; >+ return std::nullopt; >+ } >+ >+ return scheme.convertToASCIILowercase(); >+} >+ >+bool URLParser::isSpecialScheme(const String& schemeArg) >+{ >+ return scheme(schemeArg) != Scheme::NonSpecial; >+} >+ >+enum class URLParser::URLPart { >+ SchemeEnd, >+ UserStart, >+ UserEnd, >+ PasswordEnd, >+ HostEnd, >+ PortEnd, >+ PathAfterLastSlash, >+ PathEnd, >+ QueryEnd, >+}; >+ >+size_t URLParser::urlLengthUntilPart(const URL& url, URLPart part) >+{ >+ switch (part) { >+ case URLPart::QueryEnd: >+ return url.m_queryEnd; >+ case URLPart::PathEnd: >+ return url.m_pathEnd; >+ case URLPart::PathAfterLastSlash: >+ return url.m_pathAfterLastSlash; >+ case URLPart::PortEnd: >+ return url.m_hostEnd + url.m_portLength; >+ case URLPart::HostEnd: >+ return url.m_hostEnd; >+ case URLPart::PasswordEnd: >+ return url.m_passwordEnd; >+ case URLPart::UserEnd: >+ return url.m_userEnd; >+ case URLPart::UserStart: >+ return url.m_userStart; >+ case URLPart::SchemeEnd: >+ return url.m_schemeEnd; >+ } >+ ASSERT_NOT_REACHED(); >+ return 0; >+} >+ >+void URLParser::copyASCIIStringUntil(const String& string, size_t length) >+{ >+ RELEASE_ASSERT(length <= string.length()); >+ if (string.isNull()) >+ return; >+ ASSERT(m_asciiBuffer.isEmpty()); >+ if (string.is8Bit()) >+ appendToASCIIBuffer(string.characters8(), length); >+ else { >+ const UChar* characters = string.characters16(); >+ for (size_t i = 0; i < length; ++i) { >+ UChar c = characters[i]; >+ ASSERT_WITH_SECURITY_IMPLICATION(isASCII(c)); >+ appendToASCIIBuffer(c); >+ } >+ } >+} >+ >+template<typename CharacterType> >+void URLParser::copyURLPartsUntil(const URL& base, URLPart part, const CodePointIterator<CharacterType>& iterator, const URLTextEncoding*& nonUTF8QueryEncoding) >+{ >+ syntaxViolation(iterator); >+ >+ m_asciiBuffer.clear(); >+ copyASCIIStringUntil(base.m_string, urlLengthUntilPart(base, part)); >+ switch (part) { >+ case URLPart::QueryEnd: >+ m_url.m_queryEnd = base.m_queryEnd; >+ FALLTHROUGH; >+ case URLPart::PathEnd: >+ m_url.m_pathEnd = base.m_pathEnd; >+ FALLTHROUGH; >+ case URLPart::PathAfterLastSlash: >+ m_url.m_pathAfterLastSlash = base.m_pathAfterLastSlash; >+ FALLTHROUGH; >+ case URLPart::PortEnd: >+ m_url.m_portLength = base.m_portLength; >+ FALLTHROUGH; >+ case URLPart::HostEnd: >+ m_url.m_hostEnd = base.m_hostEnd; >+ FALLTHROUGH; >+ case URLPart::PasswordEnd: >+ m_url.m_passwordEnd = base.m_passwordEnd; >+ FALLTHROUGH; >+ case URLPart::UserEnd: >+ m_url.m_userEnd = base.m_userEnd; >+ FALLTHROUGH; >+ case URLPart::UserStart: >+ m_url.m_userStart = base.m_userStart; >+ FALLTHROUGH; >+ case URLPart::SchemeEnd: >+ m_url.m_isValid = base.m_isValid; >+ m_url.m_protocolIsInHTTPFamily = base.m_protocolIsInHTTPFamily; >+ m_url.m_schemeEnd = base.m_schemeEnd; >+ } >+ switch (scheme(StringView(m_asciiBuffer.data(), m_url.m_schemeEnd))) { >+ case Scheme::WS: >+ case Scheme::WSS: >+ nonUTF8QueryEncoding = nullptr; >+ m_urlIsSpecial = true; >+ return; >+ case Scheme::File: >+ m_urlIsFile = true; >+ FALLTHROUGH; >+ case Scheme::FTP: >+ case Scheme::Gopher: >+ case Scheme::HTTP: >+ case Scheme::HTTPS: >+ m_urlIsSpecial = true; >+ return; >+ case Scheme::NonSpecial: >+ m_urlIsSpecial = false; >+ nonUTF8QueryEncoding = nullptr; >+ return; >+ } >+ ASSERT_NOT_REACHED(); >+} >+ >+static const char dotASCIICode[2] = {'2', 'e'}; >+ >+template<typename CharacterType> >+ALWAYS_INLINE bool URLParser::isSingleDotPathSegment(CodePointIterator<CharacterType> c) >+{ >+ if (c.atEnd()) >+ return false; >+ if (*c == '.') { >+ advance<CharacterType, ReportSyntaxViolation::No>(c); >+ return c.atEnd() || isSlashQuestionOrHash(*c); >+ } >+ if (*c != '%') >+ return false; >+ advance<CharacterType, ReportSyntaxViolation::No>(c); >+ if (c.atEnd() || *c != dotASCIICode[0]) >+ return false; >+ advance<CharacterType, ReportSyntaxViolation::No>(c); >+ if (c.atEnd()) >+ return false; >+ if (toASCIILower(*c) == dotASCIICode[1]) { >+ advance<CharacterType, ReportSyntaxViolation::No>(c); >+ return c.atEnd() || isSlashQuestionOrHash(*c); >+ } >+ return false; >+} >+ >+template<typename CharacterType> >+ALWAYS_INLINE bool URLParser::isDoubleDotPathSegment(CodePointIterator<CharacterType> c) >+{ >+ if (c.atEnd()) >+ return false; >+ if (*c == '.') { >+ advance<CharacterType, ReportSyntaxViolation::No>(c); >+ return isSingleDotPathSegment(c); >+ } >+ if (*c != '%') >+ return false; >+ advance<CharacterType, ReportSyntaxViolation::No>(c); >+ if (c.atEnd() || *c != dotASCIICode[0]) >+ return false; >+ advance<CharacterType, ReportSyntaxViolation::No>(c); >+ if (c.atEnd()) >+ return false; >+ if (toASCIILower(*c) == dotASCIICode[1]) { >+ advance<CharacterType, ReportSyntaxViolation::No>(c); >+ return isSingleDotPathSegment(c); >+ } >+ return false; >+} >+ >+template<typename CharacterType> >+void URLParser::consumeSingleDotPathSegment(CodePointIterator<CharacterType>& c) >+{ >+ ASSERT(isSingleDotPathSegment(c)); >+ if (*c == '.') { >+ advance(c); >+ if (!c.atEnd()) { >+ if (*c == '/' || *c == '\\') >+ advance(c); >+ else >+ ASSERT(*c == '?' || *c == '#'); >+ } >+ } else { >+ ASSERT(*c == '%'); >+ advance(c); >+ ASSERT(*c == dotASCIICode[0]); >+ advance(c); >+ ASSERT(toASCIILower(*c) == dotASCIICode[1]); >+ advance(c); >+ if (!c.atEnd()) { >+ if (*c == '/' || *c == '\\') >+ advance(c); >+ else >+ ASSERT(*c == '?' || *c == '#'); >+ } >+ } >+} >+ >+template<typename CharacterType> >+void URLParser::consumeDoubleDotPathSegment(CodePointIterator<CharacterType>& c) >+{ >+ ASSERT(isDoubleDotPathSegment(c)); >+ if (*c == '.') >+ advance(c); >+ else { >+ ASSERT(*c == '%'); >+ advance(c); >+ ASSERT(*c == dotASCIICode[0]); >+ advance(c); >+ ASSERT(toASCIILower(*c) == dotASCIICode[1]); >+ advance(c); >+ } >+ consumeSingleDotPathSegment(c); >+} >+ >+bool URLParser::shouldPopPath(unsigned newPathAfterLastSlash) >+{ >+ ASSERT(m_didSeeSyntaxViolation); >+ if (!m_urlIsFile) >+ return true; >+ >+ ASSERT(m_url.m_pathAfterLastSlash <= m_asciiBuffer.size()); >+ CodePointIterator<LChar> componentToPop(&m_asciiBuffer[newPathAfterLastSlash], &m_asciiBuffer[0] + m_url.m_pathAfterLastSlash); >+ if (newPathAfterLastSlash == m_url.m_hostEnd + m_url.m_portLength + 1 && isWindowsDriveLetter(componentToPop)) >+ return false; >+ return true; >+} >+ >+void URLParser::popPath() >+{ >+ ASSERT(m_didSeeSyntaxViolation); >+ if (m_url.m_pathAfterLastSlash > m_url.m_hostEnd + m_url.m_portLength + 1) { >+ auto newPathAfterLastSlash = m_url.m_pathAfterLastSlash - 1; >+ if (m_asciiBuffer[newPathAfterLastSlash] == '/') >+ newPathAfterLastSlash--; >+ while (newPathAfterLastSlash > m_url.m_hostEnd + m_url.m_portLength && m_asciiBuffer[newPathAfterLastSlash] != '/') >+ newPathAfterLastSlash--; >+ newPathAfterLastSlash++; >+ if (shouldPopPath(newPathAfterLastSlash)) >+ m_url.m_pathAfterLastSlash = newPathAfterLastSlash; >+ } >+ m_asciiBuffer.resize(m_url.m_pathAfterLastSlash); >+} >+ >+template<typename CharacterType> >+void URLParser::syntaxViolation(const CodePointIterator<CharacterType>& iterator) >+{ >+ if (m_didSeeSyntaxViolation) >+ return; >+ m_didSeeSyntaxViolation = true; >+ >+ ASSERT(m_asciiBuffer.isEmpty()); >+ size_t codeUnitsToCopy = iterator.codeUnitsSince(reinterpret_cast<const CharacterType*>(m_inputBegin)); >+ RELEASE_ASSERT(codeUnitsToCopy <= m_inputString.length()); >+ m_asciiBuffer.reserveCapacity(m_inputString.length()); >+ for (size_t i = 0; i < codeUnitsToCopy; ++i) { >+ ASSERT(isASCII(m_inputString[i])); >+ m_asciiBuffer.uncheckedAppend(m_inputString[i]); >+ } >+} >+ >+void URLParser::failure() >+{ >+ m_url.invalidate(); >+ m_url.m_string = m_inputString; >+} >+ >+template<typename CharacterType> >+bool URLParser::checkLocalhostCodePoint(CodePointIterator<CharacterType>& iterator, UChar32 codePoint) >+{ >+ if (iterator.atEnd() || toASCIILower(*iterator) != codePoint) >+ return false; >+ advance<CharacterType, ReportSyntaxViolation::No>(iterator); >+ return true; >+} >+ >+template<typename CharacterType> >+bool URLParser::isAtLocalhost(CodePointIterator<CharacterType> iterator) >+{ >+ if (!checkLocalhostCodePoint(iterator, 'l')) >+ return false; >+ if (!checkLocalhostCodePoint(iterator, 'o')) >+ return false; >+ if (!checkLocalhostCodePoint(iterator, 'c')) >+ return false; >+ if (!checkLocalhostCodePoint(iterator, 'a')) >+ return false; >+ if (!checkLocalhostCodePoint(iterator, 'l')) >+ return false; >+ if (!checkLocalhostCodePoint(iterator, 'h')) >+ return false; >+ if (!checkLocalhostCodePoint(iterator, 'o')) >+ return false; >+ if (!checkLocalhostCodePoint(iterator, 's')) >+ return false; >+ if (!checkLocalhostCodePoint(iterator, 't')) >+ return false; >+ return iterator.atEnd(); >+} >+ >+bool URLParser::isLocalhost(StringView view) >+{ >+ if (view.is8Bit()) >+ return isAtLocalhost(CodePointIterator<LChar>(view.characters8(), view.characters8() + view.length())); >+ return isAtLocalhost(CodePointIterator<UChar>(view.characters16(), view.characters16() + view.length())); >+} >+ >+ALWAYS_INLINE StringView URLParser::parsedDataView(size_t start, size_t length) >+{ >+ if (UNLIKELY(m_didSeeSyntaxViolation)) { >+ ASSERT(start + length <= m_asciiBuffer.size()); >+ return StringView(m_asciiBuffer.data() + start, length); >+ } >+ ASSERT(start + length <= m_inputString.length()); >+ return StringView(m_inputString).substring(start, length); >+} >+ >+ALWAYS_INLINE UChar URLParser::parsedDataView(size_t position) >+{ >+ if (UNLIKELY(m_didSeeSyntaxViolation)) >+ return m_asciiBuffer[position]; >+ return m_inputString[position]; >+} >+ >+template<typename CharacterType> >+ALWAYS_INLINE size_t URLParser::currentPosition(const CodePointIterator<CharacterType>& iterator) >+{ >+ if (UNLIKELY(m_didSeeSyntaxViolation)) >+ return m_asciiBuffer.size(); >+ >+ return iterator.codeUnitsSince(reinterpret_cast<const CharacterType*>(m_inputBegin)); >+} >+ >+URLParser::URLParser(const String& input, const URL& base, const URLTextEncoding* nonUTF8QueryEncoding) >+ : m_inputString(input) >+{ >+ if (input.isNull()) { >+ if (base.isValid() && !base.m_cannotBeABaseURL) { >+ m_url = base; >+ m_url.removeFragmentIdentifier(); >+ } >+ return; >+ } >+ >+ if (input.is8Bit()) { >+ m_inputBegin = input.characters8(); >+ parse(input.characters8(), input.length(), base, nonUTF8QueryEncoding); >+ } else { >+ m_inputBegin = input.characters16(); >+ parse(input.characters16(), input.length(), base, nonUTF8QueryEncoding); >+ } >+ >+ ASSERT(!m_url.m_isValid >+ || m_didSeeSyntaxViolation == (m_url.string() != input) >+ || (input.isAllSpecialCharacters<isC0ControlOrSpace>() >+ && m_url.m_string == base.m_string.left(base.m_queryEnd))); >+ ASSERT(internalValuesConsistent(m_url)); >+#if !ASSERT_DISABLED >+ if (!m_didSeeSyntaxViolation) { >+ // Force a syntax violation at the beginning to make sure we get the same result. >+ URLParser parser(makeString(" ", input), base, nonUTF8QueryEncoding); >+ URL parsed = parser.result(); >+ if (parsed.isValid()) >+ ASSERT(allValuesEqual(parser.result(), m_url)); >+ } >+#endif >+} >+ >+template<typename CharacterType> >+void URLParser::parse(const CharacterType* input, const unsigned length, const URL& base, const URLTextEncoding* nonUTF8QueryEncoding) >+{ >+ URL_PARSER_LOG("Parsing URL <%s> base <%s>", String(input, length).utf8().data(), base.string().utf8().data()); >+ m_url = { }; >+ ASSERT(m_asciiBuffer.isEmpty()); >+ >+ Vector<UChar> queryBuffer; >+ >+ unsigned endIndex = length; >+ while (UNLIKELY(endIndex && isC0ControlOrSpace(input[endIndex - 1]))) { >+ syntaxViolation(CodePointIterator<CharacterType>(input, input)); >+ endIndex--; >+ } >+ CodePointIterator<CharacterType> c(input, input + endIndex); >+ CodePointIterator<CharacterType> authorityOrHostBegin; >+ CodePointIterator<CharacterType> queryBegin; >+ while (UNLIKELY(!c.atEnd() && isC0ControlOrSpace(*c))) { >+ syntaxViolation(c); >+ ++c; >+ } >+ auto beginAfterControlAndSpace = c; >+ >+ enum class State : uint8_t { >+ SchemeStart, >+ Scheme, >+ NoScheme, >+ SpecialRelativeOrAuthority, >+ PathOrAuthority, >+ Relative, >+ RelativeSlash, >+ SpecialAuthoritySlashes, >+ SpecialAuthorityIgnoreSlashes, >+ AuthorityOrHost, >+ Host, >+ File, >+ FileSlash, >+ FileHost, >+ PathStart, >+ Path, >+ CannotBeABaseURLPath, >+ UTF8Query, >+ NonUTF8Query, >+ Fragment, >+ }; >+ >+#define LOG_STATE(x) URL_PARSER_LOG("State %s, code point %c, parsed data <%s> size %zu", x, *c, parsedDataView(0, currentPosition(c)).utf8().data(), currentPosition(c)) >+#define LOG_FINAL_STATE(x) URL_PARSER_LOG("Final State: %s", x) >+ >+ State state = State::SchemeStart; >+ while (!c.atEnd()) { >+ if (UNLIKELY(isTabOrNewline(*c))) { >+ syntaxViolation(c); >+ ++c; >+ continue; >+ } >+ >+ switch (state) { >+ case State::SchemeStart: >+ LOG_STATE("SchemeStart"); >+ if (isASCIIAlpha(*c)) { >+ if (UNLIKELY(isASCIIUpper(*c))) >+ syntaxViolation(c); >+ appendToASCIIBuffer(toASCIILower(*c)); >+ advance(c); >+ if (c.atEnd()) { >+ m_asciiBuffer.clear(); >+ state = State::NoScheme; >+ c = beginAfterControlAndSpace; >+ break; >+ } >+ state = State::Scheme; >+ } else >+ state = State::NoScheme; >+ break; >+ case State::Scheme: >+ LOG_STATE("Scheme"); >+ if (isValidSchemeCharacter(*c)) { >+ if (UNLIKELY(isASCIIUpper(*c))) >+ syntaxViolation(c); >+ appendToASCIIBuffer(toASCIILower(*c)); >+ } else if (*c == ':') { >+ unsigned schemeEnd = currentPosition(c); >+ if (schemeEnd > URL::maxSchemeLength) { >+ failure(); >+ return; >+ } >+ m_url.m_schemeEnd = schemeEnd; >+ StringView urlScheme = parsedDataView(0, m_url.m_schemeEnd); >+ appendToASCIIBuffer(':'); >+ switch (scheme(urlScheme)) { >+ case Scheme::File: >+ m_urlIsSpecial = true; >+ m_urlIsFile = true; >+ state = State::File; >+ ++c; >+ break; >+ case Scheme::WS: >+ case Scheme::WSS: >+ nonUTF8QueryEncoding = nullptr; >+ m_urlIsSpecial = true; >+ if (base.protocolIs(urlScheme)) >+ state = State::SpecialRelativeOrAuthority; >+ else >+ state = State::SpecialAuthoritySlashes; >+ ++c; >+ break; >+ case Scheme::HTTP: >+ case Scheme::HTTPS: >+ m_url.m_protocolIsInHTTPFamily = true; >+ FALLTHROUGH; >+ case Scheme::FTP: >+ case Scheme::Gopher: >+ m_urlIsSpecial = true; >+ if (base.protocolIs(urlScheme)) >+ state = State::SpecialRelativeOrAuthority; >+ else >+ state = State::SpecialAuthoritySlashes; >+ ++c; >+ break; >+ case Scheme::NonSpecial: >+ nonUTF8QueryEncoding = nullptr; >+ auto maybeSlash = c; >+ advance(maybeSlash); >+ if (!maybeSlash.atEnd() && *maybeSlash == '/') { >+ appendToASCIIBuffer('/'); >+ c = maybeSlash; >+ state = State::PathOrAuthority; >+ ASSERT(*c == '/'); >+ ++c; >+ m_url.m_userStart = currentPosition(c); >+ } else { >+ ++c; >+ m_url.m_userStart = currentPosition(c); >+ m_url.m_userEnd = m_url.m_userStart; >+ m_url.m_passwordEnd = m_url.m_userStart; >+ m_url.m_hostEnd = m_url.m_userStart; >+ m_url.m_portLength = 0; >+ m_url.m_pathAfterLastSlash = m_url.m_userStart; >+ m_url.m_cannotBeABaseURL = true; >+ state = State::CannotBeABaseURLPath; >+ } >+ break; >+ } >+ break; >+ } else { >+ m_asciiBuffer.clear(); >+ state = State::NoScheme; >+ c = beginAfterControlAndSpace; >+ break; >+ } >+ advance(c); >+ if (c.atEnd()) { >+ m_asciiBuffer.clear(); >+ state = State::NoScheme; >+ c = beginAfterControlAndSpace; >+ } >+ break; >+ case State::NoScheme: >+ LOG_STATE("NoScheme"); >+ if (!base.isValid() || (base.m_cannotBeABaseURL && *c != '#')) { >+ failure(); >+ return; >+ } >+ if (base.m_cannotBeABaseURL && *c == '#') { >+ copyURLPartsUntil(base, URLPart::QueryEnd, c, nonUTF8QueryEncoding); >+ state = State::Fragment; >+ appendToASCIIBuffer('#'); >+ ++c; >+ break; >+ } >+ if (!base.protocolIs("file")) { >+ state = State::Relative; >+ break; >+ } >+ copyURLPartsUntil(base, URLPart::SchemeEnd, c, nonUTF8QueryEncoding); >+ appendToASCIIBuffer(':'); >+ state = State::File; >+ break; >+ case State::SpecialRelativeOrAuthority: >+ LOG_STATE("SpecialRelativeOrAuthority"); >+ if (*c == '/') { >+ appendToASCIIBuffer('/'); >+ advance(c); >+ if (c.atEnd()) { >+ failure(); >+ return; >+ } >+ if (*c == '/') { >+ appendToASCIIBuffer('/'); >+ state = State::SpecialAuthorityIgnoreSlashes; >+ ++c; >+ } else >+ state = State::RelativeSlash; >+ } else >+ state = State::Relative; >+ break; >+ case State::PathOrAuthority: >+ LOG_STATE("PathOrAuthority"); >+ if (*c == '/') { >+ appendToASCIIBuffer('/'); >+ state = State::AuthorityOrHost; >+ advance(c); >+ m_url.m_userStart = currentPosition(c); >+ authorityOrHostBegin = c; >+ } else { >+ ASSERT(parsedDataView(currentPosition(c) - 1) == '/'); >+ m_url.m_userStart = currentPosition(c) - 1; >+ m_url.m_userEnd = m_url.m_userStart; >+ m_url.m_passwordEnd = m_url.m_userStart; >+ m_url.m_hostEnd = m_url.m_userStart; >+ m_url.m_portLength = 0; >+ m_url.m_pathAfterLastSlash = m_url.m_userStart + 1; >+ state = State::Path; >+ } >+ break; >+ case State::Relative: >+ LOG_STATE("Relative"); >+ switch (*c) { >+ case '/': >+ case '\\': >+ state = State::RelativeSlash; >+ ++c; >+ break; >+ case '?': >+ copyURLPartsUntil(base, URLPart::PathEnd, c, nonUTF8QueryEncoding); >+ appendToASCIIBuffer('?'); >+ ++c; >+ if (nonUTF8QueryEncoding) { >+ queryBegin = c; >+ state = State::NonUTF8Query; >+ } else >+ state = State::UTF8Query; >+ break; >+ case '#': >+ copyURLPartsUntil(base, URLPart::QueryEnd, c, nonUTF8QueryEncoding); >+ appendToASCIIBuffer('#'); >+ state = State::Fragment; >+ ++c; >+ break; >+ default: >+ copyURLPartsUntil(base, URLPart::PathAfterLastSlash, c, nonUTF8QueryEncoding); >+ if (currentPosition(c) && parsedDataView(currentPosition(c) - 1) != '/') { >+ appendToASCIIBuffer('/'); >+ m_url.m_pathAfterLastSlash = currentPosition(c); >+ } >+ state = State::Path; >+ break; >+ } >+ break; >+ case State::RelativeSlash: >+ LOG_STATE("RelativeSlash"); >+ if (*c == '/' || *c == '\\') { >+ ++c; >+ copyURLPartsUntil(base, URLPart::SchemeEnd, c, nonUTF8QueryEncoding); >+ appendToASCIIBuffer("://", 3); >+ if (m_urlIsSpecial) >+ state = State::SpecialAuthorityIgnoreSlashes; >+ else { >+ m_url.m_userStart = currentPosition(c); >+ state = State::AuthorityOrHost; >+ authorityOrHostBegin = c; >+ } >+ } else { >+ copyURLPartsUntil(base, URLPart::PortEnd, c, nonUTF8QueryEncoding); >+ appendToASCIIBuffer('/'); >+ m_url.m_pathAfterLastSlash = base.m_hostEnd + base.m_portLength + 1; >+ state = State::Path; >+ } >+ break; >+ case State::SpecialAuthoritySlashes: >+ LOG_STATE("SpecialAuthoritySlashes"); >+ if (LIKELY(*c == '/' || *c == '\\')) { >+ if (UNLIKELY(*c == '\\')) >+ syntaxViolation(c); >+ appendToASCIIBuffer('/'); >+ advance(c); >+ if (LIKELY(!c.atEnd() && (*c == '/' || *c == '\\'))) { >+ if (UNLIKELY(*c == '\\')) >+ syntaxViolation(c); >+ ++c; >+ appendToASCIIBuffer('/'); >+ } else { >+ syntaxViolation(c); >+ appendToASCIIBuffer('/'); >+ } >+ } else { >+ syntaxViolation(c); >+ appendToASCIIBuffer("//", 2); >+ } >+ state = State::SpecialAuthorityIgnoreSlashes; >+ break; >+ case State::SpecialAuthorityIgnoreSlashes: >+ LOG_STATE("SpecialAuthorityIgnoreSlashes"); >+ if (*c == '/' || *c == '\\') { >+ syntaxViolation(c); >+ ++c; >+ } else { >+ m_url.m_userStart = currentPosition(c); >+ state = State::AuthorityOrHost; >+ authorityOrHostBegin = c; >+ } >+ break; >+ case State::AuthorityOrHost: >+ do { >+ LOG_STATE("AuthorityOrHost"); >+ if (*c == '@') { >+ auto lastAt = c; >+ auto findLastAt = c; >+ while (!findLastAt.atEnd()) { >+ URL_PARSER_LOG("Finding last @: %c", *findLastAt); >+ if (*findLastAt == '@') >+ lastAt = findLastAt; >+ bool isSlash = *findLastAt == '/' || (m_urlIsSpecial && *findLastAt == '\\'); >+ if (isSlash || *findLastAt == '?' || *findLastAt == '#') >+ break; >+ ++findLastAt; >+ } >+ parseAuthority(CodePointIterator<CharacterType>(authorityOrHostBegin, lastAt)); >+ c = lastAt; >+ advance(c); >+ authorityOrHostBegin = c; >+ state = State::Host; >+ m_hostHasPercentOrNonASCII = false; >+ break; >+ } >+ bool isSlash = *c == '/' || (m_urlIsSpecial && *c == '\\'); >+ if (isSlash || *c == '?' || *c == '#') { >+ auto iterator = CodePointIterator<CharacterType>(authorityOrHostBegin, c); >+ if (iterator.atEnd()) { >+ if (m_urlIsSpecial) >+ return failure(); >+ m_url.m_userEnd = currentPosition(c); >+ m_url.m_passwordEnd = m_url.m_userEnd; >+ m_url.m_hostEnd = m_url.m_userEnd; >+ m_url.m_portLength = 0; >+ m_url.m_pathAfterLastSlash = m_url.m_userEnd; >+ } else { >+ m_url.m_userEnd = currentPosition(authorityOrHostBegin); >+ m_url.m_passwordEnd = m_url.m_userEnd; >+ if (!parseHostAndPort(iterator)) { >+ failure(); >+ return; >+ } >+ if (UNLIKELY(!isSlash)) { >+ if (m_urlIsSpecial) { >+ syntaxViolation(c); >+ appendToASCIIBuffer('/'); >+ } >+ m_url.m_pathAfterLastSlash = currentPosition(c); >+ } >+ } >+ state = State::Path; >+ break; >+ } >+ if (isPercentOrNonASCII(*c)) >+ m_hostHasPercentOrNonASCII = true; >+ ++c; >+ } while (!c.atEnd()); >+ break; >+ case State::Host: >+ do { >+ LOG_STATE("Host"); >+ if (*c == '/' || *c == '?' || *c == '#') { >+ if (!parseHostAndPort(CodePointIterator<CharacterType>(authorityOrHostBegin, c))) { >+ failure(); >+ return; >+ } >+ if (*c == '?' || *c == '#') { >+ syntaxViolation(c); >+ appendToASCIIBuffer('/'); >+ m_url.m_pathAfterLastSlash = currentPosition(c); >+ } >+ state = State::Path; >+ break; >+ } >+ if (isPercentOrNonASCII(*c)) >+ m_hostHasPercentOrNonASCII = true; >+ ++c; >+ } while (!c.atEnd()); >+ break; >+ case State::File: >+ LOG_STATE("File"); >+ switch (*c) { >+ case '\\': >+ syntaxViolation(c); >+ FALLTHROUGH; >+ case '/': >+ appendToASCIIBuffer('/'); >+ state = State::FileSlash; >+ ++c; >+ break; >+ case '?': >+ syntaxViolation(c); >+ if (base.isValid() && base.protocolIs("file")) { >+ copyURLPartsUntil(base, URLPart::PathEnd, c, nonUTF8QueryEncoding); >+ appendToASCIIBuffer('?'); >+ ++c; >+ } else { >+ appendToASCIIBuffer("///?", 4); >+ ++c; >+ m_url.m_userStart = currentPosition(c) - 2; >+ m_url.m_userEnd = m_url.m_userStart; >+ m_url.m_passwordEnd = m_url.m_userStart; >+ m_url.m_hostEnd = m_url.m_userStart; >+ m_url.m_portLength = 0; >+ m_url.m_pathAfterLastSlash = m_url.m_userStart + 1; >+ m_url.m_pathEnd = m_url.m_pathAfterLastSlash; >+ } >+ if (nonUTF8QueryEncoding) { >+ queryBegin = c; >+ state = State::NonUTF8Query; >+ } else >+ state = State::UTF8Query; >+ break; >+ case '#': >+ syntaxViolation(c); >+ if (base.isValid() && base.protocolIs("file")) { >+ copyURLPartsUntil(base, URLPart::QueryEnd, c, nonUTF8QueryEncoding); >+ appendToASCIIBuffer('#'); >+ } else { >+ appendToASCIIBuffer("///#", 4); >+ m_url.m_userStart = currentPosition(c) - 2; >+ m_url.m_userEnd = m_url.m_userStart; >+ m_url.m_passwordEnd = m_url.m_userStart; >+ m_url.m_hostEnd = m_url.m_userStart; >+ m_url.m_portLength = 0; >+ m_url.m_pathAfterLastSlash = m_url.m_userStart + 1; >+ m_url.m_pathEnd = m_url.m_pathAfterLastSlash; >+ m_url.m_queryEnd = m_url.m_pathAfterLastSlash; >+ } >+ state = State::Fragment; >+ ++c; >+ break; >+ default: >+ syntaxViolation(c); >+ if (base.isValid() && base.protocolIs("file") && shouldCopyFileURL(c)) >+ copyURLPartsUntil(base, URLPart::PathAfterLastSlash, c, nonUTF8QueryEncoding); >+ else { >+ appendToASCIIBuffer("///", 3); >+ m_url.m_userStart = currentPosition(c) - 1; >+ m_url.m_userEnd = m_url.m_userStart; >+ m_url.m_passwordEnd = m_url.m_userStart; >+ m_url.m_hostEnd = m_url.m_userStart; >+ m_url.m_portLength = 0; >+ m_url.m_pathAfterLastSlash = m_url.m_userStart + 1; >+ if (isWindowsDriveLetter(c)) >+ appendWindowsDriveLetter(c); >+ } >+ state = State::Path; >+ break; >+ } >+ break; >+ case State::FileSlash: >+ LOG_STATE("FileSlash"); >+ if (LIKELY(*c == '/' || *c == '\\')) { >+ if (UNLIKELY(*c == '\\')) >+ syntaxViolation(c); >+ appendToASCIIBuffer('/'); >+ advance(c); >+ m_url.m_userStart = currentPosition(c); >+ m_url.m_userEnd = m_url.m_userStart; >+ m_url.m_passwordEnd = m_url.m_userStart; >+ m_url.m_hostEnd = m_url.m_userStart; >+ m_url.m_portLength = 0; >+ authorityOrHostBegin = c; >+ state = State::FileHost; >+ break; >+ } >+ syntaxViolation(c); >+ appendToASCIIBuffer("//", 2); >+ m_url.m_userStart = currentPosition(c) - 1; >+ m_url.m_userEnd = m_url.m_userStart; >+ m_url.m_passwordEnd = m_url.m_userStart; >+ m_url.m_hostEnd = m_url.m_userStart; >+ m_url.m_portLength = 0; >+ if (isWindowsDriveLetter(c)) { >+ appendWindowsDriveLetter(c); >+ m_url.m_pathAfterLastSlash = m_url.m_userStart + 1; >+ } else if (copyBaseWindowsDriveLetter(base)) { >+ appendToASCIIBuffer('/'); >+ m_url.m_pathAfterLastSlash = m_url.m_userStart + 4; >+ } else >+ m_url.m_pathAfterLastSlash = m_url.m_userStart + 1; >+ state = State::Path; >+ break; >+ case State::FileHost: >+ do { >+ LOG_STATE("FileHost"); >+ if (isSlashQuestionOrHash(*c)) { >+ bool windowsQuirk = takesTwoAdvancesUntilEnd(CodePointIterator<CharacterType>(authorityOrHostBegin, c)) >+ && isWindowsDriveLetter(authorityOrHostBegin); >+ if (windowsQuirk) { >+ syntaxViolation(authorityOrHostBegin); >+ appendToASCIIBuffer('/'); >+ appendWindowsDriveLetter(authorityOrHostBegin); >+ } >+ if (windowsQuirk || authorityOrHostBegin == c) { >+ ASSERT(windowsQuirk || parsedDataView(currentPosition(c) - 1) == '/'); >+ if (UNLIKELY(*c == '?')) { >+ syntaxViolation(c); >+ appendToASCIIBuffer("/?", 2); >+ ++c; >+ if (nonUTF8QueryEncoding) { >+ queryBegin = c; >+ state = State::NonUTF8Query; >+ } else >+ state = State::UTF8Query; >+ m_url.m_pathAfterLastSlash = currentPosition(c) - 1; >+ m_url.m_pathEnd = m_url.m_pathAfterLastSlash; >+ break; >+ } >+ if (UNLIKELY(*c == '#')) { >+ syntaxViolation(c); >+ appendToASCIIBuffer("/#", 2); >+ ++c; >+ m_url.m_pathAfterLastSlash = currentPosition(c) - 1; >+ m_url.m_pathEnd = m_url.m_pathAfterLastSlash; >+ m_url.m_queryEnd = m_url.m_pathAfterLastSlash; >+ state = State::Fragment; >+ break; >+ } >+ state = State::Path; >+ break; >+ } >+ if (!parseHostAndPort(CodePointIterator<CharacterType>(authorityOrHostBegin, c))) { >+ failure(); >+ return; >+ } >+ if (UNLIKELY(isLocalhost(parsedDataView(m_url.m_passwordEnd, currentPosition(c) - m_url.m_passwordEnd)))) { >+ syntaxViolation(c); >+ m_asciiBuffer.shrink(m_url.m_passwordEnd); >+ m_url.m_hostEnd = currentPosition(c); >+ m_url.m_portLength = 0; >+ } >+ >+ state = State::PathStart; >+ break; >+ } >+ if (isPercentOrNonASCII(*c)) >+ m_hostHasPercentOrNonASCII = true; >+ ++c; >+ } while (!c.atEnd()); >+ break; >+ case State::PathStart: >+ LOG_STATE("PathStart"); >+ if (*c != '/' && *c != '\\') { >+ syntaxViolation(c); >+ appendToASCIIBuffer('/'); >+ } >+ m_url.m_pathAfterLastSlash = currentPosition(c); >+ state = State::Path; >+ break; >+ case State::Path: >+ LOG_STATE("Path"); >+ if (*c == '/' || (m_urlIsSpecial && *c == '\\')) { >+ if (UNLIKELY(m_urlIsSpecial && *c == '\\')) >+ syntaxViolation(c); >+ appendToASCIIBuffer('/'); >+ ++c; >+ m_url.m_pathAfterLastSlash = currentPosition(c); >+ break; >+ } >+ if (UNLIKELY(currentPosition(c) && parsedDataView(currentPosition(c) - 1) == '/')) { >+ if (UNLIKELY(isDoubleDotPathSegment(c))) { >+ syntaxViolation(c); >+ consumeDoubleDotPathSegment(c); >+ popPath(); >+ break; >+ } >+ if (UNLIKELY(isSingleDotPathSegment(c))) { >+ syntaxViolation(c); >+ consumeSingleDotPathSegment(c); >+ break; >+ } >+ } >+ if (*c == '?') { >+ m_url.m_pathEnd = currentPosition(c); >+ appendToASCIIBuffer('?'); >+ ++c; >+ if (nonUTF8QueryEncoding) { >+ queryBegin = c; >+ state = State::NonUTF8Query; >+ } else >+ state = State::UTF8Query; >+ break; >+ } >+ if (*c == '#') { >+ m_url.m_pathEnd = currentPosition(c); >+ m_url.m_queryEnd = m_url.m_pathEnd; >+ state = State::Fragment; >+ break; >+ } >+ utf8PercentEncode<isInDefaultEncodeSet>(c); >+ ++c; >+ break; >+ case State::CannotBeABaseURLPath: >+ LOG_STATE("CannotBeABaseURLPath"); >+ if (*c == '?') { >+ m_url.m_pathEnd = currentPosition(c); >+ appendToASCIIBuffer('?'); >+ ++c; >+ if (nonUTF8QueryEncoding) { >+ queryBegin = c; >+ state = State::NonUTF8Query; >+ } else >+ state = State::UTF8Query; >+ } else if (*c == '#') { >+ m_url.m_pathEnd = currentPosition(c); >+ m_url.m_queryEnd = m_url.m_pathEnd; >+ state = State::Fragment; >+ } else if (*c == '/') { >+ appendToASCIIBuffer('/'); >+ ++c; >+ m_url.m_pathAfterLastSlash = currentPosition(c); >+ } else { >+ utf8PercentEncode<isInSimpleEncodeSet>(c); >+ ++c; >+ } >+ break; >+ case State::UTF8Query: >+ LOG_STATE("UTF8Query"); >+ ASSERT(queryBegin == CodePointIterator<CharacterType>()); >+ if (*c == '#') { >+ m_url.m_queryEnd = currentPosition(c); >+ state = State::Fragment; >+ break; >+ } >+ ASSERT(!nonUTF8QueryEncoding); >+ utf8QueryEncode(c); >+ ++c; >+ break; >+ case State::NonUTF8Query: >+ do { >+ LOG_STATE("NonUTF8Query"); >+ ASSERT(queryBegin != CodePointIterator<CharacterType>()); >+ if (*c == '#') { >+ encodeNonUTF8Query(queryBuffer, *nonUTF8QueryEncoding, CodePointIterator<CharacterType>(queryBegin, c)); >+ m_url.m_queryEnd = currentPosition(c); >+ state = State::Fragment; >+ break; >+ } >+ appendCodePoint(queryBuffer, *c); >+ advance(c, queryBegin); >+ } while (!c.atEnd()); >+ break; >+ case State::Fragment: >+ URL_PARSER_LOG("State Fragment"); >+ utf8PercentEncode<isInSimpleEncodeSet>(c); >+ ++c; >+ break; >+ } >+ } >+ >+ switch (state) { >+ case State::SchemeStart: >+ LOG_FINAL_STATE("SchemeStart"); >+ if (!currentPosition(c) && base.isValid() && !base.m_cannotBeABaseURL) { >+ m_url = base; >+ m_url.removeFragmentIdentifier(); >+ return; >+ } >+ failure(); >+ return; >+ case State::Scheme: >+ LOG_FINAL_STATE("Scheme"); >+ failure(); >+ return; >+ case State::NoScheme: >+ LOG_FINAL_STATE("NoScheme"); >+ RELEASE_ASSERT_NOT_REACHED(); >+ case State::SpecialRelativeOrAuthority: >+ LOG_FINAL_STATE("SpecialRelativeOrAuthority"); >+ copyURLPartsUntil(base, URLPart::QueryEnd, c, nonUTF8QueryEncoding); >+ break; >+ case State::PathOrAuthority: >+ LOG_FINAL_STATE("PathOrAuthority"); >+ ASSERT(m_url.m_userStart); >+ ASSERT(m_url.m_userStart == currentPosition(c)); >+ ASSERT(parsedDataView(currentPosition(c) - 1) == '/'); >+ m_url.m_userStart--; >+ m_url.m_userEnd = m_url.m_userStart; >+ m_url.m_passwordEnd = m_url.m_userStart; >+ m_url.m_hostEnd = m_url.m_userStart; >+ m_url.m_portLength = 0; >+ m_url.m_pathAfterLastSlash = m_url.m_userStart + 1; >+ m_url.m_pathEnd = m_url.m_pathAfterLastSlash; >+ m_url.m_queryEnd = m_url.m_pathAfterLastSlash; >+ break; >+ case State::Relative: >+ LOG_FINAL_STATE("Relative"); >+ RELEASE_ASSERT_NOT_REACHED(); >+ case State::RelativeSlash: >+ LOG_FINAL_STATE("RelativeSlash"); >+ copyURLPartsUntil(base, URLPart::PortEnd, c, nonUTF8QueryEncoding); >+ appendToASCIIBuffer('/'); >+ m_url.m_pathAfterLastSlash = m_url.m_hostEnd + m_url.m_portLength + 1; >+ m_url.m_pathEnd = m_url.m_pathAfterLastSlash; >+ m_url.m_queryEnd = m_url.m_pathAfterLastSlash; >+ break; >+ case State::SpecialAuthoritySlashes: >+ LOG_FINAL_STATE("SpecialAuthoritySlashes"); >+ m_url.m_userStart = currentPosition(c); >+ m_url.m_userEnd = m_url.m_userStart; >+ m_url.m_passwordEnd = m_url.m_userStart; >+ m_url.m_hostEnd = m_url.m_userStart; >+ m_url.m_portLength = 0; >+ m_url.m_pathAfterLastSlash = m_url.m_userStart; >+ m_url.m_pathEnd = m_url.m_userStart; >+ m_url.m_queryEnd = m_url.m_userStart; >+ break; >+ case State::SpecialAuthorityIgnoreSlashes: >+ LOG_FINAL_STATE("SpecialAuthorityIgnoreSlashes"); >+ failure(); >+ return; >+ case State::AuthorityOrHost: >+ LOG_FINAL_STATE("AuthorityOrHost"); >+ m_url.m_userEnd = currentPosition(authorityOrHostBegin); >+ m_url.m_passwordEnd = m_url.m_userEnd; >+ if (authorityOrHostBegin.atEnd()) { >+ m_url.m_userEnd = m_url.m_userStart; >+ m_url.m_passwordEnd = m_url.m_userStart; >+ m_url.m_hostEnd = m_url.m_userStart; >+ m_url.m_portLength = 0; >+ m_url.m_pathEnd = m_url.m_userStart; >+ } else if (!parseHostAndPort(authorityOrHostBegin)) { >+ failure(); >+ return; >+ } else { >+ if (m_urlIsSpecial) { >+ syntaxViolation(c); >+ appendToASCIIBuffer('/'); >+ m_url.m_pathEnd = m_url.m_hostEnd + m_url.m_portLength + 1; >+ } else >+ m_url.m_pathEnd = m_url.m_hostEnd + m_url.m_portLength; >+ } >+ m_url.m_pathAfterLastSlash = m_url.m_pathEnd; >+ m_url.m_queryEnd = m_url.m_pathEnd; >+ break; >+ case State::Host: >+ LOG_FINAL_STATE("Host"); >+ if (!parseHostAndPort(authorityOrHostBegin)) { >+ failure(); >+ return; >+ } >+ if (m_urlIsSpecial) { >+ syntaxViolation(c); >+ appendToASCIIBuffer('/'); >+ m_url.m_pathEnd = m_url.m_hostEnd + m_url.m_portLength + 1; >+ } else >+ m_url.m_pathEnd = m_url.m_hostEnd + m_url.m_portLength; >+ m_url.m_pathAfterLastSlash = m_url.m_pathEnd; >+ m_url.m_queryEnd = m_url.m_pathEnd; >+ break; >+ case State::File: >+ LOG_FINAL_STATE("File"); >+ if (base.isValid() && base.protocolIs("file")) { >+ copyURLPartsUntil(base, URLPart::QueryEnd, c, nonUTF8QueryEncoding); >+ break; >+ } >+ syntaxViolation(c); >+ appendToASCIIBuffer("///", 3); >+ m_url.m_userStart = currentPosition(c) - 1; >+ m_url.m_userEnd = m_url.m_userStart; >+ m_url.m_passwordEnd = m_url.m_userStart; >+ m_url.m_hostEnd = m_url.m_userStart; >+ m_url.m_portLength = 0; >+ m_url.m_pathAfterLastSlash = m_url.m_userStart + 1; >+ m_url.m_pathEnd = m_url.m_pathAfterLastSlash; >+ m_url.m_queryEnd = m_url.m_pathAfterLastSlash; >+ break; >+ case State::FileSlash: >+ LOG_FINAL_STATE("FileSlash"); >+ syntaxViolation(c); >+ m_url.m_userStart = currentPosition(c) + 1; >+ appendToASCIIBuffer("//", 2); >+ m_url.m_userEnd = m_url.m_userStart; >+ m_url.m_passwordEnd = m_url.m_userStart; >+ m_url.m_hostEnd = m_url.m_userStart; >+ m_url.m_portLength = 0; >+ if (copyBaseWindowsDriveLetter(base)) { >+ appendToASCIIBuffer('/'); >+ m_url.m_pathAfterLastSlash = m_url.m_userStart + 4; >+ } else >+ m_url.m_pathAfterLastSlash = m_url.m_userStart + 1; >+ m_url.m_pathEnd = m_url.m_pathAfterLastSlash; >+ m_url.m_queryEnd = m_url.m_pathAfterLastSlash; >+ break; >+ case State::FileHost: >+ LOG_FINAL_STATE("FileHost"); >+ if (takesTwoAdvancesUntilEnd(CodePointIterator<CharacterType>(authorityOrHostBegin, c)) >+ && isWindowsDriveLetter(authorityOrHostBegin)) { >+ syntaxViolation(authorityOrHostBegin); >+ appendToASCIIBuffer('/'); >+ appendWindowsDriveLetter(authorityOrHostBegin); >+ m_url.m_pathAfterLastSlash = currentPosition(c); >+ m_url.m_pathEnd = m_url.m_pathAfterLastSlash; >+ m_url.m_queryEnd = m_url.m_pathAfterLastSlash; >+ break; >+ } >+ >+ if (authorityOrHostBegin == c) { >+ syntaxViolation(c); >+ appendToASCIIBuffer('/'); >+ m_url.m_userStart = currentPosition(c) - 1; >+ m_url.m_userEnd = m_url.m_userStart; >+ m_url.m_passwordEnd = m_url.m_userStart; >+ m_url.m_hostEnd = m_url.m_userStart; >+ m_url.m_portLength = 0; >+ m_url.m_pathAfterLastSlash = m_url.m_userStart + 1; >+ m_url.m_pathEnd = m_url.m_pathAfterLastSlash; >+ m_url.m_queryEnd = m_url.m_pathAfterLastSlash; >+ break; >+ } >+ >+ if (!parseHostAndPort(CodePointIterator<CharacterType>(authorityOrHostBegin, c))) { >+ failure(); >+ return; >+ } >+ >+ syntaxViolation(c); >+ if (isLocalhost(parsedDataView(m_url.m_passwordEnd, currentPosition(c) - m_url.m_passwordEnd))) { >+ m_asciiBuffer.shrink(m_url.m_passwordEnd); >+ m_url.m_hostEnd = currentPosition(c); >+ m_url.m_portLength = 0; >+ } >+ appendToASCIIBuffer('/'); >+ m_url.m_pathAfterLastSlash = m_url.m_hostEnd + m_url.m_portLength + 1; >+ m_url.m_pathEnd = m_url.m_pathAfterLastSlash; >+ m_url.m_queryEnd = m_url.m_pathAfterLastSlash; >+ break; >+ case State::PathStart: >+ LOG_FINAL_STATE("PathStart"); >+ RELEASE_ASSERT_NOT_REACHED(); >+ case State::Path: >+ LOG_FINAL_STATE("Path"); >+ m_url.m_pathEnd = currentPosition(c); >+ m_url.m_queryEnd = m_url.m_pathEnd; >+ break; >+ case State::CannotBeABaseURLPath: >+ LOG_FINAL_STATE("CannotBeABaseURLPath"); >+ m_url.m_pathEnd = currentPosition(c); >+ m_url.m_queryEnd = m_url.m_pathEnd; >+ break; >+ case State::UTF8Query: >+ LOG_FINAL_STATE("UTF8Query"); >+ ASSERT(queryBegin == CodePointIterator<CharacterType>()); >+ m_url.m_queryEnd = currentPosition(c); >+ break; >+ case State::NonUTF8Query: >+ LOG_FINAL_STATE("NonUTF8Query"); >+ ASSERT(queryBegin != CodePointIterator<CharacterType>()); >+ encodeNonUTF8Query(queryBuffer, *nonUTF8QueryEncoding, CodePointIterator<CharacterType>(queryBegin, c)); >+ m_url.m_queryEnd = currentPosition(c); >+ break; >+ case State::Fragment: >+ LOG_FINAL_STATE("Fragment"); >+ break; >+ } >+ >+ if (LIKELY(!m_didSeeSyntaxViolation)) { >+ m_url.m_string = m_inputString; >+ ASSERT(m_asciiBuffer.isEmpty()); >+ } else >+ m_url.m_string = String::adopt(WTFMove(m_asciiBuffer)); >+ m_url.m_isValid = true; >+ URL_PARSER_LOG("Parsed URL <%s>", m_url.m_string.utf8().data()); >+} >+ >+template<typename CharacterType> >+void URLParser::parseAuthority(CodePointIterator<CharacterType> iterator) >+{ >+ if (UNLIKELY(iterator.atEnd())) { >+ syntaxViolation(iterator); >+ m_url.m_userEnd = currentPosition(iterator); >+ m_url.m_passwordEnd = m_url.m_userEnd; >+ return; >+ } >+ for (; !iterator.atEnd(); advance(iterator)) { >+ if (*iterator == ':') { >+ m_url.m_userEnd = currentPosition(iterator); >+ auto iteratorAtColon = iterator; >+ ++iterator; >+ bool tabOrNewlineAfterColon = false; >+ while (UNLIKELY(!iterator.atEnd() && isTabOrNewline(*iterator))) { >+ tabOrNewlineAfterColon = true; >+ ++iterator; >+ } >+ if (UNLIKELY(iterator.atEnd())) { >+ syntaxViolation(iteratorAtColon); >+ m_url.m_passwordEnd = m_url.m_userEnd; >+ if (m_url.m_userEnd > m_url.m_userStart) >+ appendToASCIIBuffer('@'); >+ return; >+ } >+ if (tabOrNewlineAfterColon) >+ syntaxViolation(iteratorAtColon); >+ appendToASCIIBuffer(':'); >+ break; >+ } >+ utf8PercentEncode<WTF::isInUserInfoEncodeSet>(iterator); >+ } >+ for (; !iterator.atEnd(); advance(iterator)) >+ utf8PercentEncode<WTF::isInUserInfoEncodeSet>(iterator); >+ m_url.m_passwordEnd = currentPosition(iterator); >+ if (!m_url.m_userEnd) >+ m_url.m_userEnd = m_url.m_passwordEnd; >+ appendToASCIIBuffer('@'); >+} >+ >+template<typename UnsignedIntegerType> >+void URLParser::appendNumberToASCIIBuffer(UnsignedIntegerType number) >+{ >+ LChar buf[sizeof(UnsignedIntegerType) * 3 + 1]; >+ LChar* end = std::end(buf); >+ LChar* p = end; >+ do { >+ *--p = (number % 10) + '0'; >+ number /= 10; >+ } while (number); >+ appendToASCIIBuffer(p, end - p); >+} >+ >+void URLParser::serializeIPv4(IPv4Address address) >+{ >+ appendNumberToASCIIBuffer<uint8_t>(address >> 24); >+ appendToASCIIBuffer('.'); >+ appendNumberToASCIIBuffer<uint8_t>(address >> 16); >+ appendToASCIIBuffer('.'); >+ appendNumberToASCIIBuffer<uint8_t>(address >> 8); >+ appendToASCIIBuffer('.'); >+ appendNumberToASCIIBuffer<uint8_t>(address); >+} >+ >+static size_t zeroSequenceLength(const std::array<uint16_t, 8>& address, size_t begin) >+{ >+ size_t end = begin; >+ for (; end < 8; end++) { >+ if (address[end]) >+ break; >+ } >+ return end - begin; >+} >+ >+static std::optional<size_t> findLongestZeroSequence(const std::array<uint16_t, 8>& address) >+{ >+ std::optional<size_t> longest; >+ size_t longestLength = 0; >+ for (size_t i = 0; i < 8; i++) { >+ size_t length = zeroSequenceLength(address, i); >+ if (length) { >+ if (length > 1 && (!longest || longestLength < length)) { >+ longest = i; >+ longestLength = length; >+ } >+ i += length; >+ } >+ } >+ return longest; >+} >+ >+void URLParser::serializeIPv6Piece(uint16_t piece) >+{ >+ bool printed = false; >+ if (auto nibble0 = piece >> 12) { >+ appendToASCIIBuffer(lowerNibbleToLowercaseASCIIHexDigit(nibble0)); >+ printed = true; >+ } >+ auto nibble1 = piece >> 8 & 0xF; >+ if (printed || nibble1) { >+ appendToASCIIBuffer(lowerNibbleToLowercaseASCIIHexDigit(nibble1)); >+ printed = true; >+ } >+ auto nibble2 = piece >> 4 & 0xF; >+ if (printed || nibble2) >+ appendToASCIIBuffer(lowerNibbleToLowercaseASCIIHexDigit(nibble2)); >+ appendToASCIIBuffer(lowerNibbleToLowercaseASCIIHexDigit(piece & 0xF)); >+} >+ >+void URLParser::serializeIPv6(URLParser::IPv6Address address) >+{ >+ appendToASCIIBuffer('['); >+ auto compressPointer = findLongestZeroSequence(address); >+ for (size_t piece = 0; piece < 8; piece++) { >+ if (compressPointer && compressPointer.value() == piece) { >+ ASSERT(!address[piece]); >+ if (piece) >+ appendToASCIIBuffer(':'); >+ else >+ appendToASCIIBuffer("::", 2); >+ while (piece < 8 && !address[piece]) >+ piece++; >+ if (piece == 8) >+ break; >+ } >+ serializeIPv6Piece(address[piece]); >+ if (piece < 7) >+ appendToASCIIBuffer(':'); >+ } >+ appendToASCIIBuffer(']'); >+} >+ >+enum class URLParser::IPv4PieceParsingError { >+ Failure, >+ Overflow, >+}; >+ >+template<typename CharacterType> >+Expected<uint32_t, URLParser::IPv4PieceParsingError> URLParser::parseIPv4Piece(CodePointIterator<CharacterType>& iterator, bool& didSeeSyntaxViolation) >+{ >+ enum class State : uint8_t { >+ UnknownBase, >+ Decimal, >+ OctalOrHex, >+ Octal, >+ Hex, >+ }; >+ State state = State::UnknownBase; >+ Checked<uint32_t, RecordOverflow> value = 0; >+ if (!iterator.atEnd() && *iterator == '.') >+ return makeUnexpected(IPv4PieceParsingError::Failure); >+ while (!iterator.atEnd()) { >+ if (isTabOrNewline(*iterator)) { >+ didSeeSyntaxViolation = true; >+ ++iterator; >+ continue; >+ } >+ if (*iterator == '.') { >+ ASSERT(!value.hasOverflowed()); >+ return value.unsafeGet(); >+ } >+ switch (state) { >+ case State::UnknownBase: >+ if (UNLIKELY(*iterator == '0')) { >+ ++iterator; >+ state = State::OctalOrHex; >+ break; >+ } >+ state = State::Decimal; >+ break; >+ case State::OctalOrHex: >+ didSeeSyntaxViolation = true; >+ if (*iterator == 'x' || *iterator == 'X') { >+ ++iterator; >+ state = State::Hex; >+ break; >+ } >+ state = State::Octal; >+ break; >+ case State::Decimal: >+ if (!isASCIIDigit(*iterator)) >+ return makeUnexpected(IPv4PieceParsingError::Failure); >+ value *= 10; >+ value += *iterator - '0'; >+ if (UNLIKELY(value.hasOverflowed())) >+ return makeUnexpected(IPv4PieceParsingError::Overflow); >+ ++iterator; >+ break; >+ case State::Octal: >+ ASSERT(didSeeSyntaxViolation); >+ if (*iterator < '0' || *iterator > '7') >+ return makeUnexpected(IPv4PieceParsingError::Failure); >+ value *= 8; >+ value += *iterator - '0'; >+ if (UNLIKELY(value.hasOverflowed())) >+ return makeUnexpected(IPv4PieceParsingError::Overflow); >+ ++iterator; >+ break; >+ case State::Hex: >+ ASSERT(didSeeSyntaxViolation); >+ if (!isASCIIHexDigit(*iterator)) >+ return makeUnexpected(IPv4PieceParsingError::Failure); >+ value *= 16; >+ value += toASCIIHexValue(*iterator); >+ if (UNLIKELY(value.hasOverflowed())) >+ return makeUnexpected(IPv4PieceParsingError::Overflow); >+ ++iterator; >+ break; >+ } >+ } >+ ASSERT(!value.hasOverflowed()); >+ return value.unsafeGet(); >+} >+ >+ALWAYS_INLINE static uint64_t pow256(size_t exponent) >+{ >+ RELEASE_ASSERT(exponent <= 4); >+ uint64_t values[5] = {1, 256, 256 * 256, 256 * 256 * 256, 256ull * 256 * 256 * 256 }; >+ return values[exponent]; >+} >+ >+enum class URLParser::IPv4ParsingError { >+ Failure, >+ NotIPv4, >+}; >+ >+template<typename CharacterTypeForSyntaxViolation, typename CharacterType> >+Expected<URLParser::IPv4Address, URLParser::IPv4ParsingError> URLParser::parseIPv4Host(const CodePointIterator<CharacterTypeForSyntaxViolation>& iteratorForSyntaxViolationPosition, CodePointIterator<CharacterType> iterator) >+{ >+ Vector<Expected<uint32_t, URLParser::IPv4PieceParsingError>, 4> items; >+ bool didSeeSyntaxViolation = false; >+ if (!iterator.atEnd() && *iterator == '.') >+ return makeUnexpected(IPv4ParsingError::NotIPv4); >+ while (!iterator.atEnd()) { >+ if (isTabOrNewline(*iterator)) { >+ didSeeSyntaxViolation = true; >+ ++iterator; >+ continue; >+ } >+ if (items.size() >= 4) >+ return makeUnexpected(IPv4ParsingError::NotIPv4); >+ items.append(parseIPv4Piece(iterator, didSeeSyntaxViolation)); >+ if (!iterator.atEnd() && *iterator == '.') { >+ ++iterator; >+ if (iterator.atEnd()) >+ syntaxViolation(iteratorForSyntaxViolationPosition); >+ else if (*iterator == '.') >+ return makeUnexpected(IPv4ParsingError::NotIPv4); >+ } >+ } >+ if (!iterator.atEnd() || !items.size() || items.size() > 4) >+ return makeUnexpected(IPv4ParsingError::NotIPv4); >+ for (const auto& item : items) { >+ if (!item.has_value() && item.error() == IPv4PieceParsingError::Failure) >+ return makeUnexpected(IPv4ParsingError::NotIPv4); >+ } >+ for (const auto& item : items) { >+ if (!item.has_value() && item.error() == IPv4PieceParsingError::Overflow) >+ return makeUnexpected(IPv4ParsingError::Failure); >+ } >+ if (items.size() > 1) { >+ for (size_t i = 0; i < items.size() - 1; i++) { >+ if (items[i].value() > 255) >+ return makeUnexpected(IPv4ParsingError::Failure); >+ } >+ } >+ if (items[items.size() - 1].value() >= pow256(5 - items.size())) >+ return makeUnexpected(IPv4ParsingError::Failure); >+ >+ if (didSeeSyntaxViolation) >+ syntaxViolation(iteratorForSyntaxViolationPosition); >+ for (const auto& item : items) { >+ if (item.value() > 255) >+ syntaxViolation(iteratorForSyntaxViolationPosition); >+ } >+ >+ if (UNLIKELY(items.size() != 4)) >+ syntaxViolation(iteratorForSyntaxViolationPosition); >+ >+ IPv4Address ipv4 = items.takeLast().value(); >+ for (size_t counter = 0; counter < items.size(); ++counter) >+ ipv4 += items[counter].value() * pow256(3 - counter); >+ return ipv4; >+} >+ >+template<typename CharacterType> >+std::optional<uint32_t> URLParser::parseIPv4PieceInsideIPv6(CodePointIterator<CharacterType>& iterator) >+{ >+ if (iterator.atEnd()) >+ return std::nullopt; >+ uint32_t piece = 0; >+ bool leadingZeros = false; >+ size_t digitCount = 0; >+ while (!iterator.atEnd()) { >+ if (!isASCIIDigit(*iterator)) >+ return std::nullopt; >+ ++digitCount; >+ if (!piece && *iterator == '0') { >+ if (leadingZeros) >+ return std::nullopt; >+ leadingZeros = true; >+ } >+ if (!piece && *iterator == '0') >+ leadingZeros = true; >+ piece = piece * 10 + *iterator - '0'; >+ if (piece > 255) >+ return std::nullopt; >+ advance<CharacterType, ReportSyntaxViolation::No>(iterator); >+ if (iterator.atEnd()) >+ break; >+ if (*iterator == '.') >+ break; >+ } >+ if (piece && leadingZeros) >+ return std::nullopt; >+ return piece; >+} >+ >+template<typename CharacterType> >+std::optional<URLParser::IPv4Address> URLParser::parseIPv4AddressInsideIPv6(CodePointIterator<CharacterType> iterator) >+{ >+ IPv4Address address = 0; >+ for (size_t i = 0; i < 4; ++i) { >+ if (std::optional<uint32_t> piece = parseIPv4PieceInsideIPv6(iterator)) >+ address = (address << 8) + piece.value(); >+ else >+ return std::nullopt; >+ if (i < 3) { >+ if (iterator.atEnd()) >+ return std::nullopt; >+ if (*iterator != '.') >+ return std::nullopt; >+ advance<CharacterType, ReportSyntaxViolation::No>(iterator); >+ } else if (!iterator.atEnd()) >+ return std::nullopt; >+ } >+ ASSERT(iterator.atEnd()); >+ return address; >+} >+ >+template<typename CharacterType> >+std::optional<URLParser::IPv6Address> URLParser::parseIPv6Host(CodePointIterator<CharacterType> c) >+{ >+ ASSERT(*c == '['); >+ const auto hostBegin = c; >+ advance(c, hostBegin); >+ if (c.atEnd()) >+ return std::nullopt; >+ >+ IPv6Address address = {{0, 0, 0, 0, 0, 0, 0, 0}}; >+ size_t piecePointer = 0; >+ std::optional<size_t> compressPointer; >+ >+ if (*c == ':') { >+ advance(c, hostBegin); >+ if (c.atEnd()) >+ return std::nullopt; >+ if (*c != ':') >+ return std::nullopt; >+ advance(c, hostBegin); >+ ++piecePointer; >+ compressPointer = piecePointer; >+ } >+ >+ while (!c.atEnd()) { >+ if (piecePointer == 8) >+ return std::nullopt; >+ if (*c == ':') { >+ if (compressPointer) >+ return std::nullopt; >+ advance(c, hostBegin); >+ ++piecePointer; >+ compressPointer = piecePointer; >+ continue; >+ } >+ if (piecePointer == 6 || (compressPointer && piecePointer < 6)) { >+ if (std::optional<IPv4Address> ipv4Address = parseIPv4AddressInsideIPv6(c)) { >+ if (compressPointer && piecePointer == 5) >+ return std::nullopt; >+ syntaxViolation(hostBegin); >+ address[piecePointer++] = ipv4Address.value() >> 16; >+ address[piecePointer++] = ipv4Address.value() & 0xFFFF; >+ c = { }; >+ break; >+ } >+ } >+ uint16_t value = 0; >+ size_t length = 0; >+ bool leadingZeros = false; >+ for (; length < 4; length++) { >+ if (c.atEnd()) >+ break; >+ if (!isASCIIHexDigit(*c)) >+ break; >+ if (isASCIIUpper(*c)) >+ syntaxViolation(hostBegin); >+ if (*c == '0' && !length) >+ leadingZeros = true; >+ value = value * 0x10 + toASCIIHexValue(*c); >+ advance(c, hostBegin); >+ } >+ >+ if (UNLIKELY((value && leadingZeros) || (!value && length > 1))) >+ syntaxViolation(hostBegin); >+ >+ address[piecePointer++] = value; >+ if (c.atEnd()) >+ break; >+ if (piecePointer == 8 || *c != ':') >+ return std::nullopt; >+ advance(c, hostBegin); >+ } >+ >+ if (!c.atEnd()) >+ return std::nullopt; >+ >+ if (compressPointer) { >+ size_t swaps = piecePointer - compressPointer.value(); >+ piecePointer = 7; >+ while (swaps) >+ std::swap(address[piecePointer--], address[compressPointer.value() + swaps-- - 1]); >+ } else if (piecePointer != 8) >+ return std::nullopt; >+ >+ std::optional<size_t> possibleCompressPointer = findLongestZeroSequence(address); >+ if (possibleCompressPointer) >+ possibleCompressPointer.value()++; >+ if (UNLIKELY(compressPointer != possibleCompressPointer)) >+ syntaxViolation(hostBegin); >+ >+ return address; >+} >+ >+template<typename CharacterType> >+URLParser::LCharBuffer URLParser::percentDecode(const LChar* input, size_t length, const CodePointIterator<CharacterType>& iteratorForSyntaxViolationPosition) >+{ >+ LCharBuffer output; >+ output.reserveInitialCapacity(length); >+ >+ for (size_t i = 0; i < length; ++i) { >+ uint8_t byte = input[i]; >+ if (byte != '%') >+ output.uncheckedAppend(byte); >+ else if (length > 2 && i < length - 2) { >+ if (isASCIIHexDigit(input[i + 1]) && isASCIIHexDigit(input[i + 2])) { >+ syntaxViolation(iteratorForSyntaxViolationPosition); >+ output.uncheckedAppend(toASCIIHexValue(input[i + 1], input[i + 2])); >+ i += 2; >+ } else >+ output.uncheckedAppend(byte); >+ } else >+ output.uncheckedAppend(byte); >+ } >+ return output; >+} >+ >+URLParser::LCharBuffer URLParser::percentDecode(const LChar* input, size_t length) >+{ >+ LCharBuffer output; >+ output.reserveInitialCapacity(length); >+ >+ for (size_t i = 0; i < length; ++i) { >+ uint8_t byte = input[i]; >+ if (byte != '%') >+ output.uncheckedAppend(byte); >+ else if (length > 2 && i < length - 2) { >+ if (isASCIIHexDigit(input[i + 1]) && isASCIIHexDigit(input[i + 2])) { >+ output.uncheckedAppend(toASCIIHexValue(input[i + 1], input[i + 2])); >+ i += 2; >+ } else >+ output.uncheckedAppend(byte); >+ } else >+ output.uncheckedAppend(byte); >+ } >+ return output; >+} >+ >+template<typename CharacterType> std::optional<URLParser::LCharBuffer> URLParser::domainToASCII(StringImpl& domain, const CodePointIterator<CharacterType>& iteratorForSyntaxViolationPosition) >+{ >+ LCharBuffer ascii; >+ if (domain.isAllASCII()) { >+ size_t length = domain.length(); >+ if (domain.is8Bit()) { >+ const LChar* characters = domain.characters8(); >+ ascii.reserveInitialCapacity(length); >+ for (size_t i = 0; i < length; ++i) { >+ if (UNLIKELY(isASCIIUpper(characters[i]))) >+ syntaxViolation(iteratorForSyntaxViolationPosition); >+ ascii.uncheckedAppend(toASCIILower(characters[i])); >+ } >+ } else { >+ const UChar* characters = domain.characters16(); >+ ascii.reserveInitialCapacity(length); >+ for (size_t i = 0; i < length; ++i) { >+ if (UNLIKELY(isASCIIUpper(characters[i]))) >+ syntaxViolation(iteratorForSyntaxViolationPosition); >+ ascii.uncheckedAppend(toASCIILower(characters[i])); >+ } >+ } >+ return ascii; >+ } >+ >+ const size_t maxDomainLength = 64; >+ UChar hostnameBuffer[maxDomainLength]; >+ UErrorCode error = U_ZERO_ERROR; >+ UIDNAInfo processingDetails = UIDNA_INFO_INITIALIZER; >+ int32_t numCharactersConverted = uidna_nameToASCII(&internationalDomainNameTranscoder(), StringView(domain).upconvertedCharacters(), domain.length(), hostnameBuffer, maxDomainLength, &processingDetails, &error); >+ ASSERT(numCharactersConverted <= static_cast<int32_t>(maxDomainLength)); >+ >+ if (U_SUCCESS(error) && !processingDetails.errors) { >+ for (int32_t i = 0; i < numCharactersConverted; ++i) { >+ ASSERT(isASCII(hostnameBuffer[i])); >+ ASSERT(!isASCIIUpper(hostnameBuffer[i])); >+ } >+ ascii.append(hostnameBuffer, numCharactersConverted); >+ if (domain != StringView(ascii.data(), ascii.size())) >+ syntaxViolation(iteratorForSyntaxViolationPosition); >+ return ascii; >+ } >+ return std::nullopt; >+} >+ >+bool URLParser::hasForbiddenHostCodePoint(const URLParser::LCharBuffer& asciiDomain) >+{ >+ for (size_t i = 0; i < asciiDomain.size(); ++i) { >+ if (isForbiddenHostCodePoint(asciiDomain[i])) >+ return true; >+ } >+ return false; >+} >+ >+template<typename CharacterType> >+bool URLParser::parsePort(CodePointIterator<CharacterType>& iterator) >+{ >+ ASSERT(*iterator == ':'); >+ auto colonIterator = iterator; >+ advance(iterator, colonIterator); >+ uint32_t port = 0; >+ if (UNLIKELY(iterator.atEnd())) { >+ unsigned portLength = currentPosition(colonIterator) - m_url.m_hostEnd; >+ RELEASE_ASSERT(portLength <= URL::maxPortLength); >+ m_url.m_portLength = portLength; >+ syntaxViolation(colonIterator); >+ return true; >+ } >+ size_t digitCount = 0; >+ bool leadingZeros = false; >+ for (; !iterator.atEnd(); ++iterator) { >+ if (UNLIKELY(isTabOrNewline(*iterator))) { >+ syntaxViolation(colonIterator); >+ continue; >+ } >+ if (isASCIIDigit(*iterator)) { >+ if (*iterator == '0' && !digitCount) >+ leadingZeros = true; >+ ++digitCount; >+ port = port * 10 + *iterator - '0'; >+ if (port > std::numeric_limits<uint16_t>::max()) >+ return false; >+ } else >+ return false; >+ } >+ >+ if (port && leadingZeros) >+ syntaxViolation(colonIterator); >+ >+ if (!port && digitCount > 1) >+ syntaxViolation(colonIterator); >+ >+ ASSERT(port == static_cast<uint16_t>(port)); >+ if (UNLIKELY(defaultPortForProtocol(parsedDataView(0, m_url.m_schemeEnd)) == static_cast<uint16_t>(port))) >+ syntaxViolation(colonIterator); >+ else { >+ appendToASCIIBuffer(':'); >+ ASSERT(port <= std::numeric_limits<uint16_t>::max()); >+ appendNumberToASCIIBuffer<uint16_t>(static_cast<uint16_t>(port)); >+ } >+ >+ unsigned portLength = currentPosition(iterator) - m_url.m_hostEnd; >+ RELEASE_ASSERT(portLength <= URL::maxPortLength); >+ m_url.m_portLength = portLength; >+ return true; >+} >+ >+template<typename CharacterType> >+bool URLParser::parseHostAndPort(CodePointIterator<CharacterType> iterator) >+{ >+ if (iterator.atEnd()) >+ return false; >+ if (*iterator == ':') >+ return false; >+ if (*iterator == '[') { >+ auto ipv6End = iterator; >+ while (!ipv6End.atEnd() && *ipv6End != ']') >+ ++ipv6End; >+ if (ipv6End.atEnd()) >+ return false; >+ if (auto address = parseIPv6Host(CodePointIterator<CharacterType>(iterator, ipv6End))) { >+ serializeIPv6(address.value()); >+ if (!ipv6End.atEnd()) { >+ advance(ipv6End); >+ if (!ipv6End.atEnd() && *ipv6End == ':') { >+ m_url.m_hostEnd = currentPosition(ipv6End); >+ return parsePort(ipv6End); >+ } >+ m_url.m_hostEnd = currentPosition(ipv6End); >+ m_url.m_portLength = 0; >+ return true; >+ } >+ m_url.m_hostEnd = currentPosition(ipv6End); >+ return true; >+ } >+ return false; >+ } >+ >+ if (!m_urlIsSpecial) { >+ for (; !iterator.atEnd(); ++iterator) { >+ if (UNLIKELY(isTabOrNewline(*iterator))) { >+ syntaxViolation(iterator); >+ continue; >+ } >+ if (*iterator == ':') >+ break; >+ if (UNLIKELY(isForbiddenHostCodePoint(*iterator) && *iterator != '%')) >+ return false; >+ utf8PercentEncode<isInSimpleEncodeSet>(iterator); >+ } >+ m_url.m_hostEnd = currentPosition(iterator); >+ if (iterator.atEnd()) { >+ m_url.m_portLength = 0; >+ return true; >+ } >+ return parsePort(iterator); >+ } >+ >+ if (LIKELY(!m_hostHasPercentOrNonASCII)) { >+ auto hostIterator = iterator; >+ for (; !iterator.atEnd(); ++iterator) { >+ if (isTabOrNewline(*iterator)) >+ continue; >+ if (*iterator == ':') >+ break; >+ if (isForbiddenHostCodePoint(*iterator)) >+ return false; >+ } >+ auto address = parseIPv4Host(hostIterator, CodePointIterator<CharacterType>(hostIterator, iterator)); >+ if (address) { >+ serializeIPv4(address.value()); >+ m_url.m_hostEnd = currentPosition(iterator); >+ if (iterator.atEnd()) { >+ m_url.m_portLength = 0; >+ return true; >+ } >+ return parsePort(iterator); >+ } >+ if (address.error() == IPv4ParsingError::Failure) >+ return false; >+ for (; hostIterator != iterator; ++hostIterator) { >+ if (UNLIKELY(isTabOrNewline(*hostIterator))) { >+ syntaxViolation(hostIterator); >+ continue; >+ } >+ if (UNLIKELY(isASCIIUpper(*hostIterator))) >+ syntaxViolation(hostIterator); >+ appendToASCIIBuffer(toASCIILower(*hostIterator)); >+ } >+ m_url.m_hostEnd = currentPosition(iterator); >+ if (!hostIterator.atEnd()) >+ return parsePort(hostIterator); >+ unsigned portLength = currentPosition(iterator) - m_url.m_hostEnd; >+ RELEASE_ASSERT(portLength <= URL::maxPortLength); >+ m_url.m_portLength = portLength; >+ return true; >+ } >+ >+ const auto hostBegin = iterator; >+ >+ LCharBuffer utf8Encoded; >+ for (; !iterator.atEnd(); ++iterator) { >+ if (UNLIKELY(isTabOrNewline(*iterator))) { >+ syntaxViolation(hostBegin); >+ continue; >+ } >+ if (*iterator == ':') >+ break; >+ if (UNLIKELY(!isASCII(*iterator))) >+ syntaxViolation(hostBegin); >+ >+ if (!U_IS_UNICODE_CHAR(*iterator)) >+ return false; >+ uint8_t buffer[U8_MAX_LENGTH]; >+ int32_t offset = 0; >+ U8_APPEND_UNSAFE(buffer, offset, *iterator); >+ utf8Encoded.append(buffer, offset); >+ } >+ LCharBuffer percentDecoded = percentDecode(utf8Encoded.data(), utf8Encoded.size(), hostBegin); >+ String domain = String::fromUTF8(percentDecoded.data(), percentDecoded.size()); >+ if (domain.isNull()) >+ return false; >+ if (domain != StringView(percentDecoded.data(), percentDecoded.size())) >+ syntaxViolation(hostBegin); >+ auto asciiDomain = domainToASCII(*domain.impl(), hostBegin); >+ if (!asciiDomain || hasForbiddenHostCodePoint(asciiDomain.value())) >+ return false; >+ LCharBuffer& asciiDomainValue = asciiDomain.value(); >+ const LChar* asciiDomainCharacters = asciiDomainValue.data(); >+ >+ auto address = parseIPv4Host(hostBegin, CodePointIterator<LChar>(asciiDomainValue.begin(), asciiDomainValue.end())); >+ if (address) { >+ serializeIPv4(address.value()); >+ m_url.m_hostEnd = currentPosition(iterator); >+ if (iterator.atEnd()) { >+ m_url.m_portLength = 0; >+ return true; >+ } >+ return parsePort(iterator); >+ } >+ if (address.error() == IPv4ParsingError::Failure) >+ return false; >+ >+ appendToASCIIBuffer(asciiDomainCharacters, asciiDomainValue.size()); >+ m_url.m_hostEnd = currentPosition(iterator); >+ if (!iterator.atEnd()) >+ return parsePort(iterator); >+ m_url.m_portLength = 0; >+ return true; >+} >+ >+std::optional<String> URLParser::formURLDecode(StringView input) >+{ >+ auto utf8 = input.utf8(StrictConversion); >+ if (utf8.isNull()) >+ return std::nullopt; >+ auto percentDecoded = percentDecode(reinterpret_cast<const LChar*>(utf8.data()), utf8.length()); >+ return String::fromUTF8(percentDecoded.data(), percentDecoded.size()); >+} >+ >+// https://url.spec.whatwg.org/#concept-urlencoded-parser >+auto URLParser::parseURLEncodedForm(StringView input) -> URLEncodedForm >+{ >+ URLEncodedForm output; >+ for (StringView bytes : input.split('&')) { >+ auto equalIndex = bytes.find('='); >+ if (equalIndex == notFound) { >+ auto name = formURLDecode(bytes.toString().replace('+', 0x20)); >+ if (name) >+ output.append({ name.value(), emptyString() }); >+ } else { >+ auto name = formURLDecode(bytes.substring(0, equalIndex).toString().replace('+', 0x20)); >+ auto value = formURLDecode(bytes.substring(equalIndex + 1).toString().replace('+', 0x20)); >+ if (name && value) >+ output.append({ name.value(), value.value() }); >+ } >+ } >+ return output; >+} >+ >+static void serializeURLEncodedForm(const String& input, Vector<LChar>& output) >+{ >+ auto utf8 = input.utf8(StrictConversion); >+ const char* data = utf8.data(); >+ for (size_t i = 0; i < utf8.length(); ++i) { >+ const char byte = data[i]; >+ if (byte == 0x20) >+ output.append(0x2B); >+ else if (byte == 0x2A >+ || byte == 0x2D >+ || byte == 0x2E >+ || (byte >= 0x30 && byte <= 0x39) >+ || (byte >= 0x41 && byte <= 0x5A) >+ || byte == 0x5F >+ || (byte >= 0x61 && byte <= 0x7A)) // FIXME: Put these in the characterClassTable to avoid branches. >+ output.append(byte); >+ else >+ percentEncodeByte(byte, output); >+ } >+} >+ >+String URLParser::serialize(const URLEncodedForm& tuples) >+{ >+ if (tuples.isEmpty()) >+ return { }; >+ >+ Vector<LChar> output; >+ for (auto& tuple : tuples) { >+ if (!output.isEmpty()) >+ output.append('&'); >+ serializeURLEncodedForm(tuple.key, output); >+ output.append('='); >+ serializeURLEncodedForm(tuple.value, output); >+ } >+ return String::adopt(WTFMove(output)); >+} >+ >+const UIDNA& URLParser::internationalDomainNameTranscoder() >+{ >+ static UIDNA* encoder; >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ UErrorCode error = U_ZERO_ERROR; >+ // Warning: Please contact a WebKitGTK+ developer if changing these flags. >+ // They should be synced with ephy_uri_decode() in ephy-uri-helpers.c. >+ encoder = uidna_openUTS46(UIDNA_CHECK_BIDI | UIDNA_CHECK_CONTEXTJ | UIDNA_NONTRANSITIONAL_TO_UNICODE | UIDNA_NONTRANSITIONAL_TO_ASCII, &error); >+ RELEASE_ASSERT(U_SUCCESS(error)); >+ RELEASE_ASSERT(encoder); >+ }); >+ return *encoder; >+} >+ >+bool URLParser::allValuesEqual(const URL& a, const URL& b) >+{ >+ URL_PARSER_LOG("%d %d %d %d %d %d %d %d %d %d %d %d %s\n%d %d %d %d %d %d %d %d %d %d %d %d %s", >+ a.m_isValid, >+ a.m_cannotBeABaseURL, >+ a.m_protocolIsInHTTPFamily, >+ a.m_schemeEnd, >+ a.m_userStart, >+ a.m_userEnd, >+ a.m_passwordEnd, >+ a.m_hostEnd, >+ a.m_hostEnd + a.m_portLength, >+ a.m_pathAfterLastSlash, >+ a.m_pathEnd, >+ a.m_queryEnd, >+ a.m_string.utf8().data(), >+ b.m_isValid, >+ b.m_cannotBeABaseURL, >+ b.m_protocolIsInHTTPFamily, >+ b.m_schemeEnd, >+ b.m_userStart, >+ b.m_userEnd, >+ b.m_passwordEnd, >+ b.m_hostEnd, >+ b.m_hostEnd + b.m_portLength, >+ b.m_pathAfterLastSlash, >+ b.m_pathEnd, >+ b.m_queryEnd, >+ b.m_string.utf8().data()); >+ >+ return a.m_string == b.m_string >+ && a.m_isValid == b.m_isValid >+ && a.m_cannotBeABaseURL == b.m_cannotBeABaseURL >+ && a.m_protocolIsInHTTPFamily == b.m_protocolIsInHTTPFamily >+ && a.m_schemeEnd == b.m_schemeEnd >+ && a.m_userStart == b.m_userStart >+ && a.m_userEnd == b.m_userEnd >+ && a.m_passwordEnd == b.m_passwordEnd >+ && a.m_hostEnd == b.m_hostEnd >+ && a.m_portLength == b.m_portLength >+ && a.m_pathAfterLastSlash == b.m_pathAfterLastSlash >+ && a.m_pathEnd == b.m_pathEnd >+ && a.m_queryEnd == b.m_queryEnd; >+} >+ >+bool URLParser::internalValuesConsistent(const URL& url) >+{ >+ return url.m_schemeEnd <= url.m_userStart >+ && url.m_userStart <= url.m_userEnd >+ && url.m_userEnd <= url.m_passwordEnd >+ && url.m_passwordEnd <= url.m_hostEnd >+ && url.m_hostEnd + url.m_portLength <= url.m_pathAfterLastSlash >+ && url.m_pathAfterLastSlash <= url.m_pathEnd >+ && url.m_pathEnd <= url.m_queryEnd >+ && url.m_queryEnd <= url.m_string.length(); >+} >+ >+} // namespace WTF >diff --git a/Source/WTF/wtf/URLParser.h b/Source/WTF/wtf/URLParser.h >new file mode 100644 >index 0000000000000000000000000000000000000000..9e25b54022340a9e88bed8ccf1700392777fe72a >--- /dev/null >+++ b/Source/WTF/wtf/URLParser.h >@@ -0,0 +1,136 @@ >+/* >+ * Copyright (C) 2016-2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include <wtf/Expected.h> >+#include <wtf/Forward.h> >+#include <wtf/URL.h> >+ >+struct UIDNA; >+ >+namespace WTF { >+ >+template<typename CharacterType> class CodePointIterator; >+ >+class URLParser { >+public: >+ WTF_EXPORT_PRIVATE static bool allValuesEqual(const URL&, const URL&); >+ WTF_EXPORT_PRIVATE static bool internalValuesConsistent(const URL&); >+ >+ using URLEncodedForm = Vector<WTF::KeyValuePair<String, String>>; >+ WTF_EXPORT_PRIVATE static URLEncodedForm parseURLEncodedForm(StringView); >+ WTF_EXPORT_PRIVATE static String serialize(const URLEncodedForm&); >+ >+ WTF_EXPORT_PRIVATE static bool isSpecialScheme(const String& scheme); >+ WTF_EXPORT_PRIVATE static std::optional<String> maybeCanonicalizeScheme(const String& scheme); >+ >+ static const UIDNA& internationalDomainNameTranscoder(); >+ static bool isInUserInfoEncodeSet(UChar); >+ >+private: >+ URLParser(const String&, const URL& = { }, const URLTextEncoding* = nullptr); >+ URL result() { return m_url; } >+ >+ static std::optional<uint16_t> defaultPortForProtocol(StringView); >+ friend std::optional<uint16_t> defaultPortForProtocol(StringView); >+ friend class URL; >+ >+ URL m_url; >+ Vector<LChar> m_asciiBuffer; >+ bool m_urlIsSpecial { false }; >+ bool m_urlIsFile { false }; >+ bool m_hostHasPercentOrNonASCII { false }; >+ String m_inputString; >+ const void* m_inputBegin { nullptr }; >+ >+ bool m_didSeeSyntaxViolation { false }; >+ static constexpr size_t defaultInlineBufferSize = 2048; >+ using LCharBuffer = Vector<LChar, defaultInlineBufferSize>; >+ >+ template<typename CharacterType> void parse(const CharacterType*, const unsigned length, const URL&, const URLTextEncoding*); >+ template<typename CharacterType> void parseAuthority(CodePointIterator<CharacterType>); >+ template<typename CharacterType> bool parseHostAndPort(CodePointIterator<CharacterType>); >+ template<typename CharacterType> bool parsePort(CodePointIterator<CharacterType>&); >+ >+ void failure(); >+ enum class ReportSyntaxViolation { No, Yes }; >+ template<typename CharacterType, ReportSyntaxViolation reportSyntaxViolation = ReportSyntaxViolation::Yes> >+ void advance(CodePointIterator<CharacterType>& iterator) { advance<CharacterType, reportSyntaxViolation>(iterator, iterator); } >+ template<typename CharacterType, ReportSyntaxViolation = ReportSyntaxViolation::Yes> >+ void advance(CodePointIterator<CharacterType>&, const CodePointIterator<CharacterType>& iteratorForSyntaxViolationPosition); >+ template<typename CharacterType> bool takesTwoAdvancesUntilEnd(CodePointIterator<CharacterType>); >+ template<typename CharacterType> void syntaxViolation(const CodePointIterator<CharacterType>&); >+ template<typename CharacterType> bool isPercentEncodedDot(CodePointIterator<CharacterType>); >+ template<typename CharacterType> bool isWindowsDriveLetter(CodePointIterator<CharacterType>); >+ template<typename CharacterType> bool isSingleDotPathSegment(CodePointIterator<CharacterType>); >+ template<typename CharacterType> bool isDoubleDotPathSegment(CodePointIterator<CharacterType>); >+ template<typename CharacterType> bool shouldCopyFileURL(CodePointIterator<CharacterType>); >+ template<typename CharacterType> bool checkLocalhostCodePoint(CodePointIterator<CharacterType>&, UChar32); >+ template<typename CharacterType> bool isAtLocalhost(CodePointIterator<CharacterType>); >+ bool isLocalhost(StringView); >+ template<typename CharacterType> void consumeSingleDotPathSegment(CodePointIterator<CharacterType>&); >+ template<typename CharacterType> void consumeDoubleDotPathSegment(CodePointIterator<CharacterType>&); >+ template<typename CharacterType> void appendWindowsDriveLetter(CodePointIterator<CharacterType>&); >+ template<typename CharacterType> size_t currentPosition(const CodePointIterator<CharacterType>&); >+ template<typename UnsignedIntegerType> void appendNumberToASCIIBuffer(UnsignedIntegerType); >+ template<bool(*isInCodeSet)(UChar32), typename CharacterType> void utf8PercentEncode(const CodePointIterator<CharacterType>&); >+ template<typename CharacterType> void utf8QueryEncode(const CodePointIterator<CharacterType>&); >+ template<typename CharacterType> std::optional<LCharBuffer> domainToASCII(StringImpl&, const CodePointIterator<CharacterType>& iteratorForSyntaxViolationPosition); >+ template<typename CharacterType> LCharBuffer percentDecode(const LChar*, size_t, const CodePointIterator<CharacterType>& iteratorForSyntaxViolationPosition); >+ static LCharBuffer percentDecode(const LChar*, size_t); >+ static std::optional<String> formURLDecode(StringView input); >+ static bool hasForbiddenHostCodePoint(const LCharBuffer&); >+ void percentEncodeByte(uint8_t); >+ void appendToASCIIBuffer(UChar32); >+ void appendToASCIIBuffer(const char*, size_t); >+ void appendToASCIIBuffer(const LChar* characters, size_t size) { appendToASCIIBuffer(reinterpret_cast<const char*>(characters), size); } >+ template<typename CharacterType> void encodeNonUTF8Query(const Vector<UChar>& source, const URLTextEncoding&, CodePointIterator<CharacterType>); >+ void copyASCIIStringUntil(const String&, size_t length); >+ bool copyBaseWindowsDriveLetter(const URL&); >+ StringView parsedDataView(size_t start, size_t length); >+ UChar parsedDataView(size_t position); >+ >+ using IPv4Address = uint32_t; >+ void serializeIPv4(IPv4Address); >+ enum class IPv4ParsingError; >+ enum class IPv4PieceParsingError; >+ template<typename CharacterTypeForSyntaxViolation, typename CharacterType> Expected<IPv4Address, IPv4ParsingError> parseIPv4Host(const CodePointIterator<CharacterTypeForSyntaxViolation>&, CodePointIterator<CharacterType>); >+ template<typename CharacterType> Expected<uint32_t, URLParser::IPv4PieceParsingError> parseIPv4Piece(CodePointIterator<CharacterType>&, bool& syntaxViolation); >+ using IPv6Address = std::array<uint16_t, 8>; >+ template<typename CharacterType> std::optional<IPv6Address> parseIPv6Host(CodePointIterator<CharacterType>); >+ template<typename CharacterType> std::optional<uint32_t> parseIPv4PieceInsideIPv6(CodePointIterator<CharacterType>&); >+ template<typename CharacterType> std::optional<IPv4Address> parseIPv4AddressInsideIPv6(CodePointIterator<CharacterType>); >+ void serializeIPv6Piece(uint16_t piece); >+ void serializeIPv6(IPv6Address); >+ >+ enum class URLPart; >+ template<typename CharacterType> void copyURLPartsUntil(const URL& base, URLPart, const CodePointIterator<CharacterType>&, const URLTextEncoding*&); >+ static size_t urlLengthUntilPart(const URL&, URLPart); >+ void popPath(); >+ bool shouldPopPath(unsigned); >+}; >+ >+} >diff --git a/Source/WTF/wtf/cf/CFURLExtras.cpp b/Source/WTF/wtf/cf/CFURLExtras.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..b6665a8d0ffb963492064531705bc1cb933bb78d >--- /dev/null >+++ b/Source/WTF/wtf/cf/CFURLExtras.cpp >@@ -0,0 +1,81 @@ >+/* >+ * Copyright (C) 2013 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "CFURLExtras.h" >+ >+#include <wtf/URL.h> >+#include <wtf/text/CString.h> >+ >+namespace WTF { >+ >+RetainPtr<CFURLRef> createCFURLFromBuffer(const char* data, size_t size, CFURLRef baseURL) >+{ >+ // NOTE: We use UTF-8 here since this encoding is used when computing strings when returning URL components >+ // (e.g calls to NSURL -path). However, this function is not tolerant of illegal UTF-8 sequences, which >+ // could either be a malformed string or bytes in a different encoding, like Shift-JIS, so we fall back >+ // onto using ISO Latin-1 in those cases. >+ RetainPtr<CFURLRef> result = adoptCF(CFURLCreateAbsoluteURLWithBytes(0, reinterpret_cast<const UInt8*>(data), size, kCFStringEncodingUTF8, baseURL, true)); >+ if (!result) >+ result = adoptCF(CFURLCreateAbsoluteURLWithBytes(0, reinterpret_cast<const UInt8*>(data), size, kCFStringEncodingISOLatin1, baseURL, true)); >+ return result; >+} >+ >+void getURLBytes(CFURLRef url, URLCharBuffer& result) >+{ >+ CFIndex bytesLength = CFURLGetBytes(url, 0, 0); >+ result.resize(bytesLength); >+ CFIndex finalLength = CFURLGetBytes(url, reinterpret_cast<UInt8*>(result.data()), bytesLength); >+ ASSERT_UNUSED(finalLength, finalLength == bytesLength); >+} >+ >+void getURLBytes(CFURLRef url, CString& result) >+{ >+ CFIndex bytesLength = CFURLGetBytes(url, 0, 0); >+ char* bytes; >+ result = CString::newUninitialized(bytesLength, bytes); >+ CFIndex finalLength = CFURLGetBytes(url, reinterpret_cast<UInt8*>(bytes), bytesLength); >+ ASSERT_UNUSED(finalLength, finalLength == bytesLength); >+} >+ >+bool isCFURLSameOrigin(CFURLRef cfURL, const URL& url) >+{ >+ ASSERT(url.protocolIsInHTTPFamily()); >+ >+ if (url.hasUsername() || url.hasPassword()) >+ return protocolHostAndPortAreEqual(url, URL { cfURL }); >+ >+ URLCharBuffer bytes; >+ getURLBytes(cfURL, bytes); >+ StringView cfURLString { reinterpret_cast<const LChar*>(bytes.data()), static_cast<unsigned>(bytes.size()) }; >+ >+ if (!url.hasPath()) >+ return StringView { url.string() } == cfURLString; >+ >+ auto urlWithoutPath = StringView { url.string() }.substring(0, url.pathStart() + 1); >+ return cfURLString.startsWith(urlWithoutPath); >+} >+ >+} >diff --git a/Source/WTF/wtf/cf/CFURLExtras.h b/Source/WTF/wtf/cf/CFURLExtras.h >new file mode 100644 >index 0000000000000000000000000000000000000000..dac49c3f37f6500e963aed5b04d098f3851f0efc >--- /dev/null >+++ b/Source/WTF/wtf/cf/CFURLExtras.h >@@ -0,0 +1,46 @@ >+/* >+ * Copyright (C) 2013 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#ifndef CFURLExtras_h >+#define CFURLExtras_h >+ >+#include <wtf/Forward.h> >+#include <wtf/RetainPtr.h> >+#include <wtf/Vector.h> >+ >+namespace WTF { >+ >+class URL; >+typedef Vector<char, 512> URLCharBuffer; >+ >+WTF_EXPORT_PRIVATE RetainPtr<CFURLRef> createCFURLFromBuffer(const char*, size_t, CFURLRef baseURL = 0); >+WTF_EXPORT_PRIVATE void getURLBytes(CFURLRef, URLCharBuffer&); >+WTF_EXPORT_PRIVATE void getURLBytes(CFURLRef, CString&); >+ >+bool isCFURLSameOrigin(CFURLRef, const URL&); >+ >+} >+ >+#endif // CFURLExtras_h >diff --git a/Source/WTF/wtf/cf/URLCF.cpp b/Source/WTF/wtf/cf/URLCF.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..89591e2b384ebb206d52227ec9cbf9e75d958252 >--- /dev/null >+++ b/Source/WTF/wtf/cf/URLCF.cpp >@@ -0,0 +1,81 @@ >+/* >+ * Copyright (C) 2004, 2008, 2013 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include <wtf/URL.h> >+ >+#include "CFURLExtras.h" >+#include "URLParser.h" >+#include <CoreFoundation/CFURL.h> >+#include <wtf/text/CString.h> >+ >+namespace WTF { >+ >+URL::URL(CFURLRef url) >+{ >+ if (!url) { >+ invalidate(); >+ return; >+ } >+ >+ // FIXME: Why is it OK to ignore base URL here? >+ CString urlBytes; >+ getURLBytes(url, urlBytes); >+ URLParser parser(urlBytes.data()); >+ *this = parser.result(); >+} >+ >+#if !USE(FOUNDATION) >+RetainPtr<CFURLRef> URL::createCFURL() const >+{ >+ // FIXME: What should this return for invalid URLs? >+ // Currently it throws away the high bytes of the characters in the string in that case, >+ // which is clearly wrong. >+ URLCharBuffer buffer; >+ copyToBuffer(buffer); >+ auto cfURL = createCFURLFromBuffer(buffer.data(), buffer.size()); >+ >+ if (protocolIsInHTTPFamily() && !isCFURLSameOrigin(cfURL.get(), *this)) >+ return nullptr; >+ >+ return cfURL; >+} >+#endif >+ >+String URL::fileSystemPath() const >+{ >+ RetainPtr<CFURLRef> cfURL = createCFURL(); >+ if (!cfURL) >+ return String(); >+ >+#if PLATFORM(WIN) >+ CFURLPathStyle pathStyle = kCFURLWindowsPathStyle; >+#else >+ CFURLPathStyle pathStyle = kCFURLPOSIXPathStyle; >+#endif >+ return adoptCF(CFURLCopyFileSystemPath(cfURL.get(), pathStyle)).get(); >+} >+ >+} >diff --git a/Source/WTF/wtf/cocoa/NSURLExtras.h b/Source/WTF/wtf/cocoa/NSURLExtras.h >new file mode 100644 >index 0000000000000000000000000000000000000000..0c432e4b33d2487db70ff4d39b0bd43e9f89aa1a >--- /dev/null >+++ b/Source/WTF/wtf/cocoa/NSURLExtras.h >@@ -0,0 +1,49 @@ >+/* >+ * Copyright (C) 2005, 2007, 2012, 2014 Apple, Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * 3. Neither the name of Apple Inc. ("Apple") nor the names of >+ * its contributors may be used to endorse or promote products derived >+ * from this software without specific prior written permission. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY >+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES >+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; >+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND >+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF >+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+@class NSString; >+@class NSURL; >+ >+namespace WTF { >+ >+WTF_EXPORT_PRIVATE NSString *userVisibleString(NSURL *); >+WTF_EXPORT_PRIVATE NSURL *URLWithUserTypedString(NSString *, NSURL *baseURL); // Return value of nil means error. >+WTF_EXPORT_PRIVATE NSURL *URLByRemovingUserInfo(NSURL *); >+WTF_EXPORT_PRIVATE NSString *decodeHostName(NSString *); // Return value of nil means error. >+WTF_EXPORT_PRIVATE NSString *encodeHostName(NSString *); // Return value of nil means error. >+WTF_EXPORT_PRIVATE NSURL *URLByTruncatingOneCharacterBeforeComponent(NSURL *, CFURLComponentType); >+WTF_EXPORT_PRIVATE NSURL *URLWithData(NSData *, NSURL *baseURL); >+WTF_EXPORT_PRIVATE NSData *originalURLData(NSURL *); >+WTF_EXPORT_PRIVATE NSData *dataForURLComponentType(NSURL *, CFURLComponentType); >+WTF_EXPORT_PRIVATE NSURL *URLWithUserTypedStringDeprecated(NSString *, NSURL *baseURL); >+ >+NSRange rangeOfURLScheme(NSString *); >+WTF_EXPORT_PRIVATE BOOL isUserVisibleURL(NSString *); >+WTF_EXPORT_PRIVATE BOOL looksLikeAbsoluteURL(NSString *); >+ >+} // namespace WTF >diff --git a/Source/WTF/wtf/cocoa/NSURLExtras.mm b/Source/WTF/wtf/cocoa/NSURLExtras.mm >new file mode 100644 >index 0000000000000000000000000000000000000000..135e42db5a0e3444b2857d3ef169807c2953ea33 >--- /dev/null >+++ b/Source/WTF/wtf/cocoa/NSURLExtras.mm >@@ -0,0 +1,1236 @@ >+/* >+ * Copyright (C) 2005, 2007, 2014 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * 3. Neither the name of Apple Inc. ("Apple") nor the names of >+ * its contributors may be used to endorse or promote products derived >+ * from this software without specific prior written permission. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY >+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES >+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; >+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND >+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF >+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#import "config.h" >+#import <Foundation/Foundation.h> >+#import "NSURLExtras.h" >+ >+#import "CFURLExtras.h" >+#import "URLParser.h" >+#import <wtf/Function.h> >+#import <wtf/HexNumber.h> >+#import <wtf/ObjCRuntimeExtras.h> >+#import <wtf/RetainPtr.h> >+#import <wtf/Vector.h> >+#import <unicode/uchar.h> >+#import <unicode/uidna.h> >+#import <unicode/uscript.h> >+ >+// Needs to be big enough to hold an IDN-encoded name. >+// For host names bigger than this, we won't do IDN encoding, which is almost certainly OK. >+#define HOST_NAME_BUFFER_LENGTH 2048 >+#define URL_BYTES_BUFFER_LENGTH 2048 >+ >+typedef void (* StringRangeApplierFunction)(NSString *, NSRange, RetainPtr<NSMutableArray>&); >+ >+static uint32_t IDNScriptWhiteList[(USCRIPT_CODE_LIMIT + 31) / 32]; >+ >+namespace WTF { >+ >+static bool isArmenianLookalikeCharacter(UChar32 codePoint) >+{ >+ return codePoint == 0x0548 || codePoint == 0x054D || codePoint == 0x0578 || codePoint == 0x057D; >+} >+ >+static bool isArmenianScriptCharacter(UChar32 codePoint) >+{ >+ UErrorCode error = U_ZERO_ERROR; >+ UScriptCode script = uscript_getScript(codePoint, &error); >+ if (error != U_ZERO_ERROR) { >+ LOG_ERROR("got ICU error while trying to look at scripts: %d", error); >+ return false; >+ } >+ >+ return script == USCRIPT_ARMENIAN; >+} >+ >+ >+template<typename CharacterType> inline bool isASCIIDigitOrValidHostCharacter(CharacterType charCode) >+{ >+ if (!isASCIIDigitOrPunctuation(charCode)) >+ return false; >+ >+ // Things the URL Parser rejects: >+ switch (charCode) { >+ case '#': >+ case '%': >+ case '/': >+ case ':': >+ case '?': >+ case '@': >+ case '[': >+ case '\\': >+ case ']': >+ return false; >+ default: >+ return true; >+ } >+} >+ >+ >+ >+static BOOL isLookalikeCharacter(std::optional<UChar32> previousCodePoint, UChar32 charCode) >+{ >+ // This function treats the following as unsafe, lookalike characters: >+ // any non-printable character, any character considered as whitespace, >+ // any ignorable character, and emoji characters related to locks. >+ >+ // We also considered the characters in Mozilla's blacklist <http://kb.mozillazine.org/Network.IDN.blacklist_chars>. >+ >+ // Some of the characters here will never appear once ICU has encoded. >+ // For example, ICU transforms most spaces into an ASCII space and most >+ // slashes into an ASCII solidus. But one of the two callers uses this >+ // on characters that have not been processed by ICU, so they are needed here. >+ >+ if (!u_isprint(charCode) || u_isUWhiteSpace(charCode) || u_hasBinaryProperty(charCode, UCHAR_DEFAULT_IGNORABLE_CODE_POINT)) >+ return YES; >+ >+ switch (charCode) { >+ case 0x00BC: /* VULGAR FRACTION ONE QUARTER */ >+ case 0x00BD: /* VULGAR FRACTION ONE HALF */ >+ case 0x00BE: /* VULGAR FRACTION THREE QUARTERS */ >+ case 0x00ED: /* LATIN SMALL LETTER I WITH ACUTE */ >+ case 0x01C3: /* LATIN LETTER RETROFLEX CLICK */ >+ case 0x0251: /* LATIN SMALL LETTER ALPHA */ >+ case 0x0261: /* LATIN SMALL LETTER SCRIPT G */ >+ case 0x02D0: /* MODIFIER LETTER TRIANGULAR COLON */ >+ case 0x0335: /* COMBINING SHORT STROKE OVERLAY */ >+ case 0x0337: /* COMBINING SHORT SOLIDUS OVERLAY */ >+ case 0x0338: /* COMBINING LONG SOLIDUS OVERLAY */ >+ case 0x0589: /* ARMENIAN FULL STOP */ >+ case 0x05B4: /* HEBREW POINT HIRIQ */ >+ case 0x05BC: /* HEBREW POINT DAGESH OR MAPIQ */ >+ case 0x05C3: /* HEBREW PUNCTUATION SOF PASUQ */ >+ case 0x05F4: /* HEBREW PUNCTUATION GERSHAYIM */ >+ case 0x0609: /* ARABIC-INDIC PER MILLE SIGN */ >+ case 0x060A: /* ARABIC-INDIC PER TEN THOUSAND SIGN */ >+ case 0x0650: /* ARABIC KASRA */ >+ case 0x0660: /* ARABIC INDIC DIGIT ZERO */ >+ case 0x066A: /* ARABIC PERCENT SIGN */ >+ case 0x06D4: /* ARABIC FULL STOP */ >+ case 0x06F0: /* EXTENDED ARABIC INDIC DIGIT ZERO */ >+ case 0x0701: /* SYRIAC SUPRALINEAR FULL STOP */ >+ case 0x0702: /* SYRIAC SUBLINEAR FULL STOP */ >+ case 0x0703: /* SYRIAC SUPRALINEAR COLON */ >+ case 0x0704: /* SYRIAC SUBLINEAR COLON */ >+ case 0x1735: /* PHILIPPINE SINGLE PUNCTUATION */ >+ case 0x1D04: /* LATIN LETTER SMALL CAPITAL C */ >+ case 0x1D0F: /* LATIN LETTER SMALL CAPITAL O */ >+ case 0x1D1C: /* LATIN LETTER SMALL CAPITAL U */ >+ case 0x1D20: /* LATIN LETTER SMALL CAPITAL V */ >+ case 0x1D21: /* LATIN LETTER SMALL CAPITAL W */ >+ case 0x1D22: /* LATIN LETTER SMALL CAPITAL Z */ >+ case 0x1ECD: /* LATIN SMALL LETTER O WITH DOT BELOW */ >+ case 0x2010: /* HYPHEN */ >+ case 0x2011: /* NON-BREAKING HYPHEN */ >+ case 0x2024: /* ONE DOT LEADER */ >+ case 0x2027: /* HYPHENATION POINT */ >+ case 0x2039: /* SINGLE LEFT-POINTING ANGLE QUOTATION MARK */ >+ case 0x203A: /* SINGLE RIGHT-POINTING ANGLE QUOTATION MARK */ >+ case 0x2041: /* CARET INSERTION POINT */ >+ case 0x2044: /* FRACTION SLASH */ >+ case 0x2052: /* COMMERCIAL MINUS SIGN */ >+ case 0x2153: /* VULGAR FRACTION ONE THIRD */ >+ case 0x2154: /* VULGAR FRACTION TWO THIRDS */ >+ case 0x2155: /* VULGAR FRACTION ONE FIFTH */ >+ case 0x2156: /* VULGAR FRACTION TWO FIFTHS */ >+ case 0x2157: /* VULGAR FRACTION THREE FIFTHS */ >+ case 0x2158: /* VULGAR FRACTION FOUR FIFTHS */ >+ case 0x2159: /* VULGAR FRACTION ONE SIXTH */ >+ case 0x215A: /* VULGAR FRACTION FIVE SIXTHS */ >+ case 0x215B: /* VULGAR FRACTION ONE EIGHT */ >+ case 0x215C: /* VULGAR FRACTION THREE EIGHTHS */ >+ case 0x215D: /* VULGAR FRACTION FIVE EIGHTHS */ >+ case 0x215E: /* VULGAR FRACTION SEVEN EIGHTHS */ >+ case 0x215F: /* FRACTION NUMERATOR ONE */ >+ case 0x2212: /* MINUS SIGN */ >+ case 0x2215: /* DIVISION SLASH */ >+ case 0x2216: /* SET MINUS */ >+ case 0x2236: /* RATIO */ >+ case 0x233F: /* APL FUNCTIONAL SYMBOL SLASH BAR */ >+ case 0x23AE: /* INTEGRAL EXTENSION */ >+ case 0x244A: /* OCR DOUBLE BACKSLASH */ >+ case 0x2571: /* DisplayType::Box DRAWINGS LIGHT DIAGONAL UPPER RIGHT TO LOWER LEFT */ >+ case 0x2572: /* DisplayType::Box DRAWINGS LIGHT DIAGONAL UPPER LEFT TO LOWER RIGHT */ >+ case 0x29F6: /* SOLIDUS WITH OVERBAR */ >+ case 0x29F8: /* BIG SOLIDUS */ >+ case 0x2AFB: /* TRIPLE SOLIDUS BINARY RELATION */ >+ case 0x2AFD: /* DOUBLE SOLIDUS OPERATOR */ >+ case 0x2FF0: /* IDEOGRAPHIC DESCRIPTION CHARACTER LEFT TO RIGHT */ >+ case 0x2FF1: /* IDEOGRAPHIC DESCRIPTION CHARACTER ABOVE TO BELOW */ >+ case 0x2FF2: /* IDEOGRAPHIC DESCRIPTION CHARACTER LEFT TO MIDDLE AND RIGHT */ >+ case 0x2FF3: /* IDEOGRAPHIC DESCRIPTION CHARACTER ABOVE TO MIDDLE AND BELOW */ >+ case 0x2FF4: /* IDEOGRAPHIC DESCRIPTION CHARACTER FULL SURROUND */ >+ case 0x2FF5: /* IDEOGRAPHIC DESCRIPTION CHARACTER SURROUND FROM ABOVE */ >+ case 0x2FF6: /* IDEOGRAPHIC DESCRIPTION CHARACTER SURROUND FROM BELOW */ >+ case 0x2FF7: /* IDEOGRAPHIC DESCRIPTION CHARACTER SURROUND FROM LEFT */ >+ case 0x2FF8: /* IDEOGRAPHIC DESCRIPTION CHARACTER SURROUND FROM UPPER LEFT */ >+ case 0x2FF9: /* IDEOGRAPHIC DESCRIPTION CHARACTER SURROUND FROM UPPER RIGHT */ >+ case 0x2FFA: /* IDEOGRAPHIC DESCRIPTION CHARACTER SURROUND FROM LOWER LEFT */ >+ case 0x2FFB: /* IDEOGRAPHIC DESCRIPTION CHARACTER OVERLAID */ >+ case 0x3002: /* IDEOGRAPHIC FULL STOP */ >+ case 0x3008: /* LEFT ANGLE BRACKET */ >+ case 0x3014: /* LEFT TORTOISE SHELL BRACKET */ >+ case 0x3015: /* RIGHT TORTOISE SHELL BRACKET */ >+ case 0x3033: /* VERTICAL KANA REPEAT MARK UPPER HALF */ >+ case 0x3035: /* VERTICAL KANA REPEAT MARK LOWER HALF */ >+ case 0x321D: /* PARENTHESIZED KOREAN CHARACTER OJEON */ >+ case 0x321E: /* PARENTHESIZED KOREAN CHARACTER O HU */ >+ case 0x33AE: /* SQUARE RAD OVER S */ >+ case 0x33AF: /* SQUARE RAD OVER S SQUARED */ >+ case 0x33C6: /* SQUARE C OVER KG */ >+ case 0x33DF: /* SQUARE A OVER M */ >+ case 0x05B9: /* HEBREW POINT HOLAM */ >+ case 0x05BA: /* HEBREW POINT HOLAM HASER FOR VAV */ >+ case 0x05C1: /* HEBREW POINT SHIN DOT */ >+ case 0x05C2: /* HEBREW POINT SIN DOT */ >+ case 0x05C4: /* HEBREW MARK UPPER DOT */ >+ case 0xA731: /* LATIN LETTER SMALL CAPITAL S */ >+ case 0xA771: /* LATIN SMALL LETTER DUM */ >+ case 0xA789: /* MODIFIER LETTER COLON */ >+ case 0xFE14: /* PRESENTATION FORM FOR VERTICAL SEMICOLON */ >+ case 0xFE15: /* PRESENTATION FORM FOR VERTICAL EXCLAMATION MARK */ >+ case 0xFE3F: /* PRESENTATION FORM FOR VERTICAL LEFT ANGLE BRACKET */ >+ case 0xFE5D: /* SMALL LEFT TORTOISE SHELL BRACKET */ >+ case 0xFE5E: /* SMALL RIGHT TORTOISE SHELL BRACKET */ >+ case 0xFF0E: /* FULLWIDTH FULL STOP */ >+ case 0xFF0F: /* FULL WIDTH SOLIDUS */ >+ case 0xFF61: /* HALFWIDTH IDEOGRAPHIC FULL STOP */ >+ case 0xFFFC: /* OBJECT REPLACEMENT CHARACTER */ >+ case 0xFFFD: /* REPLACEMENT CHARACTER */ >+ case 0x1F50F: /* LOCK WITH INK PEN */ >+ case 0x1F510: /* CLOSED LOCK WITH KEY */ >+ case 0x1F511: /* KEY */ >+ case 0x1F512: /* LOCK */ >+ case 0x1F513: /* OPEN LOCK */ >+ return YES; >+ case 0x0307: /* COMBINING DOT ABOVE */ >+ return previousCodePoint == 0x0237 /* LATIN SMALL LETTER DOTLESS J */ >+ || previousCodePoint == 0x0131 /* LATIN SMALL LETTER DOTLESS I */ >+ || previousCodePoint == 0x05D5; /* HEBREW LETTER VAV */ >+ case 0x0548: /* ARMENIAN CAPITAL LETTER VO */ >+ case 0x054D: /* ARMENIAN CAPITAL LETTER SEH */ >+ case 0x0578: /* ARMENIAN SMALL LETTER VO */ >+ case 0x057D: /* ARMENIAN SMALL LETTER SEH */ >+ return previousCodePoint >+ && !isASCIIDigitOrValidHostCharacter(previousCodePoint.value()) >+ && !isArmenianScriptCharacter(previousCodePoint.value()); >+ case '.': >+ return NO; >+ default: >+ return previousCodePoint >+ && isArmenianLookalikeCharacter(previousCodePoint.value()) >+ && !(isArmenianScriptCharacter(charCode) || isASCIIDigitOrValidHostCharacter(charCode)); >+ } >+} >+ >+static void whiteListIDNScript(const char* scriptName) >+{ >+ int32_t script = u_getPropertyValueEnum(UCHAR_SCRIPT, scriptName); >+ if (script >= 0 && script < USCRIPT_CODE_LIMIT) { >+ size_t index = script / 32; >+ uint32_t mask = 1 << (script % 32); >+ IDNScriptWhiteList[index] |= mask; >+ } >+} >+ >+static BOOL readIDNScriptWhiteListFile(NSString *filename) >+{ >+ if (!filename) >+ return NO; >+ >+ FILE *file = fopen([filename fileSystemRepresentation], "r"); >+ if (!file) >+ return NO; >+ >+ // Read a word at a time. >+ // Allow comments, starting with # character to the end of the line. >+ while (1) { >+ // Skip a comment if present. >+ if (fscanf(file, " #%*[^\n\r]%*[\n\r]") == EOF) >+ break; >+ >+ // Read a script name if present. >+ char word[33]; >+ int result = fscanf(file, " %32[^# \t\n\r]%*[^# \t\n\r] ", word); >+ if (result == EOF) >+ break; >+ >+ if (result == 1) { >+ // Got a word, map to script code and put it into the array. >+ whiteListIDNScript(word); >+ } >+ } >+ fclose(file); >+ return YES; >+} >+ >+static BOOL allCharactersInIDNScriptWhiteList(const UChar *buffer, int32_t length) >+{ >+ static dispatch_once_t flag; >+ dispatch_once(&flag, ^{ >+ // Read white list from library. >+ NSArray *dirs = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSAllDomainsMask, YES); >+ int numDirs = [dirs count]; >+ for (int i = 0; i < numDirs; i++) { >+ if (readIDNScriptWhiteListFile([[dirs objectAtIndex:i] stringByAppendingPathComponent:@"IDNScriptWhiteList.txt"])) >+ return; >+ } >+ const char* defaultIDNScriptWhiteList[20] = { >+ "Common", >+ "Inherited", >+ "Arabic", >+ "Armenian", >+ "Bopomofo", >+ "Canadian_Aboriginal", >+ "Devanagari", >+ "Deseret", >+ "Gujarati", >+ "Gurmukhi", >+ "Hangul", >+ "Han", >+ "Hebrew", >+ "Hiragana", >+ "Katakana_Or_Hiragana", >+ "Katakana", >+ "Latin", >+ "Tamil", >+ "Thai", >+ "Yi", >+ }; >+ for (const char* scriptName : defaultIDNScriptWhiteList) >+ whiteListIDNScript(scriptName); >+ }); >+ >+ int32_t i = 0; >+ std::optional<UChar32> previousCodePoint; >+ while (i < length) { >+ UChar32 c; >+ U16_NEXT(buffer, i, length, c) >+ UErrorCode error = U_ZERO_ERROR; >+ UScriptCode script = uscript_getScript(c, &error); >+ if (error != U_ZERO_ERROR) { >+ LOG_ERROR("got ICU error while trying to look at scripts: %d", error); >+ return NO; >+ } >+ if (script < 0) { >+ LOG_ERROR("got negative number for script code from ICU: %d", script); >+ return NO; >+ } >+ if (script >= USCRIPT_CODE_LIMIT) >+ return NO; >+ >+ size_t index = script / 32; >+ uint32_t mask = 1 << (script % 32); >+ if (!(IDNScriptWhiteList[index] & mask)) >+ return NO; >+ >+ if (isLookalikeCharacter(previousCodePoint, c)) >+ return NO; >+ previousCodePoint = c; >+ } >+ return YES; >+} >+ >+static bool isSecondLevelDomainNameAllowedByTLDRules(const UChar* buffer, int32_t length, const WTF::Function<bool(UChar)>& characterIsAllowed) >+{ >+ ASSERT(length > 0); >+ >+ for (int32_t i = length - 1; i >= 0; --i) { >+ UChar ch = buffer[i]; >+ >+ if (characterIsAllowed(ch)) >+ continue; >+ >+ // Only check the second level domain. Lower level registrars may have different rules. >+ if (ch == '.') >+ break; >+ >+ return false; >+ } >+ return true; >+} >+ >+#define CHECK_RULES_IF_SUFFIX_MATCHES(suffix, function) \ >+ { \ >+ static const int32_t suffixLength = sizeof(suffix) / sizeof(suffix[0]); \ >+ if (length > suffixLength && 0 == memcmp(buffer + length - suffixLength, suffix, sizeof(suffix))) \ >+ return isSecondLevelDomainNameAllowedByTLDRules(buffer, length - suffixLength, function); \ >+ } >+ >+static bool isRussianDomainNameCharacter(UChar ch) >+{ >+ // Only modern Russian letters, digits and dashes are allowed. >+ return (ch >= 0x0430 && ch <= 0x044f) || ch == 0x0451 || isASCIIDigit(ch) || ch == '-'; >+} >+ >+static BOOL allCharactersAllowedByTLDRules(const UChar* buffer, int32_t length) >+{ >+ // Skip trailing dot for root domain. >+ if (buffer[length - 1] == '.') >+ length--; >+ >+ // http://cctld.ru/files/pdf/docs/rules_ru-rf.pdf >+ static const UChar cyrillicRF[] = { >+ '.', >+ 0x0440, // CYRILLIC SMALL LETTER ER >+ 0x0444 // CYRILLIC SMALL LETTER EF >+ }; >+ CHECK_RULES_IF_SUFFIX_MATCHES(cyrillicRF, isRussianDomainNameCharacter); >+ >+ // http://rusnames.ru/rules.pl >+ static const UChar cyrillicRUS[] = { >+ '.', >+ 0x0440, // CYRILLIC SMALL LETTER ER >+ 0x0443, // CYRILLIC SMALL LETTER U >+ 0x0441 // CYRILLIC SMALL LETTER ES >+ }; >+ CHECK_RULES_IF_SUFFIX_MATCHES(cyrillicRUS, isRussianDomainNameCharacter); >+ >+ // http://ru.faitid.org/projects/moscow/documents/moskva/idn >+ static const UChar cyrillicMOSKVA[] = { >+ '.', >+ 0x043C, // CYRILLIC SMALL LETTER EM >+ 0x043E, // CYRILLIC SMALL LETTER O >+ 0x0441, // CYRILLIC SMALL LETTER ES >+ 0x043A, // CYRILLIC SMALL LETTER KA >+ 0x0432, // CYRILLIC SMALL LETTER VE >+ 0x0430 // CYRILLIC SMALL LETTER A >+ }; >+ CHECK_RULES_IF_SUFFIX_MATCHES(cyrillicMOSKVA, isRussianDomainNameCharacter); >+ >+ // http://www.dotdeti.ru/foruser/docs/regrules.php >+ static const UChar cyrillicDETI[] = { >+ '.', >+ 0x0434, // CYRILLIC SMALL LETTER DE >+ 0x0435, // CYRILLIC SMALL LETTER IE >+ 0x0442, // CYRILLIC SMALL LETTER TE >+ 0x0438 // CYRILLIC SMALL LETTER I >+ }; >+ CHECK_RULES_IF_SUFFIX_MATCHES(cyrillicDETI, isRussianDomainNameCharacter); >+ >+ // http://corenic.org - rules not published. The word is Russian, so only allowing Russian at this time, >+ // although we may need to revise the checks if this ends up being used with other languages spoken in Russia. >+ static const UChar cyrillicONLAYN[] = { >+ '.', >+ 0x043E, // CYRILLIC SMALL LETTER O >+ 0x043D, // CYRILLIC SMALL LETTER EN >+ 0x043B, // CYRILLIC SMALL LETTER EL >+ 0x0430, // CYRILLIC SMALL LETTER A >+ 0x0439, // CYRILLIC SMALL LETTER SHORT I >+ 0x043D // CYRILLIC SMALL LETTER EN >+ }; >+ CHECK_RULES_IF_SUFFIX_MATCHES(cyrillicONLAYN, isRussianDomainNameCharacter); >+ >+ // http://corenic.org - same as above. >+ static const UChar cyrillicSAYT[] = { >+ '.', >+ 0x0441, // CYRILLIC SMALL LETTER ES >+ 0x0430, // CYRILLIC SMALL LETTER A >+ 0x0439, // CYRILLIC SMALL LETTER SHORT I >+ 0x0442 // CYRILLIC SMALL LETTER TE >+ }; >+ CHECK_RULES_IF_SUFFIX_MATCHES(cyrillicSAYT, isRussianDomainNameCharacter); >+ >+ // http://pir.org/products/opr-domain/ - rules not published. According to the registry site, >+ // the intended audience is "Russian and other Slavic-speaking markets". >+ // Chrome appears to only allow Russian, so sticking with that for now. >+ static const UChar cyrillicORG[] = { >+ '.', >+ 0x043E, // CYRILLIC SMALL LETTER O >+ 0x0440, // CYRILLIC SMALL LETTER ER >+ 0x0433 // CYRILLIC SMALL LETTER GHE >+ }; >+ CHECK_RULES_IF_SUFFIX_MATCHES(cyrillicORG, isRussianDomainNameCharacter); >+ >+ // http://cctld.by/rules.html >+ static const UChar cyrillicBEL[] = { >+ '.', >+ 0x0431, // CYRILLIC SMALL LETTER BE >+ 0x0435, // CYRILLIC SMALL LETTER IE >+ 0x043B // CYRILLIC SMALL LETTER EL >+ }; >+ CHECK_RULES_IF_SUFFIX_MATCHES(cyrillicBEL, [](UChar ch) { >+ // Russian and Byelorussian letters, digits and dashes are allowed. >+ return (ch >= 0x0430 && ch <= 0x044f) || ch == 0x0451 || ch == 0x0456 || ch == 0x045E || ch == 0x2019 || isASCIIDigit(ch) || ch == '-'; >+ }); >+ >+ // http://www.nic.kz/docs/poryadok_vnedreniya_kaz_ru.pdf >+ static const UChar cyrillicKAZ[] = { >+ '.', >+ 0x049B, // CYRILLIC SMALL LETTER KA WITH DESCENDER >+ 0x0430, // CYRILLIC SMALL LETTER A >+ 0x0437 // CYRILLIC SMALL LETTER ZE >+ }; >+ CHECK_RULES_IF_SUFFIX_MATCHES(cyrillicKAZ, [](UChar ch) { >+ // Kazakh letters, digits and dashes are allowed. >+ return (ch >= 0x0430 && ch <= 0x044f) || ch == 0x0451 || ch == 0x04D9 || ch == 0x0493 || ch == 0x049B || ch == 0x04A3 || ch == 0x04E9 || ch == 0x04B1 || ch == 0x04AF || ch == 0x04BB || ch == 0x0456 || isASCIIDigit(ch) || ch == '-'; >+ }); >+ >+ // http://uanic.net/docs/documents-ukr/Rules%20of%20UKR_v4.0.pdf >+ static const UChar cyrillicUKR[] = { >+ '.', >+ 0x0443, // CYRILLIC SMALL LETTER U >+ 0x043A, // CYRILLIC SMALL LETTER KA >+ 0x0440 // CYRILLIC SMALL LETTER ER >+ }; >+ CHECK_RULES_IF_SUFFIX_MATCHES(cyrillicUKR, [](UChar ch) { >+ // Russian and Ukrainian letters, digits and dashes are allowed. >+ return (ch >= 0x0430 && ch <= 0x044f) || ch == 0x0451 || ch == 0x0491 || ch == 0x0404 || ch == 0x0456 || ch == 0x0457 || isASCIIDigit(ch) || ch == '-'; >+ }); >+ >+ // http://www.rnids.rs/data/DOKUMENTI/idn-srb-policy-termsofuse-v1.4-eng.pdf >+ static const UChar cyrillicSRB[] = { >+ '.', >+ 0x0441, // CYRILLIC SMALL LETTER ES >+ 0x0440, // CYRILLIC SMALL LETTER ER >+ 0x0431 // CYRILLIC SMALL LETTER BE >+ }; >+ CHECK_RULES_IF_SUFFIX_MATCHES(cyrillicSRB, [](UChar ch) { >+ // Serbian letters, digits and dashes are allowed. >+ return (ch >= 0x0430 && ch <= 0x0438) || (ch >= 0x043A && ch <= 0x0448) || ch == 0x0452 || ch == 0x0458 || ch == 0x0459 || ch == 0x045A || ch == 0x045B || ch == 0x045F || isASCIIDigit(ch) || ch == '-'; >+ }); >+ >+ // http://marnet.mk/doc/pravilnik-mk-mkd.pdf >+ static const UChar cyrillicMKD[] = { >+ '.', >+ 0x043C, // CYRILLIC SMALL LETTER EM >+ 0x043A, // CYRILLIC SMALL LETTER KA >+ 0x0434 // CYRILLIC SMALL LETTER DE >+ }; >+ CHECK_RULES_IF_SUFFIX_MATCHES(cyrillicMKD, [](UChar ch) { >+ // Macedonian letters, digits and dashes are allowed. >+ return (ch >= 0x0430 && ch <= 0x0438) || (ch >= 0x043A && ch <= 0x0448) || ch == 0x0453 || ch == 0x0455 || ch == 0x0458 || ch == 0x0459 || ch == 0x045A || ch == 0x045C || ch == 0x045F || isASCIIDigit(ch) || ch == '-'; >+ }); >+ >+ // https://www.mon.mn/cs/ >+ static const UChar cyrillicMON[] = { >+ '.', >+ 0x043C, // CYRILLIC SMALL LETTER EM >+ 0x043E, // CYRILLIC SMALL LETTER O >+ 0x043D // CYRILLIC SMALL LETTER EN >+ }; >+ CHECK_RULES_IF_SUFFIX_MATCHES(cyrillicMON, [](UChar ch) { >+ // Mongolian letters, digits and dashes are allowed. >+ return (ch >= 0x0430 && ch <= 0x044f) || ch == 0x0451 || ch == 0x04E9 || ch == 0x04AF || isASCIIDigit(ch) || ch == '-'; >+ }); >+ >+ // Not a known top level domain with special rules. >+ return NO; >+} >+ >+// Return value of nil means no mapping is necessary. >+// If makeString is NO, then return value is either nil or self to indicate mapping is necessary. >+// If makeString is YES, then return value is either nil or the mapped string. >+static NSString *mapHostNameWithRange(NSString *string, NSRange range, BOOL encode, BOOL makeString, BOOL *error) >+{ >+ if (range.length > HOST_NAME_BUFFER_LENGTH) >+ return nil; >+ >+ if (![string length]) >+ return nil; >+ >+ UChar sourceBuffer[HOST_NAME_BUFFER_LENGTH]; >+ UChar destinationBuffer[HOST_NAME_BUFFER_LENGTH]; >+ >+ if (encode && [string rangeOfString:@"%" options:NSLiteralSearch range:range].location != NSNotFound) { >+ NSString *substring = [string substringWithRange:range]; >+ substring = CFBridgingRelease(CFURLCreateStringByReplacingPercentEscapes(nullptr, (CFStringRef)substring, CFSTR(""))); >+ if (substring) { >+ string = substring; >+ range = NSMakeRange(0, [string length]); >+ } >+ } >+ >+ int length = range.length; >+ [string getCharacters:sourceBuffer range:range]; >+ >+ UErrorCode uerror = U_ZERO_ERROR; >+ UIDNAInfo processingDetails = UIDNA_INFO_INITIALIZER; >+ int32_t numCharactersConverted = (encode ? uidna_nameToASCII : uidna_nameToUnicode)(&URLParser::internationalDomainNameTranscoder(), sourceBuffer, length, destinationBuffer, HOST_NAME_BUFFER_LENGTH, &processingDetails, &uerror); >+ if (length && (U_FAILURE(uerror) || processingDetails.errors)) { >+ *error = YES; >+ return nil; >+ } >+ >+ if (numCharactersConverted == length && !memcmp(sourceBuffer, destinationBuffer, length * sizeof(UChar))) >+ return nil; >+ >+ if (!encode && !allCharactersInIDNScriptWhiteList(destinationBuffer, numCharactersConverted) && !allCharactersAllowedByTLDRules(destinationBuffer, numCharactersConverted)) >+ return nil; >+ >+ return makeString ? [NSString stringWithCharacters:destinationBuffer length:numCharactersConverted] : string; >+} >+ >+static BOOL hostNameNeedsDecodingWithRange(NSString *string, NSRange range, BOOL *error) >+{ >+ return mapHostNameWithRange(string, range, NO, NO, error) != nil; >+} >+ >+static BOOL hostNameNeedsEncodingWithRange(NSString *string, NSRange range, BOOL *error) >+{ >+ return mapHostNameWithRange(string, range, YES, NO, error) != nil; >+} >+ >+static NSString *decodeHostNameWithRange(NSString *string, NSRange range) >+{ >+ BOOL error = NO; >+ NSString *host = mapHostNameWithRange(string, range, NO, YES, &error); >+ if (error) >+ return nil; >+ return !host ? string : host; >+} >+ >+static NSString *encodeHostNameWithRange(NSString *string, NSRange range) >+{ >+ BOOL error = NO; >+ NSString *host = mapHostNameWithRange(string, range, YES, YES, &error); >+ if (error) >+ return nil; >+ return !host ? string : host; >+} >+ >+NSString *decodeHostName(NSString *string) >+{ >+ BOOL error = NO; >+ NSString *host = mapHostNameWithRange(string, NSMakeRange(0, [string length]), NO, YES, &error); >+ if (error) >+ return nil; >+ return !host ? string : host; >+} >+ >+NSString *encodeHostName(NSString *string) >+{ >+ BOOL error = NO; >+ NSString *host = mapHostNameWithRange(string, NSMakeRange(0, [string length]), YES, YES, &error); >+ if (error) >+ return nil; >+ return !host ? string : host; >+} >+ >+static void collectRangesThatNeedMapping(NSString *string, NSRange range, RetainPtr<NSMutableArray>& array, BOOL encode) >+{ >+ // Generally, we want to optimize for the case where there is one host name that does not need mapping. >+ // Therefore, we use nil to indicate no mapping here and an empty array to indicate error. >+ >+ BOOL error = NO; >+ BOOL needsMapping = encode ? hostNameNeedsEncodingWithRange(string, range, &error) : hostNameNeedsDecodingWithRange(string, range, &error); >+ if (!error && !needsMapping) >+ return; >+ >+ if (!array) >+ array = adoptNS([NSMutableArray new]); >+ >+ if (!error) >+ [array addObject:[NSValue valueWithRange:range]]; >+} >+ >+static void collectRangesThatNeedEncoding(NSString *string, NSRange range, RetainPtr<NSMutableArray>& array) >+{ >+ return collectRangesThatNeedMapping(string, range, array, YES); >+} >+ >+static void collectRangesThatNeedDecoding(NSString *string, NSRange range, RetainPtr<NSMutableArray>& array) >+{ >+ return collectRangesThatNeedMapping(string, range, array, NO); >+} >+ >+static void applyHostNameFunctionToMailToURLString(NSString *string, StringRangeApplierFunction f, RetainPtr<NSMutableArray>& array) >+{ >+ // In a mailto: URL, host names come after a '@' character and end with a '>' or ',' or '?' character. >+ // Skip quoted strings so that characters in them don't confuse us. >+ // When we find a '?' character, we are past the part of the URL that contains host names. >+ >+ static NeverDestroyed<RetainPtr<NSCharacterSet>> hostNameOrStringStartCharacters = [NSCharacterSet characterSetWithCharactersInString:@"\"@?"]; >+ static NeverDestroyed<RetainPtr<NSCharacterSet>> hostNameEndCharacters = [NSCharacterSet characterSetWithCharactersInString:@">,?"]; >+ static NeverDestroyed<RetainPtr<NSCharacterSet>> quotedStringCharacters = [NSCharacterSet characterSetWithCharactersInString:@"\"\\"]; >+ >+ unsigned stringLength = [string length]; >+ NSRange remaining = NSMakeRange(0, stringLength); >+ >+ while (1) { >+ // Find start of host name or of quoted string. >+ NSRange hostNameOrStringStart = [string rangeOfCharacterFromSet:hostNameOrStringStartCharacters.get().get() options:0 range:remaining]; >+ if (hostNameOrStringStart.location == NSNotFound) >+ return; >+ >+ unichar c = [string characterAtIndex:hostNameOrStringStart.location]; >+ remaining.location = NSMaxRange(hostNameOrStringStart); >+ remaining.length = stringLength - remaining.location; >+ >+ if (c == '?') >+ return; >+ >+ if (c == '@') { >+ // Find end of host name. >+ unsigned hostNameStart = remaining.location; >+ NSRange hostNameEnd = [string rangeOfCharacterFromSet:hostNameEndCharacters.get().get() options:0 range:remaining]; >+ BOOL done; >+ if (hostNameEnd.location == NSNotFound) { >+ hostNameEnd.location = stringLength; >+ done = YES; >+ } else { >+ remaining.location = hostNameEnd.location; >+ remaining.length = stringLength - remaining.location; >+ done = NO; >+ } >+ >+ // Process host name range. >+ f(string, NSMakeRange(hostNameStart, hostNameEnd.location - hostNameStart), array); >+ >+ if (done) >+ return; >+ } else { >+ // Skip quoted string. >+ ASSERT(c == '"'); >+ while (1) { >+ NSRange escapedCharacterOrStringEnd = [string rangeOfCharacterFromSet:quotedStringCharacters.get().get() options:0 range:remaining]; >+ if (escapedCharacterOrStringEnd.location == NSNotFound) >+ return; >+ >+ c = [string characterAtIndex:escapedCharacterOrStringEnd.location]; >+ remaining.location = NSMaxRange(escapedCharacterOrStringEnd); >+ remaining.length = stringLength - remaining.location; >+ >+ // If we are the end of the string, then break from the string loop back to the host name loop. >+ if (c == '"') >+ break; >+ >+ // Skip escaped character. >+ ASSERT(c == '\\'); >+ if (!remaining.length) >+ return; >+ >+ remaining.location += 1; >+ remaining.length -= 1; >+ } >+ } >+ } >+} >+ >+static void applyHostNameFunctionToURLString(NSString *string, StringRangeApplierFunction f, RetainPtr<NSMutableArray>& array) >+{ >+ // Find hostnames. Too bad we can't use any real URL-parsing code to do this, >+ // but we have to do it before doing all the %-escaping, and this is the only >+ // code we have that parses mailto URLs anyway. >+ >+ // Maybe we should implement this using a character buffer instead? >+ >+ if (protocolIs(string, "mailto")) { >+ applyHostNameFunctionToMailToURLString(string, f, array); >+ return; >+ } >+ >+ // Find the host name in a hierarchical URL. >+ // It comes after a "://" sequence, with scheme characters preceding. >+ // If ends with the end of the string or a ":", "/", or a "?". >+ // If there is a "@" character, the host part is just the part after the "@". >+ NSRange separatorRange = [string rangeOfString:@"://"]; >+ if (separatorRange.location == NSNotFound) >+ return; >+ >+ // Check that all characters before the :// are valid scheme characters. >+ static NeverDestroyed<RetainPtr<NSCharacterSet>> nonSchemeCharacters = [[NSCharacterSet characterSetWithCharactersInString:@"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-."] invertedSet]; >+ if ([string rangeOfCharacterFromSet:nonSchemeCharacters.get().get() options:0 range:NSMakeRange(0, separatorRange.location)].location != NSNotFound) >+ return; >+ >+ unsigned stringLength = [string length]; >+ >+ static NeverDestroyed<RetainPtr<NSCharacterSet>> hostTerminators = [NSCharacterSet characterSetWithCharactersInString:@":/?#"]; >+ >+ // Start after the separator. >+ unsigned authorityStart = NSMaxRange(separatorRange); >+ >+ // Find terminating character. >+ NSRange hostNameTerminator = [string rangeOfCharacterFromSet:hostTerminators.get().get() options:0 range:NSMakeRange(authorityStart, stringLength - authorityStart)]; >+ unsigned hostNameEnd = hostNameTerminator.location == NSNotFound ? stringLength : hostNameTerminator.location; >+ >+ // Find "@" for the start of the host name. >+ NSRange userInfoTerminator = [string rangeOfString:@"@" options:0 range:NSMakeRange(authorityStart, hostNameEnd - authorityStart)]; >+ unsigned hostNameStart = userInfoTerminator.location == NSNotFound ? authorityStart : NSMaxRange(userInfoTerminator); >+ >+ return f(string, NSMakeRange(hostNameStart, hostNameEnd - hostNameStart), array); >+} >+ >+static RetainPtr<NSString> mapHostNames(NSString *string, BOOL encode) >+{ >+ // Generally, we want to optimize for the case where there is one host name that does not need mapping. >+ >+ if (encode && [string canBeConvertedToEncoding:NSASCIIStringEncoding]) >+ return string; >+ >+ // Make a list of ranges that actually need mapping. >+ RetainPtr<NSMutableArray> hostNameRanges; >+ StringRangeApplierFunction f = encode ? collectRangesThatNeedEncoding : collectRangesThatNeedDecoding; >+ applyHostNameFunctionToURLString(string, f, hostNameRanges); >+ if (!hostNameRanges) >+ return string; >+ >+ if (![hostNameRanges count]) >+ return nil; >+ >+ // Do the mapping. >+ auto mutableCopy = adoptNS([string mutableCopy]); >+ unsigned i = [hostNameRanges count]; >+ while (i--) { >+ NSRange hostNameRange = [[hostNameRanges objectAtIndex:i] rangeValue]; >+ NSString *mappedHostName = encode ? encodeHostNameWithRange(string, hostNameRange) : decodeHostNameWithRange(string, hostNameRange); >+ [mutableCopy replaceCharactersInRange:hostNameRange withString:mappedHostName]; >+ } >+ return mutableCopy; >+} >+ >+static RetainPtr<NSString> stringByTrimmingWhitespace(NSString *string) >+{ >+ auto trimmed = adoptNS([string mutableCopy]); >+ CFStringTrimWhitespace((__bridge CFMutableStringRef)trimmed.get()); >+ return trimmed; >+} >+ >+NSURL *URLByTruncatingOneCharacterBeforeComponent(NSURL *URL, CFURLComponentType component) >+{ >+ if (!URL) >+ return nil; >+ >+ CFRange fragRg = CFURLGetByteRangeForComponent((__bridge CFURLRef)URL, component, nullptr); >+ if (fragRg.location == kCFNotFound) >+ return URL; >+ >+ Vector<UInt8, URL_BYTES_BUFFER_LENGTH> urlBytes(URL_BYTES_BUFFER_LENGTH); >+ CFIndex numBytes = CFURLGetBytes((__bridge CFURLRef)URL, urlBytes.data(), urlBytes.size()); >+ if (numBytes == -1) { >+ numBytes = CFURLGetBytes((__bridge CFURLRef)URL, nullptr, 0); >+ urlBytes.grow(numBytes); >+ CFURLGetBytes((__bridge CFURLRef)URL, urlBytes.data(), numBytes); >+ } >+ >+ CFURLRef result = CFURLCreateWithBytes(nullptr, urlBytes.data(), fragRg.location - 1, kCFStringEncodingUTF8, nullptr); >+ if (!result) >+ result = CFURLCreateWithBytes(nullptr, urlBytes.data(), fragRg.location - 1, kCFStringEncodingISOLatin1, nullptr); >+ >+ return result ? CFBridgingRelease(result) : URL; >+} >+ >+static NSURL *URLByRemovingResourceSpecifier(NSURL *URL) >+{ >+ return URLByTruncatingOneCharacterBeforeComponent(URL, kCFURLComponentResourceSpecifier); >+} >+ >+NSURL *URLWithData(NSData *data, NSURL *baseURL) >+{ >+ if (!data) >+ return nil; >+ >+ NSURL *result = nil; >+ size_t length = [data length]; >+ if (length > 0) { >+ // work around <rdar://4470771>: CFURLCreateAbsoluteURLWithBytes(.., TRUE) doesn't remove non-path components. >+ baseURL = URLByRemovingResourceSpecifier(baseURL); >+ >+ const UInt8 *bytes = static_cast<const UInt8*>([data bytes]); >+ >+ // CFURLCreateAbsoluteURLWithBytes would complain to console if we passed a path to it. >+ if (bytes[0] == '/' && !baseURL) >+ return nil; >+ >+ // NOTE: We use UTF-8 here since this encoding is used when computing strings when returning URL components >+ // (e.g calls to NSURL -path). However, this function is not tolerant of illegal UTF-8 sequences, which >+ // could either be a malformed string or bytes in a different encoding, like shift-jis, so we fall back >+ // onto using ISO Latin 1 in those cases. >+ result = CFBridgingRelease(CFURLCreateAbsoluteURLWithBytes(nullptr, bytes, length, kCFStringEncodingUTF8, (__bridge CFURLRef)baseURL, YES)); >+ if (!result) >+ result = CFBridgingRelease(CFURLCreateAbsoluteURLWithBytes(nullptr, bytes, length, kCFStringEncodingISOLatin1, (__bridge CFURLRef)baseURL, YES)); >+ } else >+ result = [NSURL URLWithString:@""]; >+ >+ return result; >+} >+static NSData *dataWithUserTypedString(NSString *string) >+{ >+ NSData *userTypedData = [string dataUsingEncoding:NSUTF8StringEncoding]; >+ ASSERT(userTypedData); >+ >+ const UInt8* inBytes = static_cast<const UInt8 *>([userTypedData bytes]); >+ int inLength = [userTypedData length]; >+ if (!inLength) >+ return nil; >+ >+ char* outBytes = static_cast<char *>(malloc(inLength * 3)); // large enough to %-escape every character >+ char* p = outBytes; >+ int outLength = 0; >+ for (int i = 0; i < inLength; i++) { >+ UInt8 c = inBytes[i]; >+ if (c <= 0x20 || c >= 0x7f) { >+ *p++ = '%'; >+ *p++ = upperNibbleToASCIIHexDigit(c); >+ *p++ = lowerNibbleToASCIIHexDigit(c); >+ outLength += 3; >+ } else { >+ *p++ = c; >+ outLength++; >+ } >+ } >+ >+ return [NSData dataWithBytesNoCopy:outBytes length:outLength]; // adopts outBytes >+} >+ >+NSURL *URLWithUserTypedString(NSString *string, NSURL *nsURL) >+{ >+ if (!string) >+ return nil; >+ >+ auto mappedString = mapHostNames(stringByTrimmingWhitespace(string).get(), YES); >+ if (!mappedString) >+ return nil; >+ >+ // Let's check whether the URL is bogus. >+ URL url { URL { nsURL }, mappedString.get() }; >+ if (!url.createCFURL()) >+ return nil; >+ >+ // FIXME: https://bugs.webkit.org/show_bug.cgi?id=186057 >+ // We should be able to use url.createCFURL instead of using directly CFURL parsing routines. >+ NSData *data = dataWithUserTypedString(mappedString.get()); >+ if (!data) >+ return [NSURL URLWithString:@""]; >+ >+ return URLWithData(data, nsURL); >+} >+ >+NSURL *URLWithUserTypedStringDeprecated(NSString *string, NSURL *URL) >+{ >+ if (!string) >+ return nil; >+ >+ NSURL *result = URLWithUserTypedString(string, URL); >+ if (!result) { >+ NSData *resultData = dataWithUserTypedString(string); >+ if (!resultData) >+ return [NSURL URLWithString:@""]; >+ result = URLWithData(resultData, URL); >+ } >+ >+ return result; >+} >+ >+static BOOL hasQuestionMarkOnlyQueryString(NSURL *URL) >+{ >+ CFRange rangeWithSeparators; >+ CFURLGetByteRangeForComponent((__bridge CFURLRef)URL, kCFURLComponentQuery, &rangeWithSeparators); >+ if (rangeWithSeparators.location != kCFNotFound && rangeWithSeparators.length == 1) >+ return YES; >+ >+ return NO; >+} >+ >+NSData *dataForURLComponentType(NSURL *URL, CFURLComponentType componentType) >+{ >+ Vector<UInt8, URL_BYTES_BUFFER_LENGTH> allBytesBuffer(URL_BYTES_BUFFER_LENGTH); >+ CFIndex bytesFilled = CFURLGetBytes((__bridge CFURLRef)URL, allBytesBuffer.data(), allBytesBuffer.size()); >+ if (bytesFilled == -1) { >+ CFIndex bytesToAllocate = CFURLGetBytes((__bridge CFURLRef)URL, nullptr, 0); >+ allBytesBuffer.grow(bytesToAllocate); >+ bytesFilled = CFURLGetBytes((__bridge CFURLRef)URL, allBytesBuffer.data(), bytesToAllocate); >+ } >+ >+ const CFURLComponentType completeURL = (CFURLComponentType)-1; >+ CFRange range; >+ if (componentType != completeURL) { >+ range = CFURLGetByteRangeForComponent((__bridge CFURLRef)URL, componentType, nullptr); >+ if (range.location == kCFNotFound) >+ return nil; >+ } else { >+ range.location = 0; >+ range.length = bytesFilled; >+ } >+ >+ NSData *componentData = [NSData dataWithBytes:allBytesBuffer.data() + range.location length:range.length]; >+ >+ const unsigned char *bytes = static_cast<const unsigned char *>([componentData bytes]); >+ NSMutableData *resultData = [NSMutableData data]; >+ // NOTE: add leading '?' to query strings non-zero length query strings. >+ // NOTE: retain question-mark only query strings. >+ if (componentType == kCFURLComponentQuery) { >+ if (range.length > 0 || hasQuestionMarkOnlyQueryString(URL)) >+ [resultData appendBytes:"?" length:1]; >+ } >+ for (int i = 0; i < range.length; i++) { >+ unsigned char c = bytes[i]; >+ if (c <= 0x20 || c >= 0x7f) { >+ char escaped[3]; >+ escaped[0] = '%'; >+ escaped[1] = upperNibbleToASCIIHexDigit(c); >+ escaped[2] = lowerNibbleToASCIIHexDigit(c); >+ [resultData appendBytes:escaped length:3]; >+ } else { >+ char b[1]; >+ b[0] = c; >+ [resultData appendBytes:b length:1]; >+ } >+ } >+ >+ return resultData; >+} >+ >+static NSURL *URLByRemovingComponentAndSubsequentCharacter(NSURL *URL, CFURLComponentType component) >+{ >+ CFRange range = CFURLGetByteRangeForComponent((__bridge CFURLRef)URL, component, 0); >+ if (range.location == kCFNotFound) >+ return URL; >+ >+ // Remove one subsequent character. >+ range.length++; >+ >+ Vector<UInt8, URL_BYTES_BUFFER_LENGTH> buffer(URL_BYTES_BUFFER_LENGTH); >+ CFIndex numBytes = CFURLGetBytes((__bridge CFURLRef)URL, buffer.data(), buffer.size()); >+ if (numBytes == -1) { >+ numBytes = CFURLGetBytes((__bridge CFURLRef)URL, nullptr, 0); >+ buffer.grow(numBytes); >+ CFURLGetBytes((__bridge CFURLRef)URL, buffer.data(), numBytes); >+ } >+ UInt8* urlBytes = buffer.data(); >+ >+ if (numBytes < range.location) >+ return URL; >+ if (numBytes < range.location + range.length) >+ range.length = numBytes - range.location; >+ >+ memmove(urlBytes + range.location, urlBytes + range.location + range.length, numBytes - range.location + range.length); >+ >+ CFURLRef result = CFURLCreateWithBytes(nullptr, urlBytes, numBytes - range.length, kCFStringEncodingUTF8, nullptr); >+ if (!result) >+ result = CFURLCreateWithBytes(nullptr, urlBytes, numBytes - range.length, kCFStringEncodingISOLatin1, nullptr); >+ >+ return result ? CFBridgingRelease(result) : URL; >+} >+ >+NSURL *URLByRemovingUserInfo(NSURL *URL) >+{ >+ return URLByRemovingComponentAndSubsequentCharacter(URL, kCFURLComponentUserInfo); >+} >+ >+NSData *originalURLData(NSURL *URL) >+{ >+ UInt8 *buffer = (UInt8 *)malloc(URL_BYTES_BUFFER_LENGTH); >+ CFIndex bytesFilled = CFURLGetBytes((__bridge CFURLRef)URL, buffer, URL_BYTES_BUFFER_LENGTH); >+ if (bytesFilled == -1) { >+ CFIndex bytesToAllocate = CFURLGetBytes((__bridge CFURLRef)URL, nullptr, 0); >+ buffer = (UInt8 *)realloc(buffer, bytesToAllocate); >+ bytesFilled = CFURLGetBytes((__bridge CFURLRef)URL, buffer, bytesToAllocate); >+ ASSERT(bytesFilled == bytesToAllocate); >+ } >+ >+ // buffer is adopted by the NSData >+ NSData *data = [NSData dataWithBytesNoCopy:buffer length:bytesFilled freeWhenDone:YES]; >+ >+ NSURL *baseURL = (__bridge NSURL *)CFURLGetBaseURL((__bridge CFURLRef)URL); >+ if (baseURL) >+ return originalURLData(URLWithData(data, baseURL)); >+ return data; >+} >+ >+static CFStringRef createStringWithEscapedUnsafeCharacters(CFStringRef string) >+{ >+ CFIndex length = CFStringGetLength(string); >+ Vector<UChar, URL_BYTES_BUFFER_LENGTH> sourceBuffer(length); >+ CFStringGetCharacters(string, CFRangeMake(0, length), sourceBuffer.data()); >+ >+ Vector<UChar, URL_BYTES_BUFFER_LENGTH> outBuffer; >+ >+ std::optional<UChar32> previousCodePoint; >+ CFIndex i = 0; >+ while (i < length) { >+ UChar32 c; >+ U16_NEXT(sourceBuffer, i, length, c) >+ >+ if (isLookalikeCharacter(previousCodePoint, c)) { >+ uint8_t utf8Buffer[4]; >+ CFIndex offset = 0; >+ UBool failure = false; >+ U8_APPEND(utf8Buffer, offset, 4, c, failure) >+ ASSERT(!failure); >+ >+ for (CFIndex j = 0; j < offset; ++j) { >+ outBuffer.append('%'); >+ outBuffer.append(upperNibbleToASCIIHexDigit(utf8Buffer[j])); >+ outBuffer.append(lowerNibbleToASCIIHexDigit(utf8Buffer[j])); >+ } >+ } else { >+ UChar utf16Buffer[2]; >+ CFIndex offset = 0; >+ UBool failure = false; >+ U16_APPEND(utf16Buffer, offset, 2, c, failure) >+ ASSERT(!failure); >+ for (CFIndex j = 0; j < offset; ++j) >+ outBuffer.append(utf16Buffer[j]); >+ } >+ previousCodePoint = c; >+ } >+ >+ return CFStringCreateWithCharacters(nullptr, outBuffer.data(), outBuffer.size()); >+} >+ >+NSString *userVisibleString(NSURL *URL) >+{ >+ NSData *data = originalURLData(URL); >+ const unsigned char *before = static_cast<const unsigned char*>([data bytes]); >+ int length = [data length]; >+ >+ bool mayNeedHostNameDecoding = false; >+ >+ const unsigned char *p = before; >+ int bufferLength = (length * 3) + 1; >+ Vector<char, URL_BYTES_BUFFER_LENGTH> after(bufferLength); // large enough to %-escape every character >+ char *q = after.data(); >+ for (int i = 0; i < length; i++) { >+ unsigned char c = p[i]; >+ // unescape escape sequences that indicate bytes greater than 0x7f >+ if (c == '%' && (i + 1 < length && isASCIIHexDigit(p[i + 1])) && i + 2 < length && isASCIIHexDigit(p[i + 2])) { >+ auto u = toASCIIHexValue(p[i + 1], p[i + 2]); >+ if (u > 0x7f) { >+ // unescape >+ *q++ = u; >+ } else { >+ // do not unescape >+ *q++ = p[i]; >+ *q++ = p[i + 1]; >+ *q++ = p[i + 2]; >+ } >+ i += 2; >+ } else { >+ *q++ = c; >+ >+ // Check for "xn--" in an efficient, non-case-sensitive, way. >+ if (c == '-' && i >= 3 && !mayNeedHostNameDecoding && (q[-4] | 0x20) == 'x' && (q[-3] | 0x20) == 'n' && q[-2] == '-') >+ mayNeedHostNameDecoding = true; >+ } >+ } >+ *q = '\0'; >+ >+ // Check string to see if it can be converted to display using UTF-8 >+ RetainPtr<NSString> result = [NSString stringWithUTF8String:after.data()]; >+ if (!result) { >+ // Could not convert to UTF-8. >+ // Convert characters greater than 0x7f to escape sequences. >+ // Shift current string to the end of the buffer >+ // then we will copy back bytes to the start of the buffer >+ // as we convert. >+ int afterlength = q - after.data(); >+ char *p = after.data() + bufferLength - afterlength - 1; >+ memmove(p, after.data(), afterlength + 1); // copies trailing '\0' >+ char *q = after.data(); >+ while (*p) { >+ unsigned char c = *p; >+ if (c > 0x7f) { >+ *q++ = '%'; >+ *q++ = upperNibbleToASCIIHexDigit(c); >+ *q++ = lowerNibbleToASCIIHexDigit(c); >+ } else >+ *q++ = *p; >+ p++; >+ } >+ *q = '\0'; >+ result = [NSString stringWithUTF8String:after.data()]; >+ } >+ >+ if (mayNeedHostNameDecoding) { >+ // FIXME: Is it good to ignore the failure of mapHostNames and keep result intact? >+ auto mappedResult = mapHostNames(result.get(), NO); >+ if (mappedResult) >+ result = mappedResult; >+ } >+ >+ result = [result precomposedStringWithCanonicalMapping]; >+ return CFBridgingRelease(createStringWithEscapedUnsafeCharacters((__bridge CFStringRef)result.get())); >+} >+ >+BOOL isUserVisibleURL(NSString *string) >+{ >+ BOOL valid = YES; >+ // get buffer >+ >+ char static_buffer[1024]; >+ const char *p; >+ BOOL success = CFStringGetCString((__bridge CFStringRef)string, static_buffer, 1023, kCFStringEncodingUTF8); >+ p = success ? static_buffer : [string UTF8String]; >+ >+ int length = strlen(p); >+ >+ // check for characters <= 0x20 or >=0x7f, %-escape sequences of %7f, and xn--, these >+ // are the things that will lead _web_userVisibleString to actually change things. >+ for (int i = 0; i < length; i++) { >+ unsigned char c = p[i]; >+ // escape control characters, space, and delete >+ if (c <= 0x20 || c == 0x7f) { >+ valid = NO; >+ break; >+ } else if (c == '%' && (i + 1 < length && isASCIIHexDigit(p[i + 1])) && i + 2 < length && isASCIIHexDigit(p[i + 2])) { >+ auto u = toASCIIHexValue(p[i + 1], p[i + 2]); >+ if (u > 0x7f) { >+ valid = NO; >+ break; >+ } >+ i += 2; >+ } else { >+ // Check for "xn--" in an efficient, non-case-sensitive, way. >+ if (c == '-' && i >= 3 && (p[i - 3] | 0x20) == 'x' && (p[i - 2] | 0x20) == 'n' && p[i - 1] == '-') { >+ valid = NO; >+ break; >+ } >+ } >+ } >+ >+ return valid; >+} >+ >+NSRange rangeOfURLScheme(NSString *string) >+{ >+ NSRange colon = [string rangeOfString:@":"]; >+ if (colon.location != NSNotFound && colon.location > 0) { >+ NSRange scheme = {0, colon.location}; >+ /* >+ This stuff is very expensive. 10-15 msec on a 2x1.2GHz. If not cached it swamps >+ everything else when adding items to the autocomplete DB. Makes me wonder if we >+ even need to enforce the character set here. >+ */ >+ NSString *acceptableCharacters = @"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+.-"; >+ static NeverDestroyed<RetainPtr<NSCharacterSet>> InverseSchemeCharacterSet([[NSCharacterSet characterSetWithCharactersInString:acceptableCharacters] invertedSet]); >+ NSRange illegals = [string rangeOfCharacterFromSet:InverseSchemeCharacterSet.get().get() options:0 range:scheme]; >+ if (illegals.location == NSNotFound) >+ return scheme; >+ } >+ return NSMakeRange(NSNotFound, 0); >+} >+ >+BOOL looksLikeAbsoluteURL(NSString *string) >+{ >+ // Trim whitespace because _web_URLWithString allows whitespace. >+ return rangeOfURLScheme(stringByTrimmingWhitespace(string).get()).location != NSNotFound; >+} >+ >+} // namespace WebCore >diff --git a/Source/WTF/wtf/cocoa/URLCocoa.mm b/Source/WTF/wtf/cocoa/URLCocoa.mm >new file mode 100644 >index 0000000000000000000000000000000000000000..5161c3ac7ce71ad34002b8afbfe44842ef688757 >--- /dev/null >+++ b/Source/WTF/wtf/cocoa/URLCocoa.mm >@@ -0,0 +1,95 @@ >+/* >+ * Copyright (C) 2004, 2008 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#import "config.h" >+#import <wtf/URL.h> >+ >+#import "CFURLExtras.h" >+#import "NSURLExtras.h" >+#import <wtf/ObjCRuntimeExtras.h> >+#import <wtf/URLParser.h> >+#import <wtf/text/CString.h> >+ >+@interface NSString (WTFNSURLExtras) >+- (BOOL)_web_looksLikeIPAddress; >+@end >+ >+namespace WTF { >+ >+URL::URL(NSURL *url) >+{ >+ if (!url) { >+ invalidate(); >+ return; >+ } >+ >+ // FIXME: Why is it OK to ignore base URL here? >+ CString urlBytes; >+ WTF::getURLBytes((__bridge CFURLRef)url, urlBytes); >+ URLParser parser(urlBytes.data()); >+ *this = parser.result(); >+} >+ >+URL::operator NSURL *() const >+{ >+ // Creating a toll-free bridged CFURL because creation with NSURL methods would not preserve the original string. >+ // We'll need fidelity when round-tripping via CFURLGetBytes(). >+ return createCFURL().bridgingAutorelease(); >+} >+ >+RetainPtr<CFURLRef> URL::createCFURL() const >+{ >+ if (isNull()) >+ return nullptr; >+ >+ if (isEmpty()) { >+ // We use the toll-free bridge between NSURL and CFURL to create a CFURLRef supporting both empty and null values. >+ return (__bridge CFURLRef)adoptNS([[NSURL alloc] initWithString:@""]).get(); >+ } >+ >+ RetainPtr<CFURLRef> cfURL; >+ >+ // Fast path if the input data is 8-bit to avoid copying into a temporary buffer. >+ if (LIKELY(m_string.is8Bit())) >+ cfURL = WTF::createCFURLFromBuffer(reinterpret_cast<const char*>(m_string.characters8()), m_string.length()); >+ else { >+ // Slower path. >+ WTF::URLCharBuffer buffer; >+ copyToBuffer(buffer); >+ cfURL = WTF::createCFURLFromBuffer(buffer.data(), buffer.size()); >+ } >+ >+ if (protocolIsInHTTPFamily() && !WTF::isCFURLSameOrigin(cfURL.get(), *this)) >+ return nullptr; >+ >+ return cfURL; >+} >+ >+bool URL::hostIsIPAddress(StringView host) >+{ >+ return [host.createNSStringWithoutCopying().get() _web_looksLikeIPAddress]; >+} >+ >+} >diff --git a/Source/WTF/wtf/glib/GUniquePtrSoup.h b/Source/WTF/wtf/glib/GUniquePtrSoup.h >new file mode 100644 >index 0000000000000000000000000000000000000000..0b4fb34f86f24a4621e0f906706775f948185996 >--- /dev/null >+++ b/Source/WTF/wtf/glib/GUniquePtrSoup.h >@@ -0,0 +1,38 @@ >+/* >+ * Copyright (C) 2014 Igalia S.L >+ * >+ * This library is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU Library General Public >+ * License as published by the Free Software Foundation; either >+ * version 2 of the License, or (at your option) any later version. >+ * >+ * This library is distributed in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >+ * Library General Public License for more details. >+ * >+ * You should have received a copy of the GNU Library General Public License >+ * along with this library; see the file COPYING.LIB. If not, write to >+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >+ * Boston, MA 02110-1301, USA. >+ */ >+ >+#pragma once >+ >+#include <wtf/Platform.h> >+ >+#if USE(SOUP) >+ >+#include <libsoup/soup.h> >+#include <wtf/glib/GUniquePtr.h> >+ >+namespace WTF { >+ >+WTF_DEFINE_GPTR_DELETER(SoupURI, soup_uri_free) >+WTF_DEFINE_GPTR_DELETER(SoupCookie, soup_cookie_free) >+WTF_DEFINE_GPTR_DELETER(SoupMessageHeaders, soup_message_headers_free) >+WTF_DEFINE_GPTR_DELETER(SoupBuffer, soup_buffer_free) >+ >+} // namespace WTF >+ >+#endif // USE(SOUP) >diff --git a/Source/WTF/wtf/glib/URLSoup.cpp b/Source/WTF/wtf/glib/URLSoup.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..55dbc7e17b838919c50cfffbd6b45cf8cb3b89ad >--- /dev/null >+++ b/Source/WTF/wtf/glib/URLSoup.cpp >@@ -0,0 +1,75 @@ >+/* >+ * Copyright (C) 2014 Igalia S.L. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+ >+#if USE(SOUP) >+ >+#include <libsoup/soup.h> >+#include <wtf/URL.h> >+#include <wtf/URLParser.h> >+#include <wtf/text/CString.h> >+ >+namespace WTF { >+ >+URL::URL(SoupURI* soupURI) >+{ >+ if (!soupURI) { >+ invalidate(); >+ return; >+ } >+ >+ GUniquePtr<gchar> urlString(soup_uri_to_string(soupURI, FALSE)); >+ URLParser parser(String::fromUTF8(urlString.get())); >+ *this = parser.result(); >+ >+ if (!isValid()) >+ return; >+ >+ // Motivated by https://bugs.webkit.org/show_bug.cgi?id=38956. libsoup >+ // does not add the password to the URL when calling >+ // soup_uri_to_string, and thus the requests are not properly >+ // built. Fixing soup_uri_to_string is a no-no as the maintainer does >+ // not want to break compatibility with previous implementations >+ if (soupURI->password) >+ setPass(String::fromUTF8(soupURI->password)); >+} >+ >+GUniquePtr<SoupURI> URL::createSoupURI() const >+{ >+ if (!isValid()) >+ return nullptr; >+ >+ return GUniquePtr<SoupURI>(soup_uri_new(string().utf8().data())); >+} >+ >+bool URL::hostIsIPAddress(StringView host) >+{ >+ return !host.isEmpty() && g_hostname_is_ip_address(host.utf8().data()); >+} >+ >+} // namespace WTF >+ >+#endif >diff --git a/Source/WebCore/Modules/applepay/ApplePaySession.h b/Source/WebCore/Modules/applepay/ApplePaySession.h >index d0b9038f82647be0a15f5cea4f801961f672f29b..7ec3982e110b7af73149ae9aec551b0d036b1497 100644 >--- a/Source/WebCore/Modules/applepay/ApplePaySession.h >+++ b/Source/WebCore/Modules/applepay/ApplePaySession.h >@@ -48,7 +48,6 @@ class Payment; > class PaymentContact; > class PaymentCoordinator; > class PaymentMethod; >-class URL; > enum class PaymentAuthorizationStatus; > struct ApplePayLineItem; > struct ApplePayPaymentRequest; >diff --git a/Source/WebCore/Modules/applepay/ApplePayValidateMerchantEvent.h b/Source/WebCore/Modules/applepay/ApplePayValidateMerchantEvent.h >index b0759cda18c03c73db0bd1dcf84531b24b52d09d..3aa22f5b82d6c2c180ece814585d8510894b1b4f 100644 >--- a/Source/WebCore/Modules/applepay/ApplePayValidateMerchantEvent.h >+++ b/Source/WebCore/Modules/applepay/ApplePayValidateMerchantEvent.h >@@ -28,7 +28,7 @@ > #if ENABLE(APPLE_PAY) > > #include "Event.h" >-#include "URL.h" >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/Modules/applepay/PaymentCoordinator.cpp b/Source/WebCore/Modules/applepay/PaymentCoordinator.cpp >index bd5534c2df912587dd277892298bd7d41e7a9afc..e373357cc07fea59de97ec55d5c8893d063864d3 100644 >--- a/Source/WebCore/Modules/applepay/PaymentCoordinator.cpp >+++ b/Source/WebCore/Modules/applepay/PaymentCoordinator.cpp >@@ -31,7 +31,7 @@ > #include "PaymentAuthorizationStatus.h" > #include "PaymentCoordinatorClient.h" > #include "PaymentSession.h" >-#include "URL.h" >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/Modules/applepay/PaymentCoordinator.h b/Source/WebCore/Modules/applepay/PaymentCoordinator.h >index a6f1b6e7b21e0ec004a4b0aa729409b83a7a34ff..5bf71daa26368fc834b154022c9cc1769a14bc3e 100644 >--- a/Source/WebCore/Modules/applepay/PaymentCoordinator.h >+++ b/Source/WebCore/Modules/applepay/PaymentCoordinator.h >@@ -38,7 +38,6 @@ class PaymentContact; > class PaymentMerchantSession; > class PaymentMethod; > class PaymentSession; >-class URL; > enum class PaymentAuthorizationStatus; > struct PaymentAuthorizationResult; > struct PaymentMethodUpdate; >diff --git a/Source/WebCore/Modules/applepay/PaymentCoordinatorClient.h b/Source/WebCore/Modules/applepay/PaymentCoordinatorClient.h >index 80198f2471b348e70a111607a351a320700732b0..85e4e4b04468890f4ec3c804d5a24738e814446b 100644 >--- a/Source/WebCore/Modules/applepay/PaymentCoordinatorClient.h >+++ b/Source/WebCore/Modules/applepay/PaymentCoordinatorClient.h >@@ -38,7 +38,6 @@ > namespace WebCore { > > class PaymentMerchantSession; >-class URL; > struct PaymentAuthorizationResult; > struct PaymentMethodUpdate; > struct ShippingContactUpdate; >diff --git a/Source/WebCore/Modules/applepay/PaymentSession.h b/Source/WebCore/Modules/applepay/PaymentSession.h >index 0a3507e260e7467e0ac0d31c9493754a33ff2a64..8f7a4b650f0b92f815f9b5d5cce179a7d5291043 100644 >--- a/Source/WebCore/Modules/applepay/PaymentSession.h >+++ b/Source/WebCore/Modules/applepay/PaymentSession.h >@@ -37,7 +37,6 @@ class Document; > class Payment; > class PaymentContact; > class PaymentMethod; >-class URL; > > class PaymentSession : public virtual PaymentSessionBase { > public: >diff --git a/Source/WebCore/Modules/applicationmanifest/ApplicationManifest.h b/Source/WebCore/Modules/applicationmanifest/ApplicationManifest.h >index fa4ee637a79e54b31661c4b50d1873b7fe9970c3..b2f1b49f3eb3a3ee80a4fb329f69e8bf8e51a98a 100644 >--- a/Source/WebCore/Modules/applicationmanifest/ApplicationManifest.h >+++ b/Source/WebCore/Modules/applicationmanifest/ApplicationManifest.h >@@ -27,8 +27,9 @@ > > #if ENABLE(APPLICATION_MANIFEST) > >-#include "URL.h" >+#include <wtf/EnumTraits.h> > #include <wtf/Optional.h> >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/Modules/beacon/NavigatorBeacon.cpp b/Source/WebCore/Modules/beacon/NavigatorBeacon.cpp >index e6896e7878b2c2b10f6613cdb985d0b6e258d94a..48976d2a352e20de414a6bf98e566ee470475e06 100644 >--- a/Source/WebCore/Modules/beacon/NavigatorBeacon.cpp >+++ b/Source/WebCore/Modules/beacon/NavigatorBeacon.cpp >@@ -32,7 +32,7 @@ > #include "Frame.h" > #include "HTTPParsers.h" > #include "Navigator.h" >-#include "URL.h" >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/Modules/cache/DOMCache.cpp b/Source/WebCore/Modules/cache/DOMCache.cpp >index d2aa7a2ee7f6fbda19c8afb8e954ead51abf6bf2..87310a6b68677cd9667da991375c3f1ecf61b4d8 100644 >--- a/Source/WebCore/Modules/cache/DOMCache.cpp >+++ b/Source/WebCore/Modules/cache/DOMCache.cpp >@@ -33,7 +33,7 @@ > #include "JSFetchResponse.h" > #include "ReadableStreamChunk.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/Modules/fetch/FetchLoader.h b/Source/WebCore/Modules/fetch/FetchLoader.h >index 67de2e5462bf3dc6ab80c24a318c4054fcf92ca5..4011b3738c979bb978adfdcfcba854cae8c5dfff 100644 >--- a/Source/WebCore/Modules/fetch/FetchLoader.h >+++ b/Source/WebCore/Modules/fetch/FetchLoader.h >@@ -31,7 +31,7 @@ > #include "FetchBodyConsumer.h" > #include "ThreadableLoader.h" > #include "ThreadableLoaderClient.h" >-#include "URL.h" >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/Modules/mediasession/MediaSessionMetadata.h b/Source/WebCore/Modules/mediasession/MediaSessionMetadata.h >index e3644a87519597f64e53f3ccdac744039760023d..6f3dfe36f053899147c4eadefce02d432f9993f4 100644 >--- a/Source/WebCore/Modules/mediasession/MediaSessionMetadata.h >+++ b/Source/WebCore/Modules/mediasession/MediaSessionMetadata.h >@@ -27,7 +27,7 @@ > > #if ENABLE(MEDIA_SESSION) > >-#include "URL.h" >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/Modules/mediasource/MediaSourceRegistry.cpp b/Source/WebCore/Modules/mediasource/MediaSourceRegistry.cpp >index 2e82c3261865d7a9888a5c2c6b85754b42cba459..98c663b6fc6dbda2936a7da26896df003233bdb9 100644 >--- a/Source/WebCore/Modules/mediasource/MediaSourceRegistry.cpp >+++ b/Source/WebCore/Modules/mediasource/MediaSourceRegistry.cpp >@@ -35,9 +35,9 @@ > #if ENABLE(MEDIA_SOURCE) > > #include "MediaSource.h" >-#include "URL.h" > #include <wtf/MainThread.h> > #include <wtf/NeverDestroyed.h> >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/Modules/mediasource/MediaSourceRegistry.h b/Source/WebCore/Modules/mediasource/MediaSourceRegistry.h >index 2b894e0ca43be41b5b10f4d19891343487928306..033674f26d345859a4aa1cda120e6d8841546d85 100644 >--- a/Source/WebCore/Modules/mediasource/MediaSourceRegistry.h >+++ b/Source/WebCore/Modules/mediasource/MediaSourceRegistry.h >@@ -38,7 +38,6 @@ > > namespace WebCore { > >-class URL; > class MediaSource; > > class MediaSourceRegistry final : public URLRegistry { >diff --git a/Source/WebCore/Modules/mediastream/MediaStream.cpp b/Source/WebCore/Modules/mediastream/MediaStream.cpp >index 7e221502408fbc491e870669768679ebe0043462..8ac1457950a79189d3acd2d070566a2187bcfae1 100644 >--- a/Source/WebCore/Modules/mediastream/MediaStream.cpp >+++ b/Source/WebCore/Modules/mediastream/MediaStream.cpp >@@ -41,7 +41,7 @@ > #include "NetworkingContext.h" > #include "Page.h" > #include "RealtimeMediaSource.h" >-#include "URL.h" >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/Modules/mediastream/MediaStreamRegistry.cpp b/Source/WebCore/Modules/mediastream/MediaStreamRegistry.cpp >index d69dccf86e38aa3f73cca719df1b9ebffb2c2008..6415ffaba5c9a848134e522334dd3a601ec2bf2e 100644 >--- a/Source/WebCore/Modules/mediastream/MediaStreamRegistry.cpp >+++ b/Source/WebCore/Modules/mediastream/MediaStreamRegistry.cpp >@@ -29,9 +29,9 @@ > #if ENABLE(MEDIA_STREAM) > > #include "MediaStream.h" >-#include "URL.h" > #include <wtf/MainThread.h> > #include <wtf/NeverDestroyed.h> >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/Modules/mediastream/MediaStreamRegistry.h b/Source/WebCore/Modules/mediastream/MediaStreamRegistry.h >index a267f1100be17c2a0b29a221e3b169c9774aa22d..f6d23d2d790f0d4f275105bb406b19e3ce0e493d 100644 >--- a/Source/WebCore/Modules/mediastream/MediaStreamRegistry.h >+++ b/Source/WebCore/Modules/mediastream/MediaStreamRegistry.h >@@ -36,7 +36,6 @@ namespace WebCore { > > class MediaStream; > class MediaStreamPrivate; >-class URL; > > class MediaStreamRegistry final : public URLRegistry { > public: >diff --git a/Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtilsClient.h b/Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtilsClient.h >index b62d9afa8eae5b4f6fe34b4c58cdb4fdccd65a06..470673a09e95f030f5eeac42398696fa1043e179 100644 >--- a/Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtilsClient.h >+++ b/Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtilsClient.h >@@ -27,7 +27,7 @@ > > #if ENABLE(NAVIGATOR_CONTENT_UTILS) > >-#include "URL.h" >+#include <wtf/URL.h> > #include <wtf/text/WTFString.h> > > namespace WebCore { >diff --git a/Source/WebCore/Modules/notifications/Notification.h b/Source/WebCore/Modules/notifications/Notification.h >index ff0dc54daf1e50238afa35f13289e5b83e2b2b9c..feda1a13aed21c44bad3389629a7253f92b1c9eb 100644 >--- a/Source/WebCore/Modules/notifications/Notification.h >+++ b/Source/WebCore/Modules/notifications/Notification.h >@@ -38,7 +38,7 @@ > #include "NotificationDirection.h" > #include "NotificationPermission.h" > #include "Timer.h" >-#include "URL.h" >+#include <wtf/URL.h> > #include "WritingMode.h" > > namespace WebCore { >diff --git a/Source/WebCore/Modules/paymentrequest/MerchantValidationEvent.h b/Source/WebCore/Modules/paymentrequest/MerchantValidationEvent.h >index 9f6d066f5be0bd7b659a03b938730f17088bf376..29fffbf20b285f8f5e0e619d0871dd6495265d41 100644 >--- a/Source/WebCore/Modules/paymentrequest/MerchantValidationEvent.h >+++ b/Source/WebCore/Modules/paymentrequest/MerchantValidationEvent.h >@@ -28,7 +28,7 @@ > #if ENABLE(PAYMENT_REQUEST) > > #include "Event.h" >-#include "URL.h" >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/Modules/paymentrequest/PaymentRequest.h b/Source/WebCore/Modules/paymentrequest/PaymentRequest.h >index 9e215e5c2dabe97b45c85988820e5f0d30bd1a86..7eae137ad245828b7dd98804652a5d0915bc4668 100644 >--- a/Source/WebCore/Modules/paymentrequest/PaymentRequest.h >+++ b/Source/WebCore/Modules/paymentrequest/PaymentRequest.h >@@ -35,7 +35,7 @@ > #include "PaymentMethodChangeEvent.h" > #include "PaymentOptions.h" > #include "PaymentResponse.h" >-#include "URL.h" >+#include <wtf/URL.h> > #include <wtf/Variant.h> > > namespace WebCore { >diff --git a/Source/WebCore/Modules/plugins/PluginReplacement.h b/Source/WebCore/Modules/plugins/PluginReplacement.h >index 6b5542e089007d9a49704f2fb3cf4398a0fb4e0c..efeaf00c9e358ed68155b58a11ad4725561e0247 100644 >--- a/Source/WebCore/Modules/plugins/PluginReplacement.h >+++ b/Source/WebCore/Modules/plugins/PluginReplacement.h >@@ -40,7 +40,6 @@ class RenderStyle; > class RenderTreePosition; > class Settings; > class ShadowRoot; >-class URL; > > class PluginReplacement : public RefCounted<PluginReplacement> { > public: >diff --git a/Source/WebCore/Modules/webaudio/AudioContext.h b/Source/WebCore/Modules/webaudio/AudioContext.h >index 760a4e7114f74758223add1fb0f856d6e85d30ce..4ef0b4dde01754fd7bd68922a455d9367ecb86d2 100644 >--- a/Source/WebCore/Modules/webaudio/AudioContext.h >+++ b/Source/WebCore/Modules/webaudio/AudioContext.h >@@ -71,7 +71,6 @@ class OscillatorNode; > class PannerNode; > class PeriodicWave; > class ScriptProcessorNode; >-class URL; > class WaveShaperNode; > > // AudioContext is the cornerstone of the web audio API and all AudioNodes are created from it. >diff --git a/Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.h b/Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.h >index ca406af4c6f52251f9f6cca8c45d443abb8d9857..a85dfd7744cd479ab123d332711ee8f23d101d63 100644 >--- a/Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.h >+++ b/Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.h >@@ -40,7 +40,6 @@ class ArrayBuffer; > namespace WebCore { > > class Blob; >-class URL; > class ScriptExecutionContext; > class SocketProvider; > class WebSocketChannelClient; >diff --git a/Source/WebCore/Modules/websockets/WebSocket.h b/Source/WebCore/Modules/websockets/WebSocket.h >index 90121f70d30880c2a02f96580ae05728fb8bddc8..5043c494235d07085506aabdce3bc4d0b84bbc1b 100644 >--- a/Source/WebCore/Modules/websockets/WebSocket.h >+++ b/Source/WebCore/Modules/websockets/WebSocket.h >@@ -34,7 +34,7 @@ > #include "EventTarget.h" > #include "ExceptionOr.h" > #include "Timer.h" >-#include "URL.h" >+#include <wtf/URL.h> > #include "WebSocketChannelClient.h" > #include <wtf/Deque.h> > #include <wtf/HashSet.h> >diff --git a/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp b/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp >index 7427bb557075eda88fbd66121e7d90a3f19cdd34..1b19edab4c9a6f3812f7130b76a6b9537c5c75e6 100644 >--- a/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp >+++ b/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp >@@ -44,7 +44,7 @@ > #include "ResourceRequest.h" > #include "ScriptExecutionContext.h" > #include "SecurityOrigin.h" >-#include "URL.h" >+#include <wtf/URL.h> > #include "WebSocket.h" > #include <wtf/ASCIICType.h> > #include <wtf/CryptographicallyRandomNumber.h> >diff --git a/Source/WebCore/Modules/websockets/WebSocketHandshake.h b/Source/WebCore/Modules/websockets/WebSocketHandshake.h >index cf2bd7ac0af1b274d983bd6bfcf24e381d1223e7..e96f8602a87a935269696765c80e7302cf737eb0 100644 >--- a/Source/WebCore/Modules/websockets/WebSocketHandshake.h >+++ b/Source/WebCore/Modules/websockets/WebSocketHandshake.h >@@ -31,7 +31,7 @@ > #pragma once > > #include "CookieRequestHeaderFieldProxy.h" >-#include "URL.h" >+#include <wtf/URL.h> > #include "ResourceResponse.h" > #include "WebSocketExtensionDispatcher.h" > #include "WebSocketExtensionProcessor.h" >diff --git a/Source/WebCore/Modules/websockets/WorkerThreadableWebSocketChannel.h b/Source/WebCore/Modules/websockets/WorkerThreadableWebSocketChannel.h >index 812f8a02d30a1683ce94684f871020e6bbb99d18..3895e44967507c5ee99cc22f43e721f291375ff8 100644 >--- a/Source/WebCore/Modules/websockets/WorkerThreadableWebSocketChannel.h >+++ b/Source/WebCore/Modules/websockets/WorkerThreadableWebSocketChannel.h >@@ -39,7 +39,6 @@ > > namespace WebCore { > >-class URL; > class ScriptExecutionContext; > class ThreadableWebSocketChannelClientWrapper; > class WorkerGlobalScope; >diff --git a/Source/WebCore/PlatformMac.cmake b/Source/WebCore/PlatformMac.cmake >index 5b039878f6ab910cf6a8635069efb0bb4d7c89b2..71746f06d650a9487a4541799a8bcf20112b3969 100644 >--- a/Source/WebCore/PlatformMac.cmake >+++ b/Source/WebCore/PlatformMac.cmake >@@ -187,7 +187,6 @@ list(APPEND WebCore_SOURCES > platform/audio/mac/FFTFrameMac.cpp > platform/audio/mac/MediaSessionManagerMac.mm > >- platform/cf/CFURLExtras.cpp > platform/cf/FileSystemCF.cpp > platform/cf/KeyedDecoderCF.cpp > platform/cf/KeyedEncoderCF.cpp >@@ -195,7 +194,6 @@ list(APPEND WebCore_SOURCES > platform/cf/MediaAccessibilitySoftLink.cpp > platform/cf/RunLoopObserver.cpp > platform/cf/SharedBufferCF.cpp >- platform/cf/URLCF.cpp > > platform/cocoa/ContentFilterUnblockHandlerCocoa.mm > platform/cocoa/CoreVideoSoftLink.cpp >@@ -397,7 +395,6 @@ list(APPEND WebCore_SOURCES > platform/mac/SuddenTermination.mm > platform/mac/ThemeMac.mm > platform/mac/ThreadCheck.mm >- platform/mac/URLMac.mm > platform/mac/UserActivityMac.mm > platform/mac/ValidationBubbleMac.mm > platform/mac/WebCoreFullScreenPlaceholderView.mm >diff --git a/Source/WebCore/PlatformWin.cmake b/Source/WebCore/PlatformWin.cmake >index 1930ebc39aff46ee9db821f459fc3ece018e4bf7..70046821da81b79ef5f8510e9d01b31f767521bd 100644 >--- a/Source/WebCore/PlatformWin.cmake >+++ b/Source/WebCore/PlatformWin.cmake >@@ -249,12 +249,10 @@ if (USE_CF) > list(APPEND WebCore_SOURCES > loader/archive/cf/LegacyWebArchive.cpp > >- platform/cf/CFURLExtras.cpp > platform/cf/FileSystemCF.cpp > platform/cf/KeyedDecoderCF.cpp > platform/cf/KeyedEncoderCF.cpp > platform/cf/SharedBufferCF.cpp >- platform/cf/URLCF.cpp > > platform/cf/win/CertificateCFWin.cpp > >diff --git a/Source/WebCore/Sources.txt b/Source/WebCore/Sources.txt >index cfe4687822abc32309904ba10343c8fa509d1f32..e745cd5a009f05504d8cb2552a15ef9b957e0262 100644 >--- a/Source/WebCore/Sources.txt >+++ b/Source/WebCore/Sources.txt >@@ -1584,8 +1584,6 @@ platform/Theme.cpp > platform/ThreadGlobalData.cpp > platform/ThreadTimers.cpp > platform/Timer.cpp >-platform/URL.cpp >-platform/URLParser.cpp > platform/UserActivity.cpp > platform/WebCoreCrossThreadCopier.cpp > platform/WebGLStateTracker.cpp >diff --git a/Source/WebCore/SourcesCocoa.txt b/Source/WebCore/SourcesCocoa.txt >index 3a318eabcdff98f9c76588fbcf26e29ebeac703b..52bb2fc2d7a8e87d41f9ce1601ed8157462029cf 100644 >--- a/Source/WebCore/SourcesCocoa.txt >+++ b/Source/WebCore/SourcesCocoa.txt >@@ -180,7 +180,6 @@ platform/audio/mac/AudioSessionMac.cpp > platform/audio/mac/CARingBuffer.cpp > platform/audio/mac/FFTFrameMac.cpp > >-platform/cf/CFURLExtras.cpp > platform/cf/FileSystemCF.cpp > platform/cf/KeyedDecoderCF.cpp > platform/cf/KeyedEncoderCF.cpp >@@ -188,7 +187,6 @@ platform/cf/MainThreadSharedTimerCF.cpp > platform/cf/MediaAccessibilitySoftLink.cpp > platform/cf/RunLoopObserver.cpp > platform/cf/SharedBufferCF.cpp >-platform/cf/URLCF.cpp > > platform/cocoa/ContentFilterUnblockHandlerCocoa.mm @no-unify > platform/cocoa/CoreVideoSoftLink.cpp >@@ -467,7 +465,6 @@ platform/mac/StringUtilities.mm > platform/mac/SuddenTermination.mm > platform/mac/ThemeMac.mm > platform/mac/ThreadCheck.mm @no-unify >-platform/mac/URLMac.mm > platform/mac/UserActivityMac.mm > platform/mac/UserAgentMac.mm > platform/mac/ValidationBubbleMac.mm >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index 3e327b3072e2aee777a503286d00801307f36319..9f4c7477cb7e6f39b1c804c2f7d552f559384188 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -1893,7 +1893,6 @@ > 5C4304B0191AC908000E2BC0 /* EXTShaderTextureLOD.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C4304AD191AC908000E2BC0 /* EXTShaderTextureLOD.cpp */; }; > 5C4304B1191AC908000E2BC0 /* EXTShaderTextureLOD.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C4304AE191AC908000E2BC0 /* EXTShaderTextureLOD.h */; }; > 5C4304B6191AEF46000E2BC0 /* JSEXTShaderTextureLOD.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C4304B4191AEF46000E2BC0 /* JSEXTShaderTextureLOD.h */; }; >- 5C6E65431D5CEFBF00F7862E /* URLParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C6E65401D5CEDC900F7862E /* URLParser.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 5C7C88D81D0F1F4A009D2F6D /* SocketProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C7C88D71D0F1F2B009D2F6D /* SocketProvider.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 5CA1DEC61F71F1C700E71BD3 /* HTTPHeaderField.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CA1DEC41F71E68700E71BD3 /* HTTPHeaderField.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 5CB37FFF1C62D2A100F20188 /* ScrollAnimatorMock.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CB37FFD1C62D27800F20188 /* ScrollAnimatorMock.h */; }; >@@ -1968,7 +1967,6 @@ > 656D37480ADBA5DE00A4554D /* SubresourceLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 656D37300ADBA5DE00A4554D /* SubresourceLoader.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 657AFAFC20047A2900509464 /* SpectreGadget.h in Headers */ = {isa = PBXBuildFile; fileRef = 657AFAF82004789900509464 /* SpectreGadget.h */; }; > 658436860AE01B7400E53753 /* FrameLoadRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 658436850AE01B7400E53753 /* FrameLoadRequest.h */; settings = {ATTRIBUTES = (Private, ); }; }; >- 6593923809AE4346002C531F /* URL.h in Headers */ = {isa = PBXBuildFile; fileRef = 6593923609AE4346002C531F /* URL.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 659A7D130B6DB4D9001155B3 /* SubstituteData.h in Headers */ = {isa = PBXBuildFile; fileRef = 659A7D120B6DB4D9001155B3 /* SubstituteData.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 659DDC8309E198BA001BF3C6 /* JSDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 659DDC8109E198BA001BF3C6 /* JSDocument.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 65A21468097A329100B9050A /* Page.h in Headers */ = {isa = PBXBuildFile; fileRef = 65A21467097A329100B9050A /* Page.h */; settings = {ATTRIBUTES = (Private, ); }; }; >@@ -3859,7 +3857,6 @@ > BCBB8AB913F1AFB000734DF0 /* PODInterval.h in Headers */ = {isa = PBXBuildFile; fileRef = BCBB8AB513F1AFB000734DF0 /* PODInterval.h */; settings = {ATTRIBUTES = (Private, ); }; }; > BCBB8ABA13F1AFB000734DF0 /* PODIntervalTree.h in Headers */ = {isa = PBXBuildFile; fileRef = BCBB8AB613F1AFB000734DF0 /* PODIntervalTree.h */; settings = {ATTRIBUTES = (Private, ); }; }; > BCBB8ABB13F1AFB000734DF0 /* PODRedBlackTree.h in Headers */ = {isa = PBXBuildFile; fileRef = BCBB8AB713F1AFB000734DF0 /* PODRedBlackTree.h */; settings = {ATTRIBUTES = (Private, ); }; }; >- BCBD21AB0E417AD400A070F2 /* URLHash.h in Headers */ = {isa = PBXBuildFile; fileRef = BCBD21AA0E417AD400A070F2 /* URLHash.h */; settings = {ATTRIBUTES = (Private, ); }; }; > BCBFB53D0DCD29CF0019B3E5 /* JSWindowProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = BCBFB53B0DCD29CF0019B3E5 /* JSWindowProxy.h */; settings = {ATTRIBUTES = (Private, ); }; }; > BCC0E8761BFE70E9008F7F50 /* HTMLPictureElement.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC0E8741BFE70E9008F7F50 /* HTMLPictureElement.h */; }; > BCC5BE010C0E93110011C2DB /* JSCSSStyleSheet.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC5BDFF0C0E93110011C2DB /* JSCSSStyleSheet.h */; }; >@@ -4733,7 +4730,6 @@ > E1A1470811102B1500EEC0F3 /* ContainerNodeAlgorithms.h in Headers */ = {isa = PBXBuildFile; fileRef = E1A1470711102B1500EEC0F3 /* ContainerNodeAlgorithms.h */; }; > E1A3162D134BC32D007C9A4F /* WebNSAttributedStringExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = E1A3162B134BC32D007C9A4F /* WebNSAttributedStringExtras.h */; settings = {ATTRIBUTES = (Private, ); }; }; > E1A643F20EC0972500779668 /* WorkerScriptController.h in Headers */ = {isa = PBXBuildFile; fileRef = E1A643F10EC0972500779668 /* WorkerScriptController.h */; settings = {ATTRIBUTES = (Private, ); }; }; >- E1A8E56717552B2A007488E7 /* CFURLExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = E1A8E56517552B2A007488E7 /* CFURLExtras.h */; settings = {ATTRIBUTES = (Private, ); }; }; > E1ADECBF0E76ACF1004A1A5E /* MessagePort.h in Headers */ = {isa = PBXBuildFile; fileRef = E1ADECBD0E76ACF1004A1A5E /* MessagePort.h */; settings = {ATTRIBUTES = (Private, ); }; }; > E1ADECCE0E76AD8B004A1A5E /* MessageChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = E1ADECCC0E76AD8B004A1A5E /* MessageChannel.h */; }; > E1ADEDDA0E76BD93004A1A5E /* JSMessagePort.h in Headers */ = {isa = PBXBuildFile; fileRef = E1ADEDD80E76BD93004A1A5E /* JSMessagePort.h */; }; >@@ -6183,7 +6179,6 @@ > 1A927FCF1416A15B003A83C8 /* npapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = npapi.h; sourceTree = "<group>"; }; > 1A927FD01416A15B003A83C8 /* npruntime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = npruntime.h; sourceTree = "<group>"; }; > 1A927FD11416A15B003A83C8 /* nptypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nptypes.h; sourceTree = "<group>"; }; >- 1A98956A0AA78F80005EF5EF /* URLCF.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = URLCF.cpp; sourceTree = "<group>"; }; > 1AA84F02143BA7BD0051D153 /* ScrollController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ScrollController.mm; sourceTree = "<group>"; }; > 1AA84F03143BA7BD0051D153 /* ScrollController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollController.h; sourceTree = "<group>"; }; > 1AAADDA114DB409F00AF64B3 /* ScrollingTree.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollingTree.cpp; sourceTree = "<group>"; }; >@@ -8843,8 +8838,6 @@ > 5C668E641E7C6C3500D32B3B /* SocketStreamHandleImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SocketStreamHandleImpl.cpp; sourceTree = "<group>"; }; > 5C688AA01D380509000B54FA /* ThreadableWebSocketChannel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadableWebSocketChannel.cpp; sourceTree = "<group>"; }; > 5C688AA21D38126F000B54FA /* SocketProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SocketProvider.cpp; sourceTree = "<group>"; }; >- 5C6E653F1D5CEDC900F7862E /* URLParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = URLParser.cpp; sourceTree = "<group>"; }; >- 5C6E65401D5CEDC900F7862E /* URLParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = URLParser.h; sourceTree = "<group>"; }; > 5C7C88D71D0F1F2B009D2F6D /* SocketProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SocketProvider.h; sourceTree = "<group>"; }; > 5C97A3361F5F7A6500105207 /* RectEdges.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RectEdges.h; sourceTree = "<group>"; }; > 5C9B860B1C21E3C600110F36 /* NetworkLoadMetrics.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NetworkLoadMetrics.mm; sourceTree = "<group>"; }; >@@ -8997,8 +8990,6 @@ > 657AFAFA2004789A00509464 /* SpectreGadget.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SpectreGadget.idl; sourceTree = "<group>"; }; > 657AFAFB2004789A00509464 /* SpectreGadget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpectreGadget.cpp; sourceTree = "<group>"; }; > 658436850AE01B7400E53753 /* FrameLoadRequest.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FrameLoadRequest.h; sourceTree = "<group>"; }; >- 6593923509AE4346002C531F /* URL.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = URL.cpp; sourceTree = "<group>"; }; >- 6593923609AE4346002C531F /* URL.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = URL.h; sourceTree = "<group>"; }; > 6593923909AE435C002C531F /* URLMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = URLMac.mm; sourceTree = "<group>"; }; > 659A7D120B6DB4D9001155B3 /* SubstituteData.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SubstituteData.h; sourceTree = "<group>"; }; > 659DDC8009E198BA001BF3C6 /* JSDocument.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSDocument.cpp; sourceTree = "<group>"; }; >@@ -13017,7 +13008,6 @@ > BCBB8AB513F1AFB000734DF0 /* PODInterval.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PODInterval.h; sourceTree = "<group>"; }; > BCBB8AB613F1AFB000734DF0 /* PODIntervalTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PODIntervalTree.h; sourceTree = "<group>"; }; > BCBB8AB713F1AFB000734DF0 /* PODRedBlackTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PODRedBlackTree.h; sourceTree = "<group>"; }; >- BCBD21AA0E417AD400A070F2 /* URLHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = URLHash.h; sourceTree = "<group>"; }; > BCBFB53A0DCD29CF0019B3E5 /* JSWindowProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWindowProxy.cpp; sourceTree = "<group>"; }; > BCBFB53B0DCD29CF0019B3E5 /* JSWindowProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWindowProxy.h; sourceTree = "<group>"; }; > BCC0E8731BFE70E9008F7F50 /* HTMLPictureElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLPictureElement.cpp; sourceTree = "<group>"; }; >@@ -14518,8 +14508,6 @@ > E1A5F99A0E7EAA2500AF85EA /* JSMessageChannelCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMessageChannelCustom.cpp; sourceTree = "<group>"; }; > E1A643F10EC0972500779668 /* WorkerScriptController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WorkerScriptController.h; sourceTree = "<group>"; }; > E1A643FC0EC097A000779668 /* WorkerScriptController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WorkerScriptController.cpp; sourceTree = "<group>"; }; >- E1A8E56417552B2A007488E7 /* CFURLExtras.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CFURLExtras.cpp; sourceTree = "<group>"; }; >- E1A8E56517552B2A007488E7 /* CFURLExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFURLExtras.h; sourceTree = "<group>"; }; > E1AB1EA814E9E27D00449E13 /* FileList.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = FileList.idl; sourceTree = "<group>"; }; > E1AB1EB714E9E35800449E13 /* File.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = File.idl; sourceTree = "<group>"; }; > E1AB1EBB14E9E37A00449E13 /* FileError.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = FileError.idl; sourceTree = "<group>"; }; >@@ -16525,8 +16513,6 @@ > 1AE42F670AA4B8CB00C8612D /* cf */ = { > isa = PBXGroup; > children = ( >- E1A8E56417552B2A007488E7 /* CFURLExtras.cpp */, >- E1A8E56517552B2A007488E7 /* CFURLExtras.h */, > 5160306B0CC4362300C8AC25 /* FileSystemCF.cpp */, > 517A63BF1B74317E00E7DCDC /* KeyedDecoderCF.cpp */, > 517A63C01B74317E00E7DCDC /* KeyedDecoderCF.h */, >@@ -16538,7 +16524,6 @@ > 2D76BB8319456F8100CFD29A /* RunLoopObserver.cpp */, > 2D76BB801945632400CFD29A /* RunLoopObserver.h */, > 512DD8E20D91E2B4000F89EE /* SharedBufferCF.cpp */, >- 1A98956A0AA78F80005EF5EF /* URLCF.cpp */, > ); > path = cf; > sourceTree = "<group>"; >@@ -25130,11 +25115,6 @@ > 185BCF270F3279CE000EA262 /* ThreadTimers.h */, > 93309EA1099EB78C0056E581 /* Timer.cpp */, > 9305B24C098F1B6B00C28855 /* Timer.h */, >- 6593923509AE4346002C531F /* URL.cpp */, >- 6593923609AE4346002C531F /* URL.h */, >- BCBD21AA0E417AD400A070F2 /* URLHash.h */, >- 5C6E653F1D5CEDC900F7862E /* URLParser.cpp */, >- 5C6E65401D5CEDC900F7862E /* URLParser.h */, > 868160D1187669C40021E79D /* UserActivity.cpp */, > 868160D2187669C40021E79D /* UserActivity.h */, > A3AF9D8220325324006CAD06 /* UserAgent.h */, >@@ -28008,9 +27988,8 @@ > CD318623199F1E2A0030A0F7 /* CDMPrivateMediaSourceAVFObjC.h in Headers */, > CDE595971BF26E2100A1CBE8 /* CDMSessionMediaSourceAVFObjC.h in Headers */, > 5FA904CA178E61F5004C8A2D /* CertificateInfo.h in Headers */, >- 91B8F0B521953D65000C2B00 /* CertificateInfoBase.h in Headers */, >- E1A8E56717552B2A007488E7 /* CFURLExtras.h in Headers */, >- FE36FD1516C7826500F887C1 /* ChangeVersionData.h in Headers */, >+ 91B8F0B521953D65000C2B00 /* CertificateInfoBase.h in Headers */, >+ FE36FD1516C7826500F887C1 /* ChangeVersionData.h in Headers */, > 97BC69DD1505F076001B74AC /* ChangeVersionWrapper.h in Headers */, > FD315FFF12B0267600C1A359 /* ChannelMergerNode.h in Headers */, > FD31600212B0267600C1A359 /* ChannelSplitterNode.h in Headers */, >@@ -31506,11 +31485,8 @@ > E4AFCFA50DAF29A300F5F55C /* UnitBezier.h in Headers */, > D086FE9809D53AAB005BC74D /* UnlinkCommand.h in Headers */, > FD1762E0176686D900D836A8 /* UpSampler.h in Headers */, >- 6593923809AE4346002C531F /* URL.h in Headers */, > 267726051A5DF6F2003C24DD /* URLFilterParser.h in Headers */, >- BCBD21AB0E417AD400A070F2 /* URLHash.h in Headers */, > F55B3DDE1251F12D003EF269 /* URLInputType.h in Headers */, >- 5C6E65431D5CEFBF00F7862E /* URLParser.h in Headers */, > 7CC289DF1AA0FE5D009A9CE3 /* URLRegistry.h in Headers */, > 93D437A21D57B3FE00AB85EA /* URLUtils.h in Headers */, > A72763BF16689BFB002FCACB /* UserActionElementSet.h in Headers */, >diff --git a/Source/WebCore/bindings/js/CachedModuleScriptLoader.h b/Source/WebCore/bindings/js/CachedModuleScriptLoader.h >index f3e346bea7e18bed2b8990674b6e22fc4a025cc2..62cd54a84ab4a5f02fac7b725f60d7e8ad12c2cc 100644 >--- a/Source/WebCore/bindings/js/CachedModuleScriptLoader.h >+++ b/Source/WebCore/bindings/js/CachedModuleScriptLoader.h >@@ -40,7 +40,6 @@ class DeferredPromise; > class Document; > class JSDOMGlobalObject; > class ModuleFetchParameters; >-class URL; > > class CachedModuleScriptLoader final : public RefCounted<CachedModuleScriptLoader>, private CachedResourceClient { > public: >diff --git a/Source/WebCore/bindings/js/CachedScriptFetcher.h b/Source/WebCore/bindings/js/CachedScriptFetcher.h >index 522b2ffc0432c1894a45c02b6959e9e60a84356e..d5391c697d7cf4f6f5d4079ca272ef77ea9caba7 100644 >--- a/Source/WebCore/bindings/js/CachedScriptFetcher.h >+++ b/Source/WebCore/bindings/js/CachedScriptFetcher.h >@@ -33,7 +33,6 @@ namespace WebCore { > > class CachedScript; > class Document; >-class URL; > > class CachedScriptFetcher : public JSC::ScriptFetcher { > public: >diff --git a/Source/WebCore/bindings/js/ScriptController.cpp b/Source/WebCore/bindings/js/ScriptController.cpp >index 4af371f0e1a0ed1584459b378cd505419580f085..21d1d347ca1d07e17a62ba76b5af79b121e23524 100644 >--- a/Source/WebCore/bindings/js/ScriptController.cpp >+++ b/Source/WebCore/bindings/js/ScriptController.cpp >@@ -589,7 +589,7 @@ JSValue ScriptController::executeScript(const ScriptSourceCode& sourceCode, Exce > > bool ScriptController::executeIfJavaScriptURL(const URL& url, ShouldReplaceDocumentIfJavaScriptURL shouldReplaceDocumentIfJavaScriptURL) > { >- if (!protocolIsJavaScript(url)) >+ if (!WTF::protocolIsJavaScript(url)) > return false; > > if (!m_frame.page() || !m_frame.document()->contentSecurityPolicy()->allowJavaScriptURLs(m_frame.document()->url(), eventHandlerPosition().m_line)) >diff --git a/Source/WebCore/bindings/js/ScriptController.h b/Source/WebCore/bindings/js/ScriptController.h >index f7c0824e06cc71469c070d688e426824c9c3c4f0..6e9ddca08de0f6818a07675baa6f4ae4deeebbeb 100644 >--- a/Source/WebCore/bindings/js/ScriptController.h >+++ b/Source/WebCore/bindings/js/ScriptController.h >@@ -60,7 +60,6 @@ class LoadableModuleScript; > class ModuleFetchParameters; > class ScriptSourceCode; > class SecurityOrigin; >-class URL; > class Widget; > struct ExceptionDetails; > >diff --git a/Source/WebCore/bindings/js/ScriptModuleLoader.h b/Source/WebCore/bindings/js/ScriptModuleLoader.h >index 91ff99c150cfbc8fb6ea70f5f5042c7aa1e4344b..a6066f4ce399996c654db603c0a4724dd0840368 100644 >--- a/Source/WebCore/bindings/js/ScriptModuleLoader.h >+++ b/Source/WebCore/bindings/js/ScriptModuleLoader.h >@@ -27,10 +27,10 @@ > > #include "CachedModuleScriptLoader.h" > #include "CachedModuleScriptLoaderClient.h" >-#include "URL.h" >-#include "URLHash.h" > #include <JavaScriptCore/JSCJSValue.h> > #include <wtf/Noncopyable.h> >+#include <wtf/URL.h> >+#include <wtf/URLHash.h> > > namespace JSC { > >diff --git a/Source/WebCore/bindings/js/ScriptSourceCode.h b/Source/WebCore/bindings/js/ScriptSourceCode.h >index 56ee690de84159a57c428a90739b2056ffddbfd6..b7d7eb93cbacb74a81c007e5ef0981225bc9a97a 100644 >--- a/Source/WebCore/bindings/js/ScriptSourceCode.h >+++ b/Source/WebCore/bindings/js/ScriptSourceCode.h >@@ -34,10 +34,10 @@ > #include "CachedScript.h" > #include "CachedScriptFetcher.h" > #include "CachedScriptSourceProvider.h" >-#include "URL.h" > #include <JavaScriptCore/SourceCode.h> > #include <JavaScriptCore/SourceProvider.h> > #include <wtf/RefPtr.h> >+#include <wtf/URL.h> > #include <wtf/text/TextPosition.h> > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >index 3f6c039145c1de4017a926140e011f1f19f0bbf6..65e4536fa6ea1bd3f90feb6b958983da8d7a2389 100644 >--- a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >+++ b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >@@ -4551,7 +4551,7 @@ sub GenerateImplementation > if (NeedsImplementationClass($interface) && !$interface->extendedAttributes->{CustomHeapSnapshot}) { > AddToImplIncludes("<JavaScriptCore/HeapSnapshotBuilder.h>"); > AddToImplIncludes("ScriptExecutionContext.h"); >- AddToImplIncludes("URL.h"); >+ AddToImplIncludes("<wtf/URL.h>"); > push(@implContent, "void ${className}::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder)\n"); > push(@implContent, "{\n"); > push(@implContent, " auto* thisObject = jsCast<${className}*>(cell);\n"); >@@ -4563,7 +4563,7 @@ sub GenerateImplementation > } > > if ($indexedGetterOperation) { >- $implIncludes{"URL.h"} = 1 if $indexedGetterOperation->type->name eq "DOMString"; >+ $implIncludes{"<wtf/URL.h>"} = 1 if $indexedGetterOperation->type->name eq "DOMString"; > if ($interfaceName =~ /^HTML\w*Collection$/ or $interfaceName eq "RadioNodeList") { > $implIncludes{"JSNode.h"} = 1; > $implIncludes{"Node.h"} = 1; >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSInterfaceName.cpp b/Source/WebCore/bindings/scripts/test/JS/JSInterfaceName.cpp >index 11795875351bf2e363c914edd741351b742a29ac..6d9bd17b6d154e0bf0a6ff8b01b001d3356dfe6e 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSInterfaceName.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSInterfaceName.cpp >@@ -26,12 +26,12 @@ > #include "JSDOMExceptionHandling.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSMapLike.cpp b/Source/WebCore/bindings/scripts/test/JS/JSMapLike.cpp >index 6d7faa2b77dad6a473d09ca6ff29b3896c5c4a2b..079c666294aeeca8274ae2bce5efe4ea77b16b4d 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSMapLike.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSMapLike.cpp >@@ -31,13 +31,13 @@ > #include "JSDOMOperation.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/BuiltinNames.h> > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSReadOnlyMapLike.cpp b/Source/WebCore/bindings/scripts/test/JS/JSReadOnlyMapLike.cpp >index 008dceba42c6d4c6fb2c9a913ffb6d33fd0f1c83..97d4f3ab4fa1602ae490ae86c96e0c38478bf934 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSReadOnlyMapLike.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSReadOnlyMapLike.cpp >@@ -31,13 +31,13 @@ > #include "JSDOMOperation.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/BuiltinNames.h> > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp >index 0f7154ac40453f37a9fbb1ed928f62e553031c8d..6cc23ad0131d112f22da8d8adf1205bbb1adb157 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp >@@ -33,12 +33,12 @@ > #include "JSDOMWrapperCache.h" > #include "JSNode.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestCEReactions.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestCEReactions.cpp >index 6406be99903d14c1b17108b8fa3d1292e1fc9070..4a027936b9db99360bfdd78a97b6b35d64686cae 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestCEReactions.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestCEReactions.cpp >@@ -34,12 +34,12 @@ > #include "JSDOMWrapperCache.h" > #include "JSTestCEReactionsStringifier.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp >index adad049b14c4aa5f25aead9460b1c2bfa619224e..342a0df8d1e2835284bc36be61dbbbf27bb28d0c 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp >@@ -30,12 +30,12 @@ > #include "JSDOMOperation.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestCallTracer.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestCallTracer.cpp >index 461c4d96a5f390dc8f190095cb74564a7107a722..3ad8c23793a7a69b8334df5bd754323fd9aab710 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestCallTracer.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestCallTracer.cpp >@@ -37,12 +37,12 @@ > #include "JSDOMWrapperCache.h" > #include "JSNode.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > #include <wtf/Variant.h> > > >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp >index 1db0a32d55e5cb7c0f94c85f2afc9c982b2eb00d..008b5e89768695f25c833ba34601d4be57d0e248 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp >@@ -27,12 +27,12 @@ > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" > #include "TestClassWithJSBuiltinConstructorBuiltins.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp >index e1f9f170a6cd723dbe95584dcf5fad04242cee88..a9454e9ba6b93804a3e90594e9a70e60cd6a1b43 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp >@@ -26,12 +26,12 @@ > #include "JSDOMExceptionHandling.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestDOMJIT.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestDOMJIT.cpp >index 76c40fb04579503ea5b52c47e04960db21999f3a..95d767047388e38c01004295d8cf13456bd44bde 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestDOMJIT.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestDOMJIT.cpp >@@ -41,12 +41,12 @@ > #include "JSElement.h" > #include "JSNodeList.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FrameTracers.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestEnabledBySetting.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestEnabledBySetting.cpp >index 87b353c5b598589d5902b70e64f390721fa92c93..127faa967d2ac536e46ab93dbf56fd5254fe1911 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestEnabledBySetting.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestEnabledBySetting.cpp >@@ -31,13 +31,13 @@ > #include "JSTestSubObj.h" > #include "ScriptExecutionContext.h" > #include "Settings.h" >-#include "URL.h" > #include "WebCoreJSClientData.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > #if ENABLE(TEST_FEATURE) > #include "JSDOMConvertStrings.h" >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp >index 55dea8eeab07f7505f1a6bdfcc241b671cbdea56..45dc1927049be2720552a98b7df235b0f5a15bd0 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp >@@ -30,11 +30,11 @@ > #include "JSDOMExceptionHandling.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp >index 308e34f001ac2d8b353e8051d8ec51bbadd6ee0a..71e3bf3754429ec7a7ccca83551d39288ac1eef3 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp >@@ -32,12 +32,12 @@ > #include "JSDOMWrapperCache.h" > #include "JSNode.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <JavaScriptCore/PropertyNameArray.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp >index 238a48f7c65f0d3cb6f1e03f7a29e9e829ebcbcf..d32c04cc50eedf269ed801d69123f6b505404721 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp >@@ -28,12 +28,12 @@ > #include "JSDOMExceptionHandling.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp >index 34238bc5d213ec499fbe5a255c5618f30685b2dc..ac2bebb2d9324a1a2c2add6a160d37c775c23b8f 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp >@@ -28,12 +28,12 @@ > #include "JSDOMExceptionHandling.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp >index 71b8bddf68daecc73e221ce83d66073c738b4ec8..b20b83c7be9e5b37b9cc5758663e1785585e392c 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp >@@ -34,13 +34,13 @@ > #include "JSDOMWrapperCache.h" > #include "RuntimeEnabledFeatures.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include "WebCoreJSClientData.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > #if ENABLE(TEST_FEATURE) > #include "TestGlobalObjectBuiltins.h" >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp >index 66078bd6cb511e1d2f468882582a7f91fbc06bc9..57892537be878324a5dde8f6d1c592c1b962b725 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp >@@ -27,13 +27,13 @@ > #include "JSDOMExceptionHandling.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <JavaScriptCore/PropertyNameArray.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp >index 6203cc0b987392477a1d9bf7b570cbe37c10e34f..355adcd90aefcf595d07ed546e4caab20b3ee244 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp >@@ -27,13 +27,13 @@ > #include "JSDOMExceptionHandling.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <JavaScriptCore/PropertyNameArray.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp >index 3fdc56040350e1321db24697b7272557dd1a908d..769673afbb4e6201d94c32a84cf249ee60388fe6 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp >@@ -29,13 +29,13 @@ > #include "JSDOMOperation.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <JavaScriptCore/PropertyNameArray.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp >index 40cf7c97722ae7ec2569316b64983554aa91109d..6ea3f9745b2ab48276c51ae3deaa4c1d5808a269 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp >@@ -34,12 +34,12 @@ > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" > #include "TestSupplemental.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > #if ENABLE(Condition1) || ENABLE(Condition11) || ENABLE(Condition12) || ENABLE(Condition2) || ENABLE(Condition22) || ENABLE(Condition23) > #include "JSDOMConvertStrings.h" >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp >index 55ffd67a150fe32c5eda35e32d246f6932e8ebaa..cff32ff0eb3adda77fe9463a2a4f99ce658b4970 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp >@@ -28,12 +28,12 @@ > #include "JSDOMExceptionHandling.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestIterable.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestIterable.cpp >index 979c0f8cc5bad846f0961cbda264e0cb76c1830c..ac1e8e7f9ef829278e245845a66231a5fcbcab08 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestIterable.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestIterable.cpp >@@ -28,13 +28,13 @@ > #include "JSDOMOperation.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/BuiltinNames.h> > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp >index 50ada8caf0ee6d02bada801b0b698aee959d9360..00faf9f0573fd0075de8de5149e8eb50874c94fc 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp >@@ -30,12 +30,12 @@ > #include "JSDOMWrapperCache.h" > #include "JSMediaQueryListListener.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp >index 3187d2daf3d6e721e7e0085f27ccb22f2b41daf9..3febd1cdec40ecefba32bcfc4363243515ce6bcd 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp >@@ -28,13 +28,13 @@ > #include "JSDOMExceptionHandling.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <JavaScriptCore/PropertyNameArray.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp >index d27194e83e6ac776531a9db7730f0574c2dfae1d..e05d65546bfa1136a08642958472cf50ca2d5350 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp >@@ -28,13 +28,13 @@ > #include "JSDOMExceptionHandling.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <JavaScriptCore/PropertyNameArray.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp >index b1f36d73e035afe78efe932b14df93ceffba4df2..e015b178a76538f819e53afe7c5fbba74184ca3b 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp >@@ -30,13 +30,13 @@ > #include "JSDOMOperation.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <JavaScriptCore/PropertyNameArray.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp >index 9298a1760c0835266c42eb664864bf64482c7b30..f1a84a8bad9a5d605a10e49d9c5c4273d99287e1 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp >@@ -29,12 +29,12 @@ > #include "JSDOMNamedConstructor.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp >index 57d67c234e26b4ddd0947e402ef89b4502b6dd43..862b459fbb21d7d10125695f5a0eaefed754f6f6 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp >@@ -28,12 +28,12 @@ > #include "JSDOMExceptionHandling.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp >index d0fcd2f2b9032495b4b658be9b31b7fe55a0886a..c105f15dbaf85dbf3fe4433ba7a8055a842faa4f 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp >@@ -28,12 +28,12 @@ > #include "JSDOMExceptionHandling.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp >index 251410b5faef7004c0116666fce8e1e90a3379a9..64139c8f6b20bb34b6236d62041c7e6d029d8a78 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp >@@ -29,12 +29,12 @@ > #include "JSDOMOperation.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp >index 2758ca10a1412c4139b32584f3cf92b403abb014..d614bce421fe34c6fbe678bd37e532d52d276425 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp >@@ -28,13 +28,13 @@ > #include "JSDOMExceptionHandling.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <JavaScriptCore/PropertyNameArray.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp >index ca2bf612acbc2fd4e044a159a76467e5aacab9b2..ea4c5cd27f8879d179ebbb9153df993810be7647 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp >@@ -28,12 +28,12 @@ > #include "JSDOMExceptionHandling.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp >index 9120f4be7f21b78d2c9bff2db1725a94974bfcd1..6e40def3d44ba37f76400991289afc10e29b7b5f 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp >@@ -28,12 +28,12 @@ > #include "JSDOMExceptionHandling.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp >index 3bb7d3b7e12f829c88c344babdb486822f57cba2..d3924cba6086cf90846bf1108509342018e43366 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp >@@ -29,12 +29,12 @@ > #include "JSDOMOperation.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp >index cbd5d31a6267ea1ee25de0914d61468bfcd925b5..c7a3c6a9d595dfe672cc72abdde03efe6c8328fa 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp >@@ -28,12 +28,12 @@ > #include "JSDOMExceptionHandling.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp >index 9fcbf697b639ae03ddc0ebb2083ce799f7388353..98ec13dc2e79ef5fda64bf72d743f1bcf39e4165 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp >@@ -28,12 +28,12 @@ > #include "JSDOMExceptionHandling.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp >index b8a9fade85b4e987c7052a029a9dd8fcda6d3250..dddff8ccd7259b3745a66cc7dbe6aafff809e6a9 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp >@@ -29,12 +29,12 @@ > #include "JSDOMOperation.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp >index 171477550b0c38459562f6a75c2e83d8315db924..b661f53cd28708883a11c8c205e7048095317f1d 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp >@@ -30,13 +30,13 @@ > #include "JSDOMOperation.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <JavaScriptCore/PropertyNameArray.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp >index 103f91c1baa2aa39f1e399aafece581191116dee..c35ff896c48d8bb287823bdf0a4607a1b3da870d 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp >@@ -30,13 +30,13 @@ > #include "JSDOMOperation.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <JavaScriptCore/PropertyNameArray.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp >index fc122a2e2bbf87ba14b16f70799e6c280f1e4c4d..9f10d64ee5a0d1319b8ccf894da90c8ac18a1883 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp >@@ -28,12 +28,12 @@ > #include "JSDOMExceptionHandling.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp >index 4807b36553318e042a9b67b44408119d684ed1de..c60dcab6359597db4f880edf4040ac83435a8290 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp >@@ -30,12 +30,12 @@ > #include "JSDOMOperation.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp >index dd51930733b6cdaa49e1f6856b6b71f1e117cade..40b981e3441057d7cbb7fee170ee53cb9030177a 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp >@@ -30,12 +30,12 @@ > #include "JSDOMOperation.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp >index de96d3b8cbf20128b39635db36e0684e9f8667c6..2b2ded4c2c688af443f4a97c0fd49b12600065ad 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp >@@ -34,13 +34,13 @@ > #include "JSDOMWrapperCache.h" > #include "RuntimeEnabledFeatures.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/BuiltinNames.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <JavaScriptCore/ObjectConstructor.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp >index 3e7d774eb429006e9d40f65523e5c4fdcf5d5e07..1bd2fa1e005c34c8b8d6e0fe1388a980bdc4140a 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp >@@ -77,7 +77,6 @@ > #include "RuntimeEnabledFeatures.h" > #include "ScriptExecutionContext.h" > #include "SerializedScriptValue.h" >-#include "URL.h" > #include "WebCoreJSClientData.h" > #include <JavaScriptCore/ArrayPrototype.h> > #include <JavaScriptCore/BuiltinNames.h> >@@ -91,6 +90,7 @@ > #include <JavaScriptCore/PropertyNameArray.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > #include <wtf/Variant.h> > #include <wtf/Vector.h> > >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp >index eaf092af3f3a71e9d3c4cf6011bfd9192ab21b5a..1adb70212f451cce85b08cda036fe478089c3978 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp >@@ -32,12 +32,12 @@ > #include "JSDOMExceptionHandling.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp >index 058143ba14bb4eb22409c8d28473753d84f03e7f..b055668596bc6f27c82c716fd234e5d80aa8a4c5 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp >@@ -29,7 +29,6 @@ > #include "JSDOMExceptionHandling.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/IteratorOperations.h> >@@ -37,6 +36,7 @@ > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp >index 0db774af125f5d1850f79a6171475e137ab7cd61..c1a63430ac0d8ac13bba4c4a743949018c711d31 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp >@@ -32,12 +32,12 @@ > #include "JSDOMWrapperCache.h" > #include "JSNode.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestPluginInterface.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestPluginInterface.cpp >index 28362473a709f59646bbeb604be3da111a0a8ced..bec57d5517d5b09c8d20a0ade4297cf0ae8dfced 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestPluginInterface.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestPluginInterface.cpp >@@ -27,12 +27,12 @@ > #include "JSDOMWrapperCache.h" > #include "JSPluginElementFunctions.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp >index 8b0f51ed31941c84aeb24a373be9b17c07f763d7..7a258986714630a3053bc7481a5de0fef1bd798f 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp >@@ -34,11 +34,11 @@ > #include "JSDOMGlobalObject.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestSerialization.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestSerialization.cpp >index e3c1cc259a1d27879a267d9f4458d5d489a68792..78d1c41c428c01e1f75f6e91a64aeb305c0a525f 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestSerialization.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestSerialization.cpp >@@ -36,13 +36,13 @@ > #include "JSTestSerializationIndirectInheritance.h" > #include "JSTestSerializationInheritFinal.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <JavaScriptCore/ObjectConstructor.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp >index 96368f3e6f7bffa8e1a7efbfe7f5063f646dbda7..133eda02e640163fc9be65434820fb925f04c0a4 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp >@@ -26,11 +26,11 @@ > #include "JSDOMExceptionHandling.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationInherit.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationInherit.cpp >index 37f654ddfcd7c15b78eb671c4aac6785d5400bb7..ad531b20b74bc6d259569182eaefc5311cf8e092 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationInherit.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationInherit.cpp >@@ -29,12 +29,12 @@ > #include "JSDOMOperation.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <JavaScriptCore/ObjectConstructor.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp >index 5e86910ab52088e317793649d4c6072ac4e72b94..a1ac2d010e51c4837c0f0b546228034ad0db84e8 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp >@@ -29,12 +29,12 @@ > #include "JSDOMOperation.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <JavaScriptCore/ObjectConstructor.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp >index 342ed1aa50b46868bfb39166ae0f83d08c6802a8..df7dfb8f961d94fe8e24f01d241fb24f6a94faef 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp >@@ -37,13 +37,13 @@ > #include "JSMessagePort.h" > #include "ScriptExecutionContext.h" > #include "SerializedScriptValue.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSArray.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestStringifier.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestStringifier.cpp >index ff2cad2caffc9adf1affa53cdf0977cfc83e8715..5242bb8baac6fc8ca1404060f150bb1dd7c015df 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestStringifier.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestStringifier.cpp >@@ -28,12 +28,12 @@ > #include "JSDOMOperation.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp >index 89edfb4d54ffce29312e9dc370a2904e8638948f..7cae2439ef627b6c26617394b91cc8b804ff055b 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp >@@ -28,12 +28,12 @@ > #include "JSDOMOperation.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp >index b16b6fb4bd14e24d2dae0f44babea64d84700f44..50a46f614f9848b769285e16389073c129157fd1 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp >@@ -28,12 +28,12 @@ > #include "JSDOMOperation.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp >index 5a54ac143cb279364e646c3334b0cbc17ae83435..0a33af378a2b1219f29284dc89e16d38b724779d 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp >@@ -28,12 +28,12 @@ > #include "JSDOMOperation.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp >index f2518a71ed6861c5a8caf6beb34c5fcf6bd30def..49049174e036f5f1806244c3f2ebd19e16962e44 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp >@@ -28,12 +28,12 @@ > #include "JSDOMOperation.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp >index 812372b4d4ee70c423a284334651d1158eaace59..c9c52698b82d3fff27d2344fddb5543d092ca406 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp >@@ -29,12 +29,12 @@ > #include "JSDOMOperation.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp >index 3917b4d9296ba523dc13070619cf4ced38a83fb1..75ec38adb8fe8893046035346b56446d7b2b62f4 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp >@@ -29,12 +29,12 @@ > #include "JSDOMOperation.h" > #include "JSDOMWrapperCache.h" > #include "ScriptExecutionContext.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > > > namespace WebCore { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp >index 1e613aab06524af5560633d8822497fd1c01e0a2..186a416da873a64e5df5c66ebbfd0901ace5dd21 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp >@@ -45,13 +45,13 @@ > #include "JSTestSubObj.h" > #include "ScriptExecutionContext.h" > #include "SerializedScriptValue.h" >-#include "URL.h" > #include <JavaScriptCore/FunctionPrototype.h> > #include <JavaScriptCore/HeapSnapshotBuilder.h> > #include <JavaScriptCore/JSArray.h> > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/GetPtr.h> > #include <wtf/PointerPreparations.h> >+#include <wtf/URL.h> > #include <wtf/Variant.h> > > >diff --git a/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp b/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp >index 72407156ebd62686a134b01a4e40cd5116b759df..d0eaba09fd12eeaf5a137a2ab4dc240b997b7696 100644 >--- a/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp >+++ b/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp >@@ -41,7 +41,7 @@ > #include "FrameLoaderClient.h" > #include "Page.h" > #include "ResourceLoadInfo.h" >-#include "URL.h" >+#include <wtf/URL.h> > #include "UserContentController.h" > #include <wtf/NeverDestroyed.h> > #include <wtf/text/CString.h> >@@ -194,7 +194,7 @@ BlockedStatus ContentExtensionsBackend::processContentExtensionRulesForLoad(cons > break; > case ContentExtensions::ActionType::MakeHTTPS: { > if ((url.protocolIs("http") || url.protocolIs("ws")) >- && (!url.port() || isDefaultPortForProtocol(url.port().value(), url.protocol()))) >+ && (!url.port() || WTF::isDefaultPortForProtocol(url.port().value(), url.protocol()))) > willMakeHTTPS = true; > break; > } >@@ -244,7 +244,7 @@ BlockedStatus ContentExtensionsBackend::processContentExtensionRulesForPingLoad( > willBlockCookies = true; > break; > case ContentExtensions::ActionType::MakeHTTPS: >- if ((url.protocolIs("http") || url.protocolIs("ws")) && (!url.port() || isDefaultPortForProtocol(url.port().value(), url.protocol()))) >+ if ((url.protocolIs("http") || url.protocolIs("ws")) && (!url.port() || WTF::isDefaultPortForProtocol(url.port().value(), url.protocol()))) > willMakeHTTPS = true; > break; > case ContentExtensions::ActionType::CSSDisplayNoneSelector: >@@ -275,12 +275,12 @@ void applyBlockedStatusToRequest(const BlockedStatus& status, Page* page, Resour > if (status.madeHTTPS) { > const URL& originalURL = request.url(); > ASSERT(originalURL.protocolIs("http")); >- ASSERT(!originalURL.port() || isDefaultPortForProtocol(originalURL.port().value(), originalURL.protocol())); >+ ASSERT(!originalURL.port() || WTF::isDefaultPortForProtocol(originalURL.port().value(), originalURL.protocol())); > > URL newURL = originalURL; > newURL.setProtocol("https"); > if (originalURL.port()) >- newURL.setPort(defaultPortForProtocol("https").value()); >+ newURL.setPort(WTF::defaultPortForProtocol("https").value()); > request.setURL(newURL); > } > } >diff --git a/Source/WebCore/contentextensions/ContentExtensionsBackend.h b/Source/WebCore/contentextensions/ContentExtensionsBackend.h >index a296ff97fbcfec90b5a60cfec3c80c40e8e41833..34cfaca501fd3c72c9667e8f4b70de277aac5c66 100644 >--- a/Source/WebCore/contentextensions/ContentExtensionsBackend.h >+++ b/Source/WebCore/contentextensions/ContentExtensionsBackend.h >@@ -37,7 +37,6 @@ namespace WebCore { > > class DocumentLoader; > class ResourceRequest; >-class URL; > > struct ResourceLoadInfo; > >diff --git a/Source/WebCore/css/CSSValue.h b/Source/WebCore/css/CSSValue.h >index ef50e2d4f635404fa148a48530d79241975a6dba..7edd3e231a7c1b20a0b01a468f51d594afb98536 100644 >--- a/Source/WebCore/css/CSSValue.h >+++ b/Source/WebCore/css/CSSValue.h >@@ -21,12 +21,12 @@ > #pragma once > > #include "CSSPropertyNames.h" >-#include "URLHash.h" > #include <wtf/Function.h> > #include <wtf/HashMap.h> > #include <wtf/RefCounted.h> > #include <wtf/RefPtr.h> > #include <wtf/TypeCasts.h> >+#include <wtf/URLHash.h> > > namespace WebCore { > >diff --git a/Source/WebCore/css/StyleProperties.h b/Source/WebCore/css/StyleProperties.h >index 839a5443f9178a22e30b6f087b2c199864cf358c..50f72e9bac64a68186ff53fbf61f3bb9b331c238 100644 >--- a/Source/WebCore/css/StyleProperties.h >+++ b/Source/WebCore/css/StyleProperties.h >@@ -38,7 +38,6 @@ class CSSStyleDeclaration; > class CachedResource; > class Color; > class ImmutableStyleProperties; >-class URL; > class MutableStyleProperties; > class PropertySetCSSStyleDeclaration; > class StyledElement; >diff --git a/Source/WebCore/css/StyleResolver.h b/Source/WebCore/css/StyleResolver.h >index 9824216c813469b8968dd4c12a2e1b07e416d78d..438e5c877fb43f44de572e6ede3d4c20c4738b01 100644 >--- a/Source/WebCore/css/StyleResolver.h >+++ b/Source/WebCore/css/StyleResolver.h >@@ -58,7 +58,6 @@ class Document; > class Element; > class Frame; > class FrameView; >-class URL; > class KeyframeList; > class KeyframeValue; > class MediaQueryEvaluator; >diff --git a/Source/WebCore/css/StyleSheet.h b/Source/WebCore/css/StyleSheet.h >index e8b5bfc56287a4d9828e893d8579cba8b8eebcc2..bab4e627947b6ee85d84995c3fd0234218d43819 100644 >--- a/Source/WebCore/css/StyleSheet.h >+++ b/Source/WebCore/css/StyleSheet.h >@@ -30,7 +30,6 @@ class CSSImportRule; > class MediaList; > class Node; > class StyleSheet; >-class URL; > > class StyleSheet : public RefCounted<StyleSheet> { > public: >diff --git a/Source/WebCore/css/StyleSheetContents.h b/Source/WebCore/css/StyleSheetContents.h >index 2c74afa3655dbd31bd5ae5c477b5cdf131e24ae1..553716203ea8a5f3f50d2e1cbb2a4c72c868da2b 100644 >--- a/Source/WebCore/css/StyleSheetContents.h >+++ b/Source/WebCore/css/StyleSheetContents.h >@@ -22,10 +22,10 @@ > > #include "CSSParserContext.h" > #include "CachePolicy.h" >-#include "URL.h" > #include <wtf/Function.h> > #include <wtf/HashMap.h> > #include <wtf/RefCounted.h> >+#include <wtf/URL.h> > #include <wtf/Vector.h> > #include <wtf/WeakPtr.h> > #include <wtf/text/AtomicStringHash.h> >diff --git a/Source/WebCore/css/parser/CSSParserContext.h b/Source/WebCore/css/parser/CSSParserContext.h >index 1089d22d41b18ae815026e40e0e02bfbaac82d07..758b6eeb3afa80a86563cc4ef42f93a249c70cff 100644 >--- a/Source/WebCore/css/parser/CSSParserContext.h >+++ b/Source/WebCore/css/parser/CSSParserContext.h >@@ -27,9 +27,9 @@ > > #include "CSSParserMode.h" > #include "TextEncoding.h" >-#include "URL.h" >-#include "URLHash.h" > #include <wtf/HashFunctions.h> >+#include <wtf/URL.h> >+#include <wtf/URLHash.h> > #include <wtf/text/StringHash.h> > > namespace WebCore { >@@ -87,7 +87,7 @@ WEBCORE_EXPORT const CSSParserContext& strictCSSParserContext(); > struct CSSParserContextHash { > static unsigned hash(const CSSParserContext& key) > { >- auto hash = URLHash::hash(key.baseURL); >+ auto hash = WTF::URLHash::hash(key.baseURL); > if (!key.charset.isEmpty()) > hash ^= StringHash::hash(key.charset); > unsigned bits = key.isHTMLDocument << 0 >@@ -121,7 +121,7 @@ struct CSSParserContextHash { > > namespace WTF { > template<> struct HashTraits<WebCore::CSSParserContext> : GenericHashTraits<WebCore::CSSParserContext> { >- static void constructDeletedValue(WebCore::CSSParserContext& slot) { new (NotNull, &slot.baseURL) WebCore::URL(WTF::HashTableDeletedValue); } >+ static void constructDeletedValue(WebCore::CSSParserContext& slot) { new (NotNull, &slot.baseURL) URL(WTF::HashTableDeletedValue); } > static bool isDeletedValue(const WebCore::CSSParserContext& value) { return value.baseURL.isHashTableDeletedValue(); } > static WebCore::CSSParserContext emptyValue() { return WebCore::CSSParserContext(WebCore::HTMLStandardMode); } > }; >diff --git a/Source/WebCore/css/parser/CSSParserIdioms.h b/Source/WebCore/css/parser/CSSParserIdioms.h >index 871d5991b576bb30f46587811873daf6fa58bca4..2575c0df2b87c5905f7dbc2ce6fcc354fb7a97bd 100644 >--- a/Source/WebCore/css/parser/CSSParserIdioms.h >+++ b/Source/WebCore/css/parser/CSSParserIdioms.h >@@ -35,8 +35,6 @@ > #include <wtf/ASCIICType.h> > > namespace WebCore { >- >-class URL; > > // Space characters as defined by the CSS specification. > // http://www.w3.org/TR/css3-syntax/#whitespace >diff --git a/Source/WebCore/dom/DataTransfer.cpp b/Source/WebCore/dom/DataTransfer.cpp >index 6d39da455d42f3382dc7425dad8007bfd6707b9e..60e3b7ce69bf9808465117c8a6438639b1745134 100644 >--- a/Source/WebCore/dom/DataTransfer.cpp >+++ b/Source/WebCore/dom/DataTransfer.cpp >@@ -43,10 +43,10 @@ > #include "RuntimeEnabledFeatures.h" > #include "Settings.h" > #include "StaticPasteboard.h" >-#include "URLParser.h" > #include "WebContentReader.h" > #include "WebCorePasteboardFileReader.h" > #include "markup.h" >+#include <wtf/URLParser.h> > #include <wtf/unicode/CharacterNames.h> > > namespace WebCore { >@@ -255,7 +255,7 @@ void DataTransfer::setDataFromItemList(const String& type, const String& data) > if (type == "text/html") > sanitizedData = sanitizeMarkup(data); > else if (type == "text/uri-list") { >- auto url = URLParser(data).result(); >+ auto url = URL({ }, data); > if (url.isValid()) > sanitizedData = url.string(); > } else if (type == "text/plain") >diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp >index ab3870e8d3496de59ab72fb0be86afbe68f2b4d5..16614409a38153acedebc57128b6e5e1186eb8f2 100644 >--- a/Source/WebCore/dom/Document.cpp >+++ b/Source/WebCore/dom/Document.cpp >@@ -3167,7 +3167,7 @@ void Document::logExceptionToConsole(const String& errorMessage, const String& s > > void Document::setURL(const URL& url) > { >- const URL& newURL = url.isEmpty() ? blankURL() : url; >+ const URL& newURL = url.isEmpty() ? WTF::blankURL() : url; > if (newURL == m_url) > return; > >@@ -3457,7 +3457,7 @@ void Document::processHttpEquiv(const String& equiv, const String& content, bool > completedURL = m_url; > else > completedURL = completeURL(urlString); >- if (!protocolIsJavaScript(completedURL)) >+ if (!WTF::protocolIsJavaScript(completedURL)) > frame->navigationScheduler().scheduleRedirect(*this, delay, completedURL); > else { > String message = "Refused to refresh " + m_url.stringCenterEllipsizedToLength() + " to a javascript: URL"; >@@ -5006,7 +5006,7 @@ URL Document::completeURL(const String& url, const URL& baseURLOverride) const > // See also [CSS]StyleSheet::completeURL(const String&) > if (url.isNull()) > return URL(); >- const URL& baseURL = ((baseURLOverride.isEmpty() || baseURLOverride == blankURL()) && parentDocument()) ? parentDocument()->baseURL() : baseURLOverride; >+ const URL& baseURL = ((baseURLOverride.isEmpty() || baseURLOverride == WTF::blankURL()) && parentDocument()) ? parentDocument()->baseURL() : baseURLOverride; > if (!m_decoder) > return URL(baseURL, url); > return URL(baseURL, url, m_decoder->encodingForURLParsing()); >@@ -7288,9 +7288,9 @@ Document& Document::ensureTemplateDocument() > return const_cast<Document&>(*document); > > if (isHTMLDocument()) >- m_templateDocument = HTMLDocument::create(nullptr, blankURL()); >+ m_templateDocument = HTMLDocument::create(nullptr, WTF::blankURL()); > else >- m_templateDocument = Document::create(nullptr, blankURL()); >+ m_templateDocument = Document::create(nullptr, WTF::blankURL()); > > m_templateDocument->setContextDocument(contextDocument()); > m_templateDocument->setTemplateDocumentHost(this); // balanced in dtor. >diff --git a/Source/WebCore/dom/Document.h b/Source/WebCore/dom/Document.h >index 298ba9e31fe5f1496d0ca9546cff3d2f5555a2f5..4d06e60700ed75cda560e3a5513d55105671c8d5 100644 >--- a/Source/WebCore/dom/Document.h >+++ b/Source/WebCore/dom/Document.h >@@ -681,7 +681,7 @@ public: > > const URL& url() const final { return m_url; } > void setURL(const URL&); >- const URL& urlForBindings() const { return m_url.isEmpty() ? blankURL() : m_url; } >+ const URL& urlForBindings() const { return m_url.isEmpty() ? WTF::blankURL() : m_url; } > > // To understand how these concepts relate to one another, please see the > // comments surrounding their declaration. >diff --git a/Source/WebCore/dom/Element.cpp b/Source/WebCore/dom/Element.cpp >index 88207e54f80d75b146881a42df18c985699924e3..5a15a69d6cd077400ed72f6b67b7ba4e15b6dd98 100644 >--- a/Source/WebCore/dom/Element.cpp >+++ b/Source/WebCore/dom/Element.cpp >@@ -1720,7 +1720,7 @@ bool Element::isEventHandlerAttribute(const Attribute& attribute) const > > bool Element::isJavaScriptURLAttribute(const Attribute& attribute) const > { >- return isURLAttribute(attribute) && protocolIsJavaScript(stripLeadingAndTrailingHTMLSpaces(attribute.value())); >+ return isURLAttribute(attribute) && WTF::protocolIsJavaScript(stripLeadingAndTrailingHTMLSpaces(attribute.value())); > } > > void Element::stripScriptingAttributes(Vector<Attribute>& attributeVector) const >diff --git a/Source/WebCore/dom/InlineStyleSheetOwner.cpp b/Source/WebCore/dom/InlineStyleSheetOwner.cpp >index ca531f0364c508fe9b580ae6c0702d838c1a9a6f..922233d6990eae9970a73b665cf52798b655ad0b 100644 >--- a/Source/WebCore/dom/InlineStyleSheetOwner.cpp >+++ b/Source/WebCore/dom/InlineStyleSheetOwner.cpp >@@ -50,7 +50,7 @@ static CSSParserContext parserContextForElement(const Element& element) > { > auto* shadowRoot = element.containingShadowRoot(); > // User agent shadow trees can't contain document-relative URLs. Use blank URL as base allowing cross-document sharing. >- auto& baseURL = shadowRoot && shadowRoot->mode() == ShadowRootMode::UserAgent ? blankURL() : element.document().baseURL(); >+ auto& baseURL = shadowRoot && shadowRoot->mode() == ShadowRootMode::UserAgent ? WTF::blankURL() : element.document().baseURL(); > > CSSParserContext result = CSSParserContext { element.document(), baseURL, element.document().characterSetWithUTF8Fallback() }; > if (shadowRoot && shadowRoot->mode() == ShadowRootMode::UserAgent) >diff --git a/Source/WebCore/dom/Node.cpp b/Source/WebCore/dom/Node.cpp >index de0569d5af50d9648cc2083e081f800c2893da6b..07c2f65d0eb44d57d0b29124f2592025c280e7d8 100644 >--- a/Source/WebCore/dom/Node.cpp >+++ b/Source/WebCore/dom/Node.cpp >@@ -1350,7 +1350,7 @@ Document* Node::ownerDocument() const > const URL& Node::baseURI() const > { > auto& url = document().baseURL(); >- return url.isNull() ? blankURL() : url; >+ return url.isNull() ? WTF::blankURL() : url; > } > > bool Node::isEqualNode(Node* other) const >diff --git a/Source/WebCore/dom/Node.h b/Source/WebCore/dom/Node.h >index 52da6d11a010ff43a369555af7799461bca2a58b..12439d78d35c4c2821a7254d032145035fb47f9f 100644 >--- a/Source/WebCore/dom/Node.h >+++ b/Source/WebCore/dom/Node.h >@@ -31,11 +31,11 @@ > #include "RenderStyleConstants.h" > #include "StyleValidity.h" > #include "TreeScope.h" >-#include "URLHash.h" > #include <wtf/Forward.h> > #include <wtf/IsoMalloc.h> > #include <wtf/ListHashSet.h> > #include <wtf/MainThread.h> >+#include <wtf/URLHash.h> > > // This needs to be here because Document.h also depends on it. > #define DUMP_NODE_STATISTICS 0 >diff --git a/Source/WebCore/dom/ScriptElement.h b/Source/WebCore/dom/ScriptElement.h >index a61dad45e9e444fa322e59822b4e8e6b1e8f6db7..62454e793cb1334f64ccf3be2095d33ca9a72c8a 100644 >--- a/Source/WebCore/dom/ScriptElement.h >+++ b/Source/WebCore/dom/ScriptElement.h >@@ -35,7 +35,6 @@ class Element; > class LoadableModuleScript; > class PendingScript; > class ScriptSourceCode; >-class URL; > > class ScriptElement { > public: >diff --git a/Source/WebCore/dom/ScriptExecutionContext.h b/Source/WebCore/dom/ScriptExecutionContext.h >index 7859045823b7c63050ae01f1a645bad30b2dc79b..f5fc0ba1db6270088d47f7547443ca02ebb51eb0 100644 >--- a/Source/WebCore/dom/ScriptExecutionContext.h >+++ b/Source/WebCore/dom/ScriptExecutionContext.h >@@ -68,7 +68,6 @@ class RejectedPromiseTracker; > class ResourceRequest; > class SecurityOrigin; > class SocketProvider; >-class URL; > > #if ENABLE(SERVICE_WORKER) > class ServiceWorker; >diff --git a/Source/WebCore/dom/SecurityContext.h b/Source/WebCore/dom/SecurityContext.h >index 9f215fba1b53f25615cc0da3cc7342050125aca5..c0cc8e21109d63bf4a32e9b5a7c4f195a48070a1 100644 >--- a/Source/WebCore/dom/SecurityContext.h >+++ b/Source/WebCore/dom/SecurityContext.h >@@ -37,7 +37,6 @@ namespace WebCore { > class SecurityOrigin; > class SecurityOriginPolicy; > class ContentSecurityPolicy; >-class URL; > > enum SandboxFlag { > // See http://www.whatwg.org/specs/web-apps/current-work/#attr-iframe-sandbox for a list of the sandbox flags. >diff --git a/Source/WebCore/editing/Editor.cpp b/Source/WebCore/editing/Editor.cpp >index aa61b1eb6d0ab8dfc66fed187a2a2dddb5ae3fe4..adccf94e888bc394ec1c8db94290d139c42ed86b 100644 >--- a/Source/WebCore/editing/Editor.cpp >+++ b/Source/WebCore/editing/Editor.cpp >@@ -1528,9 +1528,9 @@ void Editor::copyURL(const URL& url, const String& title, Pasteboard& pasteboard > pasteboard.write(pasteboardURL); > } > >-PasteboardWriterData::URL Editor::pasteboardWriterURL(const URL& url, const String& title) >+PasteboardWriterData::URLData Editor::pasteboardWriterURL(const URL& url, const String& title) > { >- PasteboardWriterData::URL result; >+ PasteboardWriterData::URLData result; > > result.url = url; > result.title = title; >diff --git a/Source/WebCore/editing/Editor.h b/Source/WebCore/editing/Editor.h >index 11c11943d0b1c20be584a58adb0206e0b83f94a6..87b684f903a33fddb66304cf13486f9c84045bd4 100644 >--- a/Source/WebCore/editing/Editor.h >+++ b/Source/WebCore/editing/Editor.h >@@ -176,7 +176,7 @@ public: > > WEBCORE_EXPORT void copyURL(const URL&, const String& title); > void copyURL(const URL&, const String& title, Pasteboard&); >- PasteboardWriterData::URL pasteboardWriterURL(const URL&, const String& title); >+ PasteboardWriterData::URLData pasteboardWriterURL(const URL&, const String& title); > #if !PLATFORM(IOS_FAMILY) > WEBCORE_EXPORT void copyImage(const HitTestResult&); > #endif >diff --git a/Source/WebCore/editing/MarkupAccumulator.cpp b/Source/WebCore/editing/MarkupAccumulator.cpp >index 62364dface8b607bc5677c948f5525dc22a66196..23f6e5d1ec4b85fef0e86104ec89601eb6d0fdf7 100644 >--- a/Source/WebCore/editing/MarkupAccumulator.cpp >+++ b/Source/WebCore/editing/MarkupAccumulator.cpp >@@ -35,7 +35,7 @@ > #include "HTMLElement.h" > #include "HTMLNames.h" > #include "HTMLTemplateElement.h" >-#include "URL.h" >+#include <wtf/URL.h> > #include "ProcessingInstruction.h" > #include "XLinkNames.h" > #include "XMLNSNames.h" >@@ -295,7 +295,7 @@ void MarkupAccumulator::appendQuotedURLAttributeValue(StringBuilder& result, con > const String resolvedURLString = resolveURLIfNeeded(element, attribute.value()); > UChar quoteChar = '"'; > String strippedURLString = resolvedURLString.stripWhiteSpace(); >- if (protocolIsJavaScript(strippedURLString)) { >+ if (WTF::protocolIsJavaScript(strippedURLString)) { > // minimal escaping for javascript urls > if (strippedURLString.contains('"')) { > if (strippedURLString.contains('\'')) >diff --git a/Source/WebCore/editing/cocoa/DataDetection.h b/Source/WebCore/editing/cocoa/DataDetection.h >index 3a34a09a5fbcd923aae3c8db88f5a668a76c9140..1d112dc6983980bfd6f6b97df7800fbed6338175 100644 >--- a/Source/WebCore/editing/cocoa/DataDetection.h >+++ b/Source/WebCore/editing/cocoa/DataDetection.h >@@ -42,7 +42,6 @@ class Element; > class FloatRect; > class HitTestResult; > class Range; >-class URL; > > enum DataDetectorTypes { > DataDetectorTypeNone = 0, >diff --git a/Source/WebCore/editing/cocoa/EditorCocoa.mm b/Source/WebCore/editing/cocoa/EditorCocoa.mm >index abe3db3f3a96ed14b640c9af44933f2d2311b3a8..e3129ab2fa5157450c8daddcd55dd761514175d5 100644 >--- a/Source/WebCore/editing/cocoa/EditorCocoa.mm >+++ b/Source/WebCore/editing/cocoa/EditorCocoa.mm >@@ -52,11 +52,11 @@ > #import "Settings.h" > #import "Text.h" > #import "WebContentReader.h" >-#import "WebCoreNSURLExtras.h" > #import "markup.h" > #import <pal/spi/cocoa/NSAttributedStringSPI.h> > #import <pal/spi/cocoa/NSKeyedArchiverSPI.h> > #import <wtf/BlockObjCExceptions.h> >+#import <wtf/cocoa/NSURLExtras.h> > > namespace WebCore { > >@@ -184,7 +184,7 @@ void Editor::replaceSelectionWithAttributedString(NSAttributedString *attributed > > String Editor::userVisibleString(const URL& url) > { >- return WebCore::userVisibleString(url); >+ return WTF::userVisibleString(url); > } > > RefPtr<SharedBuffer> Editor::dataInRTFDFormat(NSAttributedString *string) >diff --git a/Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm b/Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm >index abfad8e738785ac195c85aeabd5a961931a5e698..41ee05ca697a03780f4e94926812fc8bef168a7a 100644 >--- a/Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm >+++ b/Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm >@@ -58,7 +58,6 @@ > #import "Settings.h" > #import "SocketProvider.h" > #import "TypedElementDescendantIterator.h" >-#import "URLParser.h" > #import "UTIUtilities.h" > #import "WebArchiveResourceFromNSAttributedString.h" > #import "WebArchiveResourceWebResourceHandler.h" >@@ -66,6 +65,7 @@ > #import "markup.h" > #import <pal/spi/cocoa/NSAttributedStringSPI.h> > #import <wtf/SoftLinking.h> >+#import <wtf/URLParser.h> > > #if PLATFORM(MAC) > #include "LocalDefaultSystemAppearance.h" >@@ -313,7 +313,7 @@ static void replaceRichContentWithAttachments(Frame& frame, DocumentFragment& fr > > auto name = image.attributeWithoutSynchronization(HTMLNames::altAttr); > if (name.isEmpty()) >- name = URLParser { resourceURLString }.result().lastPathComponent(); >+ name = URL({ }, resourceURLString).lastPathComponent(); > if (name.isEmpty()) > name = AtomicString("media"); > >@@ -331,7 +331,7 @@ static void replaceRichContentWithAttachments(Frame& frame, DocumentFragment& fr > if (resource == urlToResourceMap.end()) > continue; > >- auto name = URLParser { resourceURLString }.result().lastPathComponent(); >+ auto name = URL({ }, resourceURLString).lastPathComponent(); > if (name.isEmpty()) > name = AtomicString("file"); > >@@ -543,7 +543,7 @@ bool WebContentReader::readWebArchive(SharedBuffer& buffer) > String sanitizedMarkup = sanitizeMarkupWithArchive(frame, *frame.document(), *result, msoListQuirksForMarkup(), [&] (const String& type) { > return frame.loader().client().canShowMIMETypeAsHTML(type); > }); >- fragment = createFragmentFromMarkup(*frame.document(), sanitizedMarkup, blankURL(), DisallowScriptingAndPluginContent); >+ fragment = createFragmentFromMarkup(*frame.document(), sanitizedMarkup, WTF::blankURL(), DisallowScriptingAndPluginContent); > > if (!fragment) > return false; >diff --git a/Source/WebCore/editing/mac/EditorMac.mm b/Source/WebCore/editing/mac/EditorMac.mm >index f1cd53c9e338d1aaaf530a908118ffe088b2824f..4622f866bd2061185f32955ee7e79be1d692f25f 100644 >--- a/Source/WebCore/editing/mac/EditorMac.mm >+++ b/Source/WebCore/editing/mac/EditorMac.mm >@@ -52,11 +52,11 @@ > #import "RuntimeEnabledFeatures.h" > #import "StyleProperties.h" > #import "WebContentReader.h" >-#import "WebCoreNSURLExtras.h" > #import "WebNSAttributedStringExtras.h" > #import "markup.h" > #import <AppKit/AppKit.h> > #import <pal/system/Sound.h> >+#import <wtf/cocoa/NSURLExtras.h> > > namespace WebCore { > >@@ -253,7 +253,7 @@ String Editor::plainTextFromPasteboard(const PasteboardPlainText& text) > // FIXME: It's not clear this is 100% correct since we know -[NSURL URLWithString:] does not handle > // all the same cases we handle well in the URL code for creating an NSURL. > if (text.isURL) >- string = userVisibleString([NSURL URLWithString:string]); >+ string = WTF::userVisibleString([NSURL URLWithString:string]); > > // FIXME: WTF should offer a non-Mac-specific way to convert string to precomposed form so we can do it for all platforms. > return [(NSString *)string precomposedStringWithCanonicalMapping]; >@@ -272,7 +272,7 @@ void Editor::writeImageToPasteboard(Pasteboard& pasteboard, Element& imageElemen > pasteboardImage.dataInWebArchiveFormat = imageInWebArchiveFormat(imageElement); > pasteboardImage.url.url = url; > pasteboardImage.url.title = title; >- pasteboardImage.url.userVisibleForm = userVisibleString(pasteboardImage.url.url); >+ pasteboardImage.url.userVisibleForm = WTF::userVisibleString(pasteboardImage.url.url); > pasteboardImage.resourceData = cachedImage->resourceBuffer(); > pasteboardImage.resourceMIMEType = cachedImage->response().mimeType(); > >diff --git a/Source/WebCore/editing/markup.cpp b/Source/WebCore/editing/markup.cpp >index 63bf4584faa92acfbd915d3d2e1468cd44e9cec3..124ea5b1dc440dcedfd8449a6c3308f364bcbad3 100644 >--- a/Source/WebCore/editing/markup.cpp >+++ b/Source/WebCore/editing/markup.cpp >@@ -74,11 +74,11 @@ > #include "StyleProperties.h" > #include "TextIterator.h" > #include "TypedElementDescendantIterator.h" >-#include "URL.h" >-#include "URLParser.h" > #include "VisibleSelection.h" > #include "VisibleUnits.h" > #include <wtf/StdLibExtras.h> >+#include <wtf/URL.h> >+#include <wtf/URLParser.h> > #include <wtf/text/StringBuilder.h> > > namespace WebCore { >@@ -162,7 +162,7 @@ void removeSubresourceURLAttributes(Ref<DocumentFragment>&& fragment, WTF::Funct > for (const Attribute& attribute : element.attributesIterator()) { > // FIXME: This won't work for srcset. > if (element.attributeContainsURL(attribute) && !attribute.value().isEmpty()) { >- URL url = URLParser { attribute.value() }.result(); >+ URL url({ }, attribute.value()); > if (shouldRemoveURL(url)) > attributesToRemove.append({ element, attribute.name() }); > } >@@ -1029,7 +1029,7 @@ Ref<DocumentFragment> createFragmentFromMarkup(Document& document, const String& > > fragment->parseHTML(markup, fakeBody.ptr(), parserContentPolicy); > restoreAttachmentElementsInFragment(fragment); >- if (!baseURL.isEmpty() && baseURL != blankURL() && baseURL != document.baseURL()) >+ if (!baseURL.isEmpty() && baseURL != WTF::blankURL() && baseURL != document.baseURL()) > completeURLs(fragment.ptr(), baseURL); > > return fragment; >diff --git a/Source/WebCore/editing/markup.h b/Source/WebCore/editing/markup.h >index 0b8314b8154d2085ea1284c62736b9505229f82d..22486ce2c8ad5ecd574b2814d0fbccfd24278781 100644 >--- a/Source/WebCore/editing/markup.h >+++ b/Source/WebCore/editing/markup.h >@@ -41,7 +41,6 @@ class DocumentFragment; > class Element; > class Frame; > class HTMLElement; >-class URL; > class Node; > class Page; > class QualifiedName; >diff --git a/Source/WebCore/fileapi/AsyncFileStream.cpp b/Source/WebCore/fileapi/AsyncFileStream.cpp >index 63b1e0e57411d0633c4198f4ae09353a0355127e..73a365228799c16b9a988d9a1189e0cf9380fe9d 100644 >--- a/Source/WebCore/fileapi/AsyncFileStream.cpp >+++ b/Source/WebCore/fileapi/AsyncFileStream.cpp >@@ -34,7 +34,6 @@ > > #include "FileStream.h" > #include "FileStreamClient.h" >-#include "URL.h" > #include <mutex> > #include <wtf/AutodrainedPool.h> > #include <wtf/Function.h> >@@ -42,6 +41,7 @@ > #include <wtf/MessageQueue.h> > #include <wtf/NeverDestroyed.h> > #include <wtf/Threading.h> >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/fileapi/AsyncFileStream.h b/Source/WebCore/fileapi/AsyncFileStream.h >index 4f0e7b277717a19cc270df2e963abeef93f3f353..62caffe2d98ad1d5d10f4ed68817da90494ea178 100644 >--- a/Source/WebCore/fileapi/AsyncFileStream.h >+++ b/Source/WebCore/fileapi/AsyncFileStream.h >@@ -38,7 +38,6 @@ namespace WebCore { > > class FileStreamClient; > class FileStream; >-class URL; > > class WEBCORE_EXPORT AsyncFileStream { > public: >diff --git a/Source/WebCore/fileapi/Blob.h b/Source/WebCore/fileapi/Blob.h >index 20139c4c12a1493e0538dc9ab95163b1498cf962..90d4656997301258ee86828e9ab6078ac3f89a20 100644 >--- a/Source/WebCore/fileapi/Blob.h >+++ b/Source/WebCore/fileapi/Blob.h >@@ -32,7 +32,7 @@ > > #include "BlobPropertyBag.h" > #include "ScriptWrappable.h" >-#include "URL.h" >+#include <wtf/URL.h> > #include "URLRegistry.h" > #include <wtf/Variant.h> > >diff --git a/Source/WebCore/fileapi/BlobURL.cpp b/Source/WebCore/fileapi/BlobURL.cpp >index c6dfee6550153e2bf488a27cc5ae8e20e98e0461..146c0db049d71548d0fc2d889e46bb6f55649ae7 100644 >--- a/Source/WebCore/fileapi/BlobURL.cpp >+++ b/Source/WebCore/fileapi/BlobURL.cpp >@@ -32,7 +32,7 @@ > > #include "BlobURL.h" > >-#include "URL.h" >+#include <wtf/URL.h> > #include "SecurityOrigin.h" > #include <wtf/UUID.h> > #include <wtf/text/WTFString.h> >diff --git a/Source/WebCore/fileapi/BlobURL.h b/Source/WebCore/fileapi/BlobURL.h >index 359eaaf7f2a2667b8b22f7a35032a1571d6720c4..3d0ae11c1039e3484e0edf7009777bf2ebf9bda8 100644 >--- a/Source/WebCore/fileapi/BlobURL.h >+++ b/Source/WebCore/fileapi/BlobURL.h >@@ -30,7 +30,7 @@ > > #pragma once > >-#include "URL.h" >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/fileapi/File.h b/Source/WebCore/fileapi/File.h >index 575f0e76d09a9d3e57f258aecbef31f360a48df0..da2e8bca352ca3fc7ec7cb4562d79bbb728bf05f 100644 >--- a/Source/WebCore/fileapi/File.h >+++ b/Source/WebCore/fileapi/File.h >@@ -33,8 +33,6 @@ > > namespace WebCore { > >-class URL; >- > class File final : public Blob { > public: > struct PropertyBag : BlobPropertyBag { >diff --git a/Source/WebCore/fileapi/FileReaderLoader.h b/Source/WebCore/fileapi/FileReaderLoader.h >index f3dc6c478c98004a7b1340c329ed68808b7218f0..1f7778e889e393d7fb969443ce8ebe21274d4a03 100644 >--- a/Source/WebCore/fileapi/FileReaderLoader.h >+++ b/Source/WebCore/fileapi/FileReaderLoader.h >@@ -32,7 +32,7 @@ > > #include "BlobResourceHandle.h" > #include "FileError.h" >-#include "URL.h" >+#include <wtf/URL.h> > #include "TextEncoding.h" > #include "ThreadableLoaderClient.h" > #include <wtf/Forward.h> >diff --git a/Source/WebCore/fileapi/ThreadableBlobRegistry.h b/Source/WebCore/fileapi/ThreadableBlobRegistry.h >index 4246d7eea0b0e73b509fbc80d241e1cff96209c2..a9c79fe2292f895b31c60f7567ffd0493fedc832 100644 >--- a/Source/WebCore/fileapi/ThreadableBlobRegistry.h >+++ b/Source/WebCore/fileapi/ThreadableBlobRegistry.h >@@ -36,7 +36,6 @@ > namespace WebCore { > > class BlobPart; >-class URL; > class SecurityOrigin; > > class ThreadableBlobRegistry { >diff --git a/Source/WebCore/history/CachedFrame.h b/Source/WebCore/history/CachedFrame.h >index bf99ca468645659b4f81355148f2a992fed9b194..dbdbaf31f75570593d723ec8b2bfb19e6c8a2156 100644 >--- a/Source/WebCore/history/CachedFrame.h >+++ b/Source/WebCore/history/CachedFrame.h >@@ -26,7 +26,7 @@ > #pragma once > > #include "DOMWindow.h" >-#include "URL.h" >+#include <wtf/URL.h> > #include "ScriptCachedFrameData.h" > #include <wtf/RefPtr.h> > >diff --git a/Source/WebCore/history/HistoryItem.h b/Source/WebCore/history/HistoryItem.h >index 6dcc64716f02d94bdc2b17dd9d1f18077ade11ad..8af98e4c982f39b0a66bd6f615257e2c00167407 100644 >--- a/Source/WebCore/history/HistoryItem.h >+++ b/Source/WebCore/history/HistoryItem.h >@@ -54,7 +54,6 @@ class FormData; > class HistoryItem; > class Image; > class ResourceRequest; >-class URL; > enum class PruningReason; > > WEBCORE_EXPORT extern void (*notifyHistoryItemChanged)(HistoryItem&); >diff --git a/Source/WebCore/html/DOMURL.cpp b/Source/WebCore/html/DOMURL.cpp >index a77bcd70723f3cf9ca11682e446edfe87d8138f8..0a08b5946865732f28da30fb7f63ca4d314ea917 100644 >--- a/Source/WebCore/html/DOMURL.cpp >+++ b/Source/WebCore/html/DOMURL.cpp >@@ -63,7 +63,7 @@ ExceptionOr<Ref<DOMURL>> DOMURL::create(const String& url, const DOMURL& base) > > ExceptionOr<Ref<DOMURL>> DOMURL::create(const String& url) > { >- URL baseURL { blankURL() }; >+ URL baseURL { WTF::blankURL() }; > URL completeURL { baseURL, url }; > if (!completeURL.isValid()) > return Exception { TypeError }; >diff --git a/Source/WebCore/html/DOMURL.h b/Source/WebCore/html/DOMURL.h >index 59025c2fb96f0299ad917e617b2911c31ab91d34..d313d7a444d8ea5534f003f4450fdda0d463520e 100644 >--- a/Source/WebCore/html/DOMURL.h >+++ b/Source/WebCore/html/DOMURL.h >@@ -27,7 +27,7 @@ > #pragma once > > #include "ExceptionOr.h" >-#include "URL.h" >+#include <wtf/URL.h> > #include "URLUtils.h" > > namespace WebCore { >diff --git a/Source/WebCore/html/HTMLAttachmentElement.cpp b/Source/WebCore/html/HTMLAttachmentElement.cpp >index eeb69277dcb1c19c8ebdfcab5b8fb67b042a4145..8ced01221a5e5f8aaafb313bc7b39d2fbcd7d900 100644 >--- a/Source/WebCore/html/HTMLAttachmentElement.cpp >+++ b/Source/WebCore/html/HTMLAttachmentElement.cpp >@@ -38,10 +38,10 @@ > #include "MIMETypeRegistry.h" > #include "RenderAttachment.h" > #include "SharedBuffer.h" >-#include "URLParser.h" > #include <pal/FileSizeFormatter.h> > #include <wtf/IsoMallocInlines.h> > #include <wtf/UUID.h> >+#include <wtf/URLParser.h> > > #if PLATFORM(COCOA) > #include "UTIUtilities.h" >@@ -88,7 +88,7 @@ const String& HTMLAttachmentElement::getAttachmentIdentifier(HTMLImageElement& i > > URL HTMLAttachmentElement::archiveResourceURL(const String& identifier) > { >- auto resourceURL = URLParser("applewebdata://attachment/"_s).result(); >+ auto resourceURL = URL({ }, "applewebdata://attachment/"_s); > resourceURL.setPath(identifier); > return resourceURL; > } >diff --git a/Source/WebCore/html/HTMLFrameElementBase.cpp b/Source/WebCore/html/HTMLFrameElementBase.cpp >index 9b99a34730972d4dd799c081a0f98f6377ab5ad0..3048b490fa53f3fd4151e0210436c64fa9471479 100644 >--- a/Source/WebCore/html/HTMLFrameElementBase.cpp >+++ b/Source/WebCore/html/HTMLFrameElementBase.cpp >@@ -37,8 +37,8 @@ > #include "ScriptController.h" > #include "Settings.h" > #include "SubframeLoader.h" >-#include "URL.h" > #include <wtf/IsoMallocInlines.h> >+#include <wtf/URL.h> > > namespace WebCore { > >@@ -71,7 +71,7 @@ bool HTMLFrameElementBase::isURLAllowed(const URL& completeURL) const > if (completeURL.isEmpty()) > return true; > >- if (protocolIsJavaScript(completeURL)) { >+ if (WTF::protocolIsJavaScript(completeURL)) { > RefPtr<Document> contentDoc = this->contentDocument(); > if (contentDoc && !ScriptController::canAccessFromCurrentOrigin(contentDoc->frame())) > return false; >@@ -90,7 +90,7 @@ void HTMLFrameElementBase::openURL(LockHistory lockHistory, LockBackForwardList > return; > > if (m_URL.isEmpty()) >- m_URL = blankURL().string(); >+ m_URL = WTF::blankURL().string(); > > RefPtr<Frame> parentFrame = document().frame(); > if (!parentFrame) >@@ -179,7 +179,7 @@ void HTMLFrameElementBase::setLocation(const String& str) > > void HTMLFrameElementBase::setLocation(JSC::ExecState& state, const String& newLocation) > { >- if (protocolIsJavaScript(stripLeadingAndTrailingHTMLSpaces(newLocation))) { >+ if (WTF::protocolIsJavaScript(stripLeadingAndTrailingHTMLSpaces(newLocation))) { > if (!BindingSecurity::shouldAllowAccessToNode(state, contentDocument())) > return; > } >diff --git a/Source/WebCore/html/HTMLInputElement.h b/Source/WebCore/html/HTMLInputElement.h >index 7337c22ad009ca763712df04288a8f2fa6b4e7b7..ac50d36e2226b412caf584ba1050d9a99b07c7e6 100644 >--- a/Source/WebCore/html/HTMLInputElement.h >+++ b/Source/WebCore/html/HTMLInputElement.h >@@ -44,7 +44,6 @@ class Icon; > class InputType; > class ListAttributeTargetObserver; > class RadioButtonGroups; >-class URL; > > struct DateTimeChooserParameters; > >diff --git a/Source/WebCore/html/HTMLLinkElement.h b/Source/WebCore/html/HTMLLinkElement.h >index 510f4cfb636d9da11e258f9ee3a42fed6efd36cd..6828f9343b5724095db6021742687654070cdf89 100644 >--- a/Source/WebCore/html/HTMLLinkElement.h >+++ b/Source/WebCore/html/HTMLLinkElement.h >@@ -36,7 +36,6 @@ namespace WebCore { > > class DOMTokenList; > class HTMLLinkElement; >-class URL; > struct MediaQueryParserContext; > > template<typename T> class EventSender; >diff --git a/Source/WebCore/html/HTMLMediaElement.cpp b/Source/WebCore/html/HTMLMediaElement.cpp >index f6c24b3a196ec1324a4b2b9ee76b1e199e0028b4..0d527f6e9f228be1b3881b50ba5f1f0f0aeb0094 100644 >--- a/Source/WebCore/html/HTMLMediaElement.cpp >+++ b/Source/WebCore/html/HTMLMediaElement.cpp >@@ -170,8 +170,8 @@ > > namespace WTF { > template <> >-struct LogArgument<WebCore::URL> { >- static String toString(const WebCore::URL& url) >+struct LogArgument<URL> { >+ static String toString(const URL& url) > { > #if !LOG_DISABLED > static const unsigned maximumURLLengthForLogging = 512; >diff --git a/Source/WebCore/html/HTMLPlugInImageElement.cpp b/Source/WebCore/html/HTMLPlugInImageElement.cpp >index 3213c44adbf28f270b5260dca13055de8aa43d9b..9e5c27777d693e4f64bef1b731258395c4ad2304 100644 >--- a/Source/WebCore/html/HTMLPlugInImageElement.cpp >+++ b/Source/WebCore/html/HTMLPlugInImageElement.cpp >@@ -158,7 +158,7 @@ bool HTMLPlugInImageElement::isImageType() > bool HTMLPlugInImageElement::allowedToLoadFrameURL(const String& url) > { > URL completeURL = document().completeURL(url); >- if (contentFrame() && protocolIsJavaScript(completeURL) && !document().securityOrigin().canAccess(contentDocument()->securityOrigin())) >+ if (contentFrame() && WTF::protocolIsJavaScript(completeURL) && !document().securityOrigin().canAccess(contentDocument()->securityOrigin())) > return false; > return document().frame()->isURLAllowed(completeURL); > } >diff --git a/Source/WebCore/html/ImageBitmap.h b/Source/WebCore/html/ImageBitmap.h >index 27a489d4f657b6e69dc4e99f9d4dc9b69d7bcc77..1200b8781646f61a6f70c46b99bcc8efcf65ad1b 100644 >--- a/Source/WebCore/html/ImageBitmap.h >+++ b/Source/WebCore/html/ImageBitmap.h >@@ -44,7 +44,6 @@ class IntRect; > class IntSize; > class PendingImageBitmap; > class ScriptExecutionContext; >-class URL; > struct ImageBitmapOptions; > > class ImageBitmap : public ScriptWrappable, public RefCounted<ImageBitmap> { >diff --git a/Source/WebCore/html/MediaFragmentURIParser.h b/Source/WebCore/html/MediaFragmentURIParser.h >index 7c7736c34ebcf64d945603dcd863939e8db37e4c..10a2a0d0f5224b050ad5c7f4d1d656afee83c7e5 100644 >--- a/Source/WebCore/html/MediaFragmentURIParser.h >+++ b/Source/WebCore/html/MediaFragmentURIParser.h >@@ -27,14 +27,12 @@ > > #if ENABLE(VIDEO) > >-#include "URL.h" > #include <wtf/MediaTime.h> >+#include <wtf/URL.h> > #include <wtf/Vector.h> > > namespace WebCore { > >-class URL; >- > class MediaFragmentURIParser final { > public: > >diff --git a/Source/WebCore/html/PublicURLManager.cpp b/Source/WebCore/html/PublicURLManager.cpp >index cf186c0ba400e2a3c2304cc79ffadba8af3aa361..73b5473578e3b0b31eaf95da40c20ac099c07367 100644 >--- a/Source/WebCore/html/PublicURLManager.cpp >+++ b/Source/WebCore/html/PublicURLManager.cpp >@@ -26,7 +26,7 @@ > > #include "config.h" > #include "PublicURLManager.h" >-#include "URL.h" >+#include <wtf/URL.h> > #include "URLRegistry.h" > #include <wtf/text/StringHash.h> > >diff --git a/Source/WebCore/html/PublicURLManager.h b/Source/WebCore/html/PublicURLManager.h >index e326545dccb49bfa6c5aff923a2c5e0c0fa775a4..e69de4ed8c83bb8a8dc4d3668622cd3fdd537e75 100644 >--- a/Source/WebCore/html/PublicURLManager.h >+++ b/Source/WebCore/html/PublicURLManager.h >@@ -33,7 +33,6 @@ > > namespace WebCore { > >-class URL; > class ScriptExecutionContext; > class SecurityOrigin; > class URLRegistry; >diff --git a/Source/WebCore/html/URLInputType.cpp b/Source/WebCore/html/URLInputType.cpp >index 6ca0ac1a2013cf6d5d8dc5c0ea03b211792f195e..63bb3cc2601a043d149c45a29ec18da140b5ad84 100644 >--- a/Source/WebCore/html/URLInputType.cpp >+++ b/Source/WebCore/html/URLInputType.cpp >@@ -36,7 +36,7 @@ > #include "HTMLParserIdioms.h" > #include "InputTypeNames.h" > #include "LocalizedStrings.h" >-#include "URL.h" >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/html/URLRegistry.h b/Source/WebCore/html/URLRegistry.h >index bd772ce5f17a6b87dc2f4625b71be01103c37743..8223bbd07590ddacce9fd1604e3ac0bc015f64ae 100644 >--- a/Source/WebCore/html/URLRegistry.h >+++ b/Source/WebCore/html/URLRegistry.h >@@ -34,7 +34,6 @@ > > namespace WebCore { > >-class URL; > class SecurityOrigin; > class URLRegistry; > >diff --git a/Source/WebCore/html/URLSearchParams.cpp b/Source/WebCore/html/URLSearchParams.cpp >index 30e85924a78520d6592091ad2d33c0420cfedd43..4e7fbaefdf0a416cc654aa73d59b7be80b41d0f8 100644 >--- a/Source/WebCore/html/URLSearchParams.cpp >+++ b/Source/WebCore/html/URLSearchParams.cpp >@@ -26,13 +26,13 @@ > #include "URLSearchParams.h" > > #include "DOMURL.h" >-#include "URLParser.h" >+#include <wtf/URLParser.h> > > namespace WebCore { > > URLSearchParams::URLSearchParams(const String& init, DOMURL* associatedURL) > : m_associatedURL(associatedURL) >- , m_pairs(init.startsWith('?') ? URLParser::parseURLEncodedForm(StringView(init).substring(1)) : URLParser::parseURLEncodedForm(init)) >+ , m_pairs(init.startsWith('?') ? WTF::URLParser::parseURLEncodedForm(StringView(init).substring(1)) : WTF::URLParser::parseURLEncodedForm(init)) > { > } > >@@ -133,20 +133,20 @@ void URLSearchParams::remove(const String& name) > > String URLSearchParams::toString() const > { >- return URLParser::serialize(m_pairs); >+ return WTF::URLParser::serialize(m_pairs); > } > > void URLSearchParams::updateURL() > { > if (m_associatedURL) >- m_associatedURL->setQuery(URLParser::serialize(m_pairs)); >+ m_associatedURL->setQuery(WTF::URLParser::serialize(m_pairs)); > } > > void URLSearchParams::updateFromAssociatedURL() > { > ASSERT(m_associatedURL); > String search = m_associatedURL->search(); >- m_pairs = search.startsWith('?') ? URLParser::parseURLEncodedForm(StringView(search).substring(1)) : URLParser::parseURLEncodedForm(search); >+ m_pairs = search.startsWith('?') ? WTF::URLParser::parseURLEncodedForm(StringView(search).substring(1)) : WTF::URLParser::parseURLEncodedForm(search); > } > > std::optional<WTF::KeyValuePair<String, String>> URLSearchParams::Iterator::next() >diff --git a/Source/WebCore/html/URLUtils.h b/Source/WebCore/html/URLUtils.h >index a07c0814f11e171184503e6aa6aaad6c047d475a..656abfbda0bdbce393b88cc52344b9cd616e76e9 100644 >--- a/Source/WebCore/html/URLUtils.h >+++ b/Source/WebCore/html/URLUtils.h >@@ -174,7 +174,7 @@ void URLUtils<T>::setHost(const String& value) > // requires setting the port to "0" if it is set to empty string. > url.setHostAndPort(value.substring(0, separator + 1) + '0'); > } else { >- if (isDefaultPortForProtocol(port, url.protocol())) >+ if (WTF::isDefaultPortForProtocol(port, url.protocol())) > url.setHostAndPort(value.substring(0, separator)); > else > url.setHostAndPort(value.substring(0, portEnd)); >@@ -235,7 +235,7 @@ void URLUtils<T>::setPort(const String& value) > // requires setting the port to "0" if it is set to empty string. > // FIXME: http://url.spec.whatwg.org/ doesn't appear to require this; test what browsers do > unsigned port = value.toUInt(); >- if (isDefaultPortForProtocol(port, url.protocol())) >+ if (WTF::isDefaultPortForProtocol(port, url.protocol())) > url.removePort(); > else > url.setPort(port); >diff --git a/Source/WebCore/html/canvas/CanvasRenderingContext.cpp b/Source/WebCore/html/canvas/CanvasRenderingContext.cpp >index 3361438f1ef233699d0eda3521c056de67baed25..704b41ffbe71797ef865dd972c9e51591a6dffe7 100644 >--- a/Source/WebCore/html/canvas/CanvasRenderingContext.cpp >+++ b/Source/WebCore/html/canvas/CanvasRenderingContext.cpp >@@ -34,7 +34,7 @@ > #include "Image.h" > #include "ImageBitmap.h" > #include "OffscreenCanvas.h" >-#include "URL.h" >+#include <wtf/URL.h> > #include "SecurityOrigin.h" > > namespace WebCore { >diff --git a/Source/WebCore/html/canvas/CanvasRenderingContext.h b/Source/WebCore/html/canvas/CanvasRenderingContext.h >index ff479dea0543986909583d954fc7f661934ecdaa..7af43fc814c9dd814d1c1c45f4ed6ac8ca1903c6 100644 >--- a/Source/WebCore/html/canvas/CanvasRenderingContext.h >+++ b/Source/WebCore/html/canvas/CanvasRenderingContext.h >@@ -38,7 +38,6 @@ class HTMLCanvasElement; > class HTMLImageElement; > class HTMLVideoElement; > class ImageBitmap; >-class URL; > class WebGLObject; > > class CanvasRenderingContext : public ScriptWrappable { >diff --git a/Source/WebCore/html/parser/HTMLParserIdioms.cpp b/Source/WebCore/html/parser/HTMLParserIdioms.cpp >index 674debc698db9b7002eb4052335b9e6db81b64a3..42309268e9bdd095ac9bf16ad9f7332a371cd5b7 100644 >--- a/Source/WebCore/html/parser/HTMLParserIdioms.cpp >+++ b/Source/WebCore/html/parser/HTMLParserIdioms.cpp >@@ -27,9 +27,9 @@ > > #include "Decimal.h" > #include "QualifiedName.h" >-#include "URL.h" > #include <limits> > #include <wtf/MathExtras.h> >+#include <wtf/URL.h> > #include <wtf/dtoa.h> > > namespace WebCore { >diff --git a/Source/WebCore/html/parser/XSSAuditor.cpp b/Source/WebCore/html/parser/XSSAuditor.cpp >index 1c2e4d9a5e927fec75b0962ddddb66ddf8b4ffa1..d635747c1f0632ae345d65dd1a5e530fee70adec 100644 >--- a/Source/WebCore/html/parser/XSSAuditor.cpp >+++ b/Source/WebCore/html/parser/XSSAuditor.cpp >@@ -244,7 +244,7 @@ static bool isSemicolonSeparatedAttribute(const HTMLToken::Attribute& attribute) > static bool semicolonSeparatedValueContainsJavaScriptURL(StringView semicolonSeparatedValue) > { > for (auto value : semicolonSeparatedValue.split(';')) { >- if (protocolIsJavaScript(value)) >+ if (WTF::protocolIsJavaScript(value)) > return true; > } > return false; >@@ -440,9 +440,9 @@ bool XSSAuditor::filterScriptToken(const FilterTokenRequest& request) > > bool didBlockScript = false; > if (m_wasScriptTagFoundInRequest) { >- didBlockScript |= eraseAttributeIfInjected(request, srcAttr, blankURL().string(), TruncationStyle::SrcLikeAttribute); >- didBlockScript |= eraseAttributeIfInjected(request, SVGNames::hrefAttr, blankURL().string(), TruncationStyle::SrcLikeAttribute); >- didBlockScript |= eraseAttributeIfInjected(request, XLinkNames::hrefAttr, blankURL().string(), TruncationStyle::SrcLikeAttribute); >+ didBlockScript |= eraseAttributeIfInjected(request, srcAttr, WTF::blankURL().string(), TruncationStyle::SrcLikeAttribute); >+ didBlockScript |= eraseAttributeIfInjected(request, SVGNames::hrefAttr, WTF::blankURL().string(), TruncationStyle::SrcLikeAttribute); >+ didBlockScript |= eraseAttributeIfInjected(request, XLinkNames::hrefAttr, WTF::blankURL().string(), TruncationStyle::SrcLikeAttribute); > } > > return didBlockScript; >@@ -455,7 +455,7 @@ bool XSSAuditor::filterObjectToken(const FilterTokenRequest& request) > > bool didBlockScript = false; > if (isContainedInRequest(canonicalizedSnippetForTagName(request))) { >- didBlockScript |= eraseAttributeIfInjected(request, dataAttr, blankURL().string(), TruncationStyle::SrcLikeAttribute); >+ didBlockScript |= eraseAttributeIfInjected(request, dataAttr, WTF::blankURL().string(), TruncationStyle::SrcLikeAttribute); > didBlockScript |= eraseAttributeIfInjected(request, typeAttr); > didBlockScript |= eraseAttributeIfInjected(request, classidAttr); > } >@@ -475,7 +475,7 @@ bool XSSAuditor::filterParamToken(const FilterTokenRequest& request) > if (!HTMLParamElement::isURLParameter(String(nameAttribute.value))) > return false; > >- return eraseAttributeIfInjected(request, valueAttr, blankURL().string(), TruncationStyle::SrcLikeAttribute); >+ return eraseAttributeIfInjected(request, valueAttr, WTF::blankURL().string(), TruncationStyle::SrcLikeAttribute); > } > > bool XSSAuditor::filterEmbedToken(const FilterTokenRequest& request) >@@ -486,7 +486,7 @@ bool XSSAuditor::filterEmbedToken(const FilterTokenRequest& request) > bool didBlockScript = false; > if (isContainedInRequest(canonicalizedSnippetForTagName(request))) { > didBlockScript |= eraseAttributeIfInjected(request, codeAttr, String(), TruncationStyle::SrcLikeAttribute); >- didBlockScript |= eraseAttributeIfInjected(request, srcAttr, blankURL().string(), TruncationStyle::SrcLikeAttribute); >+ didBlockScript |= eraseAttributeIfInjected(request, srcAttr, WTF::blankURL().string(), TruncationStyle::SrcLikeAttribute); > didBlockScript |= eraseAttributeIfInjected(request, typeAttr); > } > return didBlockScript; >@@ -538,7 +538,7 @@ bool XSSAuditor::filterFormToken(const FilterTokenRequest& request) > ASSERT(request.token.type() == HTMLToken::StartTag); > ASSERT(hasName(request.token, formTag)); > >- return eraseAttributeIfInjected(request, actionAttr, blankURL().string()); >+ return eraseAttributeIfInjected(request, actionAttr, WTF::blankURL().string()); > } > > bool XSSAuditor::filterInputToken(const FilterTokenRequest& request) >@@ -546,7 +546,7 @@ bool XSSAuditor::filterInputToken(const FilterTokenRequest& request) > ASSERT(request.token.type() == HTMLToken::StartTag); > ASSERT(hasName(request.token, inputTag)); > >- return eraseAttributeIfInjected(request, formactionAttr, blankURL().string(), TruncationStyle::SrcLikeAttribute); >+ return eraseAttributeIfInjected(request, formactionAttr, WTF::blankURL().string(), TruncationStyle::SrcLikeAttribute); > } > > bool XSSAuditor::filterButtonToken(const FilterTokenRequest& request) >@@ -554,7 +554,7 @@ bool XSSAuditor::filterButtonToken(const FilterTokenRequest& request) > ASSERT(request.token.type() == HTMLToken::StartTag); > ASSERT(hasName(request.token, buttonTag)); > >- return eraseAttributeIfInjected(request, formactionAttr, blankURL().string(), TruncationStyle::SrcLikeAttribute); >+ return eraseAttributeIfInjected(request, formactionAttr, WTF::blankURL().string(), TruncationStyle::SrcLikeAttribute); > } > > bool XSSAuditor::eraseDangerousAttributesIfInjected(const FilterTokenRequest& request) >@@ -567,7 +567,7 @@ bool XSSAuditor::eraseDangerousAttributesIfInjected(const FilterTokenRequest& re > bool isInlineEventHandler = isNameOfInlineEventHandler(attribute.name); > // FIXME: It would be better if we didn't create a new String for every attribute in the document. > String strippedValue = stripLeadingAndTrailingHTMLSpaces(String(attribute.value)); >- bool valueContainsJavaScriptURL = (!isInlineEventHandler && protocolIsJavaScript(strippedValue)) || (isSemicolonSeparatedAttribute(attribute) && semicolonSeparatedValueContainsJavaScriptURL(strippedValue)); >+ bool valueContainsJavaScriptURL = (!isInlineEventHandler && WTF::protocolIsJavaScript(strippedValue)) || (isSemicolonSeparatedAttribute(attribute) && semicolonSeparatedValueContainsJavaScriptURL(strippedValue)); > if (!isInlineEventHandler && !valueContainsJavaScriptURL) > continue; > if (!isContainedInRequest(canonicalize(snippetFromAttribute(request, attribute), TruncationStyle::ScriptLikeAttribute))) >@@ -732,7 +732,7 @@ bool XSSAuditor::isLikelySafeResource(const String& url) > // Give empty URLs and about:blank a pass. Making a resourceURL from an > // empty string below will likely later fail the "no query args test" as > // it inherits the document's query args. >- if (url.isEmpty() || url == blankURL().string()) >+ if (url.isEmpty() || url == WTF::blankURL().string()) > return true; > > // If the resource is loaded from the same host as the enclosing page, it's >diff --git a/Source/WebCore/html/parser/XSSAuditor.h b/Source/WebCore/html/parser/XSSAuditor.h >index 38eb0553c93a89b53fd3289de4884893ae0fe0b9..6ceb8438f74b67cc10c9d3dfbfde2c6d8eb2c481 100644 >--- a/Source/WebCore/html/parser/XSSAuditor.h >+++ b/Source/WebCore/html/parser/XSSAuditor.h >@@ -27,7 +27,7 @@ > > #include "HTMLToken.h" > #include "HTTPParsers.h" >-#include "URL.h" >+#include <wtf/URL.h> > #include "SuffixTree.h" > #include "TextEncoding.h" > >diff --git a/Source/WebCore/html/parser/XSSAuditorDelegate.h b/Source/WebCore/html/parser/XSSAuditorDelegate.h >index 67a32ed930d7d9dd4dac4089220bdf3f2ad76e87..605159b2fafa4cf871ae656f10af43f001e93fad 100644 >--- a/Source/WebCore/html/parser/XSSAuditorDelegate.h >+++ b/Source/WebCore/html/parser/XSSAuditorDelegate.h >@@ -26,7 +26,7 @@ > > #pragma once > >-#include "URL.h" >+#include <wtf/URL.h> > #include <wtf/text/TextPosition.h> > > namespace WebCore { >diff --git a/Source/WebCore/inspector/InspectorFrontendHost.cpp b/Source/WebCore/inspector/InspectorFrontendHost.cpp >index 9f93294b6423d861bec782c90ac9cb57d382eeac..874f384c3a3f7c14cc4ac36a2a1f08a8c59ec861 100644 >--- a/Source/WebCore/inspector/InspectorFrontendHost.cpp >+++ b/Source/WebCore/inspector/InspectorFrontendHost.cpp >@@ -318,7 +318,7 @@ void InspectorFrontendHost::killText(const String& text, bool shouldPrependToKil > > void InspectorFrontendHost::openInNewTab(const String& url) > { >- if (WebCore::protocolIsJavaScript(url)) >+ if (WTF::protocolIsJavaScript(url)) > return; > > if (m_client) >diff --git a/Source/WebCore/inspector/InspectorInstrumentation.h b/Source/WebCore/inspector/InspectorInstrumentation.h >index 5d2fb3d562b60abf450d0fa2a4f03aa0ef94d582..b9a42e6fc098b634bd8b38a702e4d82957976753 100644 >--- a/Source/WebCore/inspector/InspectorInstrumentation.h >+++ b/Source/WebCore/inspector/InspectorInstrumentation.h >@@ -88,7 +88,6 @@ class ScriptExecutionContext; > class SecurityOrigin; > class ShadowRoot; > class TimerBase; >-class URL; > #if ENABLE(WEBGL) > class WebGLProgram; > #endif >diff --git a/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp b/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp >index 12a4e62bf1fafd308bce5e023212bc593bf6d98f..2230993d232ddd55472e6d9c8185100e885059b8 100644 >--- a/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp >+++ b/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp >@@ -68,7 +68,7 @@ > #include "SubresourceLoader.h" > #include "TextResourceDecoder.h" > #include "ThreadableLoaderClient.h" >-#include "URL.h" >+#include <wtf/URL.h> > #include "WebSocket.h" > #include "WebSocketChannel.h" > #include "WebSocketFrame.h" >diff --git a/Source/WebCore/inspector/agents/InspectorNetworkAgent.h b/Source/WebCore/inspector/agents/InspectorNetworkAgent.h >index 5239422a02b7f8b5916a55159eeb9d443030c5d7..65735fe209476269daf3ad2cb4fd9f32664daacc 100644 >--- a/Source/WebCore/inspector/agents/InspectorNetworkAgent.h >+++ b/Source/WebCore/inspector/agents/InspectorNetworkAgent.h >@@ -58,7 +58,6 @@ class ResourceLoader; > class ResourceRequest; > class ResourceResponse; > class TextResourceDecoder; >-class URL; > class WebSocket; > > struct WebSocketFrame; >diff --git a/Source/WebCore/inspector/agents/InspectorPageAgent.h b/Source/WebCore/inspector/agents/InspectorPageAgent.h >index b407635c4796b93b6f7f785ca008992c502b00e4..e1a1da99f244879ee31175ac33140170245a1e47 100644 >--- a/Source/WebCore/inspector/agents/InspectorPageAgent.h >+++ b/Source/WebCore/inspector/agents/InspectorPageAgent.h >@@ -49,7 +49,6 @@ class InspectorOverlay; > class Page; > class RenderObject; > class SharedBuffer; >-class URL; > > typedef String ErrorString; > >diff --git a/Source/WebCore/inspector/agents/InspectorWorkerAgent.h b/Source/WebCore/inspector/agents/InspectorWorkerAgent.h >index 7288cffe4cf2e8febeb0c610d46b7ecafbc65f4d..5e040c954d4b514a14903c072070becde060cbd0 100644 >--- a/Source/WebCore/inspector/agents/InspectorWorkerAgent.h >+++ b/Source/WebCore/inspector/agents/InspectorWorkerAgent.h >@@ -34,7 +34,6 @@ > namespace WebCore { > > class Page; >-class URL; > > typedef String ErrorString; > >diff --git a/Source/WebCore/loader/ApplicationManifestLoader.h b/Source/WebCore/loader/ApplicationManifestLoader.h >index 8b6431ab422f2cb6c948d8cf8ebb55117117ddba..1b0f760d2ecebd5c28ef5c2ec42eda12f03f3beb 100644 >--- a/Source/WebCore/loader/ApplicationManifestLoader.h >+++ b/Source/WebCore/loader/ApplicationManifestLoader.h >@@ -30,8 +30,8 @@ > #include "ApplicationManifest.h" > #include "CachedRawResourceClient.h" > #include "CachedResourceHandle.h" >-#include "URL.h" > #include <wtf/Noncopyable.h> >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/loader/CookieJar.h b/Source/WebCore/loader/CookieJar.h >index 5fa705d8a85ff158689065fc8bcd88b3fc98b4e4..b9b9f3749743ed48f738a3fd8e72a69a4d009e7e 100644 >--- a/Source/WebCore/loader/CookieJar.h >+++ b/Source/WebCore/loader/CookieJar.h >@@ -31,7 +31,6 @@ > namespace WebCore { > > class Document; >-class URL; > struct Cookie; > struct CookieRequestHeaderFieldProxy; > >diff --git a/Source/WebCore/loader/CrossOriginAccessControl.h b/Source/WebCore/loader/CrossOriginAccessControl.h >index d2b09bd5db5676c01abf823d3f0722a770ea540b..2af3d4a1c52091293de1c483a2fc173ac66ea276 100644 >--- a/Source/WebCore/loader/CrossOriginAccessControl.h >+++ b/Source/WebCore/loader/CrossOriginAccessControl.h >@@ -40,7 +40,6 @@ class ResourceError; > class ResourceRequest; > class ResourceResponse; > class SecurityOrigin; >-class URL; > > struct ResourceLoaderOptions; > >diff --git a/Source/WebCore/loader/CrossOriginPreflightResultCache.h b/Source/WebCore/loader/CrossOriginPreflightResultCache.h >index dc07130a1b14653bd1df5beee98809e3b72efbe3..965de6f8a07bdc78c08e0f1c2e7219e1eda40473 100644 >--- a/Source/WebCore/loader/CrossOriginPreflightResultCache.h >+++ b/Source/WebCore/loader/CrossOriginPreflightResultCache.h >@@ -27,9 +27,9 @@ > #pragma once > > #include "StoredCredentialsPolicy.h" >-#include "URLHash.h" > #include <wtf/HashMap.h> > #include <wtf/HashSet.h> >+#include <wtf/URLHash.h> > #include <wtf/text/StringHash.h> > > namespace WebCore { >diff --git a/Source/WebCore/loader/DocumentLoader.cpp b/Source/WebCore/loader/DocumentLoader.cpp >index 2c320ae51ba49f760edbc16a3c8ef08bc29b68a1..f6ffb13ff597ee24211f1d49f160bbbb7b8ddd58 100644 >--- a/Source/WebCore/loader/DocumentLoader.cpp >+++ b/Source/WebCore/loader/DocumentLoader.cpp >@@ -636,7 +636,7 @@ void DocumentLoader::willSendRequest(ResourceRequest&& newRequest, const Resourc > switch (shouldContinue) { > case ShouldContinue::ForSuspension: > // We handle suspension by navigating forward to about:blank, which leaves us setup to navigate back to resume. >- request = { blankURL() }; >+ request = { WTF::blankURL() }; > break; > case ShouldContinue::No: > stopLoadingForPolicyChange(); >@@ -1682,7 +1682,7 @@ bool DocumentLoader::maybeLoadEmpty() > return false; > > if (m_request.url().isEmpty() && !frameLoader()->stateMachine().creatingInitialEmptyDocument()) { >- m_request.setURL(blankURL()); >+ m_request.setURL(WTF::blankURL()); > if (isLoadingMainResource()) > frameLoader()->client().dispatchDidChangeProvisionalURL(); > } >diff --git a/Source/WebCore/loader/DocumentLoader.h b/Source/WebCore/loader/DocumentLoader.h >index ec3acabbce1e47ba67a4326dfbc625640ce162f2..a62ff4428b4c00c7442c1737dbf0fc0814b0ec6b 100644 >--- a/Source/WebCore/loader/DocumentLoader.h >+++ b/Source/WebCore/loader/DocumentLoader.h >@@ -236,7 +236,7 @@ public: > String clientRedirectDestinationForHistory() const { return urlForHistory(); } > void setClientRedirectSourceForHistory(const String& clientRedirectSourceForHistory) { m_clientRedirectSourceForHistory = clientRedirectSourceForHistory; } > >- String serverRedirectSourceForHistory() const { return (urlForHistory() == url() || url() == blankURL()) ? String() : urlForHistory().string(); } // null if no server redirect occurred. >+ String serverRedirectSourceForHistory() const { return (urlForHistory() == url() || url() == WTF::blankURL()) ? String() : urlForHistory().string(); } // null if no server redirect occurred. > String serverRedirectDestinationForHistory() const { return url(); } > > bool didCreateGlobalHistoryEntry() const { return m_didCreateGlobalHistoryEntry; } >diff --git a/Source/WebCore/loader/DocumentWriter.h b/Source/WebCore/loader/DocumentWriter.h >index 385fb6407ba419bbb8667cbc50997c1b0d4bf214..3048c59e575137d85e0a99ce92c50e3de7baf64b 100644 >--- a/Source/WebCore/loader/DocumentWriter.h >+++ b/Source/WebCore/loader/DocumentWriter.h >@@ -28,7 +28,7 @@ > > #pragma once > >-#include "URL.h" >+#include <wtf/URL.h> > #include <wtf/text/WTFString.h> > > namespace WebCore { >diff --git a/Source/WebCore/loader/FormSubmission.h b/Source/WebCore/loader/FormSubmission.h >index 4cdf48b77c6d05e2e65579a432148308d848ebc9..f9accf17215bb06a6f8966cf021799bed58e3d12 100644 >--- a/Source/WebCore/loader/FormSubmission.h >+++ b/Source/WebCore/loader/FormSubmission.h >@@ -32,7 +32,7 @@ > > #include "FormState.h" > #include "FrameLoaderTypes.h" >-#include "URL.h" >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/loader/FrameLoader.cpp b/Source/WebCore/loader/FrameLoader.cpp >index b0d28a917e047de6f65220ac7d4a500e2eb12ac3..c14580fa253e9e4e281a7e99398b713b33b66a32 100644 >--- a/Source/WebCore/loader/FrameLoader.cpp >+++ b/Source/WebCore/loader/FrameLoader.cpp >@@ -119,13 +119,13 @@ > #include "SubframeLoader.h" > #include "SubresourceLoader.h" > #include "TextResourceDecoder.h" >-#include "URL.h" > #include "UserContentController.h" > #include "UserGestureIndicator.h" > #include "WindowFeatures.h" > #include "XMLDocumentParser.h" > #include <dom/ScriptDisallowedScope.h> > #include <wtf/CompletionHandler.h> >+#include <wtf/URL.h> > #include <wtf/Ref.h> > #include <wtf/SetForScope.h> > #include <wtf/StdLibExtras.h> >@@ -423,7 +423,7 @@ void FrameLoader::submitForm(Ref<FormSubmission>&& submission) > return; > } > >- if (protocolIsJavaScript(submission->action())) { >+ if (WTF::protocolIsJavaScript(submission->action())) { > if (!m_frame.document()->contentSecurityPolicy()->allowFormAction(URL(submission->action()))) > return; > m_isExecutingJavaScriptFormAction = true; >@@ -701,7 +701,7 @@ void FrameLoader::receivedFirstData() > if (!parseHTTPRefresh(documentLoader.response().httpHeaderField(HTTPHeaderName::Refresh), delay, urlString)) > return; > auto completedURL = urlString.isEmpty() ? document.url() : document.completeURL(urlString); >- if (!protocolIsJavaScript(completedURL)) >+ if (!WTF::protocolIsJavaScript(completedURL)) > m_frame.navigationScheduler().scheduleRedirect(document, delay, completedURL); > else { > auto message = "Refused to refresh " + document.url().stringCenterEllipsizedToLength() + " to a javascript: URL"; >@@ -1558,7 +1558,7 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t > > // Only the first iframe navigation or the first iframe navigation after about:blank should be reported. > // https://www.w3.org/TR/resource-timing-2/#resources-included-in-the-performanceresourcetiming-interface >- if (m_shouldReportResourceTimingToParentFrame && !m_previousURL.isNull() && m_previousURL != blankURL()) >+ if (m_shouldReportResourceTimingToParentFrame && !m_previousURL.isNull() && m_previousURL != WTF::blankURL()) > m_shouldReportResourceTimingToParentFrame = false; > > // Log main frame navigation types. >@@ -3375,7 +3375,7 @@ void FrameLoader::continueLoadAfterNavigationPolicy(const ResourceRequest& reque > // For example, using a Back/Forward load to load about blank would cause the current HistoryItem's url to be > // overwritten with 'about:blank', which we do not want. > m_loadType = FrameLoadType::Standard; >- m_provisionalDocumentLoader->willContinueMainResourceLoadAfterRedirect({ blankURL() }); >+ m_provisionalDocumentLoader->willContinueMainResourceLoadAfterRedirect({ WTF::blankURL() }); > } > > m_provisionalDocumentLoader->startLoadingMainResource(shouldContinue); >@@ -3927,7 +3927,7 @@ RefPtr<Frame> createWindow(Frame& openerFrame, Frame& lookupFrame, FrameLoadRequ > created = false; > > // FIXME: Provide line number information with respect to the opener's document. >- if (protocolIsJavaScript(request.resourceRequest().url()) && !openerFrame.document()->contentSecurityPolicy()->allowJavaScriptURLs(openerFrame.document()->url(), { })) >+ if (WTF::protocolIsJavaScript(request.resourceRequest().url()) && !openerFrame.document()->contentSecurityPolicy()->allowJavaScriptURLs(openerFrame.document()->url(), { })) > return nullptr; > > if (!request.frameName().isEmpty() && !equalIgnoringASCIICase(request.frameName(), "_blank")) { >diff --git a/Source/WebCore/loader/FrameLoaderClient.h b/Source/WebCore/loader/FrameLoaderClient.h >index 99c382a66862419d62a43a81b6dcd40b6c3da021..679d773c1d9e3f4495ab2dce0633ea427002496f 100644 >--- a/Source/WebCore/loader/FrameLoaderClient.h >+++ b/Source/WebCore/loader/FrameLoaderClient.h >@@ -100,7 +100,6 @@ class ResourceResponse; > class SecurityOrigin; > class SharedBuffer; > class SubstituteData; >-class URL; > class Widget; > > enum class LockBackForwardList : bool; >diff --git a/Source/WebCore/loader/HistoryController.cpp b/Source/WebCore/loader/HistoryController.cpp >index 76c94b24feb8bea2f10d8d86b047e080e2ea554e..5f38cda69137e7e1bea6658794a0129e0e92dfc7 100644 >--- a/Source/WebCore/loader/HistoryController.cpp >+++ b/Source/WebCore/loader/HistoryController.cpp >@@ -613,7 +613,7 @@ bool HistoryController::currentItemShouldBeReplaced() const > // "If the browsing context's session history contains only one Document, > // and that was the about:blank Document created when the browsing context > // was created, then the navigation must be done with replacement enabled." >- return m_currentItem && !m_previousItem && equalIgnoringASCIICase(m_currentItem->urlString(), blankURL()); >+ return m_currentItem && !m_previousItem && equalIgnoringASCIICase(m_currentItem->urlString(), WTF::blankURL()); > } > > void HistoryController::clearPreviousItem() >@@ -652,9 +652,9 @@ void HistoryController::initializeItem(HistoryItem& item) > // Later we may want to learn to live with nil for URL. > // See bug 3368236 and related bugs for more information. > if (url.isEmpty()) >- url = blankURL(); >+ url = WTF::blankURL(); > if (originalURL.isEmpty()) >- originalURL = blankURL(); >+ originalURL = WTF::blankURL(); > > StringWithDirection title = documentLoader->title(); > >diff --git a/Source/WebCore/loader/LinkLoader.h b/Source/WebCore/loader/LinkLoader.h >index 01d1efc315a5b02d0699e9ac45dfd136878f4ab1..54d722310d8dff921f1e9de0545bd9e1c620947c 100644 >--- a/Source/WebCore/loader/LinkLoader.h >+++ b/Source/WebCore/loader/LinkLoader.h >@@ -41,7 +41,6 @@ > namespace WebCore { > > class Document; >-class URL; > class LinkPreloadResourceClient; > > struct LinkRelAttribute; >diff --git a/Source/WebCore/loader/LoadTiming.h b/Source/WebCore/loader/LoadTiming.h >index 73f9ef94afd6255d5a3f574582d30a64f21d1464..fea7c41fce602526e36aa8edb6eab46569858c80 100644 >--- a/Source/WebCore/loader/LoadTiming.h >+++ b/Source/WebCore/loader/LoadTiming.h >@@ -25,13 +25,12 @@ > > #pragma once > >+#include <wtf/Forward.h> > #include <wtf/MonotonicTime.h> > #include <wtf/WallTime.h> > > namespace WebCore { > >-class URL; >- > class LoadTiming { > public: > Seconds secondsSinceStartTime(MonotonicTime) const; >diff --git a/Source/WebCore/loader/LoaderStrategy.h b/Source/WebCore/loader/LoaderStrategy.h >index 596782c657cac5082cafe1ce4b1c16ffb9a68d4d..285e6809ce45e221244469ff955ae55efdeb514e 100644 >--- a/Source/WebCore/loader/LoaderStrategy.h >+++ b/Source/WebCore/loader/LoaderStrategy.h >@@ -51,7 +51,6 @@ class ResourceResponse; > class SecurityOrigin; > class SharedBuffer; > class SubresourceLoader; >-class URL; > > struct FetchOptions; > >diff --git a/Source/WebCore/loader/MixedContentChecker.cpp b/Source/WebCore/loader/MixedContentChecker.cpp >index 050cb79ea6577d53a0335206bd460ea4473f2377..fade01b7c1d0bec846367ff5a627d93df1f09a14 100644 >--- a/Source/WebCore/loader/MixedContentChecker.cpp >+++ b/Source/WebCore/loader/MixedContentChecker.cpp >@@ -108,7 +108,7 @@ void MixedContentChecker::checkFormForMixedContent(SecurityOrigin& securityOrigi > { > // Unconditionally allow javascript: URLs as form actions as some pages do this and it does not introduce > // a mixed content issue. >- if (protocolIsJavaScript(url)) >+ if (WTF::protocolIsJavaScript(url)) > return; > > if (!isMixedContent(securityOrigin, url)) >diff --git a/Source/WebCore/loader/MixedContentChecker.h b/Source/WebCore/loader/MixedContentChecker.h >index a26a85797d3a8cb0c2933df24776b695b70d4434..5fdfff80a31874371838890b5e2404ea009f1179 100644 >--- a/Source/WebCore/loader/MixedContentChecker.h >+++ b/Source/WebCore/loader/MixedContentChecker.h >@@ -37,7 +37,6 @@ namespace WebCore { > > class Frame; > class FrameLoaderClient; >-class URL; > class SecurityOrigin; > > class MixedContentChecker { >diff --git a/Source/WebCore/loader/NavigationScheduler.cpp b/Source/WebCore/loader/NavigationScheduler.cpp >index 8ecc143f4213c95f790ee83e388075534cb989a4..617dedbfdfa865193c7b734d3bad5df55113d969 100644 >--- a/Source/WebCore/loader/NavigationScheduler.cpp >+++ b/Source/WebCore/loader/NavigationScheduler.cpp >@@ -366,7 +366,7 @@ inline bool NavigationScheduler::shouldScheduleNavigation(const URL& url) const > { > if (!shouldScheduleNavigation()) > return false; >- if (protocolIsJavaScript(url)) >+ if (WTF::protocolIsJavaScript(url)) > return true; > return NavigationDisabler::isNavigationAllowed(m_frame); > } >diff --git a/Source/WebCore/loader/NavigationScheduler.h b/Source/WebCore/loader/NavigationScheduler.h >index 53ef55844e67414382e6dbfebd19a75642a466c0..b97d98681618eab60fd2758ad98993b245244982 100644 >--- a/Source/WebCore/loader/NavigationScheduler.h >+++ b/Source/WebCore/loader/NavigationScheduler.h >@@ -41,7 +41,6 @@ class FormSubmission; > class Frame; > class ScheduledNavigation; > class SecurityOrigin; >-class URL; > > enum class NewLoadInProgress : bool { No, Yes }; > >diff --git a/Source/WebCore/loader/PingLoader.h b/Source/WebCore/loader/PingLoader.h >index 15489dcf04bf1ded7886ef8c08617ddbc13d9a18..6deef45169a9e5ca30a9f2f83342379d399b1db1 100644 >--- a/Source/WebCore/loader/PingLoader.h >+++ b/Source/WebCore/loader/PingLoader.h >@@ -40,7 +40,6 @@ namespace WebCore { > class FormData; > class Frame; > class HTTPHeaderMap; >-class URL; > class ResourceRequest; > > enum class ViolationReportType { >diff --git a/Source/WebCore/loader/PolicyChecker.cpp b/Source/WebCore/loader/PolicyChecker.cpp >index 8302539cb377bcfc46ccf1d59e17fbf87813c800..f4c191fad45764d49b32429f2cbd4dc6bd5e2ce0 100644 >--- a/Source/WebCore/loader/PolicyChecker.cpp >+++ b/Source/WebCore/loader/PolicyChecker.cpp >@@ -179,7 +179,7 @@ void PolicyChecker::checkNavigationPolicy(ResourceRequest&& request, const Resou > case PolicyAction::Ignore: > return function({ }, nullptr, ShouldContinue::No); > case PolicyAction::Suspend: >- return function({ blankURL() }, nullptr, ShouldContinue::ForSuspension); >+ return function({ WTF::blankURL() }, nullptr, ShouldContinue::ForSuspension); > case PolicyAction::Use: > if (!m_frame.loader().client().canHandleRequest(request)) { > handleUnimplementablePolicy(m_frame.loader().client().cannotShowURLError(request)); >diff --git a/Source/WebCore/loader/ResourceLoadInfo.h b/Source/WebCore/loader/ResourceLoadInfo.h >index 9b6330ed47bac66dea22b84e19cf1d00b06a23c1..1c123d06f7ad675229d6c5e01f9251a68b16225b 100644 >--- a/Source/WebCore/loader/ResourceLoadInfo.h >+++ b/Source/WebCore/loader/ResourceLoadInfo.h >@@ -26,7 +26,7 @@ > #pragma once > > #include "CachedResource.h" >-#include "URL.h" >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/loader/ResourceLoadObserver.cpp b/Source/WebCore/loader/ResourceLoadObserver.cpp >index 95d659567ee693a8337135a56f5eb5a3a99fd91a..ca360051154b6d5f30b8cbbf5968dfb152bce9ec 100644 >--- a/Source/WebCore/loader/ResourceLoadObserver.cpp >+++ b/Source/WebCore/loader/ResourceLoadObserver.cpp >@@ -40,7 +40,7 @@ > #include "ScriptExecutionContext.h" > #include "SecurityOrigin.h" > #include "Settings.h" >-#include "URL.h" >+#include <wtf/URL.h> > > namespace WebCore { > >@@ -224,7 +224,7 @@ void ResourceLoadObserver::requestStorageAccessUnderOpener(const String& domainI > auto openerPrimaryDomain = primaryDomain(openerUrl); > if (domainInNeedOfStorageAccess != openerPrimaryDomain > && !openerDocument.hasRequestedPageSpecificStorageAccessWithUserInteraction(domainInNeedOfStorageAccess) >- && !equalIgnoringASCIICase(openerUrl.string(), blankURL())) { >+ && !equalIgnoringASCIICase(openerUrl.string(), WTF::blankURL())) { > m_requestStorageAccessUnderOpenerCallback(domainInNeedOfStorageAccess, openerPageID, openerPrimaryDomain); > // Remember user interaction-based requests since they don't need to be repeated. > openerDocument.setHasRequestedPageSpecificStorageAccessWithUserInteraction(domainInNeedOfStorageAccess); >diff --git a/Source/WebCore/loader/ResourceLoadObserver.h b/Source/WebCore/loader/ResourceLoadObserver.h >index ae2cae27809175583f2ebb43365a1019a1471087..2abfc50334c17d89e2b6ffbdc38a382a1f106e9d 100644 >--- a/Source/WebCore/loader/ResourceLoadObserver.h >+++ b/Source/WebCore/loader/ResourceLoadObserver.h >@@ -47,7 +47,6 @@ class Page; > class ResourceRequest; > class ResourceResponse; > class ScriptExecutionContext; >-class URL; > > struct ResourceLoadStatistics; > >diff --git a/Source/WebCore/loader/ResourceLoadStatistics.h b/Source/WebCore/loader/ResourceLoadStatistics.h >index f2f0962e896c7064e5676bf7aa29535db5b37d8e..11fc63cf6683a6eb8d4a79170c93dd6b7eb38926 100644 >--- a/Source/WebCore/loader/ResourceLoadStatistics.h >+++ b/Source/WebCore/loader/ResourceLoadStatistics.h >@@ -26,10 +26,10 @@ > #pragma once > > #include "CanvasActivityRecord.h" >-#include "URL.h" > #include <wtf/HashCountedSet.h> > #include <wtf/HashSet.h> > #include <wtf/OptionSet.h> >+#include <wtf/URL.h> > #include <wtf/WallTime.h> > #include <wtf/text/StringHash.h> > #include <wtf/text/WTFString.h> >diff --git a/Source/WebCore/loader/ResourceLoader.h b/Source/WebCore/loader/ResourceLoader.h >index 7119310bd3ba42b66762dd1937f0cc2bc5462cdc..c4d7927b66bb47c075a3ba1d7505b1de7e9b252e 100644 >--- a/Source/WebCore/loader/ResourceLoader.h >+++ b/Source/WebCore/loader/ResourceLoader.h >@@ -52,7 +52,6 @@ class Frame; > class FrameLoader; > class NetworkLoadMetrics; > class PreviewLoader; >-class URL; > > class ResourceLoader : public RefCounted<ResourceLoader>, protected ResourceHandleClient { > public: >diff --git a/Source/WebCore/loader/ResourceTiming.h b/Source/WebCore/loader/ResourceTiming.h >index 6c9acb193a67023bb5dc36bac4da7e79883443be..7ef8dbc8514dcecff1b07f45037037f8e884882a 100644 >--- a/Source/WebCore/loader/ResourceTiming.h >+++ b/Source/WebCore/loader/ResourceTiming.h >@@ -28,7 +28,7 @@ > #include "LoadTiming.h" > #include "NetworkLoadMetrics.h" > #include "ServerTiming.h" >-#include "URL.h" >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/loader/SubframeLoader.cpp b/Source/WebCore/loader/SubframeLoader.cpp >index 71384d0b2c1db0db9eaa107c9833d93964a87d9e..78ce7c1ed4e3fd03fb6f3291f74420b25779ac8b 100644 >--- a/Source/WebCore/loader/SubframeLoader.cpp >+++ b/Source/WebCore/loader/SubframeLoader.cpp >@@ -77,14 +77,14 @@ bool SubframeLoader::requestFrame(HTMLFrameOwnerElement& ownerElement, const Str > // Support for <frame src="javascript:string"> > URL scriptURL; > URL url; >- if (protocolIsJavaScript(urlString)) { >+ if (WTF::protocolIsJavaScript(urlString)) { > scriptURL = completeURL(urlString); // completeURL() encodes the URL. >- url = blankURL(); >+ url = WTF::blankURL(); > } else > url = completeURL(urlString); > > if (shouldConvertInvalidURLsToBlank() && !url.isValid()) >- url = blankURL(); >+ url = WTF::blankURL(); > > bool hasExistingFrame = ownerElement.contentFrame(); > Frame* frame = loadOrRedirectSubframe(ownerElement, url, frameName, lockHistory, lockBackForwardList); >@@ -94,7 +94,7 @@ bool SubframeLoader::requestFrame(HTMLFrameOwnerElement& ownerElement, const Str > // If we create a new subframe then an empty document is loaded into it synchronously and may > // cause script execution (say, via a DOM load event handler) that can do anything, including > // navigating the subframe. We only want to evaluate scriptURL if the frame has not been navigated. >- bool canExecuteScript = hasExistingFrame || (frame->loader().documentLoader() && frame->loader().documentLoader()->originalURL() == blankURL()); >+ bool canExecuteScript = hasExistingFrame || (frame->loader().documentLoader() && frame->loader().documentLoader()->originalURL() == WTF::blankURL()); > if (!scriptURL.isEmpty() && canExecuteScript && ownerElement.isURLAllowed(scriptURL)) > frame->script().executeIfJavaScriptURL(scriptURL); > >diff --git a/Source/WebCore/loader/SubframeLoader.h b/Source/WebCore/loader/SubframeLoader.h >index 4896d62f45f1f81d90de7402e2097041a6eb064c..2caae9ca6098a7533c3093896dc203126e689476 100644 >--- a/Source/WebCore/loader/SubframeLoader.h >+++ b/Source/WebCore/loader/SubframeLoader.h >@@ -45,7 +45,6 @@ class HTMLFrameOwnerElement; > class HTMLMediaElement; > class HTMLPlugInImageElement; > class IntSize; >-class URL; > class Widget; > > // This is a slight misnomer. It handles the higher level logic of loading both subframes and plugins. >diff --git a/Source/WebCore/loader/SubstituteData.h b/Source/WebCore/loader/SubstituteData.h >index f1013515971981829c610191752b91af9ec7fb75..705632133df8ef8565985287e41060b1db379489 100644 >--- a/Source/WebCore/loader/SubstituteData.h >+++ b/Source/WebCore/loader/SubstituteData.h >@@ -27,8 +27,8 @@ > > #include "ResourceResponse.h" > #include "SharedBuffer.h" >-#include "URL.h" > #include <wtf/RefPtr.h> >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/loader/appcache/ApplicationCache.h b/Source/WebCore/loader/appcache/ApplicationCache.h >index 5df5f6017ce4c03b788be98beb7b6e17bb040b6e..61317b531ccc1b0629b21dbf0a67ccfeea6cf469 100644 >--- a/Source/WebCore/loader/appcache/ApplicationCache.h >+++ b/Source/WebCore/loader/appcache/ApplicationCache.h >@@ -33,7 +33,6 @@ namespace WebCore { > class ApplicationCacheGroup; > class ApplicationCacheResource; > class ResourceRequest; >-class URL; > > using FallbackURLVector = Vector<std::pair<URL, URL>>; > >diff --git a/Source/WebCore/loader/appcache/ApplicationCacheGroup.h b/Source/WebCore/loader/appcache/ApplicationCacheGroup.h >index abaa73e14ab4b8c7abab1088dd8c238e69e2b41e..47d8934ba9914a5a56d1146a797edeb84df2dbc5 100644 >--- a/Source/WebCore/loader/appcache/ApplicationCacheGroup.h >+++ b/Source/WebCore/loader/appcache/ApplicationCacheGroup.h >@@ -27,10 +27,10 @@ > > #include "ApplicationCacheResourceLoader.h" > #include "DOMApplicationCache.h" >-#include "URL.h" > #include <wtf/Noncopyable.h> > #include <wtf/HashMap.h> > #include <wtf/HashSet.h> >+#include <wtf/URL.h> > #include <wtf/text/WTFString.h> > > namespace WebCore { >diff --git a/Source/WebCore/loader/appcache/ApplicationCacheHost.h b/Source/WebCore/loader/appcache/ApplicationCacheHost.h >index f2fb1f7832bcd80462bcab08ceba7d125b85a243..0d130a45f8af3b499042105b961039ff5fbf342f 100644 >--- a/Source/WebCore/loader/appcache/ApplicationCacheHost.h >+++ b/Source/WebCore/loader/appcache/ApplicationCacheHost.h >@@ -31,8 +31,8 @@ > > #pragma once > >-#include "URL.h" > #include <wtf/Deque.h> >+#include <wtf/URL.h> > #include <wtf/Vector.h> > > namespace WebCore { >diff --git a/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp b/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp >index 81c2321f3399c304033776d926d8e3003b6e41a5..040d8b7ad6a091eb1c9e435b5e0c3401f93ae252 100644 >--- a/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp >+++ b/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp >@@ -36,8 +36,8 @@ > #include "SQLiteTransaction.h" > #include "SecurityOrigin.h" > #include "SecurityOriginData.h" >-#include "URL.h" > #include <wtf/StdLibExtras.h> >+#include <wtf/URL.h> > #include <wtf/UUID.h> > #include <wtf/text/CString.h> > #include <wtf/text/StringBuilder.h> >diff --git a/Source/WebCore/loader/appcache/ApplicationCacheStorage.h b/Source/WebCore/loader/appcache/ApplicationCacheStorage.h >index 48cbf88e5d8903711361895ca1c132a640c7d904..68c361e52b42d91d361e9cc8290ef35c350152b5 100644 >--- a/Source/WebCore/loader/appcache/ApplicationCacheStorage.h >+++ b/Source/WebCore/loader/appcache/ApplicationCacheStorage.h >@@ -38,7 +38,6 @@ class ApplicationCache; > class ApplicationCacheGroup; > class ApplicationCacheHost; > class ApplicationCacheResource; >-class URL; > class SecurityOrigin; > class SharedBuffer; > template<typename> class StorageIDJournal; >diff --git a/Source/WebCore/loader/appcache/ManifestParser.cpp b/Source/WebCore/loader/appcache/ManifestParser.cpp >index cb481585f4a0dc3689c8e815e706ca24c4260015..84469f8ad4a94a8462e76f3d910c32e8b1412196 100644 >--- a/Source/WebCore/loader/appcache/ManifestParser.cpp >+++ b/Source/WebCore/loader/appcache/ManifestParser.cpp >@@ -27,7 +27,7 @@ > #include "ManifestParser.h" > > #include "TextResourceDecoder.h" >-#include "URL.h" >+#include <wtf/URL.h> > #include <wtf/text/StringView.h> > #include <wtf/unicode/CharacterNames.h> > >diff --git a/Source/WebCore/loader/appcache/ManifestParser.h b/Source/WebCore/loader/appcache/ManifestParser.h >index e7810893a20690ace63aec3ec88e60eaf62fc780..8fe40a64e4490aac827a61db0f4047c1ee860b14 100644 >--- a/Source/WebCore/loader/appcache/ManifestParser.h >+++ b/Source/WebCore/loader/appcache/ManifestParser.h >@@ -30,8 +30,6 @@ > > namespace WebCore { > >-class URL; >- > struct Manifest { > Vector<URL> onlineWhitelistedURLs; > HashSet<String> explicitURLs; >diff --git a/Source/WebCore/loader/archive/ArchiveResourceCollection.h b/Source/WebCore/loader/archive/ArchiveResourceCollection.h >index 37df68b366cff8539b95c823f2e9124d35ea9938..e460b69c2aed5d279dd54a0df9af010b94bc77f4 100644 >--- a/Source/WebCore/loader/archive/ArchiveResourceCollection.h >+++ b/Source/WebCore/loader/archive/ArchiveResourceCollection.h >@@ -37,7 +37,6 @@ namespace WebCore { > > class Archive; > class ArchiveResource; >-class URL; > > class ArchiveResourceCollection { > WTF_MAKE_NONCOPYABLE(ArchiveResourceCollection); >diff --git a/Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp b/Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp >index 861e3992610e0e5fc8d93967235dacef4617500e..a33a1861ace2287fed706764b9f71b15a5956ff9 100644 >--- a/Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp >+++ b/Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp >@@ -45,7 +45,6 @@ > #include "HTMLNames.h" > #include "HTMLObjectElement.h" > #include "Image.h" >-#include "URLHash.h" > #include "Logging.h" > #include "MemoryCache.h" > #include "Page.h" >@@ -57,6 +56,7 @@ > #include "markup.h" > #include <wtf/ListHashSet.h> > #include <wtf/RetainPtr.h> >+#include <wtf/URLHash.h> > #include <wtf/text/StringBuilder.h> > #include <wtf/text/CString.h> > >@@ -611,7 +611,7 @@ RefPtr<LegacyWebArchive> LegacyWebArchive::createFromSelection(Frame* frame) > // Wrap the frameset document in an iframe so it can be pasted into > // another document (which will have a body or frameset of its own). > String iframeMarkup = "<iframe frameborder=\"no\" marginwidth=\"0\" marginheight=\"0\" width=\"98%%\" height=\"98%%\" src=\"" + frame->loader().documentLoader()->response().url().string() + "\"></iframe>"; >- auto iframeResource = ArchiveResource::create(utf8Buffer(iframeMarkup), blankURL(), "text/html", "UTF-8", String()); >+ auto iframeResource = ArchiveResource::create(utf8Buffer(iframeMarkup), WTF::blankURL(), "text/html", "UTF-8", String()); > > Vector<Ref<LegacyWebArchive>> subframeArchives; > subframeArchives.reserveInitialCapacity(1); >diff --git a/Source/WebCore/loader/cache/CachedResource.cpp b/Source/WebCore/loader/cache/CachedResource.cpp >index 5e1e3f1d3cd14a46a2749a48a1939ca2d6388b4c..8f5dd206174ff486f412cedf812a980dd63dc52d 100644 >--- a/Source/WebCore/loader/cache/CachedResource.cpp >+++ b/Source/WebCore/loader/cache/CachedResource.cpp >@@ -47,11 +47,11 @@ > #include "SchemeRegistry.h" > #include "SecurityOrigin.h" > #include "SubresourceLoader.h" >-#include "URL.h" > #include <wtf/CompletionHandler.h> > #include <wtf/MathExtras.h> > #include <wtf/RefCountedLeakCounter.h> > #include <wtf/StdLibExtras.h> >+#include <wtf/URL.h> > #include <wtf/Vector.h> > #include <wtf/text/CString.h> > >diff --git a/Source/WebCore/loader/cache/CachedResourceLoader.h b/Source/WebCore/loader/cache/CachedResourceLoader.h >index 0777b17724e9b05cef5ed54a3aefc1d11467f4d7..10f69c6a10529f1fd911a1d074ef0309c0f5cbb8 100644 >--- a/Source/WebCore/loader/cache/CachedResourceLoader.h >+++ b/Source/WebCore/loader/cache/CachedResourceLoader.h >@@ -57,7 +57,6 @@ class DocumentLoader; > class Frame; > class ImageLoader; > class Settings; >-class URL; > > template <typename T> > using ResourceErrorOr = Expected<T, ResourceError>; >diff --git a/Source/WebCore/loader/cache/CachedStyleSheetClient.h b/Source/WebCore/loader/cache/CachedStyleSheetClient.h >index df46be2d377e4c1de182adaf14d739a1f97cdc02..38bb19990087c8d6661f36a3669d4c9ae3348170 100644 >--- a/Source/WebCore/loader/cache/CachedStyleSheetClient.h >+++ b/Source/WebCore/loader/cache/CachedStyleSheetClient.h >@@ -31,7 +31,6 @@ > namespace WebCore { > > class CachedCSSStyleSheet; >-class URL; > > class CachedStyleSheetClient : public CachedResourceClient { > public: >diff --git a/Source/WebCore/loader/cache/MemoryCache.h b/Source/WebCore/loader/cache/MemoryCache.h >index d716798a4ce1d97d61d313e9518b7dc2269f705c..2fcbd31985a475a30ff177f63294622f012529f8 100644 >--- a/Source/WebCore/loader/cache/MemoryCache.h >+++ b/Source/WebCore/loader/cache/MemoryCache.h >@@ -41,7 +41,6 @@ > namespace WebCore { > > class CachedResource; >-class URL; > class ResourceRequest; > class ResourceResponse; > class ScriptExecutionContext; >diff --git a/Source/WebCore/loader/icon/IconLoader.h b/Source/WebCore/loader/icon/IconLoader.h >index 6aa55374f78b6677f5709a2bd9dcb714c18ffdfa..34a0f32b4f5e8df9a6c03ef57418fc6aa851d34d 100644 >--- a/Source/WebCore/loader/icon/IconLoader.h >+++ b/Source/WebCore/loader/icon/IconLoader.h >@@ -27,9 +27,9 @@ > > #include "CachedRawResourceClient.h" > #include "CachedResourceHandle.h" >-#include "URL.h" > #include <wtf/Forward.h> > #include <wtf/Noncopyable.h> >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/loader/mac/LoaderNSURLExtras.mm b/Source/WebCore/loader/mac/LoaderNSURLExtras.mm >index f910ed5bde249ba31b8a583fc541ef7aaccc3cc0..cbe0004806cc587423d8deb0ee484a01f7e06f18 100644 >--- a/Source/WebCore/loader/mac/LoaderNSURLExtras.mm >+++ b/Source/WebCore/loader/mac/LoaderNSURLExtras.mm >@@ -30,11 +30,11 @@ > #import "config.h" > #import "LoaderNSURLExtras.h" > >-#import <wtf/Assertions.h> >-#import <wtf/Vector.h> >-#import "URL.h" > #import "LocalizedStrings.h" > #import "MIMETypeRegistry.h" >+#import <wtf/Assertions.h> >+#import <wtf/URL.h> >+#import <wtf/Vector.h> > #import <wtf/text/WTFString.h> > > using namespace WebCore; >diff --git a/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp b/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp >index 36a24e788589340f0177b75d052ee3bba5ea0b13..b7923f7832226ed53f0c91f8deda85db9d63162c 100644 >--- a/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp >+++ b/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp >@@ -41,7 +41,7 @@ > #include "Logging.h" > #include "MediaControlElements.h" > #include "TextTrackList.h" >-#include "URL.h" >+#include <wtf/URL.h> > #include "UserStyleSheetTypes.h" > #include "VTTCue.h" > #include <algorithm> >diff --git a/Source/WebCore/page/ChromeClient.h b/Source/WebCore/page/ChromeClient.h >index 568b5cd8e3a218a27be54095af1bb79b77eb1383..57f8a40a91a664ae32e5e6e0cdb34d66d6952fa1 100644 >--- a/Source/WebCore/page/ChromeClient.h >+++ b/Source/WebCore/page/ChromeClient.h >@@ -384,7 +384,7 @@ public: > virtual void enableSuddenTermination() { } > virtual void disableSuddenTermination() { } > >- virtual void contentRuleListNotification(const WebCore::URL&, const HashSet<std::pair<String, String>>&) { }; >+ virtual void contentRuleListNotification(const URL&, const HashSet<std::pair<String, String>>&) { }; > > #if PLATFORM(WIN) > virtual void setLastSetCursorToCurrentCursor() = 0; >diff --git a/Source/WebCore/page/ClientOrigin.h b/Source/WebCore/page/ClientOrigin.h >index af7ca9264a4f2f85e940c9bd1d4016dfa0992cc0..b87505a050579e3bf138502a5eff4a4552ed1c0c 100644 >--- a/Source/WebCore/page/ClientOrigin.h >+++ b/Source/WebCore/page/ClientOrigin.h >@@ -26,7 +26,7 @@ > #pragma once > > #include "SecurityOriginData.h" >-#include "URL.h" >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/page/ContextMenuClient.h b/Source/WebCore/page/ContextMenuClient.h >index 5e7c35c97718d88f841bf4180452494ad8f75192..889ee9976128d1a9667e0a50a348e512be68706f 100644 >--- a/Source/WebCore/page/ContextMenuClient.h >+++ b/Source/WebCore/page/ContextMenuClient.h >@@ -31,29 +31,28 @@ > > namespace WebCore { > >- class Frame; >- class URL; >- >- class ContextMenuClient { >- public: >- virtual ~ContextMenuClient() = default; >- virtual void contextMenuDestroyed() = 0; >- >- virtual void downloadURL(const URL& url) = 0; >- virtual void searchWithGoogle(const Frame*) = 0; >- virtual void lookUpInDictionary(Frame*) = 0; >- virtual bool isSpeaking() = 0; >- virtual void speak(const String&) = 0; >- virtual void stopSpeaking() = 0; >+class Frame; >+ >+class ContextMenuClient { >+public: >+ virtual ~ContextMenuClient() = default; >+ virtual void contextMenuDestroyed() = 0; >+ >+ virtual void downloadURL(const URL&) = 0; >+ virtual void searchWithGoogle(const Frame*) = 0; >+ virtual void lookUpInDictionary(Frame*) = 0; >+ virtual bool isSpeaking() = 0; >+ virtual void speak(const String&) = 0; >+ virtual void stopSpeaking() = 0; > > #if PLATFORM(COCOA) >- virtual void searchWithSpotlight() = 0; >+ virtual void searchWithSpotlight() = 0; > #endif > > #if USE(ACCESSIBILITY_CONTEXT_MENUS) >- virtual void showContextMenu() = 0; >+ virtual void showContextMenu() = 0; > #endif >- }; >+}; > > } // namespace WebCore > >diff --git a/Source/WebCore/page/ContextMenuController.cpp b/Source/WebCore/page/ContextMenuController.cpp >index 68126ba96e8bf17e76893e1ebaacf54940f2fbc7..a3e5eae894d6427637dd845edaade71c6151c1aa 100644 >--- a/Source/WebCore/page/ContextMenuController.cpp >+++ b/Source/WebCore/page/ContextMenuController.cpp >@@ -1336,7 +1336,7 @@ void ContextMenuController::checkOrEnableIfNeeded(ContextMenuItem& item) const > break; > case ContextMenuItemTagDownloadImageToDisk: > #if PLATFORM(MAC) >- if (WebCore::protocolIs(m_context.hitTestResult().absoluteImageURL(), "file")) >+ if (WTF::protocolIs(m_context.hitTestResult().absoluteImageURL(), "file")) > shouldEnable = false; > #endif > break; >@@ -1351,7 +1351,7 @@ void ContextMenuController::checkOrEnableIfNeeded(ContextMenuItem& item) const > item.setTitle(contextMenuItemTagDownloadVideoToDisk()); > else > item.setTitle(contextMenuItemTagDownloadAudioToDisk()); >- if (WebCore::protocolIs(m_context.hitTestResult().absoluteImageURL(), "file")) >+ if (WTF::protocolIs(m_context.hitTestResult().absoluteImageURL(), "file")) > shouldEnable = false; > break; > case ContextMenuItemTagCopyMediaLinkToClipboard: >diff --git a/Source/WebCore/page/DOMWindow.cpp b/Source/WebCore/page/DOMWindow.cpp >index 0c27b6d5f186f63255487f682f1f2a28391fc15e..11c2769b6a7953db7149ed35901cff67998ecd75 100644 >--- a/Source/WebCore/page/DOMWindow.cpp >+++ b/Source/WebCore/page/DOMWindow.cpp >@@ -101,7 +101,7 @@ > #include "StyleResolver.h" > #include "StyleScope.h" > #include "SuddenTermination.h" >-#include "URL.h" >+#include <wtf/URL.h> > #include "UserGestureIndicator.h" > #include "VisualViewport.h" > #include "WebKitPoint.h" >@@ -2186,7 +2186,7 @@ String DOMWindow::crossDomainAccessErrorMessage(const DOMWindow& activeWindow, I > > bool DOMWindow::isInsecureScriptAccess(DOMWindow& activeWindow, const String& urlString) > { >- if (!protocolIsJavaScript(urlString)) >+ if (!WTF::protocolIsJavaScript(urlString)) > return false; > > // If this DOMWindow isn't currently active in the Frame, then there's no >diff --git a/Source/WebCore/page/DragController.cpp b/Source/WebCore/page/DragController.cpp >index 756213651c4f4db5f7b573df2d7fd5eef06a4e66..9ee3d468964fc8d4f6a3e4cb4db05e1db720cd69 100644 >--- a/Source/WebCore/page/DragController.cpp >+++ b/Source/WebCore/page/DragController.cpp >@@ -1069,7 +1069,7 @@ bool DragController::startDrag(Frame& src, const DragState& state, DragOperation > if (mustUseLegacyDragClient) > src.editor().copyURL(linkURL, textContentWithSimplifiedWhiteSpace, dataTransfer.pasteboard()); > else >- pasteboardWriterData.setURL(src.editor().pasteboardWriterURL(linkURL, textContentWithSimplifiedWhiteSpace)); >+ pasteboardWriterData.setURLData(src.editor().pasteboardWriterURL(linkURL, textContentWithSimplifiedWhiteSpace)); > } else { > // Make sure the pasteboard also contains trustworthy link data > // but don't overwrite more general pasteboard types. >diff --git a/Source/WebCore/page/DragController.h b/Source/WebCore/page/DragController.h >index c02d5c8016c65b3d5ef9356c82be7d572b979a94..8435283cdfcb11a862d9fccc66f3043f2c57a934 100644 >--- a/Source/WebCore/page/DragController.h >+++ b/Source/WebCore/page/DragController.h >@@ -29,7 +29,7 @@ > #include "DragImage.h" > #include "IntPoint.h" > #include "IntRect.h" >-#include "URL.h" >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/page/EventSource.h b/Source/WebCore/page/EventSource.h >index 3792a9126f1d30affe37be1c2a6dac78216a729a..58a4c38749e950b478cf87068a2639310adef09a 100644 >--- a/Source/WebCore/page/EventSource.h >+++ b/Source/WebCore/page/EventSource.h >@@ -34,7 +34,7 @@ > #include "ActiveDOMObject.h" > #include "EventTarget.h" > #include "ExceptionOr.h" >-#include "URL.h" >+#include <wtf/URL.h> > #include "ThreadableLoaderClient.h" > #include "Timer.h" > #include <wtf/Vector.h> >diff --git a/Source/WebCore/page/Frame.h b/Source/WebCore/page/Frame.h >index b747fd6c6e4032368c06b7ec87c564008a279d53..9faf2437f5721e96a2582127e2eae2643db9b71e 100644 >--- a/Source/WebCore/page/Frame.h >+++ b/Source/WebCore/page/Frame.h >@@ -89,7 +89,6 @@ class RenderWidget; > class ScriptController; > class SecurityOrigin; > class Settings; >-class URL; > class VisiblePosition; > class Widget; > >diff --git a/Source/WebCore/page/FrameView.h b/Source/WebCore/page/FrameView.h >index e44977670e61347ccdfe3e23f1bf80fcd8e38a7e..d45e75d54d486f90d60b11c86a46c883ad7c4002 100644 >--- a/Source/WebCore/page/FrameView.h >+++ b/Source/WebCore/page/FrameView.h >@@ -53,7 +53,6 @@ class Element; > class FloatSize; > class Frame; > class HTMLFrameOwnerElement; >-class URL; > class Node; > class Page; > class RenderBox; >diff --git a/Source/WebCore/page/History.h b/Source/WebCore/page/History.h >index 87a0f3d17878d17111184a2642092fc7ff510a02..d6e934ab00219d41b77f5f98aa918eed08a0697e 100644 >--- a/Source/WebCore/page/History.h >+++ b/Source/WebCore/page/History.h >@@ -35,7 +35,6 @@ > namespace WebCore { > > class Document; >-class URL; > > class History final : public ScriptWrappable, public RefCounted<History>, public DOMWindowProperty { > public: >diff --git a/Source/WebCore/page/Location.cpp b/Source/WebCore/page/Location.cpp >index 4e487ec1ef511699388bd70d1e4babb99999d9dd..1640cfc123ba3762ab56c07fc8e3111f4732a7fb 100644 >--- a/Source/WebCore/page/Location.cpp >+++ b/Source/WebCore/page/Location.cpp >@@ -34,7 +34,7 @@ > #include "Frame.h" > #include "FrameLoader.h" > #include "NavigationScheduler.h" >-#include "URL.h" >+#include <wtf/URL.h> > #include "SecurityOrigin.h" > > namespace WebCore { >@@ -47,11 +47,11 @@ Location::Location(DOMWindow& window) > inline const URL& Location::url() const > { > if (!frame()) >- return blankURL(); >+ return WTF::blankURL(); > > const URL& url = frame()->document()->url(); > if (!url.isValid()) >- return blankURL(); // Use "about:blank" while the page is still loading (before we have a frame). >+ return WTF::blankURL(); // Use "about:blank" while the page is still loading (before we have a frame). > > return url; > } >@@ -258,7 +258,7 @@ void Location::reload(DOMWindow& activeWindow) > return; > } > >- if (protocolIsJavaScript(targetDocument.url())) >+ if (WTF::protocolIsJavaScript(targetDocument.url())) > return; > > frame->navigationScheduler().scheduleRefresh(activeDocument); >diff --git a/Source/WebCore/page/Location.h b/Source/WebCore/page/Location.h >index 69691bc61a7ad7cb8a0b3a3a7fefb9b768676da6..80d5d90c6b3b73a58494bce49264fbde70ad952c 100644 >--- a/Source/WebCore/page/Location.h >+++ b/Source/WebCore/page/Location.h >@@ -36,7 +36,6 @@ > namespace WebCore { > > class DOMWindow; >-class URL; > > class Location : public ScriptWrappable, public RefCounted<Location>, public DOMWindowProperty { > public: >diff --git a/Source/WebCore/page/Page.h b/Source/WebCore/page/Page.h >index 3dbe572cd32903d5fcbd6c37e051bceb10723e7e..cb2e38f3289ab6871775a0cfaab7c29213df38fd 100644 >--- a/Source/WebCore/page/Page.h >+++ b/Source/WebCore/page/Page.h >@@ -136,7 +136,6 @@ class Settings; > class SocketProvider; > class StorageNamespace; > class StorageNamespaceProvider; >-class URL; > class UserContentProvider; > class ValidationMessageClient; > class ActivityStateChangeObserver; >diff --git a/Source/WebCore/page/PageSerializer.h b/Source/WebCore/page/PageSerializer.h >index 3b6e1829e28c35a39e4a16b5f088e61c3c46ed8a..ff3e2e1fcb061a4fffc5defd4c2d180af49bf771 100644 >--- a/Source/WebCore/page/PageSerializer.h >+++ b/Source/WebCore/page/PageSerializer.h >@@ -30,11 +30,11 @@ > > #pragma once > >-#include "URLHash.h" > #include "SharedBuffer.h" > #include <wtf/Forward.h> > #include <wtf/HashMap.h> > #include <wtf/ListHashSet.h> >+#include <wtf/URLHash.h> > > namespace WebCore { > >diff --git a/Source/WebCore/page/Performance.h b/Source/WebCore/page/Performance.h >index a62cb2ed52f786ea2e7b3f526d076d119ff4b587..9e598765dcecc4aaec256c66b9949377f41fd28b 100644 >--- a/Source/WebCore/page/Performance.h >+++ b/Source/WebCore/page/Performance.h >@@ -49,7 +49,6 @@ class PerformanceTiming; > class ResourceResponse; > class ResourceTiming; > class ScriptExecutionContext; >-class URL; > class UserTiming; > > class Performance final : public RefCounted<Performance>, public ContextDestructionObserver, public EventTargetWithInlineData { >diff --git a/Source/WebCore/page/PerformanceResourceTiming.cpp b/Source/WebCore/page/PerformanceResourceTiming.cpp >index 57533580c3021eae66de319089d8e4b1bc103f9d..7b7d87a458fba0e739d2c4209cf8242bbd874907 100644 >--- a/Source/WebCore/page/PerformanceResourceTiming.cpp >+++ b/Source/WebCore/page/PerformanceResourceTiming.cpp >@@ -38,7 +38,7 @@ > #include "LoadTiming.h" > #include "ResourceResponse.h" > #include "ResourceTiming.h" >-#include "URL.h" >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/page/SecurityOrigin.cpp b/Source/WebCore/page/SecurityOrigin.cpp >index e6d07341489aecf96de2b560edad782e4a135cf1..d98a061e552222a406faae0f1c113c12c65954f3 100644 >--- a/Source/WebCore/page/SecurityOrigin.cpp >+++ b/Source/WebCore/page/SecurityOrigin.cpp >@@ -31,7 +31,7 @@ > > #include "BlobURL.h" > #include "FileSystem.h" >-#include "URL.h" >+#include <wtf/URL.h> > #include "SchemeRegistry.h" > #include "SecurityPolicy.h" > #include "TextEncoding.h" >@@ -148,7 +148,7 @@ SecurityOrigin::SecurityOrigin(const URL& url) > // document.domain starts as m_data.host, but can be set by the DOM. > m_domain = m_data.host; > >- if (m_data.port && isDefaultPortForProtocol(m_data.port.value(), m_data.protocol)) >+ if (m_data.port && WTF::isDefaultPortForProtocol(m_data.port.value(), m_data.protocol)) > m_data.port = std::nullopt; > > // By default, only local SecurityOrigins can load local resources. >@@ -516,7 +516,7 @@ Ref<SecurityOrigin> SecurityOrigin::create(const String& protocol, const String& > { > String decodedHost = decodeURLEscapeSequences(host); > auto origin = create(URL(URL(), protocol + "://" + host + "/")); >- if (port && !isDefaultPortForProtocol(*port, protocol)) >+ if (port && !WTF::isDefaultPortForProtocol(*port, protocol)) > origin->m_data.port = port; > return origin; > } >diff --git a/Source/WebCore/page/SecurityOrigin.h b/Source/WebCore/page/SecurityOrigin.h >index 5adf501749b09c293e59ba40456f767cb56e08e1..b93d0faf235a7fe35476509f6e437d54405cc120 100644 >--- a/Source/WebCore/page/SecurityOrigin.h >+++ b/Source/WebCore/page/SecurityOrigin.h >@@ -34,8 +34,6 @@ > > namespace WebCore { > >-class URL; >- > class SecurityOrigin : public ThreadSafeRefCounted<SecurityOrigin> { > public: > enum Policy { >diff --git a/Source/WebCore/page/SecurityOriginData.h b/Source/WebCore/page/SecurityOriginData.h >index ceffea32b084c563124f20b7c5fe28f149040475..27762ea21d6d2065e9dd0146db979b332ec456c0 100644 >--- a/Source/WebCore/page/SecurityOriginData.h >+++ b/Source/WebCore/page/SecurityOriginData.h >@@ -25,7 +25,7 @@ > > #pragma once > >-#include "URL.h" >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/page/SecurityOriginHash.h b/Source/WebCore/page/SecurityOriginHash.h >index ee2572c5a9a6443957a5f3f753f46e2fba922340..e0148a2d05d99b0dddf06a23d246d53452cb2c13 100644 >--- a/Source/WebCore/page/SecurityOriginHash.h >+++ b/Source/WebCore/page/SecurityOriginHash.h >@@ -28,7 +28,7 @@ > > #pragma once > >-#include "URL.h" >+#include <wtf/URL.h> > #include "SecurityOrigin.h" > #include <wtf/RefPtr.h> > >diff --git a/Source/WebCore/page/SecurityPolicy.cpp b/Source/WebCore/page/SecurityPolicy.cpp >index 153edd819d125555568876566de31f98b6c0553b..423418280ea2ee3c9bfdfc91cd127b968eb1e1bf 100644 >--- a/Source/WebCore/page/SecurityPolicy.cpp >+++ b/Source/WebCore/page/SecurityPolicy.cpp >@@ -31,11 +31,11 @@ > > #include "OriginAccessEntry.h" > #include "SecurityOrigin.h" >-#include "URL.h" > #include <memory> > #include <wtf/HashMap.h> > #include <wtf/MainThread.h> > #include <wtf/NeverDestroyed.h> >+#include <wtf/URL.h> > #include <wtf/text/StringHash.h> > > namespace WebCore { >@@ -142,7 +142,7 @@ bool SecurityPolicy::shouldInheritSecurityOriginFromOwner(const URL& url) > // > // Note: We generalize this to invalid URLs because we treat such URLs as about:blank. > // >- return url.isEmpty() || equalIgnoringASCIICase(url.string(), blankURL()) || equalLettersIgnoringASCIICase(url.string(), "about:srcdoc"); >+ return url.isEmpty() || equalIgnoringASCIICase(url.string(), WTF::blankURL()) || equalLettersIgnoringASCIICase(url.string(), "about:srcdoc"); > } > > void SecurityPolicy::setLocalLoadPolicy(LocalLoadPolicy policy) >diff --git a/Source/WebCore/page/SecurityPolicy.h b/Source/WebCore/page/SecurityPolicy.h >index cd37ca3ad2dfdbd7e672351fa543eef49e82b4f4..533b1d4fbdad52e38f1fd35a2f6a07d48008b17e 100644 >--- a/Source/WebCore/page/SecurityPolicy.h >+++ b/Source/WebCore/page/SecurityPolicy.h >@@ -34,7 +34,6 @@ > namespace WebCore { > > class SecurityOrigin; >-class URL; > > class SecurityPolicy { > public: >diff --git a/Source/WebCore/page/SettingsBase.h b/Source/WebCore/page/SettingsBase.h >index fb143161546fd2f639e40ae167a15b725f612719..d6471c24d9ebc70da937afab59bcbad01e119dfd 100644 >--- a/Source/WebCore/page/SettingsBase.h >+++ b/Source/WebCore/page/SettingsBase.h >@@ -34,7 +34,7 @@ > #include "StorageMap.h" > #include "TextFlags.h" > #include "Timer.h" >-#include "URL.h" >+#include <wtf/URL.h> > #include "WritingMode.h" > #include <JavaScriptCore/RuntimeFlags.h> > #include <unicode/uscript.h> >diff --git a/Source/WebCore/page/ShareData.h b/Source/WebCore/page/ShareData.h >index a2fd3ef12472dd4a1c33aa4061f9fc49f4b1635b..44d0a33f393c83a85a7e36a24d886e3efb57a1a3 100644 >--- a/Source/WebCore/page/ShareData.h >+++ b/Source/WebCore/page/ShareData.h >@@ -24,7 +24,7 @@ > */ > > #pragma once >-#include "URL.h" >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/page/SocketProvider.h b/Source/WebCore/page/SocketProvider.h >index d197977afeb820aa412e2c34fa54721638490e72..9e8c003bff51e1a5cc96d2e473e7aeeeedbda8ff 100644 >--- a/Source/WebCore/page/SocketProvider.h >+++ b/Source/WebCore/page/SocketProvider.h >@@ -34,7 +34,6 @@ namespace WebCore { > class ScriptExecutionContext; > class SocketStreamHandle; > class SocketStreamHandleClient; >-class URL; > > class WEBCORE_EXPORT SocketProvider : public ThreadSafeRefCounted<SocketProvider> { > public: >diff --git a/Source/WebCore/page/UserContentProvider.h b/Source/WebCore/page/UserContentProvider.h >index 28dfb32a076e6512ecf924f0145220eeae49c472..fa692034dbae5fd79fe819789a7321ebe4b0dedd 100644 >--- a/Source/WebCore/page/UserContentProvider.h >+++ b/Source/WebCore/page/UserContentProvider.h >@@ -42,7 +42,6 @@ class DOMWrapperWorld; > class DocumentLoader; > class Page; > class ResourceRequest; >-class URL; > class UserMessageHandlerDescriptor; > class UserScript; > class UserStyleSheet; >diff --git a/Source/WebCore/page/UserContentURLPattern.cpp b/Source/WebCore/page/UserContentURLPattern.cpp >index b9b8115827b78f5273095c2c3e1518bf43f43e90..f373cf37b24c50fc21dc6dc471ab08ed4ec5091c 100644 >--- a/Source/WebCore/page/UserContentURLPattern.cpp >+++ b/Source/WebCore/page/UserContentURLPattern.cpp >@@ -26,9 +26,9 @@ > #include "config.h" > #include "UserContentURLPattern.h" > >-#include "URL.h" > #include <wtf/NeverDestroyed.h> > #include <wtf/StdLibExtras.h> >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/page/UserContentURLPattern.h b/Source/WebCore/page/UserContentURLPattern.h >index 933f69d6c5a60e6ed728ba080eee84f5480df2d6..93f65812dac5de8ad5fcdb670d8d2f9e869781f3 100644 >--- a/Source/WebCore/page/UserContentURLPattern.h >+++ b/Source/WebCore/page/UserContentURLPattern.h >@@ -30,8 +30,6 @@ > > namespace WebCore { > >-class URL; >- > class UserContentURLPattern { > public: > UserContentURLPattern() : m_invalid(true), m_matchSubdomains(false) { } >diff --git a/Source/WebCore/page/UserScript.h b/Source/WebCore/page/UserScript.h >index 8510c1f339901e995f320ccc9bf719b2e49ae427..52c12f3c6966302aaef455b8fefbc99ebda584cd 100644 >--- a/Source/WebCore/page/UserScript.h >+++ b/Source/WebCore/page/UserScript.h >@@ -25,7 +25,7 @@ > > #pragma once > >-#include "URL.h" >+#include <wtf/URL.h> > #include "UserContentTypes.h" > #include "UserScriptTypes.h" > #include <wtf/Vector.h> >diff --git a/Source/WebCore/page/UserStyleSheet.h b/Source/WebCore/page/UserStyleSheet.h >index 68f10a82adf898f252c41559cb1678aec8c50841..c474767e7c98bb48a883cb73b698905f601d7601 100644 >--- a/Source/WebCore/page/UserStyleSheet.h >+++ b/Source/WebCore/page/UserStyleSheet.h >@@ -25,7 +25,7 @@ > > #pragma once > >-#include "URL.h" >+#include <wtf/URL.h> > #include "UserContentTypes.h" > #include "UserStyleSheetTypes.h" > #include <wtf/Vector.h> >diff --git a/Source/WebCore/page/VisitedLinkStore.h b/Source/WebCore/page/VisitedLinkStore.h >index 43c351372d618b68109b0fb8ccd69fc85f8bdd78..26d650dba74dc502cf9309a3f3d1c05da6b649b3 100644 >--- a/Source/WebCore/page/VisitedLinkStore.h >+++ b/Source/WebCore/page/VisitedLinkStore.h >@@ -33,7 +33,6 @@ namespace WebCore { > > typedef uint64_t SharedStringHash; > class Page; >-class URL; > > class VisitedLinkStore : public RefCounted<VisitedLinkStore> { > public: >diff --git a/Source/WebCore/page/csp/ContentSecurityPolicy.h b/Source/WebCore/page/csp/ContentSecurityPolicy.h >index 5b592fd828f97f94c23ae334968a5ab47d96c163..e02a7ab6c59bfcf5b99e648ffc6c7e2544cffe35 100644 >--- a/Source/WebCore/page/csp/ContentSecurityPolicy.h >+++ b/Source/WebCore/page/csp/ContentSecurityPolicy.h >@@ -56,7 +56,6 @@ class ResourceRequest; > class ScriptExecutionContext; > class SecurityOrigin; > class TextEncoding; >-class URL; > struct ContentSecurityPolicyClient; > > typedef Vector<std::unique_ptr<ContentSecurityPolicyDirectiveList>> CSPDirectiveListVector; >diff --git a/Source/WebCore/page/csp/ContentSecurityPolicyClient.h b/Source/WebCore/page/csp/ContentSecurityPolicyClient.h >index eb4fe87c29f1cab118bd1b0dbe6763cb104f3230..8e05182641406f2cc8caa2dc56ae3360634e6b1e 100644 >--- a/Source/WebCore/page/csp/ContentSecurityPolicyClient.h >+++ b/Source/WebCore/page/csp/ContentSecurityPolicyClient.h >@@ -32,7 +32,6 @@ > namespace WebCore { > > class FormData; >-class URL; > > struct CSPInfo { > String documentURI; >diff --git a/Source/WebCore/page/csp/ContentSecurityPolicyDirectiveList.h b/Source/WebCore/page/csp/ContentSecurityPolicyDirectiveList.h >index 2907250f0eb1dc4fd08fb2072c68337b28d7b026..dd51300ec3b00331f33bd02737a158c2aac62146 100644 >--- a/Source/WebCore/page/csp/ContentSecurityPolicyDirectiveList.h >+++ b/Source/WebCore/page/csp/ContentSecurityPolicyDirectiveList.h >@@ -30,7 +30,7 @@ > #include "ContentSecurityPolicyHash.h" > #include "ContentSecurityPolicyMediaListDirective.h" > #include "ContentSecurityPolicySourceListDirective.h" >-#include "URL.h" >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/page/csp/ContentSecurityPolicySource.cpp b/Source/WebCore/page/csp/ContentSecurityPolicySource.cpp >index a0710dcc2a9134af068ccef9806bc94e26dbfad1..c82f856c2c7822dd645e32b171cf343798154ad4 100644 >--- a/Source/WebCore/page/csp/ContentSecurityPolicySource.cpp >+++ b/Source/WebCore/page/csp/ContentSecurityPolicySource.cpp >@@ -30,7 +30,7 @@ > #include "ContentSecurityPolicy.h" > #include "SecurityOriginData.h" > #include "TextEncoding.h" >-#include "URL.h" >+#include <wtf/URL.h> > > namespace WebCore { > >@@ -101,14 +101,14 @@ bool ContentSecurityPolicySource::portMatches(const URL& url) const > if (port == m_port) > return true; > >- if ((m_port && isDefaultPortForProtocol(m_port.value(), "http")) && ((!port && url.protocolIs("https")) || (port && isDefaultPortForProtocol(port.value(), "https")))) >+ if ((m_port && WTF::isDefaultPortForProtocol(m_port.value(), "http")) && ((!port && url.protocolIs("https")) || (port && WTF::isDefaultPortForProtocol(port.value(), "https")))) > return true; > > if (!port) >- return isDefaultPortForProtocol(m_port.value(), url.protocol()); >+ return WTF::isDefaultPortForProtocol(m_port.value(), url.protocol()); > > if (!m_port) >- return isDefaultPortForProtocol(port.value(), url.protocol()); >+ return WTF::isDefaultPortForProtocol(port.value(), url.protocol()); > > return false; > } >diff --git a/Source/WebCore/page/csp/ContentSecurityPolicySource.h b/Source/WebCore/page/csp/ContentSecurityPolicySource.h >index 4eeabb01365251b6d89633ca9680d015f23106aa..a2db5043898f2e6947bc7b0a2dd6443ab51438d0 100644 >--- a/Source/WebCore/page/csp/ContentSecurityPolicySource.h >+++ b/Source/WebCore/page/csp/ContentSecurityPolicySource.h >@@ -31,7 +31,6 @@ > namespace WebCore { > > class ContentSecurityPolicy; >-class URL; > struct SecurityOriginData; > > class ContentSecurityPolicySource { >diff --git a/Source/WebCore/page/csp/ContentSecurityPolicySourceList.cpp b/Source/WebCore/page/csp/ContentSecurityPolicySourceList.cpp >index 1b433126600a501f95f5e63b42dd4cdddd9579b2..26da91153764aff7048678e627f72fc4c7981d5c 100644 >--- a/Source/WebCore/page/csp/ContentSecurityPolicySourceList.cpp >+++ b/Source/WebCore/page/csp/ContentSecurityPolicySourceList.cpp >@@ -31,9 +31,9 @@ > #include "ContentSecurityPolicyDirectiveNames.h" > #include "ParsingUtilities.h" > #include "TextEncoding.h" >-#include "URL.h" > #include <wtf/ASCIICType.h> > #include <wtf/NeverDestroyed.h> >+#include <wtf/URL.h> > #include <wtf/text/Base64.h> > > namespace WebCore { >diff --git a/Source/WebCore/page/csp/ContentSecurityPolicySourceList.h b/Source/WebCore/page/csp/ContentSecurityPolicySourceList.h >index 9f63c3006a0ca7f2e33994801b542c36668c2e54..5fcf3b2eae4a9e5f84810bd53c455524407726fd 100644 >--- a/Source/WebCore/page/csp/ContentSecurityPolicySourceList.h >+++ b/Source/WebCore/page/csp/ContentSecurityPolicySourceList.h >@@ -36,7 +36,6 @@ > namespace WebCore { > > class ContentSecurityPolicy; >-class URL; > > class ContentSecurityPolicySourceList { > public: >diff --git a/Source/WebCore/page/csp/ContentSecurityPolicySourceListDirective.cpp b/Source/WebCore/page/csp/ContentSecurityPolicySourceListDirective.cpp >index c2bf1d45a55f577fa2d3fb600b2ac9f3ff0ca1e4..1b092b84fd0bf7d66f8e1aafe0f1bac5336ae65e 100644 >--- a/Source/WebCore/page/csp/ContentSecurityPolicySourceListDirective.cpp >+++ b/Source/WebCore/page/csp/ContentSecurityPolicySourceListDirective.cpp >@@ -29,7 +29,7 @@ > > #include "ContentSecurityPolicy.h" > #include "ContentSecurityPolicyDirectiveList.h" >-#include "URL.h" >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/platform/ContentFilterUnblockHandler.h b/Source/WebCore/platform/ContentFilterUnblockHandler.h >index 9048dbd1e09d8ec7abf37f9b7ce8ffdbbaad88c6..fdf1fd79231a02dfd4d34b0cc2ea946a193b593c 100644 >--- a/Source/WebCore/platform/ContentFilterUnblockHandler.h >+++ b/Source/WebCore/platform/ContentFilterUnblockHandler.h >@@ -23,14 +23,13 @@ > * THE POSSIBILITY OF SUCH DAMAGE. > */ > >-#ifndef ContentFilterUnblockHandler_h >-#define ContentFilterUnblockHandler_h >+#pragma once > > #if ENABLE(CONTENT_FILTERING) > >-#include "URL.h" > #include <functional> > #include <wtf/RetainPtr.h> >+#include <wtf/URL.h> > #include <wtf/text/WTFString.h> > > OBJC_CLASS NSCoder; >@@ -77,5 +76,3 @@ private: > } // namespace WebCore > > #endif // ENABLE(CONTENT_FILTERING) >- >-#endif // ContentFilterUnblockHandler_h >diff --git a/Source/WebCore/platform/ContextMenuItem.h b/Source/WebCore/platform/ContextMenuItem.h >index 476a3c36b95bdb187bb58932e003bd11ef32b406..1b0f7450b4572d56a913e5c1e7aa573984948d10 100644 >--- a/Source/WebCore/platform/ContextMenuItem.h >+++ b/Source/WebCore/platform/ContextMenuItem.h >@@ -33,7 +33,6 @@ namespace WebCore { > > class ContextMenu; > class Image; >-class URL; > > enum ContextMenuAction { > ContextMenuItemTagNoAction, >diff --git a/Source/WebCore/platform/Cookie.h b/Source/WebCore/platform/Cookie.h >index d5a0288d0c33d4ca3b01e52819a9b685e39f77a5..16ca9639db4974fde34b73b58d46dfd9091916c4 100644 >--- a/Source/WebCore/platform/Cookie.h >+++ b/Source/WebCore/platform/Cookie.h >@@ -26,7 +26,7 @@ > > #pragma once > >-#include "URL.h" >+#include <wtf/URL.h> > #include <wtf/text/StringHash.h> > #include <wtf/text/WTFString.h> > >diff --git a/Source/WebCore/platform/CookiesStrategy.h b/Source/WebCore/platform/CookiesStrategy.h >index 4c3069a020166ab735f41d88bb68f64020cbded6..8a5c594830c07d61c900bb2ea784878141770abf 100644 >--- a/Source/WebCore/platform/CookiesStrategy.h >+++ b/Source/WebCore/platform/CookiesStrategy.h >@@ -32,7 +32,6 @@ > namespace WebCore { > > class NetworkStorageSession; >-class URL; > > struct Cookie; > struct SameSiteInfo; >diff --git a/Source/WebCore/platform/DragData.h b/Source/WebCore/platform/DragData.h >index 1a4a45f805cc506ab9f191f8061578704ff49206..e93095fc7b2a0b136d46616d0220cceba399a034 100644 >--- a/Source/WebCore/platform/DragData.h >+++ b/Source/WebCore/platform/DragData.h >@@ -56,8 +56,6 @@ typedef void* DragDataRef; > > namespace WebCore { > >-class URL; >- > enum DragApplicationFlags { > DragApplicationNone = 0, > DragApplicationIsModal = 1, >diff --git a/Source/WebCore/platform/DragImage.h b/Source/WebCore/platform/DragImage.h >index a113b48c247b86fc1867c865abf46df4579eb7f5..b28c5e04f46c3d3a682acc5a4dc2f2698231d20b 100644 >--- a/Source/WebCore/platform/DragImage.h >+++ b/Source/WebCore/platform/DragImage.h >@@ -57,7 +57,6 @@ class Image; > class IntRect; > class Node; > class Range; >-class URL; > > #if PLATFORM(IOS_FAMILY) > typedef RetainPtr<CGImageRef> DragImageRef; >diff --git a/Source/WebCore/platform/FileStream.h b/Source/WebCore/platform/FileStream.h >index 967dedc7ba6ecf4292df19cfc18851d166b3aa5f..b2aa284479f7b1226ebf7aaa9b7fdcac30c33761 100644 >--- a/Source/WebCore/platform/FileStream.h >+++ b/Source/WebCore/platform/FileStream.h >@@ -35,8 +35,6 @@ > > namespace WebCore { > >-class URL; >- > // All methods are synchronous. > class FileStream { > public: >diff --git a/Source/WebCore/platform/LinkIcon.h b/Source/WebCore/platform/LinkIcon.h >index 28175460359adff7a0cf2fe1eb7ff4134c577e59..89e2f8969bb526a364db6b90e30a9b771cde586a 100644 >--- a/Source/WebCore/platform/LinkIcon.h >+++ b/Source/WebCore/platform/LinkIcon.h >@@ -26,9 +26,9 @@ > #pragma once > > #include "LinkIconType.h" >-#include "URL.h" > #include <wtf/HashMap.h> > #include <wtf/Optional.h> >+#include <wtf/URL.h> > #include <wtf/text/WTFString.h> > > namespace WebCore { >diff --git a/Source/WebCore/platform/Pasteboard.cpp b/Source/WebCore/platform/Pasteboard.cpp >index 737a3904257de643bc0d9ab99bc264a314fd6ff7..555ec282e4bb66e5f9d11120b9761a725ebc3f34 100644 >--- a/Source/WebCore/platform/Pasteboard.cpp >+++ b/Source/WebCore/platform/Pasteboard.cpp >@@ -30,7 +30,7 @@ > #include "PlatformStrategies.h" > #include "Settings.h" > #include "SharedBuffer.h" >-#include "URLParser.h" >+#include <wtf/URLParser.h> > #include <wtf/persistence/PersistentCoders.h> > #include <wtf/text/StringHash.h> > >@@ -47,7 +47,7 @@ bool Pasteboard::isSafeTypeForDOMToReadAndWrite(const String& type) > > bool Pasteboard::canExposeURLToDOMWhenPasteboardContainsFiles(const String& urlString) > { >- auto url = URLParser { urlString }.result(); >+ URL url({ }, urlString); > return url.protocolIsInHTTPFamily() || url.protocolIsBlob() || url.protocolIsData(); > } > >diff --git a/Source/WebCore/platform/Pasteboard.h b/Source/WebCore/platform/Pasteboard.h >index 0d3e73ea08963d4982a3fb4708d3ee28e6efa63a..c59b842ba9367929643c024544bd2f67f2604625 100644 >--- a/Source/WebCore/platform/Pasteboard.h >+++ b/Source/WebCore/platform/Pasteboard.h >@@ -27,10 +27,10 @@ > > #include "DragImage.h" > #include "PasteboardItemInfo.h" >-#include "URL.h" > #include <wtf/HashMap.h> > #include <wtf/ListHashSet.h> > #include <wtf/Noncopyable.h> >+#include <wtf/URL.h> > #include <wtf/Vector.h> > #include <wtf/text/WTFString.h> > >diff --git a/Source/WebCore/platform/PasteboardStrategy.h b/Source/WebCore/platform/PasteboardStrategy.h >index b14d54aa9a90db95c989e5d2ab38ef621f7e43bb..1e9b880fd1a5e1852530ab935cce0d875c63d957 100644 >--- a/Source/WebCore/platform/PasteboardStrategy.h >+++ b/Source/WebCore/platform/PasteboardStrategy.h >@@ -33,7 +33,6 @@ namespace WebCore { > class Color; > class SelectionData; > class SharedBuffer; >-class URL; > struct PasteboardImage; > struct PasteboardItemInfo; > struct PasteboardURL; >diff --git a/Source/WebCore/platform/PasteboardWriterData.cpp b/Source/WebCore/platform/PasteboardWriterData.cpp >index 3d2dceed7c56e87096789807a67bee2ed032927f..e2569074ee5a2b3ef6c20e8be48dfe757a8069fd 100644 >--- a/Source/WebCore/platform/PasteboardWriterData.cpp >+++ b/Source/WebCore/platform/PasteboardWriterData.cpp >@@ -48,7 +48,7 @@ void PasteboardWriterData::setPlainText(PlainText plainText) > m_plainText = WTFMove(plainText); > } > >-void PasteboardWriterData::setURL(URL url) >+void PasteboardWriterData::setURLData(URLData url) > { > ASSERT(!m_url); > >diff --git a/Source/WebCore/platform/PasteboardWriterData.h b/Source/WebCore/platform/PasteboardWriterData.h >index d53fd72ff5e6c44e0a16e77f391dafcd8465020a..5f47592b1019511911797688e78550f48bbed56f 100644 >--- a/Source/WebCore/platform/PasteboardWriterData.h >+++ b/Source/WebCore/platform/PasteboardWriterData.h >@@ -25,8 +25,8 @@ > > #pragma once > >-#include "URL.h" > #include <wtf/Optional.h> >+#include <wtf/URL.h> > #include <wtf/text/WTFString.h> > > namespace WebCore { >@@ -66,8 +66,8 @@ public: > const std::optional<PlainText>& plainText() const { return m_plainText; } > void setPlainText(PlainText); > >- struct URL { >- WebCore::URL url; >+ struct URLData { >+ URL url; > String title; > #if PLATFORM(MAC) > String userVisibleForm; >@@ -76,15 +76,15 @@ public: > #endif > }; > >- const std::optional<URL>& url() const { return m_url; } >- void setURL(URL); >+ const std::optional<URLData>& urlData() const { return m_url; } >+ void setURLData(URLData); > > const std::optional<WebContent>& webContent() const { return m_webContent; } > void setWebContent(WebContent); > > private: > std::optional<PlainText> m_plainText; >- std::optional<URL> m_url; >+ std::optional<URLData> m_url; > std::optional<WebContent> m_webContent; > }; > >diff --git a/Source/WebCore/platform/PlatformPasteboard.h b/Source/WebCore/platform/PlatformPasteboard.h >index 7e0b76c3ed10b727bacb5a96300cc7a28692c26f..c35f08ecd6458778395d835a3426abd3fcf5f8ba 100644 >--- a/Source/WebCore/platform/PlatformPasteboard.h >+++ b/Source/WebCore/platform/PlatformPasteboard.h >@@ -48,7 +48,6 @@ namespace WebCore { > class Color; > class SelectionData; > class SharedBuffer; >-class URL; > struct PasteboardCustomData; > struct PasteboardImage; > struct PasteboardItemInfo; >diff --git a/Source/WebCore/platform/PromisedAttachmentInfo.h b/Source/WebCore/platform/PromisedAttachmentInfo.h >index dbecfc1b3b16d7f5e0308e110acda1102cb4207e..a958c2f0ab2d9f1f37662a7a0b602be3134307b5 100644 >--- a/Source/WebCore/platform/PromisedAttachmentInfo.h >+++ b/Source/WebCore/platform/PromisedAttachmentInfo.h >@@ -31,7 +31,6 @@ > namespace WebCore { > > class SharedBuffer; >-class URL; > > struct PromisedAttachmentInfo { > URL blobURL; >diff --git a/Source/WebCore/platform/SSLKeyGenerator.h b/Source/WebCore/platform/SSLKeyGenerator.h >index 07672386f68eaa981fe7c597c05f61ef8e673ce4..c2bd8d6e9d3aa93e246024862c1f3b22f45a4843 100644 >--- a/Source/WebCore/platform/SSLKeyGenerator.h >+++ b/Source/WebCore/platform/SSLKeyGenerator.h >@@ -31,8 +31,6 @@ > > namespace WebCore { > >-class URL; >- > // Returns strings representing key sizes that may be used > // for the <keygen> tag. The first string is displayed as the default > // key size in the <keygen> menu. >diff --git a/Source/WebCore/platform/SchemeRegistry.cpp b/Source/WebCore/platform/SchemeRegistry.cpp >index 949de63aef06cfcfaf0c02d24c6ac44e66fe0b97..77f6c392a917f0c9172665a7618e670438c4e4bd 100644 >--- a/Source/WebCore/platform/SchemeRegistry.cpp >+++ b/Source/WebCore/platform/SchemeRegistry.cpp >@@ -26,11 +26,11 @@ > #include "config.h" > #include "SchemeRegistry.h" > >-#include "URLParser.h" > #include <wtf/Lock.h> > #include <wtf/Locker.h> > #include <wtf/MainThread.h> > #include <wtf/NeverDestroyed.h> >+#include <wtf/URLParser.h> > > #if ENABLE(CONTENT_FILTERING) > #include "ContentFilter.h" >@@ -551,7 +551,7 @@ bool SchemeRegistry::isUserExtensionScheme(const String& scheme) > > bool SchemeRegistry::isBuiltinScheme(const String& scheme) > { >- return !scheme.isNull() && (allBuiltinSchemes().contains(scheme) || URLParser::isSpecialScheme(scheme)); >+ return !scheme.isNull() && (allBuiltinSchemes().contains(scheme) || WTF::URLParser::isSpecialScheme(scheme)); > } > > } // namespace WebCore >diff --git a/Source/WebCore/platform/SharedBuffer.h b/Source/WebCore/platform/SharedBuffer.h >index e2aae2f30457355f489eec4ab4ecf1ce7d3e452f..f868c2c01d6b10ecf364b1a6ffe3dd42f5f52283 100644 >--- a/Source/WebCore/platform/SharedBuffer.h >+++ b/Source/WebCore/platform/SharedBuffer.h >@@ -40,7 +40,7 @@ > #endif > > #if USE(SOUP) >-#include "GUniquePtrSoup.h" >+#include <wtf/glib/GUniquePtrSoup.h> > #endif > > #if USE(GLIB) >diff --git a/Source/WebCore/platform/SharedStringHash.cpp b/Source/WebCore/platform/SharedStringHash.cpp >index 0cc5f687d621efe7eabac4dbf9e54547a48dce18..afb757cbe4022fedfc4793eabc2569e860e95956 100644 >--- a/Source/WebCore/platform/SharedStringHash.cpp >+++ b/Source/WebCore/platform/SharedStringHash.cpp >@@ -24,7 +24,7 @@ > #include "config.h" > #include "SharedStringHash.h" > >-#include "URL.h" >+#include <wtf/URL.h> > #include <wtf/text/AtomicString.h> > #include <wtf/text/StringHash.h> > #include <wtf/text/StringView.h> >diff --git a/Source/WebCore/platform/SharedStringHash.h b/Source/WebCore/platform/SharedStringHash.h >index 7324617ba496a0663bfd53dec4a443d976939e8e..3603cf0f2e7f9214b3e253f5479d9cb346b27af8 100644 >--- a/Source/WebCore/platform/SharedStringHash.h >+++ b/Source/WebCore/platform/SharedStringHash.h >@@ -30,8 +30,6 @@ > > namespace WebCore { > >-class URL; >- > typedef uint64_t SharedStringHash; > > // Use the low 32-bits of the 64-bit SharedStringHash as the key for HashSets. >diff --git a/Source/WebCore/platform/SourcesSoup.txt b/Source/WebCore/platform/SourcesSoup.txt >index 91b9f309920fe6d5bade0803655c284590354d19..dbac3134e8bb177e39c573ad79733271e8d73c01 100644 >--- a/Source/WebCore/platform/SourcesSoup.txt >+++ b/Source/WebCore/platform/SourcesSoup.txt >@@ -41,4 +41,3 @@ platform/network/soup/WebKitSoupRequestGeneric.cpp > > platform/soup/PublicSuffixSoup.cpp > platform/soup/SharedBufferSoup.cpp >-platform/soup/URLSoup.cpp >diff --git a/Source/WebCore/platform/URL.cpp b/Source/WebCore/platform/URL.cpp >deleted file mode 100644 >index 013462bdef8e8a61afb012a10e27cb6134edfd3b..0000000000000000000000000000000000000000 >--- a/Source/WebCore/platform/URL.cpp >+++ /dev/null >@@ -1,1110 +0,0 @@ >-/* >- * Copyright (C) 2004, 2007-2008, 2011-2013, 2015-2016 Apple Inc. All rights reserved. >- * Copyright (C) 2012 Research In Motion Limited. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#include "config.h" >-#include "URL.h" >- >-#include "URLParser.h" >-#include <stdio.h> >-#include <unicode/uidna.h> >-#include <wtf/HashMap.h> >-#include <wtf/HexNumber.h> >-#include <wtf/NeverDestroyed.h> >-#include <wtf/StdLibExtras.h> >-#include <wtf/UUID.h> >-#include <wtf/text/CString.h> >-#include <wtf/text/StringBuilder.h> >-#include <wtf/text/StringConcatenateNumbers.h> >-#include <wtf/text/StringHash.h> >-#include <wtf/text/TextStream.h> >- >-// FIXME: This file makes too much use of the + operator on String. >-// We either have to optimize that operator so it doesn't involve >-// so many allocations, or change this to use StringBuffer instead. >- >- >-namespace WebCore { >-using namespace WTF; >- >-typedef Vector<char, 512> CharBuffer; >-typedef Vector<UChar, 512> UCharBuffer; >- >-static const unsigned invalidPortNumber = 0xFFFF; >- >-// Copies the source to the destination, assuming all the source characters are >-// ASCII. The destination buffer must be large enough. Null characters are allowed >-// in the source string, and no attempt is made to null-terminate the result. >-static void copyASCII(const String& string, char* dest) >-{ >- if (string.isEmpty()) >- return; >- >- if (string.is8Bit()) >- memcpy(dest, string.characters8(), string.length()); >- else { >- const UChar* src = string.characters16(); >- size_t length = string.length(); >- for (size_t i = 0; i < length; i++) >- dest[i] = static_cast<char>(src[i]); >- } >-} >- >-void URL::invalidate() >-{ >- m_isValid = false; >- m_protocolIsInHTTPFamily = false; >- m_cannotBeABaseURL = false; >- m_schemeEnd = 0; >- m_userStart = 0; >- m_userEnd = 0; >- m_passwordEnd = 0; >- m_hostEnd = 0; >- m_portLength = 0; >- m_pathEnd = 0; >- m_pathAfterLastSlash = 0; >- m_queryEnd = 0; >-} >- >-URL::URL(const URL& base, const String& relative, const URLTextEncoding* encoding) >-{ >- URLParser parser(relative, base, encoding); >- *this = parser.result(); >-} >- >-static bool shouldTrimFromURL(UChar c) >-{ >- // Browsers ignore leading/trailing whitespace and control >- // characters from URLs. Note that c is an *unsigned* char here >- // so this comparison should only catch control characters. >- return c <= ' '; >-} >- >-URL URL::isolatedCopy() const >-{ >- URL result = *this; >- result.m_string = result.m_string.isolatedCopy(); >- return result; >-} >- >-String URL::lastPathComponent() const >-{ >- if (!hasPath()) >- return String(); >- >- unsigned end = m_pathEnd - 1; >- if (m_string[end] == '/') >- --end; >- >- size_t start = m_string.reverseFind('/', end); >- if (start < static_cast<unsigned>(m_hostEnd + m_portLength)) >- return String(); >- ++start; >- >- return m_string.substring(start, end - start + 1); >-} >- >-StringView URL::protocol() const >-{ >- return StringView(m_string).substring(0, m_schemeEnd); >-} >- >-StringView URL::host() const >-{ >- unsigned start = hostStart(); >- return StringView(m_string).substring(start, m_hostEnd - start); >-} >- >-std::optional<uint16_t> URL::port() const >-{ >- if (!m_portLength) >- return std::nullopt; >- >- bool ok = false; >- unsigned number; >- if (m_string.is8Bit()) >- number = charactersToUIntStrict(m_string.characters8() + m_hostEnd + 1, m_portLength - 1, &ok); >- else >- number = charactersToUIntStrict(m_string.characters16() + m_hostEnd + 1, m_portLength - 1, &ok); >- if (!ok || number > std::numeric_limits<uint16_t>::max()) >- return std::nullopt; >- return number; >-} >- >-String URL::hostAndPort() const >-{ >- if (auto port = this->port()) >- return makeString(host(), ':', static_cast<unsigned>(port.value())); >- return host().toString(); >-} >- >-String URL::protocolHostAndPort() const >-{ >- String result = m_string.substring(0, m_hostEnd + m_portLength); >- >- if (m_passwordEnd - m_userStart > 0) { >- const int allowForTrailingAtSign = 1; >- result.remove(m_userStart, m_passwordEnd - m_userStart + allowForTrailingAtSign); >- } >- >- return result; >-} >- >-static String decodeEscapeSequencesFromParsedURL(StringView input) >-{ >- auto inputLength = input.length(); >- if (!inputLength) >- return emptyString(); >- Vector<LChar> percentDecoded; >- percentDecoded.reserveInitialCapacity(inputLength); >- for (unsigned i = 0; i < inputLength; ++i) { >- if (input[i] == '%' >- && inputLength > 2 >- && i < inputLength - 2 >- && isASCIIHexDigit(input[i + 1]) >- && isASCIIHexDigit(input[i + 2])) { >- percentDecoded.uncheckedAppend(toASCIIHexValue(input[i + 1], input[i + 2])); >- i += 2; >- } else >- percentDecoded.uncheckedAppend(input[i]); >- } >- return String::fromUTF8(percentDecoded.data(), percentDecoded.size()); >-} >- >-String URL::user() const >-{ >- return decodeEscapeSequencesFromParsedURL(StringView(m_string).substring(m_userStart, m_userEnd - m_userStart)); >-} >- >-String URL::pass() const >-{ >- if (m_passwordEnd == m_userEnd) >- return String(); >- >- return decodeEscapeSequencesFromParsedURL(StringView(m_string).substring(m_userEnd + 1, m_passwordEnd - m_userEnd - 1)); >-} >- >-String URL::encodedUser() const >-{ >- return m_string.substring(m_userStart, m_userEnd - m_userStart); >-} >- >-String URL::encodedPass() const >-{ >- if (m_passwordEnd == m_userEnd) >- return String(); >- >- return m_string.substring(m_userEnd + 1, m_passwordEnd - m_userEnd - 1); >-} >- >-String URL::fragmentIdentifier() const >-{ >- if (!hasFragmentIdentifier()) >- return String(); >- >- return m_string.substring(m_queryEnd + 1); >-} >- >-bool URL::hasFragmentIdentifier() const >-{ >- return m_isValid && m_string.length() != m_queryEnd; >-} >- >-String URL::baseAsString() const >-{ >- return m_string.left(m_pathAfterLastSlash); >-} >- >-#if !USE(CF) >- >-String URL::fileSystemPath() const >-{ >- if (!isValid() || !isLocalFile()) >- return String(); >- >- return decodeEscapeSequencesFromParsedURL(StringView(path())); >-} >- >-#endif >- >-#ifdef NDEBUG >- >-static inline void assertProtocolIsGood(StringView) >-{ >-} >- >-#else >- >-static void assertProtocolIsGood(StringView protocol) >-{ >- // FIXME: We probably don't need this function any more. >- // The isASCIIAlphaCaselessEqual function asserts that passed-in characters >- // are ones it can handle; the older code did not and relied on these checks. >- for (auto character : protocol.codeUnits()) { >- ASSERT(isASCII(character)); >- ASSERT(character > ' '); >- ASSERT(!isASCIIUpper(character)); >- ASSERT(toASCIILowerUnchecked(character) == character); >- } >-} >- >-#endif >- >-static Lock defaultPortForProtocolMapForTestingLock; >- >-using DefaultPortForProtocolMapForTesting = HashMap<String, uint16_t>; >-static DefaultPortForProtocolMapForTesting*& defaultPortForProtocolMapForTesting() >-{ >- static DefaultPortForProtocolMapForTesting* defaultPortForProtocolMap; >- return defaultPortForProtocolMap; >-} >- >-static DefaultPortForProtocolMapForTesting& ensureDefaultPortForProtocolMapForTesting() >-{ >- DefaultPortForProtocolMapForTesting*& defaultPortForProtocolMap = defaultPortForProtocolMapForTesting(); >- if (!defaultPortForProtocolMap) >- defaultPortForProtocolMap = new DefaultPortForProtocolMapForTesting; >- return *defaultPortForProtocolMap; >-} >- >-void registerDefaultPortForProtocolForTesting(uint16_t port, const String& protocol) >-{ >- auto locker = holdLock(defaultPortForProtocolMapForTestingLock); >- ensureDefaultPortForProtocolMapForTesting().add(protocol, port); >-} >- >-void clearDefaultPortForProtocolMapForTesting() >-{ >- auto locker = holdLock(defaultPortForProtocolMapForTestingLock); >- if (auto* map = defaultPortForProtocolMapForTesting()) >- map->clear(); >-} >- >-std::optional<uint16_t> defaultPortForProtocol(StringView protocol) >-{ >- if (auto* overrideMap = defaultPortForProtocolMapForTesting()) { >- auto locker = holdLock(defaultPortForProtocolMapForTestingLock); >- ASSERT(overrideMap); // No need to null check again here since overrideMap cannot become null after being non-null. >- auto iterator = overrideMap->find(protocol.toStringWithoutCopying()); >- if (iterator != overrideMap->end()) >- return iterator->value; >- } >- return URLParser::defaultPortForProtocol(protocol); >-} >- >-bool isDefaultPortForProtocol(uint16_t port, StringView protocol) >-{ >- return defaultPortForProtocol(protocol) == port; >-} >- >-bool URL::protocolIs(const char* protocol) const >-{ >- assertProtocolIsGood(StringView(reinterpret_cast<const LChar*>(protocol), strlen(protocol))); >- >- // JavaScript URLs are "valid" and should be executed even if URL decides they are invalid. >- // The free function protocolIsJavaScript() should be used instead. >- ASSERT(!equalLettersIgnoringASCIICase(StringView(protocol), "javascript")); >- >- if (!m_isValid) >- return false; >- >- // Do the comparison without making a new string object. >- for (unsigned i = 0; i < m_schemeEnd; ++i) { >- if (!protocol[i] || !isASCIIAlphaCaselessEqual(m_string[i], protocol[i])) >- return false; >- } >- return !protocol[m_schemeEnd]; // We should have consumed all characters in the argument. >-} >- >-bool URL::protocolIs(StringView protocol) const >-{ >- assertProtocolIsGood(protocol); >- >- if (!m_isValid) >- return false; >- >- if (m_schemeEnd != protocol.length()) >- return false; >- >- // Do the comparison without making a new string object. >- for (unsigned i = 0; i < m_schemeEnd; ++i) { >- if (!isASCIIAlphaCaselessEqual(m_string[i], protocol[i])) >- return false; >- } >- return true; >-} >- >-String URL::query() const >-{ >- if (m_queryEnd == m_pathEnd) >- return String(); >- >- return m_string.substring(m_pathEnd + 1, m_queryEnd - (m_pathEnd + 1)); >-} >- >-String URL::path() const >-{ >- unsigned portEnd = m_hostEnd + m_portLength; >- return m_string.substring(portEnd, m_pathEnd - portEnd); >-} >- >-bool URL::setProtocol(const String& s) >-{ >- // Firefox and IE remove everything after the first ':'. >- size_t separatorPosition = s.find(':'); >- String newProtocol = s.substring(0, separatorPosition); >- auto canonicalized = URLParser::maybeCanonicalizeScheme(newProtocol); >- if (!canonicalized) >- return false; >- >- if (!m_isValid) { >- URLParser parser(makeString(*canonicalized, ":", m_string)); >- *this = parser.result(); >- return true; >- } >- >- URLParser parser(makeString(*canonicalized, m_string.substring(m_schemeEnd))); >- *this = parser.result(); >- return true; >-} >- >-static bool isAllASCII(StringView string) >-{ >- if (string.is8Bit()) >- return charactersAreAllASCII(string.characters8(), string.length()); >- return charactersAreAllASCII(string.characters16(), string.length()); >-} >- >-// Appends the punycoded hostname identified by the given string and length to >-// the output buffer. The result will not be null terminated. >-// Return value of false means error in encoding. >-static bool appendEncodedHostname(UCharBuffer& buffer, StringView string) >-{ >- // Needs to be big enough to hold an IDN-encoded name. >- // For host names bigger than this, we won't do IDN encoding, which is almost certainly OK. >- const unsigned hostnameBufferLength = 2048; >- >- if (string.length() > hostnameBufferLength || isAllASCII(string)) { >- append(buffer, string); >- return true; >- } >- >- UChar hostnameBuffer[hostnameBufferLength]; >- UErrorCode error = U_ZERO_ERROR; >- UIDNAInfo processingDetails = UIDNA_INFO_INITIALIZER; >- int32_t numCharactersConverted = uidna_nameToASCII(&URLParser::internationalDomainNameTranscoder(), >- string.upconvertedCharacters(), string.length(), hostnameBuffer, hostnameBufferLength, &processingDetails, &error); >- >- if (U_SUCCESS(error) && !processingDetails.errors) { >- buffer.append(hostnameBuffer, numCharactersConverted); >- return true; >- } >- return false; >-} >- >-unsigned URL::hostStart() const >-{ >- return (m_passwordEnd == m_userStart) ? m_passwordEnd : m_passwordEnd + 1; >-} >- >-void URL::setHost(const String& s) >-{ >- if (!m_isValid) >- return; >- >- auto colonIndex = s.find(':'); >- if (colonIndex != notFound) >- return; >- >- UCharBuffer encodedHostName; >- if (!appendEncodedHostname(encodedHostName, s)) >- return; >- >- bool slashSlashNeeded = m_userStart == static_cast<unsigned>(m_schemeEnd + 1); >- >- StringBuilder builder; >- builder.append(m_string.left(hostStart())); >- if (slashSlashNeeded) >- builder.appendLiteral("//"); >- builder.append(StringView(encodedHostName.data(), encodedHostName.size())); >- builder.append(m_string.substring(m_hostEnd)); >- >- URLParser parser(builder.toString()); >- *this = parser.result(); >-} >- >-void URL::removePort() >-{ >- if (!m_portLength) >- return; >- URLParser parser(makeString(StringView(m_string).left(m_hostEnd), StringView(m_string).substring(m_hostEnd + m_portLength))); >- *this = parser.result(); >-} >- >-void URL::setPort(unsigned short i) >-{ >- if (!m_isValid) >- return; >- >- bool colonNeeded = !m_portLength; >- unsigned portStart = (colonNeeded ? m_hostEnd : m_hostEnd + 1); >- >- URLParser parser(makeString(StringView(m_string).left(portStart), (colonNeeded ? ":" : ""), String::number(i), StringView(m_string).substring(m_hostEnd + m_portLength))); >- *this = parser.result(); >-} >- >-void URL::setHostAndPort(const String& hostAndPort) >-{ >- if (!m_isValid) >- return; >- >- StringView hostName(hostAndPort); >- StringView port; >- >- auto colonIndex = hostName.find(':'); >- if (colonIndex != notFound) { >- port = hostName.substring(colonIndex + 1); >- bool ok; >- int portInt = port.toIntStrict(ok); >- if (!ok || portInt < 0) >- return; >- hostName = hostName.substring(0, colonIndex); >- } >- >- if (hostName.isEmpty()) >- return; >- >- UCharBuffer encodedHostName; >- if (!appendEncodedHostname(encodedHostName, hostName)) >- return; >- >- bool slashSlashNeeded = m_userStart == static_cast<unsigned>(m_schemeEnd + 1); >- >- StringBuilder builder; >- builder.append(m_string.left(hostStart())); >- if (slashSlashNeeded) >- builder.appendLiteral("//"); >- builder.append(StringView(encodedHostName.data(), encodedHostName.size())); >- if (!port.isEmpty()) { >- builder.appendLiteral(":"); >- builder.append(port); >- } >- builder.append(StringView(m_string).substring(m_hostEnd + m_portLength)); >- >- URLParser parser(builder.toString()); >- *this = parser.result(); >-} >- >-static String percentEncodeCharacters(const String& input, bool(*shouldEncode)(UChar)) >-{ >- auto encode = [shouldEncode] (const String& input) { >- CString utf8 = input.utf8(); >- auto* data = utf8.data(); >- StringBuilder builder; >- auto length = utf8.length(); >- for (unsigned j = 0; j < length; j++) { >- auto c = data[j]; >- if (shouldEncode(c)) { >- builder.append('%'); >- builder.append(upperNibbleToASCIIHexDigit(c)); >- builder.append(lowerNibbleToASCIIHexDigit(c)); >- } else >- builder.append(c); >- } >- return builder.toString(); >- }; >- >- for (size_t i = 0; i < input.length(); ++i) { >- if (UNLIKELY(shouldEncode(input[i]))) >- return encode(input); >- } >- return input; >-} >- >-void URL::setUser(const String& user) >-{ >- if (!m_isValid) >- return; >- >- // FIXME: Non-ASCII characters must be encoded and escaped to match parse() expectations, >- // and to avoid changing more than just the user login. >- >- unsigned end = m_userEnd; >- if (!user.isEmpty()) { >- String u = percentEncodeCharacters(user, URLParser::isInUserInfoEncodeSet); >- if (m_userStart == static_cast<unsigned>(m_schemeEnd + 1)) >- u = "//" + u; >- // Add '@' if we didn't have one before. >- if (end == m_hostEnd || (end == m_passwordEnd && m_string[end] != '@')) >- u.append('@'); >- URLParser parser(makeString(StringView(m_string).left(m_userStart), u, StringView(m_string).substring(end))); >- *this = parser.result(); >- } else { >- // Remove '@' if we now have neither user nor password. >- if (m_userEnd == m_passwordEnd && end != m_hostEnd && m_string[end] == '@') >- end += 1; >- // We don't want to parse in the extremely common case where we are not going to make a change. >- if (m_userStart != end) { >- URLParser parser(makeString(StringView(m_string).left(m_userStart), StringView(m_string).substring(end))); >- *this = parser.result(); >- } >- } >-} >- >-void URL::setPass(const String& password) >-{ >- if (!m_isValid) >- return; >- >- unsigned end = m_passwordEnd; >- if (!password.isEmpty()) { >- String p = ":" + percentEncodeCharacters(password, URLParser::isInUserInfoEncodeSet) + "@"; >- if (m_userEnd == static_cast<unsigned>(m_schemeEnd + 1)) >- p = "//" + p; >- // Eat the existing '@' since we are going to add our own. >- if (end != m_hostEnd && m_string[end] == '@') >- end += 1; >- URLParser parser(makeString(StringView(m_string).left(m_userEnd), p, StringView(m_string).substring(end))); >- *this = parser.result(); >- } else { >- // Remove '@' if we now have neither user nor password. >- if (m_userStart == m_userEnd && end != m_hostEnd && m_string[end] == '@') >- end += 1; >- // We don't want to parse in the extremely common case where we are not going to make a change. >- if (m_userEnd != end) { >- URLParser parser(makeString(StringView(m_string).left(m_userEnd), StringView(m_string).substring(end))); >- *this = parser.result(); >- } >- } >-} >- >-void URL::setFragmentIdentifier(StringView identifier) >-{ >- if (!m_isValid) >- return; >- >- // FIXME: Optimize the case where the identifier already happens to be equal to what was passed? >- // FIXME: Is it correct to do this without encoding and escaping non-ASCII characters? >- *this = URLParser { makeString(StringView { m_string }.substring(0, m_queryEnd), '#', identifier) }.result(); >-} >- >-void URL::removeFragmentIdentifier() >-{ >- if (!m_isValid) { >- ASSERT(!m_queryEnd); >- return; >- } >- if (m_isValid && m_string.length() > m_queryEnd) >- m_string = m_string.left(m_queryEnd); >-} >- >-void URL::removeQueryAndFragmentIdentifier() >-{ >- if (!m_isValid) >- return; >- >- m_string = m_string.left(m_pathEnd); >- m_queryEnd = m_pathEnd; >-} >- >-void URL::setQuery(const String& query) >-{ >- if (!m_isValid) >- return; >- >- // FIXME: '#' and non-ASCII characters must be encoded and escaped. >- // Usually, the query is encoded using document encoding, not UTF-8, but we don't have >- // access to the document in this function. >- // https://webkit.org/b/161176 >- if ((query.isEmpty() || query[0] != '?') && !query.isNull()) { >- URLParser parser(makeString(StringView(m_string).left(m_pathEnd), "?", query, StringView(m_string).substring(m_queryEnd))); >- *this = parser.result(); >- } else { >- URLParser parser(makeString(StringView(m_string).left(m_pathEnd), query, StringView(m_string).substring(m_queryEnd))); >- *this = parser.result(); >- } >- >-} >- >-void URL::setPath(const String& s) >-{ >- if (!m_isValid) >- return; >- >- String path = s; >- if (path.isEmpty() || path[0] != '/') >- path = "/" + path; >- >- auto questionMarkOrNumberSign = [] (UChar character) { >- return character == '?' || character == '#'; >- }; >- URLParser parser(makeString(StringView(m_string).left(m_hostEnd + m_portLength), percentEncodeCharacters(path, questionMarkOrNumberSign), StringView(m_string).substring(m_pathEnd))); >- *this = parser.result(); >-} >- >-bool equalIgnoringFragmentIdentifier(const URL& a, const URL& b) >-{ >- if (a.m_queryEnd != b.m_queryEnd) >- return false; >- unsigned queryLength = a.m_queryEnd; >- for (unsigned i = 0; i < queryLength; ++i) >- if (a.string()[i] != b.string()[i]) >- return false; >- return true; >-} >- >-bool equalIgnoringQueryAndFragment(const URL& a, const URL& b) >-{ >- if (a.pathEnd() != b.pathEnd()) >- return false; >- unsigned pathEnd = a.pathEnd(); >- for (unsigned i = 0; i < pathEnd; ++i) { >- if (a.string()[i] != b.string()[i]) >- return false; >- } >- return true; >-} >- >-bool protocolHostAndPortAreEqual(const URL& a, const URL& b) >-{ >- if (a.m_schemeEnd != b.m_schemeEnd) >- return false; >- >- unsigned hostStartA = a.hostStart(); >- unsigned hostLengthA = a.m_hostEnd - hostStartA; >- unsigned hostStartB = b.hostStart(); >- unsigned hostLengthB = b.m_hostEnd - b.hostStart(); >- if (hostLengthA != hostLengthB) >- return false; >- >- // Check the scheme >- for (unsigned i = 0; i < a.m_schemeEnd; ++i) { >- if (a.string()[i] != b.string()[i]) >- return false; >- } >- >- // And the host >- for (unsigned i = 0; i < hostLengthA; ++i) { >- if (a.string()[hostStartA + i] != b.string()[hostStartB + i]) >- return false; >- } >- >- if (a.port() != b.port()) >- return false; >- >- return true; >-} >- >-bool hostsAreEqual(const URL& a, const URL& b) >-{ >- unsigned hostStartA = a.hostStart(); >- unsigned hostLengthA = a.m_hostEnd - hostStartA; >- unsigned hostStartB = b.hostStart(); >- unsigned hostLengthB = b.m_hostEnd - hostStartB; >- if (hostLengthA != hostLengthB) >- return false; >- >- for (unsigned i = 0; i < hostLengthA; ++i) { >- if (a.string()[hostStartA + i] != b.string()[hostStartB + i]) >- return false; >- } >- >- return true; >-} >- >-bool URL::isMatchingDomain(const String& domain) const >-{ >- if (isNull()) >- return false; >- >- if (domain.isEmpty()) >- return true; >- >- if (!protocolIsInHTTPFamily()) >- return false; >- >- auto host = this->host(); >- if (!host.endsWith(domain)) >- return false; >- >- return host.length() == domain.length() || host[host.length() - domain.length() - 1] == '.'; >-} >- >-String encodeWithURLEscapeSequences(const String& input) >-{ >- return percentEncodeCharacters(input, URLParser::isInUserInfoEncodeSet); >-} >- >-bool URL::isHierarchical() const >-{ >- if (!m_isValid) >- return false; >- ASSERT(m_string[m_schemeEnd] == ':'); >- return m_string[m_schemeEnd + 1] == '/'; >-} >- >-void URL::copyToBuffer(Vector<char, 512>& buffer) const >-{ >- // FIXME: This throws away the high bytes of all the characters in the string! >- // That's fine for a valid URL, which is all ASCII, but not for invalid URLs. >- buffer.resize(m_string.length()); >- copyASCII(m_string, buffer.data()); >-} >- >-template<typename StringClass> >-bool protocolIsInternal(const StringClass& url, const char* protocol) >-{ >- // Do the comparison without making a new string object. >- assertProtocolIsGood(StringView(reinterpret_cast<const LChar*>(protocol), strlen(protocol))); >- bool isLeading = true; >- for (unsigned i = 0, j = 0; url[i]; ++i) { >- // Skip leading whitespace and control characters. >- if (isLeading && shouldTrimFromURL(url[i])) >- continue; >- isLeading = false; >- >- // Skip any tabs and newlines. >- if (url[i] == '\t' || url[i] == '\r' || url[i] == '\n') >- continue; >- >- if (!protocol[j]) >- return url[i] == ':'; >- if (!isASCIIAlphaCaselessEqual(url[i], protocol[j])) >- return false; >- >- ++j; >- } >- >- return false; >-} >- >-bool protocolIs(const String& url, const char* protocol) >-{ >- return protocolIsInternal(url, protocol); >-} >- >-inline bool URL::protocolIs(const String& string, const char* protocol) >-{ >- return WebCore::protocolIsInternal(string, protocol); >-} >- >-#ifndef NDEBUG >- >-void URL::print() const >-{ >- printf("%s\n", m_string.utf8().data()); >-} >- >-#endif >- >-String URL::strippedForUseAsReferrer() const >-{ >- URL referrer(*this); >- referrer.setUser(String()); >- referrer.setPass(String()); >- referrer.removeFragmentIdentifier(); >- return referrer.string(); >-} >- >-bool URL::isLocalFile() const >-{ >- // Including feed here might be a bad idea since drag and drop uses this check >- // and including feed would allow feeds to potentially let someone's blog >- // read the contents of the clipboard on a drag, even without a drop. >- // Likewise with using the FrameLoader::shouldTreatURLAsLocal() function. >- return protocolIs("file"); >-} >- >-bool protocolIsJavaScript(const String& url) >-{ >- return protocolIsInternal(url, "javascript"); >-} >- >-bool protocolIsJavaScript(StringView url) >-{ >- return protocolIsInternal(url, "javascript"); >-} >- >-bool protocolIsInHTTPFamily(const String& url) >-{ >- auto length = url.length(); >- // Do the comparison without making a new string object. >- return length >= 5 >- && isASCIIAlphaCaselessEqual(url[0], 'h') >- && isASCIIAlphaCaselessEqual(url[1], 't') >- && isASCIIAlphaCaselessEqual(url[2], 't') >- && isASCIIAlphaCaselessEqual(url[3], 'p') >- && (url[4] == ':' || (isASCIIAlphaCaselessEqual(url[4], 's') && length >= 6 && url[5] == ':')); >-} >- >-const URL& blankURL() >-{ >- static NeverDestroyed<URL> staticBlankURL(URL(), "about:blank"); >- return staticBlankURL; >-} >- >-bool URL::protocolIsAbout() const >-{ >- return protocolIs("about"); >-} >- >-bool portAllowed(const URL& url) >-{ >- std::optional<uint16_t> port = url.port(); >- >- // Since most URLs don't have a port, return early for the "no port" case. >- if (!port) >- return true; >- >- // This blocked port list matches the port blocking that Mozilla implements. >- // See http://www.mozilla.org/projects/netlib/PortBanning.html for more information. >- static const uint16_t blockedPortList[] = { >- 1, // tcpmux >- 7, // echo >- 9, // discard >- 11, // systat >- 13, // daytime >- 15, // netstat >- 17, // qotd >- 19, // chargen >- 20, // FTP-data >- 21, // FTP-control >- 22, // SSH >- 23, // telnet >- 25, // SMTP >- 37, // time >- 42, // name >- 43, // nicname >- 53, // domain >- 77, // priv-rjs >- 79, // finger >- 87, // ttylink >- 95, // supdup >- 101, // hostriame >- 102, // iso-tsap >- 103, // gppitnp >- 104, // acr-nema >- 109, // POP2 >- 110, // POP3 >- 111, // sunrpc >- 113, // auth >- 115, // SFTP >- 117, // uucp-path >- 119, // nntp >- 123, // NTP >- 135, // loc-srv / epmap >- 139, // netbios >- 143, // IMAP2 >- 179, // BGP >- 389, // LDAP >- 427, // SLP (Also used by Apple Filing Protocol) >- 465, // SMTP+SSL >- 512, // print / exec >- 513, // login >- 514, // shell >- 515, // printer >- 526, // tempo >- 530, // courier >- 531, // Chat >- 532, // netnews >- 540, // UUCP >- 548, // afpovertcp [Apple addition] >- 556, // remotefs >- 563, // NNTP+SSL >- 587, // ESMTP >- 601, // syslog-conn >- 636, // LDAP+SSL >- 993, // IMAP+SSL >- 995, // POP3+SSL >- 2049, // NFS >- 3659, // apple-sasl / PasswordServer [Apple addition] >- 4045, // lockd >- 4190, // ManageSieve [Apple addition] >- 6000, // X11 >- 6665, // Alternate IRC [Apple addition] >- 6666, // Alternate IRC [Apple addition] >- 6667, // Standard IRC [Apple addition] >- 6668, // Alternate IRC [Apple addition] >- 6669, // Alternate IRC [Apple addition] >- 6679, // Alternate IRC SSL [Apple addition] >- 6697, // IRC+SSL [Apple addition] >- invalidPortNumber, // Used to block all invalid port numbers >- }; >- >- // If the port is not in the blocked port list, allow it. >- ASSERT(std::is_sorted(std::begin(blockedPortList), std::end(blockedPortList))); >- if (!std::binary_search(std::begin(blockedPortList), std::end(blockedPortList), port.value())) >- return true; >- >- // Allow ports 21 and 22 for FTP URLs, as Mozilla does. >- if ((port.value() == 21 || port.value() == 22) && url.protocolIs("ftp")) >- return true; >- >- // Allow any port number in a file URL, since the port number is ignored. >- if (url.protocolIs("file")) >- return true; >- >- return false; >-} >- >-String mimeTypeFromDataURL(const String& url) >-{ >- ASSERT(protocolIsInternal(url, "data")); >- >- // FIXME: What's the right behavior when the URL has a comma first, but a semicolon later? >- // Currently this code will break at the semicolon in that case. Not sure that's correct. >- auto index = url.find(';', 5); >- if (index == notFound) >- index = url.find(',', 5); >- if (index == notFound) { >- // FIXME: There was an old comment here that made it sound like this should be returning text/plain. >- // But we have been returning empty string here for some time, so not changing its behavior at this time. >- return emptyString(); >- } >- if (index == 5) >- return "text/plain"_s; >- ASSERT(index >= 5); >- return url.substring(5, index - 5).convertToASCIILowercase(); >-} >- >-String URL::stringCenterEllipsizedToLength(unsigned length) const >-{ >- if (string().length() <= length) >- return string(); >- >- return string().left(length / 2 - 1) + "..." + string().right(length / 2 - 2); >-} >- >-URL URL::fakeURLWithRelativePart(const String& relativePart) >-{ >- return URL(URL(), "webkit-fake-url://" + createCanonicalUUIDString() + '/' + relativePart); >-} >- >-URL URL::fileURLWithFileSystemPath(const String& filePath) >-{ >- return URL(URL(), "file:///" + filePath); >-} >- >-TextStream& operator<<(TextStream& ts, const URL& url) >-{ >- ts << url.string(); >- return ts; >-} >- >-#if !PLATFORM(COCOA) && !USE(SOUP) >-static bool isIPv4Address(StringView string) >-{ >- auto count = 0; >- >- for (const auto octet : string.splitAllowingEmptyEntries('.')) { >- if (count >= 4) >- return false; >- >- const auto length = octet.length(); >- if (!length || length > 3) >- return false; >- >- auto value = 0; >- for (auto i = 0u; i < length; ++i) { >- const auto digit = octet[i]; >- >- // Prohibit leading zeroes. >- if (digit > '9' || digit < (!i && length > 1 ? '1' : '0')) >- return false; >- >- value = 10 * value + (digit - '0'); >- } >- >- if (value > 255) >- return false; >- >- count++; >- } >- >- return (count == 4); >-} >- >-static bool isIPv6Address(StringView string) >-{ >- enum SkipState { None, WillSkip, Skipping, Skipped, Final }; >- auto skipState = None; >- auto count = 0; >- >- for (const auto hextet : string.splitAllowingEmptyEntries(':')) { >- if (count >= 8 || skipState == Final) >- return false; >- >- const auto length = hextet.length(); >- if (!length) { >- // :: may be used anywhere to skip 1 to 8 hextets, but only once. >- if (skipState == Skipped) >- return false; >- >- if (skipState == None) >- skipState = !count ? WillSkip : Skipping; >- else if (skipState == WillSkip) >- skipState = Skipping; >- else >- skipState = Final; >- continue; >- } >- >- if (skipState == WillSkip) >- return false; >- >- if (skipState == Skipping) >- skipState = Skipped; >- >- if (length > 4) { >- // An IPv4 address may be used in place of the final two hextets. >- if ((skipState == None && count != 6) || (skipState == Skipped && count >= 6) || !isIPv4Address(hextet)) >- return false; >- >- skipState = Final; >- continue; >- } >- >- for (const auto codeUnit : hextet.codeUnits()) { >- // IPv6 allows leading zeroes. >- if (!isASCIIHexDigit(codeUnit)) >- return false; >- } >- >- count++; >- } >- >- return (count == 8 && skipState == None) || skipState == Skipped || skipState == Final; >-} >- >-bool URL::hostIsIPAddress(StringView host) >-{ >- if (host.find(':') == notFound) >- return isIPv4Address(host); >- >- return isIPv6Address(host); >-} >-#endif >- >-} // namespace WebCore >diff --git a/Source/WebCore/platform/URL.h b/Source/WebCore/platform/URL.h >deleted file mode 100644 >index 8a818ba5dde759fbcf0e905f4a9f5157db81660b..0000000000000000000000000000000000000000 >--- a/Source/WebCore/platform/URL.h >+++ /dev/null >@@ -1,397 +0,0 @@ >-/* >- * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2011, 2012, 2013 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#pragma once >- >-#include <wtf/Forward.h> >-#include <wtf/RetainPtr.h> >-#include <wtf/text/WTFString.h> >- >-#if USE(CF) >-typedef const struct __CFURL* CFURLRef; >-#endif >- >-#if USE(SOUP) >-#include "GUniquePtrSoup.h" >-#endif >- >-#if USE(FOUNDATION) >-OBJC_CLASS NSURL; >-#endif >- >-namespace WTF { >-class TextStream; >-} >- >-namespace WebCore { >- >-class URLTextEncoding { >-public: >- virtual Vector<uint8_t> encodeForURLParsing(StringView) const = 0; >- virtual ~URLTextEncoding() { }; >-}; >- >-struct URLHash; >- >-class URL { >-public: >- // Generates a URL which contains a null string. >- URL() { invalidate(); } >- >- explicit URL(WTF::HashTableDeletedValueType) : m_string(WTF::HashTableDeletedValue) { } >- bool isHashTableDeletedValue() const { return string().isHashTableDeletedValue(); } >- >- // Resolves the relative URL with the given base URL. If provided, the >- // URLTextEncoding is used to encode non-ASCII characers. The base URL can be >- // null or empty, in which case the relative URL will be interpreted as >- // absolute. >- // FIXME: If the base URL is invalid, this always creates an invalid >- // URL. Instead I think it would be better to treat all invalid base URLs >- // the same way we treate null and empty base URLs. >- WEBCORE_EXPORT URL(const URL& base, const String& relative, const URLTextEncoding* = nullptr); >- >- WEBCORE_EXPORT static URL fakeURLWithRelativePart(const String&); >- WEBCORE_EXPORT static URL fileURLWithFileSystemPath(const String&); >- >- String strippedForUseAsReferrer() const; >- >- // FIXME: The above functions should be harmonized so that passing a >- // base of null or the empty string gives the same result as the >- // standard String constructor. >- >- // Makes a deep copy. Helpful only if you need to use a URL on another >- // thread. Since the underlying StringImpl objects are immutable, there's >- // no other reason to ever prefer isolatedCopy() over plain old assignment. >- WEBCORE_EXPORT URL isolatedCopy() const; >- >- bool isNull() const; >- bool isEmpty() const; >- bool isValid() const; >- >- // Returns true if you can set the host and port for the URL. >- // Non-hierarchical URLs don't have a host and port. >- bool canSetHostOrPort() const { return isHierarchical(); } >- >- bool canSetPathname() const { return isHierarchical(); } >- bool isHierarchical() const; >- >- const String& string() const { return m_string; } >- >- WEBCORE_EXPORT String stringCenterEllipsizedToLength(unsigned length = 1024) const; >- >- WEBCORE_EXPORT StringView protocol() const; >- WEBCORE_EXPORT StringView host() const; >- WEBCORE_EXPORT std::optional<uint16_t> port() const; >- WEBCORE_EXPORT String hostAndPort() const; >- WEBCORE_EXPORT String protocolHostAndPort() const; >- WEBCORE_EXPORT String user() const; >- WEBCORE_EXPORT String pass() const; >- WEBCORE_EXPORT String path() const; >- WEBCORE_EXPORT String lastPathComponent() const; >- WEBCORE_EXPORT String query() const; >- WEBCORE_EXPORT String fragmentIdentifier() const; >- WEBCORE_EXPORT bool hasFragmentIdentifier() const; >- >- bool hasUsername() const; >- bool hasPassword() const; >- bool hasQuery() const; >- bool hasFragment() const; >- bool hasPath() const; >- >- // Unlike user() and pass(), these functions don't decode escape sequences. >- // This is necessary for accurate round-tripping, because encoding doesn't encode '%' characters. >- WEBCORE_EXPORT String encodedUser() const; >- WEBCORE_EXPORT String encodedPass() const; >- >- WEBCORE_EXPORT String baseAsString() const; >- >- WEBCORE_EXPORT String fileSystemPath() const; >- >- // Returns true if the current URL's protocol is the same as the null- >- // terminated ASCII argument. The argument must be lower-case. >- WEBCORE_EXPORT bool protocolIs(const char*) const; >- bool protocolIs(StringView) const; >- bool protocolIsBlob() const { return protocolIs("blob"); } >- bool protocolIsData() const { return protocolIs("data"); } >- WEBCORE_EXPORT bool protocolIsAbout() const; >- bool protocolIsInHTTPFamily() const; >- WEBCORE_EXPORT bool isLocalFile() const; >- bool cannotBeABaseURL() const { return m_cannotBeABaseURL; } >- >- WEBCORE_EXPORT bool isMatchingDomain(const String&) const; >- >- WEBCORE_EXPORT bool setProtocol(const String&); >- void setHost(const String&); >- >- void removePort(); >- void setPort(unsigned short); >- >- // Input is like "foo.com" or "foo.com:8000". >- void setHostAndPort(const String&); >- >- void setUser(const String&); >- void setPass(const String&); >- >- // If you pass an empty path for HTTP or HTTPS URLs, the resulting path >- // will be "/". >- WEBCORE_EXPORT void setPath(const String&); >- >- // The query may begin with a question mark, or, if not, one will be added >- // for you. Setting the query to the empty string will leave a "?" in the >- // URL (with nothing after it). To clear the query, pass a null string. >- WEBCORE_EXPORT void setQuery(const String&); >- >- WEBCORE_EXPORT void setFragmentIdentifier(StringView); >- WEBCORE_EXPORT void removeFragmentIdentifier(); >- >- WEBCORE_EXPORT void removeQueryAndFragmentIdentifier(); >- >- WEBCORE_EXPORT static bool hostIsIPAddress(StringView); >- >- unsigned pathStart() const; >- unsigned pathEnd() const; >- unsigned pathAfterLastSlash() const; >- >- operator const String&() const { return string(); } >- >-#if USE(CF) >- WEBCORE_EXPORT URL(CFURLRef); >- WEBCORE_EXPORT RetainPtr<CFURLRef> createCFURL() const; >-#endif >- >-#if USE(SOUP) >- URL(SoupURI*); >- GUniquePtr<SoupURI> createSoupURI() const; >-#endif >- >-#if USE(FOUNDATION) >- WEBCORE_EXPORT URL(NSURL*); >- WEBCORE_EXPORT operator NSURL*() const; >-#endif >-#ifdef __OBJC__ >- operator NSString*() const { return string(); } >-#endif >- >-#ifndef NDEBUG >- void print() const; >-#endif >- >- template <class Encoder> void encode(Encoder&) const; >- template <class Decoder> static bool decode(Decoder&, URL&); >- template <class Decoder> static std::optional<URL> decode(Decoder&); >- >-private: >- friend class URLParser; >- WEBCORE_EXPORT void invalidate(); >- static bool protocolIs(const String&, const char*); >- void copyToBuffer(Vector<char, 512>& buffer) const; >- unsigned hostStart() const; >- >- WEBCORE_EXPORT friend bool equalIgnoringFragmentIdentifier(const URL&, const URL&); >- WEBCORE_EXPORT friend bool protocolHostAndPortAreEqual(const URL&, const URL&); >- WEBCORE_EXPORT friend bool hostsAreEqual(const URL&, const URL&); >- >- String m_string; >- >- unsigned m_isValid : 1; >- unsigned m_protocolIsInHTTPFamily : 1; >- unsigned m_cannotBeABaseURL : 1; >- >- // This is out of order to align the bits better. The port is after the host. >- unsigned m_portLength : 3; >- static constexpr unsigned maxPortLength = (1 << 3) - 1; >- >- static constexpr unsigned maxSchemeLength = (1 << 26) - 1; >- unsigned m_schemeEnd : 26; >- unsigned m_userStart; >- unsigned m_userEnd; >- unsigned m_passwordEnd; >- unsigned m_hostEnd; >- unsigned m_pathAfterLastSlash; >- unsigned m_pathEnd; >- unsigned m_queryEnd; >-}; >- >-static_assert(sizeof(URL) == sizeof(String) + 8 * sizeof(unsigned), "URL should stay small"); >- >-template <class Encoder> >-void URL::encode(Encoder& encoder) const >-{ >- encoder << m_string; >-} >- >-template <class Decoder> >-bool URL::decode(Decoder& decoder, URL& url) >-{ >- auto optionalURL = URL::decode(decoder); >- if (!optionalURL) >- return false; >- url = WTFMove(*optionalURL); >- return true; >-} >- >-template <class Decoder> >-std::optional<URL> URL::decode(Decoder& decoder) >-{ >- String string; >- if (!decoder.decode(string)) >- return std::nullopt; >- return URL(URL(), string); >-} >- >-WEBCORE_EXPORT bool equalIgnoringFragmentIdentifier(const URL&, const URL&); >-WEBCORE_EXPORT bool equalIgnoringQueryAndFragment(const URL&, const URL&); >-WEBCORE_EXPORT bool protocolHostAndPortAreEqual(const URL&, const URL&); >-WEBCORE_EXPORT bool hostsAreEqual(const URL&, const URL&); >- >-WEBCORE_EXPORT const URL& blankURL(); >- >-// Functions to do URL operations on strings. >-// These are operations that aren't faster on a parsed URL. >-// These are also different from the URL functions in that they don't require the string to be a valid and parsable URL. >-// This is especially important because valid javascript URLs are not necessarily considered valid by URL. >- >-WEBCORE_EXPORT bool protocolIs(const String& url, const char* protocol); >-WEBCORE_EXPORT bool protocolIsJavaScript(const String& url); >-bool protocolIsJavaScript(StringView url); >-WEBCORE_EXPORT bool protocolIsInHTTPFamily(const String& url); >- >-std::optional<uint16_t> defaultPortForProtocol(StringView protocol); >-WEBCORE_EXPORT bool isDefaultPortForProtocol(uint16_t port, StringView protocol); >-WEBCORE_EXPORT bool portAllowed(const URL&); // Blacklist ports that should never be used for Web resources. >- >-WEBCORE_EXPORT void registerDefaultPortForProtocolForTesting(uint16_t port, const String& protocol); >-WEBCORE_EXPORT void clearDefaultPortForProtocolMapForTesting(); >- >-bool isValidProtocol(const String&); >- >-String mimeTypeFromDataURL(const String& url); >- >-// FIXME: This is a wrong concept to expose, different parts of a URL need different escaping per the URL Standard. >-WEBCORE_EXPORT String encodeWithURLEscapeSequences(const String&); >- >-// Inlines. >- >-inline bool operator==(const URL& a, const URL& b) >-{ >- return a.string() == b.string(); >-} >- >-inline bool operator==(const URL& a, const String& b) >-{ >- return a.string() == b; >-} >- >-inline bool operator==(const String& a, const URL& b) >-{ >- return a == b.string(); >-} >- >-inline bool operator!=(const URL& a, const URL& b) >-{ >- return a.string() != b.string(); >-} >- >-inline bool operator!=(const URL& a, const String& b) >-{ >- return a.string() != b; >-} >- >-inline bool operator!=(const String& a, const URL& b) >-{ >- return a != b.string(); >-} >- >-// Inline versions of some non-GoogleURL functions so we can get inlining >-// without having to have a lot of ugly ifdefs in the class definition. >- >-inline bool URL::isNull() const >-{ >- return m_string.isNull(); >-} >- >-inline bool URL::isEmpty() const >-{ >- return m_string.isEmpty(); >-} >- >-inline bool URL::isValid() const >-{ >- return m_isValid; >-} >- >-inline bool URL::hasPath() const >-{ >- return m_pathEnd != m_hostEnd + m_portLength; >-} >- >-inline bool URL::hasUsername() const >-{ >- return m_userEnd > m_userStart; >-} >- >-inline bool URL::hasPassword() const >-{ >- return m_passwordEnd > (m_userEnd + 1); >-} >- >-inline bool URL::hasQuery() const >-{ >- return m_queryEnd > m_pathEnd; >-} >- >-inline bool URL::hasFragment() const >-{ >- return m_isValid && m_string.length() > m_queryEnd; >-} >- >-inline bool URL::protocolIsInHTTPFamily() const >-{ >- return m_protocolIsInHTTPFamily; >-} >- >-inline unsigned URL::pathStart() const >-{ >- return m_hostEnd + m_portLength; >-} >- >-inline unsigned URL::pathEnd() const >-{ >- return m_pathEnd; >-} >- >-inline unsigned URL::pathAfterLastSlash() const >-{ >- return m_pathAfterLastSlash; >-} >- >-WTF::TextStream& operator<<(WTF::TextStream&, const URL&); >- >-} // namespace WebCore >- >-namespace WTF { >-template<> struct DefaultHash<WebCore::URL>; >-template<> struct HashTraits<WebCore::URL>; >-} // namespace WTF >diff --git a/Source/WebCore/platform/URLHash.h b/Source/WebCore/platform/URLHash.h >deleted file mode 100644 >index 41d0ab96da35d31ac8db4eb4dabd3f4e1592b81b..0000000000000000000000000000000000000000 >--- a/Source/WebCore/platform/URLHash.h >+++ /dev/null >@@ -1,62 +0,0 @@ >-/* >- * Copyright (C) 2008 Apple Inc. All Rights Reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#ifndef URLHash_h >-#define URLHash_h >- >-#include "URL.h" >-#include <wtf/text/StringHash.h> >-#include <wtf/text/WTFString.h> >- >-namespace WebCore { >- >- struct URLHash { >- static unsigned hash(const URL& key) >- { >- return key.string().impl()->hash(); >- } >- >- static bool equal(const URL& a, const URL& b) >- { >- return StringHash::equal(a.string(), b.string()); >- } >- >- static const bool safeToCompareToEmptyOrDeleted = false; >- }; >- >-} // namespace WebCore >- >-namespace WTF { >- >-// URLHash is the default hash for String >-template<> struct DefaultHash<WebCore::URL> { >- using Hash = WebCore::URLHash; >-}; >- >-template<> struct HashTraits<WebCore::URL> : SimpleClassHashTraits<WebCore::URL> { }; >- >-} // namespace WTF >- >-#endif // URLHash_h >diff --git a/Source/WebCore/platform/URLParser.cpp b/Source/WebCore/platform/URLParser.cpp >deleted file mode 100644 >index 17bac49d9b65de8b104d5a6f75b2580b8b892c6d..0000000000000000000000000000000000000000 >--- a/Source/WebCore/platform/URLParser.cpp >+++ /dev/null >@@ -1,2926 +0,0 @@ >-/* >- * Copyright (C) 2016-2018 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#include "config.h" >-#include "URLParser.h" >- >-#include "Logging.h" >-#include "RuntimeApplicationChecks.h" >-#include <array> >-#include <mutex> >-#include <unicode/uidna.h> >-#include <unicode/utypes.h> >- >-namespace WebCore { >- >-#define URL_PARSER_DEBUGGING 0 >- >-#if URL_PARSER_DEBUGGING >-#define URL_PARSER_LOG(...) LOG(URLParser, __VA_ARGS__) >-#else >-#define URL_PARSER_LOG(...) >-#endif >- >-template<typename CharacterType> >-class CodePointIterator { >-public: >- ALWAYS_INLINE CodePointIterator() { } >- ALWAYS_INLINE CodePointIterator(const CharacterType* begin, const CharacterType* end) >- : m_begin(begin) >- , m_end(end) >- { >- } >- >- ALWAYS_INLINE CodePointIterator(const CodePointIterator& begin, const CodePointIterator& end) >- : CodePointIterator(begin.m_begin, end.m_begin) >- { >- ASSERT(end.m_begin >= begin.m_begin); >- } >- >- ALWAYS_INLINE UChar32 operator*() const; >- ALWAYS_INLINE CodePointIterator& operator++(); >- >- ALWAYS_INLINE bool operator==(const CodePointIterator& other) const >- { >- return m_begin == other.m_begin >- && m_end == other.m_end; >- } >- ALWAYS_INLINE bool operator!=(const CodePointIterator& other) const { return !(*this == other); } >- >- ALWAYS_INLINE CodePointIterator& operator=(const CodePointIterator& other) >- { >- m_begin = other.m_begin; >- m_end = other.m_end; >- return *this; >- } >- >- ALWAYS_INLINE bool atEnd() const >- { >- ASSERT(m_begin <= m_end); >- return m_begin >= m_end; >- } >- >- ALWAYS_INLINE size_t codeUnitsSince(const CharacterType* reference) const >- { >- ASSERT(m_begin >= reference); >- return m_begin - reference; >- } >- >- ALWAYS_INLINE size_t codeUnitsSince(const CodePointIterator& other) const >- { >- return codeUnitsSince(other.m_begin); >- } >- >-private: >- const CharacterType* m_begin { nullptr }; >- const CharacterType* m_end { nullptr }; >-}; >- >-template<> >-ALWAYS_INLINE UChar32 CodePointIterator<LChar>::operator*() const >-{ >- ASSERT(!atEnd()); >- return *m_begin; >-} >- >-template<> >-ALWAYS_INLINE auto CodePointIterator<LChar>::operator++() -> CodePointIterator& >-{ >- m_begin++; >- return *this; >-} >- >-template<> >-ALWAYS_INLINE UChar32 CodePointIterator<UChar>::operator*() const >-{ >- ASSERT(!atEnd()); >- UChar32 c; >- U16_GET(m_begin, 0, 0, m_end - m_begin, c); >- return c; >-} >- >-template<> >-ALWAYS_INLINE auto CodePointIterator<UChar>::operator++() -> CodePointIterator& >-{ >- unsigned i = 0; >- size_t length = m_end - m_begin; >- U16_FWD_1(m_begin, i, length); >- m_begin += i; >- return *this; >-} >- >-ALWAYS_INLINE static void appendCodePoint(Vector<UChar>& destination, UChar32 codePoint) >-{ >- if (U_IS_BMP(codePoint)) { >- destination.append(static_cast<UChar>(codePoint)); >- return; >- } >- destination.reserveCapacity(destination.size() + 2); >- destination.uncheckedAppend(U16_LEAD(codePoint)); >- destination.uncheckedAppend(U16_TRAIL(codePoint)); >-} >- >-enum URLCharacterClass { >- UserInfo = 0x1, >- Default = 0x2, >- ForbiddenHost = 0x4, >- QueryPercent = 0x8, >- SlashQuestionOrHash = 0x10, >- ValidScheme = 0x20, >-}; >- >-static const uint8_t characterClassTable[256] = { >- UserInfo | Default | QueryPercent | ForbiddenHost, // 0x0 >- UserInfo | Default | QueryPercent, // 0x1 >- UserInfo | Default | QueryPercent, // 0x2 >- UserInfo | Default | QueryPercent, // 0x3 >- UserInfo | Default | QueryPercent, // 0x4 >- UserInfo | Default | QueryPercent, // 0x5 >- UserInfo | Default | QueryPercent, // 0x6 >- UserInfo | Default | QueryPercent, // 0x7 >- UserInfo | Default | QueryPercent, // 0x8 >- UserInfo | Default | QueryPercent | ForbiddenHost, // 0x9 >- UserInfo | Default | QueryPercent | ForbiddenHost, // 0xA >- UserInfo | Default | QueryPercent, // 0xB >- UserInfo | Default | QueryPercent, // 0xC >- UserInfo | Default | QueryPercent | ForbiddenHost, // 0xD >- UserInfo | Default | QueryPercent, // 0xE >- UserInfo | Default | QueryPercent, // 0xF >- UserInfo | Default | QueryPercent, // 0x10 >- UserInfo | Default | QueryPercent, // 0x11 >- UserInfo | Default | QueryPercent, // 0x12 >- UserInfo | Default | QueryPercent, // 0x13 >- UserInfo | Default | QueryPercent, // 0x14 >- UserInfo | Default | QueryPercent, // 0x15 >- UserInfo | Default | QueryPercent, // 0x16 >- UserInfo | Default | QueryPercent, // 0x17 >- UserInfo | Default | QueryPercent, // 0x18 >- UserInfo | Default | QueryPercent, // 0x19 >- UserInfo | Default | QueryPercent, // 0x1A >- UserInfo | Default | QueryPercent, // 0x1B >- UserInfo | Default | QueryPercent, // 0x1C >- UserInfo | Default | QueryPercent, // 0x1D >- UserInfo | Default | QueryPercent, // 0x1E >- UserInfo | Default | QueryPercent, // 0x1F >- UserInfo | Default | QueryPercent | ForbiddenHost, // ' ' >- 0, // '!' >- UserInfo | Default | QueryPercent, // '"' >- UserInfo | Default | QueryPercent | SlashQuestionOrHash | ForbiddenHost, // '#' >- 0, // '$' >- ForbiddenHost, // '%' >- 0, // '&' >- 0, // '\'' >- 0, // '(' >- 0, // ')' >- 0, // '*' >- ValidScheme, // '+' >- 0, // ',' >- ValidScheme, // '-' >- ValidScheme, // '.' >- UserInfo | SlashQuestionOrHash | ForbiddenHost, // '/' >- ValidScheme, // '0' >- ValidScheme, // '1' >- ValidScheme, // '2' >- ValidScheme, // '3' >- ValidScheme, // '4' >- ValidScheme, // '5' >- ValidScheme, // '6' >- ValidScheme, // '7' >- ValidScheme, // '8' >- ValidScheme, // '9' >- UserInfo | ForbiddenHost, // ':' >- UserInfo, // ';' >- UserInfo | Default | QueryPercent | ForbiddenHost, // '<' >- UserInfo, // '=' >- UserInfo | Default | QueryPercent | ForbiddenHost, // '>' >- UserInfo | Default | SlashQuestionOrHash | ForbiddenHost, // '?' >- UserInfo | ForbiddenHost, // '@' >- ValidScheme, // 'A' >- ValidScheme, // 'B' >- ValidScheme, // 'C' >- ValidScheme, // 'D' >- ValidScheme, // 'E' >- ValidScheme, // 'F' >- ValidScheme, // 'G' >- ValidScheme, // 'H' >- ValidScheme, // 'I' >- ValidScheme, // 'J' >- ValidScheme, // 'K' >- ValidScheme, // 'L' >- ValidScheme, // 'M' >- ValidScheme, // 'N' >- ValidScheme, // 'O' >- ValidScheme, // 'P' >- ValidScheme, // 'Q' >- ValidScheme, // 'R' >- ValidScheme, // 'S' >- ValidScheme, // 'T' >- ValidScheme, // 'U' >- ValidScheme, // 'V' >- ValidScheme, // 'W' >- ValidScheme, // 'X' >- ValidScheme, // 'Y' >- ValidScheme, // 'Z' >- UserInfo | ForbiddenHost, // '[' >- UserInfo | SlashQuestionOrHash | ForbiddenHost, // '\\' >- UserInfo | ForbiddenHost, // ']' >- UserInfo, // '^' >- 0, // '_' >- UserInfo | Default, // '`' >- ValidScheme, // 'a' >- ValidScheme, // 'b' >- ValidScheme, // 'c' >- ValidScheme, // 'd' >- ValidScheme, // 'e' >- ValidScheme, // 'f' >- ValidScheme, // 'g' >- ValidScheme, // 'h' >- ValidScheme, // 'i' >- ValidScheme, // 'j' >- ValidScheme, // 'k' >- ValidScheme, // 'l' >- ValidScheme, // 'm' >- ValidScheme, // 'n' >- ValidScheme, // 'o' >- ValidScheme, // 'p' >- ValidScheme, // 'q' >- ValidScheme, // 'r' >- ValidScheme, // 's' >- ValidScheme, // 't' >- ValidScheme, // 'u' >- ValidScheme, // 'v' >- ValidScheme, // 'w' >- ValidScheme, // 'x' >- ValidScheme, // 'y' >- ValidScheme, // 'z' >- UserInfo | Default, // '{' >- UserInfo, // '|' >- UserInfo | Default, // '}' >- 0, // '~' >- QueryPercent, // 0x7F >- QueryPercent, // 0x80 >- QueryPercent, // 0x81 >- QueryPercent, // 0x82 >- QueryPercent, // 0x83 >- QueryPercent, // 0x84 >- QueryPercent, // 0x85 >- QueryPercent, // 0x86 >- QueryPercent, // 0x87 >- QueryPercent, // 0x88 >- QueryPercent, // 0x89 >- QueryPercent, // 0x8A >- QueryPercent, // 0x8B >- QueryPercent, // 0x8C >- QueryPercent, // 0x8D >- QueryPercent, // 0x8E >- QueryPercent, // 0x8F >- QueryPercent, // 0x90 >- QueryPercent, // 0x91 >- QueryPercent, // 0x92 >- QueryPercent, // 0x93 >- QueryPercent, // 0x94 >- QueryPercent, // 0x95 >- QueryPercent, // 0x96 >- QueryPercent, // 0x97 >- QueryPercent, // 0x98 >- QueryPercent, // 0x99 >- QueryPercent, // 0x9A >- QueryPercent, // 0x9B >- QueryPercent, // 0x9C >- QueryPercent, // 0x9D >- QueryPercent, // 0x9E >- QueryPercent, // 0x9F >- QueryPercent, // 0xA0 >- QueryPercent, // 0xA1 >- QueryPercent, // 0xA2 >- QueryPercent, // 0xA3 >- QueryPercent, // 0xA4 >- QueryPercent, // 0xA5 >- QueryPercent, // 0xA6 >- QueryPercent, // 0xA7 >- QueryPercent, // 0xA8 >- QueryPercent, // 0xA9 >- QueryPercent, // 0xAA >- QueryPercent, // 0xAB >- QueryPercent, // 0xAC >- QueryPercent, // 0xAD >- QueryPercent, // 0xAE >- QueryPercent, // 0xAF >- QueryPercent, // 0xB0 >- QueryPercent, // 0xB1 >- QueryPercent, // 0xB2 >- QueryPercent, // 0xB3 >- QueryPercent, // 0xB4 >- QueryPercent, // 0xB5 >- QueryPercent, // 0xB6 >- QueryPercent, // 0xB7 >- QueryPercent, // 0xB8 >- QueryPercent, // 0xB9 >- QueryPercent, // 0xBA >- QueryPercent, // 0xBB >- QueryPercent, // 0xBC >- QueryPercent, // 0xBD >- QueryPercent, // 0xBE >- QueryPercent, // 0xBF >- QueryPercent, // 0xC0 >- QueryPercent, // 0xC1 >- QueryPercent, // 0xC2 >- QueryPercent, // 0xC3 >- QueryPercent, // 0xC4 >- QueryPercent, // 0xC5 >- QueryPercent, // 0xC6 >- QueryPercent, // 0xC7 >- QueryPercent, // 0xC8 >- QueryPercent, // 0xC9 >- QueryPercent, // 0xCA >- QueryPercent, // 0xCB >- QueryPercent, // 0xCC >- QueryPercent, // 0xCD >- QueryPercent, // 0xCE >- QueryPercent, // 0xCF >- QueryPercent, // 0xD0 >- QueryPercent, // 0xD1 >- QueryPercent, // 0xD2 >- QueryPercent, // 0xD3 >- QueryPercent, // 0xD4 >- QueryPercent, // 0xD5 >- QueryPercent, // 0xD6 >- QueryPercent, // 0xD7 >- QueryPercent, // 0xD8 >- QueryPercent, // 0xD9 >- QueryPercent, // 0xDA >- QueryPercent, // 0xDB >- QueryPercent, // 0xDC >- QueryPercent, // 0xDD >- QueryPercent, // 0xDE >- QueryPercent, // 0xDF >- QueryPercent, // 0xE0 >- QueryPercent, // 0xE1 >- QueryPercent, // 0xE2 >- QueryPercent, // 0xE3 >- QueryPercent, // 0xE4 >- QueryPercent, // 0xE5 >- QueryPercent, // 0xE6 >- QueryPercent, // 0xE7 >- QueryPercent, // 0xE8 >- QueryPercent, // 0xE9 >- QueryPercent, // 0xEA >- QueryPercent, // 0xEB >- QueryPercent, // 0xEC >- QueryPercent, // 0xED >- QueryPercent, // 0xEE >- QueryPercent, // 0xEF >- QueryPercent, // 0xF0 >- QueryPercent, // 0xF1 >- QueryPercent, // 0xF2 >- QueryPercent, // 0xF3 >- QueryPercent, // 0xF4 >- QueryPercent, // 0xF5 >- QueryPercent, // 0xF6 >- QueryPercent, // 0xF7 >- QueryPercent, // 0xF8 >- QueryPercent, // 0xF9 >- QueryPercent, // 0xFA >- QueryPercent, // 0xFB >- QueryPercent, // 0xFC >- QueryPercent, // 0xFD >- QueryPercent, // 0xFE >- QueryPercent, // 0xFF >-}; >- >-template<typename CharacterType> ALWAYS_INLINE static bool isC0Control(CharacterType character) { return character <= 0x1F; } >-template<typename CharacterType> ALWAYS_INLINE static bool isC0ControlOrSpace(CharacterType character) { return character <= 0x20; } >-template<typename CharacterType> ALWAYS_INLINE static bool isTabOrNewline(CharacterType character) { return character <= 0xD && character >= 0x9 && character != 0xB && character != 0xC; } >-template<typename CharacterType> ALWAYS_INLINE static bool isInSimpleEncodeSet(CharacterType character) { return character > 0x7E || isC0Control(character); } >-template<typename CharacterType> ALWAYS_INLINE static bool isInDefaultEncodeSet(CharacterType character) { return character > 0x7E || characterClassTable[character] & Default; } >-template<typename CharacterType> ALWAYS_INLINE static bool isInUserInfoEncodeSet(CharacterType character) { return character > 0x7E || characterClassTable[character] & UserInfo; } >-template<typename CharacterType> ALWAYS_INLINE static bool isPercentOrNonASCII(CharacterType character) { return !isASCII(character) || character == '%'; } >-template<typename CharacterType> ALWAYS_INLINE static bool isSlashQuestionOrHash(CharacterType character) { return character <= '\\' && characterClassTable[character] & SlashQuestionOrHash; } >-template<typename CharacterType> ALWAYS_INLINE static bool isValidSchemeCharacter(CharacterType character) { return character <= 'z' && characterClassTable[character] & ValidScheme; } >-template<typename CharacterType> ALWAYS_INLINE static bool isForbiddenHostCodePoint(CharacterType character) { return character <= ']' && characterClassTable[character] & ForbiddenHost; } >-ALWAYS_INLINE static bool shouldPercentEncodeQueryByte(uint8_t byte, const bool& urlIsSpecial) >-{ >- if (characterClassTable[byte] & QueryPercent) >- return true; >- if (byte == '\'' && urlIsSpecial) >- return true; >- return false; >-} >- >-bool URLParser::isInUserInfoEncodeSet(UChar c) >-{ >- return WebCore::isInUserInfoEncodeSet(c); >-} >- >-template<typename CharacterType, URLParser::ReportSyntaxViolation reportSyntaxViolation> >-ALWAYS_INLINE void URLParser::advance(CodePointIterator<CharacterType>& iterator, const CodePointIterator<CharacterType>& iteratorForSyntaxViolationPosition) >-{ >- ++iterator; >- while (UNLIKELY(!iterator.atEnd() && isTabOrNewline(*iterator))) { >- if (reportSyntaxViolation == ReportSyntaxViolation::Yes) >- syntaxViolation(iteratorForSyntaxViolationPosition); >- ++iterator; >- } >-} >- >-template<typename CharacterType> >-bool URLParser::takesTwoAdvancesUntilEnd(CodePointIterator<CharacterType> iterator) >-{ >- if (iterator.atEnd()) >- return false; >- advance<CharacterType, ReportSyntaxViolation::No>(iterator); >- if (iterator.atEnd()) >- return false; >- advance<CharacterType, ReportSyntaxViolation::No>(iterator); >- return iterator.atEnd(); >-} >- >-template<typename CharacterType> >-ALWAYS_INLINE bool URLParser::isWindowsDriveLetter(CodePointIterator<CharacterType> iterator) >-{ >- if (iterator.atEnd() || !isASCIIAlpha(*iterator)) >- return false; >- advance<CharacterType, ReportSyntaxViolation::No>(iterator); >- if (iterator.atEnd()) >- return false; >- if (*iterator == ':') >- return true; >- if (UNLIKELY(*iterator == '|')) >- return true; >- return false; >-} >- >-ALWAYS_INLINE void URLParser::appendToASCIIBuffer(UChar32 codePoint) >-{ >- ASSERT(isASCII(codePoint)); >- if (UNLIKELY(m_didSeeSyntaxViolation)) >- m_asciiBuffer.append(codePoint); >-} >- >-ALWAYS_INLINE void URLParser::appendToASCIIBuffer(const char* characters, size_t length) >-{ >- if (UNLIKELY(m_didSeeSyntaxViolation)) >- m_asciiBuffer.append(characters, length); >-} >- >-template<typename CharacterType> >-void URLParser::appendWindowsDriveLetter(CodePointIterator<CharacterType>& iterator) >-{ >- ASSERT(isWindowsDriveLetter(iterator)); >- appendToASCIIBuffer(*iterator); >- advance(iterator); >- ASSERT(!iterator.atEnd()); >- ASSERT(*iterator == ':' || *iterator == '|'); >- if (*iterator == '|') >- syntaxViolation(iterator); >- appendToASCIIBuffer(':'); >- advance(iterator); >-} >- >-bool URLParser::copyBaseWindowsDriveLetter(const URL& base) >-{ >- if (base.protocolIs("file")) { >- RELEASE_ASSERT(base.m_hostEnd + base.m_portLength < base.m_string.length()); >- if (base.m_string.is8Bit()) { >- const LChar* begin = base.m_string.characters8(); >- CodePointIterator<LChar> c(begin + base.m_hostEnd + base.m_portLength + 1, begin + base.m_string.length()); >- if (isWindowsDriveLetter(c)) { >- appendWindowsDriveLetter(c); >- return true; >- } >- } else { >- const UChar* begin = base.m_string.characters16(); >- CodePointIterator<UChar> c(begin + base.m_hostEnd + base.m_portLength + 1, begin + base.m_string.length()); >- if (isWindowsDriveLetter(c)) { >- appendWindowsDriveLetter(c); >- return true; >- } >- } >- } >- return false; >-} >- >-template<typename CharacterType> >-bool URLParser::shouldCopyFileURL(CodePointIterator<CharacterType> iterator) >-{ >- if (!isWindowsDriveLetter(iterator)) >- return true; >- if (iterator.atEnd()) >- return false; >- advance(iterator); >- if (iterator.atEnd()) >- return true; >- advance(iterator); >- if (iterator.atEnd()) >- return true; >- return !isSlashQuestionOrHash(*iterator); >-} >- >-static void percentEncodeByte(uint8_t byte, Vector<LChar>& buffer) >-{ >- buffer.append('%'); >- buffer.append(upperNibbleToASCIIHexDigit(byte)); >- buffer.append(lowerNibbleToASCIIHexDigit(byte)); >-} >- >-void URLParser::percentEncodeByte(uint8_t byte) >-{ >- ASSERT(m_didSeeSyntaxViolation); >- appendToASCIIBuffer('%'); >- appendToASCIIBuffer(upperNibbleToASCIIHexDigit(byte)); >- appendToASCIIBuffer(lowerNibbleToASCIIHexDigit(byte)); >-} >- >-const char replacementCharacterUTF8PercentEncoded[10] = "%EF%BF%BD"; >-const size_t replacementCharacterUTF8PercentEncodedLength = sizeof(replacementCharacterUTF8PercentEncoded) - 1; >- >-template<bool(*isInCodeSet)(UChar32), typename CharacterType> >-ALWAYS_INLINE void URLParser::utf8PercentEncode(const CodePointIterator<CharacterType>& iterator) >-{ >- ASSERT(!iterator.atEnd()); >- UChar32 codePoint = *iterator; >- if (LIKELY(isASCII(codePoint))) { >- if (UNLIKELY(isInCodeSet(codePoint))) { >- syntaxViolation(iterator); >- percentEncodeByte(codePoint); >- } else >- appendToASCIIBuffer(codePoint); >- return; >- } >- ASSERT_WITH_MESSAGE(isInCodeSet(codePoint), "isInCodeSet should always return true for non-ASCII characters"); >- syntaxViolation(iterator); >- >- if (!U_IS_UNICODE_CHAR(codePoint)) { >- appendToASCIIBuffer(replacementCharacterUTF8PercentEncoded, replacementCharacterUTF8PercentEncodedLength); >- return; >- } >- >- uint8_t buffer[U8_MAX_LENGTH]; >- int32_t offset = 0; >- U8_APPEND_UNSAFE(buffer, offset, codePoint); >- for (int32_t i = 0; i < offset; ++i) >- percentEncodeByte(buffer[i]); >-} >- >-template<typename CharacterType> >-ALWAYS_INLINE void URLParser::utf8QueryEncode(const CodePointIterator<CharacterType>& iterator) >-{ >- ASSERT(!iterator.atEnd()); >- UChar32 codePoint = *iterator; >- if (LIKELY(isASCII(codePoint))) { >- if (UNLIKELY(shouldPercentEncodeQueryByte(codePoint, m_urlIsSpecial))) { >- syntaxViolation(iterator); >- percentEncodeByte(codePoint); >- } else >- appendToASCIIBuffer(codePoint); >- return; >- } >- >- syntaxViolation(iterator); >- >- if (!U_IS_UNICODE_CHAR(codePoint)) { >- appendToASCIIBuffer(replacementCharacterUTF8PercentEncoded, replacementCharacterUTF8PercentEncodedLength); >- return; >- } >- >- uint8_t buffer[U8_MAX_LENGTH]; >- int32_t offset = 0; >- U8_APPEND_UNSAFE(buffer, offset, codePoint); >- for (int32_t i = 0; i < offset; ++i) { >- auto byte = buffer[i]; >- if (shouldPercentEncodeQueryByte(byte, m_urlIsSpecial)) >- percentEncodeByte(byte); >- else >- appendToASCIIBuffer(byte); >- } >-} >- >-template<typename CharacterType> >-void URLParser::encodeNonUTF8Query(const Vector<UChar>& source, const URLTextEncoding& encoding, CodePointIterator<CharacterType> iterator) >-{ >- auto encoded = encoding.encodeForURLParsing(StringView(source.data(), source.size())); >- auto* data = encoded.data(); >- size_t length = encoded.size(); >- >- if (!length == !iterator.atEnd()) { >- syntaxViolation(iterator); >- return; >- } >- >- size_t i = 0; >- for (; i < length; ++i) { >- ASSERT(!iterator.atEnd()); >- uint8_t byte = data[i]; >- if (UNLIKELY(byte != *iterator)) { >- syntaxViolation(iterator); >- break; >- } >- if (UNLIKELY(shouldPercentEncodeQueryByte(byte, m_urlIsSpecial))) { >- syntaxViolation(iterator); >- break; >- } >- appendToASCIIBuffer(byte); >- ++iterator; >- } >- while (!iterator.atEnd() && isTabOrNewline(*iterator)) >- ++iterator; >- ASSERT((i == length) == iterator.atEnd()); >- for (; i < length; ++i) { >- ASSERT(m_didSeeSyntaxViolation); >- uint8_t byte = data[i]; >- if (shouldPercentEncodeQueryByte(byte, m_urlIsSpecial)) >- percentEncodeByte(byte); >- else >- appendToASCIIBuffer(byte); >- } >-} >- >-std::optional<uint16_t> URLParser::defaultPortForProtocol(StringView scheme) >-{ >- static const uint16_t ftpPort = 21; >- static const uint16_t gopherPort = 70; >- static const uint16_t httpPort = 80; >- static const uint16_t httpsPort = 443; >- static const uint16_t wsPort = 80; >- static const uint16_t wssPort = 443; >- >- auto length = scheme.length(); >- if (!length) >- return std::nullopt; >- switch (scheme[0]) { >- case 'w': >- switch (length) { >- case 2: >- if (scheme[1] == 's') >- return wsPort; >- return std::nullopt; >- case 3: >- if (scheme[1] == 's' >- && scheme[2] == 's') >- return wssPort; >- return std::nullopt; >- default: >- return false; >- } >- case 'h': >- switch (length) { >- case 4: >- if (scheme[1] == 't' >- && scheme[2] == 't' >- && scheme[3] == 'p') >- return httpPort; >- return std::nullopt; >- case 5: >- if (scheme[1] == 't' >- && scheme[2] == 't' >- && scheme[3] == 'p' >- && scheme[4] == 's') >- return httpsPort; >- return std::nullopt; >- default: >- return std::nullopt; >- } >- case 'g': >- if (length == 6 >- && scheme[1] == 'o' >- && scheme[2] == 'p' >- && scheme[3] == 'h' >- && scheme[4] == 'e' >- && scheme[5] == 'r') >- return gopherPort; >- return std::nullopt; >- case 'f': >- if (length == 3 >- && scheme[1] == 't' >- && scheme[2] == 'p') >- return ftpPort; >- return std::nullopt; >- default: >- return std::nullopt; >- } >-} >- >-enum class Scheme { >- WS, >- WSS, >- File, >- FTP, >- Gopher, >- HTTP, >- HTTPS, >- NonSpecial >-}; >- >-ALWAYS_INLINE static Scheme scheme(StringView scheme) >-{ >- auto length = scheme.length(); >- if (!length) >- return Scheme::NonSpecial; >- switch (scheme[0]) { >- case 'f': >- switch (length) { >- case 3: >- if (scheme[1] == 't' >- && scheme[2] == 'p') >- return Scheme::FTP; >- return Scheme::NonSpecial; >- case 4: >- if (scheme[1] == 'i' >- && scheme[2] == 'l' >- && scheme[3] == 'e') >- return Scheme::File; >- return Scheme::NonSpecial; >- default: >- return Scheme::NonSpecial; >- } >- case 'g': >- if (length == 6 >- && scheme[1] == 'o' >- && scheme[2] == 'p' >- && scheme[3] == 'h' >- && scheme[4] == 'e' >- && scheme[5] == 'r') >- return Scheme::Gopher; >- return Scheme::NonSpecial; >- case 'h': >- switch (length) { >- case 4: >- if (scheme[1] == 't' >- && scheme[2] == 't' >- && scheme[3] == 'p') >- return Scheme::HTTP; >- return Scheme::NonSpecial; >- case 5: >- if (scheme[1] == 't' >- && scheme[2] == 't' >- && scheme[3] == 'p' >- && scheme[4] == 's') >- return Scheme::HTTPS; >- return Scheme::NonSpecial; >- default: >- return Scheme::NonSpecial; >- } >- case 'w': >- switch (length) { >- case 2: >- if (scheme[1] == 's') >- return Scheme::WS; >- return Scheme::NonSpecial; >- case 3: >- if (scheme[1] == 's' >- && scheme[2] == 's') >- return Scheme::WSS; >- return Scheme::NonSpecial; >- default: >- return Scheme::NonSpecial; >- } >- default: >- return Scheme::NonSpecial; >- } >-} >- >-std::optional<String> URLParser::maybeCanonicalizeScheme(const String& scheme) >-{ >- if (scheme.isEmpty()) >- return std::nullopt; >- >- if (!isASCIIAlpha(scheme[0])) >- return std::nullopt; >- >- for (size_t i = 1; i < scheme.length(); ++i) { >- if (isASCIIAlphanumeric(scheme[i]) || scheme[i] == '+' || scheme[i] == '-' || scheme[i] == '.') >- continue; >- return std::nullopt; >- } >- >- return scheme.convertToASCIILowercase(); >-} >- >-bool URLParser::isSpecialScheme(const String& schemeArg) >-{ >- return scheme(schemeArg) != Scheme::NonSpecial; >-} >- >-enum class URLParser::URLPart { >- SchemeEnd, >- UserStart, >- UserEnd, >- PasswordEnd, >- HostEnd, >- PortEnd, >- PathAfterLastSlash, >- PathEnd, >- QueryEnd, >-}; >- >-size_t URLParser::urlLengthUntilPart(const URL& url, URLPart part) >-{ >- switch (part) { >- case URLPart::QueryEnd: >- return url.m_queryEnd; >- case URLPart::PathEnd: >- return url.m_pathEnd; >- case URLPart::PathAfterLastSlash: >- return url.m_pathAfterLastSlash; >- case URLPart::PortEnd: >- return url.m_hostEnd + url.m_portLength; >- case URLPart::HostEnd: >- return url.m_hostEnd; >- case URLPart::PasswordEnd: >- return url.m_passwordEnd; >- case URLPart::UserEnd: >- return url.m_userEnd; >- case URLPart::UserStart: >- return url.m_userStart; >- case URLPart::SchemeEnd: >- return url.m_schemeEnd; >- } >- ASSERT_NOT_REACHED(); >- return 0; >-} >- >-void URLParser::copyASCIIStringUntil(const String& string, size_t length) >-{ >- RELEASE_ASSERT(length <= string.length()); >- if (string.isNull()) >- return; >- ASSERT(m_asciiBuffer.isEmpty()); >- if (string.is8Bit()) >- appendToASCIIBuffer(string.characters8(), length); >- else { >- const UChar* characters = string.characters16(); >- for (size_t i = 0; i < length; ++i) { >- UChar c = characters[i]; >- ASSERT_WITH_SECURITY_IMPLICATION(isASCII(c)); >- appendToASCIIBuffer(c); >- } >- } >-} >- >-template<typename CharacterType> >-void URLParser::copyURLPartsUntil(const URL& base, URLPart part, const CodePointIterator<CharacterType>& iterator, const URLTextEncoding*& nonUTF8QueryEncoding) >-{ >- syntaxViolation(iterator); >- >- m_asciiBuffer.clear(); >- copyASCIIStringUntil(base.m_string, urlLengthUntilPart(base, part)); >- switch (part) { >- case URLPart::QueryEnd: >- m_url.m_queryEnd = base.m_queryEnd; >- FALLTHROUGH; >- case URLPart::PathEnd: >- m_url.m_pathEnd = base.m_pathEnd; >- FALLTHROUGH; >- case URLPart::PathAfterLastSlash: >- m_url.m_pathAfterLastSlash = base.m_pathAfterLastSlash; >- FALLTHROUGH; >- case URLPart::PortEnd: >- m_url.m_portLength = base.m_portLength; >- FALLTHROUGH; >- case URLPart::HostEnd: >- m_url.m_hostEnd = base.m_hostEnd; >- FALLTHROUGH; >- case URLPart::PasswordEnd: >- m_url.m_passwordEnd = base.m_passwordEnd; >- FALLTHROUGH; >- case URLPart::UserEnd: >- m_url.m_userEnd = base.m_userEnd; >- FALLTHROUGH; >- case URLPart::UserStart: >- m_url.m_userStart = base.m_userStart; >- FALLTHROUGH; >- case URLPart::SchemeEnd: >- m_url.m_isValid = base.m_isValid; >- m_url.m_protocolIsInHTTPFamily = base.m_protocolIsInHTTPFamily; >- m_url.m_schemeEnd = base.m_schemeEnd; >- } >- switch (scheme(StringView(m_asciiBuffer.data(), m_url.m_schemeEnd))) { >- case Scheme::WS: >- case Scheme::WSS: >- nonUTF8QueryEncoding = nullptr; >- m_urlIsSpecial = true; >- return; >- case Scheme::File: >- m_urlIsFile = true; >- FALLTHROUGH; >- case Scheme::FTP: >- case Scheme::Gopher: >- case Scheme::HTTP: >- case Scheme::HTTPS: >- m_urlIsSpecial = true; >- return; >- case Scheme::NonSpecial: >- m_urlIsSpecial = false; >- nonUTF8QueryEncoding = nullptr; >- return; >- } >- ASSERT_NOT_REACHED(); >-} >- >-static const char dotASCIICode[2] = {'2', 'e'}; >- >-template<typename CharacterType> >-ALWAYS_INLINE bool URLParser::isSingleDotPathSegment(CodePointIterator<CharacterType> c) >-{ >- if (c.atEnd()) >- return false; >- if (*c == '.') { >- advance<CharacterType, ReportSyntaxViolation::No>(c); >- return c.atEnd() || isSlashQuestionOrHash(*c); >- } >- if (*c != '%') >- return false; >- advance<CharacterType, ReportSyntaxViolation::No>(c); >- if (c.atEnd() || *c != dotASCIICode[0]) >- return false; >- advance<CharacterType, ReportSyntaxViolation::No>(c); >- if (c.atEnd()) >- return false; >- if (toASCIILower(*c) == dotASCIICode[1]) { >- advance<CharacterType, ReportSyntaxViolation::No>(c); >- return c.atEnd() || isSlashQuestionOrHash(*c); >- } >- return false; >-} >- >-template<typename CharacterType> >-ALWAYS_INLINE bool URLParser::isDoubleDotPathSegment(CodePointIterator<CharacterType> c) >-{ >- if (c.atEnd()) >- return false; >- if (*c == '.') { >- advance<CharacterType, ReportSyntaxViolation::No>(c); >- return isSingleDotPathSegment(c); >- } >- if (*c != '%') >- return false; >- advance<CharacterType, ReportSyntaxViolation::No>(c); >- if (c.atEnd() || *c != dotASCIICode[0]) >- return false; >- advance<CharacterType, ReportSyntaxViolation::No>(c); >- if (c.atEnd()) >- return false; >- if (toASCIILower(*c) == dotASCIICode[1]) { >- advance<CharacterType, ReportSyntaxViolation::No>(c); >- return isSingleDotPathSegment(c); >- } >- return false; >-} >- >-template<typename CharacterType> >-void URLParser::consumeSingleDotPathSegment(CodePointIterator<CharacterType>& c) >-{ >- ASSERT(isSingleDotPathSegment(c)); >- if (*c == '.') { >- advance(c); >- if (!c.atEnd()) { >- if (*c == '/' || *c == '\\') >- advance(c); >- else >- ASSERT(*c == '?' || *c == '#'); >- } >- } else { >- ASSERT(*c == '%'); >- advance(c); >- ASSERT(*c == dotASCIICode[0]); >- advance(c); >- ASSERT(toASCIILower(*c) == dotASCIICode[1]); >- advance(c); >- if (!c.atEnd()) { >- if (*c == '/' || *c == '\\') >- advance(c); >- else >- ASSERT(*c == '?' || *c == '#'); >- } >- } >-} >- >-template<typename CharacterType> >-void URLParser::consumeDoubleDotPathSegment(CodePointIterator<CharacterType>& c) >-{ >- ASSERT(isDoubleDotPathSegment(c)); >- if (*c == '.') >- advance(c); >- else { >- ASSERT(*c == '%'); >- advance(c); >- ASSERT(*c == dotASCIICode[0]); >- advance(c); >- ASSERT(toASCIILower(*c) == dotASCIICode[1]); >- advance(c); >- } >- consumeSingleDotPathSegment(c); >-} >- >-bool URLParser::shouldPopPath(unsigned newPathAfterLastSlash) >-{ >- ASSERT(m_didSeeSyntaxViolation); >- if (!m_urlIsFile) >- return true; >- >- ASSERT(m_url.m_pathAfterLastSlash <= m_asciiBuffer.size()); >- CodePointIterator<LChar> componentToPop(&m_asciiBuffer[newPathAfterLastSlash], &m_asciiBuffer[0] + m_url.m_pathAfterLastSlash); >- if (newPathAfterLastSlash == m_url.m_hostEnd + m_url.m_portLength + 1 && isWindowsDriveLetter(componentToPop)) >- return false; >- return true; >-} >- >-void URLParser::popPath() >-{ >- ASSERT(m_didSeeSyntaxViolation); >- if (m_url.m_pathAfterLastSlash > m_url.m_hostEnd + m_url.m_portLength + 1) { >- auto newPathAfterLastSlash = m_url.m_pathAfterLastSlash - 1; >- if (m_asciiBuffer[newPathAfterLastSlash] == '/') >- newPathAfterLastSlash--; >- while (newPathAfterLastSlash > m_url.m_hostEnd + m_url.m_portLength && m_asciiBuffer[newPathAfterLastSlash] != '/') >- newPathAfterLastSlash--; >- newPathAfterLastSlash++; >- if (shouldPopPath(newPathAfterLastSlash)) >- m_url.m_pathAfterLastSlash = newPathAfterLastSlash; >- } >- m_asciiBuffer.resize(m_url.m_pathAfterLastSlash); >-} >- >-template<typename CharacterType> >-void URLParser::syntaxViolation(const CodePointIterator<CharacterType>& iterator) >-{ >- if (m_didSeeSyntaxViolation) >- return; >- m_didSeeSyntaxViolation = true; >- >- ASSERT(m_asciiBuffer.isEmpty()); >- size_t codeUnitsToCopy = iterator.codeUnitsSince(reinterpret_cast<const CharacterType*>(m_inputBegin)); >- RELEASE_ASSERT(codeUnitsToCopy <= m_inputString.length()); >- m_asciiBuffer.reserveCapacity(m_inputString.length()); >- for (size_t i = 0; i < codeUnitsToCopy; ++i) { >- ASSERT(isASCII(m_inputString[i])); >- m_asciiBuffer.uncheckedAppend(m_inputString[i]); >- } >-} >- >-void URLParser::failure() >-{ >- m_url.invalidate(); >- m_url.m_string = m_inputString; >-} >- >-template<typename CharacterType> >-bool URLParser::checkLocalhostCodePoint(CodePointIterator<CharacterType>& iterator, UChar32 codePoint) >-{ >- if (iterator.atEnd() || toASCIILower(*iterator) != codePoint) >- return false; >- advance<CharacterType, ReportSyntaxViolation::No>(iterator); >- return true; >-} >- >-template<typename CharacterType> >-bool URLParser::isAtLocalhost(CodePointIterator<CharacterType> iterator) >-{ >- if (!checkLocalhostCodePoint(iterator, 'l')) >- return false; >- if (!checkLocalhostCodePoint(iterator, 'o')) >- return false; >- if (!checkLocalhostCodePoint(iterator, 'c')) >- return false; >- if (!checkLocalhostCodePoint(iterator, 'a')) >- return false; >- if (!checkLocalhostCodePoint(iterator, 'l')) >- return false; >- if (!checkLocalhostCodePoint(iterator, 'h')) >- return false; >- if (!checkLocalhostCodePoint(iterator, 'o')) >- return false; >- if (!checkLocalhostCodePoint(iterator, 's')) >- return false; >- if (!checkLocalhostCodePoint(iterator, 't')) >- return false; >- return iterator.atEnd(); >-} >- >-bool URLParser::isLocalhost(StringView view) >-{ >- if (view.is8Bit()) >- return isAtLocalhost(CodePointIterator<LChar>(view.characters8(), view.characters8() + view.length())); >- return isAtLocalhost(CodePointIterator<UChar>(view.characters16(), view.characters16() + view.length())); >-} >- >-ALWAYS_INLINE StringView URLParser::parsedDataView(size_t start, size_t length) >-{ >- if (UNLIKELY(m_didSeeSyntaxViolation)) { >- ASSERT(start + length <= m_asciiBuffer.size()); >- return StringView(m_asciiBuffer.data() + start, length); >- } >- ASSERT(start + length <= m_inputString.length()); >- return StringView(m_inputString).substring(start, length); >-} >- >-ALWAYS_INLINE UChar URLParser::parsedDataView(size_t position) >-{ >- if (UNLIKELY(m_didSeeSyntaxViolation)) >- return m_asciiBuffer[position]; >- return m_inputString[position]; >-} >- >-template<typename CharacterType> >-ALWAYS_INLINE size_t URLParser::currentPosition(const CodePointIterator<CharacterType>& iterator) >-{ >- if (UNLIKELY(m_didSeeSyntaxViolation)) >- return m_asciiBuffer.size(); >- >- return iterator.codeUnitsSince(reinterpret_cast<const CharacterType*>(m_inputBegin)); >-} >- >-URLParser::URLParser(const String& input, const URL& base, const URLTextEncoding* nonUTF8QueryEncoding) >- : m_inputString(input) >-{ >- if (input.isNull()) { >- if (base.isValid() && !base.m_cannotBeABaseURL) { >- m_url = base; >- m_url.removeFragmentIdentifier(); >- } >- return; >- } >- >- if (input.is8Bit()) { >- m_inputBegin = input.characters8(); >- parse(input.characters8(), input.length(), base, nonUTF8QueryEncoding); >- } else { >- m_inputBegin = input.characters16(); >- parse(input.characters16(), input.length(), base, nonUTF8QueryEncoding); >- } >- >- ASSERT(!m_url.m_isValid >- || m_didSeeSyntaxViolation == (m_url.string() != input) >- || (input.isAllSpecialCharacters<isC0ControlOrSpace>() >- && m_url.m_string == base.m_string.left(base.m_queryEnd))); >- ASSERT(internalValuesConsistent(m_url)); >-#if !ASSERT_DISABLED >- if (!m_didSeeSyntaxViolation) { >- // Force a syntax violation at the beginning to make sure we get the same result. >- URLParser parser(makeString(" ", input), base, nonUTF8QueryEncoding); >- URL parsed = parser.result(); >- if (parsed.isValid()) >- ASSERT(allValuesEqual(parser.result(), m_url)); >- } >-#endif >-} >- >-template<typename CharacterType> >-void URLParser::parse(const CharacterType* input, const unsigned length, const URL& base, const URLTextEncoding* nonUTF8QueryEncoding) >-{ >- URL_PARSER_LOG("Parsing URL <%s> base <%s>", String(input, length).utf8().data(), base.string().utf8().data()); >- m_url = { }; >- ASSERT(m_asciiBuffer.isEmpty()); >- >- Vector<UChar> queryBuffer; >- >- unsigned endIndex = length; >- while (UNLIKELY(endIndex && isC0ControlOrSpace(input[endIndex - 1]))) { >- syntaxViolation(CodePointIterator<CharacterType>(input, input)); >- endIndex--; >- } >- CodePointIterator<CharacterType> c(input, input + endIndex); >- CodePointIterator<CharacterType> authorityOrHostBegin; >- CodePointIterator<CharacterType> queryBegin; >- while (UNLIKELY(!c.atEnd() && isC0ControlOrSpace(*c))) { >- syntaxViolation(c); >- ++c; >- } >- auto beginAfterControlAndSpace = c; >- >- enum class State : uint8_t { >- SchemeStart, >- Scheme, >- NoScheme, >- SpecialRelativeOrAuthority, >- PathOrAuthority, >- Relative, >- RelativeSlash, >- SpecialAuthoritySlashes, >- SpecialAuthorityIgnoreSlashes, >- AuthorityOrHost, >- Host, >- File, >- FileSlash, >- FileHost, >- PathStart, >- Path, >- CannotBeABaseURLPath, >- UTF8Query, >- NonUTF8Query, >- Fragment, >- }; >- >-#define LOG_STATE(x) URL_PARSER_LOG("State %s, code point %c, parsed data <%s> size %zu", x, *c, parsedDataView(0, currentPosition(c)).utf8().data(), currentPosition(c)) >-#define LOG_FINAL_STATE(x) URL_PARSER_LOG("Final State: %s", x) >- >- State state = State::SchemeStart; >- while (!c.atEnd()) { >- if (UNLIKELY(isTabOrNewline(*c))) { >- syntaxViolation(c); >- ++c; >- continue; >- } >- >- switch (state) { >- case State::SchemeStart: >- LOG_STATE("SchemeStart"); >- if (isASCIIAlpha(*c)) { >- if (UNLIKELY(isASCIIUpper(*c))) >- syntaxViolation(c); >- appendToASCIIBuffer(toASCIILower(*c)); >- advance(c); >- if (c.atEnd()) { >- m_asciiBuffer.clear(); >- state = State::NoScheme; >- c = beginAfterControlAndSpace; >- break; >- } >- state = State::Scheme; >- } else >- state = State::NoScheme; >- break; >- case State::Scheme: >- LOG_STATE("Scheme"); >- if (isValidSchemeCharacter(*c)) { >- if (UNLIKELY(isASCIIUpper(*c))) >- syntaxViolation(c); >- appendToASCIIBuffer(toASCIILower(*c)); >- } else if (*c == ':') { >- unsigned schemeEnd = currentPosition(c); >- if (schemeEnd > URL::maxSchemeLength) { >- failure(); >- return; >- } >- m_url.m_schemeEnd = schemeEnd; >- StringView urlScheme = parsedDataView(0, m_url.m_schemeEnd); >- appendToASCIIBuffer(':'); >- switch (scheme(urlScheme)) { >- case Scheme::File: >- m_urlIsSpecial = true; >- m_urlIsFile = true; >- state = State::File; >- ++c; >- break; >- case Scheme::WS: >- case Scheme::WSS: >- nonUTF8QueryEncoding = nullptr; >- m_urlIsSpecial = true; >- if (base.protocolIs(urlScheme)) >- state = State::SpecialRelativeOrAuthority; >- else >- state = State::SpecialAuthoritySlashes; >- ++c; >- break; >- case Scheme::HTTP: >- case Scheme::HTTPS: >- m_url.m_protocolIsInHTTPFamily = true; >- FALLTHROUGH; >- case Scheme::FTP: >- case Scheme::Gopher: >- m_urlIsSpecial = true; >- if (base.protocolIs(urlScheme)) >- state = State::SpecialRelativeOrAuthority; >- else >- state = State::SpecialAuthoritySlashes; >- ++c; >- break; >- case Scheme::NonSpecial: >- nonUTF8QueryEncoding = nullptr; >- auto maybeSlash = c; >- advance(maybeSlash); >- if (!maybeSlash.atEnd() && *maybeSlash == '/') { >- appendToASCIIBuffer('/'); >- c = maybeSlash; >- state = State::PathOrAuthority; >- ASSERT(*c == '/'); >- ++c; >- m_url.m_userStart = currentPosition(c); >- } else { >- ++c; >- m_url.m_userStart = currentPosition(c); >- m_url.m_userEnd = m_url.m_userStart; >- m_url.m_passwordEnd = m_url.m_userStart; >- m_url.m_hostEnd = m_url.m_userStart; >- m_url.m_portLength = 0; >- m_url.m_pathAfterLastSlash = m_url.m_userStart; >- m_url.m_cannotBeABaseURL = true; >- state = State::CannotBeABaseURLPath; >- } >- break; >- } >- break; >- } else { >- m_asciiBuffer.clear(); >- state = State::NoScheme; >- c = beginAfterControlAndSpace; >- break; >- } >- advance(c); >- if (c.atEnd()) { >- m_asciiBuffer.clear(); >- state = State::NoScheme; >- c = beginAfterControlAndSpace; >- } >- break; >- case State::NoScheme: >- LOG_STATE("NoScheme"); >- if (!base.isValid() || (base.m_cannotBeABaseURL && *c != '#')) { >- failure(); >- return; >- } >- if (base.m_cannotBeABaseURL && *c == '#') { >- copyURLPartsUntil(base, URLPart::QueryEnd, c, nonUTF8QueryEncoding); >- state = State::Fragment; >- appendToASCIIBuffer('#'); >- ++c; >- break; >- } >- if (!base.protocolIs("file")) { >- state = State::Relative; >- break; >- } >- copyURLPartsUntil(base, URLPart::SchemeEnd, c, nonUTF8QueryEncoding); >- appendToASCIIBuffer(':'); >- state = State::File; >- break; >- case State::SpecialRelativeOrAuthority: >- LOG_STATE("SpecialRelativeOrAuthority"); >- if (*c == '/') { >- appendToASCIIBuffer('/'); >- advance(c); >- if (c.atEnd()) { >- failure(); >- return; >- } >- if (*c == '/') { >- appendToASCIIBuffer('/'); >- state = State::SpecialAuthorityIgnoreSlashes; >- ++c; >- } else >- state = State::RelativeSlash; >- } else >- state = State::Relative; >- break; >- case State::PathOrAuthority: >- LOG_STATE("PathOrAuthority"); >- if (*c == '/') { >- appendToASCIIBuffer('/'); >- state = State::AuthorityOrHost; >- advance(c); >- m_url.m_userStart = currentPosition(c); >- authorityOrHostBegin = c; >- } else { >- ASSERT(parsedDataView(currentPosition(c) - 1) == '/'); >- m_url.m_userStart = currentPosition(c) - 1; >- m_url.m_userEnd = m_url.m_userStart; >- m_url.m_passwordEnd = m_url.m_userStart; >- m_url.m_hostEnd = m_url.m_userStart; >- m_url.m_portLength = 0; >- m_url.m_pathAfterLastSlash = m_url.m_userStart + 1; >- state = State::Path; >- } >- break; >- case State::Relative: >- LOG_STATE("Relative"); >- switch (*c) { >- case '/': >- case '\\': >- state = State::RelativeSlash; >- ++c; >- break; >- case '?': >- copyURLPartsUntil(base, URLPart::PathEnd, c, nonUTF8QueryEncoding); >- appendToASCIIBuffer('?'); >- ++c; >- if (nonUTF8QueryEncoding) { >- queryBegin = c; >- state = State::NonUTF8Query; >- } else >- state = State::UTF8Query; >- break; >- case '#': >- copyURLPartsUntil(base, URLPart::QueryEnd, c, nonUTF8QueryEncoding); >- appendToASCIIBuffer('#'); >- state = State::Fragment; >- ++c; >- break; >- default: >- copyURLPartsUntil(base, URLPart::PathAfterLastSlash, c, nonUTF8QueryEncoding); >- if (currentPosition(c) && parsedDataView(currentPosition(c) - 1) != '/') { >- appendToASCIIBuffer('/'); >- m_url.m_pathAfterLastSlash = currentPosition(c); >- } >- state = State::Path; >- break; >- } >- break; >- case State::RelativeSlash: >- LOG_STATE("RelativeSlash"); >- if (*c == '/' || *c == '\\') { >- ++c; >- copyURLPartsUntil(base, URLPart::SchemeEnd, c, nonUTF8QueryEncoding); >- appendToASCIIBuffer("://", 3); >- if (m_urlIsSpecial) >- state = State::SpecialAuthorityIgnoreSlashes; >- else { >- m_url.m_userStart = currentPosition(c); >- state = State::AuthorityOrHost; >- authorityOrHostBegin = c; >- } >- } else { >- copyURLPartsUntil(base, URLPart::PortEnd, c, nonUTF8QueryEncoding); >- appendToASCIIBuffer('/'); >- m_url.m_pathAfterLastSlash = base.m_hostEnd + base.m_portLength + 1; >- state = State::Path; >- } >- break; >- case State::SpecialAuthoritySlashes: >- LOG_STATE("SpecialAuthoritySlashes"); >- if (LIKELY(*c == '/' || *c == '\\')) { >- if (UNLIKELY(*c == '\\')) >- syntaxViolation(c); >- appendToASCIIBuffer('/'); >- advance(c); >- if (LIKELY(!c.atEnd() && (*c == '/' || *c == '\\'))) { >- if (UNLIKELY(*c == '\\')) >- syntaxViolation(c); >- ++c; >- appendToASCIIBuffer('/'); >- } else { >- syntaxViolation(c); >- appendToASCIIBuffer('/'); >- } >- } else { >- syntaxViolation(c); >- appendToASCIIBuffer("//", 2); >- } >- state = State::SpecialAuthorityIgnoreSlashes; >- break; >- case State::SpecialAuthorityIgnoreSlashes: >- LOG_STATE("SpecialAuthorityIgnoreSlashes"); >- if (*c == '/' || *c == '\\') { >- syntaxViolation(c); >- ++c; >- } else { >- m_url.m_userStart = currentPosition(c); >- state = State::AuthorityOrHost; >- authorityOrHostBegin = c; >- } >- break; >- case State::AuthorityOrHost: >- do { >- LOG_STATE("AuthorityOrHost"); >- if (*c == '@') { >- auto lastAt = c; >- auto findLastAt = c; >- while (!findLastAt.atEnd()) { >- URL_PARSER_LOG("Finding last @: %c", *findLastAt); >- if (*findLastAt == '@') >- lastAt = findLastAt; >- bool isSlash = *findLastAt == '/' || (m_urlIsSpecial && *findLastAt == '\\'); >- if (isSlash || *findLastAt == '?' || *findLastAt == '#') >- break; >- ++findLastAt; >- } >- parseAuthority(CodePointIterator<CharacterType>(authorityOrHostBegin, lastAt)); >- c = lastAt; >- advance(c); >- authorityOrHostBegin = c; >- state = State::Host; >- m_hostHasPercentOrNonASCII = false; >- break; >- } >- bool isSlash = *c == '/' || (m_urlIsSpecial && *c == '\\'); >- if (isSlash || *c == '?' || *c == '#') { >- auto iterator = CodePointIterator<CharacterType>(authorityOrHostBegin, c); >- if (iterator.atEnd()) { >- if (m_urlIsSpecial) >- return failure(); >- m_url.m_userEnd = currentPosition(c); >- m_url.m_passwordEnd = m_url.m_userEnd; >- m_url.m_hostEnd = m_url.m_userEnd; >- m_url.m_portLength = 0; >- m_url.m_pathAfterLastSlash = m_url.m_userEnd; >- } else { >- m_url.m_userEnd = currentPosition(authorityOrHostBegin); >- m_url.m_passwordEnd = m_url.m_userEnd; >- if (!parseHostAndPort(iterator)) { >- failure(); >- return; >- } >- if (UNLIKELY(!isSlash)) { >- if (m_urlIsSpecial) { >- syntaxViolation(c); >- appendToASCIIBuffer('/'); >- } >- m_url.m_pathAfterLastSlash = currentPosition(c); >- } >- } >- state = State::Path; >- break; >- } >- if (isPercentOrNonASCII(*c)) >- m_hostHasPercentOrNonASCII = true; >- ++c; >- } while (!c.atEnd()); >- break; >- case State::Host: >- do { >- LOG_STATE("Host"); >- if (*c == '/' || *c == '?' || *c == '#') { >- if (!parseHostAndPort(CodePointIterator<CharacterType>(authorityOrHostBegin, c))) { >- failure(); >- return; >- } >- if (*c == '?' || *c == '#') { >- syntaxViolation(c); >- appendToASCIIBuffer('/'); >- m_url.m_pathAfterLastSlash = currentPosition(c); >- } >- state = State::Path; >- break; >- } >- if (isPercentOrNonASCII(*c)) >- m_hostHasPercentOrNonASCII = true; >- ++c; >- } while (!c.atEnd()); >- break; >- case State::File: >- LOG_STATE("File"); >- switch (*c) { >- case '\\': >- syntaxViolation(c); >- FALLTHROUGH; >- case '/': >- appendToASCIIBuffer('/'); >- state = State::FileSlash; >- ++c; >- break; >- case '?': >- syntaxViolation(c); >- if (base.isValid() && base.protocolIs("file")) { >- copyURLPartsUntil(base, URLPart::PathEnd, c, nonUTF8QueryEncoding); >- appendToASCIIBuffer('?'); >- ++c; >- } else { >- appendToASCIIBuffer("///?", 4); >- ++c; >- m_url.m_userStart = currentPosition(c) - 2; >- m_url.m_userEnd = m_url.m_userStart; >- m_url.m_passwordEnd = m_url.m_userStart; >- m_url.m_hostEnd = m_url.m_userStart; >- m_url.m_portLength = 0; >- m_url.m_pathAfterLastSlash = m_url.m_userStart + 1; >- m_url.m_pathEnd = m_url.m_pathAfterLastSlash; >- } >- if (nonUTF8QueryEncoding) { >- queryBegin = c; >- state = State::NonUTF8Query; >- } else >- state = State::UTF8Query; >- break; >- case '#': >- syntaxViolation(c); >- if (base.isValid() && base.protocolIs("file")) { >- copyURLPartsUntil(base, URLPart::QueryEnd, c, nonUTF8QueryEncoding); >- appendToASCIIBuffer('#'); >- } else { >- appendToASCIIBuffer("///#", 4); >- m_url.m_userStart = currentPosition(c) - 2; >- m_url.m_userEnd = m_url.m_userStart; >- m_url.m_passwordEnd = m_url.m_userStart; >- m_url.m_hostEnd = m_url.m_userStart; >- m_url.m_portLength = 0; >- m_url.m_pathAfterLastSlash = m_url.m_userStart + 1; >- m_url.m_pathEnd = m_url.m_pathAfterLastSlash; >- m_url.m_queryEnd = m_url.m_pathAfterLastSlash; >- } >- state = State::Fragment; >- ++c; >- break; >- default: >- syntaxViolation(c); >- if (base.isValid() && base.protocolIs("file") && shouldCopyFileURL(c)) >- copyURLPartsUntil(base, URLPart::PathAfterLastSlash, c, nonUTF8QueryEncoding); >- else { >- appendToASCIIBuffer("///", 3); >- m_url.m_userStart = currentPosition(c) - 1; >- m_url.m_userEnd = m_url.m_userStart; >- m_url.m_passwordEnd = m_url.m_userStart; >- m_url.m_hostEnd = m_url.m_userStart; >- m_url.m_portLength = 0; >- m_url.m_pathAfterLastSlash = m_url.m_userStart + 1; >- if (isWindowsDriveLetter(c)) >- appendWindowsDriveLetter(c); >- } >- state = State::Path; >- break; >- } >- break; >- case State::FileSlash: >- LOG_STATE("FileSlash"); >- if (LIKELY(*c == '/' || *c == '\\')) { >- if (UNLIKELY(*c == '\\')) >- syntaxViolation(c); >- appendToASCIIBuffer('/'); >- advance(c); >- m_url.m_userStart = currentPosition(c); >- m_url.m_userEnd = m_url.m_userStart; >- m_url.m_passwordEnd = m_url.m_userStart; >- m_url.m_hostEnd = m_url.m_userStart; >- m_url.m_portLength = 0; >- authorityOrHostBegin = c; >- state = State::FileHost; >- break; >- } >- syntaxViolation(c); >- appendToASCIIBuffer("//", 2); >- m_url.m_userStart = currentPosition(c) - 1; >- m_url.m_userEnd = m_url.m_userStart; >- m_url.m_passwordEnd = m_url.m_userStart; >- m_url.m_hostEnd = m_url.m_userStart; >- m_url.m_portLength = 0; >- if (isWindowsDriveLetter(c)) { >- appendWindowsDriveLetter(c); >- m_url.m_pathAfterLastSlash = m_url.m_userStart + 1; >- } else if (copyBaseWindowsDriveLetter(base)) { >- appendToASCIIBuffer('/'); >- m_url.m_pathAfterLastSlash = m_url.m_userStart + 4; >- } else >- m_url.m_pathAfterLastSlash = m_url.m_userStart + 1; >- state = State::Path; >- break; >- case State::FileHost: >- do { >- LOG_STATE("FileHost"); >- if (isSlashQuestionOrHash(*c)) { >- bool windowsQuirk = takesTwoAdvancesUntilEnd(CodePointIterator<CharacterType>(authorityOrHostBegin, c)) >- && isWindowsDriveLetter(authorityOrHostBegin); >- if (windowsQuirk) { >- syntaxViolation(authorityOrHostBegin); >- appendToASCIIBuffer('/'); >- appendWindowsDriveLetter(authorityOrHostBegin); >- } >- if (windowsQuirk || authorityOrHostBegin == c) { >- ASSERT(windowsQuirk || parsedDataView(currentPosition(c) - 1) == '/'); >- if (UNLIKELY(*c == '?')) { >- syntaxViolation(c); >- appendToASCIIBuffer("/?", 2); >- ++c; >- if (nonUTF8QueryEncoding) { >- queryBegin = c; >- state = State::NonUTF8Query; >- } else >- state = State::UTF8Query; >- m_url.m_pathAfterLastSlash = currentPosition(c) - 1; >- m_url.m_pathEnd = m_url.m_pathAfterLastSlash; >- break; >- } >- if (UNLIKELY(*c == '#')) { >- syntaxViolation(c); >- appendToASCIIBuffer("/#", 2); >- ++c; >- m_url.m_pathAfterLastSlash = currentPosition(c) - 1; >- m_url.m_pathEnd = m_url.m_pathAfterLastSlash; >- m_url.m_queryEnd = m_url.m_pathAfterLastSlash; >- state = State::Fragment; >- break; >- } >- state = State::Path; >- break; >- } >- if (!parseHostAndPort(CodePointIterator<CharacterType>(authorityOrHostBegin, c))) { >- failure(); >- return; >- } >- if (UNLIKELY(isLocalhost(parsedDataView(m_url.m_passwordEnd, currentPosition(c) - m_url.m_passwordEnd)))) { >- syntaxViolation(c); >- m_asciiBuffer.shrink(m_url.m_passwordEnd); >- m_url.m_hostEnd = currentPosition(c); >- m_url.m_portLength = 0; >- } >- >- state = State::PathStart; >- break; >- } >- if (isPercentOrNonASCII(*c)) >- m_hostHasPercentOrNonASCII = true; >- ++c; >- } while (!c.atEnd()); >- break; >- case State::PathStart: >- LOG_STATE("PathStart"); >- if (*c != '/' && *c != '\\') { >- syntaxViolation(c); >- appendToASCIIBuffer('/'); >- } >- m_url.m_pathAfterLastSlash = currentPosition(c); >- state = State::Path; >- break; >- case State::Path: >- LOG_STATE("Path"); >- if (*c == '/' || (m_urlIsSpecial && *c == '\\')) { >- if (UNLIKELY(m_urlIsSpecial && *c == '\\')) >- syntaxViolation(c); >- appendToASCIIBuffer('/'); >- ++c; >- m_url.m_pathAfterLastSlash = currentPosition(c); >- break; >- } >- if (UNLIKELY(currentPosition(c) && parsedDataView(currentPosition(c) - 1) == '/')) { >- if (UNLIKELY(isDoubleDotPathSegment(c))) { >- syntaxViolation(c); >- consumeDoubleDotPathSegment(c); >- popPath(); >- break; >- } >- if (UNLIKELY(isSingleDotPathSegment(c))) { >- syntaxViolation(c); >- consumeSingleDotPathSegment(c); >- break; >- } >- } >- if (*c == '?') { >- m_url.m_pathEnd = currentPosition(c); >- appendToASCIIBuffer('?'); >- ++c; >- if (nonUTF8QueryEncoding) { >- queryBegin = c; >- state = State::NonUTF8Query; >- } else >- state = State::UTF8Query; >- break; >- } >- if (*c == '#') { >- m_url.m_pathEnd = currentPosition(c); >- m_url.m_queryEnd = m_url.m_pathEnd; >- state = State::Fragment; >- break; >- } >- utf8PercentEncode<isInDefaultEncodeSet>(c); >- ++c; >- break; >- case State::CannotBeABaseURLPath: >- LOG_STATE("CannotBeABaseURLPath"); >- if (*c == '?') { >- m_url.m_pathEnd = currentPosition(c); >- appendToASCIIBuffer('?'); >- ++c; >- if (nonUTF8QueryEncoding) { >- queryBegin = c; >- state = State::NonUTF8Query; >- } else >- state = State::UTF8Query; >- } else if (*c == '#') { >- m_url.m_pathEnd = currentPosition(c); >- m_url.m_queryEnd = m_url.m_pathEnd; >- state = State::Fragment; >- } else if (*c == '/') { >- appendToASCIIBuffer('/'); >- ++c; >- m_url.m_pathAfterLastSlash = currentPosition(c); >- } else { >- utf8PercentEncode<isInSimpleEncodeSet>(c); >- ++c; >- } >- break; >- case State::UTF8Query: >- LOG_STATE("UTF8Query"); >- ASSERT(queryBegin == CodePointIterator<CharacterType>()); >- if (*c == '#') { >- m_url.m_queryEnd = currentPosition(c); >- state = State::Fragment; >- break; >- } >- ASSERT(!nonUTF8QueryEncoding); >- utf8QueryEncode(c); >- ++c; >- break; >- case State::NonUTF8Query: >- do { >- LOG_STATE("NonUTF8Query"); >- ASSERT(queryBegin != CodePointIterator<CharacterType>()); >- if (*c == '#') { >- encodeNonUTF8Query(queryBuffer, *nonUTF8QueryEncoding, CodePointIterator<CharacterType>(queryBegin, c)); >- m_url.m_queryEnd = currentPosition(c); >- state = State::Fragment; >- break; >- } >- appendCodePoint(queryBuffer, *c); >- advance(c, queryBegin); >- } while (!c.atEnd()); >- break; >- case State::Fragment: >- URL_PARSER_LOG("State Fragment"); >- utf8PercentEncode<isInSimpleEncodeSet>(c); >- ++c; >- break; >- } >- } >- >- switch (state) { >- case State::SchemeStart: >- LOG_FINAL_STATE("SchemeStart"); >- if (!currentPosition(c) && base.isValid() && !base.m_cannotBeABaseURL) { >- m_url = base; >- m_url.removeFragmentIdentifier(); >- return; >- } >- failure(); >- return; >- case State::Scheme: >- LOG_FINAL_STATE("Scheme"); >- failure(); >- return; >- case State::NoScheme: >- LOG_FINAL_STATE("NoScheme"); >- RELEASE_ASSERT_NOT_REACHED(); >- case State::SpecialRelativeOrAuthority: >- LOG_FINAL_STATE("SpecialRelativeOrAuthority"); >- copyURLPartsUntil(base, URLPart::QueryEnd, c, nonUTF8QueryEncoding); >- break; >- case State::PathOrAuthority: >- LOG_FINAL_STATE("PathOrAuthority"); >- ASSERT(m_url.m_userStart); >- ASSERT(m_url.m_userStart == currentPosition(c)); >- ASSERT(parsedDataView(currentPosition(c) - 1) == '/'); >- m_url.m_userStart--; >- m_url.m_userEnd = m_url.m_userStart; >- m_url.m_passwordEnd = m_url.m_userStart; >- m_url.m_hostEnd = m_url.m_userStart; >- m_url.m_portLength = 0; >- m_url.m_pathAfterLastSlash = m_url.m_userStart + 1; >- m_url.m_pathEnd = m_url.m_pathAfterLastSlash; >- m_url.m_queryEnd = m_url.m_pathAfterLastSlash; >- break; >- case State::Relative: >- LOG_FINAL_STATE("Relative"); >- RELEASE_ASSERT_NOT_REACHED(); >- case State::RelativeSlash: >- LOG_FINAL_STATE("RelativeSlash"); >- copyURLPartsUntil(base, URLPart::PortEnd, c, nonUTF8QueryEncoding); >- appendToASCIIBuffer('/'); >- m_url.m_pathAfterLastSlash = m_url.m_hostEnd + m_url.m_portLength + 1; >- m_url.m_pathEnd = m_url.m_pathAfterLastSlash; >- m_url.m_queryEnd = m_url.m_pathAfterLastSlash; >- break; >- case State::SpecialAuthoritySlashes: >- LOG_FINAL_STATE("SpecialAuthoritySlashes"); >- m_url.m_userStart = currentPosition(c); >- m_url.m_userEnd = m_url.m_userStart; >- m_url.m_passwordEnd = m_url.m_userStart; >- m_url.m_hostEnd = m_url.m_userStart; >- m_url.m_portLength = 0; >- m_url.m_pathAfterLastSlash = m_url.m_userStart; >- m_url.m_pathEnd = m_url.m_userStart; >- m_url.m_queryEnd = m_url.m_userStart; >- break; >- case State::SpecialAuthorityIgnoreSlashes: >- LOG_FINAL_STATE("SpecialAuthorityIgnoreSlashes"); >- failure(); >- return; >- case State::AuthorityOrHost: >- LOG_FINAL_STATE("AuthorityOrHost"); >- m_url.m_userEnd = currentPosition(authorityOrHostBegin); >- m_url.m_passwordEnd = m_url.m_userEnd; >- if (authorityOrHostBegin.atEnd()) { >- m_url.m_userEnd = m_url.m_userStart; >- m_url.m_passwordEnd = m_url.m_userStart; >- m_url.m_hostEnd = m_url.m_userStart; >- m_url.m_portLength = 0; >- m_url.m_pathEnd = m_url.m_userStart; >- } else if (!parseHostAndPort(authorityOrHostBegin)) { >- failure(); >- return; >- } else { >- if (m_urlIsSpecial) { >- syntaxViolation(c); >- appendToASCIIBuffer('/'); >- m_url.m_pathEnd = m_url.m_hostEnd + m_url.m_portLength + 1; >- } else >- m_url.m_pathEnd = m_url.m_hostEnd + m_url.m_portLength; >- } >- m_url.m_pathAfterLastSlash = m_url.m_pathEnd; >- m_url.m_queryEnd = m_url.m_pathEnd; >- break; >- case State::Host: >- LOG_FINAL_STATE("Host"); >- if (!parseHostAndPort(authorityOrHostBegin)) { >- failure(); >- return; >- } >- if (m_urlIsSpecial) { >- syntaxViolation(c); >- appendToASCIIBuffer('/'); >- m_url.m_pathEnd = m_url.m_hostEnd + m_url.m_portLength + 1; >- } else >- m_url.m_pathEnd = m_url.m_hostEnd + m_url.m_portLength; >- m_url.m_pathAfterLastSlash = m_url.m_pathEnd; >- m_url.m_queryEnd = m_url.m_pathEnd; >- break; >- case State::File: >- LOG_FINAL_STATE("File"); >- if (base.isValid() && base.protocolIs("file")) { >- copyURLPartsUntil(base, URLPart::QueryEnd, c, nonUTF8QueryEncoding); >- break; >- } >- syntaxViolation(c); >- appendToASCIIBuffer("///", 3); >- m_url.m_userStart = currentPosition(c) - 1; >- m_url.m_userEnd = m_url.m_userStart; >- m_url.m_passwordEnd = m_url.m_userStart; >- m_url.m_hostEnd = m_url.m_userStart; >- m_url.m_portLength = 0; >- m_url.m_pathAfterLastSlash = m_url.m_userStart + 1; >- m_url.m_pathEnd = m_url.m_pathAfterLastSlash; >- m_url.m_queryEnd = m_url.m_pathAfterLastSlash; >- break; >- case State::FileSlash: >- LOG_FINAL_STATE("FileSlash"); >- syntaxViolation(c); >- m_url.m_userStart = currentPosition(c) + 1; >- appendToASCIIBuffer("//", 2); >- m_url.m_userEnd = m_url.m_userStart; >- m_url.m_passwordEnd = m_url.m_userStart; >- m_url.m_hostEnd = m_url.m_userStart; >- m_url.m_portLength = 0; >- if (copyBaseWindowsDriveLetter(base)) { >- appendToASCIIBuffer('/'); >- m_url.m_pathAfterLastSlash = m_url.m_userStart + 4; >- } else >- m_url.m_pathAfterLastSlash = m_url.m_userStart + 1; >- m_url.m_pathEnd = m_url.m_pathAfterLastSlash; >- m_url.m_queryEnd = m_url.m_pathAfterLastSlash; >- break; >- case State::FileHost: >- LOG_FINAL_STATE("FileHost"); >- if (takesTwoAdvancesUntilEnd(CodePointIterator<CharacterType>(authorityOrHostBegin, c)) >- && isWindowsDriveLetter(authorityOrHostBegin)) { >- syntaxViolation(authorityOrHostBegin); >- appendToASCIIBuffer('/'); >- appendWindowsDriveLetter(authorityOrHostBegin); >- m_url.m_pathAfterLastSlash = currentPosition(c); >- m_url.m_pathEnd = m_url.m_pathAfterLastSlash; >- m_url.m_queryEnd = m_url.m_pathAfterLastSlash; >- break; >- } >- >- if (authorityOrHostBegin == c) { >- syntaxViolation(c); >- appendToASCIIBuffer('/'); >- m_url.m_userStart = currentPosition(c) - 1; >- m_url.m_userEnd = m_url.m_userStart; >- m_url.m_passwordEnd = m_url.m_userStart; >- m_url.m_hostEnd = m_url.m_userStart; >- m_url.m_portLength = 0; >- m_url.m_pathAfterLastSlash = m_url.m_userStart + 1; >- m_url.m_pathEnd = m_url.m_pathAfterLastSlash; >- m_url.m_queryEnd = m_url.m_pathAfterLastSlash; >- break; >- } >- >- if (!parseHostAndPort(CodePointIterator<CharacterType>(authorityOrHostBegin, c))) { >- failure(); >- return; >- } >- >- syntaxViolation(c); >- if (isLocalhost(parsedDataView(m_url.m_passwordEnd, currentPosition(c) - m_url.m_passwordEnd))) { >- m_asciiBuffer.shrink(m_url.m_passwordEnd); >- m_url.m_hostEnd = currentPosition(c); >- m_url.m_portLength = 0; >- } >- appendToASCIIBuffer('/'); >- m_url.m_pathAfterLastSlash = m_url.m_hostEnd + m_url.m_portLength + 1; >- m_url.m_pathEnd = m_url.m_pathAfterLastSlash; >- m_url.m_queryEnd = m_url.m_pathAfterLastSlash; >- break; >- case State::PathStart: >- LOG_FINAL_STATE("PathStart"); >- RELEASE_ASSERT_NOT_REACHED(); >- case State::Path: >- LOG_FINAL_STATE("Path"); >- m_url.m_pathEnd = currentPosition(c); >- m_url.m_queryEnd = m_url.m_pathEnd; >- break; >- case State::CannotBeABaseURLPath: >- LOG_FINAL_STATE("CannotBeABaseURLPath"); >- m_url.m_pathEnd = currentPosition(c); >- m_url.m_queryEnd = m_url.m_pathEnd; >- break; >- case State::UTF8Query: >- LOG_FINAL_STATE("UTF8Query"); >- ASSERT(queryBegin == CodePointIterator<CharacterType>()); >- m_url.m_queryEnd = currentPosition(c); >- break; >- case State::NonUTF8Query: >- LOG_FINAL_STATE("NonUTF8Query"); >- ASSERT(queryBegin != CodePointIterator<CharacterType>()); >- encodeNonUTF8Query(queryBuffer, *nonUTF8QueryEncoding, CodePointIterator<CharacterType>(queryBegin, c)); >- m_url.m_queryEnd = currentPosition(c); >- break; >- case State::Fragment: >- LOG_FINAL_STATE("Fragment"); >- break; >- } >- >- if (LIKELY(!m_didSeeSyntaxViolation)) { >- m_url.m_string = m_inputString; >- ASSERT(m_asciiBuffer.isEmpty()); >- } else >- m_url.m_string = String::adopt(WTFMove(m_asciiBuffer)); >- m_url.m_isValid = true; >- URL_PARSER_LOG("Parsed URL <%s>", m_url.m_string.utf8().data()); >-} >- >-template<typename CharacterType> >-void URLParser::parseAuthority(CodePointIterator<CharacterType> iterator) >-{ >- if (UNLIKELY(iterator.atEnd())) { >- syntaxViolation(iterator); >- m_url.m_userEnd = currentPosition(iterator); >- m_url.m_passwordEnd = m_url.m_userEnd; >- return; >- } >- for (; !iterator.atEnd(); advance(iterator)) { >- if (*iterator == ':') { >- m_url.m_userEnd = currentPosition(iterator); >- auto iteratorAtColon = iterator; >- ++iterator; >- bool tabOrNewlineAfterColon = false; >- while (UNLIKELY(!iterator.atEnd() && isTabOrNewline(*iterator))) { >- tabOrNewlineAfterColon = true; >- ++iterator; >- } >- if (UNLIKELY(iterator.atEnd())) { >- syntaxViolation(iteratorAtColon); >- m_url.m_passwordEnd = m_url.m_userEnd; >- if (m_url.m_userEnd > m_url.m_userStart) >- appendToASCIIBuffer('@'); >- return; >- } >- if (tabOrNewlineAfterColon) >- syntaxViolation(iteratorAtColon); >- appendToASCIIBuffer(':'); >- break; >- } >- utf8PercentEncode<WebCore::isInUserInfoEncodeSet>(iterator); >- } >- for (; !iterator.atEnd(); advance(iterator)) >- utf8PercentEncode<WebCore::isInUserInfoEncodeSet>(iterator); >- m_url.m_passwordEnd = currentPosition(iterator); >- if (!m_url.m_userEnd) >- m_url.m_userEnd = m_url.m_passwordEnd; >- appendToASCIIBuffer('@'); >-} >- >-template<typename UnsignedIntegerType> >-void URLParser::appendNumberToASCIIBuffer(UnsignedIntegerType number) >-{ >- LChar buf[sizeof(UnsignedIntegerType) * 3 + 1]; >- LChar* end = std::end(buf); >- LChar* p = end; >- do { >- *--p = (number % 10) + '0'; >- number /= 10; >- } while (number); >- appendToASCIIBuffer(p, end - p); >-} >- >-void URLParser::serializeIPv4(IPv4Address address) >-{ >- appendNumberToASCIIBuffer<uint8_t>(address >> 24); >- appendToASCIIBuffer('.'); >- appendNumberToASCIIBuffer<uint8_t>(address >> 16); >- appendToASCIIBuffer('.'); >- appendNumberToASCIIBuffer<uint8_t>(address >> 8); >- appendToASCIIBuffer('.'); >- appendNumberToASCIIBuffer<uint8_t>(address); >-} >- >-static size_t zeroSequenceLength(const std::array<uint16_t, 8>& address, size_t begin) >-{ >- size_t end = begin; >- for (; end < 8; end++) { >- if (address[end]) >- break; >- } >- return end - begin; >-} >- >-static std::optional<size_t> findLongestZeroSequence(const std::array<uint16_t, 8>& address) >-{ >- std::optional<size_t> longest; >- size_t longestLength = 0; >- for (size_t i = 0; i < 8; i++) { >- size_t length = zeroSequenceLength(address, i); >- if (length) { >- if (length > 1 && (!longest || longestLength < length)) { >- longest = i; >- longestLength = length; >- } >- i += length; >- } >- } >- return longest; >-} >- >-void URLParser::serializeIPv6Piece(uint16_t piece) >-{ >- bool printed = false; >- if (auto nibble0 = piece >> 12) { >- appendToASCIIBuffer(lowerNibbleToLowercaseASCIIHexDigit(nibble0)); >- printed = true; >- } >- auto nibble1 = piece >> 8 & 0xF; >- if (printed || nibble1) { >- appendToASCIIBuffer(lowerNibbleToLowercaseASCIIHexDigit(nibble1)); >- printed = true; >- } >- auto nibble2 = piece >> 4 & 0xF; >- if (printed || nibble2) >- appendToASCIIBuffer(lowerNibbleToLowercaseASCIIHexDigit(nibble2)); >- appendToASCIIBuffer(lowerNibbleToLowercaseASCIIHexDigit(piece & 0xF)); >-} >- >-void URLParser::serializeIPv6(URLParser::IPv6Address address) >-{ >- appendToASCIIBuffer('['); >- auto compressPointer = findLongestZeroSequence(address); >- for (size_t piece = 0; piece < 8; piece++) { >- if (compressPointer && compressPointer.value() == piece) { >- ASSERT(!address[piece]); >- if (piece) >- appendToASCIIBuffer(':'); >- else >- appendToASCIIBuffer("::", 2); >- while (piece < 8 && !address[piece]) >- piece++; >- if (piece == 8) >- break; >- } >- serializeIPv6Piece(address[piece]); >- if (piece < 7) >- appendToASCIIBuffer(':'); >- } >- appendToASCIIBuffer(']'); >-} >- >-enum class URLParser::IPv4PieceParsingError { >- Failure, >- Overflow, >-}; >- >-template<typename CharacterType> >-Expected<uint32_t, URLParser::IPv4PieceParsingError> URLParser::parseIPv4Piece(CodePointIterator<CharacterType>& iterator, bool& didSeeSyntaxViolation) >-{ >- enum class State : uint8_t { >- UnknownBase, >- Decimal, >- OctalOrHex, >- Octal, >- Hex, >- }; >- State state = State::UnknownBase; >- Checked<uint32_t, RecordOverflow> value = 0; >- if (!iterator.atEnd() && *iterator == '.') >- return makeUnexpected(IPv4PieceParsingError::Failure); >- while (!iterator.atEnd()) { >- if (isTabOrNewline(*iterator)) { >- didSeeSyntaxViolation = true; >- ++iterator; >- continue; >- } >- if (*iterator == '.') { >- ASSERT(!value.hasOverflowed()); >- return value.unsafeGet(); >- } >- switch (state) { >- case State::UnknownBase: >- if (UNLIKELY(*iterator == '0')) { >- ++iterator; >- state = State::OctalOrHex; >- break; >- } >- state = State::Decimal; >- break; >- case State::OctalOrHex: >- didSeeSyntaxViolation = true; >- if (*iterator == 'x' || *iterator == 'X') { >- ++iterator; >- state = State::Hex; >- break; >- } >- state = State::Octal; >- break; >- case State::Decimal: >- if (!isASCIIDigit(*iterator)) >- return makeUnexpected(IPv4PieceParsingError::Failure); >- value *= 10; >- value += *iterator - '0'; >- if (UNLIKELY(value.hasOverflowed())) >- return makeUnexpected(IPv4PieceParsingError::Overflow); >- ++iterator; >- break; >- case State::Octal: >- ASSERT(didSeeSyntaxViolation); >- if (*iterator < '0' || *iterator > '7') >- return makeUnexpected(IPv4PieceParsingError::Failure); >- value *= 8; >- value += *iterator - '0'; >- if (UNLIKELY(value.hasOverflowed())) >- return makeUnexpected(IPv4PieceParsingError::Overflow); >- ++iterator; >- break; >- case State::Hex: >- ASSERT(didSeeSyntaxViolation); >- if (!isASCIIHexDigit(*iterator)) >- return makeUnexpected(IPv4PieceParsingError::Failure); >- value *= 16; >- value += toASCIIHexValue(*iterator); >- if (UNLIKELY(value.hasOverflowed())) >- return makeUnexpected(IPv4PieceParsingError::Overflow); >- ++iterator; >- break; >- } >- } >- ASSERT(!value.hasOverflowed()); >- return value.unsafeGet(); >-} >- >-ALWAYS_INLINE static uint64_t pow256(size_t exponent) >-{ >- RELEASE_ASSERT(exponent <= 4); >- uint64_t values[5] = {1, 256, 256 * 256, 256 * 256 * 256, 256ull * 256 * 256 * 256 }; >- return values[exponent]; >-} >- >-enum class URLParser::IPv4ParsingError { >- Failure, >- NotIPv4, >-}; >- >-template<typename CharacterTypeForSyntaxViolation, typename CharacterType> >-Expected<URLParser::IPv4Address, URLParser::IPv4ParsingError> URLParser::parseIPv4Host(const CodePointIterator<CharacterTypeForSyntaxViolation>& iteratorForSyntaxViolationPosition, CodePointIterator<CharacterType> iterator) >-{ >- Vector<Expected<uint32_t, URLParser::IPv4PieceParsingError>, 4> items; >- bool didSeeSyntaxViolation = false; >- if (!iterator.atEnd() && *iterator == '.') >- return makeUnexpected(IPv4ParsingError::NotIPv4); >- while (!iterator.atEnd()) { >- if (isTabOrNewline(*iterator)) { >- didSeeSyntaxViolation = true; >- ++iterator; >- continue; >- } >- if (items.size() >= 4) >- return makeUnexpected(IPv4ParsingError::NotIPv4); >- items.append(parseIPv4Piece(iterator, didSeeSyntaxViolation)); >- if (!iterator.atEnd() && *iterator == '.') { >- ++iterator; >- if (iterator.atEnd()) >- syntaxViolation(iteratorForSyntaxViolationPosition); >- else if (*iterator == '.') >- return makeUnexpected(IPv4ParsingError::NotIPv4); >- } >- } >- if (!iterator.atEnd() || !items.size() || items.size() > 4) >- return makeUnexpected(IPv4ParsingError::NotIPv4); >- for (const auto& item : items) { >- if (!item.has_value() && item.error() == IPv4PieceParsingError::Failure) >- return makeUnexpected(IPv4ParsingError::NotIPv4); >- } >- for (const auto& item : items) { >- if (!item.has_value() && item.error() == IPv4PieceParsingError::Overflow) >- return makeUnexpected(IPv4ParsingError::Failure); >- } >- if (items.size() > 1) { >- for (size_t i = 0; i < items.size() - 1; i++) { >- if (items[i].value() > 255) >- return makeUnexpected(IPv4ParsingError::Failure); >- } >- } >- if (items[items.size() - 1].value() >= pow256(5 - items.size())) >- return makeUnexpected(IPv4ParsingError::Failure); >- >- if (didSeeSyntaxViolation) >- syntaxViolation(iteratorForSyntaxViolationPosition); >- for (const auto& item : items) { >- if (item.value() > 255) >- syntaxViolation(iteratorForSyntaxViolationPosition); >- } >- >- if (UNLIKELY(items.size() != 4)) >- syntaxViolation(iteratorForSyntaxViolationPosition); >- >- IPv4Address ipv4 = items.takeLast().value(); >- for (size_t counter = 0; counter < items.size(); ++counter) >- ipv4 += items[counter].value() * pow256(3 - counter); >- return ipv4; >-} >- >-template<typename CharacterType> >-std::optional<uint32_t> URLParser::parseIPv4PieceInsideIPv6(CodePointIterator<CharacterType>& iterator) >-{ >- if (iterator.atEnd()) >- return std::nullopt; >- uint32_t piece = 0; >- bool leadingZeros = false; >- size_t digitCount = 0; >- while (!iterator.atEnd()) { >- if (!isASCIIDigit(*iterator)) >- return std::nullopt; >- ++digitCount; >- if (!piece && *iterator == '0') { >- if (leadingZeros) >- return std::nullopt; >- leadingZeros = true; >- } >- if (!piece && *iterator == '0') >- leadingZeros = true; >- piece = piece * 10 + *iterator - '0'; >- if (piece > 255) >- return std::nullopt; >- advance<CharacterType, ReportSyntaxViolation::No>(iterator); >- if (iterator.atEnd()) >- break; >- if (*iterator == '.') >- break; >- } >- if (piece && leadingZeros) >- return std::nullopt; >- return piece; >-} >- >-template<typename CharacterType> >-std::optional<URLParser::IPv4Address> URLParser::parseIPv4AddressInsideIPv6(CodePointIterator<CharacterType> iterator) >-{ >- IPv4Address address = 0; >- for (size_t i = 0; i < 4; ++i) { >- if (std::optional<uint32_t> piece = parseIPv4PieceInsideIPv6(iterator)) >- address = (address << 8) + piece.value(); >- else >- return std::nullopt; >- if (i < 3) { >- if (iterator.atEnd()) >- return std::nullopt; >- if (*iterator != '.') >- return std::nullopt; >- advance<CharacterType, ReportSyntaxViolation::No>(iterator); >- } else if (!iterator.atEnd()) >- return std::nullopt; >- } >- ASSERT(iterator.atEnd()); >- return address; >-} >- >-template<typename CharacterType> >-std::optional<URLParser::IPv6Address> URLParser::parseIPv6Host(CodePointIterator<CharacterType> c) >-{ >- ASSERT(*c == '['); >- const auto hostBegin = c; >- advance(c, hostBegin); >- if (c.atEnd()) >- return std::nullopt; >- >- IPv6Address address = {{0, 0, 0, 0, 0, 0, 0, 0}}; >- size_t piecePointer = 0; >- std::optional<size_t> compressPointer; >- >- if (*c == ':') { >- advance(c, hostBegin); >- if (c.atEnd()) >- return std::nullopt; >- if (*c != ':') >- return std::nullopt; >- advance(c, hostBegin); >- ++piecePointer; >- compressPointer = piecePointer; >- } >- >- while (!c.atEnd()) { >- if (piecePointer == 8) >- return std::nullopt; >- if (*c == ':') { >- if (compressPointer) >- return std::nullopt; >- advance(c, hostBegin); >- ++piecePointer; >- compressPointer = piecePointer; >- continue; >- } >- if (piecePointer == 6 || (compressPointer && piecePointer < 6)) { >- if (std::optional<IPv4Address> ipv4Address = parseIPv4AddressInsideIPv6(c)) { >- if (compressPointer && piecePointer == 5) >- return std::nullopt; >- syntaxViolation(hostBegin); >- address[piecePointer++] = ipv4Address.value() >> 16; >- address[piecePointer++] = ipv4Address.value() & 0xFFFF; >- c = { }; >- break; >- } >- } >- uint16_t value = 0; >- size_t length = 0; >- bool leadingZeros = false; >- for (; length < 4; length++) { >- if (c.atEnd()) >- break; >- if (!isASCIIHexDigit(*c)) >- break; >- if (isASCIIUpper(*c)) >- syntaxViolation(hostBegin); >- if (*c == '0' && !length) >- leadingZeros = true; >- value = value * 0x10 + toASCIIHexValue(*c); >- advance(c, hostBegin); >- } >- >- if (UNLIKELY((value && leadingZeros) || (!value && length > 1))) >- syntaxViolation(hostBegin); >- >- address[piecePointer++] = value; >- if (c.atEnd()) >- break; >- if (piecePointer == 8 || *c != ':') >- return std::nullopt; >- advance(c, hostBegin); >- } >- >- if (!c.atEnd()) >- return std::nullopt; >- >- if (compressPointer) { >- size_t swaps = piecePointer - compressPointer.value(); >- piecePointer = 7; >- while (swaps) >- std::swap(address[piecePointer--], address[compressPointer.value() + swaps-- - 1]); >- } else if (piecePointer != 8) >- return std::nullopt; >- >- std::optional<size_t> possibleCompressPointer = findLongestZeroSequence(address); >- if (possibleCompressPointer) >- possibleCompressPointer.value()++; >- if (UNLIKELY(compressPointer != possibleCompressPointer)) >- syntaxViolation(hostBegin); >- >- return address; >-} >- >-template<typename CharacterType> >-URLParser::LCharBuffer URLParser::percentDecode(const LChar* input, size_t length, const CodePointIterator<CharacterType>& iteratorForSyntaxViolationPosition) >-{ >- LCharBuffer output; >- output.reserveInitialCapacity(length); >- >- for (size_t i = 0; i < length; ++i) { >- uint8_t byte = input[i]; >- if (byte != '%') >- output.uncheckedAppend(byte); >- else if (length > 2 && i < length - 2) { >- if (isASCIIHexDigit(input[i + 1]) && isASCIIHexDigit(input[i + 2])) { >- syntaxViolation(iteratorForSyntaxViolationPosition); >- output.uncheckedAppend(toASCIIHexValue(input[i + 1], input[i + 2])); >- i += 2; >- } else >- output.uncheckedAppend(byte); >- } else >- output.uncheckedAppend(byte); >- } >- return output; >-} >- >-URLParser::LCharBuffer URLParser::percentDecode(const LChar* input, size_t length) >-{ >- LCharBuffer output; >- output.reserveInitialCapacity(length); >- >- for (size_t i = 0; i < length; ++i) { >- uint8_t byte = input[i]; >- if (byte != '%') >- output.uncheckedAppend(byte); >- else if (length > 2 && i < length - 2) { >- if (isASCIIHexDigit(input[i + 1]) && isASCIIHexDigit(input[i + 2])) { >- output.uncheckedAppend(toASCIIHexValue(input[i + 1], input[i + 2])); >- i += 2; >- } else >- output.uncheckedAppend(byte); >- } else >- output.uncheckedAppend(byte); >- } >- return output; >-} >- >-template<typename CharacterType> std::optional<URLParser::LCharBuffer> URLParser::domainToASCII(StringImpl& domain, const CodePointIterator<CharacterType>& iteratorForSyntaxViolationPosition) >-{ >- LCharBuffer ascii; >- if (domain.isAllASCII()) { >- size_t length = domain.length(); >- if (domain.is8Bit()) { >- const LChar* characters = domain.characters8(); >- ascii.reserveInitialCapacity(length); >- for (size_t i = 0; i < length; ++i) { >- if (UNLIKELY(isASCIIUpper(characters[i]))) >- syntaxViolation(iteratorForSyntaxViolationPosition); >- ascii.uncheckedAppend(toASCIILower(characters[i])); >- } >- } else { >- const UChar* characters = domain.characters16(); >- ascii.reserveInitialCapacity(length); >- for (size_t i = 0; i < length; ++i) { >- if (UNLIKELY(isASCIIUpper(characters[i]))) >- syntaxViolation(iteratorForSyntaxViolationPosition); >- ascii.uncheckedAppend(toASCIILower(characters[i])); >- } >- } >- return ascii; >- } >- >- const size_t maxDomainLength = 64; >- UChar hostnameBuffer[maxDomainLength]; >- UErrorCode error = U_ZERO_ERROR; >- UIDNAInfo processingDetails = UIDNA_INFO_INITIALIZER; >- int32_t numCharactersConverted = uidna_nameToASCII(&internationalDomainNameTranscoder(), StringView(domain).upconvertedCharacters(), domain.length(), hostnameBuffer, maxDomainLength, &processingDetails, &error); >- ASSERT(numCharactersConverted <= static_cast<int32_t>(maxDomainLength)); >- >- if (U_SUCCESS(error) && !processingDetails.errors) { >- for (int32_t i = 0; i < numCharactersConverted; ++i) { >- ASSERT(isASCII(hostnameBuffer[i])); >- ASSERT(!isASCIIUpper(hostnameBuffer[i])); >- } >- ascii.append(hostnameBuffer, numCharactersConverted); >- if (domain != StringView(ascii.data(), ascii.size())) >- syntaxViolation(iteratorForSyntaxViolationPosition); >- return ascii; >- } >- return std::nullopt; >-} >- >-bool URLParser::hasForbiddenHostCodePoint(const URLParser::LCharBuffer& asciiDomain) >-{ >- for (size_t i = 0; i < asciiDomain.size(); ++i) { >- if (isForbiddenHostCodePoint(asciiDomain[i])) >- return true; >- } >- return false; >-} >- >-template<typename CharacterType> >-bool URLParser::parsePort(CodePointIterator<CharacterType>& iterator) >-{ >- ASSERT(*iterator == ':'); >- auto colonIterator = iterator; >- advance(iterator, colonIterator); >- uint32_t port = 0; >- if (UNLIKELY(iterator.atEnd())) { >- unsigned portLength = currentPosition(colonIterator) - m_url.m_hostEnd; >- RELEASE_ASSERT(portLength <= URL::maxPortLength); >- m_url.m_portLength = portLength; >- syntaxViolation(colonIterator); >- return true; >- } >- size_t digitCount = 0; >- bool leadingZeros = false; >- for (; !iterator.atEnd(); ++iterator) { >- if (UNLIKELY(isTabOrNewline(*iterator))) { >- syntaxViolation(colonIterator); >- continue; >- } >- if (isASCIIDigit(*iterator)) { >- if (*iterator == '0' && !digitCount) >- leadingZeros = true; >- ++digitCount; >- port = port * 10 + *iterator - '0'; >- if (port > std::numeric_limits<uint16_t>::max()) >- return false; >- } else >- return false; >- } >- >- if (port && leadingZeros) >- syntaxViolation(colonIterator); >- >- if (!port && digitCount > 1) >- syntaxViolation(colonIterator); >- >- ASSERT(port == static_cast<uint16_t>(port)); >- if (UNLIKELY(defaultPortForProtocol(parsedDataView(0, m_url.m_schemeEnd)) == static_cast<uint16_t>(port))) >- syntaxViolation(colonIterator); >- else { >- appendToASCIIBuffer(':'); >- ASSERT(port <= std::numeric_limits<uint16_t>::max()); >- appendNumberToASCIIBuffer<uint16_t>(static_cast<uint16_t>(port)); >- } >- >- unsigned portLength = currentPosition(iterator) - m_url.m_hostEnd; >- RELEASE_ASSERT(portLength <= URL::maxPortLength); >- m_url.m_portLength = portLength; >- return true; >-} >- >-template<typename CharacterType> >-bool URLParser::parseHostAndPort(CodePointIterator<CharacterType> iterator) >-{ >- if (iterator.atEnd()) >- return false; >- if (*iterator == ':') >- return false; >- if (*iterator == '[') { >- auto ipv6End = iterator; >- while (!ipv6End.atEnd() && *ipv6End != ']') >- ++ipv6End; >- if (ipv6End.atEnd()) >- return false; >- if (auto address = parseIPv6Host(CodePointIterator<CharacterType>(iterator, ipv6End))) { >- serializeIPv6(address.value()); >- if (!ipv6End.atEnd()) { >- advance(ipv6End); >- if (!ipv6End.atEnd() && *ipv6End == ':') { >- m_url.m_hostEnd = currentPosition(ipv6End); >- return parsePort(ipv6End); >- } >- m_url.m_hostEnd = currentPosition(ipv6End); >- m_url.m_portLength = 0; >- return true; >- } >- m_url.m_hostEnd = currentPosition(ipv6End); >- return true; >- } >- return false; >- } >- >- if (!m_urlIsSpecial) { >- for (; !iterator.atEnd(); ++iterator) { >- if (UNLIKELY(isTabOrNewline(*iterator))) { >- syntaxViolation(iterator); >- continue; >- } >- if (*iterator == ':') >- break; >- if (UNLIKELY(isForbiddenHostCodePoint(*iterator) && *iterator != '%')) >- return false; >- utf8PercentEncode<isInSimpleEncodeSet>(iterator); >- } >- m_url.m_hostEnd = currentPosition(iterator); >- if (iterator.atEnd()) { >- m_url.m_portLength = 0; >- return true; >- } >- return parsePort(iterator); >- } >- >- if (LIKELY(!m_hostHasPercentOrNonASCII)) { >- auto hostIterator = iterator; >- for (; !iterator.atEnd(); ++iterator) { >- if (isTabOrNewline(*iterator)) >- continue; >- if (*iterator == ':') >- break; >- if (isForbiddenHostCodePoint(*iterator)) >- return false; >- } >- auto address = parseIPv4Host(hostIterator, CodePointIterator<CharacterType>(hostIterator, iterator)); >- if (address) { >- serializeIPv4(address.value()); >- m_url.m_hostEnd = currentPosition(iterator); >- if (iterator.atEnd()) { >- m_url.m_portLength = 0; >- return true; >- } >- return parsePort(iterator); >- } >- if (address.error() == IPv4ParsingError::Failure) >- return false; >- for (; hostIterator != iterator; ++hostIterator) { >- if (UNLIKELY(isTabOrNewline(*hostIterator))) { >- syntaxViolation(hostIterator); >- continue; >- } >- if (UNLIKELY(isASCIIUpper(*hostIterator))) >- syntaxViolation(hostIterator); >- appendToASCIIBuffer(toASCIILower(*hostIterator)); >- } >- m_url.m_hostEnd = currentPosition(iterator); >- if (!hostIterator.atEnd()) >- return parsePort(hostIterator); >- unsigned portLength = currentPosition(iterator) - m_url.m_hostEnd; >- RELEASE_ASSERT(portLength <= URL::maxPortLength); >- m_url.m_portLength = portLength; >- return true; >- } >- >- const auto hostBegin = iterator; >- >- LCharBuffer utf8Encoded; >- for (; !iterator.atEnd(); ++iterator) { >- if (UNLIKELY(isTabOrNewline(*iterator))) { >- syntaxViolation(hostBegin); >- continue; >- } >- if (*iterator == ':') >- break; >- if (UNLIKELY(!isASCII(*iterator))) >- syntaxViolation(hostBegin); >- >- if (!U_IS_UNICODE_CHAR(*iterator)) >- return false; >- uint8_t buffer[U8_MAX_LENGTH]; >- int32_t offset = 0; >- U8_APPEND_UNSAFE(buffer, offset, *iterator); >- utf8Encoded.append(buffer, offset); >- } >- LCharBuffer percentDecoded = percentDecode(utf8Encoded.data(), utf8Encoded.size(), hostBegin); >- String domain = String::fromUTF8(percentDecoded.data(), percentDecoded.size()); >- if (domain.isNull()) >- return false; >- if (domain != StringView(percentDecoded.data(), percentDecoded.size())) >- syntaxViolation(hostBegin); >- auto asciiDomain = domainToASCII(*domain.impl(), hostBegin); >- if (!asciiDomain || hasForbiddenHostCodePoint(asciiDomain.value())) >- return false; >- LCharBuffer& asciiDomainValue = asciiDomain.value(); >- const LChar* asciiDomainCharacters = asciiDomainValue.data(); >- >- auto address = parseIPv4Host(hostBegin, CodePointIterator<LChar>(asciiDomainValue.begin(), asciiDomainValue.end())); >- if (address) { >- serializeIPv4(address.value()); >- m_url.m_hostEnd = currentPosition(iterator); >- if (iterator.atEnd()) { >- m_url.m_portLength = 0; >- return true; >- } >- return parsePort(iterator); >- } >- if (address.error() == IPv4ParsingError::Failure) >- return false; >- >- appendToASCIIBuffer(asciiDomainCharacters, asciiDomainValue.size()); >- m_url.m_hostEnd = currentPosition(iterator); >- if (!iterator.atEnd()) >- return parsePort(iterator); >- m_url.m_portLength = 0; >- return true; >-} >- >-std::optional<String> URLParser::formURLDecode(StringView input) >-{ >- auto utf8 = input.utf8(StrictConversion); >- if (utf8.isNull()) >- return std::nullopt; >- auto percentDecoded = percentDecode(reinterpret_cast<const LChar*>(utf8.data()), utf8.length()); >- return String::fromUTF8(percentDecoded.data(), percentDecoded.size()); >-} >- >-// https://url.spec.whatwg.org/#concept-urlencoded-parser >-auto URLParser::parseURLEncodedForm(StringView input) -> URLEncodedForm >-{ >- URLEncodedForm output; >- for (StringView bytes : input.split('&')) { >- auto equalIndex = bytes.find('='); >- if (equalIndex == notFound) { >- auto name = formURLDecode(bytes.toString().replace('+', 0x20)); >- if (name) >- output.append({ name.value(), emptyString() }); >- } else { >- auto name = formURLDecode(bytes.substring(0, equalIndex).toString().replace('+', 0x20)); >- auto value = formURLDecode(bytes.substring(equalIndex + 1).toString().replace('+', 0x20)); >- if (name && value) >- output.append({ name.value(), value.value() }); >- } >- } >- return output; >-} >- >-static void serializeURLEncodedForm(const String& input, Vector<LChar>& output) >-{ >- auto utf8 = input.utf8(StrictConversion); >- const char* data = utf8.data(); >- for (size_t i = 0; i < utf8.length(); ++i) { >- const char byte = data[i]; >- if (byte == 0x20) >- output.append(0x2B); >- else if (byte == 0x2A >- || byte == 0x2D >- || byte == 0x2E >- || (byte >= 0x30 && byte <= 0x39) >- || (byte >= 0x41 && byte <= 0x5A) >- || byte == 0x5F >- || (byte >= 0x61 && byte <= 0x7A)) // FIXME: Put these in the characterClassTable to avoid branches. >- output.append(byte); >- else >- percentEncodeByte(byte, output); >- } >-} >- >-String URLParser::serialize(const URLEncodedForm& tuples) >-{ >- if (tuples.isEmpty()) >- return { }; >- >- Vector<LChar> output; >- for (auto& tuple : tuples) { >- if (!output.isEmpty()) >- output.append('&'); >- serializeURLEncodedForm(tuple.key, output); >- output.append('='); >- serializeURLEncodedForm(tuple.value, output); >- } >- return String::adopt(WTFMove(output)); >-} >- >-const UIDNA& URLParser::internationalDomainNameTranscoder() >-{ >- static UIDNA* encoder; >- static std::once_flag onceFlag; >- std::call_once(onceFlag, [] { >- UErrorCode error = U_ZERO_ERROR; >- // Warning: Please contact a WebKitGTK+ developer if changing these flags. >- // They should be synced with ephy_uri_decode() in ephy-uri-helpers.c. >- encoder = uidna_openUTS46(UIDNA_CHECK_BIDI | UIDNA_CHECK_CONTEXTJ | UIDNA_NONTRANSITIONAL_TO_UNICODE | UIDNA_NONTRANSITIONAL_TO_ASCII, &error); >- RELEASE_ASSERT(U_SUCCESS(error)); >- RELEASE_ASSERT(encoder); >- }); >- return *encoder; >-} >- >-bool URLParser::allValuesEqual(const URL& a, const URL& b) >-{ >- URL_PARSER_LOG("%d %d %d %d %d %d %d %d %d %d %d %d %s\n%d %d %d %d %d %d %d %d %d %d %d %d %s", >- a.m_isValid, >- a.m_cannotBeABaseURL, >- a.m_protocolIsInHTTPFamily, >- a.m_schemeEnd, >- a.m_userStart, >- a.m_userEnd, >- a.m_passwordEnd, >- a.m_hostEnd, >- a.m_hostEnd + a.m_portLength, >- a.m_pathAfterLastSlash, >- a.m_pathEnd, >- a.m_queryEnd, >- a.m_string.utf8().data(), >- b.m_isValid, >- b.m_cannotBeABaseURL, >- b.m_protocolIsInHTTPFamily, >- b.m_schemeEnd, >- b.m_userStart, >- b.m_userEnd, >- b.m_passwordEnd, >- b.m_hostEnd, >- b.m_hostEnd + b.m_portLength, >- b.m_pathAfterLastSlash, >- b.m_pathEnd, >- b.m_queryEnd, >- b.m_string.utf8().data()); >- >- return a.m_string == b.m_string >- && a.m_isValid == b.m_isValid >- && a.m_cannotBeABaseURL == b.m_cannotBeABaseURL >- && a.m_protocolIsInHTTPFamily == b.m_protocolIsInHTTPFamily >- && a.m_schemeEnd == b.m_schemeEnd >- && a.m_userStart == b.m_userStart >- && a.m_userEnd == b.m_userEnd >- && a.m_passwordEnd == b.m_passwordEnd >- && a.m_hostEnd == b.m_hostEnd >- && a.m_portLength == b.m_portLength >- && a.m_pathAfterLastSlash == b.m_pathAfterLastSlash >- && a.m_pathEnd == b.m_pathEnd >- && a.m_queryEnd == b.m_queryEnd; >-} >- >-bool URLParser::internalValuesConsistent(const URL& url) >-{ >- return url.m_schemeEnd <= url.m_userStart >- && url.m_userStart <= url.m_userEnd >- && url.m_userEnd <= url.m_passwordEnd >- && url.m_passwordEnd <= url.m_hostEnd >- && url.m_hostEnd + url.m_portLength <= url.m_pathAfterLastSlash >- && url.m_pathAfterLastSlash <= url.m_pathEnd >- && url.m_pathEnd <= url.m_queryEnd >- && url.m_queryEnd <= url.m_string.length(); >-} >- >-} // namespace WebCore >diff --git a/Source/WebCore/platform/URLParser.h b/Source/WebCore/platform/URLParser.h >deleted file mode 100644 >index f65beb024c980322a6e0539a5bfe847ae910cfab..0000000000000000000000000000000000000000 >--- a/Source/WebCore/platform/URLParser.h >+++ /dev/null >@@ -1,135 +0,0 @@ >-/* >- * Copyright (C) 2016-2018 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#pragma once >- >-#include "URL.h" >-#include <wtf/Expected.h> >-#include <wtf/Forward.h> >- >-struct UIDNA; >- >-namespace WebCore { >- >-template<typename CharacterType> class CodePointIterator; >- >-class URLParser { >-public: >- WEBCORE_EXPORT URLParser(const String&, const URL& = { }, const URLTextEncoding* = nullptr); >- URL result() { return m_url; } >- >- WEBCORE_EXPORT static bool allValuesEqual(const URL&, const URL&); >- WEBCORE_EXPORT static bool internalValuesConsistent(const URL&); >- >- typedef Vector<WTF::KeyValuePair<String, String>> URLEncodedForm; >- WEBCORE_EXPORT static URLEncodedForm parseURLEncodedForm(StringView); >- static String serialize(const URLEncodedForm&); >- >- static const UIDNA& internationalDomainNameTranscoder(); >- static bool isInUserInfoEncodeSet(UChar); >- >- WEBCORE_EXPORT static bool isSpecialScheme(const String& scheme); >- WEBCORE_EXPORT static std::optional<String> maybeCanonicalizeScheme(const String& scheme); >- >-private: >- static std::optional<uint16_t> defaultPortForProtocol(StringView); >- friend std::optional<uint16_t> defaultPortForProtocol(StringView); >- >- URL m_url; >- Vector<LChar> m_asciiBuffer; >- bool m_urlIsSpecial { false }; >- bool m_urlIsFile { false }; >- bool m_hostHasPercentOrNonASCII { false }; >- String m_inputString; >- const void* m_inputBegin { nullptr }; >- >- bool m_didSeeSyntaxViolation { false }; >- static constexpr size_t defaultInlineBufferSize = 2048; >- using LCharBuffer = Vector<LChar, defaultInlineBufferSize>; >- >- template<typename CharacterType> void parse(const CharacterType*, const unsigned length, const URL&, const URLTextEncoding*); >- template<typename CharacterType> void parseAuthority(CodePointIterator<CharacterType>); >- template<typename CharacterType> bool parseHostAndPort(CodePointIterator<CharacterType>); >- template<typename CharacterType> bool parsePort(CodePointIterator<CharacterType>&); >- >- void failure(); >- enum class ReportSyntaxViolation { No, Yes }; >- template<typename CharacterType, ReportSyntaxViolation reportSyntaxViolation = ReportSyntaxViolation::Yes> >- void advance(CodePointIterator<CharacterType>& iterator) { advance<CharacterType, reportSyntaxViolation>(iterator, iterator); } >- template<typename CharacterType, ReportSyntaxViolation = ReportSyntaxViolation::Yes> >- void advance(CodePointIterator<CharacterType>&, const CodePointIterator<CharacterType>& iteratorForSyntaxViolationPosition); >- template<typename CharacterType> bool takesTwoAdvancesUntilEnd(CodePointIterator<CharacterType>); >- template<typename CharacterType> void syntaxViolation(const CodePointIterator<CharacterType>&); >- template<typename CharacterType> bool isPercentEncodedDot(CodePointIterator<CharacterType>); >- template<typename CharacterType> bool isWindowsDriveLetter(CodePointIterator<CharacterType>); >- template<typename CharacterType> bool isSingleDotPathSegment(CodePointIterator<CharacterType>); >- template<typename CharacterType> bool isDoubleDotPathSegment(CodePointIterator<CharacterType>); >- template<typename CharacterType> bool shouldCopyFileURL(CodePointIterator<CharacterType>); >- template<typename CharacterType> bool checkLocalhostCodePoint(CodePointIterator<CharacterType>&, UChar32); >- template<typename CharacterType> bool isAtLocalhost(CodePointIterator<CharacterType>); >- bool isLocalhost(StringView); >- template<typename CharacterType> void consumeSingleDotPathSegment(CodePointIterator<CharacterType>&); >- template<typename CharacterType> void consumeDoubleDotPathSegment(CodePointIterator<CharacterType>&); >- template<typename CharacterType> void appendWindowsDriveLetter(CodePointIterator<CharacterType>&); >- template<typename CharacterType> size_t currentPosition(const CodePointIterator<CharacterType>&); >- template<typename UnsignedIntegerType> void appendNumberToASCIIBuffer(UnsignedIntegerType); >- template<bool(*isInCodeSet)(UChar32), typename CharacterType> void utf8PercentEncode(const CodePointIterator<CharacterType>&); >- template<typename CharacterType> void utf8QueryEncode(const CodePointIterator<CharacterType>&); >- template<typename CharacterType> std::optional<LCharBuffer> domainToASCII(StringImpl&, const CodePointIterator<CharacterType>& iteratorForSyntaxViolationPosition); >- template<typename CharacterType> LCharBuffer percentDecode(const LChar*, size_t, const CodePointIterator<CharacterType>& iteratorForSyntaxViolationPosition); >- static LCharBuffer percentDecode(const LChar*, size_t); >- static std::optional<String> formURLDecode(StringView input); >- static bool hasForbiddenHostCodePoint(const LCharBuffer&); >- void percentEncodeByte(uint8_t); >- void appendToASCIIBuffer(UChar32); >- void appendToASCIIBuffer(const char*, size_t); >- void appendToASCIIBuffer(const LChar* characters, size_t size) { appendToASCIIBuffer(reinterpret_cast<const char*>(characters), size); } >- template<typename CharacterType> void encodeNonUTF8Query(const Vector<UChar>& source, const URLTextEncoding&, CodePointIterator<CharacterType>); >- void copyASCIIStringUntil(const String&, size_t length); >- bool copyBaseWindowsDriveLetter(const URL&); >- StringView parsedDataView(size_t start, size_t length); >- UChar parsedDataView(size_t position); >- >- using IPv4Address = uint32_t; >- void serializeIPv4(IPv4Address); >- enum class IPv4ParsingError; >- enum class IPv4PieceParsingError; >- template<typename CharacterTypeForSyntaxViolation, typename CharacterType> Expected<IPv4Address, IPv4ParsingError> parseIPv4Host(const CodePointIterator<CharacterTypeForSyntaxViolation>&, CodePointIterator<CharacterType>); >- template<typename CharacterType> Expected<uint32_t, URLParser::IPv4PieceParsingError> parseIPv4Piece(CodePointIterator<CharacterType>&, bool& syntaxViolation); >- using IPv6Address = std::array<uint16_t, 8>; >- template<typename CharacterType> std::optional<IPv6Address> parseIPv6Host(CodePointIterator<CharacterType>); >- template<typename CharacterType> std::optional<uint32_t> parseIPv4PieceInsideIPv6(CodePointIterator<CharacterType>&); >- template<typename CharacterType> std::optional<IPv4Address> parseIPv4AddressInsideIPv6(CodePointIterator<CharacterType>); >- void serializeIPv6Piece(uint16_t piece); >- void serializeIPv6(IPv6Address); >- >- enum class URLPart; >- template<typename CharacterType> void copyURLPartsUntil(const URL& base, URLPart, const CodePointIterator<CharacterType>&, const URLTextEncoding*&); >- static size_t urlLengthUntilPart(const URL&, URLPart); >- void popPath(); >- bool shouldPopPath(unsigned); >-}; >- >-} >diff --git a/Source/WebCore/platform/UserAgent.h b/Source/WebCore/platform/UserAgent.h >index 4181ec13bff8f4e2aa8295e1bfb7efe59ed081e3..c3448486ee7c2aeacaaebebf5a0eb7183dc6eff4 100644 >--- a/Source/WebCore/platform/UserAgent.h >+++ b/Source/WebCore/platform/UserAgent.h >@@ -36,7 +36,6 @@ WEBCORE_EXPORT String standardUserAgentWithApplicationName(const String& applica > String systemMarketingVersionForUserAgentString(); > String userAgentBundleVersion(); > #else >-class URL; > > WEBCORE_EXPORT String standardUserAgent(const String& applicationName = emptyString(), const String& applicationVersion = emptyString()); > WEBCORE_EXPORT String standardUserAgentForURL(const URL&); >diff --git a/Source/WebCore/platform/UserAgentQuirks.cpp b/Source/WebCore/platform/UserAgentQuirks.cpp >index 232e5ce57db05db38b49dd9c021a1bc99c0385cb..49b58920a7aeb7732d6573275593477a186b0b06 100644 >--- a/Source/WebCore/platform/UserAgentQuirks.cpp >+++ b/Source/WebCore/platform/UserAgentQuirks.cpp >@@ -27,7 +27,7 @@ > #include "UserAgentQuirks.h" > > #include "PublicSuffix.h" >-#include "URL.h" >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/platform/UserAgentQuirks.h b/Source/WebCore/platform/UserAgentQuirks.h >index bf10ce232d91d431bcb6d4a71a51dd4dde8fb88a..dc77d4e850ef909d4b0056d7c9a7e1ad45fdd8ef 100644 >--- a/Source/WebCore/platform/UserAgentQuirks.h >+++ b/Source/WebCore/platform/UserAgentQuirks.h >@@ -30,8 +30,6 @@ > > namespace WebCore { > >-class URL; >- > class UserAgentQuirks { > public: > enum UserAgentQuirk { >diff --git a/Source/WebCore/platform/cf/CFURLExtras.cpp b/Source/WebCore/platform/cf/CFURLExtras.cpp >deleted file mode 100644 >index 73b43bc7a07b80ae4baa35fdb7335ac3ba764417..0000000000000000000000000000000000000000 >--- a/Source/WebCore/platform/cf/CFURLExtras.cpp >+++ /dev/null >@@ -1,81 +0,0 @@ >-/* >- * Copyright (C) 2013 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#include "config.h" >-#include "CFURLExtras.h" >- >-#include "URL.h" >-#include <wtf/text/CString.h> >- >-namespace WebCore { >- >-RetainPtr<CFURLRef> createCFURLFromBuffer(const char* data, size_t size, CFURLRef baseURL) >-{ >- // NOTE: We use UTF-8 here since this encoding is used when computing strings when returning URL components >- // (e.g calls to NSURL -path). However, this function is not tolerant of illegal UTF-8 sequences, which >- // could either be a malformed string or bytes in a different encoding, like Shift-JIS, so we fall back >- // onto using ISO Latin-1 in those cases. >- RetainPtr<CFURLRef> result = adoptCF(CFURLCreateAbsoluteURLWithBytes(0, reinterpret_cast<const UInt8*>(data), size, kCFStringEncodingUTF8, baseURL, true)); >- if (!result) >- result = adoptCF(CFURLCreateAbsoluteURLWithBytes(0, reinterpret_cast<const UInt8*>(data), size, kCFStringEncodingISOLatin1, baseURL, true)); >- return result; >-} >- >-void getURLBytes(CFURLRef url, URLCharBuffer& result) >-{ >- CFIndex bytesLength = CFURLGetBytes(url, 0, 0); >- result.resize(bytesLength); >- CFIndex finalLength = CFURLGetBytes(url, reinterpret_cast<UInt8*>(result.data()), bytesLength); >- ASSERT_UNUSED(finalLength, finalLength == bytesLength); >-} >- >-void getURLBytes(CFURLRef url, CString& result) >-{ >- CFIndex bytesLength = CFURLGetBytes(url, 0, 0); >- char* bytes; >- result = CString::newUninitialized(bytesLength, bytes); >- CFIndex finalLength = CFURLGetBytes(url, reinterpret_cast<UInt8*>(bytes), bytesLength); >- ASSERT_UNUSED(finalLength, finalLength == bytesLength); >-} >- >-bool isCFURLSameOrigin(CFURLRef cfURL, const URL& url) >-{ >- ASSERT(url.protocolIsInHTTPFamily()); >- >- if (url.hasUsername() || url.hasPassword()) >- return protocolHostAndPortAreEqual(url, URL { cfURL }); >- >- URLCharBuffer bytes; >- getURLBytes(cfURL, bytes); >- StringView cfURLString { reinterpret_cast<const LChar*>(bytes.data()), static_cast<unsigned>(bytes.size()) }; >- >- if (!url.hasPath()) >- return StringView { url.string() } == cfURLString; >- >- auto urlWithoutPath = StringView { url.string() }.substring(0, url.pathStart() + 1); >- return cfURLString.startsWith(urlWithoutPath); >-} >- >-} >diff --git a/Source/WebCore/platform/cf/CFURLExtras.h b/Source/WebCore/platform/cf/CFURLExtras.h >deleted file mode 100644 >index ffd570660da6aa98d122864078fed7dd6e779ef5..0000000000000000000000000000000000000000 >--- a/Source/WebCore/platform/cf/CFURLExtras.h >+++ /dev/null >@@ -1,46 +0,0 @@ >-/* >- * Copyright (C) 2013 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#ifndef CFURLExtras_h >-#define CFURLExtras_h >- >-#include <wtf/Forward.h> >-#include <wtf/RetainPtr.h> >-#include <wtf/Vector.h> >- >-namespace WebCore { >- >-class URL; >-typedef Vector<char, 512> URLCharBuffer; >- >-WEBCORE_EXPORT RetainPtr<CFURLRef> createCFURLFromBuffer(const char*, size_t, CFURLRef baseURL = 0); >-WEBCORE_EXPORT void getURLBytes(CFURLRef, URLCharBuffer&); >-WEBCORE_EXPORT void getURLBytes(CFURLRef, CString&); >- >-bool isCFURLSameOrigin(CFURLRef, const URL&); >- >-} >- >-#endif // CFURLExtras_h >diff --git a/Source/WebCore/platform/cf/URLCF.cpp b/Source/WebCore/platform/cf/URLCF.cpp >deleted file mode 100644 >index 33366a20d3c5da47088fa98fb54f8e9c6ef88c9e..0000000000000000000000000000000000000000 >--- a/Source/WebCore/platform/cf/URLCF.cpp >+++ /dev/null >@@ -1,85 +0,0 @@ >-/* >- * Copyright (C) 2004, 2008, 2013 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#include "config.h" >-#include "URL.h" >- >-#include "CFURLExtras.h" >-#include "URLParser.h" >-#include <CoreFoundation/CFURL.h> >-#include <wtf/text/CString.h> >- >-#if PLATFORM(IOS_FAMILY) >-#include "RuntimeApplicationChecks.h" >-#endif >- >-namespace WebCore { >- >-URL::URL(CFURLRef url) >-{ >- if (!url) { >- invalidate(); >- return; >- } >- >- // FIXME: Why is it OK to ignore base URL here? >- CString urlBytes; >- getURLBytes(url, urlBytes); >- URLParser parser(urlBytes.data()); >- *this = parser.result(); >-} >- >-#if !USE(FOUNDATION) >-RetainPtr<CFURLRef> URL::createCFURL() const >-{ >- // FIXME: What should this return for invalid URLs? >- // Currently it throws away the high bytes of the characters in the string in that case, >- // which is clearly wrong. >- URLCharBuffer buffer; >- copyToBuffer(buffer); >- auto cfURL = createCFURLFromBuffer(buffer.data(), buffer.size()); >- >- if (protocolIsInHTTPFamily() && !isCFURLSameOrigin(cfURL.get(), *this)) >- return nullptr; >- >- return cfURL; >-} >-#endif >- >-String URL::fileSystemPath() const >-{ >- RetainPtr<CFURLRef> cfURL = createCFURL(); >- if (!cfURL) >- return String(); >- >-#if PLATFORM(WIN) >- CFURLPathStyle pathStyle = kCFURLWindowsPathStyle; >-#else >- CFURLPathStyle pathStyle = kCFURLPOSIXPathStyle; >-#endif >- return adoptCF(CFURLCopyFileSystemPath(cfURL.get(), pathStyle)).get(); >-} >- >-} >diff --git a/Source/WebCore/platform/cocoa/NetworkExtensionContentFilter.h b/Source/WebCore/platform/cocoa/NetworkExtensionContentFilter.h >index 2106c2ba9b86ac020b407010e913239bd42590ef..a4e762e78639dd6c63cc26e869709a597ca41092 100644 >--- a/Source/WebCore/platform/cocoa/NetworkExtensionContentFilter.h >+++ b/Source/WebCore/platform/cocoa/NetworkExtensionContentFilter.h >@@ -23,8 +23,7 @@ > * THE POSSIBILITY OF SUCH DAMAGE. > */ > >-#ifndef NetworkExtensionContentFilter_h >-#define NetworkExtensionContentFilter_h >+#pragma once > > #include "PlatformContentFilter.h" > #include <objc/NSObjCRuntime.h> >@@ -39,8 +38,6 @@ OBJC_CLASS NSData; > > namespace WebCore { > >-class URL; >- > class NetworkExtensionContentFilter final : public PlatformContentFilter { > friend std::unique_ptr<NetworkExtensionContentFilter> std::make_unique<NetworkExtensionContentFilter>(); > >@@ -69,5 +66,3 @@ private: > }; > > } // namespace WebCore >- >-#endif // NetworkExtensionContentFilter_h >diff --git a/Source/WebCore/platform/cocoa/NetworkExtensionContentFilter.mm b/Source/WebCore/platform/cocoa/NetworkExtensionContentFilter.mm >index e9bfc079e02177acb70fa892f4fa2d9156428ffc..4705ed15a5c58c411c49f34faf73eeb307b2c948 100644 >--- a/Source/WebCore/platform/cocoa/NetworkExtensionContentFilter.mm >+++ b/Source/WebCore/platform/cocoa/NetworkExtensionContentFilter.mm >@@ -34,10 +34,10 @@ > #import "ResourceResponse.h" > #import "RuntimeApplicationChecks.h" > #import "SharedBuffer.h" >-#import "URL.h" > #import <objc/runtime.h> > #import <pal/spi/cocoa/NEFilterSourceSPI.h> > #import <wtf/SoftLinking.h> >+#import <wtf/URL.h> > #import <wtf/threads/BinarySemaphore.h> > > SOFT_LINK_FRAMEWORK_OPTIONAL(NetworkExtension); >@@ -118,7 +118,7 @@ void NetworkExtensionContentFilter::willSendRequest(ResourceRequest& request, co > > URL modifiedRequestURL { URL(), modifiedRequestURLString.get() }; > if (!modifiedRequestURL.isValid()) { >- LOG(ContentFiltering, "NetworkExtensionContentFilter failed to convert modified URL string %@ to a WebCore::URL.\n", modifiedRequestURLString.get()); >+ LOG(ContentFiltering, "NetworkExtensionContentFilter failed to convert modified URL string %@ to a URL.\n", modifiedRequestURLString.get()); > return; > } > >diff --git a/Source/WebCore/platform/glib/SSLKeyGeneratorGLib.cpp b/Source/WebCore/platform/glib/SSLKeyGeneratorGLib.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..41f48d7161e7f2965c15585ff008fc293092c393 >--- /dev/null >+++ b/Source/WebCore/platform/glib/SSLKeyGeneratorGLib.cpp >@@ -0,0 +1,47 @@ >+/* >+ * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. >+ * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com >+ * All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+ >+#include "NotImplemented.h" >+#include <wtf/Forward.h> >+#include <wtf/URL.h> >+ >+namespace WebCore { >+ >+void getSupportedKeySizes(Vector<String>&) >+{ >+ notImplemented(); >+} >+ >+String signedPublicKeyAndChallengeString(unsigned, const String&, const URL&) >+{ >+ notImplemented(); >+ return { }; >+} >+ >+} // namespace WebCore >diff --git a/Source/WebCore/platform/glib/UserAgentGLib.cpp b/Source/WebCore/platform/glib/UserAgentGLib.cpp >index 1621a885e8704ca848320f6251c06f921b189d88..a3ba4e46dc28395d852ce8fb68c70b5799e27724 100644 >--- a/Source/WebCore/platform/glib/UserAgentGLib.cpp >+++ b/Source/WebCore/platform/glib/UserAgentGLib.cpp >@@ -27,9 +27,9 @@ > #include "config.h" > #include "UserAgent.h" > >-#include "URL.h" > #include "UserAgentQuirks.h" > #include <wtf/NeverDestroyed.h> >+#include <wtf/URL.h> > #include <wtf/text/StringBuilder.h> > > #if OS(UNIX) >diff --git a/Source/WebCore/platform/graphics/GraphicsContext.h b/Source/WebCore/platform/graphics/GraphicsContext.h >index d2b39b3db4a9c5b47cc9c3fd695cfef753f3592a..f9afe8e60600ee276bc00304583e24abf402cf38 100644 >--- a/Source/WebCore/platform/graphics/GraphicsContext.h >+++ b/Source/WebCore/platform/graphics/GraphicsContext.h >@@ -65,6 +65,12 @@ typedef unsigned char UInt8; > #endif > #endif > >+// X11 header defines "None" as constant in macro and breakes the PaintInvalidationReasons enum's "None". >+// As a workaround, we explicitly undef X11's None here. >+#if defined(None) >+#undef None >+#endif >+ > namespace WebCore { > > #if USE(WINGDI) >@@ -81,7 +87,6 @@ class GraphicsContextPlatformPrivate; > class ImageBuffer; > class IntRect; > class RoundedRect; >-class URL; > class GraphicsContext3D; > class Path; > class TextRun; >diff --git a/Source/WebCore/platform/graphics/Image.cpp b/Source/WebCore/platform/graphics/Image.cpp >index 4f077d5b992f41f80dd41c0a972e5a87affb9147..e44a61e224ca1194d0918d4443bea7c1e7e4a0e1 100644 >--- a/Source/WebCore/platform/graphics/Image.cpp >+++ b/Source/WebCore/platform/graphics/Image.cpp >@@ -35,10 +35,10 @@ > #include "MIMETypeRegistry.h" > #include "SVGImage.h" > #include "SharedBuffer.h" >-#include "URL.h" > #include <math.h> > #include <wtf/MainThread.h> > #include <wtf/StdLibExtras.h> >+#include <wtf/URL.h> > #include <wtf/text/TextStream.h> > > #if USE(CG) >diff --git a/Source/WebCore/platform/graphics/Image.h b/Source/WebCore/platform/graphics/Image.h >index 464dd67b4ae0aea3bb716322ce101fb083f943cc..65cb08eab007272e62652ae2001ef11f1a2bafab 100644 >--- a/Source/WebCore/platform/graphics/Image.h >+++ b/Source/WebCore/platform/graphics/Image.h >@@ -68,7 +68,6 @@ class FloatSize; > class GraphicsContext; > class GraphicsContextImpl; > class SharedBuffer; >-class URL; > struct Length; > > // This class gets notified when an image creates or destroys decoded frames and when it advances animation frames. >diff --git a/Source/WebCore/platform/graphics/ImageObserver.h b/Source/WebCore/platform/graphics/ImageObserver.h >index 8269cc4edc37ce5f4dc165fbd4d61c3698a427fe..f28323c255b1d0a014351c934273da01c5af85bc 100644 >--- a/Source/WebCore/platform/graphics/ImageObserver.h >+++ b/Source/WebCore/platform/graphics/ImageObserver.h >@@ -23,8 +23,7 @@ > * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > */ > >-#ifndef ImageObserver_h >-#define ImageObserver_h >+#pragma once > > #include "ImageTypes.h" > >@@ -32,7 +31,6 @@ namespace WebCore { > > class Image; > class IntRect; >-class URL; > > // Interface for notification about changes to an image, including decoding, > // drawing, and animating. >@@ -54,5 +52,3 @@ public: > }; > > } >- >-#endif >diff --git a/Source/WebCore/platform/graphics/ImageSource.cpp b/Source/WebCore/platform/graphics/ImageSource.cpp >index 31fc818298be258a8764c6acf4cfccf6c1e1f52f..68d12a13888c421884eed0b118c998ec5865d96b 100644 >--- a/Source/WebCore/platform/graphics/ImageSource.cpp >+++ b/Source/WebCore/platform/graphics/ImageSource.cpp >@@ -30,11 +30,11 @@ > #include "ImageDecoder.h" > #include "ImageObserver.h" > #include "Logging.h" >-#include "URL.h" > #include <wtf/CheckedArithmetic.h> > #include <wtf/MainThread.h> > #include <wtf/RunLoop.h> > #include <wtf/SystemTracing.h> >+#include <wtf/URL.h> > > #if USE(DIRECT2D) > #include "GraphicsContext.h" >diff --git a/Source/WebCore/platform/graphics/ImageSource.h b/Source/WebCore/platform/graphics/ImageSource.h >index 0901012299ebc41c2ca84e19e951e0247886958e..980d60ee50d50bc26a00305e03e51b4d44cc9e4f 100644 >--- a/Source/WebCore/platform/graphics/ImageSource.h >+++ b/Source/WebCore/platform/graphics/ImageSource.h >@@ -38,7 +38,6 @@ namespace WebCore { > class BitmapImage; > class GraphicsContext; > class ImageDecoder; >-class URL; > > class ImageSource : public ThreadSafeRefCounted<ImageSource> { > friend class BitmapImage; >diff --git a/Source/WebCore/platform/graphics/MediaPlayer.h b/Source/WebCore/platform/graphics/MediaPlayer.h >index be9d150c59797f63d37bb10c426844179f9e044c..c2816bdd277a2252805bdb1582ccbbd6716403c1 100644 >--- a/Source/WebCore/platform/graphics/MediaPlayer.h >+++ b/Source/WebCore/platform/graphics/MediaPlayer.h >@@ -40,7 +40,7 @@ > #include "PlatformMediaSession.h" > #include "SecurityOriginHash.h" > #include "Timer.h" >-#include "URL.h" >+#include <wtf/URL.h> > #include "VideoTrackPrivate.h" > #include <JavaScriptCore/Uint8Array.h> > #include <wtf/Function.h> >diff --git a/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp b/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp >index 4689a55137b7234b26196bb4fa05d46b0803f893..b96d85f0298c798cde5437ab1da12eee3bc70adb 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp >+++ b/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp >@@ -39,7 +39,6 @@ > #include "PlatformLayer.h" > #include "PlatformTimeRanges.h" > #include "Settings.h" >-#include "URL.h" > #include <CoreMedia/CoreMedia.h> > #include <JavaScriptCore/DataView.h> > #include <JavaScriptCore/HeapInlines.h> >@@ -49,6 +48,7 @@ > #include <wtf/NeverDestroyed.h> > #include <wtf/SoftLinking.h> > #include <wtf/StringPrintStream.h> >+#include <wtf/URL.h> > #include <wtf/text/CString.h> > > namespace WebCore { >diff --git a/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp b/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp >index f5a9e7faabf6af25589f2bdabc72f66acd05abba..b8cb8506b9987fb052ace9814de3bfa6c10dd694 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp >+++ b/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp >@@ -45,9 +45,9 @@ > #include "PlatformCALayerClient.h" > #include "PlatformCALayerWin.h" > #include "TimeRanges.h" >-#include "URL.h" > #include "WebCoreAVCFResourceLoader.h" > #include <pal/avfoundation/MediaTimeAVFoundation.h> >+#include <wtf/URL.h> > > #include <AVFoundationCF/AVCFPlayerItem.h> > #if HAVE(AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT) >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm >index 1785b5a859cb69947f8f32e9fa5fbdce354484b7..2a0560b43843bfe54dbee723a1154b8cc89bede9 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm >@@ -59,7 +59,6 @@ > #import "TextEncoding.h" > #import "TextTrackRepresentation.h" > #import "TextureCacheCV.h" >-#import "URL.h" > #import "VideoFullscreenLayerManagerObjC.h" > #import "VideoTextureCopierCV.h" > #import "VideoTrackPrivateAVFObjC.h" >@@ -81,6 +80,7 @@ > #import <wtf/ListHashSet.h> > #import <wtf/NeverDestroyed.h> > #import <wtf/OSObjectPtr.h> >+#import <wtf/URL.h> > #import <wtf/text/CString.h> > > #if ENABLE(AVF_CAPTIONS) >diff --git a/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp b/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp >index 47929e6d3051d3f79a8a219d8e47c08e31b048ce..8adf8014df59621fa049a84772ad4b8425f67881 100644 >--- a/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp >+++ b/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp >@@ -41,10 +41,10 @@ > #include "ShadowBlur.h" > #include "SubimageCacheWithTimer.h" > #include "Timer.h" >-#include "URL.h" > #include <pal/spi/cg/CoreGraphicsSPI.h> > #include <wtf/MathExtras.h> > #include <wtf/RetainPtr.h> >+#include <wtf/URL.h> > #include <wtf/text/TextStream.h> > > #define USE_DRAW_PATH_DIRECT (PLATFORM(IOS_FAMILY) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400)) >diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp >index b41da87eba6fea996229592dd208e337e24bd56a..94768dc1a92a2f64bf2ce21268814aa29a09f6cf 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp >@@ -37,7 +37,6 @@ > #include "NotImplemented.h" > #include "SecurityOrigin.h" > #include "TimeRanges.h" >-#include "URL.h" > #include "WebKitWebSourceGStreamer.h" > #include <glib.h> > #include <gst/gst.h> >@@ -47,6 +46,7 @@ > #include <wtf/MediaTime.h> > #include <wtf/NeverDestroyed.h> > #include <wtf/StringPrintStream.h> >+#include <wtf/URL.h> > #include <wtf/WallTime.h> > #include <wtf/glib/GUniquePtr.h> > #include <wtf/glib/RunLoopSourcePriority.h> >diff --git a/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp b/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp >index bb93ad7288f4f93fbf4589487789791f62ca4c2e..b63e5deee72c95c49d856dc5470baab3f6149e8c 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp >@@ -39,7 +39,6 @@ > #include "PlaybackPipeline.h" > #include "SourceBufferPrivateGStreamer.h" > #include "TimeRanges.h" >-#include "URL.h" > #include "VideoTrackPrivateGStreamer.h" > > #include <fnmatch.h> >@@ -52,6 +51,7 @@ > #include <wtf/HashSet.h> > #include <wtf/NeverDestroyed.h> > #include <wtf/StringPrintStream.h> >+#include <wtf/URL.h> > #include <wtf/text/AtomicString.h> > #include <wtf/text/AtomicStringHash.h> > >diff --git a/Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp >index f7bd4773bfd5c567e801fb07178eb8fd861b7d40..969a422442e583d3ed1af7cfe43d29e42aa9eb61 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp >@@ -635,7 +635,7 @@ gboolean webKitMediaSrcSetUri(GstURIHandler* handler, const gchar* uri, GError** > return TRUE; > } > >- WebCore::URL url(WebCore::URL(), uri); >+ URL url(URL(), uri); > > priv->location = GUniquePtr<gchar>(g_strdup(url.string().utf8().data())); > GST_OBJECT_UNLOCK(source); >diff --git a/Source/WebCore/platform/graphics/iso/ISOVTTCue.cpp b/Source/WebCore/platform/graphics/iso/ISOVTTCue.cpp >index d03f5f7fcea3c8f1737716a435f9e666012a5f18..9ec40894f1e28a05a214cb323514f7b13955d284 100644 >--- a/Source/WebCore/platform/graphics/iso/ISOVTTCue.cpp >+++ b/Source/WebCore/platform/graphics/iso/ISOVTTCue.cpp >@@ -27,9 +27,9 @@ > #include "ISOVTTCue.h" > > #include "Logging.h" >-#include "URL.h" > #include <JavaScriptCore/DataView.h> > #include <wtf/JSONValues.h> >+#include <wtf/URL.h> > > using JSC::DataView; > >diff --git a/Source/WebCore/platform/graphics/win/GraphicsContextDirect2D.cpp b/Source/WebCore/platform/graphics/win/GraphicsContextDirect2D.cpp >index b8f65b4763b3f48df1681328db9a93b085539d79..eaf3d25cfbff2fcfbc01eddf155567e23cf87a03 100644 >--- a/Source/WebCore/platform/graphics/win/GraphicsContextDirect2D.cpp >+++ b/Source/WebCore/platform/graphics/win/GraphicsContextDirect2D.cpp >@@ -33,10 +33,10 @@ > #include "ImageBuffer.h" > #include "Logging.h" > #include "NotImplemented.h" >-#include "URL.h" > #include <d2d1.h> > #include <d2d1effects.h> > #include <dwrite.h> >+#include <wtf/URL.h> > > #pragma warning (disable : 4756) > >diff --git a/Source/WebCore/platform/gtk/DragImageGtk.cpp b/Source/WebCore/platform/gtk/DragImageGtk.cpp >index 33f4fe3a42f05f2d6b93db0fada87843e9b70268..f7d184f67e8ac35655335153e1ce558ae18e97e1 100644 >--- a/Source/WebCore/platform/gtk/DragImageGtk.cpp >+++ b/Source/WebCore/platform/gtk/DragImageGtk.cpp >@@ -23,9 +23,9 @@ > #include "Image.h" > #include "TextFlags.h" > #include "TextIndicator.h" >-#include "URL.h" > #include <cairo.h> > #include <gdk/gdk.h> >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/platform/gtk/PasteboardGtk.cpp b/Source/WebCore/platform/gtk/PasteboardGtk.cpp >index a4ab610a73ff1ac91490ddc2008c488d42c900f0..71a00a30c0faedd9b40ec4ffadf178638f25b854 100644 >--- a/Source/WebCore/platform/gtk/PasteboardGtk.cpp >+++ b/Source/WebCore/platform/gtk/PasteboardGtk.cpp >@@ -27,8 +27,8 @@ > #include "PasteboardStrategy.h" > #include "PlatformStrategies.h" > #include "SelectionData.h" >-#include "URL.h" > #include <wtf/NeverDestroyed.h> >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/platform/gtk/PlatformPasteboardGtk.cpp b/Source/WebCore/platform/gtk/PlatformPasteboardGtk.cpp >index f308c2bb7e53691da34c6ebd0b34ed11beb2fb64..8143fafc37c1bc48a4c0de8df1096d7238e6501f 100644 >--- a/Source/WebCore/platform/gtk/PlatformPasteboardGtk.cpp >+++ b/Source/WebCore/platform/gtk/PlatformPasteboardGtk.cpp >@@ -23,8 +23,8 @@ > #include "PasteboardHelper.h" > #include "SelectionData.h" > #include "SharedBuffer.h" >-#include "URL.h" > #include <gtk/gtk.h> >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/platform/gtk/SelectionData.h b/Source/WebCore/platform/gtk/SelectionData.h >index da51da09ad12748cf79a50f6c33499e50aa35c87..1b858ef9dee57c206ba3e0c73aad8a86696b820f 100644 >--- a/Source/WebCore/platform/gtk/SelectionData.h >+++ b/Source/WebCore/platform/gtk/SelectionData.h >@@ -19,9 +19,9 @@ > #pragma once > > #include "Image.h" >-#include "URL.h" > #include <wtf/HashMap.h> > #include <wtf/RefCounted.h> >+#include <wtf/URL.h> > #include <wtf/text/StringHash.h> > > namespace WebCore { >diff --git a/Source/WebCore/platform/ios/PasteboardIOS.mm b/Source/WebCore/platform/ios/PasteboardIOS.mm >index b48b7349faec5caa4534bbc94428938d5d638abf..90fb3f6015e89ca6e5503ec5de0321be332295ea 100644 >--- a/Source/WebCore/platform/ios/PasteboardIOS.mm >+++ b/Source/WebCore/platform/ios/PasteboardIOS.mm >@@ -35,10 +35,10 @@ > #import "PlatformStrategies.h" > #import "RuntimeEnabledFeatures.h" > #import "SharedBuffer.h" >-#import "URL.h" > #import "UTIUtilities.h" > #import "WebNSAttributedStringExtras.h" > #import <MobileCoreServices/MobileCoreServices.h> >+#import <wtf/URL.h> > #import <wtf/text/StringHash.h> > > @interface NSAttributedString (NSAttributedStringKitAdditions) >diff --git a/Source/WebCore/platform/ios/PlatformPasteboardIOS.mm b/Source/WebCore/platform/ios/PlatformPasteboardIOS.mm >index 9794fd33bd71d8e63c817b3d5e51ba3ad97bb995..b0491476393f03b0800d47099cffc3731b3dbcd4 100644 >--- a/Source/WebCore/platform/ios/PlatformPasteboardIOS.mm >+++ b/Source/WebCore/platform/ios/PlatformPasteboardIOS.mm >@@ -32,9 +32,7 @@ > #import "Image.h" > #import "Pasteboard.h" > #import "SharedBuffer.h" >-#import "URL.h" > #import "UTIUtilities.h" >-#import "WebCoreNSURLExtras.h" > #import "WebItemProviderPasteboard.h" > #import <MobileCoreServices/MobileCoreServices.h> > #import <UIKit/UIColor.h> >@@ -44,6 +42,8 @@ > #import <pal/spi/ios/UIKitSPI.h> > #import <wtf/ListHashSet.h> > #import <wtf/SoftLinking.h> >+#import <wtf/URL.h> >+#import <wtf/cocoa/NSURLExtras.h> > #import <wtf/text/StringHash.h> > > #define PASTEBOARD_SUPPORTS_ITEM_PROVIDERS (PLATFORM(IOS_FAMILY) && !(PLATFORM(WATCHOS) || PLATFORM(APPLETV))) >@@ -420,7 +420,7 @@ void PlatformPasteboard::write(const PasteboardImage& pasteboardImage) > auto& pasteboardURL = pasteboardImage.url; > if (NSURL *nsURL = pasteboardURL.url) { > #if NSURL_SUPPORTS_TITLE >- nsURL._title = pasteboardURL.title.isEmpty() ? userVisibleString(pasteboardURL.url) : (NSString *)pasteboardURL.title; >+ nsURL._title = pasteboardURL.title.isEmpty() ? WTF::userVisibleString(pasteboardURL.url) : (NSString *)pasteboardURL.title; > #endif > [representationsToRegister addRepresentingObject:nsURL]; > } >diff --git a/Source/WebCore/platform/ios/QuickLook.h b/Source/WebCore/platform/ios/QuickLook.h >index 49d811d5140c8fd0af01629d8d0c1c9e9e994f17..0a6efaef3e861ef59fd4289cef911c778da70ca1 100644 >--- a/Source/WebCore/platform/ios/QuickLook.h >+++ b/Source/WebCore/platform/ios/QuickLook.h >@@ -35,8 +35,6 @@ OBJC_CLASS NSURLRequest; > > namespace WebCore { > >-class URL; >- > WEBCORE_EXPORT NSSet *QLPreviewGetSupportedMIMETypesSet(); > WEBCORE_EXPORT void removeQLPreviewConverterForURL(NSURL *); > WEBCORE_EXPORT RetainPtr<NSURLRequest> registerQLPreviewConverterIfNeeded(NSURL *, NSString *mimeType, NSData *); >diff --git a/Source/WebCore/platform/mac/DragDataMac.mm b/Source/WebCore/platform/mac/DragDataMac.mm >index 15ac0616231e2e1b9a97e750c7f79d331b8a6e50..64e4894393132fd3316664a18cb97c5d178aa230 100644 >--- a/Source/WebCore/platform/mac/DragDataMac.mm >+++ b/Source/WebCore/platform/mac/DragDataMac.mm >@@ -36,6 +36,7 @@ > #import "PlatformStrategies.h" > #import "RuntimeEnabledFeatures.h" > #import "WebCoreNSURLExtras.h" >+#import <wtf/cocoa/NSURLExtras.h> > > #if PLATFORM(IOS_FAMILY) > #import <MobileCoreServices/MobileCoreServices.h> >@@ -210,7 +211,7 @@ String DragData::asPlainText() const > // FIXME: It's not clear this is 100% correct since we know -[NSURL URLWithString:] does not handle > // all the same cases we handle well in the URL code for creating an NSURL. > if (text.isURL) >- return userVisibleString([NSURL URLWithString:string]); >+ return WTF::userVisibleString([NSURL URLWithString:string]); > > // FIXME: WTF should offer a non-Mac-specific way to convert string to precomposed form so we can do it for all platforms. > return [(NSString *)string precomposedStringWithCanonicalMapping]; >diff --git a/Source/WebCore/platform/mac/DragImageMac.mm b/Source/WebCore/platform/mac/DragImageMac.mm >index 9c30f79c84d3c7d865d41155391367c8f444a6da..bcbbac50f34eb71fc5dcf8739e4ee81946b97bd3 100644 >--- a/Source/WebCore/platform/mac/DragImageMac.mm >+++ b/Source/WebCore/platform/mac/DragImageMac.mm >@@ -41,12 +41,12 @@ > #import "Page.h" > #import "StringTruncator.h" > #import "TextIndicator.h" >-#import "URL.h" > #import "WebKitNSImageExtras.h" > #import <pal/spi/cg/CoreGraphicsSPI.h> > #import <pal/spi/cocoa/CoreTextSPI.h> > #import <pal/spi/cocoa/URLFormattingSPI.h> > #import <wtf/SoftLinking.h> >+#import <wtf/URL.h> > > #if !HAVE(URL_FORMATTING) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300 > SOFT_LINK_PRIVATE_FRAMEWORK_OPTIONAL(LinkPresentation) >diff --git a/Source/WebCore/platform/mac/FileSystemMac.mm b/Source/WebCore/platform/mac/FileSystemMac.mm >index 071d0c9117794e6038d98aad56fe96ff8f481533..8ed751a7ec0e5d0baf774f98610acb045cd2b004 100644 >--- a/Source/WebCore/platform/mac/FileSystemMac.mm >+++ b/Source/WebCore/platform/mac/FileSystemMac.mm >@@ -28,8 +28,8 @@ > > #if PLATFORM(MAC) > >-#import "WebCoreNSURLExtras.h" > #import <pal/spi/mac/MetadataSPI.h> >+#import <wtf/cocoa/NSURLExtras.h> > #import <wtf/text/WTFString.h> > > namespace WebCore { >@@ -52,7 +52,7 @@ void FileSystem::setMetadataURL(const String& path, const String& metadataURLStr > { > String urlString; > if (NSURL *url = URLWithUserTypedString(metadataURLString, nil)) >- urlString = userVisibleString(URLByRemovingUserInfo(url)); >+ urlString = WTF::userVisibleString(WTF::URLByRemovingUserInfo(url)); > else > urlString = metadataURLString; > >diff --git a/Source/WebCore/platform/mac/PasteboardMac.mm b/Source/WebCore/platform/mac/PasteboardMac.mm >index 43d7dfde6aef18991dc87cd0b9fd8aea3c45d491..51520dcbbea592185c326702cba69fe88b4d4dde 100644 >--- a/Source/WebCore/platform/mac/PasteboardMac.mm >+++ b/Source/WebCore/platform/mac/PasteboardMac.mm >@@ -37,7 +37,6 @@ > #import "PlatformPasteboard.h" > #import "PlatformStrategies.h" > #import "SharedBuffer.h" >-#import "URL.h" > #import "UTIUtilities.h" > #import "WebNSAttributedStringExtras.h" > #import <pal/spi/cg/CoreGraphicsSPI.h> >@@ -45,6 +44,7 @@ > #import <wtf/ProcessPrivilege.h> > #import <wtf/RetainPtr.h> > #import <wtf/StdLibExtras.h> >+#import <wtf/URL.h> > #import <wtf/text/StringBuilder.h> > #import <wtf/unicode/CharacterNames.h> > >diff --git a/Source/WebCore/platform/mac/PasteboardWriter.mm b/Source/WebCore/platform/mac/PasteboardWriter.mm >index 6a28fe62acecd572658d033d0cd9c1ac31ee0e3d..0fe505de55c661648f059da9b7fae2a077fc623e 100644 >--- a/Source/WebCore/platform/mac/PasteboardWriter.mm >+++ b/Source/WebCore/platform/mac/PasteboardWriter.mm >@@ -63,10 +63,10 @@ RetainPtr<id <NSPasteboardWriting>> createPasteboardWriter(const PasteboardWrite > } > } > >- if (auto& url = data.url()) { >- NSURL *cocoaURL = url->url; >- NSString *userVisibleString = url->userVisibleForm; >- NSString *title = (NSString *)url->title; >+ if (auto& urlData = data.urlData()) { >+ NSURL *cocoaURL = urlData->url; >+ NSString *userVisibleString = urlData->userVisibleForm; >+ NSString *title = (NSString *)urlData->title; > if (!title.length) { > title = cocoaURL.path.lastPathComponent; > if (!title.length) >@@ -74,7 +74,7 @@ RetainPtr<id <NSPasteboardWriting>> createPasteboardWriter(const PasteboardWrite > } > > // WebURLsWithTitlesPboardType. >- auto paths = adoptNS([[NSArray alloc] initWithObjects:@[ @[ cocoaURL.absoluteString ] ], @[ url->title.stripWhiteSpace() ], nil]); >+ auto paths = adoptNS([[NSArray alloc] initWithObjects:@[ @[ cocoaURL.absoluteString ] ], @[ urlData->title.stripWhiteSpace() ], nil]); > [pasteboardItem setPropertyList:paths.get() forType:toUTI(@"WebURLsWithTitlesPboardType").get()]; > > // NSURLPboardType. >diff --git a/Source/WebCore/platform/mac/PlatformPasteboardMac.mm b/Source/WebCore/platform/mac/PlatformPasteboardMac.mm >index b1dffb6cb7e6425741bd0c6c0e53b4efdcfdb171..0cb1dd8b930a065b7c08015ca2e0ce5dbd5b2b49 100644 >--- a/Source/WebCore/platform/mac/PlatformPasteboardMac.mm >+++ b/Source/WebCore/platform/mac/PlatformPasteboardMac.mm >@@ -32,10 +32,10 @@ > #import "ColorMac.h" > #import "LegacyNSPasteboardTypes.h" > #import "Pasteboard.h" >-#import "URL.h" > #import "SharedBuffer.h" > #import <wtf/HashCountedSet.h> > #import <wtf/ListHashSet.h> >+#import <wtf/URL.h> > #import <wtf/text/StringHash.h> > > namespace WebCore { >diff --git a/Source/WebCore/platform/mac/PublicSuffixMac.mm b/Source/WebCore/platform/mac/PublicSuffixMac.mm >index cd1cc738d6a2910a843ed746eda91a937b586e9f..668dce09face558873bbeb85dd0497ba5d344dcf 100644 >--- a/Source/WebCore/platform/mac/PublicSuffixMac.mm >+++ b/Source/WebCore/platform/mac/PublicSuffixMac.mm >@@ -28,11 +28,11 @@ > > #if ENABLE(PUBLIC_SUFFIX_LIST) > >-#import "URL.h" >-#import "WebCoreNSURLExtras.h" > #import <pal/spi/cf/CFNetworkSPI.h> > #import <wtf/HashMap.h> > #import <wtf/text/StringHash.h> >+#import <wtf/URL.h> >+#import <wtf/cocoa/NSURLExtras.h> > > namespace WebCore { > >@@ -80,7 +80,7 @@ String topPrivatelyControlledDomain(const String& domain) > > String decodeHostName(const String& domain) > { >- return decodeHostName((NSString *)(domain)); >+ return WTF::decodeHostName(domain); > } > > } >diff --git a/Source/WebCore/platform/mac/SSLKeyGeneratorMac.mm b/Source/WebCore/platform/mac/SSLKeyGeneratorMac.mm >index fc40aa19b04c3ae3471802763f7df389a7228c9d..bd9da0dd86accd1d84a6c3feda0b412a26adf625 100644 >--- a/Source/WebCore/platform/mac/SSLKeyGeneratorMac.mm >+++ b/Source/WebCore/platform/mac/SSLKeyGeneratorMac.mm >@@ -29,13 +29,13 @@ > #if PLATFORM(MAC) > > #import "LocalizedStrings.h" >-#import "URL.h" > #import <Security/SecAsn1Coder.h> > #import <Security/SecAsn1Templates.h> > #import <Security/SecEncodeTransform.h> > #import <wtf/ProcessPrivilege.h> > #import <wtf/RetainPtr.h> > #import <wtf/Scope.h> >+#import <wtf/URL.h> > #import <wtf/cf/TypeCastsCF.h> > #import <wtf/spi/cocoa/SecuritySPI.h> > #import <wtf/text/Base64.h> >diff --git a/Source/WebCore/platform/mac/URLMac.mm b/Source/WebCore/platform/mac/URLMac.mm >deleted file mode 100644 >index f312f8248e8482c8803bb8c786c737c476e848f2..0000000000000000000000000000000000000000 >--- a/Source/WebCore/platform/mac/URLMac.mm >+++ /dev/null >@@ -1,95 +0,0 @@ >-/* >- * Copyright (C) 2004, 2008 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#import "config.h" >-#import "URL.h" >- >-#import "CFURLExtras.h" >-#import "URLParser.h" >-#import "WebCoreNSURLExtras.h" >-#import <wtf/ObjCRuntimeExtras.h> >-#import <wtf/text/CString.h> >- >-@interface NSString (WebCoreNSURLExtras) >-- (BOOL)_web_looksLikeIPAddress; >-@end >- >-namespace WebCore { >- >-URL::URL(NSURL *url) >-{ >- if (!url) { >- invalidate(); >- return; >- } >- >- // FIXME: Why is it OK to ignore base URL here? >- CString urlBytes; >- getURLBytes((__bridge CFURLRef)url, urlBytes); >- URLParser parser(urlBytes.data()); >- *this = parser.result(); >-} >- >-URL::operator NSURL *() const >-{ >- // Creating a toll-free bridged CFURL because creation with NSURL methods would not preserve the original string. >- // We'll need fidelity when round-tripping via CFURLGetBytes(). >- return createCFURL().bridgingAutorelease(); >-} >- >-RetainPtr<CFURLRef> URL::createCFURL() const >-{ >- if (isNull()) >- return nullptr; >- >- if (isEmpty()) { >- // We use the toll-free bridge between NSURL and CFURL to create a CFURLRef supporting both empty and null values. >- return (__bridge CFURLRef)adoptNS([[NSURL alloc] initWithString:@""]).get(); >- } >- >- RetainPtr<CFURLRef> cfURL; >- >- // Fast path if the input data is 8-bit to avoid copying into a temporary buffer. >- if (LIKELY(m_string.is8Bit())) >- cfURL = createCFURLFromBuffer(reinterpret_cast<const char*>(m_string.characters8()), m_string.length()); >- else { >- // Slower path. >- URLCharBuffer buffer; >- copyToBuffer(buffer); >- cfURL = createCFURLFromBuffer(buffer.data(), buffer.size()); >- } >- >- if (protocolIsInHTTPFamily() && !isCFURLSameOrigin(cfURL.get(), *this)) >- return nullptr; >- >- return cfURL; >-} >- >-bool URL::hostIsIPAddress(StringView host) >-{ >- return [host.createNSStringWithoutCopying().get() _web_looksLikeIPAddress]; >-} >- >-} >diff --git a/Source/WebCore/platform/mac/WebCoreNSURLExtras.h b/Source/WebCore/platform/mac/WebCoreNSURLExtras.h >index fe10681345f57f3f41f4d0da72ce6161dbb06948..1c07329be9ebb6fb0a23c5d27cda802c4e801e19 100644 >--- a/Source/WebCore/platform/mac/WebCoreNSURLExtras.h >+++ b/Source/WebCore/platform/mac/WebCoreNSURLExtras.h >@@ -26,29 +26,10 @@ > * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > */ > >-@class NSString; > @class NSURL; > > namespace WebCore { > >-WEBCORE_EXPORT NSString *userVisibleString(NSURL *); > WEBCORE_EXPORT NSURL *URLByCanonicalizingURL(NSURL *); >-WEBCORE_EXPORT NSURL *URLWithUserTypedString(NSString *, NSURL *baseURL); // Return value of nil means error. >-WEBCORE_EXPORT NSURL *URLByRemovingUserInfo(NSURL *); >-WEBCORE_EXPORT BOOL hostNameNeedsDecodingWithRange(NSString *, NSRange, BOOL* error); >-WEBCORE_EXPORT BOOL hostNameNeedsEncodingWithRange(NSString *, NSRange, BOOL* error); >-WEBCORE_EXPORT NSString *decodeHostNameWithRange(NSString *, NSRange); // Return value of nil means error. >-WEBCORE_EXPORT NSString *encodeHostNameWithRange(NSString *, NSRange); // Return value of nil means error. >-WEBCORE_EXPORT NSString *decodeHostName(NSString *); // Return value of nil means error. >-WEBCORE_EXPORT NSString *encodeHostName(NSString *); // Return value of nil means error. >-WEBCORE_EXPORT NSURL *URLByTruncatingOneCharacterBeforeComponent(NSURL *, CFURLComponentType); >-WEBCORE_EXPORT NSURL *URLWithData(NSData *, NSURL *baseURL); >-WEBCORE_EXPORT NSData *originalURLData(NSURL *); >-WEBCORE_EXPORT NSData *dataForURLComponentType(NSURL *, CFURLComponentType); >-WEBCORE_EXPORT NSURL *URLWithUserTypedStringDeprecated(NSString *, NSURL *baseURL); >- >-NSRange rangeOfURLScheme(NSString *); >-WEBCORE_EXPORT BOOL isUserVisibleURL(NSString *); >-WEBCORE_EXPORT BOOL looksLikeAbsoluteURL(NSString *); > > } // namespace WebCore >diff --git a/Source/WebCore/platform/mac/WebCoreNSURLExtras.mm b/Source/WebCore/platform/mac/WebCoreNSURLExtras.mm >index efa78ddb8b9539b1931a77210ec6174297a7274e..d365b316777846347ccf235b763faff3309657fd 100644 >--- a/Source/WebCore/platform/mac/WebCoreNSURLExtras.mm >+++ b/Source/WebCore/platform/mac/WebCoreNSURLExtras.mm >@@ -27,7 +27,6 @@ > */ > > #import "config.h" >-#import "URLParser.h" > #import "WebCoreNSURLExtras.h" > #import <pal/spi/cf/CFNetworkSPI.h> > #import <wtf/Function.h> >@@ -39,999 +38,8 @@ > #import <unicode/uidna.h> > #import <unicode/uscript.h> > >-// Needs to be big enough to hold an IDN-encoded name. >-// For host names bigger than this, we won't do IDN encoding, which is almost certainly OK. >-#define HOST_NAME_BUFFER_LENGTH 2048 >-#define URL_BYTES_BUFFER_LENGTH 2048 >- >-typedef void (* StringRangeApplierFunction)(NSString *, NSRange, RetainPtr<NSMutableArray>&); >- >-static uint32_t IDNScriptWhiteList[(USCRIPT_CODE_LIMIT + 31) / 32]; >- > namespace WebCore { > >-static bool isArmenianLookalikeCharacter(UChar32 codePoint) >-{ >- return codePoint == 0x0548 || codePoint == 0x054D || codePoint == 0x0578 || codePoint == 0x057D; >-} >- >-static bool isArmenianScriptCharacter(UChar32 codePoint) >-{ >- UErrorCode error = U_ZERO_ERROR; >- UScriptCode script = uscript_getScript(codePoint, &error); >- if (error != U_ZERO_ERROR) { >- LOG_ERROR("got ICU error while trying to look at scripts: %d", error); >- return false; >- } >- >- return script == USCRIPT_ARMENIAN; >-} >- >- >-template<typename CharacterType> inline bool isASCIIDigitOrValidHostCharacter(CharacterType charCode) >-{ >- if (!isASCIIDigitOrPunctuation(charCode)) >- return false; >- >- // Things the URL Parser rejects: >- switch (charCode) { >- case '#': >- case '%': >- case '/': >- case ':': >- case '?': >- case '@': >- case '[': >- case '\\': >- case ']': >- return false; >- default: >- return true; >- } >-} >- >- >- >-static BOOL isLookalikeCharacter(std::optional<UChar32> previousCodePoint, UChar32 charCode) >-{ >- // This function treats the following as unsafe, lookalike characters: >- // any non-printable character, any character considered as whitespace, >- // any ignorable character, and emoji characters related to locks. >- >- // We also considered the characters in Mozilla's blacklist <http://kb.mozillazine.org/Network.IDN.blacklist_chars>. >- >- // Some of the characters here will never appear once ICU has encoded. >- // For example, ICU transforms most spaces into an ASCII space and most >- // slashes into an ASCII solidus. But one of the two callers uses this >- // on characters that have not been processed by ICU, so they are needed here. >- >- if (!u_isprint(charCode) || u_isUWhiteSpace(charCode) || u_hasBinaryProperty(charCode, UCHAR_DEFAULT_IGNORABLE_CODE_POINT)) >- return YES; >- >- switch (charCode) { >- case 0x00BC: /* VULGAR FRACTION ONE QUARTER */ >- case 0x00BD: /* VULGAR FRACTION ONE HALF */ >- case 0x00BE: /* VULGAR FRACTION THREE QUARTERS */ >- case 0x00ED: /* LATIN SMALL LETTER I WITH ACUTE */ >- case 0x01C3: /* LATIN LETTER RETROFLEX CLICK */ >- case 0x0251: /* LATIN SMALL LETTER ALPHA */ >- case 0x0261: /* LATIN SMALL LETTER SCRIPT G */ >- case 0x02D0: /* MODIFIER LETTER TRIANGULAR COLON */ >- case 0x0335: /* COMBINING SHORT STROKE OVERLAY */ >- case 0x0337: /* COMBINING SHORT SOLIDUS OVERLAY */ >- case 0x0338: /* COMBINING LONG SOLIDUS OVERLAY */ >- case 0x0589: /* ARMENIAN FULL STOP */ >- case 0x05B4: /* HEBREW POINT HIRIQ */ >- case 0x05BC: /* HEBREW POINT DAGESH OR MAPIQ */ >- case 0x05C3: /* HEBREW PUNCTUATION SOF PASUQ */ >- case 0x05F4: /* HEBREW PUNCTUATION GERSHAYIM */ >- case 0x0609: /* ARABIC-INDIC PER MILLE SIGN */ >- case 0x060A: /* ARABIC-INDIC PER TEN THOUSAND SIGN */ >- case 0x0650: /* ARABIC KASRA */ >- case 0x0660: /* ARABIC INDIC DIGIT ZERO */ >- case 0x066A: /* ARABIC PERCENT SIGN */ >- case 0x06D4: /* ARABIC FULL STOP */ >- case 0x06F0: /* EXTENDED ARABIC INDIC DIGIT ZERO */ >- case 0x0701: /* SYRIAC SUPRALINEAR FULL STOP */ >- case 0x0702: /* SYRIAC SUBLINEAR FULL STOP */ >- case 0x0703: /* SYRIAC SUPRALINEAR COLON */ >- case 0x0704: /* SYRIAC SUBLINEAR COLON */ >- case 0x1735: /* PHILIPPINE SINGLE PUNCTUATION */ >- case 0x1D04: /* LATIN LETTER SMALL CAPITAL C */ >- case 0x1D0F: /* LATIN LETTER SMALL CAPITAL O */ >- case 0x1D1C: /* LATIN LETTER SMALL CAPITAL U */ >- case 0x1D20: /* LATIN LETTER SMALL CAPITAL V */ >- case 0x1D21: /* LATIN LETTER SMALL CAPITAL W */ >- case 0x1D22: /* LATIN LETTER SMALL CAPITAL Z */ >- case 0x1ECD: /* LATIN SMALL LETTER O WITH DOT BELOW */ >- case 0x2010: /* HYPHEN */ >- case 0x2011: /* NON-BREAKING HYPHEN */ >- case 0x2024: /* ONE DOT LEADER */ >- case 0x2027: /* HYPHENATION POINT */ >- case 0x2039: /* SINGLE LEFT-POINTING ANGLE QUOTATION MARK */ >- case 0x203A: /* SINGLE RIGHT-POINTING ANGLE QUOTATION MARK */ >- case 0x2041: /* CARET INSERTION POINT */ >- case 0x2044: /* FRACTION SLASH */ >- case 0x2052: /* COMMERCIAL MINUS SIGN */ >- case 0x2153: /* VULGAR FRACTION ONE THIRD */ >- case 0x2154: /* VULGAR FRACTION TWO THIRDS */ >- case 0x2155: /* VULGAR FRACTION ONE FIFTH */ >- case 0x2156: /* VULGAR FRACTION TWO FIFTHS */ >- case 0x2157: /* VULGAR FRACTION THREE FIFTHS */ >- case 0x2158: /* VULGAR FRACTION FOUR FIFTHS */ >- case 0x2159: /* VULGAR FRACTION ONE SIXTH */ >- case 0x215A: /* VULGAR FRACTION FIVE SIXTHS */ >- case 0x215B: /* VULGAR FRACTION ONE EIGHT */ >- case 0x215C: /* VULGAR FRACTION THREE EIGHTHS */ >- case 0x215D: /* VULGAR FRACTION FIVE EIGHTHS */ >- case 0x215E: /* VULGAR FRACTION SEVEN EIGHTHS */ >- case 0x215F: /* FRACTION NUMERATOR ONE */ >- case 0x2212: /* MINUS SIGN */ >- case 0x2215: /* DIVISION SLASH */ >- case 0x2216: /* SET MINUS */ >- case 0x2236: /* RATIO */ >- case 0x233F: /* APL FUNCTIONAL SYMBOL SLASH BAR */ >- case 0x23AE: /* INTEGRAL EXTENSION */ >- case 0x244A: /* OCR DOUBLE BACKSLASH */ >- case 0x2571: /* DisplayType::Box DRAWINGS LIGHT DIAGONAL UPPER RIGHT TO LOWER LEFT */ >- case 0x2572: /* DisplayType::Box DRAWINGS LIGHT DIAGONAL UPPER LEFT TO LOWER RIGHT */ >- case 0x29F6: /* SOLIDUS WITH OVERBAR */ >- case 0x29F8: /* BIG SOLIDUS */ >- case 0x2AFB: /* TRIPLE SOLIDUS BINARY RELATION */ >- case 0x2AFD: /* DOUBLE SOLIDUS OPERATOR */ >- case 0x2FF0: /* IDEOGRAPHIC DESCRIPTION CHARACTER LEFT TO RIGHT */ >- case 0x2FF1: /* IDEOGRAPHIC DESCRIPTION CHARACTER ABOVE TO BELOW */ >- case 0x2FF2: /* IDEOGRAPHIC DESCRIPTION CHARACTER LEFT TO MIDDLE AND RIGHT */ >- case 0x2FF3: /* IDEOGRAPHIC DESCRIPTION CHARACTER ABOVE TO MIDDLE AND BELOW */ >- case 0x2FF4: /* IDEOGRAPHIC DESCRIPTION CHARACTER FULL SURROUND */ >- case 0x2FF5: /* IDEOGRAPHIC DESCRIPTION CHARACTER SURROUND FROM ABOVE */ >- case 0x2FF6: /* IDEOGRAPHIC DESCRIPTION CHARACTER SURROUND FROM BELOW */ >- case 0x2FF7: /* IDEOGRAPHIC DESCRIPTION CHARACTER SURROUND FROM LEFT */ >- case 0x2FF8: /* IDEOGRAPHIC DESCRIPTION CHARACTER SURROUND FROM UPPER LEFT */ >- case 0x2FF9: /* IDEOGRAPHIC DESCRIPTION CHARACTER SURROUND FROM UPPER RIGHT */ >- case 0x2FFA: /* IDEOGRAPHIC DESCRIPTION CHARACTER SURROUND FROM LOWER LEFT */ >- case 0x2FFB: /* IDEOGRAPHIC DESCRIPTION CHARACTER OVERLAID */ >- case 0x3002: /* IDEOGRAPHIC FULL STOP */ >- case 0x3008: /* LEFT ANGLE BRACKET */ >- case 0x3014: /* LEFT TORTOISE SHELL BRACKET */ >- case 0x3015: /* RIGHT TORTOISE SHELL BRACKET */ >- case 0x3033: /* VERTICAL KANA REPEAT MARK UPPER HALF */ >- case 0x3035: /* VERTICAL KANA REPEAT MARK LOWER HALF */ >- case 0x321D: /* PARENTHESIZED KOREAN CHARACTER OJEON */ >- case 0x321E: /* PARENTHESIZED KOREAN CHARACTER O HU */ >- case 0x33AE: /* SQUARE RAD OVER S */ >- case 0x33AF: /* SQUARE RAD OVER S SQUARED */ >- case 0x33C6: /* SQUARE C OVER KG */ >- case 0x33DF: /* SQUARE A OVER M */ >- case 0x05B9: /* HEBREW POINT HOLAM */ >- case 0x05BA: /* HEBREW POINT HOLAM HASER FOR VAV */ >- case 0x05C1: /* HEBREW POINT SHIN DOT */ >- case 0x05C2: /* HEBREW POINT SIN DOT */ >- case 0x05C4: /* HEBREW MARK UPPER DOT */ >- case 0xA731: /* LATIN LETTER SMALL CAPITAL S */ >- case 0xA771: /* LATIN SMALL LETTER DUM */ >- case 0xA789: /* MODIFIER LETTER COLON */ >- case 0xFE14: /* PRESENTATION FORM FOR VERTICAL SEMICOLON */ >- case 0xFE15: /* PRESENTATION FORM FOR VERTICAL EXCLAMATION MARK */ >- case 0xFE3F: /* PRESENTATION FORM FOR VERTICAL LEFT ANGLE BRACKET */ >- case 0xFE5D: /* SMALL LEFT TORTOISE SHELL BRACKET */ >- case 0xFE5E: /* SMALL RIGHT TORTOISE SHELL BRACKET */ >- case 0xFF0E: /* FULLWIDTH FULL STOP */ >- case 0xFF0F: /* FULL WIDTH SOLIDUS */ >- case 0xFF61: /* HALFWIDTH IDEOGRAPHIC FULL STOP */ >- case 0xFFFC: /* OBJECT REPLACEMENT CHARACTER */ >- case 0xFFFD: /* REPLACEMENT CHARACTER */ >- case 0x1F50F: /* LOCK WITH INK PEN */ >- case 0x1F510: /* CLOSED LOCK WITH KEY */ >- case 0x1F511: /* KEY */ >- case 0x1F512: /* LOCK */ >- case 0x1F513: /* OPEN LOCK */ >- return YES; >- case 0x0307: /* COMBINING DOT ABOVE */ >- return previousCodePoint == 0x0237 /* LATIN SMALL LETTER DOTLESS J */ >- || previousCodePoint == 0x0131 /* LATIN SMALL LETTER DOTLESS I */ >- || previousCodePoint == 0x05D5; /* HEBREW LETTER VAV */ >- case 0x0548: /* ARMENIAN CAPITAL LETTER VO */ >- case 0x054D: /* ARMENIAN CAPITAL LETTER SEH */ >- case 0x0578: /* ARMENIAN SMALL LETTER VO */ >- case 0x057D: /* ARMENIAN SMALL LETTER SEH */ >- return previousCodePoint >- && !isASCIIDigitOrValidHostCharacter(previousCodePoint.value()) >- && !isArmenianScriptCharacter(previousCodePoint.value()); >- case '.': >- return NO; >- default: >- return previousCodePoint >- && isArmenianLookalikeCharacter(previousCodePoint.value()) >- && !(isArmenianScriptCharacter(charCode) || isASCIIDigitOrValidHostCharacter(charCode)); >- } >-} >- >-static void whiteListIDNScript(const char* scriptName) >-{ >- int32_t script = u_getPropertyValueEnum(UCHAR_SCRIPT, scriptName); >- if (script >= 0 && script < USCRIPT_CODE_LIMIT) { >- size_t index = script / 32; >- uint32_t mask = 1 << (script % 32); >- IDNScriptWhiteList[index] |= mask; >- } >-} >- >-static BOOL readIDNScriptWhiteListFile(NSString *filename) >-{ >- if (!filename) >- return NO; >- >- FILE *file = fopen([filename fileSystemRepresentation], "r"); >- if (!file) >- return NO; >- >- // Read a word at a time. >- // Allow comments, starting with # character to the end of the line. >- while (1) { >- // Skip a comment if present. >- if (fscanf(file, " #%*[^\n\r]%*[\n\r]") == EOF) >- break; >- >- // Read a script name if present. >- char word[33]; >- int result = fscanf(file, " %32[^# \t\n\r]%*[^# \t\n\r] ", word); >- if (result == EOF) >- break; >- >- if (result == 1) { >- // Got a word, map to script code and put it into the array. >- whiteListIDNScript(word); >- } >- } >- fclose(file); >- return YES; >-} >- >-static BOOL allCharactersInIDNScriptWhiteList(const UChar *buffer, int32_t length) >-{ >- static dispatch_once_t flag; >- dispatch_once(&flag, ^{ >- // Read white list from library. >- NSArray *dirs = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSAllDomainsMask, YES); >- int numDirs = [dirs count]; >- for (int i = 0; i < numDirs; i++) { >- if (readIDNScriptWhiteListFile([[dirs objectAtIndex:i] stringByAppendingPathComponent:@"IDNScriptWhiteList.txt"])) >- return; >- } >- const char* defaultIDNScriptWhiteList[20] = { >- "Common", >- "Inherited", >- "Arabic", >- "Armenian", >- "Bopomofo", >- "Canadian_Aboriginal", >- "Devanagari", >- "Deseret", >- "Gujarati", >- "Gurmukhi", >- "Hangul", >- "Han", >- "Hebrew", >- "Hiragana", >- "Katakana_Or_Hiragana", >- "Katakana", >- "Latin", >- "Tamil", >- "Thai", >- "Yi", >- }; >- for (const char* scriptName : defaultIDNScriptWhiteList) >- whiteListIDNScript(scriptName); >- }); >- >- int32_t i = 0; >- std::optional<UChar32> previousCodePoint; >- while (i < length) { >- UChar32 c; >- U16_NEXT(buffer, i, length, c) >- UErrorCode error = U_ZERO_ERROR; >- UScriptCode script = uscript_getScript(c, &error); >- if (error != U_ZERO_ERROR) { >- LOG_ERROR("got ICU error while trying to look at scripts: %d", error); >- return NO; >- } >- if (script < 0) { >- LOG_ERROR("got negative number for script code from ICU: %d", script); >- return NO; >- } >- if (script >= USCRIPT_CODE_LIMIT) >- return NO; >- >- size_t index = script / 32; >- uint32_t mask = 1 << (script % 32); >- if (!(IDNScriptWhiteList[index] & mask)) >- return NO; >- >- if (isLookalikeCharacter(previousCodePoint, c)) >- return NO; >- previousCodePoint = c; >- } >- return YES; >-} >- >-static bool isSecondLevelDomainNameAllowedByTLDRules(const UChar* buffer, int32_t length, const WTF::Function<bool(UChar)>& characterIsAllowed) >-{ >- ASSERT(length > 0); >- >- for (int32_t i = length - 1; i >= 0; --i) { >- UChar ch = buffer[i]; >- >- if (characterIsAllowed(ch)) >- continue; >- >- // Only check the second level domain. Lower level registrars may have different rules. >- if (ch == '.') >- break; >- >- return false; >- } >- return true; >-} >- >-#define CHECK_RULES_IF_SUFFIX_MATCHES(suffix, function) \ >- { \ >- static const int32_t suffixLength = sizeof(suffix) / sizeof(suffix[0]); \ >- if (length > suffixLength && 0 == memcmp(buffer + length - suffixLength, suffix, sizeof(suffix))) \ >- return isSecondLevelDomainNameAllowedByTLDRules(buffer, length - suffixLength, function); \ >- } >- >-static bool isRussianDomainNameCharacter(UChar ch) >-{ >- // Only modern Russian letters, digits and dashes are allowed. >- return (ch >= 0x0430 && ch <= 0x044f) || ch == 0x0451 || isASCIIDigit(ch) || ch == '-'; >-} >- >-static BOOL allCharactersAllowedByTLDRules(const UChar* buffer, int32_t length) >-{ >- // Skip trailing dot for root domain. >- if (buffer[length - 1] == '.') >- length--; >- >- // http://cctld.ru/files/pdf/docs/rules_ru-rf.pdf >- static const UChar cyrillicRF[] = { >- '.', >- 0x0440, // CYRILLIC SMALL LETTER ER >- 0x0444 // CYRILLIC SMALL LETTER EF >- }; >- CHECK_RULES_IF_SUFFIX_MATCHES(cyrillicRF, isRussianDomainNameCharacter); >- >- // http://rusnames.ru/rules.pl >- static const UChar cyrillicRUS[] = { >- '.', >- 0x0440, // CYRILLIC SMALL LETTER ER >- 0x0443, // CYRILLIC SMALL LETTER U >- 0x0441 // CYRILLIC SMALL LETTER ES >- }; >- CHECK_RULES_IF_SUFFIX_MATCHES(cyrillicRUS, isRussianDomainNameCharacter); >- >- // http://ru.faitid.org/projects/moscow/documents/moskva/idn >- static const UChar cyrillicMOSKVA[] = { >- '.', >- 0x043C, // CYRILLIC SMALL LETTER EM >- 0x043E, // CYRILLIC SMALL LETTER O >- 0x0441, // CYRILLIC SMALL LETTER ES >- 0x043A, // CYRILLIC SMALL LETTER KA >- 0x0432, // CYRILLIC SMALL LETTER VE >- 0x0430 // CYRILLIC SMALL LETTER A >- }; >- CHECK_RULES_IF_SUFFIX_MATCHES(cyrillicMOSKVA, isRussianDomainNameCharacter); >- >- // http://www.dotdeti.ru/foruser/docs/regrules.php >- static const UChar cyrillicDETI[] = { >- '.', >- 0x0434, // CYRILLIC SMALL LETTER DE >- 0x0435, // CYRILLIC SMALL LETTER IE >- 0x0442, // CYRILLIC SMALL LETTER TE >- 0x0438 // CYRILLIC SMALL LETTER I >- }; >- CHECK_RULES_IF_SUFFIX_MATCHES(cyrillicDETI, isRussianDomainNameCharacter); >- >- // http://corenic.org - rules not published. The word is Russian, so only allowing Russian at this time, >- // although we may need to revise the checks if this ends up being used with other languages spoken in Russia. >- static const UChar cyrillicONLAYN[] = { >- '.', >- 0x043E, // CYRILLIC SMALL LETTER O >- 0x043D, // CYRILLIC SMALL LETTER EN >- 0x043B, // CYRILLIC SMALL LETTER EL >- 0x0430, // CYRILLIC SMALL LETTER A >- 0x0439, // CYRILLIC SMALL LETTER SHORT I >- 0x043D // CYRILLIC SMALL LETTER EN >- }; >- CHECK_RULES_IF_SUFFIX_MATCHES(cyrillicONLAYN, isRussianDomainNameCharacter); >- >- // http://corenic.org - same as above. >- static const UChar cyrillicSAYT[] = { >- '.', >- 0x0441, // CYRILLIC SMALL LETTER ES >- 0x0430, // CYRILLIC SMALL LETTER A >- 0x0439, // CYRILLIC SMALL LETTER SHORT I >- 0x0442 // CYRILLIC SMALL LETTER TE >- }; >- CHECK_RULES_IF_SUFFIX_MATCHES(cyrillicSAYT, isRussianDomainNameCharacter); >- >- // http://pir.org/products/opr-domain/ - rules not published. According to the registry site, >- // the intended audience is "Russian and other Slavic-speaking markets". >- // Chrome appears to only allow Russian, so sticking with that for now. >- static const UChar cyrillicORG[] = { >- '.', >- 0x043E, // CYRILLIC SMALL LETTER O >- 0x0440, // CYRILLIC SMALL LETTER ER >- 0x0433 // CYRILLIC SMALL LETTER GHE >- }; >- CHECK_RULES_IF_SUFFIX_MATCHES(cyrillicORG, isRussianDomainNameCharacter); >- >- // http://cctld.by/rules.html >- static const UChar cyrillicBEL[] = { >- '.', >- 0x0431, // CYRILLIC SMALL LETTER BE >- 0x0435, // CYRILLIC SMALL LETTER IE >- 0x043B // CYRILLIC SMALL LETTER EL >- }; >- CHECK_RULES_IF_SUFFIX_MATCHES(cyrillicBEL, [](UChar ch) { >- // Russian and Byelorussian letters, digits and dashes are allowed. >- return (ch >= 0x0430 && ch <= 0x044f) || ch == 0x0451 || ch == 0x0456 || ch == 0x045E || ch == 0x2019 || isASCIIDigit(ch) || ch == '-'; >- }); >- >- // http://www.nic.kz/docs/poryadok_vnedreniya_kaz_ru.pdf >- static const UChar cyrillicKAZ[] = { >- '.', >- 0x049B, // CYRILLIC SMALL LETTER KA WITH DESCENDER >- 0x0430, // CYRILLIC SMALL LETTER A >- 0x0437 // CYRILLIC SMALL LETTER ZE >- }; >- CHECK_RULES_IF_SUFFIX_MATCHES(cyrillicKAZ, [](UChar ch) { >- // Kazakh letters, digits and dashes are allowed. >- return (ch >= 0x0430 && ch <= 0x044f) || ch == 0x0451 || ch == 0x04D9 || ch == 0x0493 || ch == 0x049B || ch == 0x04A3 || ch == 0x04E9 || ch == 0x04B1 || ch == 0x04AF || ch == 0x04BB || ch == 0x0456 || isASCIIDigit(ch) || ch == '-'; >- }); >- >- // http://uanic.net/docs/documents-ukr/Rules%20of%20UKR_v4.0.pdf >- static const UChar cyrillicUKR[] = { >- '.', >- 0x0443, // CYRILLIC SMALL LETTER U >- 0x043A, // CYRILLIC SMALL LETTER KA >- 0x0440 // CYRILLIC SMALL LETTER ER >- }; >- CHECK_RULES_IF_SUFFIX_MATCHES(cyrillicUKR, [](UChar ch) { >- // Russian and Ukrainian letters, digits and dashes are allowed. >- return (ch >= 0x0430 && ch <= 0x044f) || ch == 0x0451 || ch == 0x0491 || ch == 0x0404 || ch == 0x0456 || ch == 0x0457 || isASCIIDigit(ch) || ch == '-'; >- }); >- >- // http://www.rnids.rs/data/DOKUMENTI/idn-srb-policy-termsofuse-v1.4-eng.pdf >- static const UChar cyrillicSRB[] = { >- '.', >- 0x0441, // CYRILLIC SMALL LETTER ES >- 0x0440, // CYRILLIC SMALL LETTER ER >- 0x0431 // CYRILLIC SMALL LETTER BE >- }; >- CHECK_RULES_IF_SUFFIX_MATCHES(cyrillicSRB, [](UChar ch) { >- // Serbian letters, digits and dashes are allowed. >- return (ch >= 0x0430 && ch <= 0x0438) || (ch >= 0x043A && ch <= 0x0448) || ch == 0x0452 || ch == 0x0458 || ch == 0x0459 || ch == 0x045A || ch == 0x045B || ch == 0x045F || isASCIIDigit(ch) || ch == '-'; >- }); >- >- // http://marnet.mk/doc/pravilnik-mk-mkd.pdf >- static const UChar cyrillicMKD[] = { >- '.', >- 0x043C, // CYRILLIC SMALL LETTER EM >- 0x043A, // CYRILLIC SMALL LETTER KA >- 0x0434 // CYRILLIC SMALL LETTER DE >- }; >- CHECK_RULES_IF_SUFFIX_MATCHES(cyrillicMKD, [](UChar ch) { >- // Macedonian letters, digits and dashes are allowed. >- return (ch >= 0x0430 && ch <= 0x0438) || (ch >= 0x043A && ch <= 0x0448) || ch == 0x0453 || ch == 0x0455 || ch == 0x0458 || ch == 0x0459 || ch == 0x045A || ch == 0x045C || ch == 0x045F || isASCIIDigit(ch) || ch == '-'; >- }); >- >- // https://www.mon.mn/cs/ >- static const UChar cyrillicMON[] = { >- '.', >- 0x043C, // CYRILLIC SMALL LETTER EM >- 0x043E, // CYRILLIC SMALL LETTER O >- 0x043D // CYRILLIC SMALL LETTER EN >- }; >- CHECK_RULES_IF_SUFFIX_MATCHES(cyrillicMON, [](UChar ch) { >- // Mongolian letters, digits and dashes are allowed. >- return (ch >= 0x0430 && ch <= 0x044f) || ch == 0x0451 || ch == 0x04E9 || ch == 0x04AF || isASCIIDigit(ch) || ch == '-'; >- }); >- >- // Not a known top level domain with special rules. >- return NO; >-} >- >-// Return value of nil means no mapping is necessary. >-// If makeString is NO, then return value is either nil or self to indicate mapping is necessary. >-// If makeString is YES, then return value is either nil or the mapped string. >-static NSString *mapHostNameWithRange(NSString *string, NSRange range, BOOL encode, BOOL makeString, BOOL *error) >-{ >- if (range.length > HOST_NAME_BUFFER_LENGTH) >- return nil; >- >- if (![string length]) >- return nil; >- >- UChar sourceBuffer[HOST_NAME_BUFFER_LENGTH]; >- UChar destinationBuffer[HOST_NAME_BUFFER_LENGTH]; >- >- if (encode && [string rangeOfString:@"%" options:NSLiteralSearch range:range].location != NSNotFound) { >- NSString *substring = [string substringWithRange:range]; >- substring = CFBridgingRelease(CFURLCreateStringByReplacingPercentEscapes(nullptr, (CFStringRef)substring, CFSTR(""))); >- if (substring) { >- string = substring; >- range = NSMakeRange(0, [string length]); >- } >- } >- >- int length = range.length; >- [string getCharacters:sourceBuffer range:range]; >- >- UErrorCode uerror = U_ZERO_ERROR; >- UIDNAInfo processingDetails = UIDNA_INFO_INITIALIZER; >- int32_t numCharactersConverted = (encode ? uidna_nameToASCII : uidna_nameToUnicode)(&URLParser::internationalDomainNameTranscoder(), sourceBuffer, length, destinationBuffer, HOST_NAME_BUFFER_LENGTH, &processingDetails, &uerror); >- if (length && (U_FAILURE(uerror) || processingDetails.errors)) { >- *error = YES; >- return nil; >- } >- >- if (numCharactersConverted == length && !memcmp(sourceBuffer, destinationBuffer, length * sizeof(UChar))) >- return nil; >- >- if (!encode && !allCharactersInIDNScriptWhiteList(destinationBuffer, numCharactersConverted) && !allCharactersAllowedByTLDRules(destinationBuffer, numCharactersConverted)) >- return nil; >- >- return makeString ? [NSString stringWithCharacters:destinationBuffer length:numCharactersConverted] : string; >-} >- >-BOOL hostNameNeedsDecodingWithRange(NSString *string, NSRange range, BOOL *error) >-{ >- return mapHostNameWithRange(string, range, NO, NO, error) != nil; >-} >- >-BOOL hostNameNeedsEncodingWithRange(NSString *string, NSRange range, BOOL *error) >-{ >- return mapHostNameWithRange(string, range, YES, NO, error) != nil; >-} >- >-NSString *decodeHostNameWithRange(NSString *string, NSRange range) >-{ >- BOOL error = NO; >- NSString *host = mapHostNameWithRange(string, range, NO, YES, &error); >- if (error) >- return nil; >- return !host ? string : host; >-} >- >-NSString *encodeHostNameWithRange(NSString *string, NSRange range) >-{ >- BOOL error = NO; >- NSString *host = mapHostNameWithRange(string, range, YES, YES, &error); >- if (error) >- return nil; >- return !host ? string : host; >-} >- >-NSString *decodeHostName(NSString *string) >-{ >- BOOL error = NO; >- NSString *host = mapHostNameWithRange(string, NSMakeRange(0, [string length]), NO, YES, &error); >- if (error) >- return nil; >- return !host ? string : host; >-} >- >-NSString *encodeHostName(NSString *string) >-{ >- BOOL error = NO; >- NSString *host = mapHostNameWithRange(string, NSMakeRange(0, [string length]), YES, YES, &error); >- if (error) >- return nil; >- return !host ? string : host; >-} >- >-static void collectRangesThatNeedMapping(NSString *string, NSRange range, RetainPtr<NSMutableArray>& array, BOOL encode) >-{ >- // Generally, we want to optimize for the case where there is one host name that does not need mapping. >- // Therefore, we use nil to indicate no mapping here and an empty array to indicate error. >- >- BOOL error = NO; >- BOOL needsMapping = encode ? hostNameNeedsEncodingWithRange(string, range, &error) : hostNameNeedsDecodingWithRange(string, range, &error); >- if (!error && !needsMapping) >- return; >- >- if (!array) >- array = adoptNS([NSMutableArray new]); >- >- if (!error) >- [array addObject:[NSValue valueWithRange:range]]; >-} >- >-static void collectRangesThatNeedEncoding(NSString *string, NSRange range, RetainPtr<NSMutableArray>& array) >-{ >- return collectRangesThatNeedMapping(string, range, array, YES); >-} >- >-static void collectRangesThatNeedDecoding(NSString *string, NSRange range, RetainPtr<NSMutableArray>& array) >-{ >- return collectRangesThatNeedMapping(string, range, array, NO); >-} >- >-static void applyHostNameFunctionToMailToURLString(NSString *string, StringRangeApplierFunction f, RetainPtr<NSMutableArray>& array) >-{ >- // In a mailto: URL, host names come after a '@' character and end with a '>' or ',' or '?' character. >- // Skip quoted strings so that characters in them don't confuse us. >- // When we find a '?' character, we are past the part of the URL that contains host names. >- >- static NeverDestroyed<RetainPtr<NSCharacterSet>> hostNameOrStringStartCharacters = [NSCharacterSet characterSetWithCharactersInString:@"\"@?"]; >- static NeverDestroyed<RetainPtr<NSCharacterSet>> hostNameEndCharacters = [NSCharacterSet characterSetWithCharactersInString:@">,?"]; >- static NeverDestroyed<RetainPtr<NSCharacterSet>> quotedStringCharacters = [NSCharacterSet characterSetWithCharactersInString:@"\"\\"]; >- >- unsigned stringLength = [string length]; >- NSRange remaining = NSMakeRange(0, stringLength); >- >- while (1) { >- // Find start of host name or of quoted string. >- NSRange hostNameOrStringStart = [string rangeOfCharacterFromSet:hostNameOrStringStartCharacters.get().get() options:0 range:remaining]; >- if (hostNameOrStringStart.location == NSNotFound) >- return; >- >- unichar c = [string characterAtIndex:hostNameOrStringStart.location]; >- remaining.location = NSMaxRange(hostNameOrStringStart); >- remaining.length = stringLength - remaining.location; >- >- if (c == '?') >- return; >- >- if (c == '@') { >- // Find end of host name. >- unsigned hostNameStart = remaining.location; >- NSRange hostNameEnd = [string rangeOfCharacterFromSet:hostNameEndCharacters.get().get() options:0 range:remaining]; >- BOOL done; >- if (hostNameEnd.location == NSNotFound) { >- hostNameEnd.location = stringLength; >- done = YES; >- } else { >- remaining.location = hostNameEnd.location; >- remaining.length = stringLength - remaining.location; >- done = NO; >- } >- >- // Process host name range. >- f(string, NSMakeRange(hostNameStart, hostNameEnd.location - hostNameStart), array); >- >- if (done) >- return; >- } else { >- // Skip quoted string. >- ASSERT(c == '"'); >- while (1) { >- NSRange escapedCharacterOrStringEnd = [string rangeOfCharacterFromSet:quotedStringCharacters.get().get() options:0 range:remaining]; >- if (escapedCharacterOrStringEnd.location == NSNotFound) >- return; >- >- c = [string characterAtIndex:escapedCharacterOrStringEnd.location]; >- remaining.location = NSMaxRange(escapedCharacterOrStringEnd); >- remaining.length = stringLength - remaining.location; >- >- // If we are the end of the string, then break from the string loop back to the host name loop. >- if (c == '"') >- break; >- >- // Skip escaped character. >- ASSERT(c == '\\'); >- if (!remaining.length) >- return; >- >- remaining.location += 1; >- remaining.length -= 1; >- } >- } >- } >-} >- >-static void applyHostNameFunctionToURLString(NSString *string, StringRangeApplierFunction f, RetainPtr<NSMutableArray>& array) >-{ >- // Find hostnames. Too bad we can't use any real URL-parsing code to do this, >- // but we have to do it before doing all the %-escaping, and this is the only >- // code we have that parses mailto URLs anyway. >- >- // Maybe we should implement this using a character buffer instead? >- >- if (protocolIs(string, "mailto")) { >- applyHostNameFunctionToMailToURLString(string, f, array); >- return; >- } >- >- // Find the host name in a hierarchical URL. >- // It comes after a "://" sequence, with scheme characters preceding. >- // If ends with the end of the string or a ":", "/", or a "?". >- // If there is a "@" character, the host part is just the part after the "@". >- NSRange separatorRange = [string rangeOfString:@"://"]; >- if (separatorRange.location == NSNotFound) >- return; >- >- // Check that all characters before the :// are valid scheme characters. >- static NeverDestroyed<RetainPtr<NSCharacterSet>> nonSchemeCharacters = [[NSCharacterSet characterSetWithCharactersInString:@"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-."] invertedSet]; >- if ([string rangeOfCharacterFromSet:nonSchemeCharacters.get().get() options:0 range:NSMakeRange(0, separatorRange.location)].location != NSNotFound) >- return; >- >- unsigned stringLength = [string length]; >- >- static NeverDestroyed<RetainPtr<NSCharacterSet>> hostTerminators = [NSCharacterSet characterSetWithCharactersInString:@":/?#"]; >- >- // Start after the separator. >- unsigned authorityStart = NSMaxRange(separatorRange); >- >- // Find terminating character. >- NSRange hostNameTerminator = [string rangeOfCharacterFromSet:hostTerminators.get().get() options:0 range:NSMakeRange(authorityStart, stringLength - authorityStart)]; >- unsigned hostNameEnd = hostNameTerminator.location == NSNotFound ? stringLength : hostNameTerminator.location; >- >- // Find "@" for the start of the host name. >- NSRange userInfoTerminator = [string rangeOfString:@"@" options:0 range:NSMakeRange(authorityStart, hostNameEnd - authorityStart)]; >- unsigned hostNameStart = userInfoTerminator.location == NSNotFound ? authorityStart : NSMaxRange(userInfoTerminator); >- >- return f(string, NSMakeRange(hostNameStart, hostNameEnd - hostNameStart), array); >-} >- >-static RetainPtr<NSString> mapHostNames(NSString *string, BOOL encode) >-{ >- // Generally, we want to optimize for the case where there is one host name that does not need mapping. >- >- if (encode && [string canBeConvertedToEncoding:NSASCIIStringEncoding]) >- return string; >- >- // Make a list of ranges that actually need mapping. >- RetainPtr<NSMutableArray> hostNameRanges; >- StringRangeApplierFunction f = encode ? collectRangesThatNeedEncoding : collectRangesThatNeedDecoding; >- applyHostNameFunctionToURLString(string, f, hostNameRanges); >- if (!hostNameRanges) >- return string; >- >- if (![hostNameRanges count]) >- return nil; >- >- // Do the mapping. >- auto mutableCopy = adoptNS([string mutableCopy]); >- unsigned i = [hostNameRanges count]; >- while (i--) { >- NSRange hostNameRange = [[hostNameRanges objectAtIndex:i] rangeValue]; >- NSString *mappedHostName = encode ? encodeHostNameWithRange(string, hostNameRange) : decodeHostNameWithRange(string, hostNameRange); >- [mutableCopy replaceCharactersInRange:hostNameRange withString:mappedHostName]; >- } >- return mutableCopy; >-} >- >-static RetainPtr<NSString> stringByTrimmingWhitespace(NSString *string) >-{ >- auto trimmed = adoptNS([string mutableCopy]); >- CFStringTrimWhitespace((__bridge CFMutableStringRef)trimmed.get()); >- return trimmed; >-} >- >-NSURL *URLByTruncatingOneCharacterBeforeComponent(NSURL *URL, CFURLComponentType component) >-{ >- if (!URL) >- return nil; >- >- CFRange fragRg = CFURLGetByteRangeForComponent((__bridge CFURLRef)URL, component, nullptr); >- if (fragRg.location == kCFNotFound) >- return URL; >- >- Vector<UInt8, URL_BYTES_BUFFER_LENGTH> urlBytes(URL_BYTES_BUFFER_LENGTH); >- CFIndex numBytes = CFURLGetBytes((__bridge CFURLRef)URL, urlBytes.data(), urlBytes.size()); >- if (numBytes == -1) { >- numBytes = CFURLGetBytes((__bridge CFURLRef)URL, nullptr, 0); >- urlBytes.grow(numBytes); >- CFURLGetBytes((__bridge CFURLRef)URL, urlBytes.data(), numBytes); >- } >- >- CFURLRef result = CFURLCreateWithBytes(nullptr, urlBytes.data(), fragRg.location - 1, kCFStringEncodingUTF8, nullptr); >- if (!result) >- result = CFURLCreateWithBytes(nullptr, urlBytes.data(), fragRg.location - 1, kCFStringEncodingISOLatin1, nullptr); >- >- return result ? CFBridgingRelease(result) : URL; >-} >- >-static NSURL *URLByRemovingResourceSpecifier(NSURL *URL) >-{ >- return URLByTruncatingOneCharacterBeforeComponent(URL, kCFURLComponentResourceSpecifier); >-} >- >-NSURL *URLWithData(NSData *data, NSURL *baseURL) >-{ >- if (!data) >- return nil; >- >- NSURL *result = nil; >- size_t length = [data length]; >- if (length > 0) { >- // work around <rdar://4470771>: CFURLCreateAbsoluteURLWithBytes(.., TRUE) doesn't remove non-path components. >- baseURL = URLByRemovingResourceSpecifier(baseURL); >- >- const UInt8 *bytes = static_cast<const UInt8*>([data bytes]); >- >- // CFURLCreateAbsoluteURLWithBytes would complain to console if we passed a path to it. >- if (bytes[0] == '/' && !baseURL) >- return nil; >- >- // NOTE: We use UTF-8 here since this encoding is used when computing strings when returning URL components >- // (e.g calls to NSURL -path). However, this function is not tolerant of illegal UTF-8 sequences, which >- // could either be a malformed string or bytes in a different encoding, like shift-jis, so we fall back >- // onto using ISO Latin 1 in those cases. >- result = CFBridgingRelease(CFURLCreateAbsoluteURLWithBytes(nullptr, bytes, length, kCFStringEncodingUTF8, (__bridge CFURLRef)baseURL, YES)); >- if (!result) >- result = CFBridgingRelease(CFURLCreateAbsoluteURLWithBytes(nullptr, bytes, length, kCFStringEncodingISOLatin1, (__bridge CFURLRef)baseURL, YES)); >- } else >- result = [NSURL URLWithString:@""]; >- >- return result; >-} >-static NSData *dataWithUserTypedString(NSString *string) >-{ >- NSData *userTypedData = [string dataUsingEncoding:NSUTF8StringEncoding]; >- ASSERT(userTypedData); >- >- const UInt8* inBytes = static_cast<const UInt8 *>([userTypedData bytes]); >- int inLength = [userTypedData length]; >- if (!inLength) >- return nil; >- >- char* outBytes = static_cast<char *>(malloc(inLength * 3)); // large enough to %-escape every character >- char* p = outBytes; >- int outLength = 0; >- for (int i = 0; i < inLength; i++) { >- UInt8 c = inBytes[i]; >- if (c <= 0x20 || c >= 0x7f) { >- *p++ = '%'; >- *p++ = upperNibbleToASCIIHexDigit(c); >- *p++ = lowerNibbleToASCIIHexDigit(c); >- outLength += 3; >- } else { >- *p++ = c; >- outLength++; >- } >- } >- >- return [NSData dataWithBytesNoCopy:outBytes length:outLength]; // adopts outBytes >-} >- >-NSURL *URLWithUserTypedString(NSString *string, NSURL *nsURL) >-{ >- if (!string) >- return nil; >- >- auto mappedString = mapHostNames(stringByTrimmingWhitespace(string).get(), YES); >- if (!mappedString) >- return nil; >- >- // Let's check whether the URL is bogus. >- URL url { URL { nsURL }, mappedString.get() }; >- if (!url.createCFURL()) >- return nil; >- >- // FIXME: https://bugs.webkit.org/show_bug.cgi?id=186057 >- // We should be able to use url.createCFURL instead of using directly CFURL parsing routines. >- NSData *data = dataWithUserTypedString(mappedString.get()); >- if (!data) >- return [NSURL URLWithString:@""]; >- >- return URLWithData(data, nsURL); >-} >- >-NSURL *URLWithUserTypedStringDeprecated(NSString *string, NSURL *URL) >-{ >- if (!string) >- return nil; >- >- NSURL *result = URLWithUserTypedString(string, URL); >- if (!result) { >- NSData *resultData = dataWithUserTypedString(string); >- if (!resultData) >- return [NSURL URLWithString:@""]; >- result = URLWithData(resultData, URL); >- } >- >- return result; >-} >- >-static BOOL hasQuestionMarkOnlyQueryString(NSURL *URL) >-{ >- CFRange rangeWithSeparators; >- CFURLGetByteRangeForComponent((__bridge CFURLRef)URL, kCFURLComponentQuery, &rangeWithSeparators); >- if (rangeWithSeparators.location != kCFNotFound && rangeWithSeparators.length == 1) >- return YES; >- >- return NO; >-} >- >-NSData *dataForURLComponentType(NSURL *URL, CFURLComponentType componentType) >-{ >- Vector<UInt8, URL_BYTES_BUFFER_LENGTH> allBytesBuffer(URL_BYTES_BUFFER_LENGTH); >- CFIndex bytesFilled = CFURLGetBytes((__bridge CFURLRef)URL, allBytesBuffer.data(), allBytesBuffer.size()); >- if (bytesFilled == -1) { >- CFIndex bytesToAllocate = CFURLGetBytes((__bridge CFURLRef)URL, nullptr, 0); >- allBytesBuffer.grow(bytesToAllocate); >- bytesFilled = CFURLGetBytes((__bridge CFURLRef)URL, allBytesBuffer.data(), bytesToAllocate); >- } >- >- const CFURLComponentType completeURL = (CFURLComponentType)-1; >- CFRange range; >- if (componentType != completeURL) { >- range = CFURLGetByteRangeForComponent((__bridge CFURLRef)URL, componentType, nullptr); >- if (range.location == kCFNotFound) >- return nil; >- } else { >- range.location = 0; >- range.length = bytesFilled; >- } >- >- NSData *componentData = [NSData dataWithBytes:allBytesBuffer.data() + range.location length:range.length]; >- >- const unsigned char *bytes = static_cast<const unsigned char *>([componentData bytes]); >- NSMutableData *resultData = [NSMutableData data]; >- // NOTE: add leading '?' to query strings non-zero length query strings. >- // NOTE: retain question-mark only query strings. >- if (componentType == kCFURLComponentQuery) { >- if (range.length > 0 || hasQuestionMarkOnlyQueryString(URL)) >- [resultData appendBytes:"?" length:1]; >- } >- for (int i = 0; i < range.length; i++) { >- unsigned char c = bytes[i]; >- if (c <= 0x20 || c >= 0x7f) { >- char escaped[3]; >- escaped[0] = '%'; >- escaped[1] = upperNibbleToASCIIHexDigit(c); >- escaped[2] = lowerNibbleToASCIIHexDigit(c); >- [resultData appendBytes:escaped length:3]; >- } else { >- char b[1]; >- b[0] = c; >- [resultData appendBytes:b length:1]; >- } >- } >- >- return resultData; >-} >- >-static NSURL *URLByRemovingComponentAndSubsequentCharacter(NSURL *URL, CFURLComponentType component) >-{ >- CFRange range = CFURLGetByteRangeForComponent((__bridge CFURLRef)URL, component, 0); >- if (range.location == kCFNotFound) >- return URL; >- >- // Remove one subsequent character. >- range.length++; >- >- Vector<UInt8, URL_BYTES_BUFFER_LENGTH> buffer(URL_BYTES_BUFFER_LENGTH); >- CFIndex numBytes = CFURLGetBytes((__bridge CFURLRef)URL, buffer.data(), buffer.size()); >- if (numBytes == -1) { >- numBytes = CFURLGetBytes((__bridge CFURLRef)URL, nullptr, 0); >- buffer.grow(numBytes); >- CFURLGetBytes((__bridge CFURLRef)URL, buffer.data(), numBytes); >- } >- UInt8* urlBytes = buffer.data(); >- >- if (numBytes < range.location) >- return URL; >- if (numBytes < range.location + range.length) >- range.length = numBytes - range.location; >- >- memmove(urlBytes + range.location, urlBytes + range.location + range.length, numBytes - range.location + range.length); >- >- CFURLRef result = CFURLCreateWithBytes(nullptr, urlBytes, numBytes - range.length, kCFStringEncodingUTF8, nullptr); >- if (!result) >- result = CFURLCreateWithBytes(nullptr, urlBytes, numBytes - range.length, kCFStringEncodingISOLatin1, nullptr); >- >- return result ? CFBridgingRelease(result) : URL; >-} >- >-NSURL *URLByRemovingUserInfo(NSURL *URL) >-{ >- return URLByRemovingComponentAndSubsequentCharacter(URL, kCFURLComponentUserInfo); >-} >- > NSURL *URLByCanonicalizingURL(NSURL *URL) > { > RetainPtr<NSURLRequest> request = adoptNS([[NSURLRequest alloc] initWithURL:URL]); >@@ -1049,203 +57,4 @@ NSURL *URLByCanonicalizingURL(NSURL *URL) > return [[newURL retain] autorelease]; > } > >-NSData *originalURLData(NSURL *URL) >-{ >- UInt8 *buffer = (UInt8 *)malloc(URL_BYTES_BUFFER_LENGTH); >- CFIndex bytesFilled = CFURLGetBytes((__bridge CFURLRef)URL, buffer, URL_BYTES_BUFFER_LENGTH); >- if (bytesFilled == -1) { >- CFIndex bytesToAllocate = CFURLGetBytes((__bridge CFURLRef)URL, nullptr, 0); >- buffer = (UInt8 *)realloc(buffer, bytesToAllocate); >- bytesFilled = CFURLGetBytes((__bridge CFURLRef)URL, buffer, bytesToAllocate); >- ASSERT(bytesFilled == bytesToAllocate); >- } >- >- // buffer is adopted by the NSData >- NSData *data = [NSData dataWithBytesNoCopy:buffer length:bytesFilled freeWhenDone:YES]; >- >- NSURL *baseURL = (__bridge NSURL *)CFURLGetBaseURL((__bridge CFURLRef)URL); >- if (baseURL) >- return originalURLData(URLWithData(data, baseURL)); >- return data; >-} >- >-static CFStringRef createStringWithEscapedUnsafeCharacters(CFStringRef string) >-{ >- CFIndex length = CFStringGetLength(string); >- Vector<UChar, URL_BYTES_BUFFER_LENGTH> sourceBuffer(length); >- CFStringGetCharacters(string, CFRangeMake(0, length), sourceBuffer.data()); >- >- Vector<UChar, URL_BYTES_BUFFER_LENGTH> outBuffer; >- >- std::optional<UChar32> previousCodePoint; >- CFIndex i = 0; >- while (i < length) { >- UChar32 c; >- U16_NEXT(sourceBuffer, i, length, c) >- >- if (isLookalikeCharacter(previousCodePoint, c)) { >- uint8_t utf8Buffer[4]; >- CFIndex offset = 0; >- UBool failure = false; >- U8_APPEND(utf8Buffer, offset, 4, c, failure) >- ASSERT(!failure); >- >- for (CFIndex j = 0; j < offset; ++j) { >- outBuffer.append('%'); >- outBuffer.append(upperNibbleToASCIIHexDigit(utf8Buffer[j])); >- outBuffer.append(lowerNibbleToASCIIHexDigit(utf8Buffer[j])); >- } >- } else { >- UChar utf16Buffer[2]; >- CFIndex offset = 0; >- UBool failure = false; >- U16_APPEND(utf16Buffer, offset, 2, c, failure) >- ASSERT(!failure); >- for (CFIndex j = 0; j < offset; ++j) >- outBuffer.append(utf16Buffer[j]); >- } >- previousCodePoint = c; >- } >- >- return CFStringCreateWithCharacters(nullptr, outBuffer.data(), outBuffer.size()); >-} >- >-NSString *userVisibleString(NSURL *URL) >-{ >- NSData *data = originalURLData(URL); >- const unsigned char *before = static_cast<const unsigned char*>([data bytes]); >- int length = [data length]; >- >- bool mayNeedHostNameDecoding = false; >- >- const unsigned char *p = before; >- int bufferLength = (length * 3) + 1; >- Vector<char, URL_BYTES_BUFFER_LENGTH> after(bufferLength); // large enough to %-escape every character >- char *q = after.data(); >- for (int i = 0; i < length; i++) { >- unsigned char c = p[i]; >- // unescape escape sequences that indicate bytes greater than 0x7f >- if (c == '%' && (i + 1 < length && isASCIIHexDigit(p[i + 1])) && i + 2 < length && isASCIIHexDigit(p[i + 2])) { >- auto u = toASCIIHexValue(p[i + 1], p[i + 2]); >- if (u > 0x7f) { >- // unescape >- *q++ = u; >- } else { >- // do not unescape >- *q++ = p[i]; >- *q++ = p[i + 1]; >- *q++ = p[i + 2]; >- } >- i += 2; >- } else { >- *q++ = c; >- >- // Check for "xn--" in an efficient, non-case-sensitive, way. >- if (c == '-' && i >= 3 && !mayNeedHostNameDecoding && (q[-4] | 0x20) == 'x' && (q[-3] | 0x20) == 'n' && q[-2] == '-') >- mayNeedHostNameDecoding = true; >- } >- } >- *q = '\0'; >- >- // Check string to see if it can be converted to display using UTF-8 >- RetainPtr<NSString> result = [NSString stringWithUTF8String:after.data()]; >- if (!result) { >- // Could not convert to UTF-8. >- // Convert characters greater than 0x7f to escape sequences. >- // Shift current string to the end of the buffer >- // then we will copy back bytes to the start of the buffer >- // as we convert. >- int afterlength = q - after.data(); >- char *p = after.data() + bufferLength - afterlength - 1; >- memmove(p, after.data(), afterlength + 1); // copies trailing '\0' >- char *q = after.data(); >- while (*p) { >- unsigned char c = *p; >- if (c > 0x7f) { >- *q++ = '%'; >- *q++ = upperNibbleToASCIIHexDigit(c); >- *q++ = lowerNibbleToASCIIHexDigit(c); >- } else >- *q++ = *p; >- p++; >- } >- *q = '\0'; >- result = [NSString stringWithUTF8String:after.data()]; >- } >- >- if (mayNeedHostNameDecoding) { >- // FIXME: Is it good to ignore the failure of mapHostNames and keep result intact? >- auto mappedResult = mapHostNames(result.get(), NO); >- if (mappedResult) >- result = mappedResult; >- } >- >- result = [result precomposedStringWithCanonicalMapping]; >- return CFBridgingRelease(createStringWithEscapedUnsafeCharacters((__bridge CFStringRef)result.get())); >-} >- >-BOOL isUserVisibleURL(NSString *string) >-{ >- BOOL valid = YES; >- // get buffer >- >- char static_buffer[1024]; >- const char *p; >- BOOL success = CFStringGetCString((__bridge CFStringRef)string, static_buffer, 1023, kCFStringEncodingUTF8); >- p = success ? static_buffer : [string UTF8String]; >- >- int length = strlen(p); >- >- // check for characters <= 0x20 or >=0x7f, %-escape sequences of %7f, and xn--, these >- // are the things that will lead _web_userVisibleString to actually change things. >- for (int i = 0; i < length; i++) { >- unsigned char c = p[i]; >- // escape control characters, space, and delete >- if (c <= 0x20 || c == 0x7f) { >- valid = NO; >- break; >- } else if (c == '%' && (i + 1 < length && isASCIIHexDigit(p[i + 1])) && i + 2 < length && isASCIIHexDigit(p[i + 2])) { >- auto u = toASCIIHexValue(p[i + 1], p[i + 2]); >- if (u > 0x7f) { >- valid = NO; >- break; >- } >- i += 2; >- } else { >- // Check for "xn--" in an efficient, non-case-sensitive, way. >- if (c == '-' && i >= 3 && (p[i - 3] | 0x20) == 'x' && (p[i - 2] | 0x20) == 'n' && p[i - 1] == '-') { >- valid = NO; >- break; >- } >- } >- } >- >- return valid; >-} >- >-NSRange rangeOfURLScheme(NSString *string) >-{ >- NSRange colon = [string rangeOfString:@":"]; >- if (colon.location != NSNotFound && colon.location > 0) { >- NSRange scheme = {0, colon.location}; >- /* >- This stuff is very expensive. 10-15 msec on a 2x1.2GHz. If not cached it swamps >- everything else when adding items to the autocomplete DB. Makes me wonder if we >- even need to enforce the character set here. >- */ >- NSString *acceptableCharacters = @"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+.-"; >- static NeverDestroyed<RetainPtr<NSCharacterSet>> InverseSchemeCharacterSet([[NSCharacterSet characterSetWithCharactersInString:acceptableCharacters] invertedSet]); >- NSRange illegals = [string rangeOfCharacterFromSet:InverseSchemeCharacterSet.get().get() options:0 range:scheme]; >- if (illegals.location == NSNotFound) >- return scheme; >- } >- return NSMakeRange(NSNotFound, 0); >-} >- >-BOOL looksLikeAbsoluteURL(NSString *string) >-{ >- // Trim whitespace because _web_URLWithString allows whitespace. >- return rangeOfURLScheme(stringByTrimmingWhitespace(string).get()).location != NSNotFound; >-} >- > } // namespace WebCore >diff --git a/Source/WebCore/platform/mediastream/MediaEndpointConfiguration.h b/Source/WebCore/platform/mediastream/MediaEndpointConfiguration.h >index b8617f392222773a12b743819380714a51d47e0b..a69a0e78f584751cff502f1624f3cf66b04c3c0e 100644 >--- a/Source/WebCore/platform/mediastream/MediaEndpointConfiguration.h >+++ b/Source/WebCore/platform/mediastream/MediaEndpointConfiguration.h >@@ -36,7 +36,7 @@ > #include "RTCBundlePolicy.h" > #include "RTCIceTransportPolicy.h" > #include "RTCPMuxPolicy.h" >-#include "URL.h" >+#include <wtf/URL.h> > #include <wtf/Vector.h> > #include <wtf/text/WTFString.h> > >diff --git a/Source/WebCore/platform/network/BlobPart.h b/Source/WebCore/platform/network/BlobPart.h >index 628f939a305ccf74669e6bcbabc0f59179563786..041c29a312f09817f8ecf17361613cad2fd6f4de 100644 >--- a/Source/WebCore/platform/network/BlobPart.h >+++ b/Source/WebCore/platform/network/BlobPart.h >@@ -25,7 +25,7 @@ > > #pragma once > >-#include "URL.h" >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/platform/network/BlobRegistry.h b/Source/WebCore/platform/network/BlobRegistry.h >index 02be7181dd7e95f1150c566c11ae44da74d6e9c7..2e893bdcc88a31fc9eb4a9f34c9dd78b69c48cfd 100644 >--- a/Source/WebCore/platform/network/BlobRegistry.h >+++ b/Source/WebCore/platform/network/BlobRegistry.h >@@ -38,7 +38,6 @@ namespace WebCore { > class BlobDataFileReference; > class BlobPart; > class BlobRegistry; >-class URL; > > WEBCORE_EXPORT BlobRegistry& blobRegistry(); > >diff --git a/Source/WebCore/platform/network/BlobRegistryImpl.h b/Source/WebCore/platform/network/BlobRegistryImpl.h >index c161849134ac5497024a01e223b5e45f591bd565..172bf1d75d020193ffcbdd216362926bb6f5f100 100644 >--- a/Source/WebCore/platform/network/BlobRegistryImpl.h >+++ b/Source/WebCore/platform/network/BlobRegistryImpl.h >@@ -33,14 +33,13 @@ > > #include "BlobData.h" > #include "BlobRegistry.h" >-#include "URLHash.h" > #include <wtf/HashMap.h> >+#include <wtf/URLHash.h> > #include <wtf/text/StringHash.h> > #include <wtf/text/WTFString.h> > > namespace WebCore { > >-class URL; > class ResourceHandle; > class ResourceHandleClient; > class ResourceRequest; >diff --git a/Source/WebCore/platform/network/BlobResourceHandle.cpp b/Source/WebCore/platform/network/BlobResourceHandle.cpp >index 6182be56c42605d50ea29d2d7be10217dbf62109..c94e39494b8e326db4a12a27201a46238de18c4b 100644 >--- a/Source/WebCore/platform/network/BlobResourceHandle.cpp >+++ b/Source/WebCore/platform/network/BlobResourceHandle.cpp >@@ -39,7 +39,7 @@ > #include "HTTPHeaderNames.h" > #include "HTTPParsers.h" > #include "ParsedContentRange.h" >-#include "URL.h" >+#include <wtf/URL.h> > #include "ResourceError.h" > #include "ResourceHandleClient.h" > #include "ResourceRequest.h" >diff --git a/Source/WebCore/platform/network/CookieRequestHeaderFieldProxy.h b/Source/WebCore/platform/network/CookieRequestHeaderFieldProxy.h >index 249a00361befac3c8ab339ad877e871f4bfe5932..32a6f57c0a2196047c7439b0939dfe2cd0c369e7 100644 >--- a/Source/WebCore/platform/network/CookieRequestHeaderFieldProxy.h >+++ b/Source/WebCore/platform/network/CookieRequestHeaderFieldProxy.h >@@ -27,8 +27,8 @@ > > #include "CookiesStrategy.h" > #include "SameSiteInfo.h" >-#include "URL.h" > #include <pal/SessionID.h> >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/platform/network/CredentialStorage.cpp b/Source/WebCore/platform/network/CredentialStorage.cpp >index 45bb472011ac5364a1df8b1b89420f9296ffa748..b9af422aef2efab48b4949f9b634f5097093f87c 100644 >--- a/Source/WebCore/platform/network/CredentialStorage.cpp >+++ b/Source/WebCore/platform/network/CredentialStorage.cpp >@@ -27,7 +27,7 @@ > #include "CredentialStorage.h" > > #include "NetworkStorageSession.h" >-#include "URL.h" >+#include <wtf/URL.h> > > #if PLATFORM(IOS_FAMILY) > #include "WebCoreThread.h" >diff --git a/Source/WebCore/platform/network/CredentialStorage.h b/Source/WebCore/platform/network/CredentialStorage.h >index 5cacc05631c1680d1d9427d7789529f3b18d307d..7ddc4fe55bb1be2f69200080c34f34babd50edb7 100644 >--- a/Source/WebCore/platform/network/CredentialStorage.h >+++ b/Source/WebCore/platform/network/CredentialStorage.h >@@ -23,8 +23,7 @@ > * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > */ > >-#ifndef CredentialStorage_h >-#define CredentialStorage_h >+#pragma once > > #include "Credential.h" > #include "ProtectionSpaceHash.h" >@@ -35,7 +34,6 @@ > > namespace WebCore { > >-class URL; > class ProtectionSpace; > > class CredentialStorage { >@@ -70,5 +68,3 @@ private: > }; > > } // namespace WebCore >- >-#endif // CredentialStorage_h >diff --git a/Source/WebCore/platform/network/DataURLDecoder.cpp b/Source/WebCore/platform/network/DataURLDecoder.cpp >index 3f4fb1ad884a782bdc614fd394fe7771aba54a4f..4605bea0a7a16d13a5d2c0e906fbae90cdd4622c 100644 >--- a/Source/WebCore/platform/network/DataURLDecoder.cpp >+++ b/Source/WebCore/platform/network/DataURLDecoder.cpp >@@ -30,9 +30,9 @@ > #include "HTTPParsers.h" > #include "SharedBuffer.h" > #include "TextEncoding.h" >-#include "URL.h" > #include <wtf/MainThread.h> > #include <wtf/RunLoop.h> >+#include <wtf/URL.h> > #include <wtf/WorkQueue.h> > #include <wtf/text/Base64.h> > >diff --git a/Source/WebCore/platform/network/DataURLDecoder.h b/Source/WebCore/platform/network/DataURLDecoder.h >index 7258247129cbbaa2c85fc3b49cfdb6680d2bd75d..974d9cebeb195188b5c84692aa0f5b26ba990cd6 100644 >--- a/Source/WebCore/platform/network/DataURLDecoder.h >+++ b/Source/WebCore/platform/network/DataURLDecoder.h >@@ -23,9 +23,7 @@ > * THE POSSIBILITY OF SUCH DAMAGE. > */ > >-#ifndef DataURLDecoder_h >-#define DataURLDecoder_h >- >+#pragma once > > #include <wtf/Function.h> > #include <wtf/Optional.h> >@@ -38,7 +36,6 @@ > namespace WebCore { > > class SharedBuffer; >-class URL; > > namespace DataURLDecoder { > >@@ -61,5 +58,3 @@ void decode(const URL&, const ScheduleContext&, DecodeCompletionHandler&&); > } > > } >- >-#endif >diff --git a/Source/WebCore/platform/network/FormData.h b/Source/WebCore/platform/network/FormData.h >index e8c7d98a075b66dd0542879b59164c0d46f6a726..bbaade185b79f54f8c0707539632166346ec2dec 100644 >--- a/Source/WebCore/platform/network/FormData.h >+++ b/Source/WebCore/platform/network/FormData.h >@@ -20,9 +20,9 @@ > #pragma once > > #include "BlobData.h" >-#include "URL.h" > #include <wtf/Forward.h> > #include <wtf/RefCounted.h> >+#include <wtf/URL.h> > #include <wtf/Variant.h> > #include <wtf/Vector.h> > #include <wtf/text/WTFString.h> >diff --git a/Source/WebCore/platform/network/ProxyServer.h b/Source/WebCore/platform/network/ProxyServer.h >index 103d9a96bbdc6152a61b7d161fe4090ba5bc3a05..52789b5bdd8dab397b369aac158c267721877de9 100644 >--- a/Source/WebCore/platform/network/ProxyServer.h >+++ b/Source/WebCore/platform/network/ProxyServer.h >@@ -23,15 +23,13 @@ > * THE POSSIBILITY OF SUCH DAMAGE. > */ > >-#ifndef ProxyServer_h >-#define ProxyServer_h >+#pragma once > > #include <wtf/Vector.h> > #include <wtf/text/WTFString.h> > > namespace WebCore { > >-class URL; > class NetworkingContext; > > // Represents a single proxy server. >@@ -75,5 +73,3 @@ WEBCORE_EXPORT Vector<ProxyServer> proxyServersForURL(const URL&); > WEBCORE_EXPORT String toString(const Vector<ProxyServer>&); > > } // namespace WebCore >- >-#endif // ProxyServer_h >diff --git a/Source/WebCore/platform/network/ResourceErrorBase.h b/Source/WebCore/platform/network/ResourceErrorBase.h >index 763318c2e114736236ec3d136c7c4a878ddcb2f3..e0bf04b8ac8f00b3939791ebfd0087ecb90db799 100644 >--- a/Source/WebCore/platform/network/ResourceErrorBase.h >+++ b/Source/WebCore/platform/network/ResourceErrorBase.h >@@ -26,7 +26,7 @@ > > #pragma once > >-#include "URL.h" >+#include <wtf/URL.h> > #include <wtf/text/WTFString.h> > > namespace WebCore { >diff --git a/Source/WebCore/platform/network/ResourceHandle.cpp b/Source/WebCore/platform/network/ResourceHandle.cpp >index ad7ddff171289199bf4c06d73d7febadcc91473b..d2ea9a107de679ac2a65ab56ec00384c113a6e49 100644 >--- a/Source/WebCore/platform/network/ResourceHandle.cpp >+++ b/Source/WebCore/platform/network/ResourceHandle.cpp >@@ -156,7 +156,7 @@ void ResourceHandle::didReceiveResponse(ResourceResponse&& response, CompletionH > if (response.isHTTP09()) { > auto url = response.url(); > std::optional<uint16_t> port = url.port(); >- if (port && !isDefaultPortForProtocol(port.value(), url.protocol())) { >+ if (port && !WTF::isDefaultPortForProtocol(port.value(), url.protocol())) { > cancel(); > String message = "Cancelled load from '" + url.stringCenterEllipsizedToLength() + "' because it is using HTTP/0.9."; > d->m_client->didFail(this, { String(), 0, url, message }); >diff --git a/Source/WebCore/platform/network/ResourceHandle.h b/Source/WebCore/platform/network/ResourceHandle.h >index 4f0bd7e9298e119e6bff42c4681db7b3886b17fd..b59ab21aa0a547f5d57c4b0288eb8b723689cfbd 100644 >--- a/Source/WebCore/platform/network/ResourceHandle.h >+++ b/Source/WebCore/platform/network/ResourceHandle.h >@@ -77,7 +77,6 @@ namespace WebCore { > class AuthenticationChallenge; > class Credential; > class Frame; >-class URL; > class NetworkingContext; > class ProtectionSpace; > class ResourceError; >diff --git a/Source/WebCore/platform/network/ResourceHandleClient.h b/Source/WebCore/platform/network/ResourceHandleClient.h >index c6619eebd5bfd3b9eb7a8bb6c5d338c54d96e244..7343bda55047a224cc5abd52ff94576dc0e88f98 100644 >--- a/Source/WebCore/platform/network/ResourceHandleClient.h >+++ b/Source/WebCore/platform/network/ResourceHandleClient.h >@@ -44,7 +44,6 @@ OBJC_CLASS NSCachedURLResponse; > namespace WebCore { > class AuthenticationChallenge; > class Credential; >-class URL; > class ProtectionSpace; > class ResourceHandle; > class ResourceError; >diff --git a/Source/WebCore/platform/network/ResourceRequestBase.cpp b/Source/WebCore/platform/network/ResourceRequestBase.cpp >index 9c02d2b1ca308ebed4b9657e624f35c052ab6f85..625ac51f7e39c19e32fbcb52d62a74ffecc1b273 100644 >--- a/Source/WebCore/platform/network/ResourceRequestBase.cpp >+++ b/Source/WebCore/platform/network/ResourceRequestBase.cpp >@@ -151,7 +151,7 @@ ResourceRequest ResourceRequestBase::redirectedRequest(const ResourceResponse& r > request.m_httpHeaderFields.remove(HTTPHeaderName::ContentLength); > } > >- if (shouldClearReferrerOnHTTPSToHTTPRedirect && !request.url().protocolIs("https") && WebCore::protocolIs(request.httpReferrer(), "https")) >+ if (shouldClearReferrerOnHTTPSToHTTPRedirect && !request.url().protocolIs("https") && WTF::protocolIs(request.httpReferrer(), "https")) > request.clearHTTPReferrer(); > > if (!protocolHostAndPortAreEqual(request.url(), redirectResponse.url())) >diff --git a/Source/WebCore/platform/network/ResourceRequestBase.h b/Source/WebCore/platform/network/ResourceRequestBase.h >index 3df33a113108e5e748b2d50a56e9de081f2ec152..30d4b1062dd0388845e847c9cd69ac44d297166a 100644 >--- a/Source/WebCore/platform/network/ResourceRequestBase.h >+++ b/Source/WebCore/platform/network/ResourceRequestBase.h >@@ -31,7 +31,7 @@ > #include "FormData.h" > #include "HTTPHeaderMap.h" > #include "IntRect.h" >-#include "URL.h" >+#include <wtf/URL.h> > #include "ResourceLoadPriority.h" > > namespace WebCore { >diff --git a/Source/WebCore/platform/network/ResourceResponseBase.h b/Source/WebCore/platform/network/ResourceResponseBase.h >index 6fca6b751f57f081f43a1343b2e5150ce2fd621a..ad2fd5791a7be174f8bf98447f90e4fb1df6b9f6 100644 >--- a/Source/WebCore/platform/network/ResourceResponseBase.h >+++ b/Source/WebCore/platform/network/ResourceResponseBase.h >@@ -31,8 +31,8 @@ > #include "HTTPHeaderMap.h" > #include "NetworkLoadMetrics.h" > #include "ParsedContentRange.h" >-#include "URL.h" > #include <wtf/Markable.h> >+#include <wtf/URL.h> > #include <wtf/WallTime.h> > > namespace WebCore { >diff --git a/Source/WebCore/platform/network/SocketStreamHandle.h b/Source/WebCore/platform/network/SocketStreamHandle.h >index b59bdba0b41295cee3853f6fea22abc24ecdbf25..6d1fd1a8309939894b49ea84b77a59f117d8a021 100644 >--- a/Source/WebCore/platform/network/SocketStreamHandle.h >+++ b/Source/WebCore/platform/network/SocketStreamHandle.h >@@ -31,8 +31,8 @@ > > #pragma once > >-#include "URL.h" > #include <wtf/ThreadSafeRefCounted.h> >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/platform/network/cf/DNSResolveQueueCFNet.cpp b/Source/WebCore/platform/network/cf/DNSResolveQueueCFNet.cpp >index 7d58757c23d72bcd41cd668a1c6238a773458b7b..b382a0d7edf16543ca3cf47b3de1c7715eb17450 100644 >--- a/Source/WebCore/platform/network/cf/DNSResolveQueueCFNet.cpp >+++ b/Source/WebCore/platform/network/cf/DNSResolveQueueCFNet.cpp >@@ -30,11 +30,11 @@ > > #include "NotImplemented.h" > #include "Timer.h" >-#include "URL.h" > #include <wtf/HashSet.h> > #include <wtf/MainThread.h> > #include <wtf/RetainPtr.h> > #include <wtf/StdLibExtras.h> >+#include <wtf/URL.h> > #include <wtf/text/StringHash.h> > > #if PLATFORM(WIN) >diff --git a/Source/WebCore/platform/network/cf/NetworkStorageSessionCFNet.cpp b/Source/WebCore/platform/network/cf/NetworkStorageSessionCFNet.cpp >index 07dcf435df8b82de37527a442dbb96f30baa00e1..81abed21450479104091b7f4646e18cff75d44b2 100644 >--- a/Source/WebCore/platform/network/cf/NetworkStorageSessionCFNet.cpp >+++ b/Source/WebCore/platform/network/cf/NetworkStorageSessionCFNet.cpp >@@ -40,12 +40,12 @@ > #include "CookieRequestHeaderFieldProxy.h" > #include "CookiesStrategy.h" > #include "NotImplemented.h" >-#include "URL.h" > #include <CFNetwork/CFHTTPCookiesPriv.h> > #include <CoreFoundation/CoreFoundation.h> > #include <pal/spi/cf/CFNetworkSPI.h> > #include <windows.h> > #include <wtf/SoftLinking.h> >+#include <wtf/URL.h> > #include <wtf/cf/TypeCastsCF.h> > #include <wtf/text/WTFString.h> > >diff --git a/Source/WebCore/platform/network/cf/ProxyServerCFNet.cpp b/Source/WebCore/platform/network/cf/ProxyServerCFNet.cpp >index 07517832faa4ba4ae76e9d303fe3873876b48d88..64cfc9becdb26cb53d0e14104ec4e1dfc69b2f40 100644 >--- a/Source/WebCore/platform/network/cf/ProxyServerCFNet.cpp >+++ b/Source/WebCore/platform/network/cf/ProxyServerCFNet.cpp >@@ -26,7 +26,7 @@ > #include "config.h" > #include "ProxyServer.h" > >-#include "URL.h" >+#include <wtf/URL.h> > #include "Logging.h" > #include <wtf/RetainPtr.h> > #include <wtf/text/CString.h> >diff --git a/Source/WebCore/platform/network/cf/ResourceErrorCF.cpp b/Source/WebCore/platform/network/cf/ResourceErrorCF.cpp >index 289e5970606c9d435b3aecf76548bea431cec61c..b7b9507aa357b867c18fc04d49998a9986b70029 100644 >--- a/Source/WebCore/platform/network/cf/ResourceErrorCF.cpp >+++ b/Source/WebCore/platform/network/cf/ResourceErrorCF.cpp >@@ -28,11 +28,11 @@ > > #if USE(CFURLCONNECTION) > >-#include "URL.h" > #include <CoreFoundation/CFError.h> > #include <CFNetwork/CFNetworkErrors.h> > #include <pal/spi/cf/CFNetworkSPI.h> > #include <wtf/RetainPtr.h> >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm b/Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm >index e13eb37c839bd35b73170fdeb1293b64e79164d7..c0900aeb5d16f433e4e715a90d3061dc4f55d085 100644 >--- a/Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm >+++ b/Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm >@@ -31,11 +31,11 @@ > #import "CookieStorageObserver.h" > #import "CookiesStrategy.h" > #import "SameSiteInfo.h" >-#import "URL.h" > #import <pal/spi/cf/CFNetworkSPI.h> > #import <wtf/BlockObjCExceptions.h> > #import <wtf/Optional.h> > #import <wtf/ProcessPrivilege.h> >+#import <wtf/URL.h> > #import <wtf/text/StringBuilder.h> > > @interface NSURL () >diff --git a/Source/WebCore/platform/network/curl/CookieJarCurlDatabase.cpp b/Source/WebCore/platform/network/curl/CookieJarCurlDatabase.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..c2d051e3793f5a8e868a4e79dfe1646567517aff >--- /dev/null >+++ b/Source/WebCore/platform/network/curl/CookieJarCurlDatabase.cpp >@@ -0,0 +1,145 @@ >+/* >+ * Copyright (C) 2018 Sony Interactive Entertainment Inc. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY >+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES >+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; >+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON >+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS >+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "CookieJarCurlDatabase.h" >+ >+#if USE(CURL) >+#include "Cookie.h" >+#include "CookieJarDB.h" >+#include "CookieRequestHeaderFieldProxy.h" >+#include "NetworkStorageSession.h" >+#include "NotImplemented.h" >+ >+#include <wtf/Optional.h> >+#include <wtf/URL.h> >+#include <wtf/text/StringBuilder.h> >+#include <wtf/text/WTFString.h> >+ >+namespace WebCore { >+ >+static String cookiesForSession(const NetworkStorageSession& session, const URL&, const URL& url, bool forHTTPHeader) >+{ >+ StringBuilder cookies; >+ >+ CookieJarDB& cookieJarDB = session.cookieDatabase(); >+ auto searchHTTPOnly = (forHTTPHeader ? std::nullopt : std::optional<bool> {false}); >+ auto secure = url.protocolIs("https") ? std::nullopt : std::optional<bool> {false}; >+ >+ Vector<Cookie> results; >+ if (cookieJarDB.searchCookies(url.string(), searchHTTPOnly, secure, std::nullopt, results)) { >+ for (auto result : results) { >+ if (!cookies.isEmpty()) >+ cookies.append("; "); >+ cookies.append(result.name); >+ cookies.append("="); >+ cookies.append(result.value); >+ } >+ } >+ return cookies.toString(); >+} >+ >+void CookieJarCurlDatabase::setCookiesFromDOM(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo&, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, const String& value) const >+{ >+ UNUSED_PARAM(frameID); >+ UNUSED_PARAM(pageID); >+ UNUSED_PARAM(firstParty); >+ >+ CookieJarDB& cookieJarDB = session.cookieDatabase(); >+ cookieJarDB.setCookie(url.string(), value, true); >+} >+ >+void CookieJarCurlDatabase::setCookiesFromHTTPResponse(const NetworkStorageSession& session, const URL& url, const String& value) const >+{ >+ CookieJarDB& cookieJarDB = session.cookieDatabase(); >+ cookieJarDB.setCookie(url.string(), value, false); >+} >+ >+std::pair<String, bool> CookieJarCurlDatabase::cookiesForDOM(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo&, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, IncludeSecureCookies) const >+{ >+ UNUSED_PARAM(frameID); >+ UNUSED_PARAM(pageID); >+ >+ // FIXME: This should filter secure cookies out if the caller requests it. >+ return { cookiesForSession(session, firstParty, url, false), false }; >+} >+ >+std::pair<String, bool> CookieJarCurlDatabase::cookieRequestHeaderFieldValue(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo&, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, IncludeSecureCookies) const >+{ >+ UNUSED_PARAM(frameID); >+ UNUSED_PARAM(pageID); >+ >+ // FIXME: This should filter secure cookies out if the caller requests it. >+ return { cookiesForSession(session, firstParty, url, true), false }; >+} >+ >+std::pair<String, bool> CookieJarCurlDatabase::cookieRequestHeaderFieldValue(const NetworkStorageSession& session, const CookieRequestHeaderFieldProxy& headerFieldProxy) const >+{ >+ return cookieRequestHeaderFieldValue(session, headerFieldProxy.firstParty, headerFieldProxy.sameSiteInfo, headerFieldProxy.url, headerFieldProxy.frameID, headerFieldProxy.pageID, headerFieldProxy.includeSecureCookies); >+} >+ >+bool CookieJarCurlDatabase::cookiesEnabled(const NetworkStorageSession& session) const >+{ >+ return session.cookieDatabase().isEnabled(); >+} >+ >+bool CookieJarCurlDatabase::getRawCookies(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, Vector<Cookie>& rawCookies) const >+{ >+ UNUSED_PARAM(frameID); >+ UNUSED_PARAM(pageID); >+ >+ CookieJarDB& cookieJarDB = session.cookieDatabase(); >+ return cookieJarDB.searchCookies(firstParty.string(), std::nullopt, std::nullopt, std::nullopt, rawCookies); >+} >+ >+void CookieJarCurlDatabase::deleteCookie(const NetworkStorageSession& session, const URL& url, const String& name) const >+{ >+ CookieJarDB& cookieJarDB = session.cookieDatabase(); >+ cookieJarDB.deleteCookie(url, name); >+} >+ >+void CookieJarCurlDatabase::getHostnamesWithCookies(const NetworkStorageSession&, HashSet<String>&) const >+{ >+ // FIXME: Not yet implemented >+} >+ >+void CookieJarCurlDatabase::deleteCookiesForHostnames(const NetworkStorageSession&, const Vector<String>&) const >+{ >+ // FIXME: Not yet implemented >+} >+ >+void CookieJarCurlDatabase::deleteAllCookies(const NetworkStorageSession& session) const >+{ >+ CookieJarDB& cookieJarDB = session.cookieDatabase(); >+ cookieJarDB.deleteAllCookies(); >+} >+ >+void CookieJarCurlDatabase::deleteAllCookiesModifiedSince(const NetworkStorageSession&, WallTime) const >+{ >+ // FIXME: Not yet implemented >+} >+ >+} // namespace WebCore >+ >+#endif // USE(CURL) >diff --git a/Source/WebCore/platform/network/curl/CookieJarDB.cpp b/Source/WebCore/platform/network/curl/CookieJarDB.cpp >index 799c137285f870efec287b93d16a1725acc6ffe1..12921c7f53b6f7e0a479a5b99f979efb7c2674d5 100644 >--- a/Source/WebCore/platform/network/curl/CookieJarDB.cpp >+++ b/Source/WebCore/platform/network/curl/CookieJarDB.cpp >@@ -29,9 +29,9 @@ > #include "FileSystem.h" > #include "Logging.h" > #include "SQLiteFileSystem.h" >-#include "URL.h" > > #include <wtf/MonotonicTime.h> >+#include <wtf/URL.h> > > #if ENABLE(PUBLIC_SUFFIX_LIST) > #include "PublicSuffix.h" >diff --git a/Source/WebCore/platform/network/curl/CookieUtil.h b/Source/WebCore/platform/network/curl/CookieUtil.h >index 04dbe832f669cb50fc7fa49a82150bffde033850..84d38df7e0bec734a8343209345cfe8d7f850edf 100644 >--- a/Source/WebCore/platform/network/curl/CookieUtil.h >+++ b/Source/WebCore/platform/network/curl/CookieUtil.h >@@ -24,8 +24,8 @@ > > #pragma once > >-#include "URL.h" > #include <wtf/Forward.h> >+#include <wtf/URL.h> > #include <wtf/text/WTFString.h> > > namespace WebCore { >diff --git a/Source/WebCore/platform/network/curl/CurlContext.h b/Source/WebCore/platform/network/curl/CurlContext.h >index 8052b828eeaa5e30a349ca7d2ef29ef0cbae624d..e741038dc43cc2ae36e66eebc87f16659e48fdad 100644 >--- a/Source/WebCore/platform/network/curl/CurlContext.h >+++ b/Source/WebCore/platform/network/curl/CurlContext.h >@@ -28,13 +28,13 @@ > > #include "CurlProxySettings.h" > #include "CurlSSLHandle.h" >-#include "URL.h" > > #include <wtf/Lock.h> > #include <wtf/NeverDestroyed.h> > #include <wtf/Noncopyable.h> > #include <wtf/Seconds.h> > #include <wtf/Threading.h> >+#include <wtf/URL.h> > > #if OS(WINDOWS) > #include <windows.h> >diff --git a/Source/WebCore/platform/network/curl/CurlProxySettings.h b/Source/WebCore/platform/network/curl/CurlProxySettings.h >index 27a70210df19130d95775492e01e965464fea91d..af313546c44a3277f06b4854ef03027b85814403 100644 >--- a/Source/WebCore/platform/network/curl/CurlProxySettings.h >+++ b/Source/WebCore/platform/network/curl/CurlProxySettings.h >@@ -25,7 +25,7 @@ > > #pragma once > >-#include "URL.h" >+#include <wtf/URL.h> > #include <wtf/text/WTFString.h> > > #define kCURLAUTH_DIGEST_IE (((unsigned long) 1) << 4) >diff --git a/Source/WebCore/platform/network/curl/CurlResponse.h b/Source/WebCore/platform/network/curl/CurlResponse.h >index 373661bd35afce667ae1bb3577a6c09dc144fa4d..e611ffc4fb1541f4cfd132872cbc1d5dc3d93fa7 100644 >--- a/Source/WebCore/platform/network/curl/CurlResponse.h >+++ b/Source/WebCore/platform/network/curl/CurlResponse.h >@@ -25,7 +25,7 @@ > > #pragma once > >-#include "URL.h" >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/platform/network/curl/NetworkStorageSessionCurl.cpp b/Source/WebCore/platform/network/curl/NetworkStorageSessionCurl.cpp >index 2d645c9d73925f7eead5403ed7903b3c3c197700..247a5275e858d90920c14f001327bc6a31ecd4ce 100644 >--- a/Source/WebCore/platform/network/curl/NetworkStorageSessionCurl.cpp >+++ b/Source/WebCore/platform/network/curl/NetworkStorageSessionCurl.cpp >@@ -36,10 +36,10 @@ > #include "FileSystem.h" > #include "NetworkingContext.h" > #include "ResourceHandle.h" >-#include "URL.h" > > #include <wtf/MainThread.h> > #include <wtf/NeverDestroyed.h> >+#include <wtf/URL.h> > #include <wtf/text/WTFString.h> > > namespace WebCore { >diff --git a/Source/WebCore/platform/network/curl/ProxyServerCurl.cpp b/Source/WebCore/platform/network/curl/ProxyServerCurl.cpp >index cda44993f634b2444a61dcaf97401e9f2602f0b0..18f508b6e48682a8fc700d1f67d7a96e093ed4ae 100644 >--- a/Source/WebCore/platform/network/curl/ProxyServerCurl.cpp >+++ b/Source/WebCore/platform/network/curl/ProxyServerCurl.cpp >@@ -28,7 +28,7 @@ > > #if USE(CURL) > >-#include "URL.h" >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/platform/network/curl/SocketStreamHandleImplCurl.cpp b/Source/WebCore/platform/network/curl/SocketStreamHandleImplCurl.cpp >index cfc48ffa25fd80fdb8d71fa7c3893d3e86a4577a..0710caee2503c1f3f3808e20437058827ed36dc5 100644 >--- a/Source/WebCore/platform/network/curl/SocketStreamHandleImplCurl.cpp >+++ b/Source/WebCore/platform/network/curl/SocketStreamHandleImplCurl.cpp >@@ -39,9 +39,9 @@ > #include "Logging.h" > #include "SocketStreamError.h" > #include "SocketStreamHandleClient.h" >-#include "URL.h" > #include <wtf/Lock.h> > #include <wtf/MainThread.h> >+#include <wtf/URL.h> > #include <wtf/text/CString.h> > > namespace WebCore { >diff --git a/Source/WebCore/platform/network/mac/ResourceErrorMac.mm b/Source/WebCore/platform/network/mac/ResourceErrorMac.mm >index dd620beb3674b1f2123aa99ff4032fd07daf11e5..0b55a02bc58696e425cd6f87f0b3067a489261b7 100644 >--- a/Source/WebCore/platform/network/mac/ResourceErrorMac.mm >+++ b/Source/WebCore/platform/network/mac/ResourceErrorMac.mm >@@ -26,11 +26,11 @@ > #import "config.h" > #import "ResourceError.h" > >-#import "URL.h" > #import <CoreFoundation/CFError.h> > #import <Foundation/Foundation.h> > #import <wtf/BlockObjCExceptions.h> > #import <wtf/NeverDestroyed.h> >+#import <wtf/URL.h> > #import <wtf/text/WTFString.h> > > @interface NSError (WebExtras) >diff --git a/Source/WebCore/platform/network/soup/GUniquePtrSoup.h b/Source/WebCore/platform/network/soup/GUniquePtrSoup.h >deleted file mode 100644 >index 86dc637412e18ba725f7483ec326e1249a88a16d..0000000000000000000000000000000000000000 >--- a/Source/WebCore/platform/network/soup/GUniquePtrSoup.h >+++ /dev/null >@@ -1,35 +0,0 @@ >-/* >- * Copyright (C) 2014 Igalia S.L >- * >- * This library is free software; you can redistribute it and/or >- * modify it under the terms of the GNU Library General Public >- * License as published by the Free Software Foundation; either >- * version 2 of the License, or (at your option) any later version. >- * >- * This library is distributed in the hope that it will be useful, >- * but WITHOUT ANY WARRANTY; without even the implied warranty of >- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >- * Library General Public License for more details. >- * >- * You should have received a copy of the GNU Library General Public License >- * along with this library; see the file COPYING.LIB. If not, write to >- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >- * Boston, MA 02110-1301, USA. >- */ >- >-#ifndef GUniquePtrSoup_h >-#define GUniquePtrSoup_h >- >-#include <libsoup/soup.h> >-#include <wtf/glib/GUniquePtr.h> >- >-namespace WTF { >- >-WTF_DEFINE_GPTR_DELETER(SoupURI, soup_uri_free) >-WTF_DEFINE_GPTR_DELETER(SoupCookie, soup_cookie_free) >-WTF_DEFINE_GPTR_DELETER(SoupMessageHeaders, soup_message_headers_free) >-WTF_DEFINE_GPTR_DELETER(SoupBuffer, soup_buffer_free) >- >-} // namespace WTF >- >-#endif >diff --git a/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp b/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp >index e483aa6316ce6c5d6c8f3e655d55dd1eeb0463cf..03d156e5ed6e8c1f590956a8bd840e8a3d10e47b 100644 >--- a/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp >+++ b/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp >@@ -33,7 +33,6 @@ > > #include "Cookie.h" > #include "CookieRequestHeaderFieldProxy.h" >-#include "GUniquePtrSoup.h" > #include "ResourceHandle.h" > #include "SoupNetworkSession.h" > #include <libsoup/soup.h> >@@ -41,6 +40,7 @@ > #include <wtf/MainThread.h> > #include <wtf/NeverDestroyed.h> > #include <wtf/glib/GUniquePtr.h> >+#include <wtf/glib/GUniquePtrSoup.h> > > #if USE(LIBSECRET) > #include "GRefPtrGtk.h" >diff --git a/Source/WebCore/platform/network/soup/ProxyServerSoup.cpp b/Source/WebCore/platform/network/soup/ProxyServerSoup.cpp >index 4c277c3d2167acc54411f9603e3519001733b4ad..9c99f895db4db7c811ca50f511d3d4fb25c716a0 100644 >--- a/Source/WebCore/platform/network/soup/ProxyServerSoup.cpp >+++ b/Source/WebCore/platform/network/soup/ProxyServerSoup.cpp >@@ -28,7 +28,7 @@ > > #if USE(SOUP) > >-#include "URL.h" >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp b/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp >index 63734c674c52ee95dc6c9e421c4660f418400baa..fb71813a375909c0a7a2f54574a811aeddb3fd69 100644 >--- a/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp >+++ b/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp >@@ -33,7 +33,6 @@ > > #include "CredentialStorage.h" > #include "FileSystem.h" >-#include "GUniquePtrSoup.h" > #include "HTTPParsers.h" > #include "LocalizedStrings.h" > #include "MIMETypeRegistry.h" >@@ -58,6 +57,7 @@ > #endif > #include <wtf/CompletionHandler.h> > #include <wtf/glib/GRefPtr.h> >+#include <wtf/glib/GUniquePtrSoup.h> > #include <wtf/glib/RunLoopSourcePriority.h> > #include <wtf/text/CString.h> > >diff --git a/Source/WebCore/platform/network/soup/ResourceRequest.h b/Source/WebCore/platform/network/soup/ResourceRequest.h >index 38e3a8ee696811fd5ba78b4b30c2c01a39ff5b5f..7472ad238b334a950901ede901583265b3f9bc45 100644 >--- a/Source/WebCore/platform/network/soup/ResourceRequest.h >+++ b/Source/WebCore/platform/network/soup/ResourceRequest.h >@@ -27,9 +27,9 @@ > #ifndef ResourceRequest_h > #define ResourceRequest_h > >-#include "GUniquePtrSoup.h" > #include "ResourceRequestBase.h" > #include <libsoup/soup.h> >+#include <wtf/glib/GUniquePtrSoup.h> > > namespace WebCore { > >diff --git a/Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp b/Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp >index 090dc7fd8e711e8237569702a67fca08b48e22cd..229c53cf5720276e525e9a6fb6f762b8ff58ee07 100644 >--- a/Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp >+++ b/Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp >@@ -24,11 +24,11 @@ > > #include "BlobData.h" > #include "BlobRegistryImpl.h" >-#include "GUniquePtrSoup.h" > #include "HTTPParsers.h" > #include "MIMETypeRegistry.h" > #include "SharedBuffer.h" > #include "WebKitSoupRequestGeneric.h" >+#include <wtf/glib/GUniquePtrSoup.h> > #include <wtf/text/CString.h> > #include <wtf/text/WTFString.h> > >diff --git a/Source/WebCore/platform/network/soup/SocketStreamHandleImplSoup.cpp b/Source/WebCore/platform/network/soup/SocketStreamHandleImplSoup.cpp >index 9cdddb87e37595a2bbad65102045f6fa742b4e42..5af9473f3772861131bae7177b34319a5c2db044 100644 >--- a/Source/WebCore/platform/network/soup/SocketStreamHandleImplSoup.cpp >+++ b/Source/WebCore/platform/network/soup/SocketStreamHandleImplSoup.cpp >@@ -41,9 +41,9 @@ > #include "SocketStreamError.h" > #include "SocketStreamHandleClient.h" > #include "SoupNetworkSession.h" >-#include "URL.h" > #include <gio/gio.h> > #include <glib.h> >+#include <wtf/URL.h> > #include <wtf/Vector.h> > #include <wtf/glib/GUniquePtr.h> > #include <wtf/glib/RunLoopSourcePriority.h> >diff --git a/Source/WebCore/platform/network/soup/SoupNetworkSession.cpp b/Source/WebCore/platform/network/soup/SoupNetworkSession.cpp >index 13ecb5b0f763c201cf17a41612a73f09a8f5a078..6004d17f76a03a90e338a90e3c545b52f519c760 100644 >--- a/Source/WebCore/platform/network/soup/SoupNetworkSession.cpp >+++ b/Source/WebCore/platform/network/soup/SoupNetworkSession.cpp >@@ -31,7 +31,6 @@ > > #include "AuthenticationChallenge.h" > #include "FileSystem.h" >-#include "GUniquePtrSoup.h" > #include "Logging.h" > #include "SoupNetworkProxySettings.h" > #include <glib/gstdio.h> >@@ -39,6 +38,7 @@ > #include <pal/crypto/CryptoDigest.h> > #include <wtf/HashSet.h> > #include <wtf/NeverDestroyed.h> >+#include <wtf/glib/GUniquePtrSoup.h> > #include <wtf/text/Base64.h> > #include <wtf/text/CString.h> > >diff --git a/Source/WebCore/platform/network/soup/SoupNetworkSession.h b/Source/WebCore/platform/network/soup/SoupNetworkSession.h >index d1e9d9ce5b289d14cc6c16593bf4ad067827e53a..5b5ff7977347151961a45c3497ea2f551344b1aa 100644 >--- a/Source/WebCore/platform/network/soup/SoupNetworkSession.h >+++ b/Source/WebCore/platform/network/soup/SoupNetworkSession.h >@@ -44,7 +44,6 @@ namespace WebCore { > > class CertificateInfo; > class ResourceError; >-class URL; > struct SoupNetworkProxySettings; > > class SoupNetworkSession { >diff --git a/Source/WebCore/platform/soup/URLSoup.cpp b/Source/WebCore/platform/soup/URLSoup.cpp >deleted file mode 100644 >index 97dba328695ffcb26f387b672aa9387372b2e91c..0000000000000000000000000000000000000000 >--- a/Source/WebCore/platform/soup/URLSoup.cpp >+++ /dev/null >@@ -1,76 +0,0 @@ >-/* >- * Copyright (C) 2014 Igalia S.L. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#include "config.h" >- >-#if USE(SOUP) >- >-#include "URL.h" >- >-#include "URLParser.h" >-#include <libsoup/soup.h> >-#include <wtf/text/CString.h> >- >-namespace WebCore { >- >-URL::URL(SoupURI* soupURI) >-{ >- if (!soupURI) { >- invalidate(); >- return; >- } >- >- GUniquePtr<gchar> urlString(soup_uri_to_string(soupURI, FALSE)); >- URLParser parser(String::fromUTF8(urlString.get())); >- *this = parser.result(); >- >- if (!isValid()) >- return; >- >- // Motivated by https://bugs.webkit.org/show_bug.cgi?id=38956. libsoup >- // does not add the password to the URL when calling >- // soup_uri_to_string, and thus the requests are not properly >- // built. Fixing soup_uri_to_string is a no-no as the maintainer does >- // not want to break compatibility with previous implementations >- if (soupURI->password) >- setPass(String::fromUTF8(soupURI->password)); >-} >- >-GUniquePtr<SoupURI> URL::createSoupURI() const >-{ >- if (!isValid()) >- return nullptr; >- >- return GUniquePtr<SoupURI>(soup_uri_new(string().utf8().data())); >-} >- >-bool URL::hostIsIPAddress(StringView host) >-{ >- return !host.isEmpty() && g_hostname_is_ip_address(host.utf8().data()); >-} >- >-} // namespace WebCore >- >-#endif >diff --git a/Source/WebCore/platform/text/TextEncoding.h b/Source/WebCore/platform/text/TextEncoding.h >index 77c5288fd0ce059864ef8123e0072bb7c35723db..7d03f863d0df49d2f79c7c3a6d1382cf416810e4 100644 >--- a/Source/WebCore/platform/text/TextEncoding.h >+++ b/Source/WebCore/platform/text/TextEncoding.h >@@ -25,13 +25,13 @@ > > #pragma once > >-#include "URL.h" > #include <pal/text/UnencodableHandling.h> >+#include <wtf/URL.h> > #include <wtf/text/WTFString.h> > > namespace WebCore { > >-class TextEncoding : public URLTextEncoding { >+class TextEncoding : public WTF::URLTextEncoding { > public: > TextEncoding() = default; > WEBCORE_EXPORT TextEncoding(const char* name); >diff --git a/Source/WebCore/platform/win/BString.cpp b/Source/WebCore/platform/win/BString.cpp >index bae1beaaaa37ade303b08f3489492490186479ca..0f46c5dcab29b7b463bb6ecd31b0eb3b758c223c 100644 >--- a/Source/WebCore/platform/win/BString.cpp >+++ b/Source/WebCore/platform/win/BString.cpp >@@ -26,8 +26,8 @@ > #include "config.h" > #include "BString.h" > >-#include "URL.h" > #include <windows.h> >+#include <wtf/URL.h> > #include <wtf/text/AtomicString.h> > #include <wtf/text/StringView.h> > >diff --git a/Source/WebCore/platform/win/BString.h b/Source/WebCore/platform/win/BString.h >index 1fbe02c1587c129b8d50502e64604e786ce82a2a..184b551d48e9c231ea02a78756fe96fed3e56665 100644 >--- a/Source/WebCore/platform/win/BString.h >+++ b/Source/WebCore/platform/win/BString.h >@@ -40,8 +40,6 @@ typedef _Null_terminated_ wchar_t* BSTR; > > namespace WebCore { > >- class URL; >- > class BString { > public: > BString(); >diff --git a/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp b/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp >index 6ff89ec180d5835c59140fc6a387f47b125b0a32..790a82f8b671100a162e53ed89797cd9078efff5 100644 >--- a/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp >+++ b/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp >@@ -27,13 +27,13 @@ > #include "ClipboardUtilitiesWin.h" > > #include "DocumentFragment.h" >-#include "URL.h" > #include "TextEncoding.h" > #include "markup.h" > #include <shlobj.h> > #include <shlwapi.h> > #include <wininet.h> // for INTERNET_MAX_URL_LENGTH > #include <wtf/StringExtras.h> >+#include <wtf/URL.h> > #include <wtf/Vector.h> > #include <wtf/text/CString.h> > #include <wtf/text/StringBuilder.h> >@@ -272,7 +272,7 @@ void markupToCFHTML(const String& markup, const String& srcURL, Vector<char>& re > const char* startMarkup = "<HTML>\n<BODY>\n<!--StartFragment-->\n"; > const char* endMarkup = "\n<!--EndFragment-->\n</BODY>\n</HTML>"; > >- CString sourceURLUTF8 = srcURL == blankURL() ? "" : srcURL.utf8(); >+ CString sourceURLUTF8 = srcURL == WTF::blankURL() ? "" : srcURL.utf8(); > CString markupUTF8 = markup.utf8(); > > // calculate offsets >diff --git a/Source/WebCore/platform/win/ClipboardUtilitiesWin.h b/Source/WebCore/platform/win/ClipboardUtilitiesWin.h >index 5cd9e0e757313ff0229a6cfba8ed6490a81afe28..c37f3e2de1961e6a13045477cca869264f0325b9 100644 >--- a/Source/WebCore/platform/win/ClipboardUtilitiesWin.h >+++ b/Source/WebCore/platform/win/ClipboardUtilitiesWin.h >@@ -34,7 +34,6 @@ namespace WebCore { > > class Document; > class DocumentFragment; >-class URL; > > HGLOBAL createGlobalData(const String&); > HGLOBAL createGlobalData(const Vector<char>&); >diff --git a/Source/WebCore/platform/win/DragImageWin.cpp b/Source/WebCore/platform/win/DragImageWin.cpp >index 1dfa50b532dd8b5af66675f8449fe54191174eff..a6b672fc727fe8379a2d0f7e0460716960cfbb87 100644 >--- a/Source/WebCore/platform/win/DragImageWin.cpp >+++ b/Source/WebCore/platform/win/DragImageWin.cpp >@@ -34,12 +34,12 @@ > #include "GraphicsContext.h" > #include "HWndDC.h" > #include "Image.h" >-#include "URL.h" > #include "StringTruncator.h" > #include "TextIndicator.h" > #include "TextRun.h" > #include "WebCoreTextRenderer.h" > #include <wtf/RetainPtr.h> >+#include <wtf/URL.h> > #include <wtf/text/win/WCharStringExtras.h> > #include <wtf/win/GDIObject.h> > >diff --git a/Source/WebCore/platform/win/PasteboardWin.cpp b/Source/WebCore/platform/win/PasteboardWin.cpp >index 06997990631e5c34364718ae6ab176594cdf369d..d5967a5820c97ae28c625a50d8038e00ee25dd2a 100644 >--- a/Source/WebCore/platform/win/PasteboardWin.cpp >+++ b/Source/WebCore/platform/win/PasteboardWin.cpp >@@ -41,7 +41,6 @@ > #include "HWndDC.h" > #include "HitTestResult.h" > #include "Image.h" >-#include "URL.h" > #include "NotImplemented.h" > #include "Range.h" > #include "RenderImage.h" >@@ -49,6 +48,7 @@ > #include "TextEncoding.h" > #include "WebCoreInstanceHandle.h" > #include "markup.h" >+#include <wtf/URL.h> > #include <wtf/WindowsExtras.h> > #include <wtf/text/CString.h> > #include <wtf/text/StringView.h> >diff --git a/Source/WebCore/plugins/PluginData.h b/Source/WebCore/plugins/PluginData.h >index 0b6c42ee2d08168bedefc8f3d0f9eae6e1a6bf58..f040b0af96f3b8bbd9f549329312b8f4f7069ed9 100644 >--- a/Source/WebCore/plugins/PluginData.h >+++ b/Source/WebCore/plugins/PluginData.h >@@ -20,10 +20,10 @@ > > #pragma once > >-#include "URL.h" > #include <wtf/HashMap.h> > #include <wtf/HashSet.h> > #include <wtf/RefCounted.h> >+#include <wtf/URL.h> > #include <wtf/Vector.h> > #include <wtf/text/StringHash.h> > #include <wtf/text/WTFString.h> >diff --git a/Source/WebCore/rendering/HitTestResult.h b/Source/WebCore/rendering/HitTestResult.h >index d0777b3450c3a020aefd43a723cc6cb133deae0b..332f28531d388cfe2c3d58a94c3f2617dcb91666 100644 >--- a/Source/WebCore/rendering/HitTestResult.h >+++ b/Source/WebCore/rendering/HitTestResult.h >@@ -38,7 +38,6 @@ class HTMLMediaElement; > class Image; > class Node; > class Scrollbar; >-class URL; > > enum class HitTestProgress { Stop, Continue }; > >diff --git a/Source/WebCore/rendering/RenderAttachment.cpp b/Source/WebCore/rendering/RenderAttachment.cpp >index ed3335e1374d8f7229252d54ce067cc3847681bd..7467ff3865682b8be63bb67debd719a4c8b7e3ca 100644 >--- a/Source/WebCore/rendering/RenderAttachment.cpp >+++ b/Source/WebCore/rendering/RenderAttachment.cpp >@@ -33,8 +33,8 @@ > #include "FrameSelection.h" > #include "HTMLAttachmentElement.h" > #include "RenderTheme.h" >-#include "URL.h" > #include <wtf/IsoMallocInlines.h> >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/svg/SVGImageLoader.cpp b/Source/WebCore/svg/SVGImageLoader.cpp >index 99996e01ed071af5871a1da166c63149a13b4e74..7221dfcb7ddde59039276addc9f39bda2d789045 100644 >--- a/Source/WebCore/svg/SVGImageLoader.cpp >+++ b/Source/WebCore/svg/SVGImageLoader.cpp >@@ -49,7 +49,7 @@ void SVGImageLoader::dispatchLoadEvent() > String SVGImageLoader::sourceURI(const AtomicString& attribute) const > { > URL base = element().baseURI(); >- if (base != blankURL()) >+ if (base != WTF::blankURL()) > return URL(base, stripLeadingAndTrailingHTMLSpaces(attribute)).string(); > return element().document().completeURL(stripLeadingAndTrailingHTMLSpaces(attribute)); > } >diff --git a/Source/WebCore/svg/SVGURIReference.cpp b/Source/WebCore/svg/SVGURIReference.cpp >index 081242821aed86f45c75bc5df22a3164bba0b0ef..2373cb4978d7d7722ae23b08746dd22619481c5f 100644 >--- a/Source/WebCore/svg/SVGURIReference.cpp >+++ b/Source/WebCore/svg/SVGURIReference.cpp >@@ -25,7 +25,7 @@ > #include "Document.h" > #include "Element.h" > #include "SVGAttributeOwnerProxy.h" >-#include "URL.h" >+#include <wtf/URL.h> > #include "XLinkNames.h" > > namespace WebCore { >diff --git a/Source/WebCore/svg/graphics/SVGImage.h b/Source/WebCore/svg/graphics/SVGImage.h >index 87e2823f9e71b67bd481e8e88411bad001264b98..cd3fd0d1e259dab4e33a69ab6ad1846d9ae5e195 100644 >--- a/Source/WebCore/svg/graphics/SVGImage.h >+++ b/Source/WebCore/svg/graphics/SVGImage.h >@@ -27,7 +27,7 @@ > #pragma once > > #include "Image.h" >-#include "URL.h" >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/svg/graphics/SVGImageCache.h b/Source/WebCore/svg/graphics/SVGImageCache.h >index 3f5bc3a756e68791bac8d3683b6c3c16746d9e42..32e722bfa273454c4b5a114ef80964375234f86f 100644 >--- a/Source/WebCore/svg/graphics/SVGImageCache.h >+++ b/Source/WebCore/svg/graphics/SVGImageCache.h >@@ -33,7 +33,6 @@ class LayoutSize; > class SVGImage; > class SVGImageForContainer; > class RenderObject; >-class URL; > > class SVGImageCache { > WTF_MAKE_FAST_ALLOCATED; >diff --git a/Source/WebCore/svg/graphics/SVGImageForContainer.h b/Source/WebCore/svg/graphics/SVGImageForContainer.h >index 69806be67703e2e949f341d5c986a85ea2d7e24f..4cfce8d4b0378579142267aa6b808767126b0424 100644 >--- a/Source/WebCore/svg/graphics/SVGImageForContainer.h >+++ b/Source/WebCore/svg/graphics/SVGImageForContainer.h >@@ -30,7 +30,7 @@ > #include "FloatSize.h" > #include "Image.h" > #include "SVGImage.h" >-#include "URL.h" >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/testing/Internals.cpp b/Source/WebCore/testing/Internals.cpp >index b11a32598af2fdb8e82ef0c74c3afecca7897d53..bf31334664b1513c58f459601fc64d810b6f436d 100644 >--- a/Source/WebCore/testing/Internals.cpp >+++ b/Source/WebCore/testing/Internals.cpp >@@ -459,7 +459,7 @@ void Internals::resetToConsistentState(Page& page) > backing->setTileSizeUpdateDelayDisabledForTesting(false); > } > >- WebCore::clearDefaultPortForProtocolMapForTesting(); >+ WTF::clearDefaultPortForProtocolMapForTesting(); > overrideUserPreferredLanguages(Vector<String>()); > WebCore::DeprecatedGlobalSettings::setUsesOverlayScrollbars(false); > WebCore::DeprecatedGlobalSettings::setUsesMockScrollAnimator(false); >diff --git a/Source/WebCore/testing/Internals.mm b/Source/WebCore/testing/Internals.mm >index e2f89c50625b383e2eba4401a44f9c2ae08c8f4b..b2404e2478532be62cb470dbcb0326dc1c24abee 100644 >--- a/Source/WebCore/testing/Internals.mm >+++ b/Source/WebCore/testing/Internals.mm >@@ -32,8 +32,8 @@ > #import "EventHandler.h" > #import "HitTestResult.h" > #import "Range.h" >-#import "WebCoreNSURLExtras.h" > #import <wtf/SoftLinking.h> >+#import <wtf/cocoa/NSURLExtras.h> > > #if PLATFORM(IOS_FAMILY) > SOFT_LINK_FRAMEWORK(UIKit) >@@ -44,7 +44,7 @@ namespace WebCore { > > String Internals::userVisibleString(const DOMURL& url) > { >- return WebCore::userVisibleString(url.href()); >+ return WTF::userVisibleString(url.href()); > } > > bool Internals::userPrefersReducedMotion() const >diff --git a/Source/WebCore/testing/MockContentFilter.cpp b/Source/WebCore/testing/MockContentFilter.cpp >index 648fbd26fac36a65c9957c51157887646f2dc262..51181dae72e13e2bbd153e811c14364d1cd8a187 100644 >--- a/Source/WebCore/testing/MockContentFilter.cpp >+++ b/Source/WebCore/testing/MockContentFilter.cpp >@@ -88,7 +88,7 @@ void MockContentFilter::willSendRequest(ResourceRequest& request, const Resource > > URL modifiedRequestURL { request.url(), modifiedRequestURLString }; > if (!modifiedRequestURL.isValid()) { >- LOG(ContentFiltering, "MockContentFilter failed to convert %s to a WebCore::URL.\n", modifiedRequestURL.string().ascii().data()); >+ LOG(ContentFiltering, "MockContentFilter failed to convert %s to a URL.\n", modifiedRequestURL.string().ascii().data()); > return; > } > >diff --git a/Source/WebCore/testing/MockPaymentCoordinator.cpp b/Source/WebCore/testing/MockPaymentCoordinator.cpp >index 1a848d899a58eb700e8b401dcac0fcb3b2340740..f56c485e444f836092725157506106eafc0423e9 100644 >--- a/Source/WebCore/testing/MockPaymentCoordinator.cpp >+++ b/Source/WebCore/testing/MockPaymentCoordinator.cpp >@@ -34,8 +34,8 @@ > #include "MockPaymentMethod.h" > #include "Page.h" > #include "PaymentCoordinator.h" >-#include "URL.h" > #include <wtf/RunLoop.h> >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/testing/js/WebCoreTestSupport.cpp b/Source/WebCore/testing/js/WebCoreTestSupport.cpp >index d241206a28dd5f6470da9fb84e9ed4fc74c287b0..5809f0bedf0e7a071728d09eb929747c4b4ee07b 100644 >--- a/Source/WebCore/testing/js/WebCoreTestSupport.cpp >+++ b/Source/WebCore/testing/js/WebCoreTestSupport.cpp >@@ -39,12 +39,12 @@ > #include "Page.h" > #include "SWContextManager.h" > #include "ServiceWorkerGlobalScope.h" >-#include "URLParser.h" > #include "WheelEventTestTrigger.h" > #include <JavaScriptCore/APICast.h> > #include <JavaScriptCore/CallFrame.h> > #include <JavaScriptCore/IdentifierInlines.h> > #include <JavaScriptCore/JSValueRef.h> >+#include <wtf/URLParser.h> > > namespace WebCoreTestSupport { > using namespace JSC; >diff --git a/Source/WebCore/workers/AbstractWorker.h b/Source/WebCore/workers/AbstractWorker.h >index 900c2cb40462a0ebe37028a375a633feaf9534f1..0321c2c7fed256628ff26ced913aeb8afc30e034 100644 >--- a/Source/WebCore/workers/AbstractWorker.h >+++ b/Source/WebCore/workers/AbstractWorker.h >@@ -35,8 +35,6 @@ > > namespace WebCore { > >-class URL; >- > class AbstractWorker : public RefCounted<AbstractWorker>, public EventTargetWithInlineData { > public: > using RefCounted::ref; >diff --git a/Source/WebCore/workers/WorkerGlobalScope.h b/Source/WebCore/workers/WorkerGlobalScope.h >index 5b9a0be369c299c0fb7541078fc7656d6de79ec1..282dd06bc338a1e069a5bd46d863fc329d0ba41a 100644 >--- a/Source/WebCore/workers/WorkerGlobalScope.h >+++ b/Source/WebCore/workers/WorkerGlobalScope.h >@@ -32,7 +32,7 @@ > #include "ImageBitmap.h" > #include "ScriptExecutionContext.h" > #include "Supplementable.h" >-#include "URL.h" >+#include <wtf/URL.h> > #include "WorkerCacheStorageConnection.h" > #include "WorkerEventQueue.h" > #include "WorkerScriptController.h" >diff --git a/Source/WebCore/workers/WorkerGlobalScopeProxy.h b/Source/WebCore/workers/WorkerGlobalScopeProxy.h >index 36bd00707d0a68db3076272ba65f30a3a927f1e7..8585a5bff93b04665de5321ed32b92ffa976a171 100644 >--- a/Source/WebCore/workers/WorkerGlobalScopeProxy.h >+++ b/Source/WebCore/workers/WorkerGlobalScopeProxy.h >@@ -42,7 +42,6 @@ class SessionID; > namespace WebCore { > > class ContentSecurityPolicyResponseHeaders; >-class URL; > class Worker; > > // A proxy to talk to the worker context. >diff --git a/Source/WebCore/workers/WorkerInspectorProxy.h b/Source/WebCore/workers/WorkerInspectorProxy.h >index df4371ae23c30306ea7bf640d27f9e14b975e4b2..a1d3ea7576e7ea34a64cb91547de76acf518bde5 100644 >--- a/Source/WebCore/workers/WorkerInspectorProxy.h >+++ b/Source/WebCore/workers/WorkerInspectorProxy.h >@@ -25,7 +25,7 @@ > > #pragma once > >-#include "URL.h" >+#include <wtf/URL.h> > #include "WorkerThread.h" > #include <wtf/HashSet.h> > #include <wtf/text/WTFString.h> >diff --git a/Source/WebCore/workers/WorkerLocation.h b/Source/WebCore/workers/WorkerLocation.h >index 53c776156755b706b9d2493716a812527fca35f8..92cfcc7706f034e57b9f82e9ba27ba3a51a09f0d 100644 >--- a/Source/WebCore/workers/WorkerLocation.h >+++ b/Source/WebCore/workers/WorkerLocation.h >@@ -25,8 +25,8 @@ > > #pragma once > >-#include "URL.h" > #include <wtf/RefCounted.h> >+#include <wtf/URL.h> > #include <wtf/text/WTFString.h> > > namespace WebCore { >diff --git a/Source/WebCore/workers/WorkerScriptLoader.h b/Source/WebCore/workers/WorkerScriptLoader.h >index e57c323cde9e6f4f80af9b25b2cfe1ee2e7374d9..04a41c21cb2f7531fde619e4d67dd5644905f98d 100644 >--- a/Source/WebCore/workers/WorkerScriptLoader.h >+++ b/Source/WebCore/workers/WorkerScriptLoader.h >@@ -32,11 +32,11 @@ > #include "ResourceRequest.h" > #include "ThreadableLoader.h" > #include "ThreadableLoaderClient.h" >-#include "URL.h" > #include <memory> > #include <wtf/FastMalloc.h> > #include <wtf/RefCounted.h> > #include <wtf/RefPtr.h> >+#include <wtf/URL.h> > #include <wtf/text/StringBuilder.h> > > namespace WebCore { >diff --git a/Source/WebCore/workers/WorkerThread.cpp b/Source/WebCore/workers/WorkerThread.cpp >index f6063ac63abb060838d4cd049744445fca2a4487..9795543e1bfe588049f36c1f95712a1f02c36bc5 100644 >--- a/Source/WebCore/workers/WorkerThread.cpp >+++ b/Source/WebCore/workers/WorkerThread.cpp >@@ -33,7 +33,7 @@ > #include "SecurityOrigin.h" > #include "SocketProvider.h" > #include "ThreadGlobalData.h" >-#include "URL.h" >+#include <wtf/URL.h> > #include "WorkerGlobalScope.h" > #include "WorkerInspectorController.h" > #include <utility> >diff --git a/Source/WebCore/workers/WorkerThread.h b/Source/WebCore/workers/WorkerThread.h >index d71412485a969049adb4965974dbe91f5ee19189..3dc54f6c473db3767525d1ca4103d5d6a56c968d 100644 >--- a/Source/WebCore/workers/WorkerThread.h >+++ b/Source/WebCore/workers/WorkerThread.h >@@ -39,7 +39,6 @@ class SessionID; > namespace WebCore { > > class ContentSecurityPolicyResponseHeaders; >-class URL; > class NotificationClient; > class SecurityOrigin; > class SocketProvider; >diff --git a/Source/WebCore/workers/service/ServiceWorker.h b/Source/WebCore/workers/service/ServiceWorker.h >index 9b9bcc8a22f9d767129897ec01f37b2a5521b7ed..7b239f307da71e156d87ba2353b51b1a3335fff3 100644 >--- a/Source/WebCore/workers/service/ServiceWorker.h >+++ b/Source/WebCore/workers/service/ServiceWorker.h >@@ -31,9 +31,9 @@ > #include "ContextDestructionObserver.h" > #include "EventTarget.h" > #include "ServiceWorkerData.h" >-#include "URL.h" > #include <JavaScriptCore/Strong.h> > #include <wtf/RefCounted.h> >+#include <wtf/URL.h> > > namespace JSC { > class JSValue; >diff --git a/Source/WebCore/workers/service/ServiceWorkerClientData.h b/Source/WebCore/workers/service/ServiceWorkerClientData.h >index 143d7d9e045d54e11a8c6ed9ac14e37b156a0529..f991f32ce6d3a9b257a5612b46365a679ae2d17d 100644 >--- a/Source/WebCore/workers/service/ServiceWorkerClientData.h >+++ b/Source/WebCore/workers/service/ServiceWorkerClientData.h >@@ -30,7 +30,7 @@ > #include "ServiceWorkerClientIdentifier.h" > #include "ServiceWorkerClientType.h" > #include "ServiceWorkerTypes.h" >-#include "URL.h" >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/workers/service/ServiceWorkerContainer.cpp b/Source/WebCore/workers/service/ServiceWorkerContainer.cpp >index 3b3a96661da98b49b2aa4f6aa4dcfbd335981d0b..969bd20ad50d598766bb1c4ec8e180688251ea54 100644 >--- a/Source/WebCore/workers/service/ServiceWorkerContainer.cpp >+++ b/Source/WebCore/workers/service/ServiceWorkerContainer.cpp >@@ -48,9 +48,9 @@ > #include "ServiceWorkerJobData.h" > #include "ServiceWorkerProvider.h" > #include "ServiceWorkerThread.h" >-#include "URL.h" > #include <wtf/RunLoop.h> > #include <wtf/Scope.h> >+#include <wtf/URL.h> > > #define CONTAINER_RELEASE_LOG_IF_ALLOWED(fmt, ...) RELEASE_LOG_IF(isAlwaysOnLoggingAllowed(), ServiceWorker, "%p - ServiceWorkerContainer::" fmt, this, ##__VA_ARGS__) > #define CONTAINER_RELEASE_LOG_ERROR_IF_ALLOWED(fmt, ...) RELEASE_LOG_ERROR_IF(isAlwaysOnLoggingAllowed(), ServiceWorker, "%p - ServiceWorkerContainer::" fmt, this, ##__VA_ARGS__) >diff --git a/Source/WebCore/workers/service/ServiceWorkerContextData.h b/Source/WebCore/workers/service/ServiceWorkerContextData.h >index 3be950425ea780cffd5bbee785fa4532af94a3d7..4d620889f934a7efa260b3209b4e176b02ab0d20 100644 >--- a/Source/WebCore/workers/service/ServiceWorkerContextData.h >+++ b/Source/WebCore/workers/service/ServiceWorkerContextData.h >@@ -29,11 +29,11 @@ > #include "ServiceWorkerIdentifier.h" > #include "ServiceWorkerJobDataIdentifier.h" > #include "ServiceWorkerRegistrationData.h" >-#include "URL.h" >-#include "URLHash.h" > #include "WorkerType.h" > #include <pal/SessionID.h> > #include <wtf/HashMap.h> >+#include <wtf/URL.h> >+#include <wtf/URLHash.h> > > #if ENABLE(SERVICE_WORKER) > >diff --git a/Source/WebCore/workers/service/ServiceWorkerData.h b/Source/WebCore/workers/service/ServiceWorkerData.h >index 728c37cfe62a5fe560ab6c4eb1864f0444cf936e..ce361d3f3d0f3873a86dc8a938baf03f1d164a58 100644 >--- a/Source/WebCore/workers/service/ServiceWorkerData.h >+++ b/Source/WebCore/workers/service/ServiceWorkerData.h >@@ -29,7 +29,7 @@ > > #include "ServiceWorkerIdentifier.h" > #include "ServiceWorkerTypes.h" >-#include "URL.h" >+#include <wtf/URL.h> > #include "WorkerType.h" > > namespace WebCore { >diff --git a/Source/WebCore/workers/service/ServiceWorkerJobData.h b/Source/WebCore/workers/service/ServiceWorkerJobData.h >index 0870bb6ef6029845cd4a9b6de2300a883caa1c22..93c2df6ff0d2f398e841268be19664f7a9ce64fc 100644 >--- a/Source/WebCore/workers/service/ServiceWorkerJobData.h >+++ b/Source/WebCore/workers/service/ServiceWorkerJobData.h >@@ -34,7 +34,7 @@ > #include "ServiceWorkerRegistrationKey.h" > #include "ServiceWorkerRegistrationOptions.h" > #include "ServiceWorkerTypes.h" >-#include "URL.h" >+#include <wtf/URL.h> > > namespace WebCore { > >diff --git a/Source/WebCore/workers/service/ServiceWorkerRegistrationKey.cpp b/Source/WebCore/workers/service/ServiceWorkerRegistrationKey.cpp >index 385a7047fa87999f64346702cca048b7799ee833..bc297da66f53f4b7b851870456ffbcab3da0b6b2 100644 >--- a/Source/WebCore/workers/service/ServiceWorkerRegistrationKey.cpp >+++ b/Source/WebCore/workers/service/ServiceWorkerRegistrationKey.cpp >@@ -29,7 +29,7 @@ > #if ENABLE(SERVICE_WORKER) > > #include "SecurityOrigin.h" >-#include "URLHash.h" >+#include <wtf/URLHash.h> > > namespace WebCore { > >diff --git a/Source/WebCore/workers/service/ServiceWorkerRegistrationKey.h b/Source/WebCore/workers/service/ServiceWorkerRegistrationKey.h >index c7cb6d5600e9369486139c38b821f049143199b5..eb9d7fa0148dae4108104b9fbcf49d7d95228c48 100644 >--- a/Source/WebCore/workers/service/ServiceWorkerRegistrationKey.h >+++ b/Source/WebCore/workers/service/ServiceWorkerRegistrationKey.h >@@ -28,7 +28,7 @@ > #if ENABLE(SERVICE_WORKER) > > #include "SecurityOriginData.h" >-#include "URL.h" >+#include <wtf/URL.h> > > namespace WebCore { > >@@ -102,7 +102,7 @@ struct ServiceWorkerRegistrationKeyHash { > template<> struct HashTraits<WebCore::ServiceWorkerRegistrationKey> : GenericHashTraits<WebCore::ServiceWorkerRegistrationKey> { > static WebCore::ServiceWorkerRegistrationKey emptyValue() { return WebCore::ServiceWorkerRegistrationKey::emptyKey(); } > >- static void constructDeletedValue(WebCore::ServiceWorkerRegistrationKey& slot) { slot.setScope(WebCore::URL(HashTableDeletedValue)); } >+ static void constructDeletedValue(WebCore::ServiceWorkerRegistrationKey& slot) { slot.setScope(URL(HashTableDeletedValue)); } > static bool isDeletedValue(const WebCore::ServiceWorkerRegistrationKey& slot) { return slot.scope().isHashTableDeletedValue(); } > }; > >diff --git a/Source/WebCore/worklets/WorkletGlobalScope.h b/Source/WebCore/worklets/WorkletGlobalScope.h >index ccec0dcefb8619bd2552b83f8e9e69b449bf8aba..27f154e1fa6c9c1da57925647c18d4f5bc39bff1 100644 >--- a/Source/WebCore/worklets/WorkletGlobalScope.h >+++ b/Source/WebCore/worklets/WorkletGlobalScope.h >@@ -32,12 +32,12 @@ > #include "ExceptionOr.h" > #include "ScriptExecutionContext.h" > #include "ScriptSourceCode.h" >-#include "URL.h" > #include "WorkerEventQueue.h" > > #include <JavaScriptCore/ConsoleMessage.h> > #include <JavaScriptCore/RuntimeFlags.h> > #include <pal/SessionID.h> >+#include <wtf/URL.h> > #include <wtf/ObjectIdentifier.h> > #include <wtf/WeakPtr.h> > >diff --git a/Source/WebCore/xml/XMLHttpRequest.h b/Source/WebCore/xml/XMLHttpRequest.h >index aead1bc08d9d46c12cd356846d9711107500a48a..b489db39fe7ae7ceb17e24de7c7a52a9f0396f93 100644 >--- a/Source/WebCore/xml/XMLHttpRequest.h >+++ b/Source/WebCore/xml/XMLHttpRequest.h >@@ -26,7 +26,7 @@ > #include "FormData.h" > #include "ResourceResponse.h" > #include "ThreadableLoaderClient.h" >-#include "URL.h" >+#include <wtf/URL.h> > #include "XMLHttpRequestEventTarget.h" > #include "XMLHttpRequestProgressEventThrottle.h" > #include <wtf/Variant.h> >diff --git a/Source/WebKit/NetworkProcess/Cookies/WebCookieManager.cpp b/Source/WebKit/NetworkProcess/Cookies/WebCookieManager.cpp >index acd65e9c80a067f272a58e1d9735c11fe6512a94..1fb415e2d2d08653efca271be9c8f0eae454ff35 100644 >--- a/Source/WebKit/NetworkProcess/Cookies/WebCookieManager.cpp >+++ b/Source/WebKit/NetworkProcess/Cookies/WebCookieManager.cpp >@@ -33,8 +33,8 @@ > #include <WebCore/Cookie.h> > #include <WebCore/CookieStorage.h> > #include <WebCore/NetworkStorageSession.h> >-#include <WebCore/URL.h> > #include <wtf/MainThread.h> >+#include <wtf/URL.h> > #include <wtf/text/StringHash.h> > #include <wtf/text/WTFString.h> > >diff --git a/Source/WebKit/NetworkProcess/Cookies/WebCookieManager.h b/Source/WebKit/NetworkProcess/Cookies/WebCookieManager.h >index de22c79f8e8d0e2b81724f65111a9f10a5d20369..3210e3299e6fcb832fc39c8ed6ca8e6678bc6bc3 100644 >--- a/Source/WebKit/NetworkProcess/Cookies/WebCookieManager.h >+++ b/Source/WebKit/NetworkProcess/Cookies/WebCookieManager.h >@@ -40,7 +40,6 @@ > #endif > > namespace WebCore { >-class URL; > struct Cookie; > } > >@@ -78,9 +77,9 @@ private: > void deleteAllCookiesModifiedSince(PAL::SessionID, WallTime, CallbackID); > > void setCookie(PAL::SessionID, const WebCore::Cookie&, CallbackID); >- void setCookies(PAL::SessionID, const Vector<WebCore::Cookie>&, const WebCore::URL&, const WebCore::URL& mainDocumentURL, CallbackID); >+ void setCookies(PAL::SessionID, const Vector<WebCore::Cookie>&, const URL&, const URL& mainDocumentURL, CallbackID); > void getAllCookies(PAL::SessionID, CallbackID); >- void getCookies(PAL::SessionID, const WebCore::URL&, CallbackID); >+ void getCookies(PAL::SessionID, const URL&, CallbackID); > > void platformSetHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy); > void getHTTPCookieAcceptPolicy(CallbackID); >diff --git a/Source/WebKit/NetworkProcess/Cookies/WebCookieManager.messages.in b/Source/WebKit/NetworkProcess/Cookies/WebCookieManager.messages.in >index e3de9d8cfab9fd5f6fb68a2c0710262a855dc448..0b1fd559e0beb26e00379434adae4e5c9e47daaf 100644 >--- a/Source/WebKit/NetworkProcess/Cookies/WebCookieManager.messages.in >+++ b/Source/WebKit/NetworkProcess/Cookies/WebCookieManager.messages.in >@@ -29,9 +29,9 @@ > void DeleteAllCookies(PAL::SessionID sessionID) > > void SetCookie(PAL::SessionID sessionID, struct WebCore::Cookie cookie, WebKit::CallbackID callbackID) >- void SetCookies(PAL::SessionID sessionID, Vector<WebCore::Cookie> cookies, WebCore::URL url, WebCore::URL mainDocumentURL, WebKit::CallbackID callbackID) >+ void SetCookies(PAL::SessionID sessionID, Vector<WebCore::Cookie> cookies, URL url, URL mainDocumentURL, WebKit::CallbackID callbackID) > void GetAllCookies(PAL::SessionID sessionID, WebKit::CallbackID callbackID) >- void GetCookies(PAL::SessionID sessionID, WebCore::URL url, WebKit::CallbackID callbackID) >+ void GetCookies(PAL::SessionID sessionID, URL url, WebKit::CallbackID callbackID) > void DeleteCookie(PAL::SessionID sessionID, struct WebCore::Cookie cookie, WebKit::CallbackID callbackID) > void DeleteAllCookiesModifiedSince(PAL::SessionID sessionID, WallTime time, WebKit::CallbackID callbackID) > >diff --git a/Source/WebKit/NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm b/Source/WebKit/NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm >index c2b147c5f721b9540745b648d20bbcb728471abe..6e9028db5c997bd2a31fee18a33c124b7ff1429a 100644 >--- a/Source/WebKit/NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm >+++ b/Source/WebKit/NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm >@@ -34,8 +34,8 @@ > #import <WebCore/ResourceRequest.h> > #import <WebCore/ResourceResponse.h> > #import <WebCore/TextEncoding.h> >-#import <WebCore/URL.h> > #import <pal/spi/cocoa/NSURLConnectionSPI.h> >+#import <wtf/URL.h> > > using namespace WebKit; > >diff --git a/Source/WebKit/NetworkProcess/Downloads/Download.h b/Source/WebKit/NetworkProcess/Downloads/Download.h >index bdbc8e152605aee74715fc36f4180c370d555b8e..d8fbdd1d39d2e9ac581af70d2ba5dfab1236f288 100644 >--- a/Source/WebKit/NetworkProcess/Downloads/Download.h >+++ b/Source/WebKit/NetworkProcess/Downloads/Download.h >@@ -75,7 +75,7 @@ public: > void resume(const IPC::DataReference& resumeData, const String& path, SandboxExtension::Handle&&); > void cancel(); > #if PLATFORM(COCOA) >- void publishProgress(const WebCore::URL&, SandboxExtension::Handle&&); >+ void publishProgress(const URL&, SandboxExtension::Handle&&); > #endif > > DownloadID downloadID() const { return m_downloadID; } >diff --git a/Source/WebKit/NetworkProcess/Downloads/DownloadManager.cpp b/Source/WebKit/NetworkProcess/Downloads/DownloadManager.cpp >index 7d3a1d79f6f73ef96ec9b97a969f92ebe4dd8c06..72cd7e1fe71223d891d5193b7cae8d9ff62618cb 100644 >--- a/Source/WebKit/NetworkProcess/Downloads/DownloadManager.cpp >+++ b/Source/WebKit/NetworkProcess/Downloads/DownloadManager.cpp >@@ -160,7 +160,7 @@ void DownloadManager::cancelDownload(DownloadID downloadID) > } > > #if PLATFORM(COCOA) >-void DownloadManager::publishDownloadProgress(DownloadID downloadID, const WebCore::URL& url, SandboxExtension::Handle&& sandboxExtensionHandle) >+void DownloadManager::publishDownloadProgress(DownloadID downloadID, const URL& url, SandboxExtension::Handle&& sandboxExtensionHandle) > { > if (auto* download = m_downloads.get(downloadID)) > download->publishProgress(url, WTFMove(sandboxExtensionHandle)); >diff --git a/Source/WebKit/NetworkProcess/Downloads/DownloadManager.h b/Source/WebKit/NetworkProcess/Downloads/DownloadManager.h >index 8078410da33880df0beac62c7eb5022351026841..fbad888e079ceab6fa4026993a4ce384494ed414 100644 >--- a/Source/WebKit/NetworkProcess/Downloads/DownloadManager.h >+++ b/Source/WebKit/NetworkProcess/Downloads/DownloadManager.h >@@ -86,7 +86,7 @@ public: > > void cancelDownload(DownloadID); > #if PLATFORM(COCOA) >- void publishDownloadProgress(DownloadID, const WebCore::URL&, SandboxExtension::Handle&&); >+ void publishDownloadProgress(DownloadID, const URL&, SandboxExtension::Handle&&); > #endif > > Download* download(DownloadID downloadID) { return m_downloads.get(downloadID); } >diff --git a/Source/WebKit/NetworkProcess/Downloads/PendingDownload.cpp b/Source/WebKit/NetworkProcess/Downloads/PendingDownload.cpp >index aec4da2234c821d8877bc27fa7885de3a3477579..a0f8e6bfabe237b422ae517c02046e6ab432f223 100644 >--- a/Source/WebKit/NetworkProcess/Downloads/PendingDownload.cpp >+++ b/Source/WebKit/NetworkProcess/Downloads/PendingDownload.cpp >@@ -76,7 +76,7 @@ void PendingDownload::cancel() > } > > #if PLATFORM(COCOA) >-void PendingDownload::publishProgress(const WebCore::URL& url, SandboxExtension::Handle&& sandboxExtension) >+void PendingDownload::publishProgress(const URL& url, SandboxExtension::Handle&& sandboxExtension) > { > ASSERT(!m_progressURL.isValid()); > m_progressURL = url; >diff --git a/Source/WebKit/NetworkProcess/Downloads/PendingDownload.h b/Source/WebKit/NetworkProcess/Downloads/PendingDownload.h >index 9442edbc418bfe5b6037b93d716848fc10d24fdb..59d2d02c7e8ef3ef7a03e2edc27ec82ebc8a6425 100644 >--- a/Source/WebKit/NetworkProcess/Downloads/PendingDownload.h >+++ b/Source/WebKit/NetworkProcess/Downloads/PendingDownload.h >@@ -50,7 +50,7 @@ public: > void cancel(); > > #if PLATFORM(COCOA) >- void publishProgress(const WebCore::URL&, SandboxExtension::Handle&&); >+ void publishProgress(const URL&, SandboxExtension::Handle&&); > void didBecomeDownload(const std::unique_ptr<Download>&); > #endif > >@@ -74,7 +74,7 @@ private: > bool m_isAllowedToAskUserForCredentials; > > #if PLATFORM(COCOA) >- WebCore::URL m_progressURL; >+ URL m_progressURL; > SandboxExtension::Handle m_progressSandboxExtension; > #endif > }; >diff --git a/Source/WebKit/NetworkProcess/Downloads/cocoa/DownloadCocoa.mm b/Source/WebKit/NetworkProcess/Downloads/cocoa/DownloadCocoa.mm >index 25171041b24c9853e1dea754ab1ba2f26abddc43..d30e4792ea2e9f4a3698f97e187e7796fd244a82 100644 >--- a/Source/WebKit/NetworkProcess/Downloads/cocoa/DownloadCocoa.mm >+++ b/Source/WebKit/NetworkProcess/Downloads/cocoa/DownloadCocoa.mm >@@ -99,7 +99,7 @@ void Download::platformDestroyDownload() > #endif > } > >-void Download::publishProgress(const WebCore::URL& url, SandboxExtension::Handle&& sandboxExtensionHandle) >+void Download::publishProgress(const URL& url, SandboxExtension::Handle&& sandboxExtensionHandle) > { > #if WK_API_ENABLED > ASSERT(!m_progress); >diff --git a/Source/WebKit/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp b/Source/WebKit/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp >index aee39f00efba3314eb6fe946f10dff3c5055857e..f2cb467dc84e07c415889b198e7f6d774d26b95d 100644 >--- a/Source/WebKit/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp >+++ b/Source/WebKit/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp >@@ -70,7 +70,7 @@ void NetworkBlobRegistry::registerBlobURL(NetworkConnectionToWebProcess* connect > mapIterator->value.add(url); > } > >-void NetworkBlobRegistry::registerBlobURL(NetworkConnectionToWebProcess* connection, const WebCore::URL& url, const WebCore::URL& srcURL, bool shouldBypassConnectionCheck) >+void NetworkBlobRegistry::registerBlobURL(NetworkConnectionToWebProcess* connection, const URL& url, const URL& srcURL, bool shouldBypassConnectionCheck) > { > // The connection may not be registered if NetworkProcess prevously crashed for any reason. > BlobForConnectionMap::iterator mapIterator = m_blobsForConnection.find(connection); >@@ -97,7 +97,7 @@ void NetworkBlobRegistry::registerBlobURLOptionallyFileBacked(NetworkConnectionT > mapIterator->value.add(url); > } > >-void NetworkBlobRegistry::registerBlobURLForSlice(NetworkConnectionToWebProcess* connection, const WebCore::URL& url, const WebCore::URL& srcURL, int64_t start, int64_t end) >+void NetworkBlobRegistry::registerBlobURLForSlice(NetworkConnectionToWebProcess* connection, const URL& url, const URL& srcURL, int64_t start, int64_t end) > { > // The connection may not be registered if NetworkProcess prevously crashed for any reason. > BlobForConnectionMap::iterator mapIterator = m_blobsForConnection.find(connection); >@@ -110,7 +110,7 @@ void NetworkBlobRegistry::registerBlobURLForSlice(NetworkConnectionToWebProcess* > mapIterator->value.add(url); > } > >-void NetworkBlobRegistry::unregisterBlobURL(NetworkConnectionToWebProcess* connection, const WebCore::URL& url) >+void NetworkBlobRegistry::unregisterBlobURL(NetworkConnectionToWebProcess* connection, const URL& url) > { > // The connection may not be registered if NetworkProcess prevously crashed for any reason. > BlobForConnectionMap::iterator mapIterator = m_blobsForConnection.find(connection); >@@ -122,7 +122,7 @@ void NetworkBlobRegistry::unregisterBlobURL(NetworkConnectionToWebProcess* conne > mapIterator->value.remove(url); > } > >-uint64_t NetworkBlobRegistry::blobSize(NetworkConnectionToWebProcess* connection, const WebCore::URL& url) >+uint64_t NetworkBlobRegistry::blobSize(NetworkConnectionToWebProcess* connection, const URL& url) > { > if (!m_blobsForConnection.contains(connection) || !m_blobsForConnection.find(connection)->value.contains(url)) > return 0; >@@ -166,7 +166,7 @@ void NetworkBlobRegistry::connectionToWebProcessDidClose(NetworkConnectionToWebP > m_blobsForConnection.remove(connection); > } > >-Vector<RefPtr<BlobDataFileReference>> NetworkBlobRegistry::filesInBlob(NetworkConnectionToWebProcess& connection, const WebCore::URL& url) >+Vector<RefPtr<BlobDataFileReference>> NetworkBlobRegistry::filesInBlob(NetworkConnectionToWebProcess& connection, const URL& url) > { > if (!m_blobsForConnection.contains(&connection) || !m_blobsForConnection.find(&connection)->value.contains(url)) > return { }; >diff --git a/Source/WebKit/NetworkProcess/FileAPI/NetworkBlobRegistry.h b/Source/WebKit/NetworkProcess/FileAPI/NetworkBlobRegistry.h >index 8bdae221d1e20dd867494c3f538b1a83da0bad38..60625fa1801cc44ae3d44058d56f1179ca1cc24a 100644 >--- a/Source/WebKit/NetworkProcess/FileAPI/NetworkBlobRegistry.h >+++ b/Source/WebKit/NetworkProcess/FileAPI/NetworkBlobRegistry.h >@@ -25,10 +25,10 @@ > > #pragma once > >-#include <WebCore/URLHash.h> > #include <wtf/Function.h> > #include <wtf/HashMap.h> > #include <wtf/HashSet.h> >+#include <wtf/URLHash.h> > > namespace WebCore { > class BlobDataFileReference; >@@ -46,25 +46,25 @@ public: > NetworkBlobRegistry(); > static NetworkBlobRegistry& singleton(); > >- void registerFileBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&, const String& path, RefPtr<SandboxExtension>&&, const String& contentType); >- void registerBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&, Vector<WebCore::BlobPart>&&, const String& contentType); >- void registerBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&, const WebCore::URL& srcURL, bool shouldBypassConnectionCheck); >- void registerBlobURLOptionallyFileBacked(NetworkConnectionToWebProcess*, const WebCore::URL&, const WebCore::URL& srcURL, const String& fileBackedPath, const String& contentType); >- void registerBlobURLForSlice(NetworkConnectionToWebProcess*, const WebCore::URL&, const WebCore::URL& srcURL, int64_t start, int64_t end); >- void unregisterBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&); >- uint64_t blobSize(NetworkConnectionToWebProcess*, const WebCore::URL&); >+ void registerFileBlobURL(NetworkConnectionToWebProcess*, const URL&, const String& path, RefPtr<SandboxExtension>&&, const String& contentType); >+ void registerBlobURL(NetworkConnectionToWebProcess*, const URL&, Vector<WebCore::BlobPart>&&, const String& contentType); >+ void registerBlobURL(NetworkConnectionToWebProcess*, const URL&, const URL& srcURL, bool shouldBypassConnectionCheck); >+ void registerBlobURLOptionallyFileBacked(NetworkConnectionToWebProcess*, const URL&, const URL& srcURL, const String& fileBackedPath, const String& contentType); >+ void registerBlobURLForSlice(NetworkConnectionToWebProcess*, const URL&, const URL& srcURL, int64_t start, int64_t end); >+ void unregisterBlobURL(NetworkConnectionToWebProcess*, const URL&); >+ uint64_t blobSize(NetworkConnectionToWebProcess*, const URL&); > void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&&)>&&); >- void writeBlobToFilePath(const WebCore::URL& blobURL, const String& path, CompletionHandler<void(bool success)>&&); >+ void writeBlobToFilePath(const URL& blobURL, const String& path, CompletionHandler<void(bool success)>&&); > > void connectionToWebProcessDidClose(NetworkConnectionToWebProcess*); > >- Vector<RefPtr<WebCore::BlobDataFileReference>> filesInBlob(NetworkConnectionToWebProcess&, const WebCore::URL&); >- Vector<RefPtr<WebCore::BlobDataFileReference>> filesInBlob(const WebCore::URL&); >+ Vector<RefPtr<WebCore::BlobDataFileReference>> filesInBlob(NetworkConnectionToWebProcess&, const URL&); >+ Vector<RefPtr<WebCore::BlobDataFileReference>> filesInBlob(const URL&); > > private: > ~NetworkBlobRegistry(); > >- typedef HashMap<NetworkConnectionToWebProcess*, HashSet<WebCore::URL>> BlobForConnectionMap; >+ typedef HashMap<NetworkConnectionToWebProcess*, HashSet<URL>> BlobForConnectionMap; > BlobForConnectionMap m_blobsForConnection; > }; > >diff --git a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h >index bec96685e1fa8a3c9c0d0276f719dec0c69582e0..dfe400dfed26d36c9cdf98f22ca3e9c512414c5a 100644 >--- a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h >+++ b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h >@@ -150,31 +150,31 @@ private: > void removeLoadIdentifier(ResourceLoadIdentifier); > void pageLoadCompleted(uint64_t webPageID); > void setDefersLoading(ResourceLoadIdentifier, bool); >- void crossOriginRedirectReceived(ResourceLoadIdentifier, const WebCore::URL& redirectURL); >+ void crossOriginRedirectReceived(ResourceLoadIdentifier, const URL& redirectURL); > void startDownload(PAL::SessionID, DownloadID, const WebCore::ResourceRequest&, const String& suggestedName = { }); > void convertMainResourceLoadToDownload(PAL::SessionID, uint64_t mainResourceLoadIdentifier, DownloadID, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&); > >- void cookiesForDOM(PAL::SessionID, const WebCore::URL& firstParty, const WebCore::SameSiteInfo&, const WebCore::URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, WebCore::IncludeSecureCookies, String& cookieString, bool& secureCookiesAccessed); >- void setCookiesFromDOM(PAL::SessionID, const WebCore::URL& firstParty, const WebCore::SameSiteInfo&, const WebCore::URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, const String&); >+ void cookiesForDOM(PAL::SessionID, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, WebCore::IncludeSecureCookies, String& cookieString, bool& secureCookiesAccessed); >+ void setCookiesFromDOM(PAL::SessionID, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, const String&); > void cookiesEnabled(PAL::SessionID, bool& result); >- void cookieRequestHeaderFieldValue(PAL::SessionID, const WebCore::URL& firstParty, const WebCore::SameSiteInfo&, const WebCore::URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, WebCore::IncludeSecureCookies, String& cookieString, bool& secureCookiesAccessed); >- void getRawCookies(PAL::SessionID, const WebCore::URL& firstParty, const WebCore::SameSiteInfo&, const WebCore::URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, Vector<WebCore::Cookie>&); >- void deleteCookie(PAL::SessionID, const WebCore::URL&, const String& cookieName); >- >- void registerFileBlobURL(const WebCore::URL&, const String& path, SandboxExtension::Handle&&, const String& contentType); >- void registerBlobURL(const WebCore::URL&, Vector<WebCore::BlobPart>&&, const String& contentType); >- void registerBlobURLFromURL(const WebCore::URL&, const WebCore::URL& srcURL, bool shouldBypassConnectionCheck); >- void registerBlobURLOptionallyFileBacked(const WebCore::URL&, const WebCore::URL& srcURL, const String& fileBackedPath, const String& contentType); >- void registerBlobURLForSlice(const WebCore::URL&, const WebCore::URL& srcURL, int64_t start, int64_t end); >- void blobSize(const WebCore::URL&, uint64_t& resultSize); >- void unregisterBlobURL(const WebCore::URL&); >+ void cookieRequestHeaderFieldValue(PAL::SessionID, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, WebCore::IncludeSecureCookies, String& cookieString, bool& secureCookiesAccessed); >+ void getRawCookies(PAL::SessionID, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, Vector<WebCore::Cookie>&); >+ void deleteCookie(PAL::SessionID, const URL&, const String& cookieName); >+ >+ void registerFileBlobURL(const URL&, const String& path, SandboxExtension::Handle&&, const String& contentType); >+ void registerBlobURL(const URL&, Vector<WebCore::BlobPart>&&, const String& contentType); >+ void registerBlobURLFromURL(const URL&, const URL& srcURL, bool shouldBypassConnectionCheck); >+ void registerBlobURLOptionallyFileBacked(const URL&, const URL& srcURL, const String& fileBackedPath, const String& contentType); >+ void registerBlobURLForSlice(const URL&, const URL& srcURL, int64_t start, int64_t end); >+ void blobSize(const URL&, uint64_t& resultSize); >+ void unregisterBlobURL(const URL&); > void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&&)>&&); > > void storeDerivedDataToCache(const WebKit::NetworkCache::DataKey&, const IPC::DataReference&); > > void setCaptureExtraNetworkLoadMetricsEnabled(bool); > >- void createSocketStream(WebCore::URL&&, PAL::SessionID, String cachePartition, uint64_t); >+ void createSocketStream(URL&&, PAL::SessionID, String cachePartition, uint64_t); > void destroySocketStream(uint64_t); > > void ensureLegacyPrivateBrowsingSession(); >diff --git a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in >index 45b007426a7a52f7c3624df4beaf3ab43bb53dc1..9594ef2375763ba08e3f233c61eb2b69d5269b50 100644 >--- a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in >+++ b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in >@@ -34,27 +34,27 @@ messages -> NetworkConnectionToWebProcess LegacyReceiver { > StartDownload(PAL::SessionID sessionID, WebKit::DownloadID downloadID, WebCore::ResourceRequest request, String suggestedName) > ConvertMainResourceLoadToDownload(PAL::SessionID sessionID, uint64_t mainResourceLoadIdentifier, WebKit::DownloadID downloadID, WebCore::ResourceRequest request, WebCore::ResourceResponse response) > >- CookiesForDOM(PAL::SessionID sessionID, WebCore::URL firstParty, struct WebCore::SameSiteInfo sameSiteInfo, WebCore::URL url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, enum:bool WebCore::IncludeSecureCookies includeSecureCookies) -> (String cookieString, bool didAccessSecureCookies) LegacySync >- SetCookiesFromDOM(PAL::SessionID sessionID, WebCore::URL firstParty, struct WebCore::SameSiteInfo sameSiteInfo, WebCore::URL url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, String cookieString) >+ CookiesForDOM(PAL::SessionID sessionID, URL firstParty, struct WebCore::SameSiteInfo sameSiteInfo, URL url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, enum:bool WebCore::IncludeSecureCookies includeSecureCookies) -> (String cookieString, bool didAccessSecureCookies) LegacySync >+ SetCookiesFromDOM(PAL::SessionID sessionID, URL firstParty, struct WebCore::SameSiteInfo sameSiteInfo, URL url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, String cookieString) > CookiesEnabled(PAL::SessionID sessionID) -> (bool enabled) LegacySync >- CookieRequestHeaderFieldValue(PAL::SessionID sessionID, WebCore::URL firstParty, struct WebCore::SameSiteInfo sameSiteInfo, WebCore::URL url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, enum:bool WebCore::IncludeSecureCookies includeSecureCookies) -> (String cookieString, bool didAccessSecureCookies) LegacySync >- GetRawCookies(PAL::SessionID sessionID, WebCore::URL firstParty, struct WebCore::SameSiteInfo sameSiteInfo, WebCore::URL url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID) -> (Vector<WebCore::Cookie> cookies) LegacySync >- DeleteCookie(PAL::SessionID sessionID, WebCore::URL url, String cookieName) >+ CookieRequestHeaderFieldValue(PAL::SessionID sessionID, URL firstParty, struct WebCore::SameSiteInfo sameSiteInfo, URL url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, enum:bool WebCore::IncludeSecureCookies includeSecureCookies) -> (String cookieString, bool didAccessSecureCookies) LegacySync >+ GetRawCookies(PAL::SessionID sessionID, URL firstParty, struct WebCore::SameSiteInfo sameSiteInfo, URL url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID) -> (Vector<WebCore::Cookie> cookies) LegacySync >+ DeleteCookie(PAL::SessionID sessionID, URL url, String cookieName) > >- RegisterFileBlobURL(WebCore::URL url, String path, WebKit::SandboxExtension::Handle extensionHandle, String contentType) >- RegisterBlobURL(WebCore::URL url, Vector<WebCore::BlobPart> blobParts, String contentType) >- RegisterBlobURLFromURL(WebCore::URL url, WebCore::URL srcURL, bool shouldBypassConnectionCheck) >- RegisterBlobURLOptionallyFileBacked(WebCore::URL url, WebCore::URL srcURL, String fileBackedPath, String contentType) >- RegisterBlobURLForSlice(WebCore::URL url, WebCore::URL srcURL, int64_t start, int64_t end) >- UnregisterBlobURL(WebCore::URL url) >- BlobSize(WebCore::URL url) -> (uint64_t resultSize) LegacySync >+ RegisterFileBlobURL(URL url, String path, WebKit::SandboxExtension::Handle extensionHandle, String contentType) >+ RegisterBlobURL(URL url, Vector<WebCore::BlobPart> blobParts, String contentType) >+ RegisterBlobURLFromURL(URL url, URL srcURL, bool shouldBypassConnectionCheck) >+ RegisterBlobURLOptionallyFileBacked(URL url, URL srcURL, String fileBackedPath, String contentType) >+ RegisterBlobURLForSlice(URL url, URL srcURL, int64_t start, int64_t end) >+ UnregisterBlobURL(URL url) >+ BlobSize(URL url) -> (uint64_t resultSize) LegacySync > WriteBlobsToTemporaryFiles(Vector<String> blobURLs) -> (Vector<String> fileNames) Async > > StoreDerivedDataToCache(WebKit::NetworkCache::DataKey key, IPC::SharedBufferDataReference data) > > SetCaptureExtraNetworkLoadMetricsEnabled(bool enabled) > >- CreateSocketStream(WebCore::URL url, PAL::SessionID sessionID, String cachePartition, uint64_t identifier) >+ CreateSocketStream(URL url, PAL::SessionID sessionID, String cachePartition, uint64_t identifier) > > EnsureLegacyPrivateBrowsingSession() > >diff --git a/Source/WebKit/NetworkProcess/NetworkDataTask.cpp b/Source/WebKit/NetworkProcess/NetworkDataTask.cpp >index cf4e64d503f1a9ee0bdc5e0d528c47f29429a641..059a130143ba5f3a7e0d1eb1b1466fa91fa0b993 100644 >--- a/Source/WebKit/NetworkProcess/NetworkDataTask.cpp >+++ b/Source/WebKit/NetworkProcess/NetworkDataTask.cpp >@@ -106,7 +106,7 @@ void NetworkDataTask::didReceiveResponse(ResourceResponse&& response, ResponseCo > if (response.isHTTP09()) { > auto url = response.url(); > std::optional<uint16_t> port = url.port(); >- if (port && !isDefaultPortForProtocol(port.value(), url.protocol())) { >+ if (port && !WTF::isDefaultPortForProtocol(port.value(), url.protocol())) { > completionHandler(PolicyAction::Ignore); > cancel(); > m_client->didCompleteWithError({ String(), 0, url, "Cancelled load from '" + url.stringCenterEllipsizedToLength() + "' because it is using HTTP/0.9." }); >diff --git a/Source/WebKit/NetworkProcess/NetworkDataTaskBlob.cpp b/Source/WebKit/NetworkProcess/NetworkDataTaskBlob.cpp >index 65eabb2bf3b59d2fd47aa41265dff69948b380db..d73a6ea6ff12c304bfa74bab95be6aeee66b8990 100644 >--- a/Source/WebKit/NetworkProcess/NetworkDataTaskBlob.cpp >+++ b/Source/WebKit/NetworkProcess/NetworkDataTaskBlob.cpp >@@ -48,9 +48,9 @@ > #include <WebCore/ResourceError.h> > #include <WebCore/ResourceResponse.h> > #include <WebCore/SharedBuffer.h> >-#include <WebCore/URL.h> > #include <wtf/MainThread.h> > #include <wtf/RunLoop.h> >+#include <wtf/URL.h> > > namespace WebKit { > using namespace WebCore; >diff --git a/Source/WebKit/NetworkProcess/NetworkLoadChecker.h b/Source/WebKit/NetworkProcess/NetworkLoadChecker.h >index 9ebac8f5395f42f3ae781b7f504a628e51f7ab8e..6bde17ccd65b1caf3bda6934a28c9773c0927b06 100644 >--- a/Source/WebKit/NetworkProcess/NetworkLoadChecker.h >+++ b/Source/WebKit/NetworkProcess/NetworkLoadChecker.h >@@ -47,7 +47,7 @@ class NetworkCORSPreflightChecker; > > class NetworkLoadChecker : public CanMakeWeakPtr<NetworkLoadChecker> { > public: >- NetworkLoadChecker(WebCore::FetchOptions&&, PAL::SessionID, uint64_t pageID, uint64_t frameID, WebCore::HTTPHeaderMap&&, WebCore::URL&&, RefPtr<WebCore::SecurityOrigin>&&, WebCore::PreflightPolicy, String&& referrer, bool shouldCaptureExtraNetworkLoadMetrics = false); >+ NetworkLoadChecker(WebCore::FetchOptions&&, PAL::SessionID, uint64_t pageID, uint64_t frameID, WebCore::HTTPHeaderMap&&, URL&&, RefPtr<WebCore::SecurityOrigin>&&, WebCore::PreflightPolicy, String&& referrer, bool shouldCaptureExtraNetworkLoadMetrics = false); > ~NetworkLoadChecker(); > > using RequestOrError = Expected<WebCore::ResourceRequest, WebCore::ResourceError>; >@@ -69,14 +69,14 @@ public: > > void setCSPResponseHeaders(WebCore::ContentSecurityPolicyResponseHeaders&& headers) { m_cspResponseHeaders = WTFMove(headers); } > #if ENABLE(CONTENT_EXTENSIONS) >- void setContentExtensionController(WebCore::URL&& mainDocumentURL, std::optional<UserContentControllerIdentifier> identifier) >+ void setContentExtensionController(URL&& mainDocumentURL, std::optional<UserContentControllerIdentifier> identifier) > { > m_mainDocumentURL = WTFMove(mainDocumentURL); > m_userContentControllerIdentifier = identifier; > } > #endif > >- const WebCore::URL& url() const { return m_url; } >+ const URL& url() const { return m_url; } > WebCore::StoredCredentialsPolicy storedCredentialsPolicy() const { return m_storedCredentialsPolicy; } > > WebCore::NetworkLoadInformation takeNetworkLoadInformation() { return WTFMove(m_loadInformation); } >@@ -95,7 +95,7 @@ private: > > void continueCheckingRequest(WebCore::ResourceRequest&&, ValidationHandler&&); > >- bool doesNotNeedCORSCheck(const WebCore::URL&) const; >+ bool doesNotNeedCORSCheck(const URL&) const; > void checkCORSRequest(WebCore::ResourceRequest&&, ValidationHandler&&); > void checkCORSRedirectedRequest(WebCore::ResourceRequest&&, ValidationHandler&&); > void checkCORSRequestWithPreflight(WebCore::ResourceRequest&&, ValidationHandler&&); >@@ -118,11 +118,11 @@ private: > uint64_t m_frameID; > WebCore::HTTPHeaderMap m_originalRequestHeaders; // Needed for CORS checks. > WebCore::HTTPHeaderMap m_firstRequestHeaders; // Needed for CORS checks. >- WebCore::URL m_url; >+ URL m_url; > RefPtr<WebCore::SecurityOrigin> m_origin; > std::optional<WebCore::ContentSecurityPolicyResponseHeaders> m_cspResponseHeaders; > #if ENABLE(CONTENT_EXTENSIONS) >- WebCore::URL m_mainDocumentURL; >+ URL m_mainDocumentURL; > std::optional<UserContentControllerIdentifier> m_userContentControllerIdentifier; > #endif > >@@ -131,7 +131,7 @@ private: > bool m_isSimpleRequest { true }; > std::unique_ptr<WebCore::ContentSecurityPolicy> m_contentSecurityPolicy; > size_t m_redirectCount { 0 }; >- WebCore::URL m_previousURL; >+ URL m_previousURL; > WebCore::PreflightPolicy m_preflightPolicy; > String m_dntHeaderValue; > String m_referrer; >diff --git a/Source/WebKit/NetworkProcess/NetworkProcess.cpp b/Source/WebKit/NetworkProcess/NetworkProcess.cpp >index a996809b0631d25b9bed4932b5317dc5d4d0c697..abd478818ada543fdb5039f8a038fb7f4f575985 100644 >--- a/Source/WebKit/NetworkProcess/NetworkProcess.cpp >+++ b/Source/WebKit/NetworkProcess/NetworkProcess.cpp >@@ -76,13 +76,13 @@ > #include <WebCore/SecurityOriginData.h> > #include <WebCore/SecurityOriginHash.h> > #include <WebCore/Settings.h> >-#include <WebCore/URLParser.h> > #include <pal/SessionID.h> > #include <wtf/Algorithms.h> > #include <wtf/CallbackAggregator.h> > #include <wtf/OptionSet.h> > #include <wtf/ProcessPrivilege.h> > #include <wtf/RunLoop.h> >+#include <wtf/URLParser.h> > #include <wtf/text/AtomicString.h> > #include <wtf/text/CString.h> > >@@ -478,7 +478,7 @@ void NetworkProcess::destroySession(PAL::SessionID sessionID) > #endif > } > >-void NetworkProcess::writeBlobToFilePath(const WebCore::URL& url, const String& path, SandboxExtension::Handle&& handleForWriting, CompletionHandler<void(bool)>&& completionHandler) >+void NetworkProcess::writeBlobToFilePath(const URL& url, const String& path, SandboxExtension::Handle&& handleForWriting, CompletionHandler<void(bool)>&& completionHandler) > { > auto extension = SandboxExtension::create(WTFMove(handleForWriting)); > if (!extension) { >@@ -816,7 +816,7 @@ void NetworkProcess::cancelDownload(DownloadID downloadID) > } > > #if PLATFORM(COCOA) >-void NetworkProcess::publishDownloadProgress(DownloadID downloadID, const WebCore::URL& url, SandboxExtension::Handle&& sandboxExtensionHandle) >+void NetworkProcess::publishDownloadProgress(DownloadID downloadID, const URL& url, SandboxExtension::Handle&& sandboxExtensionHandle) > { > downloadManager().publishDownloadProgress(downloadID, url, WTFMove(sandboxExtensionHandle)); > } >@@ -1035,7 +1035,7 @@ void NetworkProcess::setCacheStorageParameters(PAL::SessionID sessionID, uint64_ > callback(String { cacheStorageDirectory }, quota); > } > >-void NetworkProcess::preconnectTo(const WebCore::URL& url, WebCore::StoredCredentialsPolicy storedCredentialsPolicy) >+void NetworkProcess::preconnectTo(const URL& url, WebCore::StoredCredentialsPolicy storedCredentialsPolicy) > { > #if ENABLE(SERVER_PRECONNECT) > NetworkLoadParameters parameters; >diff --git a/Source/WebKit/NetworkProcess/NetworkProcess.h b/Source/WebKit/NetworkProcess/NetworkProcess.h >index 5d799b43049553b9de380570ed1565c23fab0e95..e67785c8dcebea17796a7bf0c440fdcc087dde3b 100644 >--- a/Source/WebKit/NetworkProcess/NetworkProcess.h >+++ b/Source/WebKit/NetworkProcess/NetworkProcess.h >@@ -66,7 +66,6 @@ class ProtectionSpace; > class ResourceError; > class SWServer; > class SecurityOrigin; >-class URL; > enum class StoredCredentialsPolicy : bool; > struct MessageWithMessagePorts; > struct SecurityOriginData; >@@ -172,7 +171,7 @@ public: > using CacheStorageParametersCallback = CompletionHandler<void(const String&, uint64_t quota)>; > void cacheStorageParameters(PAL::SessionID, CacheStorageParametersCallback&&); > >- void preconnectTo(const WebCore::URL&, WebCore::StoredCredentialsPolicy); >+ void preconnectTo(const URL&, WebCore::StoredCredentialsPolicy); > > void setSessionIsControlledByAutomation(PAL::SessionID, bool); > bool sessionIsControlledByAutomation(PAL::SessionID) const; >@@ -275,7 +274,7 @@ private: > void resumeDownload(PAL::SessionID, DownloadID, const IPC::DataReference& resumeData, const String& path, SandboxExtension::Handle&&); > void cancelDownload(DownloadID); > #if PLATFORM(COCOA) >- void publishDownloadProgress(DownloadID, const WebCore::URL&, SandboxExtension::Handle&&); >+ void publishDownloadProgress(DownloadID, const URL&, SandboxExtension::Handle&&); > #endif > void continueWillSendRequest(DownloadID, WebCore::ResourceRequest&&); > void continueDecidePendingDownloadDestination(DownloadID, String destination, SandboxExtension::Handle&&, bool allowOverwrite); >@@ -290,7 +289,7 @@ private: > void syncAllCookies(); > void didSyncAllCookies(); > >- void writeBlobToFilePath(const WebCore::URL&, const String& path, SandboxExtension::Handle&&, CompletionHandler<void(bool)>&&); >+ void writeBlobToFilePath(const URL&, const String& path, SandboxExtension::Handle&&, CompletionHandler<void(bool)>&&); > > #if USE(SOUP) > void setIgnoreTLSErrors(bool); >diff --git a/Source/WebKit/NetworkProcess/NetworkProcess.messages.in b/Source/WebKit/NetworkProcess/NetworkProcess.messages.in >index f1e0437dff6caae1519690033c8a8854d9be3e3c..50795a282279b1367160091b28ad9c71b03d5fe1 100644 >--- a/Source/WebKit/NetworkProcess/NetworkProcess.messages.in >+++ b/Source/WebKit/NetworkProcess/NetworkProcess.messages.in >@@ -50,7 +50,7 @@ messages -> NetworkProcess LegacyReceiver { > ResumeDownload(PAL::SessionID sessionID, WebKit::DownloadID downloadID, IPC::DataReference resumeData, String path, WebKit::SandboxExtension::Handle sandboxExtensionHandle) > CancelDownload(WebKit::DownloadID downloadID) > #if PLATFORM(COCOA) >- PublishDownloadProgress(WebKit::DownloadID downloadID, WebCore::URL url, WebKit::SandboxExtension::Handle sandboxExtensionHandle) >+ PublishDownloadProgress(WebKit::DownloadID downloadID, URL url, WebKit::SandboxExtension::Handle sandboxExtensionHandle) > #endif > > ContinueWillSendRequest(WebKit::DownloadID downloadID, WebCore::ResourceRequest request) >@@ -80,9 +80,9 @@ messages -> NetworkProcess LegacyReceiver { > CancelPrepareToSuspend() > ProcessDidResume() > >- WriteBlobToFilePath(WebCore::URL blobURL, String path, WebKit::SandboxExtension::Handle handle) -> (bool success) Async >+ WriteBlobToFilePath(URL blobURL, String path, WebKit::SandboxExtension::Handle handle) -> (bool success) Async > >- PreconnectTo(WebCore::URL url, enum:bool WebCore::StoredCredentialsPolicy storedCredentialsPolicy); >+ PreconnectTo(URL url, enum:bool WebCore::StoredCredentialsPolicy storedCredentialsPolicy); > > #if ENABLE(RESOURCE_LOAD_STATISTICS) > UpdatePrevalentDomainsToBlockCookiesFor(PAL::SessionID sessionID, Vector<String> domainsToBlock, uint64_t contextId) >diff --git a/Source/WebKit/NetworkProcess/NetworkResourceLoadParameters.h b/Source/WebKit/NetworkProcess/NetworkResourceLoadParameters.h >index d63738aeec8a3535d09610369e786491b1e9d2f9..2743e129c879f6b0c25c211ba00893978a3a0bc4 100644 >--- a/Source/WebKit/NetworkProcess/NetworkResourceLoadParameters.h >+++ b/Source/WebKit/NetworkProcess/NetworkResourceLoadParameters.h >@@ -65,7 +65,7 @@ public: > Vector<RefPtr<WebCore::SecurityOrigin>> frameAncestorOrigins; > > #if ENABLE(CONTENT_EXTENSIONS) >- WebCore::URL mainDocumentURL; >+ URL mainDocumentURL; > std::optional<UserContentControllerIdentifier> userContentControllerIdentifier; > #endif > }; >diff --git a/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp b/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp >index bb1fb6ba2914a638b84825f6f57aeecd51e96f0c..82a85501d2c5c67f95e1341ceb71907edeb42f19 100644 >--- a/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp >+++ b/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp >@@ -1013,7 +1013,7 @@ void NetworkResourceLoader::logCookieInformation() const > logCookieInformation("NetworkResourceLoader", reinterpret_cast<const void*>(this), *networkStorageSession, originalRequest().firstPartyForCookies(), SameSiteInfo::create(originalRequest()), originalRequest().url(), originalRequest().httpReferrer(), frameID(), pageID(), identifier()); > } > >-static void logBlockedCookieInformation(const String& label, const void* loggedObject, const WebCore::NetworkStorageSession& networkStorageSession, const WebCore::URL& firstParty, const SameSiteInfo& sameSiteInfo, const WebCore::URL& url, const String& referrer, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, std::optional<uint64_t> identifier) >+static void logBlockedCookieInformation(const String& label, const void* loggedObject, const WebCore::NetworkStorageSession& networkStorageSession, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, const String& referrer, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, std::optional<uint64_t> identifier) > { > ASSERT(NetworkResourceLoader::shouldLogCookieInformation(networkStorageSession.sessionID())); > >@@ -1040,7 +1040,7 @@ static void logBlockedCookieInformation(const String& label, const void* loggedO > #undef LOCAL_LOG_IF_ALLOWED > } > >-static void logCookieInformationInternal(const String& label, const void* loggedObject, const WebCore::NetworkStorageSession& networkStorageSession, const WebCore::URL& firstParty, const WebCore::SameSiteInfo& sameSiteInfo, const WebCore::URL& url, const String& referrer, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, std::optional<uint64_t> identifier) >+static void logCookieInformationInternal(const String& label, const void* loggedObject, const WebCore::NetworkStorageSession& networkStorageSession, const URL& firstParty, const WebCore::SameSiteInfo& sameSiteInfo, const URL& url, const String& referrer, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, std::optional<uint64_t> identifier) > { > ASSERT(NetworkResourceLoader::shouldLogCookieInformation(networkStorageSession.sessionID())); > >diff --git a/Source/WebKit/NetworkProcess/NetworkResourceLoader.h b/Source/WebKit/NetworkProcess/NetworkResourceLoader.h >index 2e2ddd3cfb479015aea9ba6cae0ff2ab2ba1cc79..c2d5d776b73ffb7601dfe58ff1649348cfe8a84e 100644 >--- a/Source/WebKit/NetworkProcess/NetworkResourceLoader.h >+++ b/Source/WebKit/NetworkProcess/NetworkResourceLoader.h >@@ -113,7 +113,7 @@ public: > > #if ENABLE(RESOURCE_LOAD_STATISTICS) && !RELEASE_LOG_DISABLED > static bool shouldLogCookieInformation(const PAL::SessionID&); >- static void logCookieInformation(const String& label, const void* loggedObject, const WebCore::NetworkStorageSession&, const WebCore::URL& firstParty, const WebCore::SameSiteInfo&, const WebCore::URL&, const String& referrer, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, std::optional<uint64_t> identifier); >+ static void logCookieInformation(const String& label, const void* loggedObject, const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, const String& referrer, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, std::optional<uint64_t> identifier); > #endif > > private: >@@ -134,7 +134,7 @@ private: > void dispatchWillSendRequestForCacheEntry(WebCore::ResourceRequest&&, std::unique_ptr<NetworkCache::Entry>&&); > void continueProcessingCachedEntryAfterDidReceiveResponse(std::unique_ptr<NetworkCache::Entry>); > >- bool shouldInterruptLoadForXFrameOptions(const String&, const WebCore::URL&); >+ bool shouldInterruptLoadForXFrameOptions(const String&, const URL&); > bool shouldInterruptLoadForCSPFrameAncestorsOrXFrameOptions(const WebCore::ResourceResponse&); > > enum class FirstLoad { No, Yes }; >@@ -169,7 +169,7 @@ private: > > // ContentSecurityPolicyClient > void addConsoleMessage(MessageSource, MessageLevel, const String&, unsigned long) final; >- void sendCSPViolationReport(WebCore::URL&&, Ref<WebCore::FormData>&&) final; >+ void sendCSPViolationReport(URL&&, Ref<WebCore::FormData>&&) final; > void enqueueSecurityPolicyViolationEvent(WebCore::SecurityPolicyViolationEvent::Init&&) final; > > void logSlowCacheRetrieveIfNeeded(const NetworkCache::Cache::RetrieveInfo&); >diff --git a/Source/WebKit/NetworkProcess/NetworkSocketStream.cpp b/Source/WebKit/NetworkProcess/NetworkSocketStream.cpp >index 42d36bc4cc3fe432f3524c83b0c9f884e8d7443c..c5a62c68fe9da656e4233fbd1369a2c661e29a4e 100644 >--- a/Source/WebKit/NetworkProcess/NetworkSocketStream.cpp >+++ b/Source/WebKit/NetworkProcess/NetworkSocketStream.cpp >@@ -35,7 +35,7 @@ > namespace WebKit { > using namespace WebCore; > >-Ref<NetworkSocketStream> NetworkSocketStream::create(WebCore::URL&& url, PAL::SessionID sessionID, const String& credentialPartition, uint64_t identifier, IPC::Connection& connection, SourceApplicationAuditToken&& auditData) >+Ref<NetworkSocketStream> NetworkSocketStream::create(URL&& url, PAL::SessionID sessionID, const String& credentialPartition, uint64_t identifier, IPC::Connection& connection, SourceApplicationAuditToken&& auditData) > { > return adoptRef(*new NetworkSocketStream(WTFMove(url), sessionID, credentialPartition, identifier, connection, WTFMove(auditData))); > } >diff --git a/Source/WebKit/NetworkProcess/NetworkSocketStream.h b/Source/WebKit/NetworkProcess/NetworkSocketStream.h >index 906e58ebf57425d683770891685fdabd2a837bc8..3268716f4469c0993f2597d09cbe1588e6f23a5b 100644 >--- a/Source/WebKit/NetworkProcess/NetworkSocketStream.h >+++ b/Source/WebKit/NetworkProcess/NetworkSocketStream.h >@@ -39,14 +39,13 @@ class DataReference; > > namespace WebCore { > class SocketStreamHandleImpl; >-class URL; > } > > namespace WebKit { > > class NetworkSocketStream : public RefCounted<NetworkSocketStream>, public IPC::MessageSender, public IPC::MessageReceiver, public WebCore::SocketStreamHandleClient { > public: >- static Ref<NetworkSocketStream> create(WebCore::URL&&, PAL::SessionID, const String& credentialPartition, uint64_t, IPC::Connection&, WebCore::SourceApplicationAuditToken&&); >+ static Ref<NetworkSocketStream> create(URL&&, PAL::SessionID, const String& credentialPartition, uint64_t, IPC::Connection&, WebCore::SourceApplicationAuditToken&&); > ~NetworkSocketStream(); > > void didReceiveMessage(IPC::Connection&, IPC::Decoder&); >@@ -67,7 +66,7 @@ private: > IPC::Connection* messageSenderConnection() final; > uint64_t messageSenderDestinationID() final; > >- NetworkSocketStream(WebCore::URL&&, PAL::SessionID, const String& credentialPartition, uint64_t, IPC::Connection&, WebCore::SourceApplicationAuditToken&&); >+ NetworkSocketStream(URL&&, PAL::SessionID, const String& credentialPartition, uint64_t, IPC::Connection&, WebCore::SourceApplicationAuditToken&&); > > uint64_t m_identifier; > IPC::Connection& m_connection; >diff --git a/Source/WebKit/NetworkProcess/PingLoad.h b/Source/WebKit/NetworkProcess/PingLoad.h >index 9f0c6b86b420f455bffc2de6b94ebe7c8be143a0..d4543f235b9047c5709c81ffda3861c59f784243 100644 >--- a/Source/WebKit/NetworkProcess/PingLoad.h >+++ b/Source/WebKit/NetworkProcess/PingLoad.h >@@ -36,7 +36,6 @@ > namespace WebCore { > class ContentSecurityPolicy; > class HTTPHeaderMap; >-class URL; > } > > namespace WebKit { >@@ -51,7 +50,7 @@ public: > private: > ~PingLoad(); > >- const WebCore::URL& currentURL() const; >+ const URL& currentURL() const; > WebCore::ContentSecurityPolicy* contentSecurityPolicy() const; > > void willPerformHTTPRedirection(WebCore::ResourceResponse&&, WebCore::ResourceRequest&&, RedirectCompletionHandler&&) final; >diff --git a/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.h b/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.h >index 2ca6625d1c00e6d27d5258861721fcc50b534b55..9d17037894f5b511038de06bad09dd7f634c7f1a 100644 >--- a/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.h >+++ b/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.h >@@ -90,8 +90,8 @@ private: > void startFetch(WebCore::ServiceWorkerRegistrationIdentifier, WebCore::FetchIdentifier, WebCore::ResourceRequest&&, WebCore::FetchOptions&&, IPC::FormDataReference&&, String&& referrer); > void cancelFetch(WebCore::ServiceWorkerRegistrationIdentifier, WebCore::FetchIdentifier); > >- void matchRegistration(uint64_t registrationMatchRequestIdentifier, const WebCore::SecurityOriginData& topOrigin, const WebCore::URL& clientURL); >- void getRegistrations(uint64_t registrationMatchRequestIdentifier, const WebCore::SecurityOriginData& topOrigin, const WebCore::URL& clientURL); >+ void matchRegistration(uint64_t registrationMatchRequestIdentifier, const WebCore::SecurityOriginData& topOrigin, const URL& clientURL); >+ void getRegistrations(uint64_t registrationMatchRequestIdentifier, const WebCore::SecurityOriginData& topOrigin, const URL& clientURL); > > void registerServiceWorkerClient(WebCore::SecurityOriginData&& topOrigin, WebCore::ServiceWorkerClientData&&, const std::optional<WebCore::ServiceWorkerRegistrationIdentifier>&); > void unregisterServiceWorkerClient(const WebCore::ServiceWorkerClientIdentifier&); >diff --git a/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in b/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in >index 8acf79794bccec89dca8890fa660238deb2c2059..d533c35c9b7eb42c886cd1ca978ac87568d9edbb 100644 >--- a/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in >+++ b/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in >@@ -36,9 +36,9 @@ messages -> WebSWServerConnection { > > DidResolveRegistrationPromise(WebCore::ServiceWorkerRegistrationKey key) > >- MatchRegistration(uint64_t serviceRegistrationMatchRequestIdentifier, struct WebCore::SecurityOriginData topOrigin, WebCore::URL clientURL) >- WhenRegistrationReady(uint64_t serviceRegistrationMatchRequestIdentifier, struct WebCore::SecurityOriginData topOrigin, WebCore::URL clientURL) >- GetRegistrations(uint64_t serviceRegistrationMatchRequestIdentifier, struct WebCore::SecurityOriginData topOrigin, WebCore::URL clientURL) >+ MatchRegistration(uint64_t serviceRegistrationMatchRequestIdentifier, struct WebCore::SecurityOriginData topOrigin, URL clientURL) >+ WhenRegistrationReady(uint64_t serviceRegistrationMatchRequestIdentifier, struct WebCore::SecurityOriginData topOrigin, URL clientURL) >+ GetRegistrations(uint64_t serviceRegistrationMatchRequestIdentifier, struct WebCore::SecurityOriginData topOrigin, URL clientURL) > RegisterServiceWorkerClient(struct WebCore::SecurityOriginData topOrigin, struct WebCore::ServiceWorkerClientData data, std::optional<WebCore::ServiceWorkerRegistrationIdentifier> controllingServiceWorkerRegistrationIdentifier) > UnregisterServiceWorkerClient(struct WebCore::ServiceWorkerClientIdentifier identifier) > >diff --git a/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in b/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in >index d86ab609397765c5bbfa79354a115b7c7491d27e..611692d1949972feb1e3ce85b88b858559fe64b0 100644 >--- a/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in >+++ b/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in >@@ -35,7 +35,7 @@ messages -> WebSWServerToContextConnection { > FindClientByIdentifier(uint64_t requestIdentifier, WebCore::ServiceWorkerIdentifier serviceWorkerIdentifier, struct WebCore::ServiceWorkerClientIdentifier clientIdentifier); > MatchAll(uint64_t matchAllRequestIdentifier, WebCore::ServiceWorkerIdentifier serviceWorkerIdentifier, struct WebCore::ServiceWorkerClientQueryOptions options); > Claim(uint64_t claimRequestIdentifier, WebCore::ServiceWorkerIdentifier serviceWorkerIdentifier); >- SetScriptResource(WebCore::ServiceWorkerIdentifier identifier, WebCore::URL scriptURL, String script, WebCore::URL responseURL, String mimeType); >+ SetScriptResource(WebCore::ServiceWorkerIdentifier identifier, URL scriptURL, String script, URL responseURL, String mimeType); > } > > #endif // ENABLE(SERVICE_WORKER) >diff --git a/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp b/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp >index f5d1362646b1eead0b53c946356e96194858a90c..2b9e543b9461554b43cfaabbc78c707bce2b6541 100644 >--- a/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp >+++ b/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp >@@ -134,7 +134,7 @@ void Engine::retrieveCaches(PAL::SessionID sessionID, WebCore::ClientOrigin&& or > } > > >-void Engine::retrieveRecords(PAL::SessionID sessionID, uint64_t cacheIdentifier, WebCore::URL&& url, WebCore::DOMCacheEngine::RecordsCallback&& callback) >+void Engine::retrieveRecords(PAL::SessionID sessionID, uint64_t cacheIdentifier, URL&& url, WebCore::DOMCacheEngine::RecordsCallback&& callback) > { > from(sessionID, [cacheIdentifier, url = WTFMove(url), callback = WTFMove(callback)](auto& engine) mutable { > engine.retrieveRecords(cacheIdentifier, WTFMove(url), WTFMove(callback)); >@@ -247,7 +247,7 @@ void Engine::retrieveCaches(const WebCore::ClientOrigin& origin, uint64_t update > }); > } > >-void Engine::retrieveRecords(uint64_t cacheIdentifier, WebCore::URL&& url, RecordsCallback&& callback) >+void Engine::retrieveRecords(uint64_t cacheIdentifier, URL&& url, RecordsCallback&& callback) > { > readCache(cacheIdentifier, [url = WTFMove(url), callback = WTFMove(callback)](CacheOrError&& result) mutable { > if (!result.has_value()) { >diff --git a/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.h b/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.h >index 8c2e8cce14d8129097f71ac21e26e361fd6d6833..7e14225bee50a977b5fc9251465467bb34d83524 100644 >--- a/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.h >+++ b/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.h >@@ -65,7 +65,7 @@ public: > static void remove(PAL::SessionID, uint64_t cacheIdentifier, WebCore::DOMCacheEngine::CacheIdentifierCallback&&); > static void retrieveCaches(PAL::SessionID, WebCore::ClientOrigin&&, uint64_t updateCounter, WebCore::DOMCacheEngine::CacheInfosCallback&&); > >- static void retrieveRecords(PAL::SessionID, uint64_t cacheIdentifier, WebCore::URL&&, WebCore::DOMCacheEngine::RecordsCallback&&); >+ static void retrieveRecords(PAL::SessionID, uint64_t cacheIdentifier, URL&&, WebCore::DOMCacheEngine::RecordsCallback&&); > static void putRecords(PAL::SessionID, uint64_t cacheIdentifier, Vector<WebCore::DOMCacheEngine::Record>&&, WebCore::DOMCacheEngine::RecordIdentifiersCallback&&); > static void deleteMatchingRecords(PAL::SessionID, uint64_t cacheIdentifier, WebCore::ResourceRequest&&, WebCore::CacheQueryOptions&&, WebCore::DOMCacheEngine::RecordIdentifiersCallback&&); > >@@ -104,7 +104,7 @@ private: > void clearMemoryRepresentation(const WebCore::ClientOrigin&, WebCore::DOMCacheEngine::CompletionCallback&&); > String representation(); > >- void retrieveRecords(uint64_t cacheIdentifier, WebCore::URL&&, WebCore::DOMCacheEngine::RecordsCallback&&); >+ void retrieveRecords(uint64_t cacheIdentifier, URL&&, WebCore::DOMCacheEngine::RecordsCallback&&); > void putRecords(uint64_t cacheIdentifier, Vector<WebCore::DOMCacheEngine::Record>&&, WebCore::DOMCacheEngine::RecordIdentifiersCallback&&); > void deleteMatchingRecords(uint64_t cacheIdentifier, WebCore::ResourceRequest&&, WebCore::CacheQueryOptions&&, WebCore::DOMCacheEngine::RecordIdentifiersCallback&&); > >diff --git a/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCache.h b/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCache.h >index 7fb6e0818ec241595f82c6772c84b5e320cf7615..898018e4ea37fb12fb632b192fe8aea1c7146576 100644 >--- a/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCache.h >+++ b/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCache.h >@@ -45,7 +45,7 @@ struct RecordInformation { > > uint64_t size { 0 }; > >- WebCore::URL url; >+ URL url; > bool hasVaryStar { false }; > HashMap<String, String> varyHeaders; > }; >@@ -66,7 +66,7 @@ public: > const String& uniqueName() const { return m_uniqueName; } > bool isActive() const { return m_state != State::Uninitialized; } > >- void retrieveRecords(const WebCore::URL&, WebCore::DOMCacheEngine::RecordsCallback&&); >+ void retrieveRecords(const URL&, WebCore::DOMCacheEngine::RecordsCallback&&); > WebCore::DOMCacheEngine::CacheInfo info() const { return { m_identifier, m_name }; } > > void put(Vector<WebCore::DOMCacheEngine::Record>&&, WebCore::DOMCacheEngine::RecordIdentifiersCallback&&); >@@ -94,8 +94,8 @@ public: > static std::optional<DecodedRecord> decodeRecordHeader(const NetworkCache::Storage::Record&); > > private: >- Vector<RecordInformation>* recordsFromURL(const WebCore::URL&); >- const Vector<RecordInformation>* recordsFromURL(const WebCore::URL&) const; >+ Vector<RecordInformation>* recordsFromURL(const URL&); >+ const Vector<RecordInformation>* recordsFromURL(const URL&) const; > RecordInformation& addRecord(Vector<RecordInformation>*, const WebCore::DOMCacheEngine::Record&); > > void storeRecords(Vector<WebCore::DOMCacheEngine::Record>&&, WebCore::DOMCacheEngine::RecordIdentifiersCallback&&); >diff --git a/Source/WebKit/NetworkProcess/cache/CacheStorageEngineConnection.cpp b/Source/WebKit/NetworkProcess/cache/CacheStorageEngineConnection.cpp >index 5f6eac8a1ae1d7e8ef5986b7f7a1b4515a5d083d..3e32517e94bdfcf3bedb2103a12e8e4c86c4c5df 100644 >--- a/Source/WebKit/NetworkProcess/cache/CacheStorageEngineConnection.cpp >+++ b/Source/WebKit/NetworkProcess/cache/CacheStorageEngineConnection.cpp >@@ -89,7 +89,7 @@ void CacheStorageEngineConnection::caches(PAL::SessionID sessionID, uint64_t req > }); > } > >-void CacheStorageEngineConnection::retrieveRecords(PAL::SessionID sessionID, uint64_t requestIdentifier, uint64_t cacheIdentifier, WebCore::URL&& url) >+void CacheStorageEngineConnection::retrieveRecords(PAL::SessionID sessionID, uint64_t requestIdentifier, uint64_t cacheIdentifier, URL&& url) > { > RELEASE_LOG_IF_ALLOWED("retrieveRecords (%" PRIu64 ") in cache %" PRIu64, requestIdentifier, cacheIdentifier); > Engine::retrieveRecords(sessionID, cacheIdentifier, WTFMove(url), [connection = makeRef(m_connection.connection()), sessionID, requestIdentifier](RecordsOrError&& result) { >diff --git a/Source/WebKit/NetworkProcess/cache/CacheStorageEngineConnection.h b/Source/WebKit/NetworkProcess/cache/CacheStorageEngineConnection.h >index bc880f5eb589aedcfee45a2341838b253dba6104..6a3ddc63d2a0885ca4c51425e56c3a5cc9683a51 100644 >--- a/Source/WebKit/NetworkProcess/cache/CacheStorageEngineConnection.h >+++ b/Source/WebKit/NetworkProcess/cache/CacheStorageEngineConnection.h >@@ -54,7 +54,7 @@ private: > void remove(PAL::SessionID, uint64_t removeRequestIdentifier, uint64_t cacheIdentifier); > void caches(PAL::SessionID, uint64_t retrieveCachesIdentifier, WebCore::ClientOrigin&&, uint64_t updateCounter); > >- void retrieveRecords(PAL::SessionID, uint64_t requestIdentifier, uint64_t cacheIdentifier, WebCore::URL&&); >+ void retrieveRecords(PAL::SessionID, uint64_t requestIdentifier, uint64_t cacheIdentifier, URL&&); > void deleteMatchingRecords(PAL::SessionID, uint64_t requestIdentifier, uint64_t cacheIdentifier, WebCore::ResourceRequest&&, WebCore::CacheQueryOptions&&); > void putRecords(PAL::SessionID, uint64_t requestIdentifier, uint64_t cacheIdentifier, Vector<WebCore::DOMCacheEngine::Record>&&); > >diff --git a/Source/WebKit/NetworkProcess/cache/CacheStorageEngineConnection.messages.in b/Source/WebKit/NetworkProcess/cache/CacheStorageEngineConnection.messages.in >index e3107e20146d59003b206b1dedf6f863cb8c55ee..60e39aa2c405dcc98aaa920094ae10d8eab543c1 100644 >--- a/Source/WebKit/NetworkProcess/cache/CacheStorageEngineConnection.messages.in >+++ b/Source/WebKit/NetworkProcess/cache/CacheStorageEngineConnection.messages.in >@@ -31,7 +31,7 @@ messages -> CacheStorageEngineConnection { > ClearMemoryRepresentation(PAL::SessionID sessionID, uint64_t requestIdentifier, struct WebCore::ClientOrigin origin); > EngineRepresentation(PAL::SessionID sessionID, uint64_t requestIdentifier); > >- RetrieveRecords(PAL::SessionID sessionID, uint64_t requestIdentifier, uint64_t cacheIdentifier, WebCore::URL url); >+ RetrieveRecords(PAL::SessionID sessionID, uint64_t requestIdentifier, uint64_t cacheIdentifier, URL url); > DeleteMatchingRecords(PAL::SessionID sessionID, uint64_t requestIdentifier, uint64_t cacheIdentifier, WebCore::ResourceRequest request, struct WebCore::CacheQueryOptions options); > PutRecords(PAL::SessionID sessionID, uint64_t requestIdentifier, uint64_t cacheIdentifier, Vector<WebCore::DOMCacheEngine::Record> record); > } >diff --git a/Source/WebKit/NetworkProcess/cache/NetworkCache.h b/Source/WebKit/NetworkProcess/cache/NetworkCache.h >index b66e32d290fe4459f33017e7970a325f7cebf3e8..c2d0e964effdfced268659485c751d538db665a6 100644 >--- a/Source/WebKit/NetworkProcess/cache/NetworkCache.h >+++ b/Source/WebKit/NetworkProcess/cache/NetworkCache.h >@@ -38,7 +38,6 @@ namespace WebCore { > class LowPowerModeNotifier; > class ResourceRequest; > class SharedBuffer; >-class URL; > } > > namespace WebKit { >diff --git a/Source/WebKit/NetworkProcess/cache/NetworkCacheStatistics.cpp b/Source/WebKit/NetworkProcess/cache/NetworkCacheStatistics.cpp >index a3780c55bc643577b4d07801e14c51e1d00ae494..16579ba8209eb658578cc2c43141c9350c856db3 100644 >--- a/Source/WebKit/NetworkProcess/cache/NetworkCacheStatistics.cpp >+++ b/Source/WebKit/NetworkProcess/cache/NetworkCacheStatistics.cpp >@@ -292,7 +292,7 @@ static String cachedEntryReuseFailureToDiagnosticKey(UseDecision decision) > > void Statistics::recordRetrievedCachedEntry(uint64_t webPageID, const Key& key, const WebCore::ResourceRequest& request, UseDecision decision) > { >- WebCore::URL requestURL = request.url(); >+ URL requestURL = request.url(); > if (decision == UseDecision::Use) { > LOG(NetworkCache, "(NetworkProcess) webPageID %" PRIu64 ": %s is in the cache and is used", webPageID, requestURL.string().ascii().data()); > NetworkProcess::singleton().logDiagnosticMessageWithResult(webPageID, WebCore::DiagnosticLoggingKeys::networkCacheKey(), WebCore::DiagnosticLoggingKeys::retrievalKey(), WebCore::DiagnosticLoggingResultPass, WebCore::ShouldSample::Yes); >@@ -312,7 +312,7 @@ void Statistics::recordRetrievedCachedEntry(uint64_t webPageID, const Key& key, > > void Statistics::recordRevalidationSuccess(uint64_t webPageID, const Key& key, const WebCore::ResourceRequest& request) > { >- WebCore::URL requestURL = request.url(); >+ URL requestURL = request.url(); > LOG(NetworkCache, "(NetworkProcess) webPageID %" PRIu64 ": %s was successfully revalidated", webPageID, requestURL.string().ascii().data()); > > NetworkProcess::singleton().logDiagnosticMessageWithResult(webPageID, WebCore::DiagnosticLoggingKeys::networkCacheKey(), WebCore::DiagnosticLoggingKeys::revalidatingKey(), WebCore::DiagnosticLoggingResultPass, WebCore::ShouldSample::Yes); >diff --git a/Source/WebKit/NetworkProcess/cache/NetworkCacheSubresourcesEntry.h b/Source/WebKit/NetworkProcess/cache/NetworkCacheSubresourcesEntry.h >index ef252a1c7b9c6bd56809730c2d04933531f04c9b..43921a0024e97dd36f0d221851ec4ae98761a171 100644 >--- a/Source/WebKit/NetworkProcess/cache/NetworkCacheSubresourcesEntry.h >+++ b/Source/WebKit/NetworkProcess/cache/NetworkCacheSubresourcesEntry.h >@@ -23,15 +23,14 @@ > * THE POSSIBILITY OF SUCH DAMAGE. > */ > >-#ifndef NetworkCacheSubresourcesEntry_h >-#define NetworkCacheSubresourcesEntry_h >+#pragma once > > #if ENABLE(NETWORK_CACHE_SPECULATIVE_REVALIDATION) > > #include "NetworkCacheStorage.h" > #include <WebCore/ResourceRequest.h> >-#include <WebCore/URL.h> > #include <wtf/HashMap.h> >+#include <wtf/URL.h> > > namespace WebKit { > namespace NetworkCache { >@@ -50,7 +49,7 @@ public: > WallTime firstSeen() const { return m_firstSeen; } > > bool isTransient() const { return m_isTransient; } >- const WebCore::URL& firstPartyForCookies() const { ASSERT(!m_isTransient); return m_firstPartyForCookies; } >+ const URL& firstPartyForCookies() const { ASSERT(!m_isTransient); return m_firstPartyForCookies; } > const WebCore::HTTPHeaderMap& requestHeaders() const { ASSERT(!m_isTransient); return m_requestHeaders; } > WebCore::ResourceLoadPriority priority() const { ASSERT(!m_isTransient); return m_priority; } > >@@ -65,7 +64,7 @@ private: > WallTime m_firstSeen; > bool m_isTransient { false }; > bool m_isSameSite { false }; >- WebCore::URL m_firstPartyForCookies; >+ URL m_firstPartyForCookies; > WebCore::HTTPHeaderMap m_requestHeaders; > WebCore::ResourceLoadPriority m_priority; > }; >@@ -107,4 +106,3 @@ private: > } // namespace NetworkCache > > #endif // ENABLE(NETWORK_CACHE_SPECULATIVE_REVALIDATION) >-#endif // NetworkCacheSubresourcesEntry_h >diff --git a/Source/WebKit/NetworkProcess/capture/NetworkCaptureEvent.cpp b/Source/WebKit/NetworkProcess/capture/NetworkCaptureEvent.cpp >index 966168b4e0781248e55681ff4b777e6e16030945..b1c0fb111bd5bd61148998b4b97a7f0f3e3ca151 100644 >--- a/Source/WebKit/NetworkProcess/capture/NetworkCaptureEvent.cpp >+++ b/Source/WebKit/NetworkProcess/capture/NetworkCaptureEvent.cpp >@@ -36,9 +36,9 @@ > #include <WebCore/ResourceError.h> > #include <WebCore/ResourceRequest.h> > #include <WebCore/ResourceResponse.h> >-#include <WebCore/URLParser.h> > #include <wtf/Assertions.h> > #include <wtf/Brigand.h> >+#include <wtf/URLParser.h> > #include <wtf/text/Base64.h> > > namespace WebKit { >@@ -81,8 +81,7 @@ Request::Request(const WebCore::ResourceRequest& request) > > Request::operator WebCore::ResourceRequest() const > { >- WebCore::URLParser parser(url); >- WebCore::ResourceRequest request(parser.result(), referrer, static_cast<WebCore::ResourceRequestCachePolicy>(policy)); >+ WebCore::ResourceRequest request(URL({ }, url), referrer, static_cast<WebCore::ResourceRequestCachePolicy>(policy)); > request.setHTTPMethod(method); > > for (const auto& header : headers) >@@ -118,8 +117,7 @@ Response::Response(const WebCore::ResourceResponse& response) > > Response::operator WebCore::ResourceResponse() const > { >- WebCore::URLParser parser(url); >- WebCore::ResourceResponse response(parser.result(), mimeType, expectedLength, textEncodingName); >+ WebCore::ResourceResponse response(URL({ }, url), mimeType, expectedLength, textEncodingName); > response.setHTTPVersion(version); > response.setHTTPStatusCode(status); > response.setHTTPStatusText(reason); >@@ -152,8 +150,7 @@ Error::Error(const WebCore::ResourceError& error) > > Error::operator WebCore::ResourceError() const > { >- WebCore::URLParser parser(failingURL); >- WebCore::ResourceError error(domain, errorCode, parser.result(), localizedDescription, static_cast<WebCore::ResourceError::Type>(type)); >+ WebCore::ResourceError error(domain, errorCode, URL({ }, failingURL), localizedDescription, static_cast<WebCore::ResourceError::Type>(type)); > > return error; > } >diff --git a/Source/WebKit/NetworkProcess/capture/NetworkCaptureManager.cpp b/Source/WebKit/NetworkProcess/capture/NetworkCaptureManager.cpp >index 27689ee3b72398d85120f736357c007242289e8e..d565a4ea3771e4637973f719ca198a28c557e0f4 100644 >--- a/Source/WebKit/NetworkProcess/capture/NetworkCaptureManager.cpp >+++ b/Source/WebKit/NetworkProcess/capture/NetworkCaptureManager.cpp >@@ -31,12 +31,12 @@ > #include "NetworkCaptureLogging.h" > #include "NetworkCaptureResource.h" > #include <WebCore/ResourceRequest.h> >-#include <WebCore/URL.h> > #include <algorithm> > #include <iterator> > #include <limits> > #include <wtf/MD5.h> > #include <wtf/NeverDestroyed.h> >+#include <wtf/URL.h> > #include <wtf/text/Base64.h> > #include <wtf/text/StringBuilder.h> > >@@ -146,7 +146,7 @@ Resource* Manager::findBestFuzzyMatch(const WebCore::ResourceRequest& request) > > Resource* bestMatch = nullptr; > int bestScore = kMinMatch; >- const auto& requestParameters = WebCore::URLParser::parseURLEncodedForm(url.query()); >+ const auto& requestParameters = WTF::URLParser::parseURLEncodedForm(url.query()); > for (auto iResource = lower; iResource != upper; ++iResource) { > int thisScore = fuzzyMatchURLs(url, requestParameters, iResource->url(), iResource->queryParameters()); > // TODO: Consider ignoring any matches < 0 as being too different. >@@ -165,7 +165,7 @@ Resource* Manager::findBestFuzzyMatch(const WebCore::ResourceRequest& request) > // TODO: Convert to an interface based on ResourceRequest so that we can do > // deeper matching. > >-int Manager::fuzzyMatchURLs(const WebCore::URL& requestURL, const WebCore::URLParser::URLEncodedForm& requestParameters, const WebCore::URL& resourceURL, const WebCore::URLParser::URLEncodedForm& resourceParameters) >+int Manager::fuzzyMatchURLs(const URL& requestURL, const WTF::URLParser::URLEncodedForm& requestParameters, const URL& resourceURL, const WTF::URLParser::URLEncodedForm& resourceParameters) > { > // TODO: consider requiring that any trailing suffixes (e.g., ".js", > // ".png", ".css", ".html", etc.) should be an exact match. >@@ -419,7 +419,7 @@ String Manager::hashToPath(const String& hash) > return path; > } > >-String Manager::urlIdentifyingCommonDomain(const WebCore::URL& url) >+String Manager::urlIdentifyingCommonDomain(const URL& url) > { > return url.protocolHostAndPort(); > } >diff --git a/Source/WebKit/NetworkProcess/capture/NetworkCaptureManager.h b/Source/WebKit/NetworkProcess/capture/NetworkCaptureManager.h >index 3c6b5010da2341e682cb1ca2401a0660f39c741a..c36816c9a89a1c7efad104f1b03908836dca7f30 100644 >--- a/Source/WebKit/NetworkProcess/capture/NetworkCaptureManager.h >+++ b/Source/WebKit/NetworkProcess/capture/NetworkCaptureManager.h >@@ -29,8 +29,8 @@ > > #include <WebCore/FileHandle.h> > #include <WebCore/FileSystem.h> >-#include <WebCore/URLParser.h> > #include <wtf/Function.h> >+#include <wtf/URLParser.h> > #include <wtf/Vector.h> > #include <wtf/text/WTFString.h> > >@@ -82,7 +82,7 @@ public: > WebCore::FileHandle openCacheFile(const String&, WebCore::FileSystem::FileOpenMode); > > String requestToPath(const WebCore::ResourceRequest&); >- static String urlIdentifyingCommonDomain(const WebCore::URL&); >+ static String urlIdentifyingCommonDomain(const URL&); > > private: > Manager() = default; >@@ -90,7 +90,7 @@ private: > > Resource* findExactMatch(const WebCore::ResourceRequest&); > Resource* findBestFuzzyMatch(const WebCore::ResourceRequest&); >- int fuzzyMatchURLs(const WebCore::URL& requestURL, const WebCore::URLParser::URLEncodedForm& requestParameters, const WebCore::URL& resourceURL, const WebCore::URLParser::URLEncodedForm& resourceParameters); >+ int fuzzyMatchURLs(const URL& requestURL, const WTF::URLParser::URLEncodedForm& requestParameters, const URL& resourceURL, const WTF::URLParser::URLEncodedForm& resourceParameters); > > void loadResources(); > >diff --git a/Source/WebKit/NetworkProcess/capture/NetworkCaptureResource.cpp b/Source/WebKit/NetworkProcess/capture/NetworkCaptureResource.cpp >index 704c0d6ad4f66a0c3cab3baf3e99561d8884f045..f3dc23c570694ef3bbf25bbba32351cd80f74093 100644 >--- a/Source/WebKit/NetworkProcess/capture/NetworkCaptureResource.cpp >+++ b/Source/WebKit/NetworkProcess/capture/NetworkCaptureResource.cpp >@@ -41,7 +41,7 @@ Resource::Resource(const String& eventFilePath) > { > } > >-const WebCore::URL& Resource::url() >+const URL& Resource::url() > { > if (!m_url.isValid()) { > auto events = eventStream(); >@@ -52,8 +52,7 @@ const WebCore::URL& Resource::url() > DEBUG_LOG_ERROR("Event stream does not have a requestSent event: file = " STRING_SPECIFIER, DEBUG_STR(m_eventFilePath)); > else { > auto requestSentEvent = WTF::get<RequestSentEvent>(*event); >- WebCore::URLParser parser(requestSentEvent.request.url); >- m_url = parser.result(); >+ m_url = URL({ }, requestSentEvent.request.url); > } > } > >@@ -68,10 +67,10 @@ const String& Resource::urlIdentifyingCommonDomain() > return m_urlIdentifyingCommonDomain; > } > >-WebCore::URLParser::URLEncodedForm Resource::queryParameters() >+WTF::URLParser::URLEncodedForm Resource::queryParameters() > { > if (!m_queryParameters) >- m_queryParameters = WebCore::URLParser::parseURLEncodedForm(url().query()); >+ m_queryParameters = WTF::URLParser::parseURLEncodedForm(url().query()); > > return *m_queryParameters; > } >diff --git a/Source/WebKit/NetworkProcess/capture/NetworkCaptureResource.h b/Source/WebKit/NetworkProcess/capture/NetworkCaptureResource.h >index 7576c0d5e008489162c18c96604fe3a387f39e5e..d493f4a4a35ad8ea6cdb2dd8e025d690c58925e2 100644 >--- a/Source/WebKit/NetworkProcess/capture/NetworkCaptureResource.h >+++ b/Source/WebKit/NetworkProcess/capture/NetworkCaptureResource.h >@@ -29,9 +29,9 @@ > > #include "NetworkCaptureEvent.h" > #include <WebCore/FileSystem.h> >-#include <WebCore/URL.h> >-#include <WebCore/URLParser.h> > #include <wtf/Optional.h> >+#include <wtf/URL.h> >+#include <wtf/URLParser.h> > > namespace WebKit { > namespace NetworkCapture { >@@ -55,16 +55,16 @@ public: > public: > Resource(const String& eventFilePath); > >- const WebCore::URL& url(); >+ const URL& url(); > const String& urlIdentifyingCommonDomain(); >- WebCore::URLParser::URLEncodedForm queryParameters(); >+ WTF::URLParser::URLEncodedForm queryParameters(); > EventStream eventStream(); > > private: > String m_eventFilePath; >- WebCore::URL m_url; >+ URL m_url; > String m_urlIdentifyingCommonDomain; >- std::optional<WebCore::URLParser::URLEncodedForm> m_queryParameters; >+ std::optional<WTF::URLParser::URLEncodedForm> m_queryParameters; > }; > > } // namespace NetworkCapture >diff --git a/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm b/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm >index 94c26204eeea4bace84c2175ee14e8f006c9de4c..68c1d57593258325805113f36c7e5e4da8afe4cb 100644 >--- a/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm >+++ b/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm >@@ -310,7 +310,7 @@ void NetworkDataTaskCocoa::willPerformHTTPRedirection(WebCore::ResourceResponse& > } > > // Should not set Referer after a redirect from a secure resource to non-secure one. >- if (m_shouldClearReferrerOnHTTPSToHTTPRedirect && !request.url().protocolIs("https") && WebCore::protocolIs(request.httpReferrer(), "https")) >+ if (m_shouldClearReferrerOnHTTPSToHTTPRedirect && !request.url().protocolIs("https") && WTF::protocolIs(request.httpReferrer(), "https")) > request.clearHTTPReferrer(); > > const auto& url = request.url(); >diff --git a/Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm b/Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm >index 7a179d1121d97e540665afad7056850f0f2ef875..71304a7f989e2333df19723fc323c9f84c1ca9ec 100644 >--- a/Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm >+++ b/Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm >@@ -164,7 +164,7 @@ void NetworkProcess::getHostNamesWithHSTSCache(WebCore::NetworkStorageSession& s > void NetworkProcess::deleteHSTSCacheForHostNames(WebCore::NetworkStorageSession& session, const Vector<String>& hostNames) > { > for (auto& hostName : hostNames) { >- auto url = WebCore::URL({ }, makeString("https://", hostName)); >+ auto url = URL({ }, makeString("https://", hostName)); > _CFNetworkResetHSTS(url.createCFURL().get(), session.platformSession()); > } > } >diff --git a/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm b/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm >index 882107c467b86f373c0cfb31c4d1eb798288cf8a..a7c02ae50f8c8e687765a22cb27fc941d6ea41af 100644 >--- a/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm >+++ b/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm >@@ -46,12 +46,12 @@ > #import <WebCore/ResourceRequest.h> > #import <WebCore/ResourceResponse.h> > #import <WebCore/SharedBuffer.h> >-#import <WebCore/URL.h> > #import <WebCore/WebCoreURLResponse.h> > #import <pal/spi/cf/CFNetworkSPI.h> > #import <wtf/MainThread.h> > #import <wtf/NeverDestroyed.h> > #import <wtf/ProcessPrivilege.h> >+#import <wtf/URL.h> > > using namespace WebKit; > >@@ -348,7 +348,7 @@ static NSURLRequest* updateIgnoreStrictTransportSecuritySettingIfNecessary(NSURL > if (credential.persistence() == WebCore::CredentialPersistenceForSession && authenticationChallenge.protectionSpace().isPasswordBased()) { > > WebCore::Credential nonPersistentCredential(credential.user(), credential.password(), WebCore::CredentialPersistenceNone); >- WebCore::URL urlToStore; >+ URL urlToStore; > if (authenticationChallenge.failureResponse().httpStatusCode() == 401) > urlToStore = authenticationChallenge.failureResponse().url(); > if (auto storageSession = WebCore::NetworkStorageSession::storageSession(sessionID)) >diff --git a/Source/WebKit/PluginProcess/mac/PluginProcessMac.mm b/Source/WebKit/PluginProcess/mac/PluginProcessMac.mm >index 402ec1de01962f0ccf4204295723791f7c6572a0..f5cc1c1e0ac6da84292c48b471b08c87bf298eed 100644 >--- a/Source/WebKit/PluginProcess/mac/PluginProcessMac.mm >+++ b/Source/WebKit/PluginProcess/mac/PluginProcessMac.mm >@@ -215,11 +215,11 @@ static void carbonWindowHidden(WindowRef window) > static bool openCFURLRef(CFURLRef url, int32_t& status, CFURLRef* launchedURL) > { > String launchedURLString; >- if (!PluginProcess::singleton().openURL(WebCore::URL(url).string(), status, launchedURLString)) >+ if (!PluginProcess::singleton().openURL(URL(url).string(), status, launchedURLString)) > return false; > > if (!launchedURLString.isNull() && launchedURL) >- *launchedURL = WebCore::URL(WebCore::URL(), launchedURLString).createCFURL().leakRef(); >+ *launchedURL = URL(URL(), launchedURLString).createCFURL().leakRef(); > return true; > } > >@@ -399,7 +399,7 @@ static NSRunningApplication *replacedNSWorkspace_launchApplicationAtURL_options_ > } > } > >- if (PluginProcess::singleton().launchApplicationAtURL(WebCore::URL(url).string(), arguments)) { >+ if (PluginProcess::singleton().launchApplicationAtURL(URL(url).string(), arguments)) { > if (error) > *error = nil; > return nil; >diff --git a/Source/WebKit/Shared/API/APIURL.h b/Source/WebKit/Shared/API/APIURL.h >index 7b01d0e9205628cd3c002ef57ef11e814dcccb91..bbd423bcf5715e4ad70bf52def8c2c30c41bf0f6 100644 >--- a/Source/WebKit/Shared/API/APIURL.h >+++ b/Source/WebKit/Shared/API/APIURL.h >@@ -23,32 +23,31 @@ > * THE POSSIBILITY OF SUCH DAMAGE. > */ > >-#ifndef WebURL_h >-#define WebURL_h >+#pragma once > > #include "APIObject.h" > #include "WebCoreArgumentCoders.h" >-#include <WebCore/URL.h> > #include <wtf/Forward.h> >+#include <wtf/URL.h> > #include <wtf/text/WTFString.h> > > namespace API { > > class URL : public ObjectImpl<Object::Type::URL> { > public: >- static Ref<URL> create(const WTF::String& string) >+ static Ref<API::URL> create(const WTF::String& string) > { > return adoptRef(*new URL(string)); > } > >- static Ref<URL> create(const URL* baseURL, const WTF::String& relativeURL) >+ static Ref<API::URL> create(const API::URL* baseURL, const WTF::String& relativeURL) > { > ASSERT(baseURL); > baseURL->parseURLIfNecessary(); >- auto absoluteURL = std::make_unique<WebCore::URL>(*baseURL->m_parsedURL.get(), relativeURL); >+ auto absoluteURL = std::make_unique<WTF::URL>(*baseURL->m_parsedURL.get(), relativeURL); > const WTF::String& absoluteURLString = absoluteURL->string(); > >- return adoptRef(*new URL(WTFMove(absoluteURL), absoluteURLString)); >+ return adoptRef(*new API::URL(WTFMove(absoluteURL), absoluteURLString)); > } > > bool isNull() const { return m_string.isNull(); } >@@ -56,7 +55,7 @@ public: > > const WTF::String& string() const { return m_string; } > >- static bool equals(const URL& a, const URL& b) >+ static bool equals(const API::URL& a, const API::URL& b) > { > return a.url() == b.url(); > } >@@ -106,13 +105,13 @@ private: > { > } > >- URL(std::unique_ptr<WebCore::URL> parsedURL, const WTF::String& string) >+ URL(std::unique_ptr<WTF::URL> parsedURL, const WTF::String& string) > : m_string(string) > , m_parsedURL(WTFMove(parsedURL)) > { > } > >- const WebCore::URL& url() const >+ const WTF::URL& url() const > { > parseURLIfNecessary(); > return *m_parsedURL; >@@ -122,13 +121,11 @@ private: > { > if (m_parsedURL) > return; >- m_parsedURL = std::make_unique<WebCore::URL>(WebCore::URL(), m_string); >+ m_parsedURL = std::make_unique<WTF::URL>(WTF::URL(), m_string); > } > > WTF::String m_string; >- mutable std::unique_ptr<WebCore::URL> m_parsedURL; >+ mutable std::unique_ptr<WTF::URL> m_parsedURL; > }; > > } // namespace WebKit >- >-#endif // URL_h >diff --git a/Source/WebKit/Shared/API/APIUserContentURLPattern.h b/Source/WebKit/Shared/API/APIUserContentURLPattern.h >index 9b5c7f66b48b8a96bdd2dcbe89ca90a123d306aa..66995a0a88526bac53ab7d1cc59615a320219e33 100644 >--- a/Source/WebKit/Shared/API/APIUserContentURLPattern.h >+++ b/Source/WebKit/Shared/API/APIUserContentURLPattern.h >@@ -27,8 +27,8 @@ > > #include "APIObject.h" > >-#include <WebCore/URL.h> > #include <WebCore/UserContentURLPattern.h> >+#include <wtf/URL.h> > > namespace API { > >@@ -42,7 +42,7 @@ public: > const WTF::String& host() const { return m_pattern.host(); } > const WTF::String& scheme() const { return m_pattern.scheme(); } > bool isValid() const { return m_pattern.isValid(); }; >- bool matchesURL(const WTF::String& url) const { return m_pattern.matches(WebCore::URL({ }, url)); } >+ bool matchesURL(const WTF::String& url) const { return m_pattern.matches(WTF::URL({ }, url)); } > bool matchesSubdomains() const { return m_pattern.matchSubdomains(); } > > const WTF::String& patternString() const { return m_patternString; } >diff --git a/Source/WebKit/Shared/API/c/WKURLRequest.cpp b/Source/WebKit/Shared/API/c/WKURLRequest.cpp >index 736e1f3e6645ce0ec212f6db9f87843d5cd13da5..1499563e39ae7b986de1734767885f6aad928d32 100644 >--- a/Source/WebKit/Shared/API/c/WKURLRequest.cpp >+++ b/Source/WebKit/Shared/API/c/WKURLRequest.cpp >@@ -29,7 +29,7 @@ > #include "APIURLRequest.h" > #include "WKAPICast.h" > #include "WKData.h" >-#include <WebCore/URL.h> >+#include <wtf/URL.h> > > using namespace WebCore; > using namespace WebKit; >diff --git a/Source/WebKit/Shared/API/c/WKURLResponse.cpp b/Source/WebKit/Shared/API/c/WKURLResponse.cpp >index b8a8a90bcd3c345cd4756527731432cfca017c87..8f1fa9ad6e36e98ac413eba9ef9553cad40638cf 100644 >--- a/Source/WebKit/Shared/API/c/WKURLResponse.cpp >+++ b/Source/WebKit/Shared/API/c/WKURLResponse.cpp >@@ -28,7 +28,7 @@ > > #include "APIURLResponse.h" > #include "WKAPICast.h" >-#include <WebCore/URL.h> >+#include <wtf/URL.h> > > using namespace WebKit; > >diff --git a/Source/WebKit/Shared/API/c/cf/WKURLCF.mm b/Source/WebKit/Shared/API/c/cf/WKURLCF.mm >index df1983a60150dd7eadbae83d38828abaa780e0ae..bd91a45b09c314eff363051ccb8815bdcbb6db89 100644 >--- a/Source/WebKit/Shared/API/c/cf/WKURLCF.mm >+++ b/Source/WebKit/Shared/API/c/cf/WKURLCF.mm >@@ -28,8 +28,8 @@ > > #import "WKAPICast.h" > #import "WKNSURL.h" >-#import <WebCore/CFURLExtras.h> > #import <objc/runtime.h> >+#import <wtf/cf/CFURLExtras.h> > #import <wtf/text/CString.h> > > #if WK_API_ENABLED >@@ -56,7 +56,7 @@ WKURLRef WKURLCreateWithCFURL(CFURLRef cfURL) > #endif > > CString urlBytes; >- WebCore::getURLBytes(cfURL, urlBytes); >+ WTF::getURLBytes(cfURL, urlBytes); > > return WebKit::toCopiedURLAPI(urlBytes.data()); > } >@@ -69,5 +69,5 @@ CFURLRef WKURLCopyCFURL(CFAllocatorRef allocatorRef, WKURLRef URLRef) > // UTF-8 which uses less memory and is what WebKit clients might expect. > > CString buffer = WebKit::toImpl(URLRef)->string().utf8(); >- return WebCore::createCFURLFromBuffer(buffer.data(), buffer.length(), 0).leakRef(); >+ return WTF::createCFURLFromBuffer(buffer.data(), buffer.length(), 0).leakRef(); > } >diff --git a/Source/WebKit/Shared/API/glib/WebKitURIRequest.cpp b/Source/WebKit/Shared/API/glib/WebKitURIRequest.cpp >index 9fe5957204cc7993ebc08888bd1f8931ea4eb001..31f61ce7eaf8b9a99cbaad7dd05375da81a25bc4 100644 >--- a/Source/WebKit/Shared/API/glib/WebKitURIRequest.cpp >+++ b/Source/WebKit/Shared/API/glib/WebKitURIRequest.cpp >@@ -21,8 +21,8 @@ > #include "WebKitURIRequest.h" > > #include "WebKitURIRequestPrivate.h" >-#include <WebCore/GUniquePtrSoup.h> > #include <glib/gi18n-lib.h> >+#include <wtf/glib/GUniquePtrSoup.h> > #include <wtf/glib/WTFGType.h> > #include <wtf/text/CString.h> > >diff --git a/Source/WebKit/Shared/API/glib/WebKitURIResponse.cpp b/Source/WebKit/Shared/API/glib/WebKitURIResponse.cpp >index d24558936cf4607555712a16c94fd461ec098a23..287eefd4d9ccf4003673de97b88d3c2d63c2340b 100644 >--- a/Source/WebKit/Shared/API/glib/WebKitURIResponse.cpp >+++ b/Source/WebKit/Shared/API/glib/WebKitURIResponse.cpp >@@ -21,8 +21,8 @@ > #include "WebKitURIResponse.h" > > #include "WebKitURIResponsePrivate.h" >-#include <WebCore/GUniquePtrSoup.h> > #include <glib/gi18n-lib.h> >+#include <wtf/glib/GUniquePtrSoup.h> > #include <wtf/glib/WTFGType.h> > #include <wtf/text/CString.h> > >diff --git a/Source/WebKit/Shared/APIWebArchiveResource.mm b/Source/WebKit/Shared/APIWebArchiveResource.mm >index dc0f90f0f3851abf100484ba573ae4af8e80b232..bc2fe49e30aa382b423b54db2bad72bb7f97ee78 100644 >--- a/Source/WebKit/Shared/APIWebArchiveResource.mm >+++ b/Source/WebKit/Shared/APIWebArchiveResource.mm >@@ -30,8 +30,8 @@ > > #include "APIData.h" > #include <WebCore/ArchiveResource.h> >-#include <WebCore/URL.h> > #include <wtf/RetainPtr.h> >+#include <wtf/URL.h> > > namespace API { > using namespace WebCore; >@@ -46,8 +46,8 @@ Ref<WebArchiveResource> WebArchiveResource::create(RefPtr<ArchiveResource>&& arc > return adoptRef(*new WebArchiveResource(WTFMove(archiveResource))); > } > >-WebArchiveResource::WebArchiveResource(API::Data* data, const String& URL, const String& MIMEType, const String& textEncoding) >- : m_archiveResource(ArchiveResource::create(SharedBuffer::create(data->bytes(), data->size()), WebCore::URL(WebCore::URL(), URL), MIMEType, textEncoding, String())) >+WebArchiveResource::WebArchiveResource(API::Data* data, const String& url, const String& MIMEType, const String& textEncoding) >+ : m_archiveResource(ArchiveResource::create(SharedBuffer::create(data->bytes(), data->size()), WTF::URL(WTF::URL(), url), MIMEType, textEncoding, String())) > { > } > >diff --git a/Source/WebKit/Shared/AssistedNodeInformation.h b/Source/WebKit/Shared/AssistedNodeInformation.h >index 96a00a57b3bb60d3fb8f187e3465ac9d9a201ec9..9b1c3b0145f83f794851774e96b8586ae72d8d19 100644 >--- a/Source/WebKit/Shared/AssistedNodeInformation.h >+++ b/Source/WebKit/Shared/AssistedNodeInformation.h >@@ -32,7 +32,7 @@ > #include <WebCore/GraphicsLayer.h> > #include <WebCore/InputMode.h> > #include <WebCore/IntRect.h> >-#include <WebCore/URL.h> >+#include <wtf/URL.h> > #include <wtf/text/WTFString.h> > > namespace WebKit { >@@ -123,7 +123,7 @@ struct AssistedNodeInformation { > bool acceptsAutofilledLoginCredentials { false }; > bool isAutofillableUsernameField { false }; > bool elementIsTransparent { false }; >- WebCore::URL representingPageURL; >+ URL representingPageURL; > WebCore::AutofillFieldName autofillFieldName { WebCore::AutofillFieldName::None }; > String placeholder; > String label; >diff --git a/Source/WebKit/Shared/Cocoa/WKNSURLExtras.mm b/Source/WebKit/Shared/Cocoa/WKNSURLExtras.mm >index 0188f747982a940a48ab86f8288aab006dfd11d7..519b9d83ed7661dc6d87d629e7c8c855b0ef2bbb 100644 >--- a/Source/WebKit/Shared/Cocoa/WKNSURLExtras.mm >+++ b/Source/WebKit/Shared/Cocoa/WKNSURLExtras.mm >@@ -26,13 +26,11 @@ > #import "config.h" > #import "WKNSURLExtras.h" > >-#import <WebCore/CFURLExtras.h> >-#import <WebCore/URL.h> >+#import <wtf/URL.h> >+#import <wtf/cf/CFURLExtras.h> > #import <wtf/text/CString.h> > #import <wtf/text/WTFString.h> > >-using namespace WebCore; >- > @implementation NSURL (WKExtras) > > + (instancetype)_web_URLWithWTFString:(const String&)string >@@ -50,7 +48,7 @@ using namespace WebCore; > - (String)_web_originalDataAsWTFString > { > CString originalData; >- getURLBytes((__bridge CFURLRef)self, originalData); >+ WTF::getURLBytes((__bridge CFURLRef)self, originalData); > return String::fromUTF8(originalData); > } > >diff --git a/Source/WebKit/Shared/SessionState.h b/Source/WebKit/Shared/SessionState.h >index 5b07d44f6c074c093d694990871be4cc2e6b0cc9..fe81a5d80955ece5d2c625f896962ea9e6c336bd 100644 >--- a/Source/WebKit/Shared/SessionState.h >+++ b/Source/WebKit/Shared/SessionState.h >@@ -34,8 +34,8 @@ > #include <WebCore/FrameLoaderTypes.h> > #include <WebCore/IntRect.h> > #include <WebCore/SerializedScriptValue.h> >-#include <WebCore/URL.h> > #include <wtf/Optional.h> >+#include <wtf/URL.h> > #include <wtf/Vector.h> > #include <wtf/text/WTFString.h> > >@@ -148,7 +148,7 @@ struct BackForwardListState { > struct SessionState { > BackForwardListState backForwardListState; > uint64_t renderTreeSize; >- WebCore::URL provisionalURL; >+ URL provisionalURL; > }; > > } // namespace WebKit >diff --git a/Source/WebKit/Shared/WebBackForwardListItem.cpp b/Source/WebKit/Shared/WebBackForwardListItem.cpp >index a6662369e79ff6419aa84fa33962272d05494908..e18125f6d01e11ab410f6926be504c76fb5f575e 100644 >--- a/Source/WebKit/Shared/WebBackForwardListItem.cpp >+++ b/Source/WebKit/Shared/WebBackForwardListItem.cpp >@@ -29,8 +29,8 @@ > #include "SuspendedPageProxy.h" > #include "WebProcessPool.h" > #include "WebProcessProxy.h" >-#include <WebCore/URL.h> > #include <wtf/DebugUtilities.h> >+#include <wtf/URL.h> > > using namespace WebCore; > >@@ -108,8 +108,8 @@ bool WebBackForwardListItem::itemIsInSameDocument(const WebBackForwardListItem& > if (mainFrameState.stateObjectData || otherMainFrameState.stateObjectData) > return mainFrameState.documentSequenceNumber == otherMainFrameState.documentSequenceNumber; > >- WebCore::URL url = WebCore::URL({ }, mainFrameState.urlString); >- WebCore::URL otherURL = WebCore::URL({ }, otherMainFrameState.urlString); >+ URL url = URL({ }, mainFrameState.urlString); >+ URL otherURL = URL({ }, otherMainFrameState.urlString); > > if ((url.hasFragmentIdentifier() || otherURL.hasFragmentIdentifier()) && equalIgnoringFragmentIdentifier(url, otherURL)) > return mainFrameState.documentSequenceNumber == otherMainFrameState.documentSequenceNumber; >diff --git a/Source/WebKit/Shared/WebCoreArgumentCoders.cpp b/Source/WebKit/Shared/WebCoreArgumentCoders.cpp >index 96aa4e9726669b61bf439483ddaeafb8d5305390..66ffe9194b047e1cf5e608a297fae52f28892340 100644 >--- a/Source/WebKit/Shared/WebCoreArgumentCoders.cpp >+++ b/Source/WebKit/Shared/WebCoreArgumentCoders.cpp >@@ -79,11 +79,11 @@ > #include <WebCore/TextIndicator.h> > #include <WebCore/TimingFunction.h> > #include <WebCore/TransformationMatrix.h> >-#include <WebCore/URL.h> > #include <WebCore/UserStyleSheet.h> > #include <WebCore/ViewportArguments.h> > #include <WebCore/WindowFeatures.h> > #include <pal/SessionID.h> >+#include <wtf/URL.h> > #include <wtf/text/CString.h> > #include <wtf/text/StringHash.h> > >diff --git a/Source/WebKit/Shared/WebCoreArgumentCoders.h b/Source/WebKit/Shared/WebCoreArgumentCoders.h >index 0909b4d19ca0895c54305f5f54cda0c0493a8831..3a3ea994910869f57ca2886f9f7dd5c48e799038 100644 >--- a/Source/WebKit/Shared/WebCoreArgumentCoders.h >+++ b/Source/WebKit/Shared/WebCoreArgumentCoders.h >@@ -96,7 +96,6 @@ class StickyPositionViewportConstraints; > class TextCheckingRequestData; > class TransformationMatrix; > class UserStyleSheet; >-class URL; > > struct CacheQueryOptions; > struct CompositionUnderline; >diff --git a/Source/WebKit/Shared/WebErrors.h b/Source/WebKit/Shared/WebErrors.h >index 27d14e31b310866c6f136e3ad8aaff88e23b3842..7d600c6d23b55dcc39630990407ce744446cb486 100644 >--- a/Source/WebKit/Shared/WebErrors.h >+++ b/Source/WebKit/Shared/WebErrors.h >@@ -28,7 +28,6 @@ > #include <wtf/Forward.h> > > namespace WebCore { >-class URL; > class ResourceError; > class ResourceRequest; > class ResourceResponse; >@@ -48,18 +47,18 @@ WebCore::ResourceError blockedByContentFilterError(const WebCore::ResourceReques > WebCore::ResourceError cannotShowMIMETypeError(const WebCore::ResourceResponse&); > WebCore::ResourceError fileDoesNotExistError(const WebCore::ResourceResponse&); > WebCore::ResourceError pluginWillHandleLoadError(const WebCore::ResourceResponse&); >-WebCore::ResourceError internalError(const WebCore::URL&); >+WebCore::ResourceError internalError(const URL&); > > #if USE(SOUP) >-WebCore::ResourceError downloadNetworkError(const WebCore::URL&, const WTF::String&); >+WebCore::ResourceError downloadNetworkError(const URL&, const WTF::String&); > WebCore::ResourceError downloadCancelledByUserError(const WebCore::ResourceResponse&); > WebCore::ResourceError downloadDestinationError(const WebCore::ResourceResponse&, const WTF::String&); > #endif > > #if PLATFORM(GTK) >-WebCore::ResourceError printError(const WebCore::URL&, const WTF::String&); >-WebCore::ResourceError printerNotFoundError(const WebCore::URL&); >-WebCore::ResourceError invalidPageRangeToPrint(const WebCore::URL&); >+WebCore::ResourceError printError(const URL&, const WTF::String&); >+WebCore::ResourceError printerNotFoundError(const URL&); >+WebCore::ResourceError invalidPageRangeToPrint(const URL&); > #endif > > } // namespace WebKit >diff --git a/Source/WebKit/Shared/WebHitTestResultData.cpp b/Source/WebKit/Shared/WebHitTestResultData.cpp >index 179ca4be37bed0e3dccb5d3263f3f069b052555b..c1cfccf05f8420ac3b9c24dc57f985f722637c64 100644 >--- a/Source/WebKit/Shared/WebHitTestResultData.cpp >+++ b/Source/WebKit/Shared/WebHitTestResultData.cpp >@@ -28,7 +28,7 @@ > #include <WebCore/Node.h> > #include <WebCore/RenderObject.h> > #include <WebCore/SharedBuffer.h> >-#include <WebCore/URL.h> >+#include <wtf/URL.h> > #include <wtf/text/WTFString.h> > > using namespace WebCore; >diff --git a/Source/WebKit/Shared/cf/ArgumentCodersCF.cpp b/Source/WebKit/Shared/cf/ArgumentCodersCF.cpp >index 10e71581d49073f8a3353f9670b711508e398e98..f8f7296486ae97aaf8e9635ce2cd7a2c4b8fe1fc 100644 >--- a/Source/WebKit/Shared/cf/ArgumentCodersCF.cpp >+++ b/Source/WebKit/Shared/cf/ArgumentCodersCF.cpp >@@ -31,9 +31,9 @@ > #include "DataReference.h" > #include "Decoder.h" > #include "Encoder.h" >-#include <WebCore/CFURLExtras.h> > #include <wtf/ProcessPrivilege.h> > #include <wtf/Vector.h> >+#include <wtf/cf/CFURLExtras.h> > #include <wtf/spi/cocoa/SecuritySPI.h> > > #if USE(FOUNDATION) >@@ -599,8 +599,8 @@ void encode(Encoder& encoder, CFURLRef url) > if (baseURL) > encode(encoder, baseURL); > >- URLCharBuffer urlBytes; >- getURLBytes(url, urlBytes); >+ WTF::URLCharBuffer urlBytes; >+ WTF::getURLBytes(url, urlBytes); > IPC::DataReference dataReference(reinterpret_cast<const uint8_t*>(urlBytes.data()), urlBytes.size()); > encoder << dataReference; > } >@@ -631,7 +631,7 @@ bool decode(Decoder& decoder, RetainPtr<CFURLRef>& result) > } > #endif > >- result = createCFURLFromBuffer(reinterpret_cast<const char*>(urlBytes.data()), urlBytes.size(), baseURL.get()); >+ result = WTF::createCFURLFromBuffer(reinterpret_cast<const char*>(urlBytes.data()), urlBytes.size(), baseURL.get()); > return result; > } > >diff --git a/Source/WebKit/Shared/gtk/WebErrorsGtk.cpp b/Source/WebKit/Shared/gtk/WebErrorsGtk.cpp >index e9d92393c7d5c6b3abf3f9f44a07f41a008460e8..6a0df54c37445df64cc5d3b4bb610ec1f3c065f0 100644 >--- a/Source/WebKit/Shared/gtk/WebErrorsGtk.cpp >+++ b/Source/WebKit/Shared/gtk/WebErrorsGtk.cpp >@@ -27,8 +27,8 @@ > #include "WebErrors.h" > > #include "APIError.h" >-#include <WebCore/URL.h> > #include <glib/gi18n-lib.h> >+#include <wtf/URL.h> > > namespace WebKit { > using namespace WebCore; >diff --git a/Source/WebKit/Shared/ios/InteractionInformationAtPosition.h b/Source/WebKit/Shared/ios/InteractionInformationAtPosition.h >index cee0f262b1cbef986cdd3a34a4ac75545a2c6040..4a30abfe2ea11fc2000a819fddf12ed423d08551 100644 >--- a/Source/WebKit/Shared/ios/InteractionInformationAtPosition.h >+++ b/Source/WebKit/Shared/ios/InteractionInformationAtPosition.h >@@ -33,7 +33,7 @@ > #include <WebCore/IntPoint.h> > #include <WebCore/SelectionRect.h> > #include <WebCore/TextIndicator.h> >-#include <WebCore/URL.h> >+#include <wtf/URL.h> > #include <wtf/text/WTFString.h> > > namespace WebKit { >@@ -60,8 +60,8 @@ struct InteractionInformationAtPosition { > bool preventTextInteraction { false }; > #endif > WebCore::FloatPoint adjustedPointForNodeRespondingToClickEvents; >- WebCore::URL url; >- WebCore::URL imageURL; >+ URL url; >+ URL imageURL; > String title; > String idAttribute; > WebCore::IntRect bounds; >diff --git a/Source/WebKit/UIProcess/API/APIHTTPCookieStore.h b/Source/WebKit/UIProcess/API/APIHTTPCookieStore.h >index bb0d1cb63d41f2e7bc36ba9f5d5dae5e40811592..90fde7d04b27305a46436141bdb77e1004bdd051 100644 >--- a/Source/WebKit/UIProcess/API/APIHTTPCookieStore.h >+++ b/Source/WebKit/UIProcess/API/APIHTTPCookieStore.h >@@ -33,7 +33,6 @@ > #include <wtf/HashSet.h> > > namespace WebCore { >-class URL; > struct Cookie; > } > >diff --git a/Source/WebKit/UIProcess/API/APINavigation.cpp b/Source/WebKit/UIProcess/API/APINavigation.cpp >index f5fa3a5d7623c4c9ac6b7aa309371d3d5cb4f26d..2754e794f25053832d5d267e120abf0741e47a9c 100644 >--- a/Source/WebKit/UIProcess/API/APINavigation.cpp >+++ b/Source/WebKit/UIProcess/API/APINavigation.cpp >@@ -76,7 +76,7 @@ void Navigation::setCurrentRequest(ResourceRequest&& request, ProcessIdentifier > m_currentRequestProcessIdentifier = processIdentifier; > } > >-void Navigation::appendRedirectionURL(const WebCore::URL& url) >+void Navigation::appendRedirectionURL(const WTF::URL& url) > { > if (m_redirectChain.isEmpty() || m_redirectChain.last() != url) > m_redirectChain.append(url); >diff --git a/Source/WebKit/UIProcess/API/APINavigation.h b/Source/WebKit/UIProcess/API/APINavigation.h >index 13bd1f44252da1f377f6e64e048f9de0533c625f..a9f62283f65852fe912e7d606dac0a3f98329714 100644 >--- a/Source/WebKit/UIProcess/API/APINavigation.h >+++ b/Source/WebKit/UIProcess/API/APINavigation.h >@@ -102,8 +102,8 @@ public: > WebKit::WebBackForwardListItem* fromItem() const { return m_fromItem.get(); } > std::optional<WebCore::FrameLoadType> backForwardFrameLoadType() const { return m_backForwardFrameLoadType; } > >- void appendRedirectionURL(const WebCore::URL&); >- Vector<WebCore::URL> takeRedirectChain() { return WTFMove(m_redirectChain); } >+ void appendRedirectionURL(const WTF::URL&); >+ Vector<WTF::URL> takeRedirectChain() { return WTFMove(m_redirectChain); } > > bool wasUserInitiated() const { return !!m_lastNavigationAction.userGestureTokenIdentifier; } > >@@ -152,7 +152,7 @@ private: > WebCore::ResourceRequest m_originalRequest; > WebCore::ResourceRequest m_currentRequest; > std::optional<WebCore::ProcessIdentifier> m_currentRequestProcessIdentifier; >- Vector<WebCore::URL> m_redirectChain; >+ Vector<WTF::URL> m_redirectChain; > > RefPtr<WebKit::WebBackForwardListItem> m_targetItem; > RefPtr<WebKit::WebBackForwardListItem> m_fromItem; >diff --git a/Source/WebKit/UIProcess/API/APINavigationAction.h b/Source/WebKit/UIProcess/API/APINavigationAction.h >index eecbff4a2a3ed90f44408ccd6caf29de98d952d7..30871c7a09554d5cb8a7ed4ab82cbb148cde7874 100644 >--- a/Source/WebKit/UIProcess/API/APINavigationAction.h >+++ b/Source/WebKit/UIProcess/API/APINavigationAction.h >@@ -31,7 +31,7 @@ > #include "APIUserInitiatedAction.h" > #include "NavigationActionData.h" > #include <WebCore/ResourceRequest.h> >-#include <WebCore/URL.h> >+#include <wtf/URL.h> > > namespace API { > >@@ -47,7 +47,7 @@ public: > std::optional<WTF::String> targetFrameName() const { return m_targetFrameName; } > > const WebCore::ResourceRequest& request() const { return m_request; } >- const WebCore::URL& originalURL() const { return !m_originalURL.isNull() ? m_originalURL : m_request.url(); } >+ const WTF::URL& originalURL() const { return !m_originalURL.isNull() ? m_originalURL : m_request.url(); } > > WebCore::NavigationType navigationType() const { return m_navigationActionData.navigationType; } > WebKit::WebEvent::Modifiers modifiers() const { return m_navigationActionData.modifiers; } >@@ -66,7 +66,7 @@ public: > Navigation* mainFrameNavigation() const { return m_mainFrameNavigation.get(); } > > private: >- NavigationAction(WebKit::NavigationActionData&& navigationActionData, API::FrameInfo* sourceFrame, API::FrameInfo* targetFrame, std::optional<WTF::String> targetFrameName, WebCore::ResourceRequest&& request, const WebCore::URL& originalURL, bool shouldOpenAppLinks, RefPtr<UserInitiatedAction>&& userInitiatedAction, API::Navigation* mainFrameNavigation) >+ NavigationAction(WebKit::NavigationActionData&& navigationActionData, API::FrameInfo* sourceFrame, API::FrameInfo* targetFrame, std::optional<WTF::String> targetFrameName, WebCore::ResourceRequest&& request, const WTF::URL& originalURL, bool shouldOpenAppLinks, RefPtr<UserInitiatedAction>&& userInitiatedAction, API::Navigation* mainFrameNavigation) > : m_sourceFrame(sourceFrame) > , m_targetFrame(targetFrame) > , m_targetFrameName(targetFrameName) >@@ -79,7 +79,7 @@ private: > { > } > >- NavigationAction(WebKit::NavigationActionData&& navigationActionData, API::FrameInfo* sourceFrame, API::FrameInfo* targetFrame, std::optional<WTF::String> targetFrameName, WebCore::ResourceRequest&& request, const WebCore::URL& originalURL, bool shouldOpenAppLinks, RefPtr<UserInitiatedAction>&& userInitiatedAction) >+ NavigationAction(WebKit::NavigationActionData&& navigationActionData, API::FrameInfo* sourceFrame, API::FrameInfo* targetFrame, std::optional<WTF::String> targetFrameName, WebCore::ResourceRequest&& request, const WTF::URL& originalURL, bool shouldOpenAppLinks, RefPtr<UserInitiatedAction>&& userInitiatedAction) > : NavigationAction(WTFMove(navigationActionData), sourceFrame, targetFrame, targetFrameName, WTFMove(request), originalURL, shouldOpenAppLinks, WTFMove(userInitiatedAction), nullptr) > { > } >@@ -89,7 +89,7 @@ private: > std::optional<WTF::String> m_targetFrameName; > > WebCore::ResourceRequest m_request; >- WebCore::URL m_originalURL; >+ WTF::URL m_originalURL; > > bool m_shouldOpenAppLinks; > >diff --git a/Source/WebKit/UIProcess/API/APINavigationClient.h b/Source/WebKit/UIProcess/API/APINavigationClient.h >index c3d1abfdde826ae8ee5cb72abf7e19614c508f9a..ccf86d61e01b9a53c6ff4b479c7c0e7aafdf0c9a 100644 >--- a/Source/WebKit/UIProcess/API/APINavigationClient.h >+++ b/Source/WebKit/UIProcess/API/APINavigationClient.h >@@ -98,7 +98,7 @@ public: > > virtual RefPtr<Data> webCryptoMasterKey(WebKit::WebPageProxy&) { return nullptr; } > >- virtual RefPtr<String> signedPublicKeyAndChallengeString(WebKit::WebPageProxy&, unsigned keySizeIndex, const RefPtr<String>& challengeString, const WebCore::URL&) { return nullptr; } >+ virtual RefPtr<String> signedPublicKeyAndChallengeString(WebKit::WebPageProxy&, unsigned keySizeIndex, const RefPtr<String>& challengeString, const WTF::URL&) { return nullptr; } > > #if USE(QUICK_LOOK) > virtual void didStartLoadForQuickLookDocumentInMainFrame(const WTF::String& fileName, const WTF::String& uti) { } >@@ -115,7 +115,7 @@ public: > listener->use(); > } > >- virtual void contentRuleListNotification(WebKit::WebPageProxy&, WebCore::URL&&, Vector<WTF::String>&&, Vector<WTF::String>&&) { }; >+ virtual void contentRuleListNotification(WebKit::WebPageProxy&, WTF::URL&&, Vector<WTF::String>&&, Vector<WTF::String>&&) { }; > > #if ENABLE(NETSCAPE_PLUGIN_API) > virtual bool didFailToInitializePlugIn(WebKit::WebPageProxy&, API::Dictionary&) { return false; } >@@ -127,8 +127,8 @@ public: > #endif > > #if ENABLE(WEBGL) >- virtual void webGLLoadPolicy(WebKit::WebPageProxy&, const WebCore::URL&, CompletionHandler<void(WebCore::WebGLLoadPolicy)>&& completionHandler) const { completionHandler(WebCore::WebGLLoadPolicy::WebGLAllowCreation); } >- virtual void resolveWebGLLoadPolicy(WebKit::WebPageProxy&, const WebCore::URL&, CompletionHandler<void(WebCore::WebGLLoadPolicy)>&& completionHandler) const { completionHandler(WebCore::WebGLLoadPolicy::WebGLAllowCreation); } >+ virtual void webGLLoadPolicy(WebKit::WebPageProxy&, const WTF::URL&, CompletionHandler<void(WebCore::WebGLLoadPolicy)>&& completionHandler) const { completionHandler(WebCore::WebGLLoadPolicy::WebGLAllowCreation); } >+ virtual void resolveWebGLLoadPolicy(WebKit::WebPageProxy&, const WTF::URL&, CompletionHandler<void(WebCore::WebGLLoadPolicy)>&& completionHandler) const { completionHandler(WebCore::WebGLLoadPolicy::WebGLAllowCreation); } > #endif > > virtual bool willGoToBackForwardListItem(WebKit::WebPageProxy&, WebKit::WebBackForwardListItem&, bool inPageCache) { return false; } >diff --git a/Source/WebKit/UIProcess/API/APIUIClient.h b/Source/WebKit/UIProcess/API/APIUIClient.h >index 5bee6bc2eea3f742ce5ab1502476a16861e2b271..1d35272c9c2d41d37811e25875eba83dc1c15428 100644 >--- a/Source/WebKit/UIProcess/API/APIUIClient.h >+++ b/Source/WebKit/UIProcess/API/APIUIClient.h >@@ -144,7 +144,7 @@ public: > virtual bool canRunModal() const { return false; } > virtual void runModal(WebKit::WebPageProxy&) { } > >- virtual void saveDataToFileInDownloadsFolder(WebKit::WebPageProxy*, const WTF::String&, const WTF::String&, const WebCore::URL&, Data&) { } >+ virtual void saveDataToFileInDownloadsFolder(WebKit::WebPageProxy*, const WTF::String&, const WTF::String&, const WTF::URL&, Data&) { } > > virtual void pinnedStateDidChange(WebKit::WebPageProxy&) { } > >diff --git a/Source/WebKit/UIProcess/API/APIUserScript.cpp b/Source/WebKit/UIProcess/API/APIUserScript.cpp >index 7584e6312102b5b0c5007ea9b88cac783b9e146c..4022efdcb97a509f6e0ef895dcb673866aa9f56f 100644 >--- a/Source/WebKit/UIProcess/API/APIUserScript.cpp >+++ b/Source/WebKit/UIProcess/API/APIUserScript.cpp >@@ -30,7 +30,7 @@ > > namespace API { > >-WebCore::URL UserScript::generateUniqueURL() >+WTF::URL UserScript::generateUniqueURL() > { > static uint64_t identifier; > >diff --git a/Source/WebKit/UIProcess/API/APIUserScript.h b/Source/WebKit/UIProcess/API/APIUserScript.h >index 17a40909897f744b505a0492ac508c4050b131c5..03332820b16011491403618b637f33da814b18a3 100644 >--- a/Source/WebKit/UIProcess/API/APIUserScript.h >+++ b/Source/WebKit/UIProcess/API/APIUserScript.h >@@ -23,8 +23,7 @@ > * THE POSSIBILITY OF SUCH DAMAGE. > */ > >-#ifndef APIUserScript_h >-#define APIUserScript_h >+#pragma once > > #include "APIObject.h" > #include "APIUserContentWorld.h" >@@ -35,7 +34,7 @@ namespace API { > > class UserScript final : public ObjectImpl<Object::Type::UserScript>, public Identified<UserScript> { > public: >- static WebCore::URL generateUniqueURL(); >+ static WTF::URL generateUniqueURL(); > > static Ref<UserScript> create(WebCore::UserScript userScript, API::UserContentWorld& world) > { >@@ -55,5 +54,3 @@ private: > }; > > } // namespace API >- >-#endif // APIUserScript_h >diff --git a/Source/WebKit/UIProcess/API/APIUserStyleSheet.cpp b/Source/WebKit/UIProcess/API/APIUserStyleSheet.cpp >index 1d595bb1588d9f7d5d48fd921cd1dd966b3f86af..3ea461fe1a156c6a9d589584037fe387c2907f08 100644 >--- a/Source/WebKit/UIProcess/API/APIUserStyleSheet.cpp >+++ b/Source/WebKit/UIProcess/API/APIUserStyleSheet.cpp >@@ -30,7 +30,7 @@ > > namespace API { > >-WebCore::URL UserStyleSheet::generateUniqueURL() >+WTF::URL UserStyleSheet::generateUniqueURL() > { > static uint64_t identifier; > >diff --git a/Source/WebKit/UIProcess/API/APIUserStyleSheet.h b/Source/WebKit/UIProcess/API/APIUserStyleSheet.h >index d856f7a52f9b504e0fa423ea9a3b6e1571451ede..75bb95afeac8f8f1e822335f293e98387b5d7638 100644 >--- a/Source/WebKit/UIProcess/API/APIUserStyleSheet.h >+++ b/Source/WebKit/UIProcess/API/APIUserStyleSheet.h >@@ -23,8 +23,7 @@ > * THE POSSIBILITY OF SUCH DAMAGE. > */ > >-#ifndef APIUserStyleSheet_h >-#define APIUserStyleSheet_h >+#pragma once > > #include "APIObject.h" > #include "APIUserContentWorld.h" >@@ -35,7 +34,7 @@ namespace API { > > class UserStyleSheet final : public ObjectImpl<Object::Type::UserStyleSheet>, public Identified<UserStyleSheet> { > public: >- static WebCore::URL generateUniqueURL(); >+ static WTF::URL generateUniqueURL(); > > static Ref<UserStyleSheet> create(WebCore::UserStyleSheet userStyleSheet, API::UserContentWorld& world) > { >@@ -55,5 +54,3 @@ private: > }; > > } // namespace API >- >-#endif // APIUserStyleSheet_h >diff --git a/Source/WebKit/UIProcess/API/C/WKOpenPanelResultListener.cpp b/Source/WebKit/UIProcess/API/C/WKOpenPanelResultListener.cpp >index 6e79662552b9f680520294ebb9d74ebabd832650..4a0ffc42e5941c306bcffbf88ce15acc7099b5ce 100644 >--- a/Source/WebKit/UIProcess/API/C/WKOpenPanelResultListener.cpp >+++ b/Source/WebKit/UIProcess/API/C/WKOpenPanelResultListener.cpp >@@ -29,7 +29,7 @@ > #include "APIArray.h" > #include "WKAPICast.h" > #include "WebOpenPanelResultListenerProxy.h" >-#include <WebCore/URL.h> >+#include <wtf/URL.h> > > using namespace WebKit; > >@@ -48,7 +48,7 @@ static Vector<String> filePathsFromFileURLs(const API::Array& fileURLs) > for (size_t i = 0; i < size; ++i) { > API::URL* apiURL = fileURLs.at<API::URL>(i); > if (apiURL) >- filePaths.uncheckedAppend(WebCore::URL(WebCore::URL(), apiURL->string()).fileSystemPath()); >+ filePaths.uncheckedAppend(URL(URL(), apiURL->string()).fileSystemPath()); > } > > return filePaths; >diff --git a/Source/WebKit/UIProcess/API/C/WKPage.cpp b/Source/WebKit/UIProcess/API/C/WKPage.cpp >index dde36bc4905d682d05f28483482d9daf252d65f9..4897f52c1f62d1702ba86abe50f797fc4be8d71d 100644 >--- a/Source/WebKit/UIProcess/API/C/WKPage.cpp >+++ b/Source/WebKit/UIProcess/API/C/WKPage.cpp >@@ -249,7 +249,7 @@ void WKPageLoadPlainTextString(WKPageRef pageRef, WKStringRef plainTextStringRef > > void WKPageLoadPlainTextStringWithUserData(WKPageRef pageRef, WKStringRef plainTextStringRef, WKTypeRef userDataRef) > { >- loadString(pageRef, plainTextStringRef, "text/plain"_s, blankURL().string(), userDataRef); >+ loadString(pageRef, plainTextStringRef, "text/plain"_s, WTF::blankURL().string(), userDataRef); > } > > void WKPageLoadWebArchiveData(WKPageRef pageRef, WKDataRef webArchiveDataRef) >@@ -1473,7 +1473,7 @@ void WKPageSetPageUIClient(WKPageRef pageRef, const WKPageUIClientBase* wkClient > > auto userInitiatedActivity = page.process().userInitiatedActivity(navigationActionData.userGestureTokenIdentifier); > bool shouldOpenAppLinks = !hostsAreEqual(sourceFrameInfo->request().url(), resourceRequest.url()); >- auto apiNavigationAction = API::NavigationAction::create(WTFMove(navigationActionData), sourceFrameInfo.ptr(), nullptr, std::nullopt, WTFMove(resourceRequest), WebCore::URL(), shouldOpenAppLinks, WTFMove(userInitiatedActivity)); >+ auto apiNavigationAction = API::NavigationAction::create(WTFMove(navigationActionData), sourceFrameInfo.ptr(), nullptr, std::nullopt, WTFMove(resourceRequest), URL(), shouldOpenAppLinks, WTFMove(userInitiatedActivity)); > > auto apiWindowFeatures = API::WindowFeatures::create(windowFeatures); > >@@ -1945,7 +1945,7 @@ void WKPageSetPageUIClient(WKPageRef pageRef, const WKPageUIClientBase* wkClient > m_client.runModal(toAPI(&page), m_client.base.clientInfo); > } > >- void saveDataToFileInDownloadsFolder(WebPageProxy* page, const String& suggestedFilename, const String& mimeType, const WebCore::URL& originatingURL, API::Data& data) final >+ void saveDataToFileInDownloadsFolder(WebPageProxy* page, const String& suggestedFilename, const String& mimeType, const URL& originatingURL, API::Data& data) final > { > if (!m_client.saveDataToFileInDownloadsFolder) > return; >@@ -2185,7 +2185,7 @@ void WKPageSetPageNavigationClient(WKPageRef pageRef, const WKPageNavigationClie > return API::Data::create(masterKey.data(), masterKey.size()); > } > >- RefPtr<API::String> signedPublicKeyAndChallengeString(WebPageProxy& page, unsigned keySizeIndex, const RefPtr<API::String>& challengeString, const WebCore::URL& url) override >+ RefPtr<API::String> signedPublicKeyAndChallengeString(WebPageProxy& page, unsigned keySizeIndex, const RefPtr<API::String>& challengeString, const URL& url) override > { > if (m_client.copySignedPublicKeyAndChallengeString) > return adoptRef(toImpl(m_client.copySignedPublicKeyAndChallengeString(toAPI(&page), m_client.base.clientInfo))); >diff --git a/Source/WebKit/UIProcess/API/C/WKPageGroup.cpp b/Source/WebKit/UIProcess/API/C/WKPageGroup.cpp >index 390e120747eae89cfd9fee69dacecb6de0795ec5..0377410ea7e67e6b0910cfbc05a9b32f58cb43e2 100644 >--- a/Source/WebKit/UIProcess/API/C/WKPageGroup.cpp >+++ b/Source/WebKit/UIProcess/API/C/WKPageGroup.cpp >@@ -77,7 +77,7 @@ void WKPageGroupAddUserStyleSheet(WKPageGroupRef pageGroupRef, WKStringRef sourc > auto whitelist = toImpl(whitelistedURLPatterns); > auto blacklist = toImpl(blacklistedURLPatterns); > >- Ref<API::UserStyleSheet> userStyleSheet = API::UserStyleSheet::create(WebCore::UserStyleSheet { source, (baseURLString.isEmpty() ? WebCore::blankURL() : WebCore::URL(WebCore::URL(), baseURLString)), whitelist ? whitelist->toStringVector() : Vector<String>(), blacklist ? blacklist->toStringVector() : Vector<String>(), toUserContentInjectedFrames(injectedFrames), WebCore::UserStyleUserLevel }, API::UserContentWorld::normalWorld()); >+ Ref<API::UserStyleSheet> userStyleSheet = API::UserStyleSheet::create(WebCore::UserStyleSheet { source, (baseURLString.isEmpty() ? WTF::blankURL() : URL(URL(), baseURLString)), whitelist ? whitelist->toStringVector() : Vector<String>(), blacklist ? blacklist->toStringVector() : Vector<String>(), toUserContentInjectedFrames(injectedFrames), WebCore::UserStyleUserLevel }, API::UserContentWorld::normalWorld()); > > toImpl(pageGroupRef)->userContentController().addUserStyleSheet(userStyleSheet.get()); > } >@@ -98,7 +98,7 @@ void WKPageGroupAddUserScript(WKPageGroupRef pageGroupRef, WKStringRef sourceRef > auto whitelist = toImpl(whitelistedURLPatterns); > auto blacklist = toImpl(blacklistedURLPatterns); > >- auto url = baseURLString.isEmpty() ? WebCore::blankURL() : WebCore::URL(WebCore::URL(), baseURLString); >+ auto url = baseURLString.isEmpty() ? WTF::blankURL() : URL(URL(), baseURLString); > Ref<API::UserScript> userScript = API::UserScript::create(WebCore::UserScript { WTFMove(source), WTFMove(url), whitelist ? whitelist->toStringVector() : Vector<String>(), blacklist ? blacklist->toStringVector() : Vector<String>(), toUserScriptInjectionTime(injectionTime), toUserContentInjectedFrames(injectedFrames) }, API::UserContentWorld::normalWorld()); > toImpl(pageGroupRef)->userContentController().addUserScript(userScript.get(), InjectUserScriptImmediately::No); > } >diff --git a/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp b/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp >index 10577ee9cc0a758d06e51035cfca0f75c8ffa476..a3e3468256bb67008295fc13f072df379b70012c 100644 >--- a/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp >+++ b/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp >@@ -41,8 +41,8 @@ > #include "WebsiteDataFetchOption.h" > #include "WebsiteDataRecord.h" > #include "WebsiteDataType.h" >-#include <WebCore/URL.h> > #include <wtf/CallbackAggregator.h> >+#include <wtf/URL.h> > > WKTypeID WKWebsiteDataStoreGetTypeID() > { >@@ -95,7 +95,7 @@ void WKWebsiteDataStoreSetResourceLoadStatisticsPrevalentResourceForDebugMode(WK > return; > } > >- store->setPrevalentResourceForDebugMode(WebCore::URL(WebCore::URL(), WebKit::toImpl(host)->string()), [context, completionHandler] { >+ store->setPrevalentResourceForDebugMode(URL(URL(), WebKit::toImpl(host)->string()), [context, completionHandler] { > completionHandler(context); > }); > } >@@ -107,7 +107,7 @@ void WKWebsiteDataStoreSetStatisticsLastSeen(WKWebsiteDataStoreRef dataStoreRef, > return; > } > >- store->setLastSeen(WebCore::URL(WebCore::URL(), WebKit::toImpl(host)->string()), Seconds { seconds }, [context, completionHandler] { >+ store->setLastSeen(URL(URL(), WebKit::toImpl(host)->string()), Seconds { seconds }, [context, completionHandler] { > completionHandler(context); > }); > } >@@ -121,11 +121,11 @@ void WKWebsiteDataStoreSetStatisticsPrevalentResource(WKWebsiteDataStoreRef data > } > > if (value) >- store->setPrevalentResource(WebCore::URL(WebCore::URL(), WebKit::toImpl(host)->string()), [context, completionHandler] { >+ store->setPrevalentResource(URL(URL(), WebKit::toImpl(host)->string()), [context, completionHandler] { > completionHandler(context); > }); > else >- store->clearPrevalentResource(WebCore::URL(WebCore::URL(), WebKit::toImpl(host)->string()), [context, completionHandler] { >+ store->clearPrevalentResource(URL(URL(), WebKit::toImpl(host)->string()), [context, completionHandler] { > completionHandler(context); > }); > } >@@ -139,11 +139,11 @@ void WKWebsiteDataStoreSetStatisticsVeryPrevalentResource(WKWebsiteDataStoreRef > } > > if (value) >- store->setVeryPrevalentResource(WebCore::URL(WebCore::URL(), WebKit::toImpl(host)->string()), [context, completionHandler] { >+ store->setVeryPrevalentResource(URL(URL(), WebKit::toImpl(host)->string()), [context, completionHandler] { > completionHandler(context); > }); > else >- store->clearPrevalentResource(WebCore::URL(WebCore::URL(), WebKit::toImpl(host)->string()), [context, completionHandler] { >+ store->clearPrevalentResource(URL(URL(), WebKit::toImpl(host)->string()), [context, completionHandler] { > completionHandler(context); > }); > } >@@ -169,7 +169,7 @@ void WKWebsiteDataStoreIsStatisticsPrevalentResource(WKWebsiteDataStoreRef dataS > return; > } > >- store->isPrevalentResource(WebCore::URL(WebCore::URL(), WebKit::toImpl(host)->string()), [context, callback](bool isPrevalentResource) { >+ store->isPrevalentResource(URL(URL(), WebKit::toImpl(host)->string()), [context, callback](bool isPrevalentResource) { > callback(isPrevalentResource, context); > }); > } >@@ -182,7 +182,7 @@ void WKWebsiteDataStoreIsStatisticsVeryPrevalentResource(WKWebsiteDataStoreRef d > return; > } > >- store->isVeryPrevalentResource(WebCore::URL(WebCore::URL(), WebKit::toImpl(host)->string()), [context, callback](bool isVeryPrevalentResource) { >+ store->isVeryPrevalentResource(URL(URL(), WebKit::toImpl(host)->string()), [context, callback](bool isVeryPrevalentResource) { > callback(isVeryPrevalentResource, context); > }); > } >@@ -195,7 +195,7 @@ void WKWebsiteDataStoreIsStatisticsRegisteredAsSubresourceUnder(WKWebsiteDataSto > return; > } > >- store->isRegisteredAsSubresourceUnder(WebCore::URL(WebCore::URL(), WebKit::toImpl(subresourceHost)->string()), WebCore::URL(WebCore::URL(), WebKit::toImpl(topFrameHost)->string()), [context, callback](bool isRegisteredAsSubresourceUnder) { >+ store->isRegisteredAsSubresourceUnder(URL(URL(), WebKit::toImpl(subresourceHost)->string()), URL(URL(), WebKit::toImpl(topFrameHost)->string()), [context, callback](bool isRegisteredAsSubresourceUnder) { > callback(isRegisteredAsSubresourceUnder, context); > }); > } >@@ -208,7 +208,7 @@ void WKWebsiteDataStoreIsStatisticsRegisteredAsSubFrameUnder(WKWebsiteDataStoreR > return; > } > >- store->isRegisteredAsSubFrameUnder(WebCore::URL(WebCore::URL(), WebKit::toImpl(subFrameHost)->string()), WebCore::URL(WebCore::URL(), WebKit::toImpl(topFrameHost)->string()), [context, callback](bool isRegisteredAsSubFrameUnder) { >+ store->isRegisteredAsSubFrameUnder(URL(URL(), WebKit::toImpl(subFrameHost)->string()), URL(URL(), WebKit::toImpl(topFrameHost)->string()), [context, callback](bool isRegisteredAsSubFrameUnder) { > callback(isRegisteredAsSubFrameUnder, context); > }); > } >@@ -221,7 +221,7 @@ void WKWebsiteDataStoreIsStatisticsRegisteredAsRedirectingTo(WKWebsiteDataStoreR > return; > } > >- store->isRegisteredAsRedirectingTo(WebCore::URL(WebCore::URL(), WebKit::toImpl(hostRedirectedFrom)->string()), WebCore::URL(WebCore::URL(), WebKit::toImpl(hostRedirectedTo)->string()), [context, callback](bool isRegisteredAsRedirectingTo) { >+ store->isRegisteredAsRedirectingTo(URL(URL(), WebKit::toImpl(hostRedirectedFrom)->string()), URL(URL(), WebKit::toImpl(hostRedirectedTo)->string()), [context, callback](bool isRegisteredAsRedirectingTo) { > callback(isRegisteredAsRedirectingTo, context); > }); > } >@@ -235,11 +235,11 @@ void WKWebsiteDataStoreSetStatisticsHasHadUserInteraction(WKWebsiteDataStoreRef > } > > if (value) >- store->logUserInteraction(WebCore::URL(WebCore::URL(), WebKit::toImpl(host)->string()), [context, completionHandler] { >+ store->logUserInteraction(URL(URL(), WebKit::toImpl(host)->string()), [context, completionHandler] { > completionHandler(context); > }); > else >- store->clearUserInteraction(WebCore::URL(WebCore::URL(), WebKit::toImpl(host)->string()), [context, completionHandler] { >+ store->clearUserInteraction(URL(URL(), WebKit::toImpl(host)->string()), [context, completionHandler] { > completionHandler(context); > }); > } >@@ -252,7 +252,7 @@ void WKWebsiteDataStoreIsStatisticsHasHadUserInteraction(WKWebsiteDataStoreRef d > return; > } > >- store->hasHadUserInteraction(WebCore::URL(WebCore::URL(), WebKit::toImpl(host)->string()), [context, callback](bool hasHadUserInteraction) { >+ store->hasHadUserInteraction(URL(URL(), WebKit::toImpl(host)->string()), [context, callback](bool hasHadUserInteraction) { > callback(hasHadUserInteraction, context); > }); > } >@@ -263,7 +263,7 @@ void WKWebsiteDataStoreSetStatisticsGrandfathered(WKWebsiteDataStoreRef dataStor > if (!store) > return; > >- store->setGrandfathered(WebCore::URL(WebCore::URL(), WebKit::toImpl(host)->string()), value); >+ store->setGrandfathered(URL(URL(), WebKit::toImpl(host)->string()), value); > } > > void WKWebsiteDataStoreIsStatisticsGrandfathered(WKWebsiteDataStoreRef dataStoreRef, WKStringRef host, void* context, WKWebsiteDataStoreIsStatisticsGrandfatheredFunction callback) >@@ -274,7 +274,7 @@ void WKWebsiteDataStoreIsStatisticsGrandfathered(WKWebsiteDataStoreRef dataStore > return; > } > >- store->hasHadUserInteraction(WebCore::URL(WebCore::URL(), WebKit::toImpl(host)->string()), [context, callback](bool isGrandfathered) { >+ store->hasHadUserInteraction(URL(URL(), WebKit::toImpl(host)->string()), [context, callback](bool isGrandfathered) { > callback(isGrandfathered, context); > }); > } >@@ -285,7 +285,7 @@ void WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin(WKWebsiteDataSto > if (!store) > return; > >- store->setSubframeUnderTopFrameOrigin(WebCore::URL(WebCore::URL(), WebKit::toImpl(host)->string()), WebCore::URL(WebCore::URL(), WebKit::toImpl(topFrameHost)->string())); >+ store->setSubframeUnderTopFrameOrigin(URL(URL(), WebKit::toImpl(host)->string()), URL(URL(), WebKit::toImpl(topFrameHost)->string())); > } > > void WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin(WKWebsiteDataStoreRef dataStoreRef, WKStringRef host, WKStringRef topFrameHost) >@@ -294,7 +294,7 @@ void WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin(WKWebsiteData > if (!store) > return; > >- store->setSubresourceUnderTopFrameOrigin(WebCore::URL(WebCore::URL(), WebKit::toImpl(host)->string()), WebCore::URL(WebCore::URL(), WebKit::toImpl(topFrameHost)->string())); >+ store->setSubresourceUnderTopFrameOrigin(URL(URL(), WebKit::toImpl(host)->string()), URL(URL(), WebKit::toImpl(topFrameHost)->string())); > } > > void WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectTo(WKWebsiteDataStoreRef dataStoreRef, WKStringRef host, WKStringRef hostRedirectedTo) >@@ -303,7 +303,7 @@ void WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectTo(WKWebsiteDataSto > if (!store) > return; > >- store->setSubresourceUniqueRedirectTo(WebCore::URL(WebCore::URL(), WebKit::toImpl(host)->string()), WebCore::URL(WebCore::URL(), WebKit::toImpl(hostRedirectedTo)->string())); >+ store->setSubresourceUniqueRedirectTo(URL(URL(), WebKit::toImpl(host)->string()), URL(URL(), WebKit::toImpl(hostRedirectedTo)->string())); > } > > void WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectFrom(WKWebsiteDataStoreRef dataStoreRef, WKStringRef host, WKStringRef hostRedirectedFrom) >@@ -312,7 +312,7 @@ void WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectFrom(WKWebsiteDataS > if (!store) > return; > >- store->setSubresourceUniqueRedirectFrom(WebCore::URL(WebCore::URL(), WebKit::toImpl(host)->string()), WebCore::URL(WebCore::URL(), WebKit::toImpl(hostRedirectedFrom)->string())); >+ store->setSubresourceUniqueRedirectFrom(URL(URL(), WebKit::toImpl(host)->string()), URL(URL(), WebKit::toImpl(hostRedirectedFrom)->string())); > } > > void WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectTo(WKWebsiteDataStoreRef dataStoreRef, WKStringRef host, WKStringRef hostRedirectedTo) >@@ -321,7 +321,7 @@ void WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectTo(WKWebsiteDataStoreR > if (!store) > return; > >- store->setTopFrameUniqueRedirectTo(WebCore::URL(WebCore::URL(), WebKit::toImpl(host)->string()), WebCore::URL(WebCore::URL(), WebKit::toImpl(hostRedirectedTo)->string())); >+ store->setTopFrameUniqueRedirectTo(URL(URL(), WebKit::toImpl(host)->string()), URL(URL(), WebKit::toImpl(hostRedirectedTo)->string())); > } > > void WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectFrom(WKWebsiteDataStoreRef dataStoreRef, WKStringRef host, WKStringRef hostRedirectedFrom) >@@ -330,7 +330,7 @@ void WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectFrom(WKWebsiteDataStor > if (!store) > return; > >- store->setTopFrameUniqueRedirectFrom(WebCore::URL(WebCore::URL(), WebKit::toImpl(host)->string()), WebCore::URL(WebCore::URL(), WebKit::toImpl(hostRedirectedFrom)->string())); >+ store->setTopFrameUniqueRedirectFrom(URL(URL(), WebKit::toImpl(host)->string()), URL(URL(), WebKit::toImpl(hostRedirectedFrom)->string())); > } > > void WKWebsiteDataStoreSetStatisticsTimeToLiveUserInteraction(WKWebsiteDataStoreRef dataStoreRef, double seconds) >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKHTTPCookieStore.mm b/Source/WebKit/UIProcess/API/Cocoa/WKHTTPCookieStore.mm >index a806bdec2e2d4823b2f1e92ed133e71365def664..c858033ae591b3a2239b01f1b9b0f39fdfbb40a7 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKHTTPCookieStore.mm >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKHTTPCookieStore.mm >@@ -30,10 +30,10 @@ > > #import "HTTPCookieAcceptPolicy.h" > #import <WebCore/Cookie.h> >-#import <WebCore/URL.h> > #import <pal/spi/cf/CFNetworkSPI.h> > #import <wtf/HashMap.h> > #import <wtf/RetainPtr.h> >+#import <wtf/URL.h> > #import <wtf/WeakObjCPtr.h> > > static NSArray<NSHTTPCookie *> *coreCookiesToNSCookies(const Vector<WebCore::Cookie>& coreCookies) >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKUserScript.mm b/Source/WebKit/UIProcess/API/Cocoa/WKUserScript.mm >index 9cf6681aab391c35b637907b111086f827976d5a..8e0c7212868282119f2f89f295065af4d2fea09c 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKUserScript.mm >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKUserScript.mm >@@ -95,7 +95,7 @@ > if (!(self = [super init])) > return nil; > >- API::Object::constructInWrapper<API::UserScript>(self, WebCore::UserScript { WTF::String(source), WebCore::URL(associatedURL), API::toStringVector(legacyWhitelist), API::toStringVector(legacyBlacklist), API::toWebCoreUserScriptInjectionTime(injectionTime), forMainFrameOnly ? WebCore::InjectInTopFrameOnly : WebCore::InjectInAllFrames }, *userContentWorld->_userContentWorld); >+ API::Object::constructInWrapper<API::UserScript>(self, WebCore::UserScript { WTF::String(source), URL(associatedURL), API::toStringVector(legacyWhitelist), API::toStringVector(legacyBlacklist), API::toWebCoreUserScriptInjectionTime(injectionTime), forMainFrameOnly ? WebCore::InjectInTopFrameOnly : WebCore::InjectInAllFrames }, *userContentWorld->_userContentWorld); > > return self; > } >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm b/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >index 881434206632ee57c7223f85e3a22d2c040c1c1b..acd0fcab2e7f769b8e86f02211dfa45722a00e18 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >@@ -1283,7 +1283,7 @@ static NSDictionary *dictionaryRepresentationForEditorState(const WebKit::Editor > [uiDelegate _webView:self editorStateDidChange:dictionaryRepresentationForEditorState(_page->editorState())]; > } > >-- (void)_showSafeBrowsingWarning:(const WebKit::SafeBrowsingWarning&)warning completionHandler:(CompletionHandler<void(Variant<WebKit::ContinueUnsafeLoad, WebCore::URL>&&)>&&)completionHandler >+- (void)_showSafeBrowsingWarning:(const WebKit::SafeBrowsingWarning&)warning completionHandler:(CompletionHandler<void(Variant<WebKit::ContinueUnsafeLoad, URL>&&)>&&)completionHandler > { > _safeBrowsingWarning = adoptNS([[WKSafeBrowsingWarning alloc] initWithFrame:self.bounds safeBrowsingWarning:warning completionHandler:[weakSelf = WeakObjCPtr<WKWebView>(self), completionHandler = WTFMove(completionHandler)] (auto&& result) mutable { > if (auto strongSelf = weakSelf.get()) >@@ -4776,7 +4776,7 @@ FOR_EACH_PRIVATE_WKCONTENTVIEW_ACTION(FORWARD_ACTION_TO_WKCONTENTVIEW) > - (void)_showSafeBrowsingWarningWithTitle:(NSString *)title warning:(NSString *)warning details:(NSAttributedString *)details completionHandler:(void(^)(BOOL))completionHandler > { > auto safeBrowsingWarning = WebKit::SafeBrowsingWarning::create(title, warning, details); >- auto wrapper = [completionHandler = makeBlockPtr(completionHandler)] (Variant<WebKit::ContinueUnsafeLoad, WebCore::URL>&& variant) { >+ auto wrapper = [completionHandler = makeBlockPtr(completionHandler)] (Variant<WebKit::ContinueUnsafeLoad, URL>&& variant) { > switchOn(variant, [&] (WebKit::ContinueUnsafeLoad continueUnsafeLoad) { > switch (continueUnsafeLoad) { > case WebKit::ContinueUnsafeLoad::Yes: >@@ -4784,7 +4784,7 @@ FOR_EACH_PRIVATE_WKCONTENTVIEW_ACTION(FORWARD_ACTION_TO_WKCONTENTVIEW) > case WebKit::ContinueUnsafeLoad::No: > return completionHandler(NO); > } >- }, [&] (WebCore::URL) { >+ }, [&] (URL) { > ASSERT_NOT_REACHED(); > completionHandler(NO); > }); >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm b/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm >index 9de5e58ea67f77a76d5a24365eac227f783bdf1b..d287fd95bdc79bc9486c3ed4f836e6ec003203ec 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm >@@ -44,8 +44,8 @@ > #import "_WKWebsiteDataStoreInternal.h" > #import <WebCore/RuntimeApplicationChecks.h> > #import <WebCore/Settings.h> >-#import <WebCore/URLParser.h> > #import <wtf/RetainPtr.h> >+#import <wtf/URLParser.h> > #import <wtf/WeakObjCPtr.h> > > #if PLATFORM(IOS_FAMILY) >@@ -487,7 +487,7 @@ static NSString *defaultApplicationNameForUserAgent() > if ([WKWebView handlesURLScheme:urlScheme]) > [NSException raise:NSInvalidArgumentException format:@"'%@' is a URL scheme that WKWebView handles natively", urlScheme]; > >- auto canonicalScheme = WebCore::URLParser::maybeCanonicalizeScheme(urlScheme); >+ auto canonicalScheme = WTF::URLParser::maybeCanonicalizeScheme(urlScheme); > if (!canonicalScheme) > [NSException raise:NSInvalidArgumentException format:@"'%@' is not a valid URL scheme", urlScheme]; > >@@ -499,7 +499,7 @@ static NSString *defaultApplicationNameForUserAgent() > > - (id <WKURLSchemeHandler>)urlSchemeHandlerForURLScheme:(NSString *)urlScheme > { >- auto canonicalScheme = WebCore::URLParser::maybeCanonicalizeScheme(urlScheme); >+ auto canonicalScheme = WTF::URLParser::maybeCanonicalizeScheme(urlScheme); > if (!canonicalScheme) > return nil; > >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h b/Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h >index b065b3518f829cef353d781c1aa00a6994802d45..1d15194cbfba9a9d6aa27479cc7ba5ae86b3b75a 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h >@@ -72,10 +72,6 @@ class WebPageProxy; > struct PrintInfo; > } > >-namespace WebCore { >-class URL; >-} >- > @class WKWebViewContentProviderRegistry; > @class WKPasswordView; > @class _WKFrameHandle; >@@ -184,7 +180,7 @@ class URL; > - (void)_didInvalidateDataForAttachment:(API::Attachment&)attachment; > #endif > >-- (void)_showSafeBrowsingWarning:(const WebKit::SafeBrowsingWarning&)warning completionHandler:(CompletionHandler<void(Variant<WebKit::ContinueUnsafeLoad, WebCore::URL>&&)>&&)completionHandler; >+- (void)_showSafeBrowsingWarning:(const WebKit::SafeBrowsingWarning&)warning completionHandler:(CompletionHandler<void(Variant<WebKit::ContinueUnsafeLoad, URL>&&)>&&)completionHandler; > - (void)_clearSafeBrowsingWarning; > > - (std::optional<BOOL>)_resolutionForShareSheetImmediateCompletionForTesting; >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm b/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm >index e426ac356b3c865016c3c3921cf4e000d3d9c658..3122d5daf1bc0343e0591c8eacdf9b214be2ef09 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm >@@ -38,9 +38,9 @@ > #import "WebResourceLoadStatisticsTelemetry.h" > #import "WebsiteDataFetchOption.h" > #import "_WKWebsiteDataStoreConfiguration.h" >-#import <WebCore/URL.h> > #import <WebKit/ServiceWorkerProcessProxy.h> > #import <wtf/BlockPtr.h> >+#import <wtf/URL.h> > > @implementation WKWebsiteDataStore > >diff --git a/Source/WebKit/UIProcess/API/Cocoa/_WKApplicationManifest.mm b/Source/WebKit/UIProcess/API/Cocoa/_WKApplicationManifest.mm >index 3edd8531a098b04f2437d7de5b8540f3f60ecf72..dfed0a9be1753722b6540771c87b365ab6df091a 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/_WKApplicationManifest.mm >+++ b/Source/WebKit/UIProcess/API/Cocoa/_WKApplicationManifest.mm >@@ -54,9 +54,9 @@ > WTF::String(name), > WTF::String(shortName), > WTF::String(description), >- WebCore::URL(scopeURL), >+ URL(scopeURL), > static_cast<WebCore::ApplicationManifest::Display>(display), >- WebCore::URL(startURL) >+ URL(startURL) > }; > > API::Object::constructInWrapper<API::ApplicationManifest>(self, WTFMove(coreApplicationManifest)); >@@ -83,7 +83,7 @@ > > + (_WKApplicationManifest *)applicationManifestFromJSON:(NSString *)json manifestURL:(NSURL *)manifestURL documentURL:(NSURL *)documentURL > { >- auto manifest = WebCore::ApplicationManifestParser::parse(WTF::String(json), WebCore::URL(manifestURL), WebCore::URL(documentURL)); >+ auto manifest = WebCore::ApplicationManifestParser::parse(WTF::String(json), URL(manifestURL), URL(documentURL)); > return wrapper(API::ApplicationManifest::create(manifest)); > } > >diff --git a/Source/WebKit/UIProcess/API/Cocoa/_WKUserStyleSheet.mm b/Source/WebKit/UIProcess/API/Cocoa/_WKUserStyleSheet.mm >index e6f090ff5d4137c6589cee8fca835013b8a6de3d..6145232a0d8e7f1a8d72dad71377ba5c74bb84f2 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/_WKUserStyleSheet.mm >+++ b/Source/WebKit/UIProcess/API/Cocoa/_WKUserStyleSheet.mm >@@ -70,7 +70,7 @@ > // FIXME: In the API test, we can use generateUniqueURL below before the API::Object constructor has done this... where should this really be? > WebKit::InitializeWebKit2(); > >- API::Object::constructInWrapper<API::UserStyleSheet>(self, WebCore::UserStyleSheet { WTF::String(source), { WebCore::URL(), WTF::String([baseURL _web_originalDataAsWTFString]) }, API::toStringVector(legacyWhitelist), API::toStringVector(legacyBlacklist), forMainFrameOnly ? WebCore::InjectInTopFrameOnly : WebCore::InjectInAllFrames, WebCore::UserStyleUserLevel }, *userContentWorld->_userContentWorld); >+ API::Object::constructInWrapper<API::UserStyleSheet>(self, WebCore::UserStyleSheet { WTF::String(source), { URL(), WTF::String([baseURL _web_originalDataAsWTFString]) }, API::toStringVector(legacyWhitelist), API::toStringVector(legacyBlacklist), forMainFrameOnly ? WebCore::InjectInTopFrameOnly : WebCore::InjectInAllFrames, WebCore::UserStyleUserLevel }, *userContentWorld->_userContentWorld); > > return self; > } >diff --git a/Source/WebKit/UIProcess/API/glib/IconDatabase.cpp b/Source/WebKit/UIProcess/API/glib/IconDatabase.cpp >index a729fab9a79e1dcd154f43091d17f4edc80df3b4..674a5db043c8a60f3620aa7ba018c1f985edf8a9 100644 >--- a/Source/WebKit/UIProcess/API/glib/IconDatabase.cpp >+++ b/Source/WebKit/UIProcess/API/glib/IconDatabase.cpp >@@ -34,10 +34,10 @@ > #include <WebCore/SQLiteStatement.h> > #include <WebCore/SQLiteTransaction.h> > #include <WebCore/SharedBuffer.h> >-#include <WebCore/URL.h> > #include <wtf/MainThread.h> > #include <wtf/NeverDestroyed.h> > #include <wtf/StdLibExtras.h> >+#include <wtf/URL.h> > > // For methods that are meant to support API from the main thread - should not be called internally > #define ASSERT_NOT_SYNC_THREAD() ASSERT(!m_syncThreadRunning || !IS_ICON_SYNC_THREAD()) >diff --git a/Source/WebKit/UIProcess/API/glib/WebKitCookieManager.cpp b/Source/WebKit/UIProcess/API/glib/WebKitCookieManager.cpp >index de82fdab5c7f953fa5bcaf407d9c66cb185227e3..7a942919ddf8c4f2a3b16da767014b2c2c154faa 100644 >--- a/Source/WebKit/UIProcess/API/glib/WebKitCookieManager.cpp >+++ b/Source/WebKit/UIProcess/API/glib/WebKitCookieManager.cpp >@@ -321,7 +321,7 @@ void webkit_cookie_manager_get_cookies(WebKitCookieManager* manager, const gchar > > // Cookies are read/written from/to the same SQLite database on disk regardless > // of the process we access them from, so just use the first process pool. >- processPools[0]->supplement<WebCookieManagerProxy>()->getCookies(sessionID, WebCore::URL(WebCore::URL(), String::fromUTF8(uri)), [task = WTFMove(task)](const Vector<WebCore::Cookie>& cookies, CallbackBase::Error error) { >+ processPools[0]->supplement<WebCookieManagerProxy>()->getCookies(sessionID, URL(URL(), String::fromUTF8(uri)), [task = WTFMove(task)](const Vector<WebCore::Cookie>& cookies, CallbackBase::Error error) { > if (error != CallbackBase::Error::None) { > // This can only happen in cases where the web process is not available, > // consider the operation "cancelled" from the point of view of the client. >diff --git a/Source/WebKit/UIProcess/API/glib/WebKitFileChooserRequest.cpp b/Source/WebKit/UIProcess/API/glib/WebKitFileChooserRequest.cpp >index cd026e4f8e91a7abfb19bcc30b0a12358f27de50..37e6cca0cebce914730e3c6d425c5fef77fb485f 100644 >--- a/Source/WebKit/UIProcess/API/glib/WebKitFileChooserRequest.cpp >+++ b/Source/WebKit/UIProcess/API/glib/WebKitFileChooserRequest.cpp >@@ -27,8 +27,8 @@ > #include "WebOpenPanelResultListenerProxy.h" > #include <WebCore/FileSystem.h> > #include <WebCore/TextEncoding.h> >-#include <WebCore/URL.h> > #include <glib/gi18n-lib.h> >+#include <wtf/URL.h> > #include <wtf/glib/GRefPtr.h> > #include <wtf/glib/GUniquePtr.h> > #include <wtf/glib/WTFGType.h> >diff --git a/Source/WebKit/UIProcess/API/glib/WebKitSecurityOrigin.cpp b/Source/WebKit/UIProcess/API/glib/WebKitSecurityOrigin.cpp >index 3bcc21236785936a771297e6e398d280dfb6b802..88336b3dc4684988ac77d169da6a595e61e59e55 100644 >--- a/Source/WebKit/UIProcess/API/glib/WebKitSecurityOrigin.cpp >+++ b/Source/WebKit/UIProcess/API/glib/WebKitSecurityOrigin.cpp >@@ -21,7 +21,7 @@ > #include "WebKitSecurityOrigin.h" > > #include "WebKitSecurityOriginPrivate.h" >-#include <WebCore/URL.h> >+#include <wtf/URL.h> > #include <wtf/text/CString.h> > > /** >@@ -110,7 +110,7 @@ WebKitSecurityOrigin* webkit_security_origin_new_for_uri(const gchar* uri) > { > g_return_val_if_fail(uri, nullptr); > >- return webkitSecurityOriginCreate(WebCore::SecurityOrigin::create(WebCore::URL(WebCore::URL(), String::fromUTF8(uri)))); >+ return webkitSecurityOriginCreate(WebCore::SecurityOrigin::create(URL(URL(), String::fromUTF8(uri)))); > } > > /** >diff --git a/Source/WebKit/UIProcess/API/glib/WebKitUIClient.cpp b/Source/WebKit/UIProcess/API/glib/WebKitUIClient.cpp >index 58bd7be4bbc5f2fce3ecee13b6530d350ed815bd..1c7688690781f2a09c0c8b7b48f78e8eee55690f 100644 >--- a/Source/WebKit/UIProcess/API/glib/WebKitUIClient.cpp >+++ b/Source/WebKit/UIProcess/API/glib/WebKitUIClient.cpp >@@ -53,7 +53,7 @@ private: > void createNewPage(WebPageProxy& page, Ref<API::FrameInfo>&& frameInfo, WebCore::ResourceRequest&& resourceRequest, WebCore::WindowFeatures&& windowFeatures, NavigationActionData&& navigationActionData, CompletionHandler<void(RefPtr<WebPageProxy>&&)>&& completionHandler) final > { > auto userInitiatedActivity = page.process().userInitiatedActivity(navigationActionData.userGestureTokenIdentifier); >- WebKitNavigationAction navigationAction(API::NavigationAction::create(WTFMove(navigationActionData), frameInfo.ptr(), nullptr, std::nullopt, WTFMove(resourceRequest), WebCore::URL { }, false, WTFMove(userInitiatedActivity))); >+ WebKitNavigationAction navigationAction(API::NavigationAction::create(WTFMove(navigationActionData), frameInfo.ptr(), nullptr, std::nullopt, WTFMove(resourceRequest), URL { }, false, WTFMove(userInitiatedActivity))); > completionHandler(webkitWebViewCreateNewPage(m_webView, windowFeatures, &navigationAction)); > } > >diff --git a/Source/WebKit/UIProcess/API/glib/WebKitURISchemeRequest.cpp b/Source/WebKit/UIProcess/API/glib/WebKitURISchemeRequest.cpp >index 91674ac288f7e78f451e9593d3a5548ff598889f..07b58ad323d5458c903663db830e94be7e5d88fd 100644 >--- a/Source/WebKit/UIProcess/API/glib/WebKitURISchemeRequest.cpp >+++ b/Source/WebKit/UIProcess/API/glib/WebKitURISchemeRequest.cpp >@@ -26,10 +26,10 @@ > #include "WebKitWebContextPrivate.h" > #include "WebKitWebView.h" > #include "WebPageProxy.h" >-#include <WebCore/GUniquePtrSoup.h> > #include <WebCore/ResourceError.h> > #include <libsoup/soup.h> > #include <wtf/glib/GRefPtr.h> >+#include <wtf/glib/GUniquePtrSoup.h> > #include <wtf/glib/RunLoopSourcePriority.h> > #include <wtf/glib/WTFGType.h> > #include <wtf/text/CString.h> >diff --git a/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp b/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp >index 0fa4a18f89c8c51a4540778f5ae27bea87d7b5f1..234859663d1f2c780898f060f4014988e786b4f6 100644 >--- a/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp >+++ b/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp >@@ -66,12 +66,12 @@ > #include <JavaScriptCore/JSRetainPtr.h> > #include <jsc/JSCContextPrivate.h> > #include <WebCore/CertificateInfo.h> >-#include <WebCore/GUniquePtrSoup.h> > #include <WebCore/JSDOMExceptionHandling.h> > #include <WebCore/RefPtrCairo.h> >-#include <WebCore/URL.h> > #include <glib/gi18n-lib.h> >+#include <wtf/URL.h> > #include <wtf/glib/GRefPtr.h> >+#include <wtf/glib/GUniquePtrSoup.h> > #include <wtf/glib/WTFGType.h> > #include <wtf/text/CString.h> > #include <wtf/text/StringBuilder.h> >@@ -2647,7 +2647,7 @@ void webkit_web_view_load_plain_text(WebKitWebView* webView, const gchar* plainT > g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView)); > g_return_if_fail(plainText); > >- getPage(webView).loadData({ reinterpret_cast<const uint8_t*>(plainText), plainText ? strlen(plainText) : 0 }, "text/plain"_s, "UTF-8"_s, blankURL().string()); >+ getPage(webView).loadData({ reinterpret_cast<const uint8_t*>(plainText), plainText ? strlen(plainText) : 0 }, "text/plain"_s, "UTF-8"_s, WTF::blankURL().string()); > } > > /** >diff --git a/Source/WebKit/UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp b/Source/WebKit/UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp >index bbd516e72962337bddfecd0c56d39814833d8a74..b7e6330eaeb2e2022e623f3a68ec1bc17aa3775d 100644 >--- a/Source/WebKit/UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp >+++ b/Source/WebKit/UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp >@@ -28,7 +28,7 @@ > #include "WebKitUserContentManagerPrivate.h" > #include "WebKitWebContextPrivate.h" > #include "WebScriptMessageHandler.h" >-#include <WebCore/URL.h> >+#include <wtf/URL.h> > > namespace WebKit { > using namespace WebCore; >diff --git a/Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp b/Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp >index b44b7db1ea832d79bae9a47a2c5829159bfb6046..edae083e9e9845a42aada68c035323d237042bb1 100644 >--- a/Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp >+++ b/Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp >@@ -106,11 +106,11 @@ void WebPaymentCoordinatorProxy::showPaymentUI(const String& originatingURLStrin > > m_state = State::Activating; > >- WebCore::URL originatingURL(WebCore::URL(), originatingURLString); >+ URL originatingURL(URL(), originatingURLString); > >- Vector<WebCore::URL> linkIconURLs; >+ Vector<URL> linkIconURLs; > for (const auto& linkIconURLString : linkIconURLStrings) >- linkIconURLs.append(WebCore::URL(WebCore::URL(), linkIconURLString)); >+ linkIconURLs.append(URL(URL(), linkIconURLString)); > > platformShowPaymentUI(originatingURL, linkIconURLs, paymentRequest, [this](bool result) { > ASSERT(m_state == State::Activating); >@@ -225,7 +225,7 @@ void WebPaymentCoordinatorProxy::didCancelPaymentSession() > didReachFinalState(); > } > >-void WebPaymentCoordinatorProxy::validateMerchant(const WebCore::URL& url) >+void WebPaymentCoordinatorProxy::validateMerchant(const URL& url) > { > ASSERT(m_merchantValidationState == MerchantValidationState::Idle); > >diff --git a/Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.h b/Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.h >index e03c70ab8b9c22598354116919f79eea3ac9f167..1fbcd345613c07d4ee919a7de4595d0a256ceee2 100644 >--- a/Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.h >+++ b/Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.h >@@ -47,7 +47,6 @@ class Payment; > class PaymentContact; > class PaymentMerchantSession; > class PaymentMethod; >-class URL; > } > > OBJC_CLASS NSObject; >@@ -65,7 +64,7 @@ public: > ~WebPaymentCoordinatorProxy(); > > void didCancelPaymentSession(); >- void validateMerchant(const WebCore::URL&); >+ void validateMerchant(const URL&); > void didAuthorizePayment(const WebCore::Payment&); > void didSelectShippingMethod(const WebCore::ApplePaySessionPaymentRequest::ShippingMethod&); > void didSelectShippingContact(const WebCore::PaymentContact&); >@@ -103,7 +102,7 @@ private: > bool platformCanMakePayments(); > void platformCanMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, WTF::Function<void (bool)>&& completionHandler); > void platformOpenPaymentSetup(const String& merchantIdentifier, const String& domainName, WTF::Function<void (bool)>&& completionHandler); >- void platformShowPaymentUI(const WebCore::URL& originatingURL, const Vector<WebCore::URL>& linkIconURLs, const WebCore::ApplePaySessionPaymentRequest&, WTF::Function<void (bool)>&& completionHandler); >+ void platformShowPaymentUI(const URL& originatingURL, const Vector<URL>& linkIconURLs, const WebCore::ApplePaySessionPaymentRequest&, WTF::Function<void(bool)>&& completionHandler); > void platformCompleteMerchantValidation(const WebCore::PaymentMerchantSession&); > void platformCompleteShippingMethodSelection(const std::optional<WebCore::ShippingMethodUpdate>&); > void platformCompleteShippingContactSelection(const std::optional<WebCore::ShippingContactUpdate>&); >diff --git a/Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h b/Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h >index bf429c896428e83609049475abfb4d69c6aef215..c4d79fe4c12c9ab854fbbd42513b785383072ae7 100644 >--- a/Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h >+++ b/Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h >@@ -31,15 +31,11 @@ > #import <pal/spi/cocoa/PassKitSPI.h> > #import <wtf/BlockPtr.h> > >-namespace WebCore { >-class URL; >-} >- > namespace WebKit { > class WebPageProxy; > class WebPaymentCoordinatorProxy; > >-RetainPtr<PKPaymentRequest> toPKPaymentRequest(WebPageProxy&, const WebCore::URL& originatingURL, const Vector<WebCore::URL>& linkIconURLs, const WebCore::ApplePaySessionPaymentRequest&); >+RetainPtr<PKPaymentRequest> toPKPaymentRequest(WebPageProxy&, const URL& originatingURL, const Vector<URL>& linkIconURLs, const WebCore::ApplePaySessionPaymentRequest&); > > } > >diff --git a/Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm b/Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm >index 056d5c3f4a5394d3cf5ded6d6db54f0f8664a933..9fcab429a240b0651f3017135e7d00b14a837bd9 100644 >--- a/Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm >+++ b/Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm >@@ -32,10 +32,10 @@ > #import "WebProcessPool.h" > #import <WebCore/PaymentAuthorizationStatus.h> > #import <WebCore/PaymentHeaders.h> >-#import <WebCore/URL.h> > #import <pal/cocoa/PassKitSoftLink.h> > #import <wtf/BlockPtr.h> > #import <wtf/RunLoop.h> >+#import <wtf/URL.h> > > #if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101300) > SOFT_LINK_FRAMEWORK(Contacts) >@@ -442,7 +442,7 @@ static PKPaymentRequestAPIType toAPIType(WebCore::ApplePaySessionPaymentRequest: > } > #endif > >-RetainPtr<PKPaymentRequest> toPKPaymentRequest(WebPageProxy& webPageProxy, const WebCore::URL& originatingURL, const Vector<WebCore::URL>& linkIconURLs, const WebCore::ApplePaySessionPaymentRequest& paymentRequest) >+RetainPtr<PKPaymentRequest> toPKPaymentRequest(WebPageProxy& webPageProxy, const URL& originatingURL, const Vector<URL>& linkIconURLs, const WebCore::ApplePaySessionPaymentRequest& paymentRequest) > { > auto result = adoptNS([PAL::allocPKPaymentRequestInstance() init]); > >diff --git a/Source/WebKit/UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm b/Source/WebKit/UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm >index f9e280d1c956a6d8de72541fff097f58cdeaa868..5d7b43e7939c37ef284d93bcf0267653d2ac031d 100644 >--- a/Source/WebKit/UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm >+++ b/Source/WebKit/UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm >@@ -38,7 +38,7 @@ > > namespace WebKit { > >-void WebPaymentCoordinatorProxy::platformShowPaymentUI(const WebCore::URL& originatingURL, const Vector<WebCore::URL>& linkIconURLStrings, const WebCore::ApplePaySessionPaymentRequest& request, WTF::Function<void (bool)>&& completionHandler) >+void WebPaymentCoordinatorProxy::platformShowPaymentUI(const URL& originatingURL, const Vector<URL>& linkIconURLStrings, const WebCore::ApplePaySessionPaymentRequest& request, WTF::Function<void(bool)>&& completionHandler) > { > UIViewController *presentingViewController = m_webPageProxy.uiClient().presentingViewController(); > >diff --git a/Source/WebKit/UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm b/Source/WebKit/UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm >index bd830c6244ddf569c5185dbe9b7503600c9c7c76..374efb53ff48dd8cbe4e86d3aa64233b06c0d01e 100644 >--- a/Source/WebKit/UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm >+++ b/Source/WebKit/UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm >@@ -35,7 +35,7 @@ > > namespace WebKit { > >-void WebPaymentCoordinatorProxy::platformShowPaymentUI(const WebCore::URL& originatingURL, const Vector<WebCore::URL>& linkIconURLStrings, const WebCore::ApplePaySessionPaymentRequest& request, WTF::Function<void (bool)>&& completionHandler) >+void WebPaymentCoordinatorProxy::platformShowPaymentUI(const URL& originatingURL, const Vector<URL>& linkIconURLStrings, const WebCore::ApplePaySessionPaymentRequest& request, WTF::Function<void(bool)>&& completionHandler) > { > auto paymentRequest = toPKPaymentRequest(m_webPageProxy, originatingURL, linkIconURLStrings, request); > >diff --git a/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp b/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp >index bba73da7df10f8df3fd7aa512aa335ad763262a3..dd0cb4427069e074fb580b11c2e9c39b1dbb39d7 100644 >--- a/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp >+++ b/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp >@@ -44,10 +44,10 @@ > #include <JavaScriptCore/InspectorBackendDispatcher.h> > #include <JavaScriptCore/InspectorFrontendRouter.h> > #include <WebCore/MIMETypeRegistry.h> >-#include <WebCore/URL.h> > #include <algorithm> > #include <wtf/HashMap.h> > #include <wtf/Optional.h> >+#include <wtf/URL.h> > #include <wtf/UUID.h> > #include <wtf/text/StringConcatenate.h> > >@@ -669,7 +669,7 @@ void WebAutomationSession::navigateBrowsingContext(const String& handle, const S > ASYNC_FAIL_WITH_PREDEFINED_ERROR_AND_DETAILS(InvalidParameter, "The parameter 'pageLoadStrategy' is invalid."); > auto pageLoadTimeout = optionalPageLoadTimeout ? Seconds::fromMilliseconds(*optionalPageLoadTimeout) : defaultPageLoadTimeout; > >- page->loadRequest(WebCore::URL(WebCore::URL(), url)); >+ page->loadRequest(URL(URL(), url)); > waitForNavigationToCompleteOnPage(*page, pageLoadStrategy.value(), pageLoadTimeout, WTFMove(callback)); > } > >@@ -1297,7 +1297,7 @@ static String domainByAddingDotPrefixIfNeeded(String domain) > if (domain[0] != '.') { > // RFC 2965: If an explicitly specified value does not start with a dot, the user agent supplies a leading dot. > // Assume that any host that ends with a digit is trying to be an IP address. >- if (!WebCore::URL::hostIsIPAddress(domain)) >+ if (!URL::hostIsIPAddress(domain)) > return makeString('.', domain); > } > >@@ -1310,7 +1310,7 @@ void WebAutomationSession::addSingleCookie(const String& browsingContextHandle, > if (!page) > ASYNC_FAIL_WITH_PREDEFINED_ERROR(WindowNotFound); > >- WebCore::URL activeURL = WebCore::URL(WebCore::URL(), page->pageLoadState().activeURL()); >+ URL activeURL = URL(URL(), page->pageLoadState().activeURL()); > ASSERT(activeURL.isValid()); > > WebCore::Cookie cookie; >@@ -1367,7 +1367,7 @@ void WebAutomationSession::deleteAllCookies(ErrorString& errorString, const Stri > if (!page) > SYNC_FAIL_WITH_PREDEFINED_ERROR(WindowNotFound); > >- WebCore::URL activeURL = WebCore::URL(WebCore::URL(), page->pageLoadState().activeURL()); >+ URL activeURL = URL(URL(), page->pageLoadState().activeURL()); > ASSERT(activeURL.isValid()); > > WebCookieManagerProxy* cookieManager = m_processPool->supplement<WebCookieManagerProxy>(); >diff --git a/Source/WebKit/UIProcess/Cocoa/DownloadClient.mm b/Source/WebKit/UIProcess/Cocoa/DownloadClient.mm >index c5a5d6bdf1782f34de241dbaccf5db28263330f1..e9d72384e491e96721c6506ddca3b34cc03240bd 100644 >--- a/Source/WebKit/UIProcess/Cocoa/DownloadClient.mm >+++ b/Source/WebKit/UIProcess/Cocoa/DownloadClient.mm >@@ -212,7 +212,7 @@ void DownloadClient::didFinish(WebProcessPool&, DownloadProxy& downloadProxy) > #if USE(SYSTEM_PREVIEW) > if (downloadProxy.isSystemPreviewDownload()) { > if (auto* webPage = downloadProxy.originatingPage()) { >- WebCore::URL destinationURL = WebCore::URL::fileURLWithFileSystemPath(downloadProxy.destinationFilename()); >+ WTF::URL destinationURL = WTF::URL::fileURLWithFileSystemPath(downloadProxy.destinationFilename()); > if (!destinationURL.fragmentIdentifier().length()) > destinationURL.setFragmentIdentifier(downloadProxy.request().url().fragmentIdentifier()); > webPage->systemPreviewController()->finish(destinationURL); >diff --git a/Source/WebKit/UIProcess/Cocoa/NavigationState.h b/Source/WebKit/UIProcess/Cocoa/NavigationState.h >index b10dc895fae84228bdc78de4e68144a11d91a1f9..c02c1564dde22d6ace2ae5d24e8c3d1de52dc70b 100644 >--- a/Source/WebKit/UIProcess/Cocoa/NavigationState.h >+++ b/Source/WebKit/UIProcess/Cocoa/NavigationState.h >@@ -117,7 +117,7 @@ private: > > RefPtr<API::Data> webCryptoMasterKey(WebPageProxy&) override; > >- RefPtr<API::String> signedPublicKeyAndChallengeString(WebPageProxy&, unsigned keySizeIndex, const RefPtr<API::String>& challengeString, const WebCore::URL&) override; >+ RefPtr<API::String> signedPublicKeyAndChallengeString(WebPageProxy&, unsigned keySizeIndex, const RefPtr<API::String>& challengeString, const URL&) override; > > #if USE(QUICK_LOOK) > void didStartLoadForQuickLookDocumentInMainFrame(const WTF::String& fileName, const WTF::String& uti) override; >@@ -125,8 +125,8 @@ private: > #endif > > #if PLATFORM(MAC) >- void webGLLoadPolicy(WebPageProxy&, const WebCore::URL&, CompletionHandler<void(WebCore::WebGLLoadPolicy)>&&) const final; >- void resolveWebGLLoadPolicy(WebPageProxy&, const WebCore::URL&, CompletionHandler<void(WebCore::WebGLLoadPolicy)>&&) const final; >+ void webGLLoadPolicy(WebPageProxy&, const URL&, CompletionHandler<void(WebCore::WebGLLoadPolicy)>&&) const final; >+ void resolveWebGLLoadPolicy(WebPageProxy&, const URL&, CompletionHandler<void(WebCore::WebGLLoadPolicy)>&&) const final; > bool willGoToBackForwardListItem(WebPageProxy&, WebBackForwardListItem&, bool inPageCache) final; > bool didFailToInitializePlugIn(WebPageProxy&, API::Dictionary&) final; > bool didBlockInsecurePluginVersion(WebPageProxy&, API::Dictionary&) final; >@@ -134,7 +134,7 @@ private: > bool didChangeBackForwardList(WebPageProxy&, WebBackForwardListItem*, const Vector<Ref<WebBackForwardListItem>>&) final; > #endif > >- void contentRuleListNotification(WebPageProxy&, WebCore::URL&&, Vector<String>&&, Vector<String>&&) final; >+ void contentRuleListNotification(WebPageProxy&, URL&&, Vector<String>&&, Vector<String>&&) final; > void decidePolicyForNavigationAction(WebPageProxy&, Ref<API::NavigationAction>&&, Ref<WebFramePolicyListenerProxy>&&, API::Object* userData) override; > void decidePolicyForNavigationResponse(WebPageProxy&, Ref<API::NavigationResponse>&&, Ref<WebFramePolicyListenerProxy>&&, API::Object* userData) override; > >diff --git a/Source/WebKit/UIProcess/Cocoa/NavigationState.mm b/Source/WebKit/UIProcess/Cocoa/NavigationState.mm >index 9c540d59aa0ae53a4ac482ba000af739f3a77c9d..f6f42d9704aefb30fe3719a0b8299b51909a3fb1 100644 >--- a/Source/WebKit/UIProcess/Cocoa/NavigationState.mm >+++ b/Source/WebKit/UIProcess/Cocoa/NavigationState.mm >@@ -70,9 +70,9 @@ > #import <WebCore/SSLKeyGenerator.h> > #import <WebCore/SecurityOriginData.h> > #import <WebCore/SerializedCryptoKeyWrap.h> >-#import <WebCore/URL.h> > #import <wtf/BlockPtr.h> > #import <wtf/NeverDestroyed.h> >+#import <wtf/URL.h> > > #if HAVE(APP_LINKS) > #import <pal/spi/cocoa/LaunchServicesSPI.h> >@@ -397,7 +397,7 @@ inline WebCore::WebGLLoadPolicy toWebCoreWebGLLoadPolicy(_WKWebGLLoadPolicy poli > return WebCore::WebGLAllowCreation; > } > >-void NavigationState::NavigationClient::webGLLoadPolicy(WebPageProxy&, const WebCore::URL& url, CompletionHandler<void(WebCore::WebGLLoadPolicy)>&& completionHandler) const >+void NavigationState::NavigationClient::webGLLoadPolicy(WebPageProxy&, const URL& url, CompletionHandler<void(WebCore::WebGLLoadPolicy)>&& completionHandler) const > { > if (!m_navigationState.m_navigationDelegateMethods.webViewWebGLLoadPolicyForURL) { > completionHandler(WebGLAllowCreation); >@@ -414,7 +414,7 @@ void NavigationState::NavigationClient::webGLLoadPolicy(WebPageProxy&, const Web > }).get()]; > } > >-void NavigationState::NavigationClient::resolveWebGLLoadPolicy(WebPageProxy&, const WebCore::URL& url, CompletionHandler<void(WebCore::WebGLLoadPolicy)>&& completionHandler) const >+void NavigationState::NavigationClient::resolveWebGLLoadPolicy(WebPageProxy&, const URL& url, CompletionHandler<void(WebCore::WebGLLoadPolicy)>&& completionHandler) const > { > if (!m_navigationState.m_navigationDelegateMethods.webViewResolveWebGLLoadPolicyForURL) { > completionHandler(WebGLAllowCreation); >@@ -593,7 +593,7 @@ void NavigationState::NavigationClient::decidePolicyForNavigationAction(WebPageP > } > } > >-void NavigationState::NavigationClient::contentRuleListNotification(WebPageProxy&, WebCore::URL&& url, Vector<String>&& listIdentifiers, Vector<String>&& notifications) >+void NavigationState::NavigationClient::contentRuleListNotification(WebPageProxy&, URL&& url, Vector<String>&& listIdentifiers, Vector<String>&& notifications) > { > if (!m_navigationState.m_navigationDelegateMethods.webViewURLContentRuleListIdentifiersNotifications) > return; >@@ -704,7 +704,7 @@ void NavigationState::NavigationClient::willPerformClientRedirect(WebPageProxy& > if (!navigationDelegate) > return; > >- WebCore::URL url(WebCore::URL(), urlString); >+ URL url(URL(), urlString); > > [static_cast<id <WKNavigationDelegatePrivate>>(navigationDelegate) _webView:m_navigationState.m_webView willPerformClientRedirectToURL:url delay:delay]; > } >@@ -718,8 +718,8 @@ void NavigationState::NavigationClient::didPerformClientRedirect(WebPageProxy& p > if (!navigationDelegate) > return; > >- WebCore::URL sourceURL(WebCore::URL(), sourceURLString); >- WebCore::URL destinationURL(WebCore::URL(), destinationURLString); >+ URL sourceURL(URL(), sourceURLString); >+ URL destinationURL(URL(), destinationURLString); > > [static_cast<id <WKNavigationDelegatePrivate>>(navigationDelegate) _webView:m_navigationState.m_webView didPerformClientRedirectFromURL:sourceURL toURL:destinationURL]; > } >@@ -992,7 +992,7 @@ RefPtr<API::Data> NavigationState::NavigationClient::webCryptoMasterKey(WebPageP > return API::Data::createWithoutCopying(data); > } > >-RefPtr<API::String> NavigationState::NavigationClient::signedPublicKeyAndChallengeString(WebPageProxy& page, unsigned keySizeIndex, const RefPtr<API::String>& challengeString, const WebCore::URL& url) >+RefPtr<API::String> NavigationState::NavigationClient::signedPublicKeyAndChallengeString(WebPageProxy& page, unsigned keySizeIndex, const RefPtr<API::String>& challengeString, const URL& url) > { > // WebKitTestRunner uses C API. Hence, no SPI is provided to override the following function. > return API::String::create(WebCore::signedPublicKeyAndChallengeString(keySizeIndex, challengeString->string(), url)); >diff --git a/Source/WebKit/UIProcess/Cocoa/SafeBrowsingResultCocoa.mm b/Source/WebKit/UIProcess/Cocoa/SafeBrowsingResultCocoa.mm >new file mode 100644 >index 0000000000000000000000000000000000000000..04dfd5d44d6e48311ddc2f2fe74169f448c5b314 >--- /dev/null >+++ b/Source/WebKit/UIProcess/Cocoa/SafeBrowsingResultCocoa.mm >@@ -0,0 +1,45 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#import "config.h" >+#import "SafeBrowsingResult.h" >+ >+#import "SafeBrowsingSPI.h" >+ >+namespace WebKit { >+ >+#if HAVE(SAFE_BROWSING) >+SafeBrowsingResult::SafeBrowsingResult(URL&& url, SSBServiceLookupResult *result) >+ : m_url(WTFMove(url)) >+ , m_provider([result provider]) >+ , m_isPhishing([result isPhishing]) >+ , m_isMalware([result isMalware]) >+ , m_isUnwantedSoftware([result isUnwantedSoftware]) >+ , m_isKnownToBeUnsafe([result isKnownToBeUnsafe]) >+{ >+} >+#endif >+ >+} >diff --git a/Source/WebKit/UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm b/Source/WebKit/UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm >index 0375b83b2a7f53c61a9fdc468eb1b6ad5ad17252..8281f6c6dee2f87277f3ad1e9b303e0873bba441 100644 >--- a/Source/WebKit/UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm >+++ b/Source/WebKit/UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm >@@ -81,14 +81,14 @@ static void addLinkAndReplace(NSMutableAttributedString *string, NSString *toRep > [string replaceCharactersInRange:[string.string rangeOfString:toReplace] withAttributedString:stringWithLink]; > } > >-static NSURL *reportAnErrorURL(const WebCore::URL& url, SSBServiceLookupResult *result) >+static NSURL *reportAnErrorURL(const URL& url, SSBServiceLookupResult *result) > { >- return WebCore::URL({ }, makeString(reportAnErrorBase(result), "&url=", encodeWithURLEscapeSequences(url), "&hl=", defaultLanguage())); >+ return URL({ }, makeString(reportAnErrorBase(result), "&url=", encodeWithURLEscapeSequences(url), "&hl=", defaultLanguage())); > } > >-static NSURL *malwareDetailsURL(const WebCore::URL& url, SSBServiceLookupResult *result) >+static NSURL *malwareDetailsURL(const URL& url, SSBServiceLookupResult *result) > { >- return WebCore::URL({ }, makeString(malwareDetailsBase(result), "&site=", url.host(), "&hl=", defaultLanguage())); >+ return URL({ }, makeString(malwareDetailsBase(result), "&site=", url.host(), "&hl=", defaultLanguage())); > } > > static NSString *safeBrowsingTitleText(SSBServiceLookupResult *result) >@@ -112,7 +112,7 @@ static NSString *safeBrowsingWarningText(SSBServiceLookupResult *result) > return WEB_UI_NSSTRING(@"This website may try to trick you into installing software that harms your browsing experience, like changing your settings without your permission or showing you unwanted ads. Once installed, it may be difficult to remove.", "Unwanted software warning"); > } > >-static NSMutableAttributedString *safeBrowsingDetailsText(const WebCore::URL& url, SSBServiceLookupResult *result) >+static NSMutableAttributedString *safeBrowsingDetailsText(const URL& url, SSBServiceLookupResult *result) > { > if (result.isPhishing) { > NSString *phishingDescription = WEB_UI_NSSTRING(@"Warnings are shown for websites that have been reported as deceptive. Deceptive websites try to trick you into believing they are legitimate websites you trust.", "Phishing warning description"); >@@ -149,7 +149,7 @@ static NSMutableAttributedString *safeBrowsingDetailsText(const WebCore::URL& ur > return malwareOrUnwantedSoftwareDetails(WEB_UI_NSSTRING(@"Warnings are shown for websites where harmful software has been detected. You can check %the-status-of-site% on the %safeBrowsingProvider% diagnostic page.", "Unwanted software warning description"), @"%the-status-of-site%", false); > } > >-SafeBrowsingWarning::SafeBrowsingWarning(const WebCore::URL& url, SSBServiceLookupResult *result) >+SafeBrowsingWarning::SafeBrowsingWarning(const URL& url, SSBServiceLookupResult *result) > : m_title(safeBrowsingTitleText(result)) > , m_warning(safeBrowsingWarningText(result)) > , m_details(safeBrowsingDetailsText(url, result)) >diff --git a/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm b/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm >index a7dad4815261a98c6c11d3448f3db218131a62da..98bdc27964a569a7798c19c7b5aac2c74e6d59f8 100644 >--- a/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm >+++ b/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm >@@ -105,7 +105,7 @@ SOFT_LINK_CLASS(QuickLook, QLItem); > [_item setPreviewItemProviderProgress:@(progress)]; > } > >-- (void)finish:(WebCore::URL)url >+- (void)finish:(URL)url > { > if (self.completionHandler) > self.completionHandler((NSURL*)url, nil); >@@ -221,7 +221,7 @@ void SystemPreviewController::updateProgress(float progress) > [m_qlPreviewControllerDataSource setProgress:progress]; > } > >-void SystemPreviewController::finish(WebCore::URL url) >+void SystemPreviewController::finish(URL url) > { > if (m_qlPreviewControllerDataSource) > [m_qlPreviewControllerDataSource finish:url]; >diff --git a/Source/WebKit/UIProcess/Cocoa/UIDelegate.h b/Source/WebKit/UIProcess/Cocoa/UIDelegate.h >index a623cc53f562b58f9aadce27636863698bd082c8..c0da3ffda10689fe13d0b336808ec82f92f1daae 100644 >--- a/Source/WebKit/UIProcess/Cocoa/UIDelegate.h >+++ b/Source/WebKit/UIProcess/Cocoa/UIDelegate.h >@@ -119,7 +119,7 @@ private: > void toolbarsAreVisible(WebPageProxy&, Function<void(bool)>&&) final; > bool runOpenPanel(WebPageProxy*, WebFrameProxy*, const WebCore::SecurityOriginData&, API::OpenPanelParameters*, WebOpenPanelResultListenerProxy*) final; > void didExceedBackgroundResourceLimitWhileInForeground(WebPageProxy&, WKResourceLimit) final; >- void saveDataToFileInDownloadsFolder(WebPageProxy*, const WTF::String&, const WTF::String&, const WebCore::URL&, API::Data&) final; >+ void saveDataToFileInDownloadsFolder(WebPageProxy*, const WTF::String&, const WTF::String&, const URL&, API::Data&) final; > #endif > bool needsFontAttributes() const final { return m_uiDelegate.m_delegateMethods.webViewDidChangeFontAttributes; } > void didChangeFontAttributes(const WebCore::FontAttributes&) final; >diff --git a/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm b/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm >index 5c7341ef30f22d63deccc998f10865bd25e6d973..a559a9c58fffc885095bc78cd68820e47ae2818b 100644 >--- a/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm >+++ b/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm >@@ -52,8 +52,8 @@ > #import "_WKHitTestResultInternal.h" > #import <WebCore/FontAttributes.h> > #import <WebCore/SecurityOriginData.h> >-#import <WebCore/URL.h> > #import <wtf/BlockPtr.h> >+#import <wtf/URL.h> > > #if PLATFORM(IOS_FAMILY) > #import <AVFoundation/AVCaptureDevice.h> >@@ -233,7 +233,7 @@ void UIDelegate::UIClient::createNewPage(WebPageProxy& page, Ref<API::FrameInfo> > > auto userInitiatedActivity = page.process().userInitiatedActivity(navigationActionData.userGestureTokenIdentifier); > bool shouldOpenAppLinks = !hostsAreEqual(sourceFrameInfo->request().url(), request.url()); >- auto apiNavigationAction = API::NavigationAction::create(WTFMove(navigationActionData), sourceFrameInfo.ptr(), nullptr, std::nullopt, WTFMove(request), WebCore::URL(), shouldOpenAppLinks, WTFMove(userInitiatedActivity)); >+ auto apiNavigationAction = API::NavigationAction::create(WTFMove(navigationActionData), sourceFrameInfo.ptr(), nullptr, std::nullopt, WTFMove(request), URL(), shouldOpenAppLinks, WTFMove(userInitiatedActivity)); > > auto apiWindowFeatures = API::WindowFeatures::create(windowFeatures); > >@@ -789,7 +789,7 @@ void UIDelegate::UIClient::showPage(WebPageProxy*) > [(id <WKUIDelegatePrivate>)delegate _showWebView:m_uiDelegate.m_webView]; > } > >-void UIDelegate::UIClient::saveDataToFileInDownloadsFolder(WebPageProxy*, const WTF::String& suggestedFilename, const WTF::String& mimeType, const WebCore::URL& originatingURL, API::Data& data) >+void UIDelegate::UIClient::saveDataToFileInDownloadsFolder(WebPageProxy*, const WTF::String& suggestedFilename, const WTF::String& mimeType, const URL& originatingURL, API::Data& data) > { > if (!m_uiDelegate.m_delegateMethods.webViewSaveDataToFileSuggestedFilenameMimeTypeOriginatingURL) > return; >@@ -867,8 +867,8 @@ static void requestUserMediaAuthorizationForDevices(const WebFrameProxy& frame, > }); > > const WebFrameProxy* mainFrame = frame.page()->mainFrame(); >- WebCore::URL requestFrameURL(WebCore::URL(), frame.url()); >- WebCore::URL mainFrameURL(WebCore::URL(), mainFrame->url()); >+ URL requestFrameURL(URL(), frame.url()); >+ URL mainFrameURL(URL(), mainFrame->url()); > > _WKCaptureDevices devices = 0; > if (request.requiresAudioCapture()) >@@ -984,8 +984,8 @@ bool UIDelegate::UIClient::checkUserMediaPermissionForOrigin(WebPageProxy& page, > > WKWebView *webView = m_uiDelegate.m_webView; > const WebFrameProxy* mainFrame = frame.page()->mainFrame(); >- WebCore::URL requestFrameURL(WebCore::URL(), frame.url()); >- WebCore::URL mainFrameURL(WebCore::URL(), mainFrame->url()); >+ URL requestFrameURL(URL(), frame.url()); >+ URL mainFrameURL(URL(), mainFrame->url()); > > auto decisionHandler = BlockPtr<void(NSString*, BOOL)>::fromCallable([protectedRequest = makeRef(request)](NSString*, BOOL authorized) { > protectedRequest->setUserMediaAccessInfo(authorized); >diff --git a/Source/WebKit/UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm b/Source/WebKit/UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm >index 5f99aec85da7524ba041e75eb08017399049b212..ae5765e48e71b87ff60d1405c3c7a3372515ca2a 100644 >--- a/Source/WebKit/UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm >+++ b/Source/WebKit/UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm >@@ -69,7 +69,7 @@ > if (!webFrameProxy) > return NO; > >- webFrameProxy->loadURL(WebCore::URL(WebCore::URL(), _urlString)); >+ webFrameProxy->loadURL(URL(URL(), _urlString)); > return YES; > } > >diff --git a/Source/WebKit/UIProcess/Cocoa/WKSafeBrowsingWarning.h b/Source/WebKit/UIProcess/Cocoa/WKSafeBrowsingWarning.h >index 07e149af8c463b4c22f6e142729d9da9207de7a1..56d405847da75be52ac5152e37b65fdcf287f702 100644 >--- a/Source/WebKit/UIProcess/Cocoa/WKSafeBrowsingWarning.h >+++ b/Source/WebKit/UIProcess/Cocoa/WKSafeBrowsingWarning.h >@@ -35,10 +35,6 @@ > #import <UIKit/UIKit.h> > #endif > >-namespace WebCore { >-class URL; >-} >- > namespace WebKit { > class SafeBrowsingWarning; > enum class ContinueUnsafeLoad : bool; >@@ -55,11 +51,11 @@ using RectType = CGRect; > #endif > { > @package >- CompletionHandler<void(Variant<WebKit::ContinueUnsafeLoad, WebCore::URL>&&)> _completionHandler; >+ CompletionHandler<void(Variant<WebKit::ContinueUnsafeLoad, URL>&&)> _completionHandler; > RefPtr<const WebKit::SafeBrowsingWarning> _warning; > WeakObjCPtr<WKSafeBrowsingTextView> _details; > } > >-- (instancetype)initWithFrame:(RectType)frame safeBrowsingWarning:(const WebKit::SafeBrowsingWarning&)warning completionHandler:(CompletionHandler<void(Variant<WebKit::ContinueUnsafeLoad, WebCore::URL>&&)>&&)completionHandler; >+- (instancetype)initWithFrame:(RectType)frame safeBrowsingWarning:(const WebKit::SafeBrowsingWarning&)warning completionHandler:(CompletionHandler<void(Variant<WebKit::ContinueUnsafeLoad, URL>&&)>&&)completionHandler; > > @end >diff --git a/Source/WebKit/UIProcess/Cocoa/WKSafeBrowsingWarning.mm b/Source/WebKit/UIProcess/Cocoa/WKSafeBrowsingWarning.mm >index afd47d080fa106f2eb6e58c0df170383202bf3fa..6095634fe5dd6f2593eafaf5f2149be4e63ed5c8 100644 >--- a/Source/WebKit/UIProcess/Cocoa/WKSafeBrowsingWarning.mm >+++ b/Source/WebKit/UIProcess/Cocoa/WKSafeBrowsingWarning.mm >@@ -29,7 +29,7 @@ > #import "PageClient.h" > #import "SafeBrowsingWarning.h" > #import <WebCore/LocalizedStrings.h> >-#import <WebCore/URL.h> >+#import <wtf/URL.h> > #import <wtf/BlockPtr.h> > #import <wtf/Language.h> > >@@ -229,7 +229,7 @@ static void setBackground(ViewType *view, ColorType *color) > > @implementation WKSafeBrowsingWarning > >-- (instancetype)initWithFrame:(RectType)frame safeBrowsingWarning:(const WebKit::SafeBrowsingWarning&)warning completionHandler:(CompletionHandler<void(Variant<WebKit::ContinueUnsafeLoad, WebCore::URL>&&)>&&)completionHandler >+- (instancetype)initWithFrame:(RectType)frame safeBrowsingWarning:(const WebKit::SafeBrowsingWarning&)warning completionHandler:(CompletionHandler<void(Variant<WebKit::ContinueUnsafeLoad, URL>&&)>&&)completionHandler > { > if (!(self = [super initWithFrame:frame])) { > completionHandler(WebKit::ContinueUnsafeLoad::Yes); >diff --git a/Source/WebKit/UIProcess/Cocoa/WebPasteboardProxyCocoa.mm b/Source/WebKit/UIProcess/Cocoa/WebPasteboardProxyCocoa.mm >index 552a12bc2714f721cf7a8675c1e832c360b00b4c..1710df19c42658f6f59c7c1807771af22e223dc2 100644 >--- a/Source/WebKit/UIProcess/Cocoa/WebPasteboardProxyCocoa.mm >+++ b/Source/WebKit/UIProcess/Cocoa/WebPasteboardProxyCocoa.mm >@@ -33,7 +33,7 @@ > #import <WebCore/PasteboardItemInfo.h> > #import <WebCore/PlatformPasteboard.h> > #import <WebCore/SharedBuffer.h> >-#import <WebCore/URL.h> >+#import <wtf/URL.h> > > namespace WebKit { > using namespace WebCore; >diff --git a/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h b/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h >index 5058216246ddcf09545bfcf72fb1b4520c0628e2..d80ef798a0104d612038623679e97c166611bfc0 100644 >--- a/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h >+++ b/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h >@@ -226,7 +226,7 @@ public: > void setViewScale(CGFloat); > CGFloat viewScale() const; > >- void showSafeBrowsingWarning(const SafeBrowsingWarning&, CompletionHandler<void(Variant<ContinueUnsafeLoad, WebCore::URL>&&)>&&); >+ void showSafeBrowsingWarning(const SafeBrowsingWarning&, CompletionHandler<void(Variant<ContinueUnsafeLoad, URL>&&)>&&); > void clearSafeBrowsingWarning(); > > WKLayoutMode layoutMode() const; >diff --git a/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm b/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm >index 79ee0aaa390fd169e4132098ef65b9d3c4429f88..f82da4a119fd2bf06965c0a07f77d476d84ee22a 100644 >--- a/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm >+++ b/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm >@@ -1615,7 +1615,7 @@ bool WebViewImpl::resignFirstResponder() > return true; > } > >-void WebViewImpl::showSafeBrowsingWarning(const SafeBrowsingWarning& warning, CompletionHandler<void(Variant<ContinueUnsafeLoad, WebCore::URL>&&)>&& completionHandler) >+void WebViewImpl::showSafeBrowsingWarning(const SafeBrowsingWarning& warning, CompletionHandler<void(Variant<ContinueUnsafeLoad, URL>&&)>&& completionHandler) > { > if (!m_view) > return completionHandler(ContinueUnsafeLoad::Yes); >@@ -4103,7 +4103,7 @@ void WebViewImpl::writeToURLForFilePromiseProvider(NSFilePromiseProvider *provid > return; > } > >- WebCore::URL blobURL { info.blobURL }; >+ URL blobURL { info.blobURL }; > if (blobURL.isEmpty()) { > completionHandler(webKitUnknownError()); > return; >diff --git a/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp b/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp >index b22e4f347cdeca728757e7d7144eec6c8c3cef3b..75102ee3b00424a4809415f36b04ed3b53cad148 100644 >--- a/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp >+++ b/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp >@@ -102,7 +102,7 @@ void DownloadProxy::setOriginatingPage(WebPageProxy* page) > } > > #if PLATFORM(COCOA) >-void DownloadProxy::publishProgress(const WebCore::URL& URL) >+void DownloadProxy::publishProgress(const URL& URL) > { > if (!m_processPool) > return; >diff --git a/Source/WebKit/UIProcess/Downloads/DownloadProxy.h b/Source/WebKit/UIProcess/Downloads/DownloadProxy.h >index f9b82436ce51800a8d3d37ef8410d7c5dd23ea5a..f24049957a2e8c26d97f5b58af06619358fbf26f 100644 >--- a/Source/WebKit/UIProcess/Downloads/DownloadProxy.h >+++ b/Source/WebKit/UIProcess/Downloads/DownloadProxy.h >@@ -45,7 +45,6 @@ class IntRect; > class ProtectionSpace; > class ResourceError; > class ResourceResponse; >-class URL; > } > > namespace WebKit { >@@ -75,8 +74,8 @@ public: > WebPageProxy* originatingPage() const; > void setOriginatingPage(WebPageProxy*); > >- void setRedirectChain(Vector<WebCore::URL>&& redirectChain) { m_redirectChain = WTFMove(redirectChain); } >- const Vector<WebCore::URL>& redirectChain() const { return m_redirectChain; } >+ void setRedirectChain(Vector<URL>&& redirectChain) { m_redirectChain = WTFMove(redirectChain); } >+ const Vector<URL>& redirectChain() const { return m_redirectChain; } > > void setWasUserInitiated(bool value) { m_wasUserInitiated = value; } > bool wasUserInitiated() const { return m_wasUserInitiated; } >@@ -96,7 +95,7 @@ public: > #endif > > #if PLATFORM(COCOA) >- void publishProgress(const WebCore::URL&); >+ void publishProgress(const URL&); > #endif > > private: >@@ -130,7 +129,7 @@ private: > uint64_t m_bytesLoaded { 0 }; > > WeakPtr<WebPageProxy> m_originatingPage; >- Vector<WebCore::URL> m_redirectChain; >+ Vector<URL> m_redirectChain; > bool m_wasUserInitiated { true }; > }; > >diff --git a/Source/WebKit/UIProcess/FrameLoadState.cpp b/Source/WebKit/UIProcess/FrameLoadState.cpp >index 9fe3c76561b255716a45bba38fe995a005977ffb..72f4f72455a7eb8a65b9e527e55a1f821ace08f9 100644 >--- a/Source/WebKit/UIProcess/FrameLoadState.cpp >+++ b/Source/WebKit/UIProcess/FrameLoadState.cpp >@@ -32,7 +32,7 @@ FrameLoadState::~FrameLoadState() > { > } > >-void FrameLoadState::didStartProvisionalLoad(const WebCore::URL& url) >+void FrameLoadState::didStartProvisionalLoad(const URL& url) > { > ASSERT(m_provisionalURL.isEmpty()); > >@@ -40,7 +40,7 @@ void FrameLoadState::didStartProvisionalLoad(const WebCore::URL& url) > m_provisionalURL = url; > } > >-void FrameLoadState::didReceiveServerRedirectForProvisionalLoad(const WebCore::URL& url) >+void FrameLoadState::didReceiveServerRedirectForProvisionalLoad(const URL& url) > { > ASSERT(m_state == State::Provisional); > >@@ -81,12 +81,12 @@ void FrameLoadState::didFailLoad() > m_state = State::Finished; > } > >-void FrameLoadState::didSameDocumentNotification(const WebCore::URL& url) >+void FrameLoadState::didSameDocumentNotification(const URL& url) > { > m_url = url; > } > >-void FrameLoadState::setUnreachableURL(const WebCore::URL& unreachableURL) >+void FrameLoadState::setUnreachableURL(const URL& unreachableURL) > { > m_lastUnreachableURL = m_unreachableURL; > m_unreachableURL = unreachableURL; >diff --git a/Source/WebKit/UIProcess/FrameLoadState.h b/Source/WebKit/UIProcess/FrameLoadState.h >index a89ad000cc10483767fe9f53cbaffc404da29dc0..ed3292092463b45b9a9eb313c7668183f01af52a 100644 >--- a/Source/WebKit/UIProcess/FrameLoadState.h >+++ b/Source/WebKit/UIProcess/FrameLoadState.h >@@ -25,7 +25,7 @@ > > #pragma once > >-#include <WebCore/URL.h> >+#include <wtf/URL.h> > > namespace WebKit { > >@@ -39,30 +39,30 @@ public: > Finished > }; > >- void didStartProvisionalLoad(const WebCore::URL&); >- void didReceiveServerRedirectForProvisionalLoad(const WebCore::URL&); >+ void didStartProvisionalLoad(const URL&); >+ void didReceiveServerRedirectForProvisionalLoad(const URL&); > void didFailProvisionalLoad(); > > void didCommitLoad(); > void didFinishLoad(); > void didFailLoad(); > >- void didSameDocumentNotification(const WebCore::URL&); >+ void didSameDocumentNotification(const URL&); > > State state() const { return m_state; } >- const WebCore::URL& url() const { return m_url; } >- void setURL(const WebCore::URL& url) { m_url = url; } >- const WebCore::URL& provisionalURL() const { return m_provisionalURL; } >+ const URL& url() const { return m_url; } >+ void setURL(const URL& url) { m_url = url; } >+ const URL& provisionalURL() const { return m_provisionalURL; } > >- void setUnreachableURL(const WebCore::URL&); >- const WebCore::URL& unreachableURL() const { return m_unreachableURL; } >+ void setUnreachableURL(const URL&); >+ const URL& unreachableURL() const { return m_unreachableURL; } > > private: > State m_state { State::Finished }; >- WebCore::URL m_url; >- WebCore::URL m_provisionalURL; >- WebCore::URL m_unreachableURL; >- WebCore::URL m_lastUnreachableURL; >+ URL m_url; >+ URL m_provisionalURL; >+ URL m_unreachableURL; >+ URL m_lastUnreachableURL; > }; > > } // namespace WebKit >diff --git a/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp b/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp >index c8eebf6b8e7474e04b9439c659bcd58dce7aaaec..fd986c235fef9032ede070efc6ee0d77108a9e98 100644 >--- a/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp >+++ b/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp >@@ -560,7 +560,7 @@ void NetworkProcessProxy::sendProcessDidResume() > send(Messages::NetworkProcess::ProcessDidResume(), 0); > } > >-void NetworkProcessProxy::writeBlobToFilePath(const WebCore::URL& url, const String& path, CompletionHandler<void(bool)>&& completionHandler) >+void NetworkProcessProxy::writeBlobToFilePath(const URL& url, const String& path, CompletionHandler<void(bool)>&& completionHandler) > { > if (!canSendMessage()) { > completionHandler(false); >diff --git a/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h b/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h >index 0969dc9c1b5a1b753c08c0753fb5c27456f05c8b..7e492387e85e024393ba16e9425db39e66c87ade 100644 >--- a/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h >+++ b/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h >@@ -49,7 +49,6 @@ class ProtectionSpace; > class ResourceRequest; > enum class ShouldSample : bool; > class SecurityOrigin; >-class URL; > struct SecurityOriginData; > } > >@@ -88,7 +87,7 @@ public: > void resetCacheMaxAgeCapForPrevalentResources(PAL::SessionID, CompletionHandler<void()>&&); > #endif > >- void writeBlobToFilePath(const WebCore::URL&, const String& path, CompletionHandler<void(bool)>&&); >+ void writeBlobToFilePath(const URL&, const String& path, CompletionHandler<void(bool)>&&); > > void processReadyToSuspend(); > >diff --git a/Source/WebKit/UIProcess/PageClient.h b/Source/WebKit/UIProcess/PageClient.h >index ee852b249977b8fd70702d887854127308f194e5..df6ec005c468b425b9be55f682f02ede5aac61be 100644 >--- a/Source/WebKit/UIProcess/PageClient.h >+++ b/Source/WebKit/UIProcess/PageClient.h >@@ -33,11 +33,11 @@ > #include "WebPopupMenuProxy.h" > #include <WebCore/AlternativeTextClient.h> > #include <WebCore/EditorClient.h> >-#include <WebCore/URL.h> > #include <WebCore/UserInterfaceLayoutDirection.h> > #include <WebCore/ValidationBubble.h> > #include <wtf/CompletionHandler.h> > #include <wtf/Forward.h> >+#include <wtf/URL.h> > #include <wtf/Variant.h> > #include <wtf/WeakPtr.h> > >@@ -216,7 +216,7 @@ public: > > virtual void didChangeContentSize(const WebCore::IntSize&) = 0; > >- virtual void showSafeBrowsingWarning(const SafeBrowsingWarning&, CompletionHandler<void(Variant<ContinueUnsafeLoad, WebCore::URL>&&)>&& completionHandler) { completionHandler(ContinueUnsafeLoad::Yes); } >+ virtual void showSafeBrowsingWarning(const SafeBrowsingWarning&, CompletionHandler<void(Variant<ContinueUnsafeLoad, URL>&&)>&& completionHandler) { completionHandler(ContinueUnsafeLoad::Yes); } > virtual void clearSafeBrowsingWarning() { } > > #if ENABLE(DRAG_SUPPORT) >diff --git a/Source/WebKit/UIProcess/PageLoadState.cpp b/Source/WebKit/UIProcess/PageLoadState.cpp >index 1759f8a49367d052e5fcae5173da26725397f660..2ed1075c600ebddea5e4ff54faa91ddd5f5be2cf 100644 >--- a/Source/WebKit/UIProcess/PageLoadState.cpp >+++ b/Source/WebKit/UIProcess/PageLoadState.cpp >@@ -206,9 +206,9 @@ bool PageLoadState::hasOnlySecureContent(const Data& data) > return false; > > if (data.state == State::Provisional) >- return WebCore::protocolIs(data.provisionalURL, "https"); >+ return WTF::protocolIs(data.provisionalURL, "https"); > >- return WebCore::protocolIs(data.url, "https"); >+ return WTF::protocolIs(data.url, "https"); > } > > bool PageLoadState::hasOnlySecureContent() const >diff --git a/Source/WebKit/UIProcess/Plugins/PluginInfoStore.cpp b/Source/WebKit/UIProcess/Plugins/PluginInfoStore.cpp >index 231075ac3599bad1d19ad4d7c42fc72ff98cda03..5132b83bfaaaa13f476a663651cd36200664aef9 100644 >--- a/Source/WebKit/UIProcess/Plugins/PluginInfoStore.cpp >+++ b/Source/WebKit/UIProcess/Plugins/PluginInfoStore.cpp >@@ -31,10 +31,10 @@ > #include "PluginModuleInfo.h" > #include <WebCore/MIMETypeRegistry.h> > #include <WebCore/SecurityOrigin.h> >-#include <WebCore/URL.h> > #include <algorithm> > #include <wtf/ListHashSet.h> > #include <wtf/StdLibExtras.h> >+#include <wtf/URL.h> > > namespace WebKit { > using namespace WebCore; >diff --git a/Source/WebKit/UIProcess/Plugins/PluginInfoStore.h b/Source/WebKit/UIProcess/Plugins/PluginInfoStore.h >index 6e9eefc8f5f438ae89a2f25ac882b5507fee1b34..55597f344bf5139b9f5673c30f88c728157af99e 100644 >--- a/Source/WebKit/UIProcess/Plugins/PluginInfoStore.h >+++ b/Source/WebKit/UIProcess/Plugins/PluginInfoStore.h >@@ -31,10 +31,6 @@ > > #include <WebCore/PluginData.h> > >-namespace WebCore { >-class URL; >-} >- > namespace WebKit { > > class PluginInfoStore; >@@ -53,7 +49,7 @@ public: > // Returns the info for a plug-in that can handle the given MIME type. > // If the MIME type is null, the file extension of the given url will be used to infer the > // plug-in type. In that case, mimeType will be filled in with the right MIME type. >- PluginModuleInfo findPlugin(String& mimeType, const WebCore::URL&, WebCore::PluginData::AllowedPluginTypes = WebCore::PluginData::AllPlugins); >+ PluginModuleInfo findPlugin(String& mimeType, const URL&, WebCore::PluginData::AllowedPluginTypes = WebCore::PluginData::AllPlugins); > > // Returns the info for the plug-in with the given bundle identifier. > PluginModuleInfo findPluginWithBundleIdentifier(const String& bundleIdentifier); >@@ -63,7 +59,7 @@ public: > > static PluginModuleLoadPolicy defaultLoadPolicyForPlugin(const PluginModuleInfo&); > >- bool isSupportedPlugin(const String& mimeType, const WebCore::URL& pluginURL, const String& frameURLString, const WebCore::URL& pageURL); >+ bool isSupportedPlugin(const String& mimeType, const URL& pluginURL, const String& frameURLString, const URL& pageURL); > std::optional<Vector<WebCore::SupportedPluginIdentifier>> supportedPluginIdentifiers(); > void addSupportedPlugin(String&& matchingDomain, String&& identifier, HashSet<String>&& mimeTypes, HashSet<String> extensions); > void clearSupportedPlugins() { m_supportedPlugins = std::nullopt; } >@@ -104,7 +100,7 @@ private: > HashSet<String> mimeTypes; > HashSet<String> extensions; > }; >- static bool isSupportedPlugin(const SupportedPlugin&, const String& mimeType, const WebCore::URL& pluginURL); >+ static bool isSupportedPlugin(const SupportedPlugin&, const String& mimeType, const URL& pluginURL); > > std::optional<Vector<SupportedPlugin>> m_supportedPlugins; > }; >diff --git a/Source/WebKit/UIProcess/Plugins/mac/PluginProcessProxyMac.mm b/Source/WebKit/UIProcess/Plugins/mac/PluginProcessProxyMac.mm >index 87b5b8c678e59f9be8059fae04ebb2b0ac16c5a5..89fab5ecb666d2b44fcc2239ebe5ba5ee1ac63d8 100644 >--- a/Source/WebKit/UIProcess/Plugins/mac/PluginProcessProxyMac.mm >+++ b/Source/WebKit/UIProcess/Plugins/mac/PluginProcessProxyMac.mm >@@ -34,12 +34,12 @@ > #import "SandboxUtilities.h" > #import <QuartzCore/CARemoteLayerServer.h> > #import <WebCore/FileSystem.h> >-#import <WebCore/URL.h> > #import <crt_externs.h> > #import <mach-o/dyld.h> > #import <pal/spi/cf/CFNetworkSPI.h> > #import <spawn.h> > #import <wtf/ProcessPrivilege.h> >+#import <wtf/URL.h> > #import <wtf/text/CString.h> > > @interface WKPlaceholderModalWindow : NSWindow >diff --git a/Source/WebKit/UIProcess/SafeBrowsingResult.h b/Source/WebKit/UIProcess/SafeBrowsingResult.h >new file mode 100644 >index 0000000000000000000000000000000000000000..3422047ab2080b69bcbb8d33838a72d8cae996a6 >--- /dev/null >+++ b/Source/WebKit/UIProcess/SafeBrowsingResult.h >@@ -0,0 +1,63 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include <wtf/RefCounted.h> >+#include <wtf/URL.h> >+#include <wtf/text/WTFString.h> >+ >+OBJC_CLASS SSBServiceLookupResult; >+ >+namespace WebKit { >+ >+class SafeBrowsingResult : public RefCounted<SafeBrowsingResult> { >+public: >+#if HAVE(SAFE_BROWSING) >+ static Ref<SafeBrowsingResult> create(URL&& url, SSBServiceLookupResult *result) >+ { >+ return adoptRef(*new SafeBrowsingResult(WTFMove(url), result)); >+ } >+#endif >+ const URL& url() const { return m_url; } >+ const String& provider() const { return m_provider; } >+ bool isPhishing() const { return m_isPhishing; } >+ bool isMalware() const { return m_isMalware; } >+ bool isUnwantedSoftware() const { return m_isUnwantedSoftware; } >+ bool isKnownToBeUnsafe() const { return m_isKnownToBeUnsafe; } >+ >+private: >+#if HAVE(SAFE_BROWSING) >+ SafeBrowsingResult(URL&&, SSBServiceLookupResult *); >+#endif >+ URL m_url; >+ String m_provider; >+ bool m_isPhishing { false }; >+ bool m_isMalware { false }; >+ bool m_isUnwantedSoftware { false }; >+ bool m_isKnownToBeUnsafe { false }; >+}; >+ >+} // namespace WebKit >diff --git a/Source/WebKit/UIProcess/SafeBrowsingWarning.h b/Source/WebKit/UIProcess/SafeBrowsingWarning.h >index 616f478ca7e942f77fc44f7f11ec4051eff79fe0..8dcb125d5e72cb6c050c392ce14f25553f15280e 100644 >--- a/Source/WebKit/UIProcess/SafeBrowsingWarning.h >+++ b/Source/WebKit/UIProcess/SafeBrowsingWarning.h >@@ -25,7 +25,7 @@ > > #pragma once > >-#include <WebCore/URL.h> >+#include <wtf/URL.h> > #include <wtf/RefCounted.h> > #include <wtf/RetainPtr.h> > #include <wtf/text/WTFString.h> >@@ -39,7 +39,7 @@ namespace WebKit { > class SafeBrowsingWarning : public RefCounted<SafeBrowsingWarning> { > public: > #if HAVE(SAFE_BROWSING) >- static Ref<SafeBrowsingWarning> create(const WebCore::URL& url, SSBServiceLookupResult *result) >+ static Ref<SafeBrowsingWarning> create(const URL& url, SSBServiceLookupResult *result) > { > return adoptRef(*new SafeBrowsingWarning(url, result)); > } >@@ -62,7 +62,7 @@ public: > > private: > #if HAVE(SAFE_BROWSING) >- SafeBrowsingWarning(const WebCore::URL&, SSBServiceLookupResult *); >+ SafeBrowsingWarning(const URL&, SSBServiceLookupResult *); > #endif > #if PLATFORM(COCOA) > SafeBrowsingWarning(String&&, String&&, RetainPtr<NSAttributedString>&&); >diff --git a/Source/WebKit/UIProcess/SuspendedPageProxy.cpp b/Source/WebKit/UIProcess/SuspendedPageProxy.cpp >index ebade88ea1b52e63ede4e7685ca08ff28349f4da..1497361393d532853dd1df8666c8ab5ba70e9836 100644 >--- a/Source/WebKit/UIProcess/SuspendedPageProxy.cpp >+++ b/Source/WebKit/UIProcess/SuspendedPageProxy.cpp >@@ -33,8 +33,8 @@ > #include "WebProcessMessages.h" > #include "WebProcessPool.h" > #include "WebProcessProxy.h" >-#include <WebCore/URL.h> > #include <wtf/DebugUtilities.h> >+#include <wtf/URL.h> > > namespace WebKit { > using namespace WebCore; >diff --git a/Source/WebKit/UIProcess/SystemPreviewController.h b/Source/WebKit/UIProcess/SystemPreviewController.h >index 949c8df721ed9ed35a7da68ec7cf91279ef90a31..269d0c32fb32084b57e7d16b0ccf25cef74f9c26 100644 >--- a/Source/WebKit/UIProcess/SystemPreviewController.h >+++ b/Source/WebKit/UIProcess/SystemPreviewController.h >@@ -29,8 +29,8 @@ > > #include <WebCore/IntRect.h> > #include <WebCore/ResourceError.h> >-#include <WebCore/URL.h> > #include <wtf/RetainPtr.h> >+#include <wtf/URL.h> > > #if USE(QUICK_LOOK) > OBJC_CLASS QLPreviewController; >@@ -50,7 +50,7 @@ public: > > void start(const String& mimeType, const WebCore::IntRect&); > void updateProgress(float); >- void finish(WebCore::URL); >+ void finish(URL); > void cancel(); > void fail(const WebCore::ResourceError&); > >diff --git a/Source/WebKit/UIProcess/WebCookieManagerProxy.h b/Source/WebKit/UIProcess/WebCookieManagerProxy.h >index e33167a8950c168f01c032ceb9e5f8f981e51380..9f240d3021edf86c7caed7e8145951ded3260e1b 100644 >--- a/Source/WebKit/UIProcess/WebCookieManagerProxy.h >+++ b/Source/WebKit/UIProcess/WebCookieManagerProxy.h >@@ -71,10 +71,10 @@ public: > void deleteAllCookiesModifiedSince(PAL::SessionID, WallTime, Function<void (CallbackBase::Error)>&&); > > void setCookie(PAL::SessionID, const WebCore::Cookie&, Function<void (CallbackBase::Error)>&&); >- void setCookies(PAL::SessionID, const Vector<WebCore::Cookie>&, const WebCore::URL&, const WebCore::URL& mainDocumentURL, Function<void (CallbackBase::Error)>&&); >+ void setCookies(PAL::SessionID, const Vector<WebCore::Cookie>&, const URL&, const URL& mainDocumentURL, Function<void(CallbackBase::Error)>&&); > > void getAllCookies(PAL::SessionID, Function<void (const Vector<WebCore::Cookie>&, CallbackBase::Error)>&& completionHandler); >- void getCookies(PAL::SessionID, const WebCore::URL&, Function<void (const Vector<WebCore::Cookie>&, CallbackBase::Error)>&& completionHandler); >+ void getCookies(PAL::SessionID, const URL&, Function<void(const Vector<WebCore::Cookie>&, CallbackBase::Error)>&& completionHandler); > > void setHTTPCookieAcceptPolicy(PAL::SessionID, HTTPCookieAcceptPolicy, Function<void (CallbackBase::Error)>&&); > void getHTTPCookieAcceptPolicy(PAL::SessionID, Function<void (HTTPCookieAcceptPolicy, CallbackBase::Error)>&&); >diff --git a/Source/WebKit/UIProcess/WebFrameProxy.h b/Source/WebKit/UIProcess/WebFrameProxy.h >index 624d806f1da3a526a0fdb5002d09b46c3701c773..66238d11bc791fedd8eecfeb7ec45c7cb2368330 100644 >--- a/Source/WebKit/UIProcess/WebFrameProxy.h >+++ b/Source/WebKit/UIProcess/WebFrameProxy.h >@@ -80,14 +80,14 @@ public: > > FrameLoadState& frameLoadState() { return m_frameLoadState; } > >- void loadURL(const WebCore::URL&); >+ void loadURL(const URL&); > void stopLoading() const; > >- const WebCore::URL& url() const { return m_frameLoadState.url(); } >- const WebCore::URL& provisionalURL() const { return m_frameLoadState.provisionalURL(); } >+ const URL& url() const { return m_frameLoadState.url(); } >+ const URL& provisionalURL() const { return m_frameLoadState.provisionalURL(); } > >- void setUnreachableURL(const WebCore::URL&); >- const WebCore::URL& unreachableURL() const { return m_frameLoadState.unreachableURL(); } >+ void setUnreachableURL(const URL&); >+ const URL& unreachableURL() const { return m_frameLoadState.unreachableURL(); } > > const String& mimeType() const { return m_MIMEType; } > bool containsPluginDocument() const { return m_containsPluginDocument; } >@@ -108,13 +108,13 @@ public: > void getMainResourceData(Function<void (API::Data*, CallbackBase::Error)>&&); > void getResourceData(API::URL*, Function<void (API::Data*, CallbackBase::Error)>&&); > >- void didStartProvisionalLoad(const WebCore::URL&); >- void didReceiveServerRedirectForProvisionalLoad(const WebCore::URL&); >+ void didStartProvisionalLoad(const URL&); >+ void didReceiveServerRedirectForProvisionalLoad(const URL&); > void didFailProvisionalLoad(); > void didCommitLoad(const String& contentType, WebCertificateInfo&, bool containsPluginDocument); > void didFinishLoad(); > void didFailLoad(); >- void didSameDocumentNavigation(const WebCore::URL&); // eg. anchor navigation, session state change. >+ void didSameDocumentNavigation(const URL&); // eg. anchor navigation, session state change. > void didChangeTitle(const String&); > > WebFramePolicyListenerProxy& setUpPolicyListenerProxy(CompletionHandler<void(WebCore::PolicyAction, API::WebsitePolicies*, ProcessSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&&)>&&, ShouldExpectSafeBrowsingResult); >diff --git a/Source/WebKit/UIProcess/WebInspectorProxy.h b/Source/WebKit/UIProcess/WebInspectorProxy.h >index 7334b4eeeada10f40b45c2a3d6a85ee426726365..3ff7fd45e59b2aea4fef384a8a2266d3f243ec72 100644 >--- a/Source/WebKit/UIProcess/WebInspectorProxy.h >+++ b/Source/WebKit/UIProcess/WebInspectorProxy.h >@@ -53,7 +53,6 @@ OBJC_CLASS WKInspectorViewController; > > namespace WebCore { > class CertificateInfo; >-class URL; > } > > namespace WebKit { >@@ -157,7 +156,7 @@ public: > static String inspectorPageURL(); > static String inspectorTestPageURL(); > static String inspectorBaseURL(); >- static bool isMainOrTestInspectorPage(const WebCore::URL&); >+ static bool isMainOrTestInspectorPage(const URL&); > > static const unsigned minimumWindowWidth; > static const unsigned minimumWindowHeight; >diff --git a/Source/WebKit/UIProcess/WebOpenPanelResultListenerProxy.cpp b/Source/WebKit/UIProcess/WebOpenPanelResultListenerProxy.cpp >index 9d2b9ad4d5da98d20f7f97afcd48054653e3baa7..85746515da67d142af7dfad88de8a48a83f61c10 100644 >--- a/Source/WebKit/UIProcess/WebOpenPanelResultListenerProxy.cpp >+++ b/Source/WebKit/UIProcess/WebOpenPanelResultListenerProxy.cpp >@@ -29,7 +29,7 @@ > #include "APIArray.h" > #include "APIString.h" > #include "WebPageProxy.h" >-#include <WebCore/URL.h> >+#include <wtf/URL.h> > #include <wtf/Vector.h> > > namespace WebKit { >diff --git a/Source/WebKit/UIProcess/WebPageProxy.cpp b/Source/WebKit/UIProcess/WebPageProxy.cpp >index 5ffb2bff6e65a2bc000c0189baee0b3b18ce39f6..957b3a48f166bfcf2b3382ef601396b918fc3a3d 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.cpp >+++ b/Source/WebKit/UIProcess/WebPageProxy.cpp >@@ -158,13 +158,13 @@ > #include <WebCore/ShouldTreatAsContinuingLoad.h> > #include <WebCore/TextCheckerClient.h> > #include <WebCore/TextIndicator.h> >-#include <WebCore/URL.h> >-#include <WebCore/URLParser.h> > #include <WebCore/ValidationBubble.h> > #include <WebCore/WindowFeatures.h> > #include <stdio.h> > #include <wtf/NeverDestroyed.h> > #include <wtf/SystemTracing.h> >+#include <wtf/URL.h> >+#include <wtf/URLParser.h> > #include <wtf/text/StringView.h> > #include <wtf/text/TextStream.h> > >@@ -1142,7 +1142,7 @@ void WebPageProxy::loadDataWithNavigation(API::Navigation& navigation, const IPC > > auto transaction = m_pageLoadState.transaction(); > >- m_pageLoadState.setPendingAPIRequestURL(transaction, !baseURL.isEmpty() ? baseURL : blankURL().string()); >+ m_pageLoadState.setPendingAPIRequestURL(transaction, !baseURL.isEmpty() ? baseURL : WTF::blankURL().string()); > > if (!isValid()) > reattachToWebProcess(); >@@ -1161,7 +1161,7 @@ void WebPageProxy::loadDataWithNavigation(API::Navigation& navigation, const IPC > m_process->responsivenessTimer().start(); > } > >-void WebPageProxy::loadAlternateHTML(const IPC::DataReference& htmlData, const String& encoding, const WebCore::URL& baseURL, const WebCore::URL& unreachableURL, API::Object* userData) >+void WebPageProxy::loadAlternateHTML(const IPC::DataReference& htmlData, const String& encoding, const URL& baseURL, const URL& unreachableURL, API::Object* userData) > { > // When the UIProcess is in the process of handling a failing provisional load, do not attempt to > // start a second alternative HTML load as this will prevent the page load state from being >@@ -1209,7 +1209,7 @@ void WebPageProxy::loadWebArchiveData(API::Data* webArchiveData, API::Object* us > reattachToWebProcess(); > > auto transaction = m_pageLoadState.transaction(); >- m_pageLoadState.setPendingAPIRequestURL(transaction, blankURL().string()); >+ m_pageLoadState.setPendingAPIRequestURL(transaction, WTF::blankURL().string()); > > LoadParameters loadParameters; > loadParameters.navigationID = 0; >@@ -1228,7 +1228,7 @@ void WebPageProxy::navigateToPDFLinkWithSimulatedClick(const String& url, IntPoi > if (m_isClosed) > return; > >- if (WebCore::protocolIsJavaScript(url)) >+ if (WTF::protocolIsJavaScript(url)) > return; > > if (!isValid()) >@@ -2663,7 +2663,7 @@ void WebPageProxy::continueNavigationInNewProcess(API::Navigation& navigation, R > > Ref<WebProcessProxy> previousProcess = m_process.copyRef(); > std::optional<uint64_t> mainFrameIDInPreviousProcess = m_mainFrame ? std::make_optional(m_mainFrame->frameID()) : std::nullopt; >- auto mainFrameURL = m_mainFrame ? m_mainFrame->url() : WebCore::URL(); >+ auto mainFrameURL = m_mainFrame ? m_mainFrame->url() : URL(); > > ASSERT(m_process.ptr() != process.ptr()); > >@@ -3660,7 +3660,7 @@ void WebPageProxy::didDestroyNavigation(uint64_t navigationID) > m_navigationState->didDestroyNavigation(navigationID); > } > >-void WebPageProxy::didStartProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, WebCore::URL&& url, WebCore::URL&& unreachableURL, const UserData& userData) >+void WebPageProxy::didStartProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, URL&& url, URL&& unreachableURL, const UserData& userData) > { > PageClientProtector protector(pageClient()); > >@@ -3758,7 +3758,7 @@ void WebPageProxy::didCancelClientRedirectForFrame(uint64_t frameID) > m_navigationClient->didCancelClientRedirect(*this); > } > >-void WebPageProxy::didChangeProvisionalURLForFrame(uint64_t frameID, uint64_t, WebCore::URL&& url) >+void WebPageProxy::didChangeProvisionalURLForFrame(uint64_t frameID, uint64_t, URL&& url) > { > PageClientProtector protector(pageClient()); > >@@ -4033,7 +4033,7 @@ void WebPageProxy::didFailLoadForFrame(uint64_t frameID, uint64_t navigationID, > } > } > >-void WebPageProxy::didSameDocumentNavigationForFrame(uint64_t frameID, uint64_t navigationID, uint32_t opaqueSameDocumentNavigationType, WebCore::URL&& url, const UserData& userData) >+void WebPageProxy::didSameDocumentNavigationForFrame(uint64_t frameID, uint64_t navigationID, uint32_t opaqueSameDocumentNavigationType, URL&& url, const UserData& userData) > { > PageClientProtector protector(pageClient()); > >@@ -4441,7 +4441,7 @@ void WebPageProxy::willSubmitForm(uint64_t frameID, uint64_t sourceFrameID, cons > }); > } > >-void WebPageProxy::contentRuleListNotification(WebCore::URL&& url, Vector<String>&& identifiers, Vector<String>&& notifications) >+void WebPageProxy::contentRuleListNotification(URL&& url, Vector<String>&& identifiers, Vector<String>&& notifications) > { > m_navigationClient->contentRuleListNotification(*this, WTFMove(url), WTFMove(identifiers), WTFMove(notifications)); > } >@@ -6157,7 +6157,7 @@ void WebPageProxy::processDidTerminate(ProcessTerminationReason reason) > > #if PLATFORM(IOS_FAMILY) > if (m_process->isUnderMemoryPressure()) { >- String domain = WebCore::topPrivatelyControlledDomain(WebCore::URL({ }, currentURL()).host().toString()); >+ String domain = WebCore::topPrivatelyControlledDomain(URL({ }, currentURL()).host().toString()); > if (!domain.isEmpty()) > logDiagnosticMessageWithEnhancedPrivacy(WebCore::DiagnosticLoggingKeys::domainCausingJetsamKey(), domain, WebCore::ShouldSample::No); > } >@@ -7240,7 +7240,7 @@ void WebPageProxy::unwrapCryptoKey(const Vector<uint8_t>& wrappedKey, bool& succ > } > #endif > >-void WebPageProxy::signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String& challengeString, const WebCore::URL& url, String& result) >+void WebPageProxy::signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String& challengeString, const URL& url, String& result) > { > PageClientProtector protector(pageClient()); > >@@ -7901,9 +7901,9 @@ void WebPageProxy::requestPointerUnlock() > > void WebPageProxy::setURLSchemeHandlerForScheme(Ref<WebURLSchemeHandler>&& handler, const String& scheme) > { >- auto canonicalizedScheme = URLParser::maybeCanonicalizeScheme(scheme); >+ auto canonicalizedScheme = WTF::URLParser::maybeCanonicalizeScheme(scheme); > ASSERT(canonicalizedScheme); >- ASSERT(!URLParser::isSpecialScheme(canonicalizedScheme.value())); >+ ASSERT(!WTF::URLParser::isSpecialScheme(canonicalizedScheme.value())); > > auto schemeResult = m_urlSchemeHandlersByScheme.add(canonicalizedScheme.value(), handler.get()); > ASSERT_UNUSED(schemeResult, schemeResult.isNewEntry); >diff --git a/Source/WebKit/UIProcess/WebPageProxy.h b/Source/WebKit/UIProcess/WebPageProxy.h >index b72b00602898c977aca5f7e26019b3a8123f4008..40e2d50a76765a0ac78df22ec6c20d611c702a1c 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.h >+++ b/Source/WebKit/UIProcess/WebPageProxy.h >@@ -83,7 +83,6 @@ > #include <WebCore/SearchPopupMenu.h> > #include <WebCore/TextChecking.h> > #include <WebCore/TextGranularity.h> >-#include <WebCore/URL.h> > #include <WebCore/UserInterfaceLayoutDirection.h> > #include <memory> > #include <wtf/CompletionHandler.h> >@@ -95,6 +94,7 @@ > #include <wtf/Ref.h> > #include <wtf/RefPtr.h> > #include <wtf/RunLoop.h> >+#include <wtf/URL.h> > #include <wtf/UniqueRef.h> > #include <wtf/Vector.h> > #include <wtf/text/WTFString.h> >@@ -479,7 +479,7 @@ public: > RefPtr<API::Navigation> loadRequest(WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy = WebCore::ShouldOpenExternalURLsPolicy::ShouldAllowExternalSchemes, API::Object* userData = nullptr); > RefPtr<API::Navigation> loadFile(const String& fileURL, const String& resourceDirectoryURL, API::Object* userData = nullptr); > RefPtr<API::Navigation> loadData(const IPC::DataReference&, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData = nullptr); >- void loadAlternateHTML(const IPC::DataReference&, const String& encoding, const WebCore::URL& baseURL, const WebCore::URL& unreachableURL, API::Object* userData = nullptr); >+ void loadAlternateHTML(const IPC::DataReference&, const String& encoding, const URL& baseURL, const URL& unreachableURL, API::Object* userData = nullptr); > void loadWebArchiveData(API::Data*, API::Object* userData = nullptr); > void navigateToPDFLinkWithSimulatedClick(const String& url, WebCore::IntPoint documentPoint, WebCore::IntPoint screenPoint); > >@@ -1092,8 +1092,8 @@ public: > void handleAlternativeTextUIResult(const String& result); > #endif > >- void saveDataToFileInDownloadsFolder(String&& suggestedFilename, String&& mimeType, WebCore::URL&& originatingURL, API::Data&); >- void savePDFToFileInDownloadsFolder(String&& suggestedFilename, WebCore::URL&& originatingURL, const IPC::DataReference&); >+ void saveDataToFileInDownloadsFolder(String&& suggestedFilename, String&& mimeType, URL&& originatingURL, API::Data&); >+ void savePDFToFileInDownloadsFolder(String&& suggestedFilename, URL&& originatingURL, const IPC::DataReference&); > #if PLATFORM(COCOA) > void savePDFToTemporaryFolderAndOpenWithNativeApplicationRaw(const String& suggestedFilename, const String& originatingURLString, const uint8_t* data, unsigned long size, const String& pdfUUID); > void savePDFToTemporaryFolderAndOpenWithNativeApplication(const String& suggestedFilename, const String& originatingURLString, const IPC::DataReference&, const String& pdfUUID); >@@ -1206,7 +1206,7 @@ public: > void unwrapCryptoKey(const Vector<uint8_t>&, bool& succeeded, Vector<uint8_t>&); > #endif > >- void signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String& challengeString, const WebCore::URL&, String& result); >+ void signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String& challengeString, const URL&, String& result); > > void takeSnapshot(WebCore::IntRect, WebCore::IntSize bitmapSize, SnapshotOptions, WTF::Function<void (const ShareableBitmap::Handle&, CallbackBase::Error)>&&); > >@@ -1380,7 +1380,7 @@ public: > void getApplicationManifest(Function<void(const std::optional<WebCore::ApplicationManifest>&, CallbackBase::Error)>&&); > #endif > >- void writeBlobToFilePath(const WebCore::URL& blobURL, const String& path, Function<void(bool success)>&&); >+ void writeBlobToFilePath(const URL& blobURL, const String& path, Function<void(bool success)>&&); > > WebPreferencesStore preferencesStore() const; > >@@ -1450,17 +1450,17 @@ private: > void didCreateSubframe(uint64_t frameID); > void didCreateWindow(uint64_t frameID, WebCore::GlobalWindowIdentifier&&); > >- void didStartProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, WebCore::URL&&, WebCore::URL&& unreachableURL, const UserData&); >+ void didStartProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, URL&&, URL&& unreachableURL, const UserData&); > void didReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, WebCore::ResourceRequest&&, const UserData&); > void willPerformClientRedirectForFrame(uint64_t frameID, const String& url, double delay, WebCore::LockBackForwardList); > void didCancelClientRedirectForFrame(uint64_t frameID); >- void didChangeProvisionalURLForFrame(uint64_t frameID, uint64_t navigationID, WebCore::URL&&); >+ void didChangeProvisionalURLForFrame(uint64_t frameID, uint64_t navigationID, URL&&); > void didFailProvisionalLoadForFrame(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, const String& provisionalURL, const WebCore::ResourceError&, const UserData&); > void didCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, const String& mimeType, bool frameHasCustomContentProvider, uint32_t frameLoadType, const WebCore::CertificateInfo&, bool containsPluginDocument, std::optional<WebCore::HasInsecureContent> forcedHasInsecureContent, const UserData&); > void didFinishDocumentLoadForFrame(uint64_t frameID, uint64_t navigationID, const UserData&); > void didFinishLoadForFrame(uint64_t frameID, uint64_t navigationID, const UserData&); > void didFailLoadForFrame(uint64_t frameID, uint64_t navigationID, const WebCore::ResourceError&, const UserData&); >- void didSameDocumentNavigationForFrame(uint64_t frameID, uint64_t navigationID, uint32_t sameDocumentNavigationType, WebCore::URL&&, const UserData&); >+ void didSameDocumentNavigationForFrame(uint64_t frameID, uint64_t navigationID, uint32_t sameDocumentNavigationType, URL&&, const UserData&); > void didChangeMainDocument(uint64_t frameID); > > void didReceiveTitleForFrame(uint64_t frameID, const String&, const UserData&); >@@ -1486,11 +1486,11 @@ private: > void decidePolicyForNewWindowAction(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, NavigationActionData&&, WebCore::ResourceRequest&&, const String& frameName, uint64_t listenerID, const UserData&); > void decidePolicyForResponse(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, uint64_t listenerID, const UserData&); > void unableToImplementPolicy(uint64_t frameID, const WebCore::ResourceError&, const UserData&); >- void beginSafeBrowsingCheck(const WebCore::URL&, WebFramePolicyListenerProxy&); >+ void beginSafeBrowsingCheck(const URL&, WebFramePolicyListenerProxy&); > > void willSubmitForm(uint64_t frameID, uint64_t sourceFrameID, const Vector<std::pair<String, String>>& textFieldValues, uint64_t listenerID, const UserData&); > >- void contentRuleListNotification(WebCore::URL&&, Vector<String>&& identifiers, Vector<String>&& notifications); >+ void contentRuleListNotification(URL&&, Vector<String>&& identifiers, Vector<String>&& notifications); > > // History client > void didNavigateWithNavigationData(const WebNavigationDataStore&, uint64_t frameID); >@@ -1511,8 +1511,8 @@ private: > void unavailablePluginButtonClicked(uint32_t opaquePluginUnavailabilityReason, const String& mimeType, const String& pluginURLString, const String& pluginsPageURLString, const String& frameURLString, const String& pageURLString); > #endif // ENABLE(NETSCAPE_PLUGIN_API) > #if ENABLE(WEBGL) >- void webGLPolicyForURL(WebCore::URL&&, Messages::WebPageProxy::WebGLPolicyForURL::DelayedReply&&); >- void resolveWebGLPolicyForURL(WebCore::URL&&, Messages::WebPageProxy::ResolveWebGLPolicyForURL::DelayedReply&&); >+ void webGLPolicyForURL(URL&&, Messages::WebPageProxy::WebGLPolicyForURL::DelayedReply&&); >+ void resolveWebGLPolicyForURL(URL&&, Messages::WebPageProxy::ResolveWebGLPolicyForURL::DelayedReply&&); > #endif // ENABLE(WEBGL) > void setToolbarsAreVisible(bool toolbarsAreVisible); > void getToolbarsAreVisible(Messages::WebPageProxy::GetToolbarsAreVisible::DelayedReply&&); >@@ -1725,7 +1725,7 @@ private: > void setPluginComplexTextInputState(uint64_t pluginComplexTextInputIdentifier, uint64_t complexTextInputState); > #endif > >- bool maybeInitializeSandboxExtensionHandle(const WebCore::URL&, SandboxExtension::Handle&); >+ bool maybeInitializeSandboxExtensionHandle(const URL&, SandboxExtension::Handle&); > > #if USE(AUTOMATIC_TEXT_REPLACEMENT) > void toggleSmartInsertDelete(); >diff --git a/Source/WebKit/UIProcess/WebPageProxy.messages.in b/Source/WebKit/UIProcess/WebPageProxy.messages.in >index 561f6d0f0c8546333f2570741c0c2a490515d57d..b85ed466260ce737dda4668143e99c6b137da84c 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.messages.in >+++ b/Source/WebKit/UIProcess/WebPageProxy.messages.in >@@ -34,8 +34,8 @@ messages -> WebPageProxy { > UnavailablePluginButtonClicked(uint32_t pluginUnavailabilityReason, String mimeType, String pluginURLString, String pluginspageAttributeURLString, String frameURLString, String pageURLString) > #endif // ENABLE(NETSCAPE_PLUGIN_API) > #if ENABLE(WEBGL) >- WebGLPolicyForURL(WebCore::URL url) -> (uint32_t loadPolicy) Delayed >- ResolveWebGLPolicyForURL(WebCore::URL url) -> (uint32_t loadPolicy) Delayed >+ WebGLPolicyForURL(URL url) -> (uint32_t loadPolicy) Delayed >+ ResolveWebGLPolicyForURL(URL url) -> (uint32_t loadPolicy) Delayed > #endif // ENABLE(WEBGL) > DidChangeViewportProperties(struct WebCore::ViewportAttributes attributes) > DidReceiveEvent(uint32_t type, bool handled) >@@ -125,11 +125,11 @@ messages -> WebPageProxy { > DidCreateWindow(uint64_t frameID, struct WebCore::GlobalWindowIdentifier windowIdentifier) > > # Frame load messages >- DidStartProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, WebCore::URL url, WebCore::URL unreachableURL, WebKit::UserData userData) >+ DidStartProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, URL url, URL unreachableURL, WebKit::UserData userData) > DidReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, WebCore::ResourceRequest request, WebKit::UserData userData) > WillPerformClientRedirectForFrame(uint64_t frameID, String url, double delay, enum:bool WebCore::LockBackForwardList lockBackForwardList) > DidCancelClientRedirectForFrame(uint64_t frameID) >- DidChangeProvisionalURLForFrame(uint64_t frameID, uint64_t navigationID, WebCore::URL url) >+ DidChangeProvisionalURLForFrame(uint64_t frameID, uint64_t navigationID, URL url) > DidFailProvisionalLoadForFrame(uint64_t frameID, struct WebCore::SecurityOriginData frameSecurityOrigin, uint64_t navigationID, String provisionalURL, WebCore::ResourceError error, WebKit::UserData userData) > DidCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, String mimeType, bool hasCustomContentProvider, uint32_t loadType, WebCore::CertificateInfo certificateInfo, bool containsPluginDocument, std::optional<WebCore::HasInsecureContent> forcedHasInsecureContent, WebKit::UserData userData) > DidFailLoadForFrame(uint64_t frameID, uint64_t navigationID, WebCore::ResourceError error, WebKit::UserData userData) >@@ -142,7 +142,7 @@ messages -> WebPageProxy { > DidDisplayInsecureContentForFrame(uint64_t frameID, WebKit::UserData userData) > DidRunInsecureContentForFrame(uint64_t frameID, WebKit::UserData userData) > DidDetectXSSForFrame(uint64_t frameID, WebKit::UserData userData) >- DidSameDocumentNavigationForFrame(uint64_t frameID, uint64_t navigationID, uint32_t type, WebCore::URL url, WebKit::UserData userData) >+ DidSameDocumentNavigationForFrame(uint64_t frameID, uint64_t navigationID, uint32_t type, URL url, WebKit::UserData userData) > DidChangeMainDocument(uint64_t frameID); > DidDestroyNavigation(uint64_t navigationID) > >@@ -428,7 +428,7 @@ messages -> WebPageProxy { > SaveRecentSearches(String name, Vector<WebCore::RecentSearch> searchItems) > LoadRecentSearches(String name) -> (Vector<WebCore::RecentSearch> result) LegacySync > >- SavePDFToFileInDownloadsFolder(String suggestedFilename, WebCore::URL originatingURL, IPC::DataReference data) >+ SavePDFToFileInDownloadsFolder(String suggestedFilename, URL originatingURL, IPC::DataReference data) > > #if PLATFORM(COCOA) > SavePDFToTemporaryFolderAndOpenWithNativeApplication(String suggestedFilename, String originatingURLString, IPC::DataReference data, String pdfUUID) >@@ -488,7 +488,7 @@ messages -> WebPageProxy { > > DidResignInputElementStrongPasswordAppearance(WebKit::UserData userData) > >- ContentRuleListNotification(WebCore::URL url, Vector<String> identifiers, Vector<String> notifications) >+ ContentRuleListNotification(URL url, Vector<String> identifiers, Vector<String> notifications) > > #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS_FAMILY) > AddPlaybackTargetPickerClient(uint64_t contextId) >@@ -544,6 +544,6 @@ messages -> WebPageProxy { > SerializedAttachmentDataForIdentifiers(Vector<String> identifiers) -> (Vector<WebCore::SerializedAttachmentData> seralizedData) LegacySync > #endif > >- SignedPublicKeyAndChallengeString(unsigned keySizeIndex, String challengeString, WebCore::URL url) -> (String result) LegacySync >+ SignedPublicKeyAndChallengeString(unsigned keySizeIndex, String challengeString, URL url) -> (String result) LegacySync > > } >diff --git a/Source/WebKit/UIProcess/WebProcessPool.cpp b/Source/WebKit/UIProcess/WebProcessPool.cpp >index affad5d42aa2bfd6fc5ab45ca3cfe82611742870..5c4d768c0db65e356f4ac1a00511f64854ba83e1 100644 >--- a/Source/WebKit/UIProcess/WebProcessPool.cpp >+++ b/Source/WebKit/UIProcess/WebProcessPool.cpp >@@ -87,7 +87,6 @@ > #include <WebCore/Process.h> > #include <WebCore/ProcessWarming.h> > #include <WebCore/ResourceRequest.h> >-#include <WebCore/URLParser.h> > #include <pal/SessionID.h> > #include <wtf/Language.h> > #include <wtf/MainThread.h> >@@ -95,6 +94,7 @@ > #include <wtf/ProcessPrivilege.h> > #include <wtf/RunLoop.h> > #include <wtf/Scope.h> >+#include <wtf/URLParser.h> > #include <wtf/WallTime.h> > #include <wtf/text/StringBuilder.h> > >@@ -2361,7 +2361,7 @@ void WebProcessPool::didCollectPrewarmInformation(const String& registrableDomai > *value = prewarmInformation; > } > >-void WebProcessPool::tryPrewarmWithDomainInformation(WebProcessProxy& process, const WebCore::URL& url) >+void WebProcessPool::tryPrewarmWithDomainInformation(WebProcessProxy& process, const URL& url) > { > auto* prewarmInformation = m_prewarmInformationPerRegistrableDomain.get(toRegistrableDomain(url)); > if (!prewarmInformation) >diff --git a/Source/WebKit/UIProcess/WebProcessPool.h b/Source/WebKit/UIProcess/WebProcessPool.h >index 7e1962aa8734c221e4cb36845028525293221f4a..03da3890ff2eafd41d76f2cef95b2e90d07be0ba 100644 >--- a/Source/WebKit/UIProcess/WebProcessPool.h >+++ b/Source/WebKit/UIProcess/WebProcessPool.h >@@ -236,7 +236,7 @@ public: > void registerURLSchemeServiceWorkersCanHandle(const String&); > void registerURLSchemeAsCanDisplayOnlyIfCanRequest(const String&); > >- void preconnectToServer(const WebCore::URL&); >+ void preconnectToServer(const URL&); > > VisitedLinkStore& visitedLinkStore() { return m_visitedLinkStore.get(); } > >@@ -541,7 +541,7 @@ private: > void addProcessToOriginCacheSet(WebPageProxy&); > void removeProcessFromOriginCacheSet(WebProcessProxy&); > >- void tryPrewarmWithDomainInformation(WebProcessProxy&, const WebCore::URL&); >+ void tryPrewarmWithDomainInformation(WebProcessProxy&, const URL&); > > void updateMaxSuspendedPageCount(); > >diff --git a/Source/WebKit/UIProcess/WebProcessProxy.cpp b/Source/WebKit/UIProcess/WebProcessProxy.cpp >index e2035d01bc0bba5de89c26bdcced9f0f01151000..cc740116fc3d70786ebf22b173d146786a83dff2 100644 >--- a/Source/WebKit/UIProcess/WebProcessProxy.cpp >+++ b/Source/WebKit/UIProcess/WebProcessProxy.cpp >@@ -55,10 +55,10 @@ > #include <WebCore/PrewarmInformation.h> > #include <WebCore/PublicSuffix.h> > #include <WebCore/SuddenTermination.h> >-#include <WebCore/URL.h> > #include <stdio.h> > #include <wtf/NeverDestroyed.h> > #include <wtf/RunLoop.h> >+#include <wtf/URL.h> > #include <wtf/text/CString.h> > #include <wtf/text/StringBuilder.h> > #include <wtf/text/WTFString.h> >@@ -697,7 +697,7 @@ void WebProcessProxy::processDidTerminateOrFailedToLaunch() > #if ENABLE(PUBLIC_SUFFIX_LIST) > if (pages.size() == 1) { > auto& page = *pages[0]; >- String domain = topPrivatelyControlledDomain(WebCore::URL({ }, page.currentURL()).host().toString()); >+ String domain = topPrivatelyControlledDomain(URL({ }, page.currentURL()).host().toString()); > if (!domain.isEmpty()) > page.logDiagnosticMessageWithEnhancedPrivacy(WebCore::DiagnosticLoggingKeys::domainCausingCrashKey(), domain, WebCore::ShouldSample::No); > } >diff --git a/Source/WebKit/UIProcess/WebProcessProxy.h b/Source/WebKit/UIProcess/WebProcessProxy.h >index 00b68ff21ea0ac4fb21ac05eb858674f093a33ef..e42377950f646a63397900b333eaba2a1353b170 100644 >--- a/Source/WebKit/UIProcess/WebProcessProxy.h >+++ b/Source/WebKit/UIProcess/WebProcessProxy.h >@@ -61,7 +61,6 @@ class PageConfiguration; > > namespace WebCore { > class ResourceRequest; >-class URL; > struct PluginInfo; > struct SecurityOriginData; > } >@@ -151,10 +150,10 @@ public: > > void willAcquireUniversalFileReadSandboxExtension() { m_mayHaveUniversalFileReadSandboxExtension = true; } > void assumeReadAccessToBaseURL(const String&); >- bool hasAssumedReadAccessToURL(const WebCore::URL&) const; >+ bool hasAssumedReadAccessToURL(const URL&) const; > > bool checkURLReceivedFromWebProcess(const String&); >- bool checkURLReceivedFromWebProcess(const WebCore::URL&); >+ bool checkURLReceivedFromWebProcess(const URL&); > > static bool fullKeyboardAccessEnabled(); > >diff --git a/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp b/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp >index 03412a7d10ec3ee374d0d35c634b060eb7c03c3f..69af382347692eb3726cec04b2215262d0d6db66 100644 >--- a/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp >+++ b/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp >@@ -173,7 +173,7 @@ void WebResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode(bool val > }); > } > >-void WebResourceLoadStatisticsStore::setPrevalentResourceForDebugMode(const WebCore::URL& url, CompletionHandler<void()>&& completionHandler) >+void WebResourceLoadStatisticsStore::setPrevalentResourceForDebugMode(const URL& url, CompletionHandler<void()>&& completionHandler) > { > ASSERT(RunLoop::isMain()); > >@@ -375,7 +375,7 @@ void WebResourceLoadStatisticsStore::submitTelemetry() > }); > } > >-void WebResourceLoadStatisticsStore::logFrameNavigation(const WebFrameProxy& frame, const URL& pageURL, const WebCore::ResourceRequest& request, const WebCore::URL& redirectURL) >+void WebResourceLoadStatisticsStore::logFrameNavigation(const WebFrameProxy& frame, const URL& pageURL, const WebCore::ResourceRequest& request, const URL& redirectURL) > { > ASSERT(RunLoop::isMain()); > >diff --git a/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.h b/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.h >index 72d990883009464f745fa16e26c12a91b5d9e88b..e92e57de60a7b738aa273d233c45dfdcf10b6c70 100644 >--- a/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.h >+++ b/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.h >@@ -41,7 +41,6 @@ class WorkQueue; > > namespace WebCore { > class ResourceRequest; >-class URL; > struct ResourceLoadStatistics; > } > >@@ -83,28 +82,28 @@ public: > > void applicationWillTerminate(); > >- void logFrameNavigation(const WebFrameProxy&, const WebCore::URL& pageURL, const WebCore::ResourceRequest&, const WebCore::URL& redirectURL); >- void logUserInteraction(const WebCore::URL&, CompletionHandler<void()>&&); >- void clearUserInteraction(const WebCore::URL&, CompletionHandler<void()>&&); >- void hasHadUserInteraction(const WebCore::URL&, CompletionHandler<void(bool)>&&); >- void setLastSeen(const WebCore::URL&, Seconds, CompletionHandler<void()>&&); >- void setPrevalentResource(const WebCore::URL&, CompletionHandler<void()>&&); >- void setVeryPrevalentResource(const WebCore::URL&, CompletionHandler<void()>&&); >+ void logFrameNavigation(const WebFrameProxy&, const URL& pageURL, const WebCore::ResourceRequest&, const URL& redirectURL); >+ void logUserInteraction(const URL&, CompletionHandler<void()>&&); >+ void clearUserInteraction(const URL&, CompletionHandler<void()>&&); >+ void hasHadUserInteraction(const URL&, CompletionHandler<void(bool)>&&); >+ void setLastSeen(const URL&, Seconds, CompletionHandler<void()>&&); >+ void setPrevalentResource(const URL&, CompletionHandler<void()>&&); >+ void setVeryPrevalentResource(const URL&, CompletionHandler<void()>&&); > void dumpResourceLoadStatistics(CompletionHandler<void(const String&)>&&); >- void isPrevalentResource(const WebCore::URL&, CompletionHandler<void(bool)>&&); >- void isVeryPrevalentResource(const WebCore::URL&, CompletionHandler<void(bool)>&&); >- void isRegisteredAsSubresourceUnder(const WebCore::URL& subresource, const WebCore::URL& topFrame, CompletionHandler<void(bool)>&&); >- void isRegisteredAsSubFrameUnder(const WebCore::URL& subFrame, const WebCore::URL& topFrame, CompletionHandler<void(bool)>&&); >- void isRegisteredAsRedirectingTo(const WebCore::URL& hostRedirectedFrom, const WebCore::URL& hostRedirectedTo, CompletionHandler<void(bool)>&&); >- void clearPrevalentResource(const WebCore::URL&, CompletionHandler<void()>&&); >- void setGrandfathered(const WebCore::URL&, bool); >- void isGrandfathered(const WebCore::URL&, CompletionHandler<void(bool)>&&); >- void setSubframeUnderTopFrameOrigin(const WebCore::URL& subframe, const WebCore::URL& topFrame); >- void setSubresourceUnderTopFrameOrigin(const WebCore::URL& subresource, const WebCore::URL& topFrame); >- void setSubresourceUniqueRedirectTo(const WebCore::URL& subresource, const WebCore::URL& hostNameRedirectedTo); >- void setSubresourceUniqueRedirectFrom(const WebCore::URL& subresource, const WebCore::URL& hostNameRedirectedFrom); >- void setTopFrameUniqueRedirectTo(const WebCore::URL& topFrameHostName, const WebCore::URL& hostNameRedirectedTo); >- void setTopFrameUniqueRedirectFrom(const WebCore::URL& topFrameHostName, const WebCore::URL& hostNameRedirectedFrom); >+ void isPrevalentResource(const URL&, CompletionHandler<void(bool)>&&); >+ void isVeryPrevalentResource(const URL&, CompletionHandler<void(bool)>&&); >+ void isRegisteredAsSubresourceUnder(const URL& subresource, const URL& topFrame, CompletionHandler<void(bool)>&&); >+ void isRegisteredAsSubFrameUnder(const URL& subFrame, const URL& topFrame, CompletionHandler<void(bool)>&&); >+ void isRegisteredAsRedirectingTo(const URL& hostRedirectedFrom, const URL& hostRedirectedTo, CompletionHandler<void(bool)>&&); >+ void clearPrevalentResource(const URL&, CompletionHandler<void()>&&); >+ void setGrandfathered(const URL&, bool); >+ void isGrandfathered(const URL&, CompletionHandler<void(bool)>&&); >+ void setSubframeUnderTopFrameOrigin(const URL& subframe, const URL& topFrame); >+ void setSubresourceUnderTopFrameOrigin(const URL& subresource, const URL& topFrame); >+ void setSubresourceUniqueRedirectTo(const URL& subresource, const URL& hostNameRedirectedTo); >+ void setSubresourceUniqueRedirectFrom(const URL& subresource, const URL& hostNameRedirectedFrom); >+ void setTopFrameUniqueRedirectTo(const URL& topFrameHostName, const URL& hostNameRedirectedTo); >+ void setTopFrameUniqueRedirectFrom(const URL& topFrameHostName, const URL& hostNameRedirectedFrom); > void scheduleCookieBlockingUpdate(CompletionHandler<void()>&&); > void scheduleCookieBlockingUpdateForDomains(const Vector<String>& domainsToBlock, CompletionHandler<void()>&&); > void scheduleClearBlockingStateForDomains(const Vector<String>& domains, CompletionHandler<void()>&&); >@@ -128,7 +127,7 @@ public: > void resetParametersToDefaultValues(CompletionHandler<void()>&&); > > void setResourceLoadStatisticsDebugMode(bool, CompletionHandler<void()>&&); >- void setPrevalentResourceForDebugMode(const WebCore::URL&, CompletionHandler<void()>&&); >+ void setPrevalentResourceForDebugMode(const URL&, CompletionHandler<void()>&&); > > void setStatisticsTestingCallback(WTF::Function<void(const String&)>&& callback) { m_statisticsTestingCallback = WTFMove(callback); } > void logTestingEvent(const String&); >diff --git a/Source/WebKit/UIProcess/ios/DragDropInteractionState.h b/Source/WebKit/UIProcess/ios/DragDropInteractionState.h >index 0836a1dae22a7575510ccb07716e7785381703e7..b0102177437f3f214945a7a34e58a3dfe2417488 100644 >--- a/Source/WebKit/UIProcess/ios/DragDropInteractionState.h >+++ b/Source/WebKit/UIProcess/ios/DragDropInteractionState.h >@@ -32,10 +32,10 @@ > #import <WebCore/DragData.h> > #import <WebCore/Path.h> > #import <WebCore/TextIndicator.h> >-#import <WebCore/URL.h> > #import <WebCore/WebItemProviderPasteboard.h> > #import <wtf/BlockPtr.h> > #import <wtf/RetainPtr.h> >+#import <wtf/URL.h> > #import <wtf/Vector.h> > > namespace WebCore { >@@ -52,7 +52,7 @@ struct DragSourceState { > std::optional<WebCore::TextIndicatorData> indicatorData; > std::optional<WebCore::Path> visiblePath; > String linkTitle; >- WebCore::URL linkURL; >+ URL linkURL; > bool possiblyNeedsDragPreviewUpdate { true }; > > NSInteger itemIdentifier { 0 }; >diff --git a/Source/WebKit/UIProcess/ios/PageClientImplIOS.h b/Source/WebKit/UIProcess/ios/PageClientImplIOS.h >index ca45a1d8bb13410d28c8899ec7ce934fd85c8c41..8ecee147aa07891a2d22102d960543897be46596 100644 >--- a/Source/WebKit/UIProcess/ios/PageClientImplIOS.h >+++ b/Source/WebKit/UIProcess/ios/PageClientImplIOS.h >@@ -115,7 +115,7 @@ private: > void clearTextIndicator(WebCore::TextIndicatorWindowDismissalAnimation) override; > void setTextIndicatorAnimationProgress(float) override; > >- void showSafeBrowsingWarning(const SafeBrowsingWarning&, CompletionHandler<void(Variant<WebKit::ContinueUnsafeLoad, WebCore::URL>&&)>&&) override; >+ void showSafeBrowsingWarning(const SafeBrowsingWarning&, CompletionHandler<void(Variant<WebKit::ContinueUnsafeLoad, URL>&&)>&&) override; > void clearSafeBrowsingWarning() override; > > void enterAcceleratedCompositingMode(const LayerTreeContext&) override; >diff --git a/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm b/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm >index 968fde96328ef126d36b80ff18a5de161ec6a111..57b5acef3b4fa639a13f8ff230706e2419a80cb8 100644 >--- a/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm >+++ b/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm >@@ -472,7 +472,7 @@ void PageClientImpl::enterAcceleratedCompositingMode(const LayerTreeContext& lay > { > } > >-void PageClientImpl::showSafeBrowsingWarning(const SafeBrowsingWarning& warning, CompletionHandler<void(Variant<WebKit::ContinueUnsafeLoad, WebCore::URL>&&)>&& completionHandler) >+void PageClientImpl::showSafeBrowsingWarning(const SafeBrowsingWarning& warning, CompletionHandler<void(Variant<WebKit::ContinueUnsafeLoad, URL>&&)>&& completionHandler) > { > if (auto webView = m_webView.get()) > [webView _showSafeBrowsingWarning:warning completionHandler:WTFMove(completionHandler)]; >diff --git a/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm b/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm >index 2d86e2a02ef43e16c395f8ee5f31a2ebcc87ae22..27b359350a0b2fc43084ccb97c0be960d5d08bd0 100644 >--- a/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm >+++ b/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm >@@ -41,10 +41,10 @@ > #import <WebCore/DataDetection.h> > #import <WebCore/LocalizedStrings.h> > #import <WebCore/PathUtilities.h> >-#import <WebCore/WebCoreNSURLExtras.h> > #import <wtf/SoftLinking.h> > #import <wtf/WeakObjCPtr.h> > #import <wtf/cocoa/Entitlements.h> >+#import <wtf/cocoa/NSURLExtras.h> > #import <wtf/text/WTFString.h> > #import <wtf/threads/BinarySemaphore.h> > >@@ -306,7 +306,7 @@ static const CGFloat presentationElementRectPadding = 15; > if (isJavaScriptURL) > titleString = WEB_UI_STRING_KEY("JavaScript", "JavaScript Action Sheet Title", "Title for action sheet for JavaScript link"); > else { >- titleString = WebCore::userVisibleString(targetURL); >+ titleString = WTF::userVisibleString(targetURL); > titleIsURL = YES; > } > } else >diff --git a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >index 12d6717760c49332134f64b389f6553a5783ca3e..e6114c721988fcd42eb914258f5c46df8d5289f5 100644 >--- a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >+++ b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >@@ -91,7 +91,6 @@ > #import <WebCore/ShareData.h> > #import <WebCore/TextIndicator.h> > #import <WebCore/VisibleSelection.h> >-#import <WebCore/WebCoreNSURLExtras.h> > #import <WebCore/WebEvent.h> > #import <WebKit/WebSelectionRect.h> // FIXME: WK2 should not include WebKit headers! > #import <pal/spi/cg/CoreGraphicsSPI.h> >@@ -102,6 +101,7 @@ > #import <wtf/SetForScope.h> > #import <wtf/SoftLinking.h> > #import <wtf/WeakObjCPtr.h> >+#import <wtf/cocoa/NSURLExtras.h> > #import <wtf/text/TextStream.h> > > #if ENABLE(DRAG_SUPPORT) >@@ -5105,7 +5105,7 @@ static bool isAssistableInputType(InputType type) > - (void)actionSheetAssistant:(WKActionSheetAssistant *)assistant shareElementWithURL:(NSURL *)url rect:(CGRect)boundingRect > { > if (_textSelectionAssistant) >- [_textSelectionAssistant showShareSheetFor:userVisibleString(url) fromRect:boundingRect]; >+ [_textSelectionAssistant showShareSheetFor:WTF::userVisibleString(url) fromRect:boundingRect]; > } > > #if HAVE(APP_LINKS) >@@ -6397,7 +6397,7 @@ static NSString *previewIdentifierForElementAction(_WKElementAction *action) > > NSURL *targetURL = controller.previewData[UIPreviewDataLink]; > URL coreTargetURL = targetURL; >- bool isValidURLForImagePreview = !coreTargetURL.isEmpty() && (WebCore::protocolIsInHTTPFamily(coreTargetURL) || WebCore::protocolIs(coreTargetURL, "data")); >+ bool isValidURLForImagePreview = !coreTargetURL.isEmpty() && (WTF::protocolIsInHTTPFamily(coreTargetURL) || WTF::protocolIs(coreTargetURL, "data")); > > if ([_previewItemController type] == UIPreviewItemTypeLink) { > _highlightLongPressCanClick = NO; >diff --git a/Source/WebKit/UIProcess/ios/WKGeolocationProviderIOS.mm b/Source/WebKit/UIProcess/ios/WKGeolocationProviderIOS.mm >index 361bc5033b1e602c2cbbed0b1d71b396632437e1..f6336fc9ec7fedf39ffff44e7fc862acaba5b9bc 100644 >--- a/Source/WebKit/UIProcess/ios/WKGeolocationProviderIOS.mm >+++ b/Source/WebKit/UIProcess/ios/WKGeolocationProviderIOS.mm >@@ -41,13 +41,13 @@ > #import "_WKGeolocationCoreLocationProvider.h" > #import "_WKGeolocationPositionInternal.h" > #import <WebCore/GeolocationPosition.h> >-#import <WebCore/URL.h> > #import <WebGeolocationPosition.h> > #import <wtf/Assertions.h> > #import <wtf/BlockPtr.h> > #import <wtf/HashSet.h> > #import <wtf/RefPtr.h> > #import <wtf/RetainPtr.h> >+#import <wtf/URL.h> > > // FIXME: Remove use of WebKit1 from WebKit2 > #import <WebKit/WebGeolocationCoreLocationProvider.h> >@@ -184,7 +184,7 @@ static void setEnableHighAccuracy(WKGeolocationManagerRef geolocationManager, bo > > id<WKUIDelegatePrivate> uiDelegate = static_cast<id <WKUIDelegatePrivate>>([request.view UIDelegate]); > if ([uiDelegate respondsToSelector:@selector(_webView:requestGeolocationAuthorizationForURL:frame:decisionHandler:)]) { >- WebCore::URL requestFrameURL(WebCore::URL(), request.frame->url()); >+ URL requestFrameURL(URL(), request.frame->url()); > RetainPtr<WKFrameInfo> frameInfo = wrapper(API::FrameInfo::create(*request.frame.get(), *request.origin.get())); > RefPtr<WebKit::CompletionHandlerCallChecker> checker = WebKit::CompletionHandlerCallChecker::create(uiDelegate, @selector(_webView:requestGeolocationAuthorizationForURL:frame:decisionHandler:)); > WKWebView *viewFromRequest = request.view.get(); >@@ -200,8 +200,8 @@ static void setEnableHighAccuracy(WKGeolocationManagerRef geolocationManager, bo > if ([uiDelegate respondsToSelector:@selector(_webView:shouldRequestGeolocationAuthorizationForURL:isMainFrame:mainFrameURL:)]) { > const WebKit::WebFrameProxy* mainFrame = request.frame->page()->mainFrame(); > bool isMainFrame = request.frame == mainFrame; >- WebCore::URL requestFrameURL(WebCore::URL(), request.frame->url()); >- WebCore::URL mainFrameURL(WebCore::URL(), mainFrame->url()); >+ URL requestFrameURL(URL(), request.frame->url()); >+ URL mainFrameURL(URL(), mainFrame->url()); > requiresUserAuthorization = [uiDelegate _webView:request.view.get() > shouldRequestGeolocationAuthorizationForURL:requestFrameURL > isMainFrame:isMainFrame >diff --git a/Source/WebKit/UIProcess/ios/WKLegacyPDFView.mm b/Source/WebKit/UIProcess/ios/WKLegacyPDFView.mm >index d38f31c815f3c9f3e98da52e54fb88884ed0a430..aea0d6d39f62d71d967446e68227ebd7f283ad14 100644 >--- a/Source/WebKit/UIProcess/ios/WKLegacyPDFView.mm >+++ b/Source/WebKit/UIProcess/ios/WKLegacyPDFView.mm >@@ -43,11 +43,11 @@ > #import <MobileCoreServices/UTCoreTypes.h> > #import <WebCore/FloatRect.h> > #import <WebCore/LocalizedStrings.h> >-#import <WebCore/WebCoreNSURLExtras.h> > #import <pal/spi/cg/CoreGraphicsSPI.h> > #import <wtf/RetainPtr.h> > #import <wtf/Vector.h> > #import <wtf/WeakObjCPtr.h> >+#import <wtf/cocoa/NSURLExtras.h> > > // All of UIPDFPage* are deprecated, so just ignore deprecated declarations > // in this file until we switch off them. >@@ -779,7 +779,7 @@ static NSStringCompareOptions stringCompareOptions(_WKFindOptions options) > - (void)actionSheetAssistant:(WKActionSheetAssistant *)assistant shareElementWithURL:(NSURL *)url rect:(CGRect)boundingRect > { > _webSelectionAssistant = adoptNS([[UIWKSelectionAssistant alloc] initWithView:self]); >- [_webSelectionAssistant showShareSheetFor:WebCore::userVisibleString(url) fromRect:boundingRect]; >+ [_webSelectionAssistant showShareSheetFor:WTF::userVisibleString(url) fromRect:boundingRect]; > _webSelectionAssistant = nil; > } > >diff --git a/Source/WebKit/UIProcess/ios/WKPDFView.mm b/Source/WebKit/UIProcess/ios/WKPDFView.mm >index 7ad6b87d05ad3af8f648d9c044bb881a9c0c40e6..485f0581176f04afaa034a55317b59b57953a102 100644 >--- a/Source/WebKit/UIProcess/ios/WKPDFView.mm >+++ b/Source/WebKit/UIProcess/ios/WKPDFView.mm >@@ -41,11 +41,11 @@ > #import "_WKWebViewPrintFormatterInternal.h" > #import <MobileCoreServices/MobileCoreServices.h> > #import <WebCore/DataDetection.h> >-#import <WebCore/WebCoreNSURLExtras.h> > #import <wtf/BlockPtr.h> > #import <wtf/MainThread.h> > #import <wtf/RetainPtr.h> > #import <wtf/WeakObjCPtr.h> >+#import <wtf/cocoa/NSURLExtras.h> > > @interface WKPDFView () <PDFHostViewControllerDelegate, WKActionSheetAssistantDelegate> > @end >@@ -518,7 +518,7 @@ static NSStringCompareOptions stringCompareOptions(_WKFindOptions findOptions) > - (void)actionSheetAssistant:(WKActionSheetAssistant *)assistant shareElementWithURL:(NSURL *)url rect:(CGRect)boundingRect > { > auto selectionAssistant = adoptNS([[UIWKSelectionAssistant alloc] initWithView:[_hostViewController view]]); >- [selectionAssistant showShareSheetFor:WebCore::userVisibleString(url) fromRect:boundingRect]; >+ [selectionAssistant showShareSheetFor:WTF::userVisibleString(url) fromRect:boundingRect]; > } > > #if HAVE(APP_LINKS) >diff --git a/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm b/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm >index 9abe7ac4575bf2cdf5bb9a7264dbc4034481a171..2bd1a8e2d1a8ae8deb13e0e47462d1c4cc792610 100644 >--- a/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm >+++ b/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm >@@ -45,12 +45,12 @@ > #import <WebCore/IntRect.h> > #import <WebCore/LocalizedStrings.h> > #import <WebCore/ViewportArguments.h> >-#import <WebCore/WebCoreNSURLExtras.h> > #import <pal/spi/cf/CFNetworkSPI.h> > #import <pal/spi/cocoa/NSStringSPI.h> > #import <pal/spi/cocoa/QuartzCoreSPI.h> > #import <pal/spi/cocoa/URLFormattingSPI.h> > #import <wtf/SoftLinking.h> >+#import <wtf/cocoa/NSURLExtras.h> > #import <wtf/spi/cocoa/SecuritySPI.h> > > using namespace WebKit; >@@ -947,7 +947,7 @@ static const NSTimeInterval kAnimationDuration = 0.2; > if (LinkPresentationLibrary()) > domain = [url _lp_simplifiedDisplayString]; > else >- domain = userVisibleString(url); >+ domain = WTF::userVisibleString(url); > #endif > > NSString *text = nil; >diff --git a/Source/WebKit/UIProcess/mac/LegacySessionStateCoding.cpp b/Source/WebKit/UIProcess/mac/LegacySessionStateCoding.cpp >index 1dac209adc03aba92e374c59198314fde1ec2e3e..5ee8dbae43f00da8108dc761ec86dc981ddc16d9 100644 >--- a/Source/WebKit/UIProcess/mac/LegacySessionStateCoding.cpp >+++ b/Source/WebKit/UIProcess/mac/LegacySessionStateCoding.cpp >@@ -1133,7 +1133,7 @@ bool decodeLegacySessionState(const uint8_t* bytes, size_t size, SessionState& s > } > > if (auto provisionalURLString = dynamic_cf_cast<CFStringRef>(CFDictionaryGetValue(sessionStateDictionary, provisionalURLKey))) { >- sessionState.provisionalURL = WebCore::URL(WebCore::URL(), provisionalURLString); >+ sessionState.provisionalURL = URL(URL(), provisionalURLString); > if (!sessionState.provisionalURL.isValid()) > return false; > } >diff --git a/Source/WebKit/UIProcess/mac/PageClientImplMac.h b/Source/WebKit/UIProcess/mac/PageClientImplMac.h >index 6bc8bdd7d31583949a7c3985bb44899c50543d9a..87b305edd63b58e5fc8d0bc280c8865ff54d7b9e 100644 >--- a/Source/WebKit/UIProcess/mac/PageClientImplMac.h >+++ b/Source/WebKit/UIProcess/mac/PageClientImplMac.h >@@ -104,7 +104,7 @@ private: > void resetSecureInputState() override; > void notifyInputContextAboutDiscardedComposition() override; > void selectionDidChange() override; >- void showSafeBrowsingWarning(const SafeBrowsingWarning&, CompletionHandler<void(Variant<WebKit::ContinueUnsafeLoad, WebCore::URL>&&)>&&) override; >+ void showSafeBrowsingWarning(const SafeBrowsingWarning&, CompletionHandler<void(Variant<WebKit::ContinueUnsafeLoad, URL>&&)>&&) override; > void clearSafeBrowsingWarning() override; > > #if WK_API_ENABLED >diff --git a/Source/WebKit/UIProcess/mac/PageClientImplMac.mm b/Source/WebKit/UIProcess/mac/PageClientImplMac.mm >index e374b99da7dd5b502c87a2ad66e36961427302f5..11235a127e277a01876038c9746f7f8ed2ccba31 100644 >--- a/Source/WebKit/UIProcess/mac/PageClientImplMac.mm >+++ b/Source/WebKit/UIProcess/mac/PageClientImplMac.mm >@@ -489,7 +489,7 @@ Ref<ValidationBubble> PageClientImpl::createValidationBubble(const String& messa > return ValidationBubble::create(m_view, message, settings); > } > >-void PageClientImpl::showSafeBrowsingWarning(const SafeBrowsingWarning& warning, CompletionHandler<void(Variant<WebKit::ContinueUnsafeLoad, WebCore::URL>&&)>&& completionHandler) >+void PageClientImpl::showSafeBrowsingWarning(const SafeBrowsingWarning& warning, CompletionHandler<void(Variant<WebKit::ContinueUnsafeLoad, URL>&&)>&& completionHandler) > { > if (!m_impl) > return completionHandler(ContinueUnsafeLoad::Yes); >diff --git a/Source/WebKit/UIProcess/mac/WKImmediateActionController.mm b/Source/WebKit/UIProcess/mac/WKImmediateActionController.mm >index 9983907099544f2a0dae31ad98b7a6288e39b589..21dcd2fe24361b1ae5cb18634eac0b38a664f4d7 100644 >--- a/Source/WebKit/UIProcess/mac/WKImmediateActionController.mm >+++ b/Source/WebKit/UIProcess/mac/WKImmediateActionController.mm >@@ -38,13 +38,13 @@ > #import <WebCore/DictionaryLookup.h> > #import <WebCore/GeometryUtilities.h> > #import <WebCore/TextIndicatorWindow.h> >-#import <WebCore/URL.h> > #import <pal/spi/mac/DataDetectorsSPI.h> > #import <pal/spi/mac/LookupSPI.h> > #import <pal/spi/mac/NSMenuSPI.h> > #import <pal/spi/mac/NSPopoverSPI.h> > #import <pal/spi/mac/QuickLookMacSPI.h> > #import <wtf/SoftLinking.h> >+#import <wtf/URL.h> > > SOFT_LINK_FRAMEWORK_IN_UMBRELLA(Quartz, QuickLookUI) > SOFT_LINK_CLASS(QuickLookUI, QLPreviewMenuItem) >@@ -276,17 +276,17 @@ SOFT_LINK_CLASS(QuickLookUI, QLPreviewMenuItem) > > String absoluteLinkURL = hitTestResult->absoluteLinkURL(); > if (!absoluteLinkURL.isEmpty()) { >- if (WebCore::protocolIs(absoluteLinkURL, "mailto")) { >+ if (WTF::protocolIs(absoluteLinkURL, "mailto")) { > _type = kWKImmediateActionMailtoLink; > return [self _animationControllerForDataDetectedLink]; > } > >- if (WebCore::protocolIs(absoluteLinkURL, "tel")) { >+ if (WTF::protocolIs(absoluteLinkURL, "tel")) { > _type = kWKImmediateActionTelLink; > return [self _animationControllerForDataDetectedLink]; > } > >- if (WebCore::protocolIsInHTTPFamily(absoluteLinkURL)) { >+ if (WTF::protocolIsInHTTPFamily(absoluteLinkURL)) { > _type = kWKImmediateActionLinkPreview; > > QLPreviewMenuItem *item = [NSMenuItem standardQuickLookMenuItem]; >diff --git a/Source/WebKit/UIProcess/win/WebInspectorProxyWin.cpp b/Source/WebKit/UIProcess/win/WebInspectorProxyWin.cpp >index 3198220c2123ee9fb78260b22e58e0b78c1284fe..cbfe30e9e0be8321518196355f779808b824f2f6 100644 >--- a/Source/WebKit/UIProcess/win/WebInspectorProxyWin.cpp >+++ b/Source/WebKit/UIProcess/win/WebInspectorProxyWin.cpp >@@ -30,7 +30,6 @@ > #include "APINavigation.h" > #include "APINavigationAction.h" > #include "APIPageConfiguration.h" >-#include "CFURLExtras.h" > #include "PageClientImpl.h" > #include "WebFramePolicyListenerProxy.h" > #include "WebPageGroup.h" >@@ -45,6 +44,7 @@ > #include <WebCore/WebCoreInstanceHandle.h> > #include <WebCore/WindowMessageBroadcaster.h> > #include <WebKit/WKPage.h> >+#include <wtf/cf/CFURLExtras.h> > > namespace WebKit { > >diff --git a/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.cpp b/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.cpp >index 77462722fca1bb2b460f4648b22013b4e3ce4986..9b8c008d16d758f8dd71f56023373ba0bd73f3e4 100644 >--- a/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.cpp >+++ b/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.cpp >@@ -36,7 +36,7 @@ > #include "WebProcess.h" > #include <WebCore/Frame.h> > #include <WebCore/PaymentCoordinator.h> >-#include <WebCore/URL.h> >+#include <wtf/URL.h> > > namespace WebKit { > >@@ -131,7 +131,7 @@ void WebPaymentCoordinator::openPaymentSetup(const String& merchantIdentifier, c > m_webPage.send(Messages::WebPaymentCoordinatorProxy::OpenPaymentSetup(merchantIdentifier, domainName, replyID)); > } > >-bool WebPaymentCoordinator::showPaymentUI(const WebCore::URL& originatingURL, const Vector<WebCore::URL>& linkIconURLs, const WebCore::ApplePaySessionPaymentRequest& paymentRequest) >+bool WebPaymentCoordinator::showPaymentUI(const URL& originatingURL, const Vector<URL>& linkIconURLs, const WebCore::ApplePaySessionPaymentRequest& paymentRequest) > { > Vector<String> linkIconURLStrings; > for (const auto& linkIconURL : linkIconURLs) >@@ -186,7 +186,7 @@ void WebPaymentCoordinator::paymentCoordinatorDestroyed() > > void WebPaymentCoordinator::validateMerchant(const String& validationURLString) > { >- paymentCoordinator().validateMerchant(WebCore::URL(WebCore::URL(), validationURLString)); >+ paymentCoordinator().validateMerchant(URL(URL(), validationURLString)); > } > > void WebPaymentCoordinator::didAuthorizePayment(const WebCore::Payment& payment) >diff --git a/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.h b/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.h >index dd72ee081800422e5df4404c196141c9d452488c..fb74d30ff95f3f72a554aa1d0a1e351797f2e844 100644 >--- a/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.h >+++ b/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.h >@@ -60,7 +60,7 @@ private: > bool canMakePayments() override; > void canMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, WTF::Function<void (bool)>&& completionHandler) override; > void openPaymentSetup(const String& merchantIdentifier, const String& domainName, WTF::Function<void (bool)>&& completionHandler) override; >- bool showPaymentUI(const WebCore::URL& originatingURL, const Vector<WebCore::URL>& linkIconURLs, const WebCore::ApplePaySessionPaymentRequest&) override; >+ bool showPaymentUI(const URL& originatingURL, const Vector<URL>& linkIconURLs, const WebCore::ApplePaySessionPaymentRequest&) override; > void completeMerchantValidation(const WebCore::PaymentMerchantSession&) override; > void completeShippingMethodSelection(std::optional<WebCore::ShippingMethodUpdate>&&) override; > void completeShippingContactSelection(std::optional<WebCore::ShippingContactUpdate>&&) override; >diff --git a/Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.cpp b/Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.cpp >index 3f271232d63e4a4f7745ef28c64eae5538c4b7b9..7fe9334ba4f359c72b0d91d5542a7164462e6de9 100644 >--- a/Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.cpp >+++ b/Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.cpp >@@ -71,7 +71,7 @@ void WebCacheStorageConnection::doRetrieveCaches(uint64_t requestIdentifier, con > connection().send(Messages::CacheStorageEngineConnection::Caches(m_sessionID, requestIdentifier, origin, updateCounter), 0); > } > >-void WebCacheStorageConnection::doRetrieveRecords(uint64_t requestIdentifier, uint64_t cacheIdentifier, const WebCore::URL& url) >+void WebCacheStorageConnection::doRetrieveRecords(uint64_t requestIdentifier, uint64_t cacheIdentifier, const URL& url) > { > connection().send(Messages::CacheStorageEngineConnection::RetrieveRecords(m_sessionID, requestIdentifier, cacheIdentifier, url), 0); > } >diff --git a/Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.h b/Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.h >index 480eddd9b4e515c4b4aae6d4c6d94258fcbe252b..d2e0df2d860922a3b1e356be921e7801986dc756 100644 >--- a/Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.h >+++ b/Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.h >@@ -56,7 +56,7 @@ private: > void doRemove(uint64_t requestIdentifier, uint64_t cacheIdentifier) final; > void doRetrieveCaches(uint64_t requestIdentifier, const WebCore::ClientOrigin&, uint64_t updateCounter) final; > >- void doRetrieveRecords(uint64_t requestIdentifier, uint64_t cacheIdentifier, const WebCore::URL&) final; >+ void doRetrieveRecords(uint64_t requestIdentifier, uint64_t cacheIdentifier, const URL&) final; > void doBatchDeleteOperation(uint64_t requestIdentifier, uint64_t cacheIdentifier, const WebCore::ResourceRequest&, WebCore::CacheQueryOptions&&) final; > void doBatchPutOperation(uint64_t requestIdentifier, uint64_t cacheIdentifier, Vector<WebCore::DOMCacheEngine::Record>&&) final; > >diff --git a/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.cpp b/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.cpp >index 7325b2a6bb48770ddc8614527e852666a5f70c09..24e3559cff069bd31791ee65178eaf4e4dc0e47d 100644 >--- a/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.cpp >+++ b/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.cpp >@@ -36,7 +36,7 @@ > namespace WebKit { > using namespace WebCore; > >-void BlobRegistryProxy::registerFileBlobURL(const WebCore::URL& url, Ref<BlobDataFileReference>&& file, const String& contentType) >+void BlobRegistryProxy::registerFileBlobURL(const URL& url, Ref<BlobDataFileReference>&& file, const String& contentType) > { > SandboxExtension::Handle extensionHandle; > >diff --git a/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.h b/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.h >index ac411aa9436df616c1d3256bc7e3fbd70d1cdecd..6abee36748dfecc2cad46ccc222a74c5176d89d4 100644 >--- a/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.h >+++ b/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.h >@@ -31,13 +31,13 @@ namespace WebKit { > > class BlobRegistryProxy final : public WebCore::BlobRegistry { > public: >- void registerFileBlobURL(const WebCore::URL&, Ref<WebCore::BlobDataFileReference>&&, const String& contentType) override; >- void registerBlobURL(const WebCore::URL&, Vector<WebCore::BlobPart>&&, const String& contentType) override; >- void registerBlobURL(const WebCore::URL&, const WebCore::URL& srcURL) override; >- void registerBlobURLOptionallyFileBacked(const WebCore::URL&, const WebCore::URL& srcURL, RefPtr<WebCore::BlobDataFileReference>&&, const String& contentType) override; >- void unregisterBlobURL(const WebCore::URL&) override; >- void registerBlobURLForSlice(const WebCore::URL&, const WebCore::URL& srcURL, long long start, long long end) override; >- unsigned long long blobSize(const WebCore::URL&) override; >+ void registerFileBlobURL(const URL&, Ref<WebCore::BlobDataFileReference>&&, const String& contentType) override; >+ void registerBlobURL(const URL&, Vector<WebCore::BlobPart>&&, const String& contentType) override; >+ void registerBlobURL(const URL&, const URL& srcURL) override; >+ void registerBlobURLOptionallyFileBacked(const URL&, const URL& srcURL, RefPtr<WebCore::BlobDataFileReference>&&, const String& contentType) override; >+ void unregisterBlobURL(const URL&) override; >+ void registerBlobURLForSlice(const URL&, const URL& srcURL, long long start, long long end) override; >+ unsigned long long blobSize(const URL&) override; > void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&& filePaths)>&&) override; > }; > >diff --git a/Source/WebKit/WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h b/Source/WebKit/WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h >index 082b4c6bdca0c6f0420f1ea0de209d653107bd57..c6e97ab13db06b24154054eab41926d47f91ec03 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h >+++ b/Source/WebKit/WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h >@@ -37,7 +37,6 @@ class DOMWrapperWorld; > class ResourceError; > class ResourceRequest; > class SharedBuffer; >-class URL; > } > > namespace WebKit { >@@ -56,7 +55,7 @@ public: > virtual ~PageLoaderClient() = default; > > virtual void willLoadURLRequest(WebKit::WebPage&, const WebCore::ResourceRequest&, API::Object*) { } >- virtual void willLoadDataRequest(WebKit::WebPage&, const WebCore::ResourceRequest&, WebCore::SharedBuffer*, const WTF::String&, const WTF::String&, const WebCore::URL&, API::Object*) { } >+ virtual void willLoadDataRequest(WebKit::WebPage&, const WebCore::ResourceRequest&, WebCore::SharedBuffer*, const WTF::String&, const WTF::String&, const WTF::URL&, API::Object*) { } > > virtual void didStartProvisionalLoadForFrame(WebKit::WebPage&, WebKit::WebFrame&, RefPtr<API::Object>&) { } > virtual void didReceiveServerRedirectForProvisionalLoadForFrame(WebKit::WebPage&, WebKit::WebFrame&, RefPtr<API::Object>&) { } >@@ -95,7 +94,7 @@ public: > virtual void featuresUsedInPage(WebKit::WebPage&, const Vector<WTF::String>&) { } > > virtual void willDestroyFrame(WebKit::WebPage&, WebKit::WebFrame&) { } >- virtual WTF::String userAgentForURL(WebKit::WebFrame&, const WebCore::URL&) const { return WTF::String(); } >+ virtual WTF::String userAgentForURL(WebKit::WebFrame&, const WTF::URL&) const { return WTF::String(); } > > virtual OptionSet<WebCore::LayoutMilestone> layoutMilestones() const { return { }; } > }; >diff --git a/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp b/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp >index bef52fa954864ba4962901a4b1484fb08093f7ab..785d1a5eb95362e49b8ce6eecf6b09b27bac8f69 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp >+++ b/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp >@@ -165,7 +165,7 @@ WKStringRef WKBundleFrameCopyLayerTreeAsText(WKBundleFrameRef frameRef) > > bool WKBundleFrameAllowsFollowingLink(WKBundleFrameRef frameRef, WKURLRef urlRef) > { >- return toImpl(frameRef)->allowsFollowingLink(WebCore::URL(WebCore::URL(), toWTFString(urlRef))); >+ return toImpl(frameRef)->allowsFollowingLink(URL(URL(), toWTFString(urlRef))); > } > > bool WKBundleFrameHandlesPageScaleGesture(WKBundleFrameRef frameRef) >@@ -210,12 +210,12 @@ bool WKBundleFrameGetDocumentBackgroundColor(WKBundleFrameRef frameRef, double* > > WKStringRef WKBundleFrameCopySuggestedFilenameForResourceWithURL(WKBundleFrameRef frameRef, WKURLRef urlRef) > { >- return toCopiedAPI(toImpl(frameRef)->suggestedFilenameForResourceWithURL(WebCore::URL(WebCore::URL(), toWTFString(urlRef)))); >+ return toCopiedAPI(toImpl(frameRef)->suggestedFilenameForResourceWithURL(URL(URL(), toWTFString(urlRef)))); > } > > WKStringRef WKBundleFrameCopyMIMETypeForResourceWithURL(WKBundleFrameRef frameRef, WKURLRef urlRef) > { >- return toCopiedAPI(toImpl(frameRef)->mimeTypeForResourceWithURL(WebCore::URL(WebCore::URL(), toWTFString(urlRef)))); >+ return toCopiedAPI(toImpl(frameRef)->mimeTypeForResourceWithURL(URL(URL(), toWTFString(urlRef)))); > } > > bool WKBundleFrameContainsAnyFormElements(WKBundleFrameRef frameRef) >diff --git a/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp b/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp >index 799305737dca951ba0b1f48f9e55b14c72108c8d..995c5dcc961e3be506c081cabcfa6a37cddc1e98 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp >+++ b/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp >@@ -65,9 +65,9 @@ > #include <WebCore/RenderLayerCompositor.h> > #include <WebCore/ScriptExecutionContext.h> > #include <WebCore/SecurityOriginData.h> >-#include <WebCore/URL.h> > #include <WebCore/WheelEventTestTrigger.h> > #include <wtf/StdLibExtras.h> >+#include <wtf/URL.h> > > using namespace WebKit; > >@@ -434,7 +434,7 @@ void WKBundlePageSetFooterBanner(WKBundlePageRef pageRef, WKBundlePageBannerRef > > bool WKBundlePageHasLocalDataForURL(WKBundlePageRef pageRef, WKURLRef urlRef) > { >- return toImpl(pageRef)->hasLocalDataForURL(WebCore::URL(WebCore::URL(), toWTFString(urlRef))); >+ return toImpl(pageRef)->hasLocalDataForURL(URL(URL(), toWTFString(urlRef))); > } > > bool WKBundlePageCanHandleRequest(WKURLRequestRef requestRef) >diff --git a/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/ConvertToUTF8String.cpp b/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/ConvertToUTF8String.cpp >index b5e1657a0d21f6c1c97bb9038fd4a50199bcf1ad..715749a49239c31aab7fc1aedd02623e14e8aaea 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/ConvertToUTF8String.cpp >+++ b/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/ConvertToUTF8String.cpp >@@ -21,7 +21,7 @@ > #include "config.h" > #include "ConvertToUTF8String.h" > >-#include <WebCore/URL.h> >+#include <wtf/URL.h> > #include <wtf/text/CString.h> > #include <wtf/text/WTFString.h> > >@@ -35,7 +35,7 @@ gchar* convertToUTF8String(WTF::String const& s) > return g_strdup(s.utf8().data()); > } > >-gchar* convertToUTF8String(WebCore::URL const& s) >+gchar* convertToUTF8String(URL const& s) > { > return convertToUTF8String(s.string()); > } >diff --git a/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/ConvertToUTF8String.h b/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/ConvertToUTF8String.h >index e494113a3f8ff6e9c4dbe68af9f1d8a2e222fec9..c3725359b89347c1f8896adc5bcab4b6a4496c49 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/ConvertToUTF8String.h >+++ b/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/ConvertToUTF8String.h >@@ -23,13 +23,9 @@ > > #include <wtf/Forward.h> > >-namespace WebCore { >-class URL; >-} >- > typedef char gchar; > > gchar* convertToUTF8String(WTF::String const& s); >-gchar* convertToUTF8String(WebCore::URL const& s); >+gchar* convertToUTF8String(URL const& s); > > #endif /* ConvertToUTF8String_h */ >diff --git a/Source/WebKit/WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp b/Source/WebKit/WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp >index 1bb0ba1603728bc2fc92497acb0136bb9990572b..083174e5ed21f983973b26c7d7c8c488e102c226 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp >+++ b/Source/WebKit/WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp >@@ -37,7 +37,7 @@ > #include <WebCore/FrameLoader.h> > #include <WebCore/FrameView.h> > #include <WebCore/GraphicsContext.h> >-#include <WebCore/URL.h> >+#include <wtf/URL.h> > #include <wtf/text/WTFString.h> > > namespace WebKit { >diff --git a/Source/WebKit/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h b/Source/WebKit/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h >index ec5d00b0f7b8a8f9288998ad3981dca812b371e3..6d3e4921fe98de793719b180c0af28136f766f12 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h >+++ b/Source/WebKit/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h >@@ -34,7 +34,6 @@ > namespace API { > class Object; > class String; >-class URL; > > template<> struct ClientTraits<WKBundlePageLoaderClientBase> { > typedef std::tuple<WKBundlePageLoaderClientV0, WKBundlePageLoaderClientV1, WKBundlePageLoaderClientV2, WKBundlePageLoaderClientV3, WKBundlePageLoaderClientV4, WKBundlePageLoaderClientV5, WKBundlePageLoaderClientV6, WKBundlePageLoaderClientV7, WKBundlePageLoaderClientV8, WKBundlePageLoaderClientV9> Versions; >@@ -48,7 +47,7 @@ public: > explicit InjectedBundlePageLoaderClient(const WKBundlePageLoaderClientBase*); > > void willLoadURLRequest(WebPage&, const WebCore::ResourceRequest&, API::Object*) override; >- void willLoadDataRequest(WebPage&, const WebCore::ResourceRequest&, WebCore::SharedBuffer*, const WTF::String&, const WTF::String&, const WebCore::URL&, API::Object*) override; >+ void willLoadDataRequest(WebPage&, const WebCore::ResourceRequest&, WebCore::SharedBuffer*, const WTF::String&, const WTF::String&, const URL&, API::Object*) override; > > void didStartProvisionalLoadForFrame(WebPage&, WebFrame&, RefPtr<API::Object>&) override; > void didReceiveServerRedirectForProvisionalLoadForFrame(WebPage&, WebFrame&, RefPtr<API::Object>&) override; >@@ -86,7 +85,7 @@ public: > > void featuresUsedInPage(WebPage&, const Vector<WTF::String>&) override; > >- WTF::String userAgentForURL(WebFrame&, const WebCore::URL&) const override; >+ WTF::String userAgentForURL(WebFrame&, const URL&) const override; > > OptionSet<WebCore::LayoutMilestone> layoutMilestones() const override; > }; >diff --git a/Source/WebKit/WebProcess/MediaCache/WebMediaKeyStorageManager.cpp b/Source/WebKit/WebProcess/MediaCache/WebMediaKeyStorageManager.cpp >index e2a6978fe283ad53c348bf0707ab68df7d962362..903c6d012c1db288fba238b578bd06563448d814 100644 >--- a/Source/WebKit/WebProcess/MediaCache/WebMediaKeyStorageManager.cpp >+++ b/Source/WebKit/WebProcess/MediaCache/WebMediaKeyStorageManager.cpp >@@ -30,7 +30,7 @@ > #include <WebCore/FileSystem.h> > #include <WebCore/SecurityOrigin.h> > #include <WebCore/SecurityOriginData.h> >-#include <WebCore/URL.h> >+#include <wtf/URL.h> > > namespace WebKit { > using namespace WebCore; >diff --git a/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp b/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp >index 1278c1b443fad7bfa71f10f2b4f28686b6e0344f..65cf423ab1682725afd94a314be147b83ea9f1c0 100644 >--- a/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp >+++ b/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp >@@ -605,7 +605,7 @@ void WebLoaderStrategy::didFinishPingLoad(uint64_t pingLoadIdentifier, ResourceE > completionHandler(WTFMove(error), WTFMove(response)); > } > >-void WebLoaderStrategy::preconnectTo(FrameLoader& frameLoader, const WebCore::URL& url, StoredCredentialsPolicy storedCredentialsPolicy, PreconnectCompletionHandler&& completionHandler) >+void WebLoaderStrategy::preconnectTo(FrameLoader& frameLoader, const URL& url, StoredCredentialsPolicy storedCredentialsPolicy, PreconnectCompletionHandler&& completionHandler) > { > uint64_t preconnectionIdentifier = generateLoadIdentifier(); > auto addResult = m_preconnectCompletionHandlers.add(preconnectionIdentifier, WTFMove(completionHandler)); >diff --git a/Source/WebKit/WebProcess/Network/WebLoaderStrategy.h b/Source/WebKit/WebProcess/Network/WebLoaderStrategy.h >index e040d0755c794dbd71ea9c558842a065c52df5de..1c2fb3f11e45e3b7ea882963fa1ca093d8e6e164 100644 >--- a/Source/WebKit/WebProcess/Network/WebLoaderStrategy.h >+++ b/Source/WebKit/WebProcess/Network/WebLoaderStrategy.h >@@ -55,7 +55,7 @@ public: > > void remove(WebCore::ResourceLoader*) final; > void setDefersLoading(WebCore::ResourceLoader&, bool) final; >- void crossOriginRedirectReceived(WebCore::ResourceLoader*, const WebCore::URL& redirectURL) final; >+ void crossOriginRedirectReceived(WebCore::ResourceLoader*, const URL& redirectURL) final; > > void servePendingRequests(WebCore::ResourceLoadPriority minimumPriority) final; > >@@ -65,7 +65,7 @@ public: > void startPingLoad(WebCore::Frame&, WebCore::ResourceRequest&, const WebCore::HTTPHeaderMap& originalRequestHeaders, const WebCore::FetchOptions&, PingLoadCompletionHandler&&) final; > void didFinishPingLoad(uint64_t pingLoadIdentifier, WebCore::ResourceError&&, WebCore::ResourceResponse&&); > >- void preconnectTo(WebCore::FrameLoader&, const WebCore::URL&, WebCore::StoredCredentialsPolicy, PreconnectCompletionHandler&&) final; >+ void preconnectTo(WebCore::FrameLoader&, const URL&, WebCore::StoredCredentialsPolicy, PreconnectCompletionHandler&&) final; > void didFinishPreconnection(uint64_t preconnectionIdentifier, WebCore::ResourceError&&); > > void storeDerivedDataToCache(const SHA1::Digest& bodyHash, const String& type, const String& partition, WebCore::SharedBuffer&) final; >diff --git a/Source/WebKit/WebProcess/Network/WebSocketProvider.h b/Source/WebKit/WebProcess/Network/WebSocketProvider.h >index 0244e5f2c886205317699ecfd1e1a1b23c7fd998..69b7fa3b416f4ef396aeade4c12084bb352b1187 100644 >--- a/Source/WebKit/WebProcess/Network/WebSocketProvider.h >+++ b/Source/WebKit/WebProcess/Network/WebSocketProvider.h >@@ -32,7 +32,7 @@ namespace WebKit { > class WebSocketProvider final : public WebCore::SocketProvider { > public: > static Ref<WebSocketProvider> create() { return adoptRef(*new WebSocketProvider); } >- Ref<WebCore::SocketStreamHandle> createSocketStreamHandle(const WebCore::URL&, WebCore::SocketStreamHandleClient&, PAL::SessionID, const String& credentialPartition) final; >+ Ref<WebCore::SocketStreamHandle> createSocketStreamHandle(const URL&, WebCore::SocketStreamHandleClient&, PAL::SessionID, const String& credentialPartition) final; > virtual ~WebSocketProvider() { } > }; > >diff --git a/Source/WebKit/WebProcess/Network/WebSocketStream.cpp b/Source/WebKit/WebProcess/Network/WebSocketStream.cpp >index 7a0b9e312eb99d47ac52dee9de4aa68eaf54d747..1d5e229ac23da3087e46d935565aaa4d67b5a026 100644 >--- a/Source/WebKit/WebProcess/Network/WebSocketStream.cpp >+++ b/Source/WebKit/WebProcess/Network/WebSocketStream.cpp >@@ -70,7 +70,7 @@ Ref<WebSocketStream> WebSocketStream::create(const URL& url, SocketStreamHandleC > return adoptRef(*new WebSocketStream(url, client, sessionID, credentialPartition)); > } > >-WebSocketStream::WebSocketStream(const WebCore::URL& url, WebCore::SocketStreamHandleClient& client, PAL::SessionID sessionID, const String& cachePartition) >+WebSocketStream::WebSocketStream(const URL& url, WebCore::SocketStreamHandleClient& client, PAL::SessionID sessionID, const String& cachePartition) > : SocketStreamHandle(url, client) > , m_client(client) > { >diff --git a/Source/WebKit/WebProcess/Network/WebSocketStream.h b/Source/WebKit/WebProcess/Network/WebSocketStream.h >index 3feb6a635ffe9e79231d32b51c63fb72877d99e3..389a0b98b7598cc668be8db45f1711b8fe8f770e 100644 >--- a/Source/WebKit/WebProcess/Network/WebSocketStream.h >+++ b/Source/WebKit/WebProcess/Network/WebSocketStream.h >@@ -45,7 +45,7 @@ namespace WebKit { > > class WebSocketStream : public IPC::MessageSender, public IPC::MessageReceiver, public WebCore::SocketStreamHandle, public Identified<WebSocketStream> { > public: >- static Ref<WebSocketStream> create(const WebCore::URL&, WebCore::SocketStreamHandleClient&, PAL::SessionID, const String& credentialPartition); >+ static Ref<WebSocketStream> create(const URL&, WebCore::SocketStreamHandleClient&, PAL::SessionID, const String& credentialPartition); > static void networkProcessCrashed(); > static WebSocketStream* streamWithIdentifier(uint64_t); > >@@ -73,7 +73,7 @@ private: > IPC::Connection* messageSenderConnection() final; > uint64_t messageSenderDestinationID() final; > >- WebSocketStream(const WebCore::URL&, WebCore::SocketStreamHandleClient&, PAL::SessionID, const String& credentialPartition); >+ WebSocketStream(const URL&, WebCore::SocketStreamHandleClient&, PAL::SessionID, const String& credentialPartition); > ~WebSocketStream(); > > size_t m_bufferedAmount { 0 }; >diff --git a/Source/WebKit/WebProcess/Plugins/Netscape/NetscapePlugin.cpp b/Source/WebKit/WebProcess/Plugins/Netscape/NetscapePlugin.cpp >index 003d27a101879889daa66faa0c6d993e9160e10f..c6a50691740a5db3e65f197571b7bd4005bb71a0 100644 >--- a/Source/WebKit/WebProcess/Plugins/Netscape/NetscapePlugin.cpp >+++ b/Source/WebKit/WebProcess/Plugins/Netscape/NetscapePlugin.cpp >@@ -38,8 +38,8 @@ > #include <WebCore/HTTPHeaderMap.h> > #include <WebCore/IntRect.h> > #include <WebCore/SharedBuffer.h> >-#include <WebCore/URL.h> > #include <utility> >+#include <wtf/URL.h> > #include <wtf/text/CString.h> > > #if PLUGIN_ARCHITECTURE(UNIX) >diff --git a/Source/WebKit/WebProcess/Plugins/Netscape/NetscapePlugin.h b/Source/WebKit/WebProcess/Plugins/Netscape/NetscapePlugin.h >index bcb3d7fb777d131c7f2476f65b152f04390146d7..74a84e927cf5a7df62236cf4a9bffb9551239a8a 100644 >--- a/Source/WebKit/WebProcess/Plugins/Netscape/NetscapePlugin.h >+++ b/Source/WebKit/WebProcess/Plugins/Netscape/NetscapePlugin.h >@@ -139,7 +139,7 @@ public: > > void setIsPlayingAudio(bool); > >- void registerRedirect(NetscapePluginStream*, const WebCore::URL& requestURL, int redirectResponseStatus, void* notificationData); >+ void registerRedirect(NetscapePluginStream*, const URL& requestURL, int redirectResponseStatus, void* notificationData); > void urlRedirectResponse(void* notifyData, bool allow); > > // Member functions for calling into the plug-in. >@@ -204,13 +204,13 @@ private: > void frameDidFinishLoading(uint64_t requestID) override; > void frameDidFail(uint64_t requestID, bool wasCancelled) override; > void didEvaluateJavaScript(uint64_t requestID, const String& result) override; >- void streamWillSendRequest(uint64_t streamID, const WebCore::URL& requestURL, const WebCore::URL& responseURL, int responseStatus) override; >- void streamDidReceiveResponse(uint64_t streamID, const WebCore::URL& responseURL, uint32_t streamLength, >+ void streamWillSendRequest(uint64_t streamID, const URL& requestURL, const URL& responseURL, int responseStatus) override; >+ void streamDidReceiveResponse(uint64_t streamID, const URL& responseURL, uint32_t streamLength, > uint32_t lastModifiedTime, const String& mimeType, const String& headers, const String& suggestedFileName) override; > void streamDidReceiveData(uint64_t streamID, const char* bytes, int length) override; > void streamDidFinishLoading(uint64_t streamID) override; > void streamDidFail(uint64_t streamID, bool wasCancelled) override; >- void manualStreamDidReceiveResponse(const WebCore::URL& responseURL, uint32_t streamLength, >+ void manualStreamDidReceiveResponse(const URL& responseURL, uint32_t streamLength, > uint32_t lastModifiedTime, const String& mimeType, const String& headers, const String& suggestedFileName) override; > void manualStreamDidReceiveData(const char* bytes, int length) override; > void manualStreamDidFinishLoading() override; >diff --git a/Source/WebKit/WebProcess/Plugins/Netscape/NetscapePluginStream.h b/Source/WebKit/WebProcess/Plugins/Netscape/NetscapePluginStream.h >index 4074078d7a8fb538cff47dc1ada4f9d20b70d22f..bb6a5b08c7cce5dded899360f7ab8340f0395e74 100644 >--- a/Source/WebKit/WebProcess/Plugins/Netscape/NetscapePluginStream.h >+++ b/Source/WebKit/WebProcess/Plugins/Netscape/NetscapePluginStream.h >@@ -36,10 +36,6 @@ > #include <wtf/RunLoop.h> > #include <wtf/text/CString.h> > >-namespace WebCore { >-class URL; >-} >- > namespace WebKit { > > class NetscapePlugin; >@@ -55,8 +51,8 @@ public: > uint64_t streamID() const { return m_streamID; } > const NPStream* npStream() const { return &m_npStream; } > >- void willSendRequest(const WebCore::URL& requestURL, const WebCore::URL& redirectResponseURL, int redirectResponseStatus); >- void didReceiveResponse(const WebCore::URL& responseURL, uint32_t streamLength, >+ void willSendRequest(const URL& requestURL, const URL& redirectResponseURL, int redirectResponseStatus); >+ void didReceiveResponse(const URL& responseURL, uint32_t streamLength, > uint32_t lastModifiedTime, const String& mimeType, const String& headers); > void didReceiveData(const char* bytes, int length); > void didFinishLoading(); >diff --git a/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h b/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h >index e58de2c760ddb14c12c4cbfbf75ce92f5ab8e01a..6862e304fedb85b78634700b9d6b35a6c3c20cec 100644 >--- a/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h >+++ b/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h >@@ -135,12 +135,12 @@ private: > void frameDidFinishLoading(uint64_t requestID) final; > void frameDidFail(uint64_t requestID, bool wasCancelled) final; > void didEvaluateJavaScript(uint64_t requestID, const String& result) final; >- void streamWillSendRequest(uint64_t streamID, const WebCore::URL& requestURL, const WebCore::URL& responseURL, int responseStatus) final { } >- void streamDidReceiveResponse(uint64_t streamID, const WebCore::URL& responseURL, uint32_t streamLength, uint32_t lastModifiedTime, const String& mimeType, const String& headers, const String& suggestedFileName) final; >+ void streamWillSendRequest(uint64_t streamID, const URL& requestURL, const URL& responseURL, int responseStatus) final { } >+ void streamDidReceiveResponse(uint64_t streamID, const URL& responseURL, uint32_t streamLength, uint32_t lastModifiedTime, const String& mimeType, const String& headers, const String& suggestedFileName) final; > void streamDidReceiveData(uint64_t streamID, const char* bytes, int length) final; > void streamDidFinishLoading(uint64_t streamID) final; > void streamDidFail(uint64_t streamID, bool wasCancelled) final; >- void manualStreamDidReceiveResponse(const WebCore::URL& responseURL, uint32_t streamLength, uint32_t lastModifiedTime, const WTF::String& mimeType, const WTF::String& headers, const String& suggestedFileName) final; >+ void manualStreamDidReceiveResponse(const URL& responseURL, uint32_t streamLength, uint32_t lastModifiedTime, const WTF::String& mimeType, const WTF::String& headers, const String& suggestedFileName) final; > void manualStreamDidReceiveData(const char* bytes, int length) final; > void manualStreamDidFinishLoading() final; > void manualStreamDidFail(bool wasCancelled) final; >@@ -306,7 +306,7 @@ private: > > WebCore::IntSize m_size; > >- WebCore::URL m_sourceURL; >+ URL m_sourceURL; > > String m_suggestedFilename; > RetainPtr<CFMutableDataRef> m_data; >diff --git a/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm b/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm >index f79271d51a14a86e73c30dbbb9bb16e34aa966d9..c2cba090fbbdb2d9a190b1aff8fe355cd6fc3264 100644 >--- a/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm >+++ b/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm >@@ -1720,7 +1720,7 @@ bool PDFPlugin::handlesPageScaleFactor() const > void PDFPlugin::clickedLink(NSURL *url) > { > URL coreURL = url; >- if (protocolIsJavaScript(coreURL)) >+ if (WTF::protocolIsJavaScript(coreURL)) > return; > > Frame* frame = webFrame()->coreFrame(); >diff --git a/Source/WebKit/WebProcess/Plugins/Plugin.h b/Source/WebKit/WebProcess/Plugins/Plugin.h >index 876f6ce48eccb606339476a6661f26f4f90aa472..aabd5e5051bec29f55115738061a6a608ef23128 100644 >--- a/Source/WebKit/WebProcess/Plugins/Plugin.h >+++ b/Source/WebKit/WebProcess/Plugins/Plugin.h >@@ -23,16 +23,15 @@ > * THE POSSIBILITY OF SUCH DAMAGE. > */ > >-#ifndef Plugin_h >-#define Plugin_h >+#pragma once > > #include <WebCore/FindOptions.h> > #include <WebCore/GraphicsLayer.h> >-#include <WebCore/URL.h> > #include <WebCore/ScrollTypes.h> > #include <WebCore/SecurityOrigin.h> > #include <wtf/RefCounted.h> > #include <wtf/RetainPtr.h> >+#include <wtf/URL.h> > #include <wtf/Vector.h> > > #if PLATFORM(COCOA) >@@ -53,15 +52,15 @@ class Decoder; > } > > namespace WebCore { >- class AffineTransform; >- class FloatPoint; >- class GraphicsContext; >- class IntPoint; >- class IntRect; >- class IntSize; >- class FloatPoint; >- class Scrollbar; >- class SharedBuffer; >+class AffineTransform; >+class FloatPoint; >+class GraphicsContext; >+class IntPoint; >+class IntRect; >+class IntSize; >+class FloatPoint; >+class Scrollbar; >+class SharedBuffer; > } > > namespace WebKit { >@@ -82,7 +81,7 @@ enum PluginType { > class Plugin : public ThreadSafeRefCounted<Plugin> { > public: > struct Parameters { >- WebCore::URL url; >+ URL url; > Vector<String> names; > Vector<String> values; > String mimeType; >@@ -167,10 +166,10 @@ public: > virtual void didEvaluateJavaScript(uint64_t requestID, const String& result) = 0; > > // Tells the plug-in that a stream may send an HTTP request. >- virtual void streamWillSendRequest(uint64_t streamID, const WebCore::URL& requestURL, const WebCore::URL& responseURL, int responseStatusCode) = 0; >+ virtual void streamWillSendRequest(uint64_t streamID, const URL& requestURL, const URL& responseURL, int responseStatusCode) = 0; > > // Tells the plug-in that a stream has received its HTTP response. >- virtual void streamDidReceiveResponse(uint64_t streamID, const WebCore::URL& responseURL, uint32_t streamLength, >+ virtual void streamDidReceiveResponse(uint64_t streamID, const URL& responseURL, uint32_t streamLength, > uint32_t lastModifiedTime, const String& mimeType, const String& headers, const String& suggestedFileName) = 0; > > // Tells the plug-in that a stream did receive data. >@@ -183,7 +182,7 @@ public: > virtual void streamDidFail(uint64_t streamID, bool wasCancelled) = 0; > > // Tells the plug-in that the manual stream has received its HTTP response. >- virtual void manualStreamDidReceiveResponse(const WebCore::URL& responseURL, uint32_t streamLength, >+ virtual void manualStreamDidReceiveResponse(const URL& responseURL, uint32_t streamLength, > uint32_t lastModifiedTime, const String& mimeType, const String& headers, const String& suggestedFileName) = 0; > > // Tells the plug-in that the manual stream did receive data. >@@ -323,5 +322,3 @@ private: > SPECIALIZE_TYPE_TRAITS_BEGIN(WebKit::ToValueTypeName) \ > static bool isType(const WebKit::Plugin& plugin) { return plugin.type() == WebKit::SpecificPluginType; } \ > SPECIALIZE_TYPE_TRAITS_END() >- >-#endif // Plugin_h >diff --git a/Source/WebKit/WebProcess/Plugins/PluginController.h b/Source/WebKit/WebProcess/Plugins/PluginController.h >index a5c6fa043c36226941c8d2147b21208ec2f29475..a1f807e1e550723efeea177133b81dff4d176b35 100644 >--- a/Source/WebKit/WebProcess/Plugins/PluginController.h >+++ b/Source/WebKit/WebProcess/Plugins/PluginController.h >@@ -43,7 +43,6 @@ namespace WebCore { > class HTTPHeaderMap; > class IntRect; > class ProtectionSpace; >-class URL; > } > > namespace WebKit { >diff --git a/Source/WebKit/WebProcess/Plugins/PluginProxy.h b/Source/WebKit/WebProcess/Plugins/PluginProxy.h >index dc4211d00ed8910d347d8f0ca1b753c6b2e6ea1d..e6ab3ed9b032fe04c02df5c6892e47d4e69d4ac5 100644 >--- a/Source/WebKit/WebProcess/Plugins/PluginProxy.h >+++ b/Source/WebKit/WebProcess/Plugins/PluginProxy.h >@@ -87,12 +87,12 @@ private: > void frameDidFinishLoading(uint64_t requestID) override; > void frameDidFail(uint64_t requestID, bool wasCancelled) override; > void didEvaluateJavaScript(uint64_t requestID, const String& result) override; >- void streamWillSendRequest(uint64_t streamID, const WebCore::URL& requestURL, const WebCore::URL& responseURL, int responseStatus) override; >- void streamDidReceiveResponse(uint64_t streamID, const WebCore::URL& responseURL, uint32_t streamLength, uint32_t lastModifiedTime, const String& mimeType, const String& headers, const String& suggestedFileName) override; >+ void streamWillSendRequest(uint64_t streamID, const URL& requestURL, const URL& responseURL, int responseStatus) override; >+ void streamDidReceiveResponse(uint64_t streamID, const URL& responseURL, uint32_t streamLength, uint32_t lastModifiedTime, const String& mimeType, const String& headers, const String& suggestedFileName) override; > void streamDidReceiveData(uint64_t streamID, const char* bytes, int length) override; > void streamDidFinishLoading(uint64_t streamID) override; > void streamDidFail(uint64_t streamID, bool wasCancelled) override; >- void manualStreamDidReceiveResponse(const WebCore::URL& responseURL, uint32_t streamLength, uint32_t lastModifiedTime, const WTF::String& mimeType, const WTF::String& headers, const String& suggestedFileName) override; >+ void manualStreamDidReceiveResponse(const URL& responseURL, uint32_t streamLength, uint32_t lastModifiedTime, const WTF::String& mimeType, const WTF::String& headers, const String& suggestedFileName) override; > void manualStreamDidReceiveData(const char* bytes, int length) override; > void manualStreamDidFinishLoading() override; > void manualStreamDidFail(bool wasCancelled) override; >diff --git a/Source/WebKit/WebProcess/Plugins/PluginView.cpp b/Source/WebKit/WebProcess/Plugins/PluginView.cpp >index 75808b1b45b0ecc56839c3bfd125caed9af63e8e..4495c991122d0843dab0c84da60ba5a7c97ba6c8 100644 >--- a/Source/WebKit/WebProcess/Plugins/PluginView.cpp >+++ b/Source/WebKit/WebProcess/Plugins/PluginView.cpp >@@ -1163,7 +1163,7 @@ void PluginView::performURLRequest(URLRequest* request) > Ref<PluginView> protect(*this); > > // First, check if this is a javascript: url. >- if (protocolIsJavaScript(request->request().url())) { >+ if (WTF::protocolIsJavaScript(request->request().url())) { > performJavaScriptURLRequest(request); > return; > } >@@ -1228,7 +1228,7 @@ void PluginView::performFrameLoadURLRequest(URLRequest* request) > > void PluginView::performJavaScriptURLRequest(URLRequest* request) > { >- ASSERT(protocolIsJavaScript(request->request().url())); >+ ASSERT(WTF::protocolIsJavaScript(request->request().url())); > > RefPtr<Frame> frame = m_pluginElement->document().frame(); > if (!frame) >diff --git a/Source/WebKit/WebProcess/Plugins/WebPluginInfoProvider.cpp b/Source/WebKit/WebProcess/Plugins/WebPluginInfoProvider.cpp >index 5c51c45f6409deedd55e93c0fd988b7c873d831a..3f70b1e87b9afe8f3f065a419ccdb952ceffce64 100644 >--- a/Source/WebKit/WebProcess/Plugins/WebPluginInfoProvider.cpp >+++ b/Source/WebKit/WebProcess/Plugins/WebPluginInfoProvider.cpp >@@ -115,7 +115,7 @@ Vector<PluginInfo> WebPluginInfoProvider::pluginInfo(Page& page, std::optional<V > #endif // ENABLE(NETSCAPE_PLUGIN_API) > } > >-Vector<WebCore::PluginInfo> WebPluginInfoProvider::webVisiblePluginInfo(Page& page, const WebCore::URL& url) >+Vector<WebCore::PluginInfo> WebPluginInfoProvider::webVisiblePluginInfo(Page& page, const URL& url) > { > std::optional<Vector<WebCore::SupportedPluginIdentifier>> supportedPluginIdentifiers; > auto plugins = pluginInfo(page, supportedPluginIdentifiers); >diff --git a/Source/WebKit/WebProcess/Plugins/WebPluginInfoProvider.h b/Source/WebKit/WebProcess/Plugins/WebPluginInfoProvider.h >index 1bbad5a79fb11ec68074947d007c3cd56e5819dd..84642d7fc011f8cacf641bb1aee8f282393c07e8 100644 >--- a/Source/WebKit/WebProcess/Plugins/WebPluginInfoProvider.h >+++ b/Source/WebKit/WebProcess/Plugins/WebPluginInfoProvider.h >@@ -46,7 +46,7 @@ private: > WebPluginInfoProvider(); > > Vector<WebCore::PluginInfo> pluginInfo(WebCore::Page&, std::optional<Vector<WebCore::SupportedPluginIdentifier>>&) final; >- Vector<WebCore::PluginInfo> webVisiblePluginInfo(WebCore::Page&, const WebCore::URL&) final; >+ Vector<WebCore::PluginInfo> webVisiblePluginInfo(WebCore::Page&, const URL&) final; > void refreshPlugins() override; > > #if ENABLE(NETSCAPE_PLUGIN_API) >diff --git a/Source/WebKit/WebProcess/Storage/WebSWClientConnection.h b/Source/WebKit/WebProcess/Storage/WebSWClientConnection.h >index 2bfaee476e1f4bcccdb2660fe5d8e66bd674a3d7..dcd6da5806bb332c24ffec8518ee5096cbae7f83 100644 >--- a/Source/WebKit/WebProcess/Storage/WebSWClientConnection.h >+++ b/Source/WebKit/WebProcess/Storage/WebSWClientConnection.h >@@ -79,13 +79,13 @@ private: > void registerServiceWorkerClient(const WebCore::SecurityOrigin& topOrigin, const WebCore::ServiceWorkerClientData&, const std::optional<WebCore::ServiceWorkerRegistrationIdentifier>&) final; > void unregisterServiceWorkerClient(WebCore::DocumentIdentifier) final; > >- void matchRegistration(WebCore::SecurityOriginData&& topOrigin, const WebCore::URL& clientURL, RegistrationCallback&&) final; >+ void matchRegistration(WebCore::SecurityOriginData&& topOrigin, const URL& clientURL, RegistrationCallback&&) final; > void didMatchRegistration(uint64_t matchRequestIdentifier, std::optional<WebCore::ServiceWorkerRegistrationData>&&); > void didGetRegistrations(uint64_t matchRequestIdentifier, Vector<WebCore::ServiceWorkerRegistrationData>&&); >- void whenRegistrationReady(const WebCore::SecurityOrigin& topOrigin, const WebCore::URL& clientURL, WhenRegistrationReadyCallback&&) final; >+ void whenRegistrationReady(const WebCore::SecurityOrigin& topOrigin, const URL& clientURL, WhenRegistrationReadyCallback&&) final; > void registrationReady(uint64_t callbackID, WebCore::ServiceWorkerRegistrationData&&); > >- void getRegistrations(WebCore::SecurityOriginData&& topOrigin, const WebCore::URL& clientURL, GetRegistrationsCallback&&) final; >+ void getRegistrations(WebCore::SecurityOriginData&& topOrigin, const URL& clientURL, GetRegistrationsCallback&&) final; > > void didResolveRegistrationPromise(const WebCore::ServiceWorkerRegistrationKey&) final; > >diff --git a/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.h b/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.h >index e873fffd2a8c701ae86905ce9e5704f1a7b9c9b4..d9794699c91dc5d756dc33bdb2545c5f5dc0414d 100644 >--- a/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.h >+++ b/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.h >@@ -72,7 +72,7 @@ private: > void matchAll(WebCore::ServiceWorkerIdentifier, const WebCore::ServiceWorkerClientQueryOptions&, WebCore::ServiceWorkerClientsMatchAllCallback&&) final; > void claim(WebCore::ServiceWorkerIdentifier, CompletionHandler<void()>&&) final; > void skipWaiting(WebCore::ServiceWorkerIdentifier, Function<void()>&&) final; >- void setScriptResource(WebCore::ServiceWorkerIdentifier, const WebCore::URL&, const WebCore::ServiceWorkerContextData::ImportedScript&) final; >+ void setScriptResource(WebCore::ServiceWorkerIdentifier, const URL&, const WebCore::ServiceWorkerContextData::ImportedScript&) final; > > // IPC messages. > void serviceWorkerStartedWithMessage(std::optional<WebCore::ServiceWorkerJobDataIdentifier>, WebCore::ServiceWorkerIdentifier, const String& exceptionMessage) final; >diff --git a/Source/WebKit/WebProcess/UserContent/WebUserContentController.h b/Source/WebKit/WebProcess/UserContent/WebUserContentController.h >index 1c9b0f47c5a829d929107ac36df880afe4be163e..164f5782edc1f8e34b77debc9ed8b029d9008847 100644 >--- a/Source/WebKit/WebProcess/UserContent/WebUserContentController.h >+++ b/Source/WebKit/WebProcess/UserContent/WebUserContentController.h >@@ -57,10 +57,10 @@ public: > UserContentControllerIdentifier identifier() { return m_identifier; } > > void addUserScript(InjectedBundleScriptWorld&, WebCore::UserScript&&); >- void removeUserScriptWithURL(InjectedBundleScriptWorld&, const WebCore::URL&); >+ void removeUserScriptWithURL(InjectedBundleScriptWorld&, const URL&); > void removeUserScripts(InjectedBundleScriptWorld&); > void addUserStyleSheet(InjectedBundleScriptWorld&, WebCore::UserStyleSheet&&); >- void removeUserStyleSheetWithURL(InjectedBundleScriptWorld&, const WebCore::URL&); >+ void removeUserStyleSheetWithURL(InjectedBundleScriptWorld&, const URL&); > void removeUserStyleSheets(InjectedBundleScriptWorld&); > void removeAllUserContent(); > >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp >index 0d2bea4f2afbe88c7bfa933b79fbfceee65ae2bd..70dd6e99c04e93c7e20f2b45a241b131bff61181 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp >+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp >@@ -1189,7 +1189,7 @@ bool WebChromeClient::unwrapCryptoKey(const Vector<uint8_t>& wrappedKey, Vector< > > #endif > >-String WebChromeClient::signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String& challengeString, const WebCore::URL& url) const >+String WebChromeClient::signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String& challengeString, const URL& url) const > { > String result; > if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::SignedPublicKeyAndChallengeString(keySizeIndex, challengeString, url), Messages::WebPageProxy::SignedPublicKeyAndChallengeString::Reply(result), m_page.pageID())) >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h >index e1ae8575f3e3027e30483608ff54ee3512050450..54157a09a84bd8cf8d625bd80407bece24ac37b5 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h >+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h >@@ -217,7 +217,7 @@ private: > void scheduleCompositingLayerFlush() final; > bool adjustLayerFlushThrottling(WebCore::LayerFlushThrottleState::Flags) final; > >- void contentRuleListNotification(const WebCore::URL&, const HashSet<std::pair<String, String>>&) final; >+ void contentRuleListNotification(const URL&, const HashSet<std::pair<String, String>>&) final; > > #if PLATFORM(WIN) > void setLastSetCursorToCurrentCursor() final { } >@@ -330,7 +330,7 @@ private: > bool unwrapCryptoKey(const Vector<uint8_t>&, Vector<uint8_t>&) const final; > #endif > >- String signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String& challengeString, const WebCore::URL&) const final; >+ String signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String& challengeString, const URL&) const final; > > #if ENABLE(TELEPHONE_NUMBER_DETECTION) && PLATFORM(MAC) > void handleTelephoneNumberClick(const String& number, const WebCore::IntPoint&) final; >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebContextMenuClient.h b/Source/WebKit/WebProcess/WebCoreSupport/WebContextMenuClient.h >index cec3142b16e35d002cfc8c42f4e781b82ebe858c..5d8e7d6d0fa51a1051d80ca1766ee377fbcf3cb3 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/WebContextMenuClient.h >+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebContextMenuClient.h >@@ -44,7 +44,7 @@ public: > private: > void contextMenuDestroyed() override; > >- void downloadURL(const WebCore::URL&) override; >+ void downloadURL(const URL&) override; > void searchWithGoogle(const WebCore::Frame*) override; > void lookUpInDictionary(WebCore::Frame*) override; > bool isSpeaking() override; >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebDragClient.h b/Source/WebKit/WebProcess/WebCoreSupport/WebDragClient.h >index 9f7d7fc50b6ec8aee56bb259b73340c40d936727..1ad4c3de2cb7d38e6262c197aab24cca6feda821 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/WebDragClient.h >+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebDragClient.h >@@ -50,7 +50,7 @@ private: > void didConcludeEditDrag() override; > > #if PLATFORM(COCOA) >- void declareAndWriteDragImage(const String& pasteboardName, WebCore::Element&, const WebCore::URL&, const String&, WebCore::Frame*) override; >+ void declareAndWriteDragImage(const String& pasteboardName, WebCore::Element&, const URL&, const String&, WebCore::Frame*) override; > #endif > > void dragControllerDestroyed() override; >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp >index 879da68dc9b0e012d686136d4fb34ac0237d7073..6958e07c8647d04bbe9ad542b4c009d39e2018ef 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp >+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp >@@ -739,7 +739,7 @@ void WebFrameLoaderClient::dispatchDecidePolicyForResponse(const ResourceRespons > } > > // For suspension loads to about:blank, no need to ask the SuspendedPageProxy. >- if (request.url() == blankURL() && webPage->isSuspended()) { >+ if (request.url() == WTF::blankURL() && webPage->isSuspended()) { > function(PolicyAction::Use); > return; > } >@@ -1795,7 +1795,7 @@ bool WebFrameLoaderClient::allowScript(bool enabledPerSettings) > return !pluginView || !pluginView->shouldAllowScripting(); > } > >-bool WebFrameLoaderClient::shouldForceUniversalAccessFromLocalURL(const WebCore::URL& url) >+bool WebFrameLoaderClient::shouldForceUniversalAccessFromLocalURL(const URL& url) > { > WebPage* webPage = m_frame->page(); > if (!webPage) >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.h b/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.h >index 6c2c32d2da7c6f182033740b3bbf441c0ccaa63e..604d56c7ff7afcaeacf1040bba7cda314c36ab9c 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.h >+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.h >@@ -97,13 +97,13 @@ private: > void dispatchDidFinishDataDetection(NSArray *detectionResults) final; > #endif > void dispatchDidChangeMainDocument() final; >- void dispatchWillChangeDocument(const WebCore::URL& currentUrl, const WebCore::URL& newUrl) final; >+ void dispatchWillChangeDocument(const URL& currentUrl, const URL& newUrl) final; > > void dispatchDidDispatchOnloadEvents() final; > void dispatchDidReceiveServerRedirectForProvisionalLoad() final; > void dispatchDidChangeProvisionalURL() final; > void dispatchDidCancelClientRedirect() final; >- void dispatchWillPerformClientRedirect(const WebCore::URL&, double interval, WallTime fireDate, WebCore::LockBackForwardList) final; >+ void dispatchWillPerformClientRedirect(const URL&, double interval, WallTime fireDate, WebCore::LockBackForwardList) final; > void dispatchDidChangeLocationWithinPage() final; > void dispatchDidPushStateWithinPage() final; > void dispatchDidReplaceStateWithinPage() final; >@@ -155,8 +155,8 @@ private: > bool shouldGoToHistoryItem(WebCore::HistoryItem&) const final; > > void didDisplayInsecureContent() final; >- void didRunInsecureContent(WebCore::SecurityOrigin&, const WebCore::URL&) final; >- void didDetectXSS(const WebCore::URL&, bool didBlockEntirePage) final; >+ void didRunInsecureContent(WebCore::SecurityOrigin&, const URL&) final; >+ void didDetectXSS(const URL&, bool didBlockEntirePage) final; > > WebCore::ResourceError cancelledError(const WebCore::ResourceRequest&) final; > WebCore::ResourceError blockedError(const WebCore::ResourceRequest&) final; >@@ -189,9 +189,9 @@ private: > Ref<WebCore::DocumentLoader> createDocumentLoader(const WebCore::ResourceRequest&, const WebCore::SubstituteData&) final; > void updateCachedDocumentLoader(WebCore::DocumentLoader&) final; > >- void setTitle(const WebCore::StringWithDirection&, const WebCore::URL&) final; >+ void setTitle(const WebCore::StringWithDirection&, const URL&) final; > >- String userAgent(const WebCore::URL&) final; >+ String userAgent(const URL&) final; > > String overrideContentSecurityPolicy() const final; > >@@ -210,20 +210,20 @@ private: > bool canCachePage() const final; > void convertMainResourceLoadToDownload(WebCore::DocumentLoader*, PAL::SessionID, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&) final; > >- RefPtr<WebCore::Frame> createFrame(const WebCore::URL&, const String& name, WebCore::HTMLFrameOwnerElement&, const String& referrer) final; >+ RefPtr<WebCore::Frame> createFrame(const URL&, const String& name, WebCore::HTMLFrameOwnerElement&, const String& referrer) final; > >- RefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement&, const WebCore::URL&, const Vector<String>&, const Vector<String>&, const String&, bool loadManually) final; >+ RefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement&, const URL&, const Vector<String>&, const Vector<String>&, const String&, bool loadManually) final; > void recreatePlugin(WebCore::Widget*) final; > void redirectDataToPlugin(WebCore::Widget&) final; > > #if ENABLE(WEBGL) >- WebCore::WebGLLoadPolicy webGLPolicyForURL(const WebCore::URL&) const final; >- WebCore::WebGLLoadPolicy resolveWebGLPolicyForURL(const WebCore::URL&) const final; >+ WebCore::WebGLLoadPolicy webGLPolicyForURL(const URL&) const final; >+ WebCore::WebGLLoadPolicy resolveWebGLPolicyForURL(const URL&) const final; > #endif // ENABLE(WEBGL) > >- RefPtr<WebCore::Widget> createJavaAppletWidget(const WebCore::IntSize&, WebCore::HTMLAppletElement&, const WebCore::URL& baseURL, const Vector<String>& paramNames, const Vector<String>& paramValues) final; >+ RefPtr<WebCore::Widget> createJavaAppletWidget(const WebCore::IntSize&, WebCore::HTMLAppletElement&, const URL& baseURL, const Vector<String>& paramNames, const Vector<String>& paramValues) final; > >- WebCore::ObjectContentType objectContentType(const WebCore::URL&, const String& mimeType) final; >+ WebCore::ObjectContentType objectContentType(const URL&, const String& mimeType) final; > String overrideMediaType() const final; > > void dispatchDidClearWindowObjectInWorld(WebCore::DOMWrapperWorld&) final; >@@ -249,7 +249,7 @@ private: > > bool allowScript(bool enabledPerSettings) final; > >- bool shouldForceUniversalAccessFromLocalURL(const WebCore::URL&) final; >+ bool shouldForceUniversalAccessFromLocalURL(const URL&) final; > > Ref<WebCore::FrameNetworkingContext> createNetworkingContext() final; > >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp >index b0e07ef3d40b63596df2ea1bcf845ad763d03d36..f9b0ceef9cf0bfaf34f64da8b31607847142a0a3 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp >+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp >@@ -60,9 +60,9 @@ > #include <WebCore/SameSiteInfo.h> > #include <WebCore/StorageNamespace.h> > #include <WebCore/SubframeLoader.h> >-#include <WebCore/URL.h> > #include <pal/SessionID.h> > #include <wtf/Atomics.h> >+#include <wtf/URL.h> > > #if PLATFORM(MAC) > #include "StringUtilities.h" >@@ -364,7 +364,7 @@ RefPtr<WebCore::SharedBuffer> WebPlatformStrategies::readBufferFromPasteboard(in > return SharedBuffer::create(static_cast<unsigned char *>(sharedMemoryBuffer->data()), size); > } > >-WebCore::URL WebPlatformStrategies::readURLFromPasteboard(int index, const String& pasteboardName, String& title) >+URL WebPlatformStrategies::readURLFromPasteboard(int index, const String& pasteboardName, String& title) > { > String urlString; > WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPasteboardProxy::ReadURLFromPasteboard(index, pasteboardName), Messages::WebPasteboardProxy::ReadURLFromPasteboard::Reply(urlString, title), 0); >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebPlatformStrategies.h b/Source/WebKit/WebProcess/WebCoreSupport/WebPlatformStrategies.h >index 16a18a96ba0fb0c72395cccdbfb0820715b7fdcb..d69337b7a7804bf15333603ace74083c48ae071d 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/WebPlatformStrategies.h >+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebPlatformStrategies.h >@@ -47,13 +47,13 @@ private: > WebCore::BlobRegistry* createBlobRegistry() override; > > // WebCore::CookiesStrategy >- std::pair<String, bool> cookiesForDOM(const WebCore::NetworkStorageSession&, const WebCore::URL& firstParty, const WebCore::SameSiteInfo&, const WebCore::URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, WebCore::IncludeSecureCookies) override; >- void setCookiesFromDOM(const WebCore::NetworkStorageSession&, const WebCore::URL& firstParty, const WebCore::SameSiteInfo&, const WebCore::URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, const String&) override; >+ std::pair<String, bool> cookiesForDOM(const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, WebCore::IncludeSecureCookies) override; >+ void setCookiesFromDOM(const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, const String&) override; > bool cookiesEnabled(const WebCore::NetworkStorageSession&) override; >- std::pair<String, bool> cookieRequestHeaderFieldValue(const WebCore::NetworkStorageSession&, const WebCore::URL& firstParty, const WebCore::SameSiteInfo&, const WebCore::URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, WebCore::IncludeSecureCookies) override; >- std::pair<String, bool> cookieRequestHeaderFieldValue(PAL::SessionID, const WebCore::URL& firstParty, const WebCore::SameSiteInfo&, const WebCore::URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, WebCore::IncludeSecureCookies) override; >- bool getRawCookies(const WebCore::NetworkStorageSession&, const WebCore::URL& firstParty, const WebCore::SameSiteInfo&, const WebCore::URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, Vector<WebCore::Cookie>&) override; >- void deleteCookie(const WebCore::NetworkStorageSession&, const WebCore::URL&, const String&) override; >+ std::pair<String, bool> cookieRequestHeaderFieldValue(const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, WebCore::IncludeSecureCookies) override; >+ std::pair<String, bool> cookieRequestHeaderFieldValue(PAL::SessionID, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, WebCore::IncludeSecureCookies) override; >+ bool getRawCookies(const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, Vector<WebCore::Cookie>&) override; >+ void deleteCookie(const WebCore::NetworkStorageSession&, const URL&, const String&) override; > > // WebCore::PasteboardStrategy > #if PLATFORM(IOS_FAMILY) >@@ -64,7 +64,7 @@ private: > int getPasteboardItemsCount(const String& pasteboardName) override; > String readStringFromPasteboard(int index, const String& pasteboardType, const String& pasteboardName) override; > RefPtr<WebCore::SharedBuffer> readBufferFromPasteboard(int index, const String& pasteboardType, const String& pasteboardName) override; >- WebCore::URL readURLFromPasteboard(int index, const String& pasteboardName, String& title) override; >+ URL readURLFromPasteboard(int index, const String& pasteboardName, String& title) override; > Vector<WebCore::PasteboardItemInfo> allPasteboardItemInfo(const String& pasteboardName) override; > WebCore::PasteboardItemInfo informationForItemAtIndex(int index, const String& pasteboardName) override; > void updateSupportedTypeIdentifiers(const Vector<String>& identifiers, const String& pasteboardName) override; >@@ -80,7 +80,7 @@ private: > long changeCount(const String& pasteboardName) override; > String uniqueName() override; > WebCore::Color color(const String& pasteboardName) override; >- WebCore::URL url(const String& pasteboardName) override; >+ URL url(const String& pasteboardName) override; > > long addTypes(const Vector<String>& pasteboardTypes, const String& pasteboardName) override; > long setTypes(const Vector<String>& pasteboardTypes, const String& pasteboardName) override; >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm b/Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm >index 63b4f50aaa73f2dafb3fe3fd6bdb5b420d7933b9..ffee2a646cc6e89f2433f3a47fe7f647347a802e 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm >+++ b/Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm >@@ -48,8 +48,8 @@ > #import <WebCore/Pasteboard.h> > #import <WebCore/RenderImage.h> > #import <WebCore/StringTruncator.h> >-#import <WebCore/WebCoreNSURLExtras.h> > #import <wtf/StdLibExtras.h> >+#import <wtf/cocoa/NSURLExtras.h> > > #if PLATFORM(IOS_FAMILY) > #import "UIKitSPI.h" >@@ -129,7 +129,7 @@ void WebDragClient::declareAndWriteDragImage(const String& pasteboardName, Eleme > if (title.isEmpty()) { > title = url.lastPathComponent(); > if (title.isEmpty()) >- title = userVisibleString((NSURL *)url); >+ title = WTF::userVisibleString(url); > } > > RefPtr<LegacyWebArchive> archive = LegacyWebArchive::create(element); >@@ -166,7 +166,7 @@ void WebDragClient::declareAndWriteDragImage(const String& pasteboardName, Eleme > filename = downloadFilename; > } > >- m_page->send(Messages::WebPageProxy::SetPromisedDataForImage(pasteboardName, imageHandle, imageSize, filename, extension, title, String([[response URL] absoluteString]), userVisibleString((NSURL *)url), archiveHandle, archiveSize)); >+ m_page->send(Messages::WebPageProxy::SetPromisedDataForImage(pasteboardName, imageHandle, imageSize, filename, extension, title, String([[response URL] absoluteString]), WTF::userVisibleString(url), archiveHandle, archiveSize)); > } > > #endif // PLATFORM(MAC) >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm b/Source/WebKit/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm >index 1f90c4a5740f41509d8e85b19d4a07e80043a254..3d1ff849031111151ca2e87c8c4e707c2f13397d 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm >+++ b/Source/WebKit/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm >@@ -40,7 +40,7 @@ > #import <WebCore/Frame.h> > #import <WebCore/KeyboardEvent.h> > #import <WebCore/NotImplemented.h> >-#import <WebCore/WebCoreNSURLExtras.h> >+#import <wtf/cocoa/NSURLExtras.h> > > namespace WebKit { > using namespace WebCore; >diff --git a/Source/WebKit/WebProcess/WebPage/VisitedLinkTableController.h b/Source/WebKit/WebProcess/WebPage/VisitedLinkTableController.h >index 0923e460959b0f34a942ed924f044c53f84c33e6..17fa8ecca78ba8ac27681653a7d2e7fdd70fe273 100644 >--- a/Source/WebKit/WebProcess/WebPage/VisitedLinkTableController.h >+++ b/Source/WebKit/WebProcess/WebPage/VisitedLinkTableController.h >@@ -41,7 +41,7 @@ private: > explicit VisitedLinkTableController(uint64_t identifier); > > // WebCore::VisitedLinkStore. >- bool isLinkVisited(WebCore::Page&, WebCore::SharedStringHash, const WebCore::URL& baseURL, const AtomicString& attributeURL) override; >+ bool isLinkVisited(WebCore::Page&, WebCore::SharedStringHash, const URL& baseURL, const AtomicString& attributeURL) override; > void addVisitedLink(WebCore::Page&, WebCore::SharedStringHash) override; > > // IPC::MessageReceiver. >diff --git a/Source/WebKit/WebProcess/WebPage/WebFrame.cpp b/Source/WebKit/WebProcess/WebPage/WebFrame.cpp >index ec2d4e199eb7fd42574b7ec7760479255acd1af3..2332a569cd078cbb05599c2ae22199991dc3c86b 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebFrame.cpp >+++ b/Source/WebKit/WebProcess/WebPage/WebFrame.cpp >@@ -508,7 +508,7 @@ unsigned WebFrame::pendingUnloadCount() const > return m_coreFrame->document()->domWindow()->pendingUnloadEventListeners(); > } > >-bool WebFrame::allowsFollowingLink(const WebCore::URL& url) const >+bool WebFrame::allowsFollowingLink(const URL& url) const > { > if (!m_coreFrame) > return true; >diff --git a/Source/WebKit/WebProcess/WebPage/WebFrame.h b/Source/WebKit/WebProcess/WebPage/WebFrame.h >index 9d221e7d0d087f4b8c78c1cde16deb37c4d4a43a..617b18f27333e3b20b68ca437c2e2d0528131013 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebFrame.h >+++ b/Source/WebKit/WebProcess/WebPage/WebFrame.h >@@ -53,7 +53,6 @@ class Frame; > class HTMLFrameOwnerElement; > class IntPoint; > class IntRect; >-class URL; > } > > namespace WebKit { >@@ -105,7 +104,7 @@ public: > // WKBundleFrame API and SPI functions > bool isMainFrame() const; > String name() const; >- WebCore::URL url() const; >+ URL url() const; > WebCore::CertificateInfo certificateInfo() const; > String innerText() const; > bool isFrameSet() const; >@@ -139,11 +138,11 @@ public: > > unsigned pendingUnloadCount() const; > >- bool allowsFollowingLink(const WebCore::URL&) const; >+ bool allowsFollowingLink(const URL&) const; > > String provisionalURL() const; >- String suggestedFilenameForResourceWithURL(const WebCore::URL&) const; >- String mimeTypeForResourceWithURL(const WebCore::URL&) const; >+ String suggestedFilenameForResourceWithURL(const URL&) const; >+ String mimeTypeForResourceWithURL(const URL&) const; > > void setTextDirection(const String&); > >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.cpp b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >index 5ff246543d7931fcea8e89c4a95e03d0056ad995..10968cdf79217322e31bf761c8c4e60abc4624ba 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.cpp >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >@@ -1304,7 +1304,7 @@ void WebPage::sendClose() > send(Messages::WebPageProxy::ClosePage(false)); > } > >-void WebPage::loadURLInFrame(WebCore::URL&& url, uint64_t frameID) >+void WebPage::loadURLInFrame(URL&& url, uint64_t frameID) > { > WebFrame* frame = WebProcess::singleton().webFrame(frameID); > if (!frame) >@@ -1370,7 +1370,7 @@ void WebPage::loadData(LoadParameters&& loadParameters) > platformDidReceiveLoadParameters(loadParameters); > > auto sharedBuffer = SharedBuffer::create(reinterpret_cast<const char*>(loadParameters.data.data()), loadParameters.data.size()); >- URL baseURL = loadParameters.baseURLString.isEmpty() ? blankURL() : URL(URL(), loadParameters.baseURLString); >+ URL baseURL = loadParameters.baseURLString.isEmpty() ? WTF::blankURL() : URL(URL(), loadParameters.baseURLString); > loadDataImpl(loadParameters.navigationID, WTFMove(sharedBuffer), loadParameters.MIMEType, loadParameters.encodingName, baseURL, URL(), loadParameters.userData); > } > >@@ -1378,7 +1378,7 @@ void WebPage::loadAlternateHTML(const LoadParameters& loadParameters) > { > platformDidReceiveLoadParameters(loadParameters); > >- URL baseURL = loadParameters.baseURLString.isEmpty() ? blankURL() : URL(URL(), loadParameters.baseURLString); >+ URL baseURL = loadParameters.baseURLString.isEmpty() ? WTF::blankURL() : URL(URL(), loadParameters.baseURLString); > URL unreachableURL = loadParameters.unreachableURLString.isEmpty() ? URL() : URL(URL(), loadParameters.unreachableURLString); > URL provisionalLoadErrorURL = loadParameters.provisionalLoadErrorURLString.isEmpty() ? URL() : URL(URL(), loadParameters.provisionalLoadErrorURLString); > auto sharedBuffer = SharedBuffer::create(reinterpret_cast<const char*>(loadParameters.data.data()), loadParameters.data.size()); >@@ -1698,7 +1698,7 @@ String WebPage::dumpHistoryForTesting(const String& directory) > > StringBuilder builder; > int begin = -list.backCount(); >- if (list.itemAtIndex(begin)->url() == blankURL()) >+ if (list.itemAtIndex(begin)->url() == WTF::blankURL()) > ++begin; > for (int i = begin; i <= static_cast<int>(list.forwardCount()); ++i) > dumpHistoryItem(*list.itemAtIndex(i), 8, !i, builder, directory); >@@ -3577,7 +3577,7 @@ void WebPage::addConsoleMessage(uint64_t frameID, MessageSource messageSource, M > frame->addConsoleMessage(messageSource, messageLevel, message, requestID); > } > >-void WebPage::sendCSPViolationReport(uint64_t frameID, const WebCore::URL& reportURL, IPC::FormDataReference&& reportData) >+void WebPage::sendCSPViolationReport(uint64_t frameID, const URL& reportURL, IPC::FormDataReference&& reportData) > { > auto report = reportData.takeData(); > if (!report) >@@ -6089,14 +6089,14 @@ void WebPage::imageOrMediaDocumentSizeChanged(const IntSize& newSize) > > void WebPage::addUserScript(String&& source, WebCore::UserContentInjectedFrames injectedFrames, WebCore::UserScriptInjectionTime injectionTime) > { >- WebCore::UserScript userScript { WTFMove(source), URL(WebCore::blankURL()), Vector<String>(), Vector<String>(), injectionTime, injectedFrames }; >+ WebCore::UserScript userScript { WTFMove(source), URL(WTF::blankURL()), Vector<String>(), Vector<String>(), injectionTime, injectedFrames }; > > m_userContentController->addUserScript(InjectedBundleScriptWorld::normalWorld(), WTFMove(userScript)); > } > > void WebPage::addUserStyleSheet(const String& source, WebCore::UserContentInjectedFrames injectedFrames) > { >- WebCore::UserStyleSheet userStyleSheet{ source, WebCore::blankURL(), Vector<String>(), Vector<String>(), injectedFrames, UserStyleUserLevel }; >+ WebCore::UserStyleSheet userStyleSheet {source, WTF::blankURL(), Vector<String>(), Vector<String>(), injectedFrames, UserStyleUserLevel }; > > m_userContentController->addUserStyleSheet(InjectedBundleScriptWorld::normalWorld(), WTFMove(userStyleSheet)); > } >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.h b/Source/WebKit/WebProcess/WebPage/WebPage.h >index b32fc9880d626850820566c1602e694238046092..074a041fa65883294730d7a587e2e42e33f281ce 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.h >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.h >@@ -164,7 +164,6 @@ class SelectionRect; > class SharedBuffer; > class SubstituteData; > class TextCheckingRequest; >-class URL; > class VisiblePosition; > > enum SyntheticClickType : int8_t; >@@ -323,7 +322,7 @@ public: > #endif > > void addConsoleMessage(uint64_t frameID, MessageSource, MessageLevel, const String&, uint64_t requestID = 0); >- void sendCSPViolationReport(uint64_t frameID, const WebCore::URL& reportURL, IPC::FormDataReference&&); >+ void sendCSPViolationReport(uint64_t frameID, const URL& reportURL, IPC::FormDataReference&&); > void enqueueSecurityPolicyViolationEvent(uint64_t frameID, WebCore::SecurityPolicyViolationEvent::Init&&); > > // -- Called by the DrawingArea. >@@ -341,9 +340,9 @@ public: > void didReplaceMultipartContent(const WebFrame&); > void didFinishLoad(WebFrame*); > void show(); >- String userAgent(const WebCore::URL&) const; >- String userAgent(WebFrame*, const WebCore::URL&) const; >- String platformUserAgent(const WebCore::URL&) const; >+ String userAgent(const URL&) const; >+ String userAgent(WebFrame*, const URL&) const; >+ String platformUserAgent(const URL&) const; > WebCore::KeyboardUIMode keyboardUIMode(); > > void didInsertMenuElement(WebCore::HTMLMenuElement&); >@@ -428,8 +427,8 @@ public: > #endif > > #if ENABLE(WEBGL) >- WebCore::WebGLLoadPolicy webGLPolicyForURL(WebFrame*, const WebCore::URL&); >- WebCore::WebGLLoadPolicy resolveWebGLPolicyForURL(WebFrame*, const WebCore::URL&); >+ WebCore::WebGLLoadPolicy webGLPolicyForURL(WebFrame*, const URL&); >+ WebCore::WebGLLoadPolicy resolveWebGLPolicyForURL(WebFrame*, const URL&); > #endif > > enum class IncludePostLayoutDataHint { No, Yes }; >@@ -706,7 +705,7 @@ public: > WebContextMenu* contextMenuAtPointInWindow(const WebCore::IntPoint&); > #endif > >- bool hasLocalDataForURL(const WebCore::URL&); >+ bool hasLocalDataForURL(const URL&); > > static bool canHandleRequest(const WebCore::ResourceRequest&); > >@@ -966,7 +965,7 @@ public: > NSDictionary *dataDetectionContext() const { return m_dataDetectionContext.get(); } > #endif > >- void savePDFToFileInDownloadsFolder(const String& suggestedFilename, const WebCore::URL& originatingURL, const uint8_t* data, unsigned long size); >+ void savePDFToFileInDownloadsFolder(const String& suggestedFilename, const URL& originatingURL, const uint8_t* data, unsigned long size); > > #if PLATFORM(COCOA) > void savePDFToTemporaryFolderAndOpenWithNativeApplication(const String& suggestedFilename, const String& originatingURLString, const uint8_t* data, unsigned long size, const String& pdfUUID); >@@ -1192,7 +1191,7 @@ private: > > String sourceForFrame(WebFrame*); > >- void loadDataImpl(uint64_t navigationID, Ref<WebCore::SharedBuffer>&&, const String& MIMEType, const String& encodingName, const WebCore::URL& baseURL, const WebCore::URL& failingURL, const UserData&); >+ void loadDataImpl(uint64_t navigationID, Ref<WebCore::SharedBuffer>&&, const String& MIMEType, const String& encodingName, const URL& baseURL, const URL& failingURL, const UserData&); > > // Actions > void tryClose(); >@@ -1236,7 +1235,7 @@ private: > static bool scroll(WebCore::Page*, WebCore::ScrollDirection, WebCore::ScrollGranularity); > static bool logicalScroll(WebCore::Page*, WebCore::ScrollLogicalDirection, WebCore::ScrollGranularity); > >- void loadURLInFrame(WebCore::URL&&, uint64_t frameID); >+ void loadURLInFrame(URL&&, uint64_t frameID); > > enum class WasRestoredByAPIRequest { No, Yes }; > void restoreSessionInternal(const Vector<BackForwardListItemState>&, WasRestoredByAPIRequest, WebBackForwardListProxy::OverwriteExistingItem); >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.messages.in b/Source/WebKit/WebProcess/WebPage/WebPage.messages.in >index 7f301548585de8f30d05a55c02278e0bf027b796..43236559af0fc7c9b94e219f2ee0dc00e775d3d5 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.messages.in >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.messages.in >@@ -28,7 +28,7 @@ messages -> WebPage LegacyReceiver { > SetDrawsBackground(bool drawsBackground) > > AddConsoleMessage(uint64_t frameID, enum:uint8_t JSC::MessageSource messageSource, enum:uint8_t JSC::MessageLevel messageLevel, String message, uint64_t requestID) >- SendCSPViolationReport(uint64_t frameID, WebCore::URL reportURL, IPC::FormDataReference reportData) >+ SendCSPViolationReport(uint64_t frameID, URL reportURL, IPC::FormDataReference reportData) > EnqueueSecurityPolicyViolationEvent(uint64_t frameID, WebCore::SecurityPolicyViolationEvent::Init eventInit) > > #if PLATFORM(COCOA) >@@ -148,7 +148,7 @@ messages -> WebPage LegacyReceiver { > GoToBackForwardItem(uint64_t navigationID, struct WebCore::BackForwardItemIdentifier backForwardItemID, enum:uint8_t WebCore::FrameLoadType backForwardType, enum:bool WebCore::ShouldTreatAsContinuingLoad shouldTreatAsContinuingLoad) > TryRestoreScrollPosition() > >- LoadURLInFrame(WebCore::URL url, uint64_t frameID) >+ LoadURLInFrame(URL url, uint64_t frameID) > LoadRequest(struct WebKit::LoadParameters loadParameters) > LoadData(struct WebKit::LoadParameters loadParameters) > LoadAlternateHTML(struct WebKit::LoadParameters loadParameters) >diff --git a/Source/WebKit/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp b/Source/WebKit/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp >index e58e9f1dd7b077f561ca51c92fef715b0ae1429d..73566a13385de3aac646fb9496bddafcb5af46b6 100644 >--- a/Source/WebKit/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp >+++ b/Source/WebKit/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp >@@ -40,9 +40,9 @@ > #include <WebCore/PlatformContextCairo.h> > #include <WebCore/PrintContext.h> > #include <WebCore/ResourceError.h> >-#include <WebCore/URL.h> > #include <gtk/gtk.h> > #include <memory> >+#include <wtf/URL.h> > #include <wtf/Vector.h> > #include <wtf/glib/GUniquePtr.h> > >@@ -454,13 +454,13 @@ bool WebPrintOperationGtk::currentPageIsLastPageOfSheet() const > return (m_numberUp < 2 || !((m_pagePosition + 1) % m_numberUp) || m_pagePosition == m_numberOfPagesToPrint - 1); > } > >-WebCore::URL WebPrintOperationGtk::frameURL() const >+URL WebPrintOperationGtk::frameURL() const > { > if (!m_printContext) >- return WebCore::URL(); >+ return URL(); > > WebCore::DocumentLoader* documentLoader = m_printContext->frame()->loader().documentLoader(); >- return documentLoader ? documentLoader->url() : WebCore::URL(); >+ return documentLoader ? documentLoader->url() : URL(); > } > > void WebPrintOperationGtk::rotatePageIfNeeded() >diff --git a/Source/WebKit/WebProcess/WebPage/gtk/WebPrintOperationGtk.h b/Source/WebKit/WebProcess/WebPage/gtk/WebPrintOperationGtk.h >index b262df34c805faacdf200781db7aafe042e7f524..b7e1444294b25127d452f12a48b2fae895820f96 100644 >--- a/Source/WebKit/WebProcess/WebPage/gtk/WebPrintOperationGtk.h >+++ b/Source/WebKit/WebProcess/WebPage/gtk/WebPrintOperationGtk.h >@@ -40,7 +40,6 @@ typedef struct _GtkPageRange GtkPageRange; > namespace WebCore { > class PrintContext; > class ResourceError; >-class URL; > }; > > namespace WebKit { >@@ -97,7 +96,7 @@ protected: > void printPagesDone(); > void printDone(const WebCore::ResourceError&); > void sendPrintFinished(const WebCore::ResourceError&); >- WebCore::URL frameURL() const; >+ URL frameURL() const; > > WebPage* m_webPage; > GRefPtr<GtkPrintSettings> m_printSettings; >diff --git a/Source/WebKit/WebProcess/WebProcess.cpp b/Source/WebKit/WebProcess/WebProcess.cpp >index 72f4dc3a1a6ffd3695cc10db3c606d9532cf25ee..83222740e253dfbced6b3474a0731d6b3fba0b4a 100644 >--- a/Source/WebKit/WebProcess/WebProcess.cpp >+++ b/Source/WebKit/WebProcess/WebProcess.cpp >@@ -114,12 +114,12 @@ > #include <WebCore/SecurityOrigin.h> > #include <WebCore/ServiceWorkerContextData.h> > #include <WebCore/Settings.h> >-#include <WebCore/URLParser.h> > #include <WebCore/UserGestureIndicator.h> > #include <wtf/Language.h> > #include <wtf/ProcessPrivilege.h> > #include <wtf/RunLoop.h> > #include <wtf/SystemTracing.h> >+#include <wtf/URLParser.h> > #include <wtf/text/StringHash.h> > > #if !OS(WINDOWS) >@@ -1499,7 +1499,7 @@ void WebProcess::processDidResume() > #endif > } > >-void WebProcess::sendPrewarmInformation(const WebCore::URL& url) >+void WebProcess::sendPrewarmInformation(const URL& url) > { > auto registrableDomain = toRegistrableDomain(url); > if (registrableDomain.isEmpty()) >diff --git a/Source/WebKit/WebProcess/WebProcess.h b/Source/WebKit/WebProcess/WebProcess.h >index e7a32652d7cf1d40d97f85c0e220a7294042b589..fb78e63a2756e22b5b39aee1c4af5e95bbfc6cf0 100644 >--- a/Source/WebKit/WebProcess/WebProcess.h >+++ b/Source/WebKit/WebProcess/WebProcess.h >@@ -202,7 +202,7 @@ public: > void cancelPrepareToSuspend(); > void processDidResume(); > >- void sendPrewarmInformation(const WebCore::URL&); >+ void sendPrewarmInformation(const URL&); > > void isJITEnabled(CompletionHandler<void(bool)>&&); > >diff --git a/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm b/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm >index 5ed7f10c31b598a5df23acd16dc946006af4c4c2..bdae746d5d48e580d33ba9ecda363615f93b9f6c 100644 >--- a/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm >+++ b/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm >@@ -63,7 +63,6 @@ > #import <WebCore/NSScrollerImpDetails.h> > #import <WebCore/PerformanceLogging.h> > #import <WebCore/RuntimeApplicationChecks.h> >-#import <WebCore/WebCoreNSURLExtras.h> > #import <algorithm> > #import <dispatch/dispatch.h> > #import <objc/runtime.h> >@@ -74,6 +73,7 @@ > #import <pal/spi/mac/NSAccessibilitySPI.h> > #import <pal/spi/mac/NSApplicationSPI.h> > #import <stdio.h> >+#import <wtf/cocoa/NSURLExtras.h> > > #if PLATFORM(IOS_FAMILY) > #import "WKAccessibilityWebPageObjectIOS.h" >@@ -494,7 +494,7 @@ static RetainPtr<NSArray<NSString *>> activePagesOrigins(const HashMap<uint64_t, > continue; > > if (NSURL *originAsURL = origin(*page)) >- [activeOrigins addObject:userVisibleString(originAsURL)]; >+ [activeOrigins addObject:WTF::userVisibleString(originAsURL)]; > } > > return activeOrigins; >diff --git a/Source/WebKitLegacy/WebCoreSupport/WebResourceLoadScheduler.cpp b/Source/WebKitLegacy/WebCoreSupport/WebResourceLoadScheduler.cpp >index 991815064641e508cdb27d43f5526e9430a9a0f8..f7aba489aa24d2363cee92321353e9b7e79755aa 100644 >--- a/Source/WebKitLegacy/WebCoreSupport/WebResourceLoadScheduler.cpp >+++ b/Source/WebKitLegacy/WebCoreSupport/WebResourceLoadScheduler.cpp >@@ -35,9 +35,9 @@ > #include <WebCore/PlatformStrategies.h> > #include <WebCore/ResourceRequest.h> > #include <WebCore/SubresourceLoader.h> >-#include <WebCore/URL.h> > #include <wtf/MainThread.h> > #include <wtf/SetForScope.h> >+#include <wtf/URL.h> > #include <wtf/text/CString.h> > > #if PLATFORM(IOS_FAMILY) >diff --git a/Source/WebKitLegacy/WebCoreSupport/WebResourceLoadScheduler.h b/Source/WebKitLegacy/WebCoreSupport/WebResourceLoadScheduler.h >index 8a56a9e799fa1ff8249f0140cad381a5e2aca83b..edf651fa6dfbca318a8f6f207f4b649ade1bf102 100644 >--- a/Source/WebKitLegacy/WebCoreSupport/WebResourceLoadScheduler.h >+++ b/Source/WebKitLegacy/WebCoreSupport/WebResourceLoadScheduler.h >@@ -55,7 +55,7 @@ public: > > void remove(WebCore::ResourceLoader*) final; > void setDefersLoading(WebCore::ResourceLoader&, bool) final; >- void crossOriginRedirectReceived(WebCore::ResourceLoader*, const WebCore::URL& redirectURL) final; >+ void crossOriginRedirectReceived(WebCore::ResourceLoader*, const URL& redirectURL) final; > > void servePendingRequests(WebCore::ResourceLoadPriority minimumPriority = WebCore::ResourceLoadPriority::VeryLow) final; > void suspendPendingRequests() final; >@@ -63,7 +63,7 @@ public: > > void startPingLoad(WebCore::Frame&, WebCore::ResourceRequest&, const WebCore::HTTPHeaderMap&, const WebCore::FetchOptions&, PingLoadCompletionHandler&&) final; > >- void preconnectTo(WebCore::FrameLoader&, const WebCore::URL&, WebCore::StoredCredentialsPolicy, PreconnectCompletionHandler&&) final; >+ void preconnectTo(WebCore::FrameLoader&, const URL&, WebCore::StoredCredentialsPolicy, PreconnectCompletionHandler&&) final; > > void storeDerivedDataToCache(const SHA1::Digest&, const String&, const String&, WebCore::SharedBuffer&) final { } > >@@ -118,7 +118,7 @@ private: > FindOnly > }; > >- HostInformation* hostForURL(const WebCore::URL&, CreateHostPolicy = FindOnly); >+ HostInformation* hostForURL(const URL&, CreateHostPolicy = FindOnly); > void servePendingRequests(HostInformation*, WebCore::ResourceLoadPriority); > > typedef HashMap<String, HostInformation*, StringHash> HostMap; >diff --git a/Source/WebKitLegacy/mac/DOM/DOMAttr.mm b/Source/WebKitLegacy/mac/DOM/DOMAttr.mm >index e8f76f164e065f8028e9a6f67ea35d52eb7ec875..216ba6548071c66d1a5a604d9cdadc3acb299ef4 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMAttr.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMAttr.mm >@@ -35,9 +35,9 @@ > #import <WebCore/JSExecState.h> > #import <WebCore/StyleProperties.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::Attr*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMBlob.mm b/Source/WebKitLegacy/mac/DOM/DOMBlob.mm >index 4e6edc56a63ff4ca7cf4b46ce1c7724839113c6e..de5913ca18600c8ed3c952b1a969d7eeedb752d1 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMBlob.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMBlob.mm >@@ -31,10 +31,10 @@ > #import "ExceptionHandlers.h" > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebCoreObjCExtras.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL reinterpret_cast<WebCore::Blob*>(_internal) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMCSSCharsetRule.mm b/Source/WebKitLegacy/mac/DOM/DOMCSSCharsetRule.mm >index d1b5eabd75d6fab6c7ccc7d66aff23d4c21201d4..7bfffdc21dba0897f66fe5ae14553c5ec537bf41 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMCSSCharsetRule.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMCSSCharsetRule.mm >@@ -30,9 +30,9 @@ > #import "ExceptionHandlers.h" > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > @implementation DOMCSSCharsetRule > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMCSSImportRule.mm b/Source/WebKitLegacy/mac/DOM/DOMCSSImportRule.mm >index 8804f24500bd6e8ef7c2b60e47067e6c92d3e003..c5178ae20184c62fb3da0adfe687e43d4ae52c3a 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMCSSImportRule.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMCSSImportRule.mm >@@ -35,9 +35,9 @@ > #import <WebCore/JSExecState.h> > #import <WebCore/MediaList.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::CSSImportRule*>(reinterpret_cast<WebCore::CSSRule*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMCSSMediaRule.mm b/Source/WebKitLegacy/mac/DOM/DOMCSSMediaRule.mm >index 159a9a494987bd54519cbd62e430901a7d0c8c9e..eb5dcf22f7cfb8c61679979a5a3248253f9f9e7d 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMCSSMediaRule.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMCSSMediaRule.mm >@@ -35,9 +35,9 @@ > #import <WebCore/JSExecState.h> > #import <WebCore/MediaList.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::CSSMediaRule*>(reinterpret_cast<WebCore::CSSRule*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMCSSPageRule.mm b/Source/WebKitLegacy/mac/DOM/DOMCSSPageRule.mm >index f362231ce5bcfd6dea65f11d314c41bdc9f93429..b6bc278099f8247717b2f9b7291bf93bfe815147 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMCSSPageRule.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMCSSPageRule.mm >@@ -34,9 +34,9 @@ > #import <WebCore/JSExecState.h> > #import <WebCore/StyleProperties.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::CSSPageRule*>(reinterpret_cast<WebCore::CSSRule*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMCSSPrimitiveValue.mm b/Source/WebKitLegacy/mac/DOM/DOMCSSPrimitiveValue.mm >index 35a89349c32128bf93725b66fac4666488d6e058..055ea9ec4ab5a51239768c3f77b9e03699e79778 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMCSSPrimitiveValue.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMCSSPrimitiveValue.mm >@@ -37,9 +37,9 @@ > #import "ExceptionHandlers.h" > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::DeprecatedCSSOMPrimitiveValue*>(reinterpret_cast<WebCore::DeprecatedCSSOMValue*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMCSSRule.mm b/Source/WebKitLegacy/mac/DOM/DOMCSSRule.mm >index d48cb3f9229ddb2bd63dd99f091fd5bc5c652d0f..a12b0e8c8f07770168e98cb7aa7551d7afd5b259 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMCSSRule.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMCSSRule.mm >@@ -34,10 +34,10 @@ > #import "ExceptionHandlers.h" > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebCoreObjCExtras.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL reinterpret_cast<WebCore::CSSRule*>(_internal) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMCSSStyleDeclaration.mm b/Source/WebKitLegacy/mac/DOM/DOMCSSStyleDeclaration.mm >index 2d9fefffc15400d98733133c8a374f1d6e938ef8..b3b07f3398686dedbd0dd2c9246419a1ecfd7661 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMCSSStyleDeclaration.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMCSSStyleDeclaration.mm >@@ -36,10 +36,10 @@ > #import "ExceptionHandlers.h" > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebCoreObjCExtras.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL reinterpret_cast<WebCore::CSSStyleDeclaration*>(_internal) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMCSSStyleRule.mm b/Source/WebKitLegacy/mac/DOM/DOMCSSStyleRule.mm >index 8a4cff30cdd55312f7dd427e5121a0661d10b909..2ae1913b2e43f8312feb40842aa8f97e0fb4f692 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMCSSStyleRule.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMCSSStyleRule.mm >@@ -34,9 +34,9 @@ > #import <WebCore/JSExecState.h> > #import <WebCore/StyleProperties.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::CSSStyleRule*>(reinterpret_cast<WebCore::CSSRule*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMCSSStyleSheet.mm b/Source/WebKitLegacy/mac/DOM/DOMCSSStyleSheet.mm >index 8c2406016c0ea5cebaeeadd6dfd99597151088ad..269f0248c7c60140e474b88407b00a380065ffb9 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMCSSStyleSheet.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMCSSStyleSheet.mm >@@ -36,9 +36,9 @@ > #import "ExceptionHandlers.h" > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::CSSStyleSheet*>(reinterpret_cast<WebCore::StyleSheet*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMCSSValue.mm b/Source/WebKitLegacy/mac/DOM/DOMCSSValue.mm >index 0c6e074d8f3d150500091b111dd9987c88aa738f..b77d4b87206596308c732f8af34c161489f621d1 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMCSSValue.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMCSSValue.mm >@@ -31,10 +31,10 @@ > #import "ExceptionHandlers.h" > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebCoreObjCExtras.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL reinterpret_cast<WebCore::DeprecatedCSSOMValue*>(_internal) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMCharacterData.mm b/Source/WebKitLegacy/mac/DOM/DOMCharacterData.mm >index 8c3b4d4a582fe947a0c38d064f9a1291b599c9c3..b30e957940ed966575bc634944e7a9160e5292f9 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMCharacterData.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMCharacterData.mm >@@ -31,10 +31,10 @@ > #import "ExceptionHandlers.h" > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <WebCore/CharacterData.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::CharacterData*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMCounter.mm b/Source/WebKitLegacy/mac/DOM/DOMCounter.mm >index 2d1e5657ea2d668d2005b53c4859edd9d52f8bf8..308701e5b48186747323c18deed4e430adac2b42 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMCounter.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMCounter.mm >@@ -31,10 +31,10 @@ > #import "ExceptionHandlers.h" > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebCoreObjCExtras.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL reinterpret_cast<WebCore::DeprecatedCSSOMCounter*>(_internal) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMDocument.mm b/Source/WebKitLegacy/mac/DOM/DOMDocument.mm >index ad558529abb783a81d3f9832fc43f9abc3a23a50..3b04d3933d24aae3335bd87b81069f4cce7bd614 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMDocument.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMDocument.mm >@@ -82,12 +82,12 @@ > #import <WebCore/Text.h> > #import <WebCore/ThreadCheck.h> > #import <WebCore/TreeWalker.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <WebCore/XPathExpression.h> > #import <WebCore/XPathNSResolver.h> > #import <WebCore/XPathResult.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::Document*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMDocumentFragment.mm b/Source/WebKitLegacy/mac/DOM/DOMDocumentFragment.mm >index 96d0329b49ae615b71efaa4c05b26911de85c17d..2ee2cf84c63948c0002f8a65d8cd669a7679d24c 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMDocumentFragment.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMDocumentFragment.mm >@@ -37,9 +37,9 @@ > #import <WebCore/NameNodeList.h> > #import <WebCore/NodeList.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::DocumentFragment*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMDocumentType.mm b/Source/WebKitLegacy/mac/DOM/DOMDocumentType.mm >index e201176a92dc66640cd501ef7ec20acd8464af92..7b2e03ec521cdf07403265900e6d3cb06342a3d2 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMDocumentType.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMDocumentType.mm >@@ -32,9 +32,9 @@ > #import <WebCore/JSExecState.h> > #import <WebCore/NamedNodeMap.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::DocumentType*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMEvent.mm b/Source/WebKitLegacy/mac/DOM/DOMEvent.mm >index 60cdb6e57f5be1760f4d915d38ae4a33557517cd..2d6154b1e0646d8a31c0c030ece6333fb516c085 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMEvent.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMEvent.mm >@@ -33,10 +33,10 @@ > #import <WebCore/JSExecState.h> > #import <WebCore/Node.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebCoreObjCExtras.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL reinterpret_cast<WebCore::Event*>(_internal) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMFile.mm b/Source/WebKitLegacy/mac/DOM/DOMFile.mm >index eda87fff1c4e4b5a9a87c6db8b402ac4b24b287f..fdc5413b9a5f46b9eda5fc0a7b36ae5f85d3dbda 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMFile.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMFile.mm >@@ -31,9 +31,9 @@ > #import <WebCore/File.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::File*>(reinterpret_cast<WebCore::Blob*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLAnchorElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLAnchorElement.mm >index 4460f27c6dfdd306560c124d9d79941c8d5c852d..c6c01bd7a6961770ce8ff18e576c10985eff4943 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLAnchorElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLAnchorElement.mm >@@ -34,9 +34,9 @@ > #import <WebCore/HTMLNames.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLAnchorElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLAppletElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLAppletElement.mm >index a84542da47d644dc362e8fd1dfb52d06b213a64a..26b8d3c58bebd2d7d5db2e8dccce269a0f95bcf9 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLAppletElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLAppletElement.mm >@@ -31,9 +31,9 @@ > #import <WebCore/HTMLNames.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLAppletElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLAreaElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLAreaElement.mm >index c4ab23202757efc226d347e50a210dd43e12052e..b9aca896a4c091768cfa0318b6c6b7a07ed57558 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLAreaElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLAreaElement.mm >@@ -34,9 +34,9 @@ > #import <WebCore/HTMLNames.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLAreaElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLBRElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLBRElement.mm >index cf5b3e0884139c98e4b78cb378df1a67c43598b8..432464b8dd2d5626310188c71807285916339370 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLBRElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLBRElement.mm >@@ -31,9 +31,9 @@ > #import <WebCore/HTMLNames.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLBRElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLBaseElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLBaseElement.mm >index 514b7091b43d122772d070c77e6a11df48006c13..afe3b6993b6386d739e14cfca3b7c9df6941e66c 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLBaseElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLBaseElement.mm >@@ -31,9 +31,9 @@ > #import <WebCore/HTMLNames.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLBaseElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLBaseFontElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLBaseFontElement.mm >index a99c0b62381f251c21e807685fb9350306711a4d..2633c80f724d87944debf908f0392fe7bfcda4ce 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLBaseFontElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLBaseFontElement.mm >@@ -31,9 +31,9 @@ > #import <WebCore/HTMLUnknownElement.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLUnknownElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLBodyElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLBodyElement.mm >index 695293b42463fbe66287b064764ef69dfe58f704..df6120866c6bc62c41223397ff1cb30c6a6f446a 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLBodyElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLBodyElement.mm >@@ -31,9 +31,9 @@ > #import <WebCore/HTMLNames.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLBodyElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLButtonElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLButtonElement.mm >index 98aa27c56275c543cd4d9e2fbb27c18db9d82ab5..7c7595d31483032cfaebfe401c17321cb9dbd42b 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLButtonElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLButtonElement.mm >@@ -36,9 +36,9 @@ > #import <WebCore/NameNodeList.h> > #import <WebCore/NodeList.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLButtonElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLCanvasElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLCanvasElement.mm >index 0fd60a6da8aaaabe74d2bd2bd9479b814bd96351..18b313eb44ac036b037f58a94235769bedd1043a 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLCanvasElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLCanvasElement.mm >@@ -31,9 +31,9 @@ > #import <WebCore/JSExecState.h> > #import <WebCore/StringAdaptors.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLCanvasElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLCollection.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLCollection.mm >index e344098cb48e2d390f540bc1d50e6973cc43d7f1..aac18549d3d8b47813bc154b1ca5c41173b536d1 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLCollection.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLCollection.mm >@@ -35,10 +35,10 @@ > #import <WebCore/Node.h> > #import <WebCore/NodeList.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebCoreObjCExtras.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL reinterpret_cast<WebCore::HTMLCollection*>(_internal) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLDivElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLDivElement.mm >index 2936afac02531858d1fb8a94d272fff95ce949dd..9cb03a01196b7f44154527a7c5c255b7d3ae9cbe 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLDivElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLDivElement.mm >@@ -31,9 +31,9 @@ > #import <WebCore/HTMLNames.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLDivElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLDocument.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLDocument.mm >index 0375a3cf4fd671f6336fbb37c9bb7c9aef01763d..88d142eada841137050148fce4ec875f0227b7db 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLDocument.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLDocument.mm >@@ -32,9 +32,9 @@ > #import <WebCore/HTMLDocument.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLDocument*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLElement.mm >index a5e0cd31913bd387326635e7935f4aa89819c6f0..2fe24c70749788725084f366f90b9d8449768054 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLElement.mm >@@ -36,9 +36,9 @@ > #import <WebCore/HitTestResult.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLEmbedElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLEmbedElement.mm >index 6b82be08e82166c31940a348ecf97258259cc9d0..0d6d881471a815e203a0c454d0d766a609d7e73b 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLEmbedElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLEmbedElement.mm >@@ -31,9 +31,9 @@ > #import <WebCore/HTMLNames.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLEmbedElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLFieldSetElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLFieldSetElement.mm >index ea92a019a5065695c6446ada49395f6fa3ae2666..1fd4d80bc718c956a35d6c8bc0a07fb02a996c83 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLFieldSetElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLFieldSetElement.mm >@@ -36,10 +36,10 @@ > #import <WebCore/HTMLNames.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/ValidityState.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLFieldSetElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLFontElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLFontElement.mm >index 80de490549248033a32bfca038b3af7719c6fb76..910e8f7d466f1de3a78ecd32fd8771bb7e8482d8 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLFontElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLFontElement.mm >@@ -31,9 +31,9 @@ > #import <WebCore/HTMLNames.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLFontElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLFormElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLFormElement.mm >index bfde1dad814eddcbea7657afb78cd34f7bedd56f..e8626ba35aa337f4b4c7cfa1bd833b95feee7825 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLFormElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLFormElement.mm >@@ -33,9 +33,9 @@ > #import <WebCore/HTMLNames.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLFormElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLFrameElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLFrameElement.mm >index 600f44f89bc43997dc40e006d26cc352e381aaf1..eb5c55ac2b67af4deebdf615a374e2573eb33b80 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLFrameElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLFrameElement.mm >@@ -35,9 +35,9 @@ > #import <WebCore/HTMLNames.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLFrameElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLFrameSetElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLFrameSetElement.mm >index f2f207f052497c2197b743477c3cbb3126ffc98a..69b95a06f78d886840e36606b7715c290616415f 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLFrameSetElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLFrameSetElement.mm >@@ -31,9 +31,9 @@ > #import <WebCore/HTMLNames.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLFrameSetElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLHRElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLHRElement.mm >index b2578aa2df3ee890085612fc217735835265b76d..a726bdc1e0227ab26cf009b736734187fe402af7 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLHRElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLHRElement.mm >@@ -31,9 +31,9 @@ > #import <WebCore/HTMLNames.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLHRElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLHeadElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLHeadElement.mm >index bef39ae5706f949acd27f41b5d0bb27eee2fd2a7..9ca4b880b1aaabad8c30a9eb1d6e40e330bed82e 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLHeadElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLHeadElement.mm >@@ -31,9 +31,9 @@ > #import <WebCore/HTMLNames.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLHeadElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLHeadingElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLHeadingElement.mm >index 811bb18048861f8b1712c9356c1d8276d0113189..a2dfb6a3ec1eb05c8cb3111222046a002c79dc9f 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLHeadingElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLHeadingElement.mm >@@ -31,9 +31,9 @@ > #import <WebCore/HTMLNames.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLHeadingElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLHtmlElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLHtmlElement.mm >index 287ce7f94ff2e9c965f35fde43350cd4ab3cbc1f..ebc3cfe7486142633d33926d5de13e59fec18ca2 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLHtmlElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLHtmlElement.mm >@@ -31,9 +31,9 @@ > #import <WebCore/HTMLNames.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLHtmlElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLIFrameElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLIFrameElement.mm >index f382c9ef8e096923a630e5dbbd597267f1e169df..e321b4f76d216e23a3d9fa043ccef788ac37a7db 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLIFrameElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLIFrameElement.mm >@@ -35,9 +35,9 @@ > #import <WebCore/HTMLNames.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLIFrameElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLImageElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLImageElement.mm >index fc91953cecc2caeee762b345420241bbf9b37151..eba4ec92316c39ce0134cdb005d16093b0322db6 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLImageElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLImageElement.mm >@@ -33,9 +33,9 @@ > #import <WebCore/HitTestResult.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLImageElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLInputElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLInputElement.mm >index 8363735d9474a86ba8a805e0f1a3eba6f84d4bcd..d737a557e9a3ec035353c512690dbe78eb0e847b 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLInputElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLInputElement.mm >@@ -64,9 +64,9 @@ > #import <WebCore/NodeList.h> > #import <WebCore/RenderElement.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLInputElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLLIElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLLIElement.mm >index 269d1a54add8ce2bd4feaf6a42a63982085feda0..a3cf3fa8dbfa8cead7a29fa98c277a84d9bf0dee 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLLIElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLLIElement.mm >@@ -31,9 +31,9 @@ > #import <WebCore/HTMLNames.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLLIElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLLabelElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLLabelElement.mm >index 51f560c09791893ae66dc552d2f9697d2fbf0281..8139000eaea4ca7d0ee92b580f4cf08017a11626 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLLabelElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLLabelElement.mm >@@ -35,9 +35,9 @@ > #import <WebCore/HTMLNames.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLLabelElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLLegendElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLLegendElement.mm >index 9343ca6e9dfaf73780657cf542ae1225452d8b0c..d4f1f36c5f24b194a92c82b10cdba1d8e10e635e 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLLegendElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLLegendElement.mm >@@ -33,9 +33,9 @@ > #import <WebCore/HTMLNames.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLLegendElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLLinkElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLLinkElement.mm >index 20f4c01515deb60ee4db379a005e52779b9c5220..5687c45bba0fac74b54c9485d98ae49e8f735b07 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLLinkElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLLinkElement.mm >@@ -36,9 +36,9 @@ > #import <WebCore/JSExecState.h> > #import <WebCore/StyleSheet.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLLinkElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLMapElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLMapElement.mm >index b921b3a50ed051503f3d77c450bd39716ad4c960..2cc90cf8634e396dd01f4a0c11f0610ecd60e8fe 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLMapElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLMapElement.mm >@@ -33,9 +33,9 @@ > #import <WebCore/HTMLNames.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLMapElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLMarqueeElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLMarqueeElement.mm >index 61ab4c62333f956e0724362772fc1fffca46a238..9623edb16ac099b41dc9638759044b471b90bcea 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLMarqueeElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLMarqueeElement.mm >@@ -31,9 +31,9 @@ > #import <WebCore/HTMLNames.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLMarqueeElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLMediaElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLMediaElement.mm >index 5bc7456f60cf7612b506ebfd3dc89fa47aeca467..783a5a15e9de1c75e74db8952b4199201a9437dd 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLMediaElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLMediaElement.mm >@@ -38,9 +38,9 @@ > #import <WebCore/MediaError.h> > #import <WebCore/ThreadCheck.h> > #import <WebCore/TimeRanges.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLMediaElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLMetaElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLMetaElement.mm >index 9987002af7cbe3d14d67cf8c4f3b81de3d3bf26c..78ed6e93cdfaa5b8c95f772f203f3844d80e99e4 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLMetaElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLMetaElement.mm >@@ -31,9 +31,9 @@ > #import <WebCore/HTMLNames.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLMetaElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLModElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLModElement.mm >index d885fcfd08036c738292e0070721ee5f82e3719a..60f9e45c7b1e34bc062e6a4eb31274af465b2549 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLModElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLModElement.mm >@@ -31,9 +31,9 @@ > #import <WebCore/HTMLNames.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLModElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLOListElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLOListElement.mm >index a32c2d8bc97121707b6e0e378e7451522c558730..b7fa59b6e6695f66c8969b1fa405e8e4a1deaeeb 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLOListElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLOListElement.mm >@@ -31,9 +31,9 @@ > #import <WebCore/HTMLOListElement.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLOListElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLObjectElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLObjectElement.mm >index 7ab73f5729430d3bf2027edbc5e4610314bdca15..db236d8b9586b8b72ac8e88ccdf2b490abedb669 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLObjectElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLObjectElement.mm >@@ -37,9 +37,9 @@ > #import <WebCore/JSExecState.h> > #import <WebCore/RenderElement.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLObjectElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLOptGroupElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLOptGroupElement.mm >index 4e515daf55bb7cc5cc038bb52404b6eef1b55cdb..1771c2efe31862d7b1559e0d124753f13f3701f0 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLOptGroupElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLOptGroupElement.mm >@@ -31,9 +31,9 @@ > #import <WebCore/HTMLOptGroupElement.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLOptGroupElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLOptionElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLOptionElement.mm >index fdec54ee1d64781e66e88334c52cf5418bc793df..145351d9b6fee3e3b12af31f04bc3037fda779b1 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLOptionElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLOptionElement.mm >@@ -33,9 +33,9 @@ > #import <WebCore/HTMLOptionElement.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLOptionElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLOptionsCollection.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLOptionsCollection.mm >index f770a8a14d5a83d7695e43719ee1af4dcb664ca1..3912101561f5ffdf8941e9a71bfbe4b828f84b15 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLOptionsCollection.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLOptionsCollection.mm >@@ -35,10 +35,10 @@ > #import <WebCore/JSExecState.h> > #import <WebCore/Node.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebCoreObjCExtras.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > #import <wtf/Variant.h> > > #define IMPL reinterpret_cast<WebCore::HTMLOptionsCollection*>(_internal) >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLParagraphElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLParagraphElement.mm >index 6c511e91664ce923cc9284a255a11e6a793b3fd4..1a543b3fd3e6fe728246b2ba8c12ff2640f66064 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLParagraphElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLParagraphElement.mm >@@ -31,9 +31,9 @@ > #import <WebCore/HTMLParagraphElement.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLParagraphElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLParamElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLParamElement.mm >index 5fb0cec27fb7097f0915ee5cdfc418a81c594fe8..eda6532c5d2a7efefc149b0b766ae9db8dbc9163 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLParamElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLParamElement.mm >@@ -31,9 +31,9 @@ > #import <WebCore/HTMLParamElement.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLParamElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLQuoteElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLQuoteElement.mm >index 3749c180330fb0e35cd545911c09e7745875afd0..bcd7866cd76c73eac644e04f8437e5030f5a2f88 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLQuoteElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLQuoteElement.mm >@@ -31,9 +31,9 @@ > #import <WebCore/HTMLQuoteElement.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLQuoteElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLScriptElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLScriptElement.mm >index 3344d5488849c14c91c5a693e79ad7e670e09ff4..e4ac017802da2514f4cdfe7dd7c92049bdab01e8 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLScriptElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLScriptElement.mm >@@ -31,9 +31,9 @@ > #import <WebCore/HTMLScriptElement.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLScriptElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLSelectElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLSelectElement.mm >index 758141de3fb7f5abf6e2a28fa6aea14658c66962..bcfbecacd38491fa7bc9954b3de90302f91a66a9 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLSelectElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLSelectElement.mm >@@ -44,9 +44,9 @@ > #import <WebCore/Node.h> > #import <WebCore/NodeList.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLSelectElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLStyleElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLStyleElement.mm >index a452782080bb639c4e67f4579f93946568c5cf10..8076a338ee1dc30af1c28a7485eb647d8ee37afd 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLStyleElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLStyleElement.mm >@@ -33,9 +33,9 @@ > #import <WebCore/JSExecState.h> > #import <WebCore/StyleSheet.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLStyleElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLTableCaptionElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLTableCaptionElement.mm >index a7811bd68b388b8d7331d453c9628608a5a36e37..483f94f13fbad1597e6736af76ca4c0f106ee89c 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLTableCaptionElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLTableCaptionElement.mm >@@ -31,9 +31,9 @@ > #import <WebCore/HTMLTableCaptionElement.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLTableCaptionElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLTableCellElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLTableCellElement.mm >index dd3016b3aa63a4f9b03144075f05e5a980558ee0..9ad9146e84a2780699bca73d547cbca8250c3e52 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLTableCellElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLTableCellElement.mm >@@ -31,9 +31,9 @@ > #import <WebCore/HTMLTableCellElement.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLTableCellElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLTableColElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLTableColElement.mm >index af26714d84f30aadcae142be846d66ce6e35e40a..c9d98ca514e1aba7b0ef489c3daf2be79c712d61 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLTableColElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLTableColElement.mm >@@ -31,9 +31,9 @@ > #import <WebCore/HTMLTableColElement.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLTableColElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLTableElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLTableElement.mm >index 4c68c4b6b4ca5d6f1f610ec5ac07fa6d347320c9..beddaf50faaab4c2d36fa5d128d03165f204b7b8 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLTableElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLTableElement.mm >@@ -39,9 +39,9 @@ > #import <WebCore/HTMLTableSectionElement.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLTableElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLTableRowElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLTableRowElement.mm >index 24096a8d9947fd7b7a24fd1657313a98409938cc..3dfedc33efcc15aae14d4411ffee706773d68a80 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLTableRowElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLTableRowElement.mm >@@ -35,9 +35,9 @@ > #import <WebCore/HTMLTableRowElement.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLTableRowElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLTableSectionElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLTableSectionElement.mm >index 98b19fa3154034dad9f630b343222882834f3188..c32c2e7027343d470930a6773b29888ed4f6fe76 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLTableSectionElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLTableSectionElement.mm >@@ -35,9 +35,9 @@ > #import <WebCore/HTMLTableSectionElement.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLTableSectionElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLTitleElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLTitleElement.mm >index 2486f77c3a5e750427102ad27e282b6b65b4efe9..2839171785599f928584ad52158e0f05d34120bc 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLTitleElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLTitleElement.mm >@@ -30,9 +30,9 @@ > #import <WebCore/HTMLTitleElement.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLTitleElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLUListElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLUListElement.mm >index f98f8e852bd47a16292b973409015728e45f33a1..fcf9054ab0f12167aee206cad8ada1d13907a3cc 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLUListElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLUListElement.mm >@@ -31,9 +31,9 @@ > #import <WebCore/HTMLUListElement.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLUListElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLVideoElement.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLVideoElement.mm >index 335806503928719b95b0f7167f271a901e85c119..457eafba0d0ce52d03f550f0478b34b08e873d8f 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLVideoElement.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLVideoElement.mm >@@ -34,9 +34,9 @@ > #import <WebCore/HTMLVideoElement.h> > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::HTMLVideoElement*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMKeyboardEvent.mm b/Source/WebKitLegacy/mac/DOM/DOMKeyboardEvent.mm >index 3fd8fce36466f37ab9a194c0a30c1c3c4052f63c..2c01f3e610552697e4513794db139a379d32c755 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMKeyboardEvent.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMKeyboardEvent.mm >@@ -33,9 +33,9 @@ > #import <WebCore/JSExecState.h> > #import <WebCore/KeyboardEvent.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::KeyboardEvent*>(reinterpret_cast<WebCore::Event*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMMediaList.mm b/Source/WebKitLegacy/mac/DOM/DOMMediaList.mm >index 9e8167a16a44b3137b23edb1a8eed45949d27d98..8651fc97b487115e2d4cdd771490df3fd00a5dbe 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMMediaList.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMMediaList.mm >@@ -33,10 +33,10 @@ > #import <WebCore/JSExecState.h> > #import <WebCore/MediaList.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebCoreObjCExtras.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL reinterpret_cast<WebCore::MediaList*>(_internal) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMMouseEvent.mm b/Source/WebKitLegacy/mac/DOM/DOMMouseEvent.mm >index f656a8ade5535a90e87abcaab9d8079963a81206..95f2235d4572fb396d624c39fc5069b3096dc39f 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMMouseEvent.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMMouseEvent.mm >@@ -36,9 +36,9 @@ > #import <WebCore/MouseEvent.h> > #import <WebCore/Node.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::MouseEvent*>(reinterpret_cast<WebCore::Event*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMMutationEvent.mm b/Source/WebKitLegacy/mac/DOM/DOMMutationEvent.mm >index 0f4ef1675a1c03a87a10d61e3fb711aaf11c76bd..2fbf422ae85d99c6680a0ed58cdba327f7ed8fca 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMMutationEvent.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMMutationEvent.mm >@@ -32,9 +32,9 @@ > #import <WebCore/MutationEvent.h> > #import <WebCore/Node.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::MutationEvent*>(reinterpret_cast<WebCore::Event*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMNamedNodeMap.mm b/Source/WebKitLegacy/mac/DOM/DOMNamedNodeMap.mm >index 56819332bb6742e1efedd01e2c7533577d71e3f8..291819090e5e250353b3074af96bd238fdb8d54b 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMNamedNodeMap.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMNamedNodeMap.mm >@@ -32,10 +32,10 @@ > #import <WebCore/JSExecState.h> > #import <WebCore/NamedNodeMap.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebCoreObjCExtras.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL reinterpret_cast<WebCore::NamedNodeMap*>(_internal) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMProcessingInstruction.mm b/Source/WebKitLegacy/mac/DOM/DOMProcessingInstruction.mm >index 9adc40b08abbc8771b3c8b8bdfee019fc81ce325..200e82a3103a671d06157112c7dc9724a556e2e8 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMProcessingInstruction.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMProcessingInstruction.mm >@@ -32,9 +32,9 @@ > #import <WebCore/ProcessingInstruction.h> > #import <WebCore/StyleSheet.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::ProcessingInstruction*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMRange.mm b/Source/WebKitLegacy/mac/DOM/DOMRange.mm >index f289b3a26e8a4f566b6724fb8d6151158bdb62e8..ef2c35809b0b6763b47745618c3b295606d99991 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMRange.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMRange.mm >@@ -34,10 +34,10 @@ > #import <WebCore/Node.h> > #import <WebCore/Range.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebCoreObjCExtras.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL reinterpret_cast<WebCore::Range*>(_internal) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMStyleSheet.mm b/Source/WebKitLegacy/mac/DOM/DOMStyleSheet.mm >index 7a1a4a87fc6ef249acb9d07de254bdb2b0a3c933..0e8785c7d2c067c484721ed537874d7c55cb0a8f 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMStyleSheet.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMStyleSheet.mm >@@ -36,10 +36,10 @@ > #import <WebCore/Node.h> > #import <WebCore/StyleSheet.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebCoreObjCExtras.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL reinterpret_cast<WebCore::StyleSheet*>(_internal) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMText.mm b/Source/WebKitLegacy/mac/DOM/DOMText.mm >index 30e7da3c0c98973d4125a67eddcd26d9cee75cb5..f730ad6debafa05be372440f96e601aeff4df7b2 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMText.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMText.mm >@@ -30,9 +30,9 @@ > #import <WebCore/JSExecState.h> > #import <WebCore/Text.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::Text*>(reinterpret_cast<WebCore::Node*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMTextEvent.mm b/Source/WebKitLegacy/mac/DOM/DOMTextEvent.mm >index c5026eb4b2f860133287b9f2e058a761fb24204f..ca06fd7c0ff0e001b9e88406d0ba7eacca414a9e 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMTextEvent.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMTextEvent.mm >@@ -33,9 +33,9 @@ > #import <WebCore/JSExecState.h> > #import <WebCore/TextEvent.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::TextEvent*>(reinterpret_cast<WebCore::Event*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMTokenList.mm b/Source/WebKitLegacy/mac/DOM/DOMTokenList.mm >index db8f55ce07aa64fd929a5f5f83ff0cbccdd77468..9c4aa89630d7814442b13c6bc25c8e4b7f96bb61 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMTokenList.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMTokenList.mm >@@ -32,10 +32,10 @@ > #import "ExceptionHandlers.h" > #import <WebCore/JSExecState.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebCoreObjCExtras.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL reinterpret_cast<WebCore::DOMTokenList*>(_internal) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMUIEvent.mm b/Source/WebKitLegacy/mac/DOM/DOMUIEvent.mm >index 173243190a32b15c47fffe002b3ba6167b1778db..f82cf58a7ed4abb94f885f0ee4affbc3f9de01e7 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMUIEvent.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMUIEvent.mm >@@ -34,9 +34,9 @@ > #import <WebCore/KeyboardEvent.h> > #import <WebCore/ThreadCheck.h> > #import <WebCore/UIEvent.h> >-#import <WebCore/URL.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL static_cast<WebCore::UIEvent*>(reinterpret_cast<WebCore::Event*>(_internal)) > >diff --git a/Source/WebKitLegacy/mac/DOM/DOMXPathResult.mm b/Source/WebKitLegacy/mac/DOM/DOMXPathResult.mm >index a1ef573f8dd2c10b686c119509a70242d7cf52af..dacf1d86df8e73c1bb044cdda8b49151a4bfffd9 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMXPathResult.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMXPathResult.mm >@@ -31,11 +31,11 @@ > #import <WebCore/JSExecState.h> > #import <WebCore/Node.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebCoreObjCExtras.h> > #import <WebCore/WebScriptObjectPrivate.h> > #import <WebCore/XPathResult.h> > #import <wtf/GetPtr.h> >+#import <wtf/URL.h> > > #define IMPL reinterpret_cast<WebCore::XPathResult*>(_internal) > >diff --git a/Source/WebKitLegacy/mac/History/WebHistoryItem.mm b/Source/WebKitLegacy/mac/History/WebHistoryItem.mm >index 985e45ef9566f5b1258d2855d98ce7221de4acc5..45607dbc5cd4631db633fd98d13d6dd8ee363859 100644 >--- a/Source/WebKitLegacy/mac/History/WebHistoryItem.mm >+++ b/Source/WebKitLegacy/mac/History/WebHistoryItem.mm >@@ -47,13 +47,13 @@ > #import <WebCore/Image.h> > #import <WebCore/PageCache.h> > #import <WebCore/ThreadCheck.h> >-#import <WebCore/URL.h> > #import <WebCore/WebCoreObjCExtras.h> > #import <wtf/Assertions.h> > #import <wtf/MainThread.h> > #import <wtf/NeverDestroyed.h> > #import <wtf/RunLoop.h> > #import <wtf/StdLibExtras.h> >+#import <wtf/URL.h> > #import <wtf/text/WTFString.h> > > #if PLATFORM(IOS_FAMILY) >diff --git a/Source/WebKitLegacy/mac/Misc/WebNSURLExtras.mm b/Source/WebKitLegacy/mac/Misc/WebNSURLExtras.mm >index 8159741b7dbb43bcc1b13c5929c1d05c0e97d066..c13b75718b1a4a7a5fed0995c9e45bf3c9bd3b98 100644 >--- a/Source/WebKitLegacy/mac/Misc/WebNSURLExtras.mm >+++ b/Source/WebKitLegacy/mac/Misc/WebNSURLExtras.mm >@@ -33,7 +33,6 @@ > #import "WebLocalizableStrings.h" > #import "WebNSDataExtras.h" > #import <Foundation/NSURLRequest.h> >-#import <WebCore/URL.h> > #import <WebCore/LoaderNSURLExtras.h> > #import <WebCore/TextEncoding.h> > #import <WebCore/WebCoreNSURLExtras.h> >@@ -41,6 +40,8 @@ > #import <unicode/uscript.h> > #import <wtf/Assertions.h> > #import <wtf/ObjCRuntimeExtras.h> >+#import <wtf/URL.h> >+#import <wtf/cocoa/NSURLExtras.h> > > using namespace WebCore; > using namespace WTF; >@@ -109,7 +110,7 @@ using namespace WTF; > > - (NSString *)_web_userVisibleString > { >- return userVisibleString(self); >+ return WTF::userVisibleString(self); > } > > - (BOOL)_web_isEmpty >@@ -139,7 +140,7 @@ using namespace WTF; > > - (NSURL *)_web_URLByRemovingUserInfo > { >- return URLByRemovingUserInfo(self); >+ return WTF::URLByRemovingUserInfo(self); > } > > - (BOOL)_webkit_isJavaScriptURL >@@ -175,17 +176,17 @@ using namespace WTF; > > -(NSData *)_web_dataForURLComponentType:(CFURLComponentType)componentType > { >- return dataForURLComponentType(self, componentType); >+ return WTF::dataForURLComponentType(self, componentType); > } > > -(NSData *)_web_schemeData > { >- return dataForURLComponentType(self, kCFURLComponentScheme); >+ return WTF::dataForURLComponentType(self, kCFURLComponentScheme); > } > > -(NSData *)_web_hostData > { >- NSData *result = dataForURLComponentType(self, kCFURLComponentHost); >+ NSData *result = WTF::dataForURLComponentType(self, kCFURLComponentHost); > NSData *scheme = [self _web_schemeData]; > // Take off localhost for file > if ([scheme _web_isCaseInsensitiveEqualToCString:"file"]) { >diff --git a/Source/WebKitLegacy/mac/Misc/WebUserContentURLPattern.mm b/Source/WebKitLegacy/mac/Misc/WebUserContentURLPattern.mm >index e9ed5cbeb295d06daad9695722a34f3eee55668d..b726583f974cddf76617f2ad18d398f403b913be 100644 >--- a/Source/WebKitLegacy/mac/Misc/WebUserContentURLPattern.mm >+++ b/Source/WebKitLegacy/mac/Misc/WebUserContentURLPattern.mm >@@ -24,8 +24,8 @@ > > #import "WebUserContentURLPattern.h" > >-#import <WebCore/URL.h> > #import <WebCore/UserContentURLPattern.h> >+#import <wtf/URL.h> > > using namespace WebCore; > >diff --git a/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm b/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm >index ac7a4bb318c55f9359c98e0a8bf96d1e6e443636..883b9207207e248dd47a30bc0c7621e7068b7c32 100644 >--- a/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm >+++ b/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm >@@ -58,7 +58,6 @@ > #import <WebCore/ProxyServer.h> > #import <WebCore/ScriptController.h> > #import <WebCore/SecurityOrigin.h> >-#import <WebCore/URL.h> > #import <WebCore/UserGestureIndicator.h> > #import <WebCore/npruntime_impl.h> > #import <WebCore/runtime_object.h> >@@ -66,6 +65,7 @@ > #import <utility> > #import <wtf/NeverDestroyed.h> > #import <wtf/RefCountedLeakCounter.h> >+#import <wtf/URL.h> > #import <wtf/text/CString.h> > > extern "C" { >diff --git a/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginStream.h b/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginStream.h >index 0e1898f0305997043e64f6a29af6fcd3f99c5fa7..2bc978d3403f73f1c063df252343c5b83ec1306c 100644 >--- a/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginStream.h >+++ b/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginStream.h >@@ -72,7 +72,7 @@ public: > > void cancelLoadAndDestroyStreamWithError(NSError *); > >- void setRequestURL(const WebCore::URL& requestURL) { m_requestURL = requestURL; } >+ void setRequestURL(const URL& requestURL) { m_requestURL = requestURL; } > > void start(); > void stop(); >@@ -103,7 +103,7 @@ private: > bool wantsAllStreams() const override; > > RetainPtr<NSMutableData> m_deliveryData; >- WebCore::URL m_requestURL; >+ URL m_requestURL; > RetainPtr<NSURL> m_responseURL; > CString m_mimeType; > >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.h b/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.h >index c4b9b634f7fb97a98c0433eca938f2e6d06099fc..54a7aa22069e80b8b47aa8a2fe4be32ebc60fc57 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.h >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.h >@@ -229,7 +229,7 @@ private: > void setMockMediaPlaybackTargetPickerState(const String&, WebCore::MediaPlaybackTargetContext::State) final; > #endif > >- String signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String& challengeString, const WebCore::URL&) const final; >+ String signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String& challengeString, const URL&) const final; > > WebView *m_webView; > }; >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm b/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm >index 467e1ce3d32b0ed9f2e763da577e23257605273d..7c290b10f7757a76a33916cf78feaec339e56f4a 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm >@@ -1142,7 +1142,7 @@ void WebChromeClient::setMockMediaPlaybackTargetPickerState(const String& name, > > #endif > >-String WebChromeClient::signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String& challengeString, const WebCore::URL& url) const >+String WebChromeClient::signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String& challengeString, const URL& url) const > { > SEL selector = @selector(signedPublicKeyAndChallengeStringForWebView:); > if ([[m_webView UIDelegate] respondsToSelector:selector]) >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebContextMenuClient.h b/Source/WebKitLegacy/mac/WebCoreSupport/WebContextMenuClient.h >index 8b20364bb67a917278b2953fc5179a12dd366ddd..1885f0313135b817b30f945777d8e24b1539bf90 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebContextMenuClient.h >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebContextMenuClient.h >@@ -50,7 +50,7 @@ public: > > void contextMenuDestroyed() override; > >- void downloadURL(const WebCore::URL&) override; >+ void downloadURL(const URL&) override; > void searchWithGoogle(const WebCore::Frame*) override; > void lookUpInDictionary(WebCore::Frame*) override; > bool isSpeaking() override; >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebContextMenuClient.mm b/Source/WebKitLegacy/mac/WebCoreSupport/WebContextMenuClient.mm >index db905d9f4c947132aa6eda7b6137c465f6fa382b..96ef921fd606ecf080eed131d4b8d912d51f3ffb 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebContextMenuClient.mm >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebContextMenuClient.mm >@@ -54,9 +54,9 @@ > #import <WebCore/RenderObject.h> > #import <WebCore/RuntimeApplicationChecks.h> > #import <WebCore/SharedBuffer.h> >-#import <WebCore/URL.h> > #import <WebKitLegacy/DOMPrivate.h> > #import <pal/spi/mac/NSSharingServicePickerSPI.h> >+#import <wtf/URL.h> > > using namespace WebCore; > >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebDragClient.h b/Source/WebKitLegacy/mac/WebCoreSupport/WebDragClient.h >index 4e81d370848f9e44a40f5040bc9ad8a37ccad8e0..847a73b17a4617bd54a8d28a923c1d4a63bdd12e 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebDragClient.h >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebDragClient.h >@@ -43,7 +43,7 @@ public: > > void beginDrag(WebCore::DragItem, WebCore::Frame&, const WebCore::IntPoint& mouseDownPosition, const WebCore::IntPoint& mouseDraggedPosition, WebCore::DataTransfer&, WebCore::DragSourceAction) override; > >- void declareAndWriteDragImage(const String& pasteboardName, WebCore::Element&, const WebCore::URL&, const String&, WebCore::Frame*) override; >+ void declareAndWriteDragImage(const String& pasteboardName, WebCore::Element&, const URL&, const String&, WebCore::Frame*) override; > void didConcludeEditDrag() override; > > private: >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.h b/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.h >index 7be5f5f5c56402e64c7b99735562aabf7786a59f..1f15b72363f982b8f1337696ed407a837b0e54ae 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.h >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.h >@@ -107,7 +107,7 @@ private: > void dispatchDidDispatchOnloadEvents() final; > void dispatchDidReceiveServerRedirectForProvisionalLoad() final; > void dispatchDidCancelClientRedirect() final; >- void dispatchWillPerformClientRedirect(const WebCore::URL&, double interval, WallTime fireDate, WebCore::LockBackForwardList) final; >+ void dispatchWillPerformClientRedirect(const URL&, double interval, WallTime fireDate, WebCore::LockBackForwardList) final; > void dispatchDidChangeLocationWithinPage() final; > void dispatchDidPushStateWithinPage() final; > void dispatchDidReplaceStateWithinPage() final; >@@ -158,8 +158,8 @@ private: > bool shouldGoToHistoryItem(WebCore::HistoryItem&) const final; > > void didDisplayInsecureContent() final; >- void didRunInsecureContent(WebCore::SecurityOrigin&, const WebCore::URL&) final; >- void didDetectXSS(const WebCore::URL&, bool didBlockEntirePage) final; >+ void didRunInsecureContent(WebCore::SecurityOrigin&, const URL&) final; >+ void didDetectXSS(const URL&, bool didBlockEntirePage) final; > > WebCore::ResourceError cancelledError(const WebCore::ResourceRequest&) final; > WebCore::ResourceError blockedError(const WebCore::ResourceRequest&) final; >@@ -176,7 +176,7 @@ private: > > bool shouldFallBack(const WebCore::ResourceError&) final; > >- WTF::String userAgent(const WebCore::URL&) final; >+ WTF::String userAgent(const URL&) final; > > void savePlatformDataToCachedFrame(WebCore::CachedFrame*) final; > void transitionToCommittedFromCachedFrame(WebCore::CachedFrame*) final; >@@ -205,30 +205,30 @@ private: > Ref<WebCore::DocumentLoader> createDocumentLoader(const WebCore::ResourceRequest&, const WebCore::SubstituteData&) final; > void updateCachedDocumentLoader(WebCore::DocumentLoader&) final { } > >- void setTitle(const WebCore::StringWithDirection&, const WebCore::URL&) final; >+ void setTitle(const WebCore::StringWithDirection&, const URL&) final; > >- RefPtr<WebCore::Frame> createFrame(const WebCore::URL&, const WTF::String& name, WebCore::HTMLFrameOwnerElement&, >+ RefPtr<WebCore::Frame> createFrame(const URL&, const WTF::String& name, WebCore::HTMLFrameOwnerElement&, > const WTF::String& referrer) final; >- RefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement&, const WebCore::URL&, >- const Vector<WTF::String>&, const Vector<WTF::String>&, const WTF::String&, bool) final; >+ RefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement&, const URL&, >+ const Vector<WTF::String>&, const Vector<WTF::String>&, const WTF::String&, bool) final; > void recreatePlugin(WebCore::Widget*) final; > void redirectDataToPlugin(WebCore::Widget&) final; > > #if ENABLE(WEBGL) >- WebCore::WebGLLoadPolicy webGLPolicyForURL(const WebCore::URL&) const final; >- WebCore::WebGLLoadPolicy resolveWebGLPolicyForURL(const WebCore::URL&) const final; >+ WebCore::WebGLLoadPolicy webGLPolicyForURL(const URL&) const final; >+ WebCore::WebGLLoadPolicy resolveWebGLPolicyForURL(const URL&) const final; > #endif > >- RefPtr<WebCore::Widget> createJavaAppletWidget(const WebCore::IntSize&, WebCore::HTMLAppletElement&, const WebCore::URL& baseURL, >+ RefPtr<WebCore::Widget> createJavaAppletWidget(const WebCore::IntSize&, WebCore::HTMLAppletElement&, const URL& baseURL, > const Vector<WTF::String>& paramNames, const Vector<WTF::String>& paramValues) final; > >- WebCore::ObjectContentType objectContentType(const WebCore::URL&, const WTF::String& mimeType) final; >+ WebCore::ObjectContentType objectContentType(const URL&, const WTF::String& mimeType) final; > WTF::String overrideMediaType() const final; > > void dispatchDidClearWindowObjectInWorld(WebCore::DOMWrapperWorld&) final; > > #if PLATFORM(IOS_FAMILY) >- bool shouldLoadMediaElementURL(const WebCore::URL&) const final; >+ bool shouldLoadMediaElementURL(const URL&) const final; > #endif > > RemoteAXObjectRef accessibilityRemoteObject() final { return 0; } >@@ -241,7 +241,7 @@ private: > > Ref<WebCore::FrameNetworkingContext> createNetworkingContext() final; > >- bool shouldPaintBrokenImage(const WebCore::URL&) const final; >+ bool shouldPaintBrokenImage(const URL&) const final; > > #if USE(QUICK_LOOK) > RefPtr<WebCore::PreviewLoaderClient> createPreviewLoaderClient(const String& fileName, const String& uti) final; >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm b/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm >index 4f700e04f8f77da5d8ddaf7a84152714943292e4..1e842ba7f44494eb6542e8e9500b8221df100efa 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm >@@ -1033,7 +1033,7 @@ void WebFrameLoaderClient::updateGlobalHistory() > WebView* view = getWebView(m_webFrame.get()); > DocumentLoader* loader = core(m_webFrame.get())->loader().documentLoader(); > #if PLATFORM(IOS_FAMILY) >- if (loader->urlForHistory() == blankURL()) >+ if (loader->urlForHistory() == WTF::blankURL()) > return; > #endif > >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebPaymentCoordinatorClient.h b/Source/WebKitLegacy/mac/WebCoreSupport/WebPaymentCoordinatorClient.h >index fd4cd4c4b36d8bff4bce57bf15ed6f89f4ecd580..077d014d3e535c7a8abb3468e1d654e9fe9be275 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebPaymentCoordinatorClient.h >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebPaymentCoordinatorClient.h >@@ -41,7 +41,7 @@ private: > bool canMakePayments() override; > void canMakePaymentsWithActiveCard(const String&, const String&, WTF::Function<void (bool)>&& completionHandler) override; > void openPaymentSetup(const String& merchantIdentifier, const String& domainName, WTF::Function<void (bool)>&& completionHandler) override; >- bool showPaymentUI(const WebCore::URL&, const Vector<WebCore::URL>& linkIconURLs, const WebCore::ApplePaySessionPaymentRequest&) override; >+ bool showPaymentUI(const URL&, const Vector<URL>& linkIconURLs, const WebCore::ApplePaySessionPaymentRequest&) override; > void completeMerchantValidation(const WebCore::PaymentMerchantSession&) override; > void completeShippingMethodSelection(std::optional<WebCore::ShippingMethodUpdate>&&) override; > void completeShippingContactSelection(std::optional<WebCore::ShippingContactUpdate>&&) override; >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebPaymentCoordinatorClient.mm b/Source/WebKitLegacy/mac/WebCoreSupport/WebPaymentCoordinatorClient.mm >index 33493bd9f160bda8aac5dafffa592a560fa99282..30e06caf931ae066c369b735113d9c48a7bdc0d4 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebPaymentCoordinatorClient.mm >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebPaymentCoordinatorClient.mm >@@ -27,8 +27,8 @@ > > #if ENABLE(APPLE_PAY) > >-#import <WebCore/URL.h> > #import <wtf/MainThread.h> >+#import <wtf/URL.h> > > WebPaymentCoordinatorClient::WebPaymentCoordinatorClient() > { >@@ -67,7 +67,7 @@ void WebPaymentCoordinatorClient::openPaymentSetup(const String&, const String&, > }); > } > >-bool WebPaymentCoordinatorClient::showPaymentUI(const WebCore::URL&, const Vector<WebCore::URL>&, const WebCore::ApplePaySessionPaymentRequest&) >+bool WebPaymentCoordinatorClient::showPaymentUI(const URL&, const Vector<URL>&, const WebCore::ApplePaySessionPaymentRequest&) > { > return false; > } >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebPlatformStrategies.h b/Source/WebKitLegacy/mac/WebCoreSupport/WebPlatformStrategies.h >index 81f7c4f69cd1114402759cec999e923195b763ef..37e714389d704647b91ee0d6607bd78470df5e03 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebPlatformStrategies.h >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebPlatformStrategies.h >@@ -48,13 +48,13 @@ private: > WebCore::BlobRegistry* createBlobRegistry() override; > > // WebCore::CookiesStrategy >- std::pair<String, bool> cookiesForDOM(const WebCore::NetworkStorageSession&, const WebCore::URL& firstParty, const WebCore::SameSiteInfo&, const WebCore::URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, WebCore::IncludeSecureCookies) override; >- void setCookiesFromDOM(const WebCore::NetworkStorageSession&, const WebCore::URL& firstParty, const WebCore::SameSiteInfo&, const WebCore::URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, const String&) override; >+ std::pair<String, bool> cookiesForDOM(const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, WebCore::IncludeSecureCookies) override; >+ void setCookiesFromDOM(const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, const String&) override; > bool cookiesEnabled(const WebCore::NetworkStorageSession&) override; >- std::pair<String, bool> cookieRequestHeaderFieldValue(const WebCore::NetworkStorageSession&, const WebCore::URL& firstParty, const WebCore::SameSiteInfo&, const WebCore::URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, WebCore::IncludeSecureCookies) override; >- std::pair<String, bool> cookieRequestHeaderFieldValue(PAL::SessionID, const WebCore::URL& firstParty, const WebCore::SameSiteInfo&, const WebCore::URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, WebCore::IncludeSecureCookies) override; >- bool getRawCookies(const WebCore::NetworkStorageSession&, const WebCore::URL& firstParty, const WebCore::SameSiteInfo&, const WebCore::URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, Vector<WebCore::Cookie>&) override; >- void deleteCookie(const WebCore::NetworkStorageSession&, const WebCore::URL&, const String&) override; >+ std::pair<String, bool> cookieRequestHeaderFieldValue(const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, WebCore::IncludeSecureCookies) override; >+ std::pair<String, bool> cookieRequestHeaderFieldValue(PAL::SessionID, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, WebCore::IncludeSecureCookies) override; >+ bool getRawCookies(const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, Vector<WebCore::Cookie>&) override; >+ void deleteCookie(const WebCore::NetworkStorageSession&, const URL&, const String&) override; > > // WebCore::PasteboardStrategy > #if PLATFORM(IOS_FAMILY) >@@ -65,7 +65,7 @@ private: > int getPasteboardItemsCount(const String& pasteboardName) override; > String readStringFromPasteboard(int index, const String& pasteboardType, const String& pasteboardName) override; > RefPtr<WebCore::SharedBuffer> readBufferFromPasteboard(int index, const String& pasteboardType, const String& pasteboardName) override; >- WebCore::URL readURLFromPasteboard(int index, const String& pasteboardName, String& title) override; >+ URL readURLFromPasteboard(int index, const String& pasteboardName, String& title) override; > Vector<WebCore::PasteboardItemInfo> allPasteboardItemInfo(const String& pasteboardName) override; > WebCore::PasteboardItemInfo informationForItemAtIndex(int index, const String& pasteboardName) override; > void updateSupportedTypeIdentifiers(const Vector<String>& identifiers, const String& pasteboardName) override; >@@ -80,7 +80,7 @@ private: > long changeCount(const String& pasteboardName) override; > String uniqueName() override; > WebCore::Color color(const String& pasteboardName) override; >- WebCore::URL url(const String& pasteboardName) override; >+ URL url(const String& pasteboardName) override; > > long writeCustomData(const WebCore::PasteboardCustomData&, const String& pasteboardName) override; > Vector<String> typesSafeForDOMToReadAndWrite(const String& pasteboardName, const String& origin) override; >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebPlatformStrategies.mm b/Source/WebKitLegacy/mac/WebCoreSupport/WebPlatformStrategies.mm >index be5096b97f6cb1f50c4939ca17e765f89a35ef05..01925eee82ce4100fd42374937868fc1564bd448 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebPlatformStrategies.mm >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebPlatformStrategies.mm >@@ -239,7 +239,7 @@ RefPtr<WebCore::SharedBuffer> WebPlatformStrategies::readBufferFromPasteboard(in > return PlatformPasteboard(pasteboardName).readBuffer(index, type); > } > >-WebCore::URL WebPlatformStrategies::readURLFromPasteboard(int index, const String& pasteboardName, String& title) >+URL WebPlatformStrategies::readURLFromPasteboard(int index, const String& pasteboardName, String& title) > { > return PlatformPasteboard(pasteboardName).readURL(index, title); > } >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebPluginInfoProvider.h b/Source/WebKitLegacy/mac/WebCoreSupport/WebPluginInfoProvider.h >index d1ab551184c0a5f649940d8e927bd84e529c7ff0..525ee2fcdeea16c5c6f9dfe8135ed7d1c5ebbd0f 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebPluginInfoProvider.h >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebPluginInfoProvider.h >@@ -35,7 +35,7 @@ public: > private: > void refreshPlugins() override; > Vector<WebCore::PluginInfo> pluginInfo(WebCore::Page&, std::optional<Vector<WebCore::SupportedPluginIdentifier>>&) final; >- Vector<WebCore::PluginInfo> webVisiblePluginInfo(WebCore::Page&, const WebCore::URL&) final; >+ Vector<WebCore::PluginInfo> webVisiblePluginInfo(WebCore::Page&, const URL&) final; > > WebPluginInfoProvider(); > }; >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebPluginInfoProvider.mm b/Source/WebKitLegacy/mac/WebCoreSupport/WebPluginInfoProvider.mm >index e34ec73e54fbd954168ffca552e4f36bc95f544b..b06da6f0f0c357b00ba87491cb17bfd2fa94e362 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebPluginInfoProvider.mm >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebPluginInfoProvider.mm >@@ -74,7 +74,7 @@ Vector<WebCore::PluginInfo> WebPluginInfoProvider::pluginInfo(WebCore::Page& pag > return plugins; > } > >-Vector<WebCore::PluginInfo> WebPluginInfoProvider::webVisiblePluginInfo(WebCore::Page& page, const WebCore::URL&) >+Vector<WebCore::PluginInfo> WebPluginInfoProvider::webVisiblePluginInfo(WebCore::Page& page, const URL&) > { > std::optional<Vector<SupportedPluginIdentifier>> supportedPluginIdentifiers; > return pluginInfo(page, supportedPluginIdentifiers); >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebSecurityOrigin.mm b/Source/WebKitLegacy/mac/WebCoreSupport/WebSecurityOrigin.mm >index b43aaa74fea242c191dee18db4ba28e5f60b9adf..067f56cde3942c2ea71b1f4b52f871a5d4613cc5 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebSecurityOrigin.mm >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebSecurityOrigin.mm >@@ -34,7 +34,7 @@ > #import <WebCore/DatabaseTracker.h> > #import <WebCore/SecurityOrigin.h> > #import <WebCore/SecurityOriginData.h> >-#import <WebCore/URL.h> >+#import <wtf/URL.h> > > using namespace WebCore; > >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebVisitedLinkStore.h b/Source/WebKitLegacy/mac/WebCoreSupport/WebVisitedLinkStore.h >index aef4fc52aae412f3e6c4ecf40395b43e87cc946c..20ee51879455972ab4b03c462ae31f3949ec913d 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebVisitedLinkStore.h >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebVisitedLinkStore.h >@@ -44,7 +44,7 @@ public: > private: > WebVisitedLinkStore(); > >- bool isLinkVisited(WebCore::Page&, WebCore::SharedStringHash, const WebCore::URL& baseURL, const AtomicString& attributeURL) override; >+ bool isLinkVisited(WebCore::Page&, WebCore::SharedStringHash, const URL& baseURL, const AtomicString& attributeURL) override; > void addVisitedLink(WebCore::Page&, WebCore::SharedStringHash) override; > > void populateVisitedLinksIfNeeded(WebCore::Page&); >diff --git a/Source/WebKitLegacy/mac/WebView/WebDataSource.mm b/Source/WebKitLegacy/mac/WebView/WebDataSource.mm >index 0fc9b91acac6b8de13e19af82379bbda823fe933..645b1b24aa26b01668b8f152db7b13c57238f6fe 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebDataSource.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebDataSource.mm >@@ -55,7 +55,6 @@ > #import <WebCore/MIMETypeRegistry.h> > #import <WebCore/ResourceRequest.h> > #import <WebCore/SharedBuffer.h> >-#import <WebCore/URL.h> > #import <WebCore/WebCoreObjCExtras.h> > #import <WebCore/WebCoreURLResponse.h> > #import <WebKitLegacy/DOMHTML.h> >@@ -65,6 +64,7 @@ > #import <wtf/RefPtr.h> > #import <wtf/RetainPtr.h> > #import <wtf/RunLoop.h> >+#import <wtf/URL.h> > > #if PLATFORM(IOS_FAMILY) > #import "WebPDFViewIOS.h" >diff --git a/Source/WebKitLegacy/mac/WebView/WebFrame.mm b/Source/WebKitLegacy/mac/WebView/WebFrame.mm >index c1440298a88e069a4d1621ac81e283c29d9582ca..d9d9a9f68612f4ad4b036224c80dcefaf124d406 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebFrame.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebFrame.mm >@@ -2508,7 +2508,7 @@ static NSURL *createUniqueWebDataURL() > if (baseURL) > baseURL = [baseURL absoluteURL]; > else { >- baseURL = blankURL(); >+ baseURL = WTF::blankURL(); > responseURL = createUniqueWebDataURL(); > } > >diff --git a/Source/WebKitLegacy/mac/WebView/WebImmediateActionController.mm b/Source/WebKitLegacy/mac/WebView/WebImmediateActionController.mm >index 754cccc1af2806558cef96b88cc6e68733ca22a6..f514b84054c21a9373bde7f5b9a401d8defb3415 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebImmediateActionController.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebImmediateActionController.mm >@@ -256,17 +256,17 @@ using namespace WebCore; > NSURL *url = _hitTestResult.absoluteLinkURL(); > NSString *absoluteURLString = [url absoluteString]; > if (url && _hitTestResult.URLElement()) { >- if (protocolIs(absoluteURLString, "mailto")) { >+ if (WTF::protocolIs(absoluteURLString, "mailto")) { > _type = WebImmediateActionMailtoLink; > return [self _animationControllerForDataDetectedLink]; > } > >- if (protocolIs(absoluteURLString, "tel")) { >+ if (WTF::protocolIs(absoluteURLString, "tel")) { > _type = WebImmediateActionTelLink; > return [self _animationControllerForDataDetectedLink]; > } > >- if (WebCore::protocolIsInHTTPFamily(absoluteURLString)) { >+ if (WTF::protocolIsInHTTPFamily(absoluteURLString)) { > _type = WebImmediateActionLinkPreview; > > RefPtr<Range> linkRange = rangeOfContents(*_hitTestResult.URLElement()); >diff --git a/Source/WebKitLegacy/mac/WebView/WebPDFView.mm b/Source/WebKitLegacy/mac/WebView/WebPDFView.mm >index 8b10e6f1e00ebb3e48e1caec011f84fa21532f56..3221d60c8f09da8746d74004cb2ac1bed447748e 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebPDFView.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebPDFView.mm >@@ -62,9 +62,9 @@ > #import <WebCore/MouseEvent.h> > #import <WebCore/PlatformEventFactoryMac.h> > #import <WebCore/RuntimeApplicationChecks.h> >-#import <WebCore/URL.h> > #import <WebCore/WebNSAttributedStringExtras.h> > #import <wtf/Assertions.h> >+#import <wtf/URL.h> > > extern "C" { > bool CGContextGetAllowsFontSmoothing(CGContextRef context); >diff --git a/Source/WebKitLegacy/mac/WebView/WebScriptDebugger.mm b/Source/WebKitLegacy/mac/WebView/WebScriptDebugger.mm >index 85affc1bca0d87833b449622ea1daa32aa0c649a..5fcf9f6afe051bb2f7ccf13e327b45a556788bd2 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebScriptDebugger.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebScriptDebugger.mm >@@ -39,8 +39,8 @@ > #import <WebCore/DOMWindow.h> > #import <WebCore/Frame.h> > #import <WebCore/JSDOMWindow.h> >-#import <WebCore/URL.h> > #import <WebCore/ScriptController.h> >+#import <wtf/URL.h> > > using namespace JSC; > using namespace WebCore; >diff --git a/Source/WebKitLegacy/mac/WebView/WebViewInternal.h b/Source/WebKitLegacy/mac/WebView/WebViewInternal.h >index af152c8f76a4dbbb698381c525bfaa16949c9d36..579c8d8850729db793c669d7497993ecf63f77ea 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebViewInternal.h >+++ b/Source/WebKitLegacy/mac/WebView/WebViewInternal.h >@@ -57,7 +57,6 @@ class KeyboardEvent; > class Page; > class RenderBox; > class TextIndicator; >-class URL; > struct DictationAlternative; > struct DictionaryPopupInfo; > } >diff --git a/Source/WebKitLegacy/win/MarshallingHelpers.cpp b/Source/WebKitLegacy/win/MarshallingHelpers.cpp >index 6af3151316518a2cf5628881b485c22330cc8097..7471a116c732dbef8fff110c3d11bc36c89e8b81 100644 >--- a/Source/WebKitLegacy/win/MarshallingHelpers.cpp >+++ b/Source/WebKitLegacy/win/MarshallingHelpers.cpp >@@ -28,9 +28,9 @@ > > #include <WebCore/BString.h> > #include <WebCore/IntRect.h> >-#include <WebCore/URL.h> > #include <wtf/DateMath.h> > #include <wtf/MathExtras.h> >+#include <wtf/URL.h> > #include <wtf/text/WTFString.h> > > using namespace WebCore; >diff --git a/Source/WebKitLegacy/win/MarshallingHelpers.h b/Source/WebKitLegacy/win/MarshallingHelpers.h >index 8119d42f98627033b113a54086d1b0bdae78e922..c76ed83c52b63a9aba3673b907ee51641580cb87 100644 >--- a/Source/WebKitLegacy/win/MarshallingHelpers.h >+++ b/Source/WebKitLegacy/win/MarshallingHelpers.h >@@ -30,15 +30,14 @@ > #include <CoreFoundation/CoreFoundation.h> > > namespace WebCore { >- class IntRect; >- class URL; >+class IntRect; > } > > class MarshallingHelpers > { > public: >- static WebCore::URL BSTRToKURL(BSTR); >- static BSTR URLToBSTR(const WebCore::URL&); >+ static URL BSTRToKURL(BSTR); >+ static BSTR URLToBSTR(const URL&); > static CFURLRef PathStringToFileCFURLRef(const WTF::String&); > static WTF::String FileCFURLRefToPathString(CFURLRef fileURL); > static CFURLRef BSTRToCFURLRef(BSTR); >diff --git a/Source/WebKitLegacy/win/Plugins/PluginDatabase.cpp b/Source/WebKitLegacy/win/Plugins/PluginDatabase.cpp >index f243603ce6715d8f1f088deaf29ae0071d8e9468..9cdcc145b71999cda698414e52fe22c37a897b84 100644 >--- a/Source/WebKitLegacy/win/Plugins/PluginDatabase.cpp >+++ b/Source/WebKitLegacy/win/Plugins/PluginDatabase.cpp >@@ -28,8 +28,8 @@ > > #include "PluginPackage.h" > #include <WebCore/Frame.h> >-#include <WebCore/URL.h> > #include <stdlib.h> >+#include <wtf/URL.h> > #include <wtf/text/CString.h> > > #if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE) >diff --git a/Source/WebKitLegacy/win/Plugins/PluginDatabase.h b/Source/WebKitLegacy/win/Plugins/PluginDatabase.h >index 013708ebd71f98370549a446411bfa4c7fd930ad..acc0e1fba746429441bb9ad64fdbce250d2db717 100644 >--- a/Source/WebKitLegacy/win/Plugins/PluginDatabase.h >+++ b/Source/WebKitLegacy/win/Plugins/PluginDatabase.h >@@ -38,7 +38,6 @@ namespace WebCore { > class Element; > class Frame; > class IntSize; >- class URL; > class PluginDatabaseClient; > class PluginPackage; > >diff --git a/Source/WebKitLegacy/win/Plugins/PluginDatabaseWin.cpp b/Source/WebKitLegacy/win/Plugins/PluginDatabaseWin.cpp >index c3e49f4419654610efd4dc5f5ebd9ab091c06e15..814e2bb6dc391fc2ffa1a95b69e46d4580c03653 100644 >--- a/Source/WebKitLegacy/win/Plugins/PluginDatabaseWin.cpp >+++ b/Source/WebKitLegacy/win/Plugins/PluginDatabaseWin.cpp >@@ -29,7 +29,7 @@ > > #include "PluginPackage.h" > #include <WebCore/Frame.h> >-#include <WebCore/URL.h> >+#include <wtf/URL.h> > #include <wtf/WindowsExtras.h> > #include <wtf/text/win/WCharStringExtras.h> > >diff --git a/Source/WebKitLegacy/win/Plugins/PluginStream.h b/Source/WebKitLegacy/win/Plugins/PluginStream.h >index f628ccd3d5a45926e5370352d86dc9a753558e71..c1b9f87ac4e622fbb2e2e205d16459c0c194e7b6 100644 >--- a/Source/WebKitLegacy/win/Plugins/PluginStream.h >+++ b/Source/WebKitLegacy/win/Plugins/PluginStream.h >@@ -32,10 +32,10 @@ > #include <WebCore/ResourceRequest.h> > #include <WebCore/ResourceResponse.h> > #include <WebCore/Timer.h> >-#include <WebCore/URL.h> > #include <WebCore/npruntime_internal.h> > #include <wtf/HashMap.h> > #include <wtf/RefCounted.h> >+#include <wtf/URL.h> > #include <wtf/Vector.h> > #include <wtf/text/CString.h> > #include <wtf/text/StringHash.h> >diff --git a/Source/WebKitLegacy/win/Plugins/PluginView.h b/Source/WebKitLegacy/win/Plugins/PluginView.h >index b4e91f6e12b3bb9b2a39d8ba8f02a9420405bd30..7cfc7a9a82e72c912f5db999cfb37bf9cf1a9f4e 100644 >--- a/Source/WebKitLegacy/win/Plugins/PluginView.h >+++ b/Source/WebKitLegacy/win/Plugins/PluginView.h >@@ -60,7 +60,6 @@ namespace WebCore { > class HTMLPlugInElement; > class KeyboardEvent; > class MouseEvent; >- class URL; > #if ENABLE(NETSCAPE_PLUGIN_API) > class PluginMessageThrottlerWin; > #endif >diff --git a/Source/WebKitLegacy/win/WebCoreSupport/WebContextMenuClient.h b/Source/WebKitLegacy/win/WebCoreSupport/WebContextMenuClient.h >index 203d1565e2586173ca2561a545a38e60e75c8d82..c9de49b3cd14551728fb2f9d96ef490e99158bd4 100644 >--- a/Source/WebKitLegacy/win/WebCoreSupport/WebContextMenuClient.h >+++ b/Source/WebKitLegacy/win/WebCoreSupport/WebContextMenuClient.h >@@ -35,7 +35,7 @@ public: > > virtual void contextMenuDestroyed(); > >- virtual void downloadURL(const WebCore::URL&); >+ virtual void downloadURL(const URL&); > virtual void searchWithGoogle(const WebCore::Frame*); > virtual void lookUpInDictionary(WebCore::Frame*); > virtual void speak(const WTF::String&); >diff --git a/Source/WebKitLegacy/win/WebCoreSupport/WebDesktopNotificationsDelegate.cpp b/Source/WebKitLegacy/win/WebCoreSupport/WebDesktopNotificationsDelegate.cpp >index 64350767f934026d09c0fa8b88dccdd38942ed07..cc038cefd915f4516d587baf109a5ad647a20137 100644 >--- a/Source/WebKitLegacy/win/WebCoreSupport/WebDesktopNotificationsDelegate.cpp >+++ b/Source/WebKitLegacy/win/WebCoreSupport/WebDesktopNotificationsDelegate.cpp >@@ -33,7 +33,7 @@ > #include "WebView.h" > #include <WebCore/BString.h> > #include <WebCore/Document.h> >-#include <WebCore/URL.h> >+#include <wtf/URL.h> > > #if ENABLE(NOTIFICATIONS) > >diff --git a/Source/WebKitLegacy/win/WebCoreSupport/WebDesktopNotificationsDelegate.h b/Source/WebKitLegacy/win/WebCoreSupport/WebDesktopNotificationsDelegate.h >index f0f1d92f2db25b744287752462afba4bc1d1c7f1..8296c8ccb6887d34548d5a64c6867726a7460772 100644 >--- a/Source/WebKitLegacy/win/WebCoreSupport/WebDesktopNotificationsDelegate.h >+++ b/Source/WebKitLegacy/win/WebCoreSupport/WebDesktopNotificationsDelegate.h >@@ -38,7 +38,6 @@ interface IWebDesktopNotificationPresenter; > > namespace WebCore { > class Document; >-class URL; > } > > class WebDesktopNotificationsDelegate : public WebCore::NotificationClient { >diff --git a/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.h b/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.h >index a7a289721f9b73b9884d33e6fe63ee77eae9e64d..0822b8357b300e2567ec87b46d7e7e2e57ef08d3 100644 >--- a/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.h >+++ b/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.h >@@ -85,7 +85,11 @@ public: > void dispatchDidDispatchOnloadEvents() override; > void dispatchDidReceiveServerRedirectForProvisionalLoad() override; > void dispatchDidCancelClientRedirect() override; >+<<<<<<< HEAD > void dispatchWillPerformClientRedirect(const WebCore::URL&, double interval, WallTime fireDate, WebCore::LockBackForwardList) override; >+======= >+ void dispatchWillPerformClientRedirect(const URL&, double interval, WallTime fireDate) override; >+>>>>>>> changes > void dispatchDidChangeLocationWithinPage() override; > void dispatchDidPushStateWithinPage() override; > void dispatchDidReplaceStateWithinPage() override; >@@ -139,8 +143,8 @@ public: > bool shouldGoToHistoryItem(WebCore::HistoryItem&) const override; > > void didDisplayInsecureContent() override; >- void didRunInsecureContent(WebCore::SecurityOrigin&, const WebCore::URL&) override; >- void didDetectXSS(const WebCore::URL&, bool didBlockEntirePage) override; >+ void didRunInsecureContent(WebCore::SecurityOrigin&, const URL&) override; >+ void didDetectXSS(const URL&, bool didBlockEntirePage) override; > > WebCore::ResourceError cancelledError(const WebCore::ResourceRequest&) override; > WebCore::ResourceError blockedError(const WebCore::ResourceRequest&) override; >@@ -153,12 +157,12 @@ public: > > bool shouldFallBack(const WebCore::ResourceError&) override; > >- WTF::String userAgent(const WebCore::URL&) override; >+ WTF::String userAgent(const URL&) override; > > Ref<WebCore::DocumentLoader> createDocumentLoader(const WebCore::ResourceRequest&, const WebCore::SubstituteData&) override; > void updateCachedDocumentLoader(WebCore::DocumentLoader&) override { } > >- void setTitle(const WebCore::StringWithDirection&, const WebCore::URL&) override; >+ void setTitle(const WebCore::StringWithDirection&, const URL&) override; > > void savePlatformDataToCachedFrame(WebCore::CachedFrame*) override; > void transitionToCommittedFromCachedFrame(WebCore::CachedFrame*) override; >@@ -184,15 +188,21 @@ public: > > bool canCachePage() const override; > >+<<<<<<< HEAD > RefPtr<WebCore::Frame> createFrame(const WebCore::URL&, const WTF::String& name, WebCore::HTMLFrameOwnerElement&, > const WTF::String& referrer) override; > RefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement&, const WebCore::URL&, const Vector<WTF::String>&, const Vector<WTF::String>&, const WTF::String&, bool loadManually) override; >+======= >+ RefPtr<WebCore::Frame> createFrame(const URL&, const WTF::String& name, WebCore::HTMLFrameOwnerElement&, >+ const WTF::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight) override; >+ RefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement&, const URL&, const Vector<WTF::String>&, const Vector<WTF::String>&, const WTF::String&, bool loadManually) override; >+>>>>>>> changes > void recreatePlugin(WebCore::Widget*) override { } > void redirectDataToPlugin(WebCore::Widget&) override; > >- RefPtr<WebCore::Widget> createJavaAppletWidget(const WebCore::IntSize&, WebCore::HTMLAppletElement&, const WebCore::URL& baseURL, const Vector<WTF::String>& paramNames, const Vector<WTF::String>& paramValues) override; >+ RefPtr<WebCore::Widget> createJavaAppletWidget(const WebCore::IntSize&, WebCore::HTMLAppletElement&, const URL& baseURL, const Vector<WTF::String>& paramNames, const Vector<WTF::String>& paramValues) override; > >- WebCore::ObjectContentType objectContentType(const WebCore::URL&, const WTF::String& mimeType) override; >+ WebCore::ObjectContentType objectContentType(const URL&, const WTF::String& mimeType) override; > WTF::String overrideMediaType() const override; > > void dispatchDidClearWindowObjectInWorld(WebCore::DOMWrapperWorld&) override; >diff --git a/Source/WebKitLegacy/win/WebCoreSupport/WebPlatformStrategies.h b/Source/WebKitLegacy/win/WebCoreSupport/WebPlatformStrategies.h >index 0c4fb0424d01ea115d27ece72e1903876e5c1e59..be24cb8a56859cd43ce19f0a17bbf81da7c99f1a 100644 >--- a/Source/WebKitLegacy/win/WebCoreSupport/WebPlatformStrategies.h >+++ b/Source/WebKitLegacy/win/WebCoreSupport/WebPlatformStrategies.h >@@ -45,11 +45,11 @@ private: > virtual WebCore::BlobRegistry* createBlobRegistry(); > > // WebCore::CookiesStrategy >- std::pair<String, bool> cookiesForDOM(const WebCore::NetworkStorageSession&, const WebCore::URL& firstParty, const WebCore::SameSiteInfo&, const WebCore::URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, WebCore::IncludeSecureCookies) override; >- virtual void setCookiesFromDOM(const WebCore::NetworkStorageSession&, const WebCore::URL& firstParty, const WebCore::SameSiteInfo&, const WebCore::URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, const String&); >+ std::pair<String, bool> cookiesForDOM(const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, WebCore::IncludeSecureCookies) override; >+ virtual void setCookiesFromDOM(const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, const String&); > virtual bool cookiesEnabled(const WebCore::NetworkStorageSession&); >- std::pair<String, bool> cookieRequestHeaderFieldValue(const WebCore::NetworkStorageSession&, const WebCore::URL& firstParty, const WebCore::SameSiteInfo&, const WebCore::URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, WebCore::IncludeSecureCookies) override; >- std::pair<String, bool> cookieRequestHeaderFieldValue(PAL::SessionID, const WebCore::URL& firstParty, const WebCore::SameSiteInfo&, const WebCore::URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, WebCore::IncludeSecureCookies) override; >- virtual bool getRawCookies(const WebCore::NetworkStorageSession&, const WebCore::URL& firstParty, const WebCore::SameSiteInfo&, const WebCore::URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, Vector<WebCore::Cookie>&); >- virtual void deleteCookie(const WebCore::NetworkStorageSession&, const WebCore::URL&, const String&); >+ std::pair<String, bool> cookieRequestHeaderFieldValue(const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, WebCore::IncludeSecureCookies) override; >+ std::pair<String, bool> cookieRequestHeaderFieldValue(PAL::SessionID, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, WebCore::IncludeSecureCookies) override; >+ virtual bool getRawCookies(const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, Vector<WebCore::Cookie>&); >+ virtual void deleteCookie(const WebCore::NetworkStorageSession&, const URL&, const String&); > }; >diff --git a/Source/WebKitLegacy/win/WebCoreSupport/WebPluginInfoProvider.cpp b/Source/WebKitLegacy/win/WebCoreSupport/WebPluginInfoProvider.cpp >index 1a45ab8de28237cfdeb6f39de0f174eeb5d823ef..d310d2910087009e89bafef5f0e01276194dde42 100644 >--- a/Source/WebKitLegacy/win/WebCoreSupport/WebPluginInfoProvider.cpp >+++ b/Source/WebKitLegacy/win/WebCoreSupport/WebPluginInfoProvider.cpp >@@ -84,7 +84,7 @@ Vector<WebCore::PluginInfo> WebPluginInfoProvider::pluginInfo(WebCore::Page& pag > return outPlugins; > } > >-Vector<WebCore::PluginInfo> WebPluginInfoProvider::webVisiblePluginInfo(WebCore::Page& page, const WebCore::URL&) >+Vector<WebCore::PluginInfo> WebPluginInfoProvider::webVisiblePluginInfo(WebCore::Page& page, const URL&) > { > std::optional<Vector<WebCore::SupportedPluginIdentifier>> supportedPluginNames; > return pluginInfo(page, supportedPluginNames); >diff --git a/Source/WebKitLegacy/win/WebCoreSupport/WebPluginInfoProvider.h b/Source/WebKitLegacy/win/WebCoreSupport/WebPluginInfoProvider.h >index 801bcb7b462dccddfc7652b64af06f860ffc55fb..10f766e06044d159b0a1cd9394921e7612d57924 100644 >--- a/Source/WebKitLegacy/win/WebCoreSupport/WebPluginInfoProvider.h >+++ b/Source/WebKitLegacy/win/WebCoreSupport/WebPluginInfoProvider.h >@@ -37,7 +37,7 @@ public: > private: > void refreshPlugins() final; > Vector<WebCore::PluginInfo> pluginInfo(WebCore::Page&, std::optional<Vector<WebCore::SupportedPluginIdentifier>>&) final; >- Vector<WebCore::PluginInfo> webVisiblePluginInfo(WebCore::Page&i, const WebCore::URL&) final; >+ Vector<WebCore::PluginInfo> webVisiblePluginInfo(WebCore::Page&i, const URL&) final; > #if PLATFORM(MAC) > void setPluginLoadClientPolicy(WebCore::PluginLoadClientPolicy, const String& host, const String& bundleIdentifier, const String& versionString) final; > void clearPluginClientPolicies() final; >diff --git a/Source/WebKitLegacy/win/WebCoreSupport/WebVisitedLinkStore.h b/Source/WebKitLegacy/win/WebCoreSupport/WebVisitedLinkStore.h >index 6a7b9922c3a391522c3da047e4a06973b404d110..8bede9e2581918320270eab65274a7a906db58a0 100644 >--- a/Source/WebKitLegacy/win/WebCoreSupport/WebVisitedLinkStore.h >+++ b/Source/WebKitLegacy/win/WebCoreSupport/WebVisitedLinkStore.h >@@ -42,7 +42,7 @@ public: > private: > WebVisitedLinkStore(); > >- bool isLinkVisited(WebCore::Page&, WebCore::SharedStringHash, const WebCore::URL& baseURL, const AtomicString& attributeURL) override; >+ bool isLinkVisited(WebCore::Page&, WebCore::SharedStringHash, const URL& baseURL, const AtomicString& attributeURL) override; > void addVisitedLink(WebCore::Page&, WebCore::SharedStringHash) override; > > void populateVisitedLinksIfNeeded(WebCore::Page&); >diff --git a/Source/WebKitLegacy/win/WebDataSource.cpp b/Source/WebKitLegacy/win/WebDataSource.cpp >index a682c62750e11f52156721f3d8282d57e0f806d2..b4073e108bd5c770dd62a105afb0cca9c4ef038e 100644 >--- a/Source/WebKitLegacy/win/WebDataSource.cpp >+++ b/Source/WebKitLegacy/win/WebDataSource.cpp >@@ -43,7 +43,7 @@ > #include <WebCore/Document.h> > #include <WebCore/Frame.h> > #include <WebCore/FrameLoader.h> >-#include <WebCore/URL.h> >+#include <wtf/URL.h> > > using namespace WebCore; > >diff --git a/Source/WebKitLegacy/win/WebDownload.h b/Source/WebKitLegacy/win/WebDownload.h >index 84885f24fb834a2dfca82eeb79e19c719104a472..4f6111e23b2c2e07e0ae4afad58ea50ed1a32c7d 100644 >--- a/Source/WebKitLegacy/win/WebDownload.h >+++ b/Source/WebKitLegacy/win/WebDownload.h >@@ -38,7 +38,6 @@ > #endif > > namespace WebCore { >- class URL; > class ResourceHandle; > class ResourceRequest; > class ResourceResponse; >@@ -52,13 +51,13 @@ class WebDownload > #endif > { > public: >- static WebDownload* createInstance(const WebCore::URL&, IWebDownloadDelegate*); >+ static WebDownload* createInstance(const URL&, IWebDownloadDelegate*); > static WebDownload* createInstance(WebCore::ResourceHandle*, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&, IWebDownloadDelegate*); > static WebDownload* createInstance(); > private: > WebDownload(); > void init(WebCore::ResourceHandle*, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&, IWebDownloadDelegate*); >- void init(const WebCore::URL&, IWebDownloadDelegate*); >+ void init(const URL&, IWebDownloadDelegate*); > ~WebDownload(); > public: > // IUnknown >diff --git a/Source/WebKitLegacy/win/WebElementPropertyBag.cpp b/Source/WebKitLegacy/win/WebElementPropertyBag.cpp >index cdf8cad6a3696eebace62f4e5784cee4bef1d9e9..27af1bae653eff02f6704f7e39ad0e1ac50ad70b 100644 >--- a/Source/WebKitLegacy/win/WebElementPropertyBag.cpp >+++ b/Source/WebKitLegacy/win/WebElementPropertyBag.cpp >@@ -36,8 +36,8 @@ > #include <WebCore/HitTestResult.h> > #include <WebCore/FrameLoader.h> > #include <WebCore/Image.h> >-#include <WebCore/URL.h> > #include <WebCore/RenderObject.h> >+#include <wtf/URL.h> > > using namespace WebCore; > >diff --git a/Source/WebKitLegacy/win/WebFrame.h b/Source/WebKitLegacy/win/WebFrame.h >index dbea698a5750212a50650e7839169d0a5e1b3754..c4d08362dad5e8393e8dff831c25981a2c77fffa 100644 >--- a/Source/WebKitLegacy/win/WebFrame.h >+++ b/Source/WebKitLegacy/win/WebFrame.h >@@ -34,9 +34,9 @@ > #include <WebCore/FrameWin.h> > #include <WebCore/GraphicsContext.h> > #include <WebCore/ResourceHandleClient.h> >-#include <WebCore/URL.h> > #include <sal.h> > #include <wtf/RefPtr.h> >+#include <wtf/URL.h> > #include <wtf/text/WTFString.h> > > namespace WebCore { >@@ -190,7 +190,7 @@ public: > HRESULT matchLabelsAgainstElement(const BSTR* labels, int cLabels, IDOMElement* againstElement, BSTR* result); > HRESULT canProvideDocumentSource(bool* result); > >- WebCore::URL url() const; >+ URL url() const; > > WebView* webView() const; > void setWebView(WebView*); >@@ -213,7 +213,7 @@ protected: > class WebFramePrivate; > WebFramePrivate* d; > bool m_quickRedirectComing { false }; >- WebCore::URL m_originalRequestURL; >+ URL m_originalRequestURL; > bool m_inPrintingMode { false }; > > Vector<WebCore::IntRect> m_pageRects; >diff --git a/Source/WebKitLegacy/win/WebHistory.cpp b/Source/WebKitLegacy/win/WebHistory.cpp >index 22b0846a906b7828656b8d957c10a0dfaff8b301..023384ce96f10949cdd59f774a8145ebbea7b7a5 100644 >--- a/Source/WebKitLegacy/win/WebHistory.cpp >+++ b/Source/WebKitLegacy/win/WebHistory.cpp >@@ -36,12 +36,12 @@ > #include "WebVisitedLinkStore.h" > #include <WebCore/BString.h> > #include <WebCore/HistoryItem.h> >-#include <WebCore/URL.h> > #include <WebCore/PageGroup.h> > #include <WebCore/SharedBuffer.h> > #include <functional> > #include <wtf/DateMath.h> > #include <wtf/StdLibExtras.h> >+#include <wtf/URL.h> > #include <wtf/Vector.h> > > #if USE(CF) >diff --git a/Source/WebKitLegacy/win/WebHistory.h b/Source/WebKitLegacy/win/WebHistory.h >index a52c51f2bbdc3b02c8fbcb8371e6fdeb04c1870d..b9d170a36e1199aa3711e9690604dc2a95052998 100644 >--- a/Source/WebKitLegacy/win/WebHistory.h >+++ b/Source/WebKitLegacy/win/WebHistory.h >@@ -33,8 +33,7 @@ > #include <wtf/HashMap.h> > > namespace WebCore { >- class URL; >- class PageGroup; >+class PageGroup; > } > > //----------------------------------------------------------------------------- >@@ -78,7 +77,7 @@ public: > > // WebHistory > static WebHistory* sharedHistory(); >- void visitedURL(const WebCore::URL&, const WTF::String& title, const WTF::String& httpMethod, bool wasFailure, bool increaseVisitCount); >+ void visitedURL(const URL&, const WTF::String& title, const WTF::String& httpMethod, bool wasFailure, bool increaseVisitCount); > void addVisitedLinksToVisitedLinkStore(WebVisitedLinkStore&); > > COMPtr<IWebHistoryItem> itemForURLString(const WTF::String&) const; >diff --git a/Source/WebKitLegacy/win/WebHistoryItem.cpp b/Source/WebKitLegacy/win/WebHistoryItem.cpp >index 84376201d07eb3fef5eb2d9a72176d317f99122e..a8559a5fd227cbd2b17eaf285ea6395eaff8a6cc 100644 >--- a/Source/WebKitLegacy/win/WebHistoryItem.cpp >+++ b/Source/WebKitLegacy/win/WebHistoryItem.cpp >@@ -32,8 +32,8 @@ > #include <WebCore/BString.h> > #include <WebCore/COMPtr.h> > #include <WebCore/HistoryItem.h> >-#include <WebCore/URL.h> > #include <wtf/RetainPtr.h> >+#include <wtf/URL.h> > #include <wtf/text/CString.h> > > using namespace WebCore; >diff --git a/Source/WebKitLegacy/win/WebResource.cpp b/Source/WebKitLegacy/win/WebResource.cpp >index b292dde7dccef62fca73b0c4cb4bab2adc5bffb0..943fa7ab45c8b0d35d67a30c0fdab4349a3e64a9 100644 >--- a/Source/WebKitLegacy/win/WebResource.cpp >+++ b/Source/WebKitLegacy/win/WebResource.cpp >@@ -34,7 +34,7 @@ using namespace WebCore; > > // WebResource --------------------------------------------------------------------- > >-WebResource::WebResource(IStream* data, const WebCore::URL& url, const WTF::String& mimeType, const WTF::String& textEncodingName, const WTF::String& frameName) >+WebResource::WebResource(IStream* data, const WTF::URL& url, const WTF::String& mimeType, const WTF::String& textEncodingName, const WTF::String& frameName) > : m_data(data) > , m_url(url) > , m_mimeType(mimeType) >diff --git a/Source/WebKitLegacy/win/WebResource.h b/Source/WebKitLegacy/win/WebResource.h >index b8c7dccb03749ab7873e37ffa29f252c653beba5..4df3e0c11504650a9f2b01c2171e21fc21a0b98d 100644 >--- a/Source/WebKitLegacy/win/WebResource.h >+++ b/Source/WebKitLegacy/win/WebResource.h >@@ -28,17 +28,17 @@ > > #include "WebKit.h" > #include <WebCore/COMPtr.h> >-#include <WebCore/URL.h> > #include <WebCore/ResourceResponse.h> > #include <WebCore/SharedBuffer.h> > #include <wtf/RefPtr.h> >+#include <wtf/URL.h> > #include <wtf/text/WTFString.h> > > class WebResource : public IWebResource { > public: > static WebResource* createInstance(RefPtr<WebCore::SharedBuffer>&&, const WebCore::ResourceResponse&); > protected: >- WebResource(IStream* data, const WebCore::URL& url, const WTF::String& mimeType, const WTF::String& textEncodingName, const WTF::String& frameName); >+ WebResource(IStream* data, const WTF::URL& url, const WTF::String& mimeType, const WTF::String& textEncodingName, const WTF::String& frameName); > ~WebResource(); > > public: >@@ -58,7 +58,7 @@ public: > private: > ULONG m_refCount { 0 }; > COMPtr<IStream> m_data; >- WebCore::URL m_url; >+ WTF::URL m_url; > WTF::String m_mimeType; > WTF::String m_textEncodingName; > WTF::String m_frameName; >diff --git a/Source/WebKitLegacy/win/WebSecurityOrigin.cpp b/Source/WebKitLegacy/win/WebSecurityOrigin.cpp >index 81b269fc420c59cc6ef5d992fc76cc49b0ea0fb8..945b86923f6b1fca7d0b4777f0cd0600246a1000 100644 >--- a/Source/WebKitLegacy/win/WebSecurityOrigin.cpp >+++ b/Source/WebKitLegacy/win/WebSecurityOrigin.cpp >@@ -33,7 +33,7 @@ > #include <WebCore/BString.h> > #include <WebCore/DatabaseTracker.h> > #include <WebCore/SecurityOriginData.h> >-#include <WebCore/URL.h> >+#include <wtf/URL.h> > > using namespace WebCore; > >diff --git a/Source/WebKitLegacy/win/WebURLResponse.cpp b/Source/WebKitLegacy/win/WebURLResponse.cpp >index a6082b48da1f9962c92658d05ee262160694b47b..569b98264b45b8878b5872c3312fe13842c520c7 100644 >--- a/Source/WebKitLegacy/win/WebURLResponse.cpp >+++ b/Source/WebKitLegacy/win/WebURLResponse.cpp >@@ -40,13 +40,13 @@ > #endif > > #include <WebCore/BString.h> >-#include <WebCore/URL.h> > #include <WebCore/LocalizedStrings.h> > #include <WebCore/ResourceError.h> > #include <WebCore/ResourceHandle.h> > #include <shlobj.h> > #include <shlwapi.h> > #include <wchar.h> >+#include <wtf/URL.h> > > using namespace WebCore; > >@@ -228,7 +228,7 @@ WebURLResponse* WebURLResponse::createInstance() > { > WebURLResponse* instance = new WebURLResponse(); > // fake an http response - so it has the IWebHTTPURLResponse interface >- instance->m_response = ResourceResponse(WebCore::URL({ }, "http://"), String(), 0, String()); >+ instance->m_response = ResourceResponse(WTF::URL({ }, "http://"), String(), 0, String()); > instance->AddRef(); > return instance; > } >diff --git a/Source/WebKitLegacy/win/WebUserContentURLPattern.cpp b/Source/WebKitLegacy/win/WebUserContentURLPattern.cpp >index bd126758a51cc3538f9ac9537cfb1fc7dfdae388..4812384713c8b99da5cba5b63f254449fe50c642 100644 >--- a/Source/WebKitLegacy/win/WebUserContentURLPattern.cpp >+++ b/Source/WebKitLegacy/win/WebUserContentURLPattern.cpp >@@ -28,7 +28,7 @@ > #include "WebKitDLL.h" > > #include <WebCore/BString.h> >-#include <WebCore/URL.h> >+#include <wtf/URL.h> > > using namespace WebCore; > >diff --git a/Source/WebKitLegacy/win/WebView.h b/Source/WebKitLegacy/win/WebView.h >index 361be53a9f2987fa62a5e27791bec3c1d1602477..1617f10a4dad2471629a012b0498c6733b914b4a 100644 >--- a/Source/WebKitLegacy/win/WebView.h >+++ b/Source/WebKitLegacy/win/WebView.h >@@ -463,7 +463,7 @@ public: > > // Convenient to be able to violate the rules of COM here for easy movement to the frame. > WebFrame* topLevelFrame() const { return m_mainFrame; } >- const WTF::String& userAgentForKURL(const WebCore::URL& url); >+ const WTF::String& userAgentForKURL(const URL& url); > > static bool canHandleRequest(const WebCore::ResourceRequest&); > >@@ -502,7 +502,7 @@ public: > bool onGetObject(WPARAM, LPARAM, LRESULT&) const; > static STDMETHODIMP AccessibleObjectFromWindow(HWND, DWORD objectID, REFIID, void** ppObject); > >- void downloadURL(const WebCore::URL&); >+ void downloadURL(const URL&); > > void flushPendingGraphicsLayerChangesSoon(); > void setRootChildLayer(WebCore::GraphicsLayer*); >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index da31d9daad3b7d1f847caf01672868eac3cb91d8..d2dff2598ea2300aacc72cac0e851870ecd4a408 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,46 @@ >+2018-11-30 Alex Christensen <achristensen@webkit.org> >+ >+ Move URL from WebCore to WTF >+ https://bugs.webkit.org/show_bug.cgi?id=190234 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp: >+ * TestWebKitAPI/Tests/WebCore/SecurityOrigin.cpp: >+ * TestWebKitAPI/Tests/WebCore/URL.cpp: >+ (TestWebKitAPI::createURL): >+ (TestWebKitAPI::TEST_F): >+ * TestWebKitAPI/Tests/WebCore/URLParser.cpp: >+ (TestWebKitAPI::checkURL): >+ (TestWebKitAPI::checkRelativeURL): >+ (TestWebKitAPI::checkURLDifferences): >+ (TestWebKitAPI::checkRelativeURLDifferences): >+ * TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp: >+ * TestWebKitAPI/Tests/WebCore/YouTubePluginReplacement.cpp: >+ * TestWebKitAPI/Tests/WebCore/cocoa/URLExtras.mm: >+ (TestWebKitAPI::originalDataAsString): >+ (TestWebKitAPI::userVisibleString): >+ (TestWebKitAPI::literalURL): >+ (TestWebKitAPI::TEST): >+ * TestWebKitAPI/Tests/WebKitCocoa/LoadAlternateHTMLString.mm: >+ (TEST): >+ * TestWebKitAPI/Tests/WebKitCocoa/LoadInvalidURLRequest.mm: >+ (literalURL): >+ * TestWebKitAPI/Tests/WebKitGLib/TestCookieManager.cpp: >+ * TestWebKitAPI/Tests/mac/LoadInvalidURLRequest.mm: >+ (-[LoadInvalidURLWebFrameLoadDelegate webView:didFailProvisionalLoadWithError:forFrame:]): >+ * TestWebKitAPI/Tests/mac/SSLKeyGenerator.mm: >+ * TestWebKitAPI/win/PlatformUtilitiesWin.cpp: >+ (TestWebKitAPI::Util::createURLForResource): >+ * lldb/lldb_webkit.py: >+ (__lldb_init_module): >+ (WTFURL_SummaryProvider): >+ (WTFURLProvider): >+ (WebCoreURL_SummaryProvider): Deleted. >+ (WebCoreURLProvider): Deleted. >+ (WebCoreURLProvider.__init__): Deleted. >+ (WebCoreURLProvider.to_string): Deleted. >+ > 2018-11-30 Jonathan Bedard <jbedard@apple.com> > > webkitpy: Use DeviceType instead of str to represent device class >diff --git a/Tools/TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp b/Tools/TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp >index 58e69d0df630597a10db2e9c96a2d8ddcdaa7c69..188b8bde0c5f349edc9f425cf9083cc7768d0707 100644 >--- a/Tools/TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp >@@ -38,10 +38,10 @@ > #include <WebCore/NFA.h> > #include <WebCore/NFAToDFA.h> > #include <WebCore/ResourceLoadInfo.h> >-#include <WebCore/URL.h> > #include <WebCore/URLFilterParser.h> > #include <wtf/MainThread.h> > #include <wtf/RunLoop.h> >+#include <wtf/URL.h> > #include <wtf/text/CString.h> > #include <wtf/text/StringBuilder.h> > >diff --git a/Tools/TestWebKitAPI/Tests/WebCore/SecurityOrigin.cpp b/Tools/TestWebKitAPI/Tests/WebCore/SecurityOrigin.cpp >index b928324f3598ddb4617a1deeb8826360c65a4205..aad16b8604179ca43a9773795854b575773afc9a 100644 >--- a/Tools/TestWebKitAPI/Tests/WebCore/SecurityOrigin.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebCore/SecurityOrigin.cpp >@@ -28,8 +28,8 @@ > #include "WTFStringUtilities.h" > #include <WebCore/FileSystem.h> > #include <WebCore/SecurityOrigin.h> >-#include <WebCore/URL.h> > #include <wtf/MainThread.h> >+#include <wtf/URL.h> > > using namespace WebCore; > >diff --git a/Tools/TestWebKitAPI/Tests/WebCore/URL.cpp b/Tools/TestWebKitAPI/Tests/WebCore/URL.cpp >index 73534c81733eba452f32fd9f82171ba9ba54b6bb..dc31b47bd07868aedcaff97f5656d83f789d8321 100644 >--- a/Tools/TestWebKitAPI/Tests/WebCore/URL.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebCore/URL.cpp >@@ -25,11 +25,9 @@ > > #include "config.h" > #include "WTFStringUtilities.h" >-#include <WebCore/URL.h> >-#include <WebCore/URLParser.h> > #include <wtf/MainThread.h> >- >-using namespace WebCore; >+#include <wtf/URL.h> >+#include <wtf/URLParser.h> > > namespace TestWebKitAPI { > >@@ -73,8 +71,7 @@ TEST_F(URLTest, URLConstructorConstChar) > > static URL createURL(const char* urlAsString) > { >- URLParser parser(urlAsString); >- return parser.result(); >+ return URL({ }, urlAsString); > }; > > TEST_F(URLTest, URLProtocolHostAndPort) >@@ -317,20 +314,20 @@ TEST_F(URLTest, EqualIgnoringQueryAndFragment) > > TEST_F(URLTest, ProtocolIsInHTTPFamily) > { >- EXPECT_FALSE(protocolIsInHTTPFamily({})); >- EXPECT_FALSE(protocolIsInHTTPFamily("")); >- EXPECT_FALSE(protocolIsInHTTPFamily("a")); >- EXPECT_FALSE(protocolIsInHTTPFamily("ab")); >- EXPECT_FALSE(protocolIsInHTTPFamily("abc")); >- EXPECT_FALSE(protocolIsInHTTPFamily("abcd")); >- EXPECT_FALSE(protocolIsInHTTPFamily("abcde")); >- EXPECT_FALSE(protocolIsInHTTPFamily("abcdef")); >- EXPECT_FALSE(protocolIsInHTTPFamily("abcdefg")); >- EXPECT_TRUE(protocolIsInHTTPFamily("http:")); >- EXPECT_FALSE(protocolIsInHTTPFamily("http")); >- EXPECT_TRUE(protocolIsInHTTPFamily("https:")); >- EXPECT_FALSE(protocolIsInHTTPFamily("https")); >- EXPECT_TRUE(protocolIsInHTTPFamily("https://!@#$%^&*()")); >+ EXPECT_FALSE(WTF::protocolIsInHTTPFamily({ })); >+ EXPECT_FALSE(WTF::protocolIsInHTTPFamily("")); >+ EXPECT_FALSE(WTF::protocolIsInHTTPFamily("a")); >+ EXPECT_FALSE(WTF::protocolIsInHTTPFamily("ab")); >+ EXPECT_FALSE(WTF::protocolIsInHTTPFamily("abc")); >+ EXPECT_FALSE(WTF::protocolIsInHTTPFamily("abcd")); >+ EXPECT_FALSE(WTF::protocolIsInHTTPFamily("abcde")); >+ EXPECT_FALSE(WTF::protocolIsInHTTPFamily("abcdef")); >+ EXPECT_FALSE(WTF::protocolIsInHTTPFamily("abcdefg")); >+ EXPECT_TRUE(WTF::protocolIsInHTTPFamily("http:")); >+ EXPECT_FALSE(WTF::protocolIsInHTTPFamily("http")); >+ EXPECT_TRUE(WTF::protocolIsInHTTPFamily("https:")); >+ EXPECT_FALSE(WTF::protocolIsInHTTPFamily("https")); >+ EXPECT_TRUE(WTF::protocolIsInHTTPFamily("https://!@#$%^&*()")); > } > > TEST_F(URLTest, HostIsIPAddress) >diff --git a/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp b/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp >index 3e10592a03d0ab01e2c166a453eaaeec1fa039c1..1c4dcdd05e21d7b5fd7ab7dfe85d8f05c1ac8a7a 100644 >--- a/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp >@@ -26,8 +26,8 @@ > #include "config.h" > #include "WTFStringUtilities.h" > #include <WebCore/TextEncoding.h> >-#include <WebCore/URLParser.h> > #include <wtf/MainThread.h> >+#include <wtf/URLParser.h> > #include <wtf/text/StringBuilder.h> > > using namespace WebCore; >@@ -102,7 +102,7 @@ static void checkURL(const String& urlString, const ExpectedParts& parts, TestTa > EXPECT_TRUE(eq(parts.fragment, url.fragmentIdentifier())); > EXPECT_TRUE(eq(parts.string, url.string())); > >- EXPECT_TRUE(URLParser::internalValuesConsistent(url)); >+ EXPECT_TRUE(WTF::URLParser::internalValuesConsistent(url)); > > if (testTabs == TestTabs::No) > return; >@@ -129,7 +129,7 @@ static void checkRelativeURL(const String& urlString, const String& baseURLStrin > EXPECT_TRUE(eq(parts.fragment, url.fragmentIdentifier())); > EXPECT_TRUE(eq(parts.string, url.string())); > >- EXPECT_TRUE(URLParser::internalValuesConsistent(url)); >+ EXPECT_TRUE(WTF::URLParser::internalValuesConsistent(url)); > > if (testTabs == TestTabs::No) > return; >@@ -158,7 +158,7 @@ static void checkURLDifferences(const String& urlString, const ExpectedParts& pa > EXPECT_TRUE(eq(partsNew.fragment, url.fragmentIdentifier())); > EXPECT_TRUE(eq(partsNew.string, url.string())); > >- EXPECT_TRUE(URLParser::internalValuesConsistent(url)); >+ EXPECT_TRUE(WTF::URLParser::internalValuesConsistent(url)); > > if (testTabs == TestTabs::No) > return; >@@ -187,7 +187,7 @@ static void checkRelativeURLDifferences(const String& urlString, const String& b > EXPECT_TRUE(eq(partsNew.fragment, url.fragmentIdentifier())); > EXPECT_TRUE(eq(partsNew.string, url.string())); > >- EXPECT_TRUE(URLParser::internalValuesConsistent(url)); >+ EXPECT_TRUE(WTF::URLParser::internalValuesConsistent(url)); > > if (testTabs == TestTabs::No) > return; >@@ -213,8 +213,7 @@ static void shouldFail(const String& urlString, const String& baseString) > > static void checkURL(const String& urlString, const TextEncoding* encoding, const ExpectedParts& parts, TestTabs testTabs = TestTabs::Yes) > { >- URLParser parser(urlString, { }, encoding); >- auto url = parser.result(); >+ auto url = URL({ }, urlString, encoding); > EXPECT_TRUE(eq(parts.protocol, url.protocol())); > EXPECT_TRUE(eq(parts.user, url.user())); > EXPECT_TRUE(eq(parts.password, url.pass())); >@@ -238,9 +237,7 @@ static void checkURL(const String& urlString, const TextEncoding* encoding, cons > > static void checkURL(const String& urlString, const String& baseURLString, const TextEncoding* encoding, const ExpectedParts& parts, TestTabs testTabs = TestTabs::Yes) > { >- URLParser baseParser(baseURLString, { }, encoding); >- URLParser parser(urlString, baseParser.result(), encoding); >- auto url = parser.result(); >+ auto url = URL(URL({ }, baseURLString), urlString, encoding); > EXPECT_TRUE(eq(parts.protocol, url.protocol())); > EXPECT_TRUE(eq(parts.user, url.user())); > EXPECT_TRUE(eq(parts.password, url.pass())); >diff --git a/Tools/TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp b/Tools/TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp >index 4c8032b936cfe3a591f202ef0e0ea1df0ef7d7b7..0c5e63779ba7e01fa689b709d3af7fe518f70043 100644 >--- a/Tools/TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp >@@ -25,8 +25,8 @@ > > #include "config.h" > >-#include <WebCore/URL.h> > #include <WebCore/UserAgent.h> >+#include <wtf/URL.h> > > using namespace WebCore; > >diff --git a/Tools/TestWebKitAPI/Tests/WebCore/YouTubePluginReplacement.cpp b/Tools/TestWebKitAPI/Tests/WebCore/YouTubePluginReplacement.cpp >index 76b103575ca425ce3fe58da3136b0eec0d6d3f1e..300b13cbca10c21b307eee3114de00fbf0fe02d1 100644 >--- a/Tools/TestWebKitAPI/Tests/WebCore/YouTubePluginReplacement.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebCore/YouTubePluginReplacement.cpp >@@ -24,9 +24,9 @@ > */ > > #include "config.h" >-#include <WebCore/URL.h> > #include <WebCore/YouTubePluginReplacement.h> > #include <wtf/MainThread.h> >+#include <wtf/URL.h> > > using namespace WebCore; > >diff --git a/Tools/TestWebKitAPI/Tests/WebCore/cocoa/URLExtras.mm b/Tools/TestWebKitAPI/Tests/WebCore/cocoa/URLExtras.mm >index 6ffd7dacb3fc0212a404d856b318c9369f89fe96..b640b10bff2f019b727243a7c600851adafd75e0 100644 >--- a/Tools/TestWebKitAPI/Tests/WebCore/cocoa/URLExtras.mm >+++ b/Tools/TestWebKitAPI/Tests/WebCore/cocoa/URLExtras.mm >@@ -25,8 +25,8 @@ > > #import "config.h" > >-#import <WebCore/WebCoreNSURLExtras.h> > #import <wtf/Vector.h> >+#import <wtf/cocoa/NSURLExtras.h> > #import <wtf/text/WTFString.h> > > namespace TestWebKitAPI { >@@ -50,17 +50,17 @@ static const char* dataAsString(NSData *data) > > static const char* originalDataAsString(NSURL *URL) > { >- return dataAsString(WebCore::originalURLData(URL)); >+ return dataAsString(WTF::originalURLData(URL)); > } > > static const char* userVisibleString(NSURL *URL) > { >- return [WebCore::userVisibleString(URL) UTF8String]; >+ return [WTF::userVisibleString(URL) UTF8String]; > } > > static NSURL *literalURL(const char* literal) > { >- return WebCore::URLWithData(literalAsData(literal), nil); >+ return WTF::URLWithData(literalAsData(literal), nil); > } > > TEST(WebCore, URLExtras) >@@ -127,8 +127,8 @@ TEST(WebCore, URLExtras_DivisionSign) > // Selected the division sign as an example of a non-ASCII character that is allowed in host names, since it's a lookalike character. > > // Code path similar to the one used when typing in a URL. >- EXPECT_STREQ("http://site.xn--comothersite-kjb.org", originalDataAsString(WebCore::URLWithUserTypedString(@"http://site.com\xC3\xB7othersite.org", nil))); >- EXPECT_STREQ("http://site.com\xC3\xB7othersite.org", userVisibleString(WebCore::URLWithUserTypedString(@"http://site.com\xC3\xB7othersite.org", nil))); >+ EXPECT_STREQ("http://site.xn--comothersite-kjb.org", originalDataAsString(WTF::URLWithUserTypedString(@"http://site.com\xC3\xB7othersite.org", nil))); >+ EXPECT_STREQ("http://site.com\xC3\xB7othersite.org", userVisibleString(WTF::URLWithUserTypedString(@"http://site.com\xC3\xB7othersite.org", nil))); > > // Code paths similar to the ones used for URLs found in webpages or HTTP responses. > EXPECT_STREQ("http://site.com\xC3\xB7othersite.org", originalDataAsString(literalURL("http://site.com\xC3\xB7othersite.org"))); >@@ -137,17 +137,17 @@ TEST(WebCore, URLExtras_DivisionSign) > EXPECT_STREQ("http://site.com\xC3\xB7othersite.org", userVisibleString(literalURL("http://site.com%C3%B7othersite.org"))); > > // Separate functions that deal with just a host name on its own. >- EXPECT_STREQ("site.xn--comothersite-kjb.org", [WebCore::encodeHostName(@"site.com\xC3\xB7othersite.org") UTF8String]); >- EXPECT_STREQ("site.com\xC3\xB7othersite.org", [WebCore::decodeHostName(@"site.com\xC3\xB7othersite.org") UTF8String]); >+ EXPECT_STREQ("site.xn--comothersite-kjb.org", [WTF::encodeHostName(@"site.com\xC3\xB7othersite.org") UTF8String]); >+ EXPECT_STREQ("site.com\xC3\xB7othersite.org", [WTF::decodeHostName(@"site.com\xC3\xB7othersite.org") UTF8String]); > } > >-TEST(WebCore, URLExtras_Solidus) >+TEST(WTF, URLExtras_Solidus) > { > // Selected full width solidus, which looks like the solidus, which is the character that indicates the end of the host name. > > // Code path similar to the one used when typing in a URL. >- EXPECT_STREQ("http://site.com/othersite.org", originalDataAsString(WebCore::URLWithUserTypedString(@"http://site.com\xEF\xBC\x8Fothersite.org", nil))); >- EXPECT_STREQ("http://site.com/othersite.org", userVisibleString(WebCore::URLWithUserTypedString(@"http://site.com\xEF\xBC\x8Fothersite.org", nil))); >+ EXPECT_STREQ("http://site.com/othersite.org", originalDataAsString(WTF::URLWithUserTypedString(@"http://site.com\xEF\xBC\x8Fothersite.org", nil))); >+ EXPECT_STREQ("http://site.com/othersite.org", userVisibleString(WTF::URLWithUserTypedString(@"http://site.com\xEF\xBC\x8Fothersite.org", nil))); > > // Code paths similar to the ones used for URLs found in webpages or HTTP responses. > EXPECT_STREQ("http://site.com\xEF\xBC\x8Fothersite.org", originalDataAsString(literalURL("http://site.com\xEF\xBC\x8Fothersite.org"))); >@@ -156,8 +156,8 @@ TEST(WebCore, URLExtras_Solidus) > EXPECT_STREQ("http://site.com%EF%BC%8Fothersite.org", userVisibleString(literalURL("http://site.com%EF%BC%8Fothersite.org"))); > > // Separate functions that deal with just a host name on its own. >- EXPECT_STREQ("site.com/othersite.org", [WebCore::encodeHostName(@"site.com\xEF\xBC\x8Fothersite.org") UTF8String]); >- EXPECT_STREQ("site.com/othersite.org", [WebCore::decodeHostName(@"site.com\xEF\xBC\x8Fothersite.org") UTF8String]); >+ EXPECT_STREQ("site.com/othersite.org", [WTF::encodeHostName(@"site.com\xEF\xBC\x8Fothersite.org") UTF8String]); >+ EXPECT_STREQ("site.com/othersite.org", [WTF::decodeHostName(@"site.com\xEF\xBC\x8Fothersite.org") UTF8String]); > } > > TEST(WebCore, URLExtras_Space) >@@ -165,8 +165,8 @@ TEST(WebCore, URLExtras_Space) > // Selected ideographic space, which looks like the ASCII space, which is not allowed unescaped. > > // Code path similar to the one used when typing in a URL. >- EXPECT_STREQ("http://site.com%20othersite.org", originalDataAsString(WebCore::URLWithUserTypedString(@"http://site.com\xE3\x80\x80othersite.org", nil))); >- EXPECT_STREQ("http://site.com%20othersite.org", userVisibleString(WebCore::URLWithUserTypedString(@"http://site.com\xE3\x80\x80othersite.org", nil))); >+ EXPECT_STREQ("http://site.com%20othersite.org", originalDataAsString(WTF::URLWithUserTypedString(@"http://site.com\xE3\x80\x80othersite.org", nil))); >+ EXPECT_STREQ("http://site.com%20othersite.org", userVisibleString(WTF::URLWithUserTypedString(@"http://site.com\xE3\x80\x80othersite.org", nil))); > > // Code paths similar to the ones used for URLs found in webpages or HTTP responses. > EXPECT_STREQ("http://site.com\xE3\x80\x80othersite.org", originalDataAsString(literalURL("http://site.com\xE3\x80\x80othersite.org"))); >@@ -175,31 +175,31 @@ TEST(WebCore, URLExtras_Space) > EXPECT_STREQ("http://site.com%E3%80%80othersite.org", userVisibleString(literalURL("http://site.com%E3%80%80othersite.org"))); > > // Separate functions that deal with just a host name on its own. >- EXPECT_STREQ("site.com othersite.org", [WebCore::encodeHostName(@"site.com\xE3\x80\x80othersite.org") UTF8String]); >- EXPECT_STREQ("site.com\xE3\x80\x80othersite.org", [WebCore::decodeHostName(@"site.com\xE3\x80\x80othersite.org") UTF8String]); >+ EXPECT_STREQ("site.com othersite.org", [WTF::encodeHostName(@"site.com\xE3\x80\x80othersite.org") UTF8String]); >+ EXPECT_STREQ("site.com\xE3\x80\x80othersite.org", [WTF::decodeHostName(@"site.com\xE3\x80\x80othersite.org") UTF8String]); > } > > TEST(WebCore, URLExtras_File) > { >- EXPECT_STREQ("file:///%E2%98%83", [[WebCore::URLWithUserTypedString(@"file:///â", nil) absoluteString] UTF8String]); >+ EXPECT_STREQ("file:///%E2%98%83", [[WTF::URLWithUserTypedString(@"file:///â", nil) absoluteString] UTF8String]); > } > > TEST(WebCore, URLExtras_ParsingError) > { > // Expect IDN failure. >- NSURL *url = WebCore::URLWithUserTypedString(@"http://.com", nil); >+ NSURL *url = WTF::URLWithUserTypedString(@"http://.com", nil); > EXPECT_TRUE(url == nil); > >- NSString *encodedHostName = WebCore::encodeHostName(@"http://.com"); >+ NSString *encodedHostName = WTF::encodeHostName(@"http://.com"); > EXPECT_TRUE(encodedHostName == nil); > } > > TEST(WebCore, URLExtras_Nil) > { >- NSURL *url1 = WebCore::URLWithUserTypedString(nil, nil); >+ NSURL *url1 = WTF::URLWithUserTypedString(nil, nil); > EXPECT_TRUE(url1 == nil); > >- NSURL *url2 = WebCore::URLWithUserTypedStringDeprecated(nil, nil); >+ NSURL *url2 = WTF::URLWithUserTypedStringDeprecated(nil, nil); > EXPECT_TRUE(url2 == nil); > } > >diff --git a/Tools/TestWebKitAPI/Tests/WebKitCocoa/LoadAlternateHTMLString.mm b/Tools/TestWebKitAPI/Tests/WebKitCocoa/LoadAlternateHTMLString.mm >index 505af357e5d101d176b523d155a6294bbe8f7fdf..90d4610c741099fae4a60be97765cc3d7b0ecd44 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitCocoa/LoadAlternateHTMLString.mm >+++ b/Tools/TestWebKitAPI/Tests/WebKitCocoa/LoadAlternateHTMLString.mm >@@ -30,9 +30,9 @@ > > #import "PlatformUtilities.h" > #import "Test.h" >-#import <WebCore/WebCoreNSURLExtras.h> > #import <WebKit/WKWebViewPrivate.h> > #import <wtf/RetainPtr.h> >+#import <wtf/cocoa/NSURLExtras.h> > > static bool isDone; > static int provisionalLoadCount; >@@ -110,7 +110,7 @@ TEST(WKWebView, LoadAlternateHTMLStringFromProvisionalLoadErrorBackToBack) > [webView setNavigationDelegate:delegate.get()]; > > char literal[] = "https://www.example.com<>/"; >- NSURL* targetURL = WebCore::URLWithData([NSData dataWithBytes:literal length:strlen(literal)], nil); >+ NSURL* targetURL = WTF::URLWithData([NSData dataWithBytes:literal length:strlen(literal)], nil); > [webView loadRequest:[NSURLRequest requestWithURL:targetURL]]; > [webView loadRequest:[NSURLRequest requestWithURL:targetURL]]; > >diff --git a/Tools/TestWebKitAPI/Tests/WebKitCocoa/LoadInvalidURLRequest.mm b/Tools/TestWebKitAPI/Tests/WebKitCocoa/LoadInvalidURLRequest.mm >index ac98c196440ab7b55084c95d78d09fe7fc797e3c..eaa55cac67f8e84414327d4dae32609645d95bac 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitCocoa/LoadInvalidURLRequest.mm >+++ b/Tools/TestWebKitAPI/Tests/WebKitCocoa/LoadInvalidURLRequest.mm >@@ -28,10 +28,10 @@ > #if WK_API_ENABLED > > #import "PlatformUtilities.h" >-#import <WebCore/WebCoreNSURLExtras.h> > #import <WebKit/WKNavigationPrivate.h> > #import <WebKit/WKWebView.h> > #import <wtf/RetainPtr.h> >+#import <wtf/cocoa/NSURLExtras.h> > > static bool didFinishTest; > static bool didFailProvisionalLoad; >@@ -39,7 +39,7 @@ static const char literal[] = "https://www.example.com<>/"; > > static NSURL *literalURL(const char* literal) > { >- return WebCore::URLWithData([NSData dataWithBytes:literal length:strlen(literal)], nil); >+ return WTF::URLWithData([NSData dataWithBytes:literal length:strlen(literal)], nil); > } > > @interface LoadInvalidURLNavigationActionDelegate : NSObject <WKNavigationDelegate> >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestCookieManager.cpp b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestCookieManager.cpp >index b0514524f72591f6cb502911031b7bfa8a3afa07..1baae95ac06231fbfb29a8ba14187772b5af3ad1 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestCookieManager.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestCookieManager.cpp >@@ -22,8 +22,8 @@ > > #include "WebKitTestServer.h" > #include "WebViewTest.h" >-#include <WebCore/GUniquePtrSoup.h> > #include <glib/gstdio.h> >+#include <wtf/glib/GUniquePtrSoup.h> > > static WebKitTestServer* kServer; > >diff --git a/Tools/TestWebKitAPI/Tests/mac/LoadInvalidURLRequest.mm b/Tools/TestWebKitAPI/Tests/mac/LoadInvalidURLRequest.mm >index 8d54ca6e19e0d69962a5f15323542aef203575d1..86b7b3c4a998630d285e51795fc8ad6981cfc927 100644 >--- a/Tools/TestWebKitAPI/Tests/mac/LoadInvalidURLRequest.mm >+++ b/Tools/TestWebKitAPI/Tests/mac/LoadInvalidURLRequest.mm >@@ -26,10 +26,10 @@ > #include "config.h" > > #import "PlatformUtilities.h" >-#import <WebCore/WebCoreNSURLExtras.h> > #import <WebKit/WKNavigationPrivate.h> > #import <WebKit/WKWebView.h> > #import <wtf/RetainPtr.h> >+#import <wtf/cocoa/NSURLExtras.h> > > static bool didFinishTest; > static bool didFailProvisionalLoad; >@@ -51,7 +51,7 @@ static bool didFailProvisionalLoad; > EXPECT_EQ(error.code, WebKitErrorCannotShowURL); > > static char literal[] = "https://www.example.com$/"; >- NSURL *failedURL = WebCore::URLWithData([NSData dataWithBytes:literal length:strlen(literal)], nil); >+ NSURL *failedURL = WTF::URLWithData([NSData dataWithBytes:literal length:strlen(literal)], nil); > EXPECT_TRUE([error.userInfo[@"NSErrorFailingURLKey"] isEqual:failedURL]); > > didFailProvisionalLoad = true; >diff --git a/Tools/TestWebKitAPI/Tests/mac/SSLKeyGenerator.mm b/Tools/TestWebKitAPI/Tests/mac/SSLKeyGenerator.mm >index dde8c7d01da67804195c7f41e2911a789c702c52..ac1bf7db6c98b02d255265972bc299da0c987edd 100644 >--- a/Tools/TestWebKitAPI/Tests/mac/SSLKeyGenerator.mm >+++ b/Tools/TestWebKitAPI/Tests/mac/SSLKeyGenerator.mm >@@ -29,9 +29,9 @@ > #import <Security/SecAsn1Templates.h> > #import <WebCore/LocalizedStrings.h> > #import <WebCore/SSLKeyGenerator.h> >-#import <WebCore/URL.h> > #import <wtf/MainThread.h> > #import <wtf/Scope.h> >+#import <wtf/URL.h> > #import <wtf/spi/cocoa/SecuritySPI.h> > #import <wtf/text/Base64.h> > >@@ -69,7 +69,7 @@ const SecAsn1Template signedPublicKeyAndChallengeTemplate[] { > { 0, 0, 0, 0 } > }; > >-const WebCore::URL url = WebCore::URL(WebCore::URL(), "http://www.webkit.org/"); >+const URL url = URL(URL(), "http://www.webkit.org/"); > > class SSLKeyGeneratorTest : public testing::Test { > public: >diff --git a/Tools/TestWebKitAPI/win/PlatformUtilitiesWin.cpp b/Tools/TestWebKitAPI/win/PlatformUtilitiesWin.cpp >index 8f755c32c8c2e2e0d379d3e5f07cc6b9bdcc1865..056bff77829528b1290f12e39ab238b0f6868b86 100644 >--- a/Tools/TestWebKitAPI/win/PlatformUtilitiesWin.cpp >+++ b/Tools/TestWebKitAPI/win/PlatformUtilitiesWin.cpp >@@ -28,7 +28,7 @@ > > #include <Shlwapi.h> > #include <WebCore/FileSystem.h> >-#include <WebCore/URL.h> >+#include <wtf/URL.h> > #include <wtf/text/win/WCharStringExtras.h> > > namespace TestWebKitAPI { >@@ -52,7 +52,7 @@ WKStringRef createInjectedBundlePath() > WKURLRef createURLForResource(const char* resource, const char* extension) > { > String filename = String::format("..\\..\\..\\Tools\\TestWebKitAPI\\Tests\\WebKit\\%s.%s", resource, extension); >- auto url = WebCore::URL::fileURLWithFileSystemPath(WebCore::FileSystem::pathByAppendingComponent(moduleDirectory(), filename)); >+ auto url = URL::fileURLWithFileSystemPath(WebCore::FileSystem::pathByAppendingComponent(moduleDirectory(), filename)); > return WKURLCreateWithUTF8CString(url.string().utf8().data()); > } > >diff --git a/Tools/lldb/lldb_webkit.py b/Tools/lldb/lldb_webkit.py >index f5bbc2171c4e6b739805d95468c733bc65b4d45f..2c554773acc486b9ad952003b74d9a05ebfe3bb8 100644 >--- a/Tools/lldb/lldb_webkit.py >+++ b/Tools/lldb/lldb_webkit.py >@@ -46,7 +46,7 @@ def __lldb_init_module(debugger, dict): > debugger.HandleCommand('type summary add --expand -F lldb_webkit.WTFMediaTime_SummaryProvider WTF::MediaTime') > debugger.HandleCommand('type summary add --expand -F lldb_webkit.WTFOptionSet_SummaryProvider -x "^WTF::OptionSet<.+>$"') > >- debugger.HandleCommand('type summary add -F lldb_webkit.WebCoreURL_SummaryProvider WebCore::URL') >+ debugger.HandleCommand('type summary add -F lldb_webkit.WTFURL_SummaryProvider WTF::URL') > debugger.HandleCommand('type summary add -F lldb_webkit.WebCoreColor_SummaryProvider WebCore::Color') > > debugger.HandleCommand('type summary add -F lldb_webkit.WebCoreLayoutUnit_SummaryProvider WebCore::LayoutUnit') >@@ -138,8 +138,8 @@ def WebCoreColor_SummaryProvider(valobj, dict): > return "{ %s }" % provider.to_string() > > >-def WebCoreURL_SummaryProvider(valobj, dict): >- provider = WebCoreURLProvider(valobj, dict) >+def WTFURL_SummaryProvider(valobj, dict): >+ provider = WTFURLProvider(valobj, dict) > return "{ %s }" % provider.to_string() > > >@@ -600,8 +600,8 @@ class WebCoreFloatRectProvider: > return WebCoreFloatSizeProvider(self.valobj.GetChildMemberWithName('m_size'), dict).get_height() > > >-class WebCoreURLProvider: >- "Print a WebCore::URL" >+class WTFURLProvider: >+ "Print a WTF::URL" > def __init__(self, valobj, dict): > self.valobj = valobj >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 190234
:
351473
|
351481
|
351483
|
351486
|
351489
|
351494
|
351500
|
351506
|
351512
|
351523
|
356258
| 356272