Prepare to remove automatic URL->String conversion operators
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 25 Apr 2020 21:28:45 +0000 (21:28 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 25 Apr 2020 21:28:45 +0000 (21:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=211007

Patch by Alex Christensen <achristensen@webkit.org> on 2020-04-25
Reviewed by Darin Adler.

Source/JavaScriptCore:

* API/JSAPIGlobalObject.mm:
(JSC::JSAPIGlobalObject::moduleLoaderResolve):
(JSC::JSAPIGlobalObject::moduleLoaderImportModule):
* API/JSScript.mm:
(validateBytecodeCachePath):
(+[JSScript scriptOfType:memoryMappedFromASCIIFile:withSourceURL:andBytecodeCache:inVirtualMachine:error:]):
* inspector/ScriptDebugServer.cpp:
(Inspector::ScriptDebugServer::sourceParsed):
* parser/Nodes.h:
(JSC::ScopeNode::sourceURL const):
* runtime/CachedTypes.cpp:
(JSC::CachedSourceProviderShape::encode):
* runtime/Error.cpp:
(JSC::addErrorInfo):
* runtime/ScriptExecutable.h:
(JSC::ScriptExecutable::sourceURL const):

Source/WebCore:

* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::requestFromInfo):
* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::urlString const):
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::fetch):
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::create):
* accessibility/AccessibilityImageMapLink.cpp:
(WebCore::AccessibilityImageMapLink::stringValueForMSAA const):
* bindings/IDLTypes.h:
(WebCore::IDLString::isNullValue):
* bindings/js/CachedScriptSourceProvider.h:
(WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):
* bindings/js/JSDOMConvertStrings.h:
(WebCore::JSConverter<IDLDOMString>::convert):
(WebCore::Converter<IDLUSVString>::convert):
(WebCore::JSConverter<IDLUSVString>::convert):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::evaluateInWorld):
(WebCore::ScriptController::evaluateModule):
(WebCore::ScriptController::callInWorld):
(WebCore::ScriptController::executeIfJavaScriptURL):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::dumpIfTerminal):
(WebCore::CloneSerializer::write):
* css/CSSCursorImageValue.cpp:
(WebCore::CSSCursorImageValue::updateCursorElement):
* css/CSSImageValue.cpp:
(WebCore::CSSImageValue::customCSSText const):
(WebCore::CSSImageValue::createDeprecatedCSSOMWrapper const):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontFaceSrcURI):
* dom/Document.cpp:
(WebCore::Document::processHttpEquiv):
* dom/ExtensionStyleSheets.cpp:
(WebCore::createExtensionsStyleSheet):
* dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::createSheet):
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::requestModuleScript):
(WebCore::ScriptElement::executeClassicScript):
* dom/StyledElement.cpp:
(WebCore::StyledElement::styleAttributeChanged):
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::sanitizeMarkupWithArchive):
(WebCore::WebContentReader::readWebArchive):
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::formAction const):
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::canLoadURL const):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::shouldLoadLink):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::selectNextSourceChild):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::canLoadURL const):
* html/parser/XSSAuditor.cpp:
(WebCore::XSSAuditor::filterToken):
* inspector/InspectorAuditResourcesObject.cpp:
(WebCore::InspectorAuditResourcesObject::getResources):
* inspector/InspectorStyleSheet.cpp:
(WebCore::buildArrayForGroupings):
* inspector/NetworkResourcesData.cpp:
(WebCore::NetworkResourcesData::responseReceived):
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::buildObjectForCachedResource):
(WebCore::InspectorNetworkAgent::willSendRequest):
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::getCookies):
(WebCore::InspectorPageAgent::searchInResources):
(WebCore::InspectorPageAgent::buildObjectForFrameTree):
* inspector/agents/InspectorWorkerAgent.cpp:
(WebCore::InspectorWorkerAgent::connectToWorkerInspectorProxy):
* inspector/agents/WebConsoleAgent.cpp:
(WebCore::WebConsoleAgent::didFailLoading):
* inspector/agents/worker/ServiceWorkerAgent.cpp:
(WebCore::ServiceWorkerAgent::getInitializationInfo):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::subresources const):
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::clientRedirectDestinationForHistory const):
(WebCore::DocumentLoader::serverRedirectDestinationForHistory const):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::submitForm):
(WebCore::FrameLoader::receivedFirstData):
(WebCore::FrameLoader::loadInSameDocument):
(WebCore::FrameLoader::loadedResourceFromMemoryCache):
(WebCore::createWindow):
* loader/HistoryController.cpp:
(WebCore::HistoryController::currentItemShouldBeReplaced const):
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::updateFromElement):
(WebCore::ImageLoader::dispatchPendingBeforeLoadEvent):
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::preloadIfNeeded):
(WebCore::LinkLoader::prefetchIfNeeded):
* loader/MixedContentChecker.cpp:
(WebCore::MixedContentChecker::checkFormForMixedContent const):
* loader/NavigationScheduler.cpp:
(WebCore::NavigationScheduler::shouldScheduleNavigation const):
(WebCore::NavigationScheduler::scheduleLocationChange):
* loader/PingLoader.cpp:
(WebCore::PingLoader::loadImage):
(WebCore::PingLoader::sendPing):
* loader/ResourceLoadNotifier.cpp:
(WebCore::ResourceLoadNotifier::dispatchWillSendRequest):
* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::requestObject):
* loader/TextTrackLoader.cpp:
(WebCore::TextTrackLoader::load):
* loader/appcache/ApplicationCache.cpp:
(WebCore::ApplicationCache::addResource):
(WebCore::ApplicationCache::resourceForRequest):
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::selectCache):
(WebCore::ApplicationCacheGroup::finishedLoadingMainResource):
(WebCore::ApplicationCacheGroup::didFinishLoadingEntry):
(WebCore::ApplicationCacheGroup::didFailLoadingEntry):
(WebCore::ApplicationCacheGroup::didFinishLoadingManifest):
* loader/appcache/ApplicationCacheHost.cpp:
(WebCore::ApplicationCacheHost::shouldLoadResourceFromApplicationCache):
(WebCore::ApplicationCacheHost::getApplicationCacheFallbackResource):
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::loadCacheGroup):
(WebCore::ApplicationCacheStorage::findOrCreateCacheGroup):
(WebCore::ApplicationCacheStorage::findInMemoryCacheGroup const):
(WebCore::ApplicationCacheStorage::cacheGroupForURL):
(WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL):
(WebCore::ApplicationCacheStorage::cacheGroupDestroyed):
(WebCore::ApplicationCacheStorage::cacheGroupMadeObsolete):
(WebCore::ApplicationCacheStorage::store):
(WebCore::ApplicationCacheStorage::deleteCacheForOrigin):
* loader/archive/ArchiveResourceCollection.cpp:
(WebCore::ArchiveResourceCollection::addAllResources):
(WebCore::ArchiveResourceCollection::addResource):
(WebCore::ArchiveResourceCollection::archiveResourceForURL):
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::didAddClient):
(WebCore::CachedCSSStyleSheet::checkNotify):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::cachedResource const):
(WebCore::CachedResourceLoader::requestResource):
(WebCore::CachedResourceLoader::determineRevalidationPolicy const):
(WebCore::CachedResourceLoader::notifyFinished):
* loader/cache/CachedXSLStyleSheet.cpp:
(WebCore::CachedXSLStyleSheet::didAddClient):
(WebCore::CachedXSLStyleSheet::checkNotify):
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::checkOrEnableIfNeeded const):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::setLocation):
(WebCore::DOMWindow::createWindow):
(WebCore::DOMWindow::open):
* page/Location.cpp:
(WebCore::Location::reload):
* page/PageSerializer.cpp:
(WebCore::PageSerializer::retrieveResourcesForProperties):
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::shouldIgnoreHost):
* page/SecurityPolicy.cpp:
(WebCore::SecurityPolicy::shouldInheritSecurityOriginFromOwner):
(WebCore::SecurityPolicy::isBaseURLSchemeAllowed):
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::reportViolation const):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
(WebCore::MediaPlayerPrivateAVFoundation::assetURL const):
* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::writeBlobToFilePath):
* platform/network/mac/ResourceErrorMac.mm:
(WebCore::ResourceError::platformLazyInit):
* storage/StorageEventDispatcher.cpp:
(WebCore::StorageEventDispatcher::dispatchSessionStorageEvents):
(WebCore::StorageEventDispatcher::dispatchLocalStorageEvents):
* svg/SVGImageLoader.cpp:
(WebCore::SVGImageLoader::sourceURI const):
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::loadSynchronously):
* workers/service/ServiceWorkerRegistration.cpp:
(WebCore::ServiceWorkerRegistration::scope const):
* workers/service/ServiceWorkerRegistrationKey.cpp:
(WebCore::ServiceWorkerRegistrationKey::hash const):
(WebCore::ServiceWorkerRegistrationKey::isMatching const):
* workers/service/context/ServiceWorkerDebuggable.cpp:
(WebCore::ServiceWorkerDebuggable::ServiceWorkerDebuggable):
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::startScriptFetch):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::send):

Source/WebKit:

* Shared/API/APIError.h:
(API::Error::failingURL const):
* Shared/API/c/WKSharedAPICast.h:
(WebKit::toCopiedURLAPI):
* UIProcess/API/Cocoa/WKBrowsingContextController.mm:
(setUpPagePolicyClient):
* UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm:
(WebKit::reportAnErrorURL):
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::requestUserMediaAuthorizationForFrame):
(WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin):
* UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
(WebKit::WebPasteboardProxy::readURLFromPasteboard):
* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::cancel):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
(WebKit::WebPageProxy::loadRequestWithNavigationShared):
(WebKit::WebPageProxy::loadAlternateHTML):
(WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
(WebKit::WebPageProxy::didExplicitOpenForFrame):
(WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrameShared):
(WebKit::WebPageProxy::didChangeProvisionalURLForFrameShared):
(WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::createNewPage):
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
(-[WKWebProcessPlugInFrame URL]):
* WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
(WebKit::NetscapePluginStream::didReceiveResponse):
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::clickedLink):
(WebKit::PDFPlugin::openWithNativeApplication):
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::performURLRequest):
(WebKit::PluginView::performJavaScriptURLRequest):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchWillPerformClientRedirect):
(WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
(WebKit::WebFrameLoaderClient::shouldForceUniversalAccessFromLocalURL):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::info const):
* WebProcess/WebStorage/StorageAreaMap.cpp:
(WebKit::StorageAreaMap::setItem):
(WebKit::StorageAreaMap::removeItem):
(WebKit::StorageAreaMap::clear):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::origin):

Source/WebKitLegacy/mac:

* DOM/DOMDocument.mm:
(-[DOMDocument URL]):
* DOM/DOMHTMLAnchorElement.mm:
(-[DOMHTMLAnchorElement href]):
* DOM/DOMHTMLAreaElement.mm:
(-[DOMHTMLAreaElement href]):
* DOM/DOMHTMLEmbedElement.mm:
(-[DOMHTMLEmbedElement src]):
* DOM/DOMHTMLFormElement.mm:
(-[DOMHTMLFormElement action]):
* DOM/DOMHTMLFrameElement.mm:
(-[DOMHTMLFrameElement src]):
(-[DOMHTMLFrameElement location]):
* DOM/DOMHTMLHtmlElement.mm:
(-[DOMHTMLHtmlElement manifest]):
* DOM/DOMHTMLIFrameElement.mm:
(-[DOMHTMLIFrameElement src]):
* DOM/DOMHTMLImageElement.mm:
(-[DOMHTMLImageElement longDesc]):
(-[DOMHTMLImageElement src]):
(-[DOMHTMLImageElement currentSrc]):
(-[DOMHTMLImageElement lowsrc]):
* DOM/DOMHTMLInputElement.mm:
(-[DOMHTMLInputElement src]):
* DOM/DOMHTMLLinkElement.mm:
(-[DOMHTMLLinkElement href]):
* DOM/DOMHTMLMediaElement.mm:
(-[DOMHTMLMediaElement src]):
(-[DOMHTMLMediaElement currentSrc]):
* DOM/DOMHTMLModElement.mm:
(-[DOMHTMLModElement cite]):
* DOM/DOMHTMLObjectElement.mm:
(-[DOMHTMLObjectElement data]):
* DOM/DOMHTMLQuoteElement.mm:
(-[DOMHTMLQuoteElement cite]):
* DOM/DOMHTMLScriptElement.mm:
(-[DOMHTMLScriptElement src]):
* DOM/DOMHTMLVideoElement.mm:
(-[DOMHTMLVideoElement poster]):
* DOM/DOMNode.mm:
(-[DOMNode baseURI]):
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::updateGlobalHistory):
(WebFrameLoaderClient::setTitle):
* WebView/WebImmediateActionController.mm:
(-[WebImmediateActionController _animationControllerForDataDetectedLink]):
* WebView/WebNotification.mm:
(-[WebNotification iconURL]):
* WebView/WebScriptDebugger.mm:
(WebScriptDebugger::sourceParsed):
(toNSURL): Deleted.

Source/WTF:

Too many bugs have been caused by the compiler finding a way to make a String from a URL without being visible in the code.
This does all the easy things to prepare to remove operator String& and operator NSString*.
The hard things will be done in the smaller patch that actually removes them.

* wtf/URL.cpp:
(WTF::URL::protocolIsJavaScript const):
* wtf/URL.h:

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

123 files changed:
Source/JavaScriptCore/API/JSAPIGlobalObject.mm
Source/JavaScriptCore/API/JSScript.mm
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/ScriptDebugServer.cpp
Source/JavaScriptCore/parser/Nodes.h
Source/JavaScriptCore/runtime/CachedTypes.cpp
Source/JavaScriptCore/runtime/Error.cpp
Source/JavaScriptCore/runtime/ScriptExecutable.h
Source/WTF/ChangeLog
Source/WTF/wtf/URL.cpp
Source/WTF/wtf/URL.h
Source/WebCore/ChangeLog
Source/WebCore/Modules/cache/DOMCache.cpp
Source/WebCore/Modules/fetch/FetchRequest.cpp
Source/WebCore/Modules/fetch/FetchResponse.cpp
Source/WebCore/Modules/websockets/WebSocket.cpp
Source/WebCore/accessibility/AccessibilityImageMapLink.cpp
Source/WebCore/bindings/IDLTypes.h
Source/WebCore/bindings/js/CachedScriptSourceProvider.h
Source/WebCore/bindings/js/JSDOMConvertStrings.h
Source/WebCore/bindings/js/ScriptController.cpp
Source/WebCore/bindings/js/SerializedScriptValue.cpp
Source/WebCore/css/CSSCursorImageValue.cpp
Source/WebCore/css/CSSImageValue.cpp
Source/WebCore/css/parser/CSSPropertyParser.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/ExtensionStyleSheets.cpp
Source/WebCore/dom/InlineStyleSheetOwner.cpp
Source/WebCore/dom/ScriptElement.cpp
Source/WebCore/dom/StyledElement.cpp
Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm
Source/WebCore/html/HTMLFormControlElement.cpp
Source/WebCore/html/HTMLFrameElementBase.cpp
Source/WebCore/html/HTMLLinkElement.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLPlugInImageElement.cpp
Source/WebCore/html/parser/XSSAuditor.cpp
Source/WebCore/inspector/InspectorAuditResourcesObject.cpp
Source/WebCore/inspector/InspectorStyleSheet.cpp
Source/WebCore/inspector/NetworkResourcesData.cpp
Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp
Source/WebCore/inspector/agents/InspectorPageAgent.cpp
Source/WebCore/inspector/agents/InspectorWorkerAgent.cpp
Source/WebCore/inspector/agents/WebConsoleAgent.cpp
Source/WebCore/inspector/agents/worker/ServiceWorkerAgent.cpp
Source/WebCore/loader/DocumentLoader.cpp
Source/WebCore/loader/DocumentLoader.h
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/HistoryController.cpp
Source/WebCore/loader/ImageLoader.cpp
Source/WebCore/loader/LinkLoader.cpp
Source/WebCore/loader/MixedContentChecker.cpp
Source/WebCore/loader/NavigationScheduler.cpp
Source/WebCore/loader/PingLoader.cpp
Source/WebCore/loader/ResourceLoadNotifier.cpp
Source/WebCore/loader/SubframeLoader.cpp
Source/WebCore/loader/TextTrackLoader.cpp
Source/WebCore/loader/appcache/ApplicationCache.cpp
Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp
Source/WebCore/loader/appcache/ApplicationCacheHost.cpp
Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp
Source/WebCore/loader/archive/ArchiveResourceCollection.cpp
Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp
Source/WebCore/loader/cache/CachedResourceLoader.cpp
Source/WebCore/loader/cache/CachedXSLStyleSheet.cpp
Source/WebCore/page/ContextMenuController.cpp
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/page/Location.cpp
Source/WebCore/page/PageSerializer.cpp
Source/WebCore/page/SecurityOrigin.cpp
Source/WebCore/page/SecurityPolicy.cpp
Source/WebCore/page/csp/ContentSecurityPolicy.cpp
Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h
Source/WebCore/platform/network/BlobRegistryImpl.cpp
Source/WebCore/platform/network/mac/ResourceErrorMac.mm
Source/WebCore/storage/StorageEventDispatcher.cpp
Source/WebCore/svg/SVGImageLoader.cpp
Source/WebCore/workers/WorkerScriptLoader.cpp
Source/WebCore/workers/service/ServiceWorkerRegistration.cpp
Source/WebCore/workers/service/ServiceWorkerRegistrationKey.cpp
Source/WebCore/workers/service/context/ServiceWorkerDebuggable.cpp
Source/WebCore/workers/service/server/SWServer.cpp
Source/WebCore/xml/XMLHttpRequest.cpp
Source/WebKit/ChangeLog
Source/WebKit/Shared/API/APIError.h
Source/WebKit/Shared/API/c/WKSharedAPICast.h
Source/WebKit/UIProcess/API/Cocoa/WKBrowsingContextController.mm
Source/WebKit/UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm
Source/WebKit/UIProcess/Cocoa/UIDelegate.mm
Source/WebKit/UIProcess/Cocoa/WebPasteboardProxyCocoa.mm
Source/WebKit/UIProcess/ProvisionalPageProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm
Source/WebKit/WebProcess/Plugins/Netscape/NetscapePluginStream.cpp
Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm
Source/WebKit/WebProcess/Plugins/PluginView.cpp
Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit/WebProcess/WebPage/WebFrame.cpp
Source/WebKit/WebProcess/WebStorage/StorageAreaMap.cpp
Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/DOM/DOMDocument.mm
Source/WebKitLegacy/mac/DOM/DOMHTMLAnchorElement.mm
Source/WebKitLegacy/mac/DOM/DOMHTMLAreaElement.mm
Source/WebKitLegacy/mac/DOM/DOMHTMLEmbedElement.mm
Source/WebKitLegacy/mac/DOM/DOMHTMLFormElement.mm
Source/WebKitLegacy/mac/DOM/DOMHTMLFrameElement.mm
Source/WebKitLegacy/mac/DOM/DOMHTMLHtmlElement.mm
Source/WebKitLegacy/mac/DOM/DOMHTMLIFrameElement.mm
Source/WebKitLegacy/mac/DOM/DOMHTMLImageElement.mm
Source/WebKitLegacy/mac/DOM/DOMHTMLInputElement.mm
Source/WebKitLegacy/mac/DOM/DOMHTMLLinkElement.mm
Source/WebKitLegacy/mac/DOM/DOMHTMLMediaElement.mm
Source/WebKitLegacy/mac/DOM/DOMHTMLModElement.mm
Source/WebKitLegacy/mac/DOM/DOMHTMLObjectElement.mm
Source/WebKitLegacy/mac/DOM/DOMHTMLQuoteElement.mm
Source/WebKitLegacy/mac/DOM/DOMHTMLScriptElement.mm
Source/WebKitLegacy/mac/DOM/DOMHTMLVideoElement.mm
Source/WebKitLegacy/mac/DOM/DOMNode.mm
Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm
Source/WebKitLegacy/mac/WebView/WebImmediateActionController.mm
Source/WebKitLegacy/mac/WebView/WebNotification.mm
Source/WebKitLegacy/mac/WebView/WebScriptDebugger.mm

index c74aca0..ebbe35d 100644 (file)
@@ -116,7 +116,7 @@ Identifier JSAPIGlobalObject::moduleLoaderResolve(JSGlobalObject* globalObject,
 
     auto result = computeValidImportSpecifier(base, name);
     if (result)
-        return Identifier::fromString(vm, result.value());
+        return Identifier::fromString(vm, result.value().string());
 
     throwVMError(globalObject, scope, createError(globalObject, result.error()));
     return { };
@@ -137,7 +137,7 @@ JSInternalPromise* JSAPIGlobalObject::moduleLoaderImportModule(JSGlobalObject* g
     };
 
     auto import = [&] (URL& url) {
-        auto result = importModule(globalObject, Identifier::fromString(vm, url), jsUndefined(), jsUndefined());
+        auto result = importModule(globalObject, Identifier::fromString(vm, url.string()), jsUndefined(), jsUndefined());
         if (UNLIKELY(scope.exception()))
             return reject(scope.exception());
         return result;
index 0a9125f..00c876a 100644 (file)
@@ -71,7 +71,7 @@ static bool validateBytecodeCachePath(NSURL* cachePath, NSError** error)
 
     URL cachePathURL([cachePath absoluteURL]);
     if (!cachePathURL.isLocalFile()) {
-        createError([NSString stringWithFormat:@"Cache path `%@` is not a local file", static_cast<NSString *>(cachePathURL)], error);
+        createError([NSString stringWithFormat:@"Cache path `%@` is not a local file", static_cast<NSURL *>(cachePathURL)], error);
         return false;
     }
 
@@ -127,7 +127,7 @@ static bool validateBytecodeCachePath(NSURL* cachePath, NSError** error)
 
     URL filePathURL([filePath absoluteURL]);
     if (!filePathURL.isLocalFile())
-        return createError([NSString stringWithFormat:@"File path %@ is not a local file", static_cast<NSString *>(filePathURL)], error);
+        return createError([NSString stringWithFormat:@"File path %@ is not a local file", static_cast<NSURL *>(filePathURL)], error);
 
     bool success = false;
     String systemPath = filePathURL.fileSystemPath();
index f96aa0b..fd552bf 100644 (file)
@@ -1,3 +1,27 @@
+2020-04-25  Alex Christensen  <achristensen@webkit.org>
+
+        Prepare to remove automatic URL->String conversion operators
+        https://bugs.webkit.org/show_bug.cgi?id=211007
+
+        Reviewed by Darin Adler.
+
+        * API/JSAPIGlobalObject.mm:
+        (JSC::JSAPIGlobalObject::moduleLoaderResolve):
+        (JSC::JSAPIGlobalObject::moduleLoaderImportModule):
+        * API/JSScript.mm:
+        (validateBytecodeCachePath):
+        (+[JSScript scriptOfType:memoryMappedFromASCIIFile:withSourceURL:andBytecodeCache:inVirtualMachine:error:]):
+        * inspector/ScriptDebugServer.cpp:
+        (Inspector::ScriptDebugServer::sourceParsed):
+        * parser/Nodes.h:
+        (JSC::ScopeNode::sourceURL const):
+        * runtime/CachedTypes.cpp:
+        (JSC::CachedSourceProviderShape::encode):
+        * runtime/Error.cpp:
+        (JSC::addErrorInfo):
+        * runtime/ScriptExecutable.h:
+        (JSC::ScriptExecutable::sourceURL const):
+
 2020-04-25  Ross Kirsling  <ross.kirsling@sony.com>
 
         [Intl] Locale validation/canonicalization should defer to ICU
index 7fa6093..6cef102 100644 (file)
@@ -144,7 +144,7 @@ void ScriptDebugServer::sourceParsed(JSGlobalObject* globalObject, SourceProvide
         auto data = sourceProvider->source().toString();
         auto firstLine = sourceProvider->startPosition().m_line.oneBasedInt();
         dispatchFunctionToListeners([&] (ScriptDebugListener& listener) {
-            listener.failedToParseSource(url, data, firstLine, errorLine, errorMessage);
+            listener.failedToParseSource(url.string(), data, firstLine, errorLine, errorMessage);
         });
         return;
     }
@@ -154,7 +154,7 @@ void ScriptDebugServer::sourceParsed(JSGlobalObject* globalObject, SourceProvide
     // FIXME: <https://webkit.org/b/162773> Web Inspector: Simplify ScriptDebugListener::Script to use SourceProvider
     ScriptDebugListener::Script script;
     script.sourceProvider = sourceProvider;
-    script.url = sourceProvider->url();
+    script.url = sourceProvider->url().string();
     script.source = sourceProvider->source().toString();
     script.startLine = sourceProvider->startPosition().m_line.zeroBasedInt();
     script.startColumn = sourceProvider->startPosition().m_column.zeroBasedInt();
index a795a8c..74ebcae 100644 (file)
@@ -1831,7 +1831,7 @@ namespace JSC {
         ScopeNode(ParserArena&, const JSTokenLocation& start, const JSTokenLocation& end, const SourceCode&, SourceElements*, VariableEnvironment&, FunctionStack&&, VariableEnvironment&, UniquedStringImplPtrSet&&, CodeFeatures, InnerArrowFunctionCodeFeatures, int numConstants);
 
         const SourceCode& source() const { return m_source; }
-        const String& sourceURL() const { return m_source.provider()->url(); }
+        const String& sourceURL() const { return m_source.provider()->url().string(); }
         intptr_t sourceID() const { return m_source.providerID(); }
 
         int startLine() const { return m_startLineNumber; }
index bf379ad..d11571f 100644 (file)
@@ -1495,7 +1495,7 @@ public:
     void encode(Encoder& encoder, const SourceProvider& sourceProvider)
     {
         m_sourceOrigin.encode(encoder, sourceProvider.sourceOrigin());
-        m_url.encode(encoder, sourceProvider.url());
+        m_url.encode(encoder, sourceProvider.url().string());
         m_sourceURLDirective.encode(encoder, sourceProvider.sourceURLDirective());
         m_sourceMappingURLDirective.encode(encoder, sourceProvider.sourceMappingURLDirective());
         m_startPosition.encode(encoder, sourceProvider.startPosition());
index 7e2b9fa..37b4988 100644 (file)
@@ -233,7 +233,7 @@ void addErrorInfo(JSGlobalObject* globalObject, JSObject* obj, bool useCurrentFr
 
 JSObject* addErrorInfo(VM& vm, JSObject* error, int line, const SourceCode& source)
 {
-    const String& sourceURL = source.provider()->url();
+    const String& sourceURL = source.provider()->url().string();
     
     // The putDirect() calls below should really be put() so that they trigger materialization of
     // the line/sourceURL properties. Otherwise, what we set here will just be overwritten later.
index 0dd44ec..f4b425b 100644 (file)
@@ -47,7 +47,7 @@ public:
     const SourceCode& source() const { return m_source; }
     intptr_t sourceID() const { return m_source.providerID(); }
     const SourceOrigin& sourceOrigin() const { return m_source.provider()->sourceOrigin(); }
-    const String& sourceURL() const { return m_source.provider()->url(); }
+    const String& sourceURL() const { return m_source.provider()->url().string(); }
     int firstLine() const { return m_source.firstLine().oneBasedInt(); }
     JS_EXPORT_PRIVATE int lastLine() const;
     unsigned startColumn() const { return m_source.startColumn().oneBasedInt(); }
index 3424f47..d9d3a18 100644 (file)
@@ -1,3 +1,18 @@
+2020-04-25  Alex Christensen  <achristensen@webkit.org>
+
+        Prepare to remove automatic URL->String conversion operators
+        https://bugs.webkit.org/show_bug.cgi?id=211007
+
+        Reviewed by Darin Adler.
+
+        Too many bugs have been caused by the compiler finding a way to make a String from a URL without being visible in the code.
+        This does all the easy things to prepare to remove operator String& and operator NSString*.
+        The hard things will be done in the smaller patch that actually removes them.
+
+        * wtf/URL.cpp:
+        (WTF::URL::protocolIsJavaScript const):
+        * wtf/URL.h:
+
 2020-04-25  Darin Adler  <darin@apple.com>
 
         Move URL to use StringView when returning substrings of the URL
index 3cd24f6..08b04bc 100644 (file)
@@ -302,6 +302,11 @@ bool isDefaultPortForProtocol(uint16_t port, StringView protocol)
     return defaultPortForProtocol(protocol) == port;
 }
 
+bool URL::protocolIsJavaScript() const
+{
+    return WTF::protocolIsJavaScript(string());
+}
+
 bool URL::protocolIs(const char* protocol) const
 {
     assertProtocolIsGood(protocol);
index 24c0d89..ab7fbd2 100644 (file)
@@ -125,6 +125,7 @@ public:
     bool protocolIsBlob() const { return protocolIs("blob"); }
     bool protocolIsData() const { return protocolIs("data"); }
     WTF_EXPORT_PRIVATE bool protocolIsAbout() const;
+    WTF_EXPORT_PRIVATE bool protocolIsJavaScript() const;
     bool protocolIsInHTTPFamily() const;
     WTF_EXPORT_PRIVATE bool isLocalFile() const;
     bool cannotBeABaseURL() const { return m_cannotBeABaseURL; }
index 85ffae4..c0fc8c5 100644 (file)
@@ -1,3 +1,200 @@
+2020-04-25  Alex Christensen  <achristensen@webkit.org>
+
+        Prepare to remove automatic URL->String conversion operators
+        https://bugs.webkit.org/show_bug.cgi?id=211007
+
+        Reviewed by Darin Adler.
+
+        * Modules/cache/DOMCache.cpp:
+        (WebCore::DOMCache::requestFromInfo):
+        * Modules/fetch/FetchRequest.cpp:
+        (WebCore::FetchRequest::urlString const):
+        * Modules/fetch/FetchResponse.cpp:
+        (WebCore::FetchResponse::fetch):
+        * Modules/websockets/WebSocket.cpp:
+        (WebCore::WebSocket::create):
+        * accessibility/AccessibilityImageMapLink.cpp:
+        (WebCore::AccessibilityImageMapLink::stringValueForMSAA const):
+        * bindings/IDLTypes.h:
+        (WebCore::IDLString::isNullValue):
+        * bindings/js/CachedScriptSourceProvider.h:
+        (WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):
+        * bindings/js/JSDOMConvertStrings.h:
+        (WebCore::JSConverter<IDLDOMString>::convert):
+        (WebCore::Converter<IDLUSVString>::convert):
+        (WebCore::JSConverter<IDLUSVString>::convert):
+        * bindings/js/ScriptController.cpp:
+        (WebCore::ScriptController::evaluateInWorld):
+        (WebCore::ScriptController::evaluateModule):
+        (WebCore::ScriptController::callInWorld):
+        (WebCore::ScriptController::executeIfJavaScriptURL):
+        * bindings/js/SerializedScriptValue.cpp:
+        (WebCore::CloneSerializer::dumpIfTerminal):
+        (WebCore::CloneSerializer::write):
+        * css/CSSCursorImageValue.cpp:
+        (WebCore::CSSCursorImageValue::updateCursorElement):
+        * css/CSSImageValue.cpp:
+        (WebCore::CSSImageValue::customCSSText const):
+        (WebCore::CSSImageValue::createDeprecatedCSSOMWrapper const):
+        * css/parser/CSSPropertyParser.cpp:
+        (WebCore::consumeFontFaceSrcURI):
+        * dom/Document.cpp:
+        (WebCore::Document::processHttpEquiv):
+        * dom/ExtensionStyleSheets.cpp:
+        (WebCore::createExtensionsStyleSheet):
+        * dom/InlineStyleSheetOwner.cpp:
+        (WebCore::InlineStyleSheetOwner::createSheet):
+        * dom/ScriptElement.cpp:
+        (WebCore::ScriptElement::requestModuleScript):
+        (WebCore::ScriptElement::executeClassicScript):
+        * dom/StyledElement.cpp:
+        (WebCore::StyledElement::styleAttributeChanged):
+        * editing/cocoa/WebContentReaderCocoa.mm:
+        (WebCore::sanitizeMarkupWithArchive):
+        (WebCore::WebContentReader::readWebArchive):
+        * html/HTMLFormControlElement.cpp:
+        (WebCore::HTMLFormControlElement::formAction const):
+        * html/HTMLFrameElementBase.cpp:
+        (WebCore::HTMLFrameElementBase::canLoadURL const):
+        * html/HTMLLinkElement.cpp:
+        (WebCore::HTMLLinkElement::shouldLoadLink):
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::selectNextSourceChild):
+        * html/HTMLPlugInImageElement.cpp:
+        (WebCore::HTMLPlugInImageElement::canLoadURL const):
+        * html/parser/XSSAuditor.cpp:
+        (WebCore::XSSAuditor::filterToken):
+        * inspector/InspectorAuditResourcesObject.cpp:
+        (WebCore::InspectorAuditResourcesObject::getResources):
+        * inspector/InspectorStyleSheet.cpp:
+        (WebCore::buildArrayForGroupings):
+        * inspector/NetworkResourcesData.cpp:
+        (WebCore::NetworkResourcesData::responseReceived):
+        * inspector/agents/InspectorNetworkAgent.cpp:
+        (WebCore::InspectorNetworkAgent::buildObjectForCachedResource):
+        (WebCore::InspectorNetworkAgent::willSendRequest):
+        * inspector/agents/InspectorPageAgent.cpp:
+        (WebCore::InspectorPageAgent::getCookies):
+        (WebCore::InspectorPageAgent::searchInResources):
+        (WebCore::InspectorPageAgent::buildObjectForFrameTree):
+        * inspector/agents/InspectorWorkerAgent.cpp:
+        (WebCore::InspectorWorkerAgent::connectToWorkerInspectorProxy):
+        * inspector/agents/WebConsoleAgent.cpp:
+        (WebCore::WebConsoleAgent::didFailLoading):
+        * inspector/agents/worker/ServiceWorkerAgent.cpp:
+        (WebCore::ServiceWorkerAgent::getInitializationInfo):
+        * loader/DocumentLoader.cpp:
+        (WebCore::DocumentLoader::subresources const):
+        * loader/DocumentLoader.h:
+        (WebCore::DocumentLoader::clientRedirectDestinationForHistory const):
+        (WebCore::DocumentLoader::serverRedirectDestinationForHistory const):
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::submitForm):
+        (WebCore::FrameLoader::receivedFirstData):
+        (WebCore::FrameLoader::loadInSameDocument):
+        (WebCore::FrameLoader::loadedResourceFromMemoryCache):
+        (WebCore::createWindow):
+        * loader/HistoryController.cpp:
+        (WebCore::HistoryController::currentItemShouldBeReplaced const):
+        * loader/ImageLoader.cpp:
+        (WebCore::ImageLoader::updateFromElement):
+        (WebCore::ImageLoader::dispatchPendingBeforeLoadEvent):
+        * loader/LinkLoader.cpp:
+        (WebCore::LinkLoader::preloadIfNeeded):
+        (WebCore::LinkLoader::prefetchIfNeeded):
+        * loader/MixedContentChecker.cpp:
+        (WebCore::MixedContentChecker::checkFormForMixedContent const):
+        * loader/NavigationScheduler.cpp:
+        (WebCore::NavigationScheduler::shouldScheduleNavigation const):
+        (WebCore::NavigationScheduler::scheduleLocationChange):
+        * loader/PingLoader.cpp:
+        (WebCore::PingLoader::loadImage):
+        (WebCore::PingLoader::sendPing):
+        * loader/ResourceLoadNotifier.cpp:
+        (WebCore::ResourceLoadNotifier::dispatchWillSendRequest):
+        * loader/SubframeLoader.cpp:
+        (WebCore::SubframeLoader::requestObject):
+        * loader/TextTrackLoader.cpp:
+        (WebCore::TextTrackLoader::load):
+        * loader/appcache/ApplicationCache.cpp:
+        (WebCore::ApplicationCache::addResource):
+        (WebCore::ApplicationCache::resourceForRequest):
+        * loader/appcache/ApplicationCacheGroup.cpp:
+        (WebCore::ApplicationCacheGroup::selectCache):
+        (WebCore::ApplicationCacheGroup::finishedLoadingMainResource):
+        (WebCore::ApplicationCacheGroup::didFinishLoadingEntry):
+        (WebCore::ApplicationCacheGroup::didFailLoadingEntry):
+        (WebCore::ApplicationCacheGroup::didFinishLoadingManifest):
+        * loader/appcache/ApplicationCacheHost.cpp:
+        (WebCore::ApplicationCacheHost::shouldLoadResourceFromApplicationCache):
+        (WebCore::ApplicationCacheHost::getApplicationCacheFallbackResource):
+        * loader/appcache/ApplicationCacheStorage.cpp:
+        (WebCore::ApplicationCacheStorage::loadCacheGroup):
+        (WebCore::ApplicationCacheStorage::findOrCreateCacheGroup):
+        (WebCore::ApplicationCacheStorage::findInMemoryCacheGroup const):
+        (WebCore::ApplicationCacheStorage::cacheGroupForURL):
+        (WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL):
+        (WebCore::ApplicationCacheStorage::cacheGroupDestroyed):
+        (WebCore::ApplicationCacheStorage::cacheGroupMadeObsolete):
+        (WebCore::ApplicationCacheStorage::store):
+        (WebCore::ApplicationCacheStorage::deleteCacheForOrigin):
+        * loader/archive/ArchiveResourceCollection.cpp:
+        (WebCore::ArchiveResourceCollection::addAllResources):
+        (WebCore::ArchiveResourceCollection::addResource):
+        (WebCore::ArchiveResourceCollection::archiveResourceForURL):
+        * loader/cache/CachedCSSStyleSheet.cpp:
+        (WebCore::CachedCSSStyleSheet::didAddClient):
+        (WebCore::CachedCSSStyleSheet::checkNotify):
+        * loader/cache/CachedResourceLoader.cpp:
+        (WebCore::CachedResourceLoader::cachedResource const):
+        (WebCore::CachedResourceLoader::requestResource):
+        (WebCore::CachedResourceLoader::determineRevalidationPolicy const):
+        (WebCore::CachedResourceLoader::notifyFinished):
+        * loader/cache/CachedXSLStyleSheet.cpp:
+        (WebCore::CachedXSLStyleSheet::didAddClient):
+        (WebCore::CachedXSLStyleSheet::checkNotify):
+        * page/ContextMenuController.cpp:
+        (WebCore::ContextMenuController::checkOrEnableIfNeeded const):
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::setLocation):
+        (WebCore::DOMWindow::createWindow):
+        (WebCore::DOMWindow::open):
+        * page/Location.cpp:
+        (WebCore::Location::reload):
+        * page/PageSerializer.cpp:
+        (WebCore::PageSerializer::retrieveResourcesForProperties):
+        * page/SecurityOrigin.cpp:
+        (WebCore::SecurityOrigin::shouldIgnoreHost):
+        * page/SecurityPolicy.cpp:
+        (WebCore::SecurityPolicy::shouldInheritSecurityOriginFromOwner):
+        (WebCore::SecurityPolicy::isBaseURLSchemeAllowed):
+        * page/csp/ContentSecurityPolicy.cpp:
+        (WebCore::ContentSecurityPolicy::reportViolation const):
+        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
+        (WebCore::MediaPlayerPrivateAVFoundation::assetURL const):
+        * platform/network/BlobRegistryImpl.cpp:
+        (WebCore::BlobRegistryImpl::writeBlobToFilePath):
+        * platform/network/mac/ResourceErrorMac.mm:
+        (WebCore::ResourceError::platformLazyInit):
+        * storage/StorageEventDispatcher.cpp:
+        (WebCore::StorageEventDispatcher::dispatchSessionStorageEvents):
+        (WebCore::StorageEventDispatcher::dispatchLocalStorageEvents):
+        * svg/SVGImageLoader.cpp:
+        (WebCore::SVGImageLoader::sourceURI const):
+        * workers/WorkerScriptLoader.cpp:
+        (WebCore::WorkerScriptLoader::loadSynchronously):
+        * workers/service/ServiceWorkerRegistration.cpp:
+        (WebCore::ServiceWorkerRegistration::scope const):
+        * workers/service/ServiceWorkerRegistrationKey.cpp:
+        (WebCore::ServiceWorkerRegistrationKey::hash const):
+        (WebCore::ServiceWorkerRegistrationKey::isMatching const):
+        * workers/service/context/ServiceWorkerDebuggable.cpp:
+        (WebCore::ServiceWorkerDebuggable::ServiceWorkerDebuggable):
+        * workers/service/server/SWServer.cpp:
+        (WebCore::SWServer::startScriptFetch):
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::XMLHttpRequest::send):
+
 2020-04-25  Zalan Bujtas  <zalan@apple.com>
 
         [LFC][TFC] Add vertical-align: baseline support
index 66eae3f..ac4089a 100644 (file)
@@ -214,7 +214,7 @@ ExceptionOr<Ref<FetchRequest>> DOMCache::requestFromInfo(RequestInfo&& info, boo
     } else
         request = FetchRequest::create(*scriptExecutionContext(), WTFMove(info), { }).releaseReturnValue();
 
-    if (!protocolIsInHTTPFamily(request->url()))
+    if (!request->url().protocolIsInHTTPFamily())
         return Exception { TypeError, "Request url is not HTTP/HTTPS"_s };
 
     return request.releaseNonNull();
index dfb733e..efc1635 100644 (file)
@@ -300,7 +300,7 @@ String FetchRequest::referrer() const
 const String& FetchRequest::urlString() const
 {
     if (m_requestURL.isNull())
-        m_requestURL = m_request.url();
+        m_requestURL = m_request.url().string();
     return m_requestURL;
 }
 
index 05f49f8..22681c1 100644 (file)
@@ -236,7 +236,7 @@ void FetchResponse::fetch(ScriptExecutionContext& context, FetchRequest& request
         return;
     }
 
-    InspectorInstrumentation::willFetch(context, request.url());
+    InspectorInstrumentation::willFetch(context, request.url().string());
 
     auto response = adoptRef(*new FetchResponse(context, FetchBody { }, FetchHeaders::create(FetchHeaders::Guard::Immutable), { }));
 
index 89f3d84..a10950d 100644 (file)
@@ -175,7 +175,7 @@ ExceptionOr<Ref<WebSocket>> WebSocket::create(ScriptExecutionContext& context, c
     auto socket = adoptRef(*new WebSocket(context));
     socket->suspendIfNeeded();
 
-    auto result = socket->connect(context.completeURL(url), protocols);
+    auto result = socket->connect(context.completeURL(url).string(), protocols);
     if (result.hasException())
         return result.releaseException();
 
index c557978..bf20171 100644 (file)
@@ -173,7 +173,7 @@ LayoutRect AccessibilityImageMapLink::elementRect() const
     
 String AccessibilityImageMapLink::stringValueForMSAA() const
 {
-    return url();
+    return url().string();
 }
 
 String AccessibilityImageMapLink::nameForMSAA() const
index 94f3165..0f0e01d 100644 (file)
@@ -31,7 +31,7 @@
 #include <wtf/Brigand.h>
 #include <wtf/HashMap.h>
 #include <wtf/StdLibExtras.h>
-#include <wtf/text/WTFString.h>
+#include <wtf/URL.h>
 
 #if ENABLE(WEBGL)
 #include "WebGLAny.h"
@@ -132,6 +132,7 @@ template<typename StringType> struct IDLString : IDLType<StringType> {
     static bool isNullValue(const StringType& value) { return value.isNull(); }
     static bool isNullValue(const UncachedString& value) { return value.string.isNull(); }
     static bool isNullValue(const OwnedString& value) { return value.string.isNull(); }
+    static bool isNullValue(const URL& value) { return value.isNull(); }
     template <typename U> static U&& extractValueFromNullable(U&& value) { return std::forward<U>(value); }
 };
 struct IDLDOMString : IDLString<String> { };
index ae444c6..0e801fc 100644 (file)
@@ -48,7 +48,7 @@ public:
 
 private:
     CachedScriptSourceProvider(CachedScript* cachedScript, JSC::SourceProviderSourceType sourceType, Ref<CachedScriptFetcher>&& scriptFetcher)
-        : SourceProvider(JSC::SourceOrigin { cachedScript->response().url(), WTFMove(scriptFetcher) }, URL(cachedScript->response().url()), TextPosition(), sourceType)
+        : SourceProvider(JSC::SourceOrigin { cachedScript->response().url().string(), WTFMove(scriptFetcher) }, URL(cachedScript->response().url()), TextPosition(), sourceType)
         , m_cachedScript(cachedScript)
     {
         m_cachedScript->addClient(*this);
index 9798f57..cbaefbc 100644 (file)
@@ -75,6 +75,11 @@ template<> struct JSConverter<IDLDOMString> {
     {
         return JSC::jsOwnedString(JSC::getVM(&lexicalGlobalObject), value.string);
     }
+
+    static JSC::JSValue convert(JSC::JSGlobalObject& lexicalGlobalObject, const URL& value)
+    {
+        return JSC::jsOwnedString(JSC::getVM(&lexicalGlobalObject), value.string());
+    }
 };
 
 template<> struct Converter<IDLByteString> : DefaultConverter<IDLByteString> {
@@ -109,6 +114,10 @@ template<> struct Converter<IDLUSVString> : DefaultConverter<IDLUSVString> {
     {
         return valueToUSVString(lexicalGlobalObject, value);
     }
+    static JSC::JSValue convert(JSC::JSGlobalObject& lexicalGlobalObject, const URL& value)
+    {
+        return JSC::jsOwnedString(JSC::getVM(&lexicalGlobalObject), value.string());
+    }
 };
 
 template<> struct JSConverter<IDLUSVString> {
@@ -129,6 +138,11 @@ template<> struct JSConverter<IDLUSVString> {
     {
         return JSC::jsOwnedString(JSC::getVM(&lexicalGlobalObject), value.string);
     }
+
+    static JSC::JSValue convert(JSC::JSGlobalObject& lexicalGlobalObject, const URL& value)
+    {
+        return JSC::jsOwnedString(JSC::getVM(&lexicalGlobalObject), value.string());
+    }
 };
 
 // MARK: -
index 81a7c5f..3a48022 100644 (file)
@@ -126,7 +126,7 @@ ValueOrException ScriptController::evaluateInWorld(const ScriptSourceCode& sourc
     JSLockHolder lock(world.vm());
 
     const SourceCode& jsSourceCode = sourceCode.jsSourceCode();
-    String sourceURL = jsSourceCode.provider()->url();
+    String sourceURL = jsSourceCode.provider()->url().string();
 
     // evaluate code. Returns the JS return value or 0
     // if there was none, an error occurred or the type couldn't be converted.
@@ -240,7 +240,7 @@ JSC::JSValue ScriptController::evaluateModule(const URL& sourceURL, JSModuleReco
 
     Ref<Frame> protector(m_frame);
 
-    InspectorInstrumentation::willEvaluateScript(m_frame, sourceURL, jsSourceCode.firstLine().oneBasedInt(), jsSourceCode.startColumn().oneBasedInt());
+    InspectorInstrumentation::willEvaluateScript(m_frame, sourceURL.string(), jsSourceCode.firstLine().oneBasedInt(), jsSourceCode.startColumn().oneBasedInt());
     auto returnValue = moduleRecord.evaluate(&lexicalGlobalObject);
     InspectorInstrumentation::didEvaluateScript(m_frame);
 
@@ -642,7 +642,7 @@ ValueOrException ScriptController::callInWorld(RunJavaScriptParameters&& paramet
     auto sourceCode = ScriptSourceCode { functionStringBuilder.toString(), URL(m_frame.document()->url()), TextPosition(), JSC::SourceProviderSourceType::Program, CachedScriptFetcher::create(m_frame.document()->charset()) };
     const auto& jsSourceCode = sourceCode.jsSourceCode();
 
-    String sourceURL = jsSourceCode.provider()->url();
+    String sourceURL = jsSourceCode.provider()->url().string();
     const String* savedSourceURL = m_sourceURL;
     m_sourceURL = &sourceURL;
 
@@ -806,13 +806,13 @@ bool ScriptController::canExecuteScripts(ReasonForCallingCanExecuteScripts reaso
 
 bool ScriptController::executeIfJavaScriptURL(const URL& url, RefPtr<SecurityOrigin> requesterSecurityOrigin, ShouldReplaceDocumentIfJavaScriptURL shouldReplaceDocumentIfJavaScriptURL)
 {
-    if (!WTF::protocolIsJavaScript(url))
+    if (!url.protocolIsJavaScript())
         return false;
 
     if (requesterSecurityOrigin && !requesterSecurityOrigin->canAccess(m_frame.document()->securityOrigin()))
         return true;
 
-    if (!m_frame.page() || !m_frame.document()->contentSecurityPolicy()->allowJavaScriptURLs(m_frame.document()->url(), eventHandlerPosition().m_line))
+    if (!m_frame.page() || !m_frame.document()->contentSecurityPolicy()->allowJavaScriptURLs(m_frame.document()->url().string(), eventHandlerPosition().m_line))
         return true;
 
     // We need to hold onto the Frame here because executing script can
index ffa295e..b523038 100644 (file)
@@ -1143,8 +1143,8 @@ private:
             }
             if (auto* blob = JSBlob::toWrapped(vm, obj)) {
                 write(BlobTag);
-                m_blobURLs.append(blob->url());
-                write(blob->url());
+                m_blobURLs.append(blob->url().string());
+                write(blob->url().string());
                 write(blob->type());
                 write(blob->size());
                 return true;
@@ -1445,9 +1445,9 @@ private:
 
     void write(const File& file)
     {
-        m_blobURLs.append(file.url());
+        m_blobURLs.append(file.url().string());
         write(file.path());
-        write(file.url());
+        write(file.url().string());
         write(file.type());
         write(file.name());
         write(static_cast<double>(file.lastModifiedOverride().valueOr(-1)));
index af9347a..82dd0e8 100644 (file)
@@ -66,7 +66,7 @@ SVGCursorElement* CSSCursorImageValue::updateCursorElement(const Document& docum
     if (!m_originalURL.hasFragmentIdentifier())
         return nullptr;
 
-    auto element = SVGURIReference::targetElementFromIRIString(m_originalURL, document).element;
+    auto element = SVGURIReference::targetElementFromIRIString(m_originalURL.string(), document).element;
     if (!is<SVGCursorElement>(element))
         return nullptr;
 
index 0acb47c..c0f5a16 100644 (file)
@@ -94,13 +94,13 @@ bool CSSImageValue::equals(const CSSImageValue& other) const
 
 String CSSImageValue::customCSSText() const
 {
-    return serializeURL(m_url);
+    return serializeURL(m_url.string());
 }
 
 Ref<DeprecatedCSSOMValue> CSSImageValue::createDeprecatedCSSOMWrapper(CSSStyleDeclaration& styleDeclaration) const
 {
     // NOTE: We expose CSSImageValues as URI primitive values in CSSOM to maintain old behavior.
-    return DeprecatedCSSOMPrimitiveValue::create(CSSPrimitiveValue::create(m_url, CSSUnitType::CSS_URI), styleDeclaration);
+    return DeprecatedCSSOMPrimitiveValue::create(CSSPrimitiveValue::create(m_url.string(), CSSUnitType::CSS_URI), styleDeclaration);
 }
 
 bool CSSImageValue::knownToBeOpaque(const RenderElement& renderer) const
index e3e97ea..3b279fd 100644 (file)
@@ -4327,7 +4327,7 @@ static RefPtr<CSSValue> consumeFontFaceSrcURI(CSSParserTokenRange& range, const
     if (url.isNull())
         return nullptr;
 
-    RefPtr<CSSFontFaceSrcValue> uriValue = CSSFontFaceSrcValue::create(context.completeURL(url), context.isContentOpaque ? LoadedFromOpaqueSource::Yes : LoadedFromOpaqueSource::No);
+    RefPtr<CSSFontFaceSrcValue> uriValue = CSSFontFaceSrcValue::create(context.completeURL(url).string(), context.isContentOpaque ? LoadedFromOpaqueSource::Yes : LoadedFromOpaqueSource::No);
 
     if (range.peek().functionId() != CSSValueFormat)
         return uriValue;
index e4454e6..6f4af47 100644 (file)
@@ -3607,7 +3607,7 @@ void Document::processHttpEquiv(const String& equiv, const String& content, bool
                 completedURL = m_url;
             else
                 completedURL = completeURL(urlString);
-            if (!WTF::protocolIsJavaScript(completedURL))
+            if (!completedURL.protocolIsJavaScript())
                 frame->navigationScheduler().scheduleRedirect(*this, delay, completedURL);
             else {
                 String message = "Refused to refresh " + m_url.stringCenterEllipsizedToLength() + " to a javascript: URL";
index 3ed4a35..8158e55 100644 (file)
@@ -59,7 +59,7 @@ ExtensionStyleSheets::ExtensionStyleSheets(Document& document)
 
 static Ref<CSSStyleSheet> createExtensionsStyleSheet(Document& document, URL url, const String& text, UserStyleLevel level)
 {
-    auto contents = StyleSheetContents::create(url, CSSParserContext(document, url));
+    auto contents = StyleSheetContents::create(url.string(), CSSParserContext(document, url));
     auto styleSheet = CSSStyleSheet::create(contents.get(), document, true);
 
     contents->setIsUserStyleSheet(level == UserStyleUserLevel);
index 9f779f9..fb29590 100644 (file)
@@ -169,7 +169,7 @@ void InlineStyleSheetOwner::createSheet(Element& element, const String& text)
     ASSERT(document.contentSecurityPolicy());
     const ContentSecurityPolicy& contentSecurityPolicy = *document.contentSecurityPolicy();
     bool hasKnownNonce = contentSecurityPolicy.allowStyleWithNonce(element.attributeWithoutSynchronization(HTMLNames::nonceAttr), element.isInUserAgentShadowTree());
-    if (!contentSecurityPolicy.allowInlineStyle(document.url(), m_startTextPosition.m_line, text, hasKnownNonce))
+    if (!contentSecurityPolicy.allowInlineStyle(document.url().string(), m_startTextPosition.m_line, text, hasKnownNonce))
         return;
 
     auto mediaQueries = MediaQuerySet::create(m_media, MediaQueryParserContext(document));
index 64d2e4f..49ab721 100644 (file)
@@ -363,7 +363,7 @@ bool ScriptElement::requestModuleScript(const TextPosition& scriptStartPosition)
     ASSERT(m_element.document().contentSecurityPolicy());
     const auto& contentSecurityPolicy = *m_element.document().contentSecurityPolicy();
     bool hasKnownNonce = contentSecurityPolicy.allowScriptWithNonce(nonce, m_element.isInUserAgentShadowTree());
-    if (!contentSecurityPolicy.allowInlineScript(m_element.document().url(), m_startLineNumber, sourceCode.source().toStringWithoutCopying(), hasKnownNonce))
+    if (!contentSecurityPolicy.allowInlineScript(m_element.document().url().string(), m_startLineNumber, sourceCode.source().toStringWithoutCopying(), hasKnownNonce))
         return false;
 
     script->load(m_element.document(), sourceCode);
@@ -383,7 +383,7 @@ void ScriptElement::executeClassicScript(const ScriptSourceCode& sourceCode)
         ASSERT(m_element.document().contentSecurityPolicy());
         const ContentSecurityPolicy& contentSecurityPolicy = *m_element.document().contentSecurityPolicy();
         bool hasKnownNonce = contentSecurityPolicy.allowScriptWithNonce(m_element.attributeWithoutSynchronization(HTMLNames::nonceAttr), m_element.isInUserAgentShadowTree());
-        if (!contentSecurityPolicy.allowInlineScript(m_element.document().url(), m_startLineNumber, sourceCode.source().toStringWithoutCopying(), hasKnownNonce))
+        if (!contentSecurityPolicy.allowInlineScript(m_element.document().url().string(), m_startLineNumber, sourceCode.source().toStringWithoutCopying(), hasKnownNonce))
             return;
     }
 
index a42baa6..7eef4ba 100644 (file)
@@ -200,7 +200,7 @@ void StyledElement::styleAttributeChanged(const AtomString& newStyleString, Attr
         if (PropertySetCSSStyleDeclaration* cssomWrapper = inlineStyleCSSOMWrapper())
             cssomWrapper->clearParentElement();
         ensureUniqueElementData().m_inlineStyle = nullptr;
-    } else if (reason == ModifiedByCloning || document().contentSecurityPolicy()->allowInlineStyle(document().url(), startLineNumber, String(), isInUserAgentShadowTree()))
+    } else if (reason == ModifiedByCloning || document().contentSecurityPolicy()->allowInlineStyle(document().url().string(), startLineNumber, String(), isInUserAgentShadowTree()))
         setInlineStyleFromString(newStyleString);
 
     elementData()->setStyleAttributeIsDirty(false);
index fa61c5c..bbfbc68 100644 (file)
@@ -452,7 +452,7 @@ static String sanitizeMarkupWithArchive(Frame& frame, Document& destinationDocum
     auto page = createPageForSanitizingWebContent();
     Document* stagingDocument = page->mainFrame().document();
     ASSERT(stagingDocument);
-    auto fragment = createFragmentFromMarkup(*stagingDocument, markupAndArchive.markup, markupAndArchive.mainResource->url(), DisallowScriptingAndPluginContent);
+    auto fragment = createFragmentFromMarkup(*stagingDocument, markupAndArchive.markup, markupAndArchive.mainResource->url().string(), DisallowScriptingAndPluginContent);
 
     if (shouldReplaceRichContentWithAttachments()) {
         replaceRichContentWithAttachments(frame, fragment, markupAndArchive.archive->subresources());
@@ -515,21 +515,21 @@ bool WebContentReader::readWebArchive(SharedBuffer& buffer)
         return false;
     
     if (!RuntimeEnabledFeatures::sharedFeatures().customPasteboardDataEnabled()) {
-        fragment = createFragmentFromMarkup(*frame.document(), result->markup, result->mainResource->url(), DisallowScriptingAndPluginContent);
+        fragment = createFragmentFromMarkup(*frame.document(), result->markup, result->mainResource->url().string(), DisallowScriptingAndPluginContent);
         if (DocumentLoader* loader = frame.loader().documentLoader())
             loader->addAllArchiveResources(result->archive.get());
         return true;
     }
 
     if (!shouldSanitize()) {
-        fragment = createFragmentFromMarkup(*frame.document(), result->markup, result->mainResource->url(), DisallowScriptingAndPluginContent);
+        fragment = createFragmentFromMarkup(*frame.document(), result->markup, result->mainResource->url().string(), DisallowScriptingAndPluginContent);
         return true;
     }
 
     String sanitizedMarkup = sanitizeMarkupWithArchive(frame, *frame.document(), *result, msoListQuirksForMarkup(), [&] (const String& type) {
         return frame.loader().client().canShowMIMETypeAsHTML(type);
     });
-    fragment = createFragmentFromMarkup(*frame.document(), sanitizedMarkup, aboutBlankURL(), DisallowScriptingAndPluginContent);
+    fragment = createFragmentFromMarkup(*frame.document(), sanitizedMarkup, aboutBlankURL().string(), DisallowScriptingAndPluginContent);
 
     if (!fragment)
         return false;
index e0d7fe7..46f8547 100644 (file)
@@ -114,8 +114,8 @@ String HTMLFormControlElement::formAction() const
 {
     const AtomString& value = attributeWithoutSynchronization(formactionAttr);
     if (value.isEmpty())
-        return document().url();
-    return getURLAttribute(formactionAttr);
+        return document().url().string();
+    return getURLAttribute(formactionAttr).string();
 }
 
 void HTMLFormControlElement::setFormAction(const AtomString& value)
index 4f4da82..24d9e1f 100644 (file)
@@ -72,7 +72,7 @@ bool HTMLFrameElementBase::canLoadURL(const String& relativeURL) const
 // Note that unlike HTMLPlugInImageElement::canLoadURL this uses ScriptController::canAccessFromCurrentOrigin.
 bool HTMLFrameElementBase::canLoadURL(const URL& completeURL) const
 {
-    if (WTF::protocolIsJavaScript(completeURL)) {
+    if (completeURL.protocolIsJavaScript()) {
         RefPtr<Document> contentDocument = this->contentDocument();
         if (contentDocument && !ScriptController::canAccessFromCurrentOrigin(contentDocument->frame(), document()))
             return false;
index f680a2e..2b9daaa 100644 (file)
@@ -211,7 +211,7 @@ void HTMLLinkElement::parseAttribute(const QualifiedName& name, const AtomString
 bool HTMLLinkElement::shouldLoadLink()
 {
     Ref<Document> originalDocument = document();
-    if (!dispatchBeforeLoadEvent(getNonEmptyURLAttribute(hrefAttr)))
+    if (!dispatchBeforeLoadEvent(getNonEmptyURLAttribute(hrefAttr).string()))
         return false;
     // A beforeload handler might have removed us from the document or changed the document.
     if (!isConnected() || &document() != originalDocument.ptr())
index 96b8b0e..fab6b76 100644 (file)
@@ -4591,7 +4591,7 @@ URL HTMLMediaElement::selectNextSourceChild(ContentType* contentType, String* ke
 
         type = source->attributeWithoutSynchronization(typeAttr);
         if (type.isEmpty() && mediaURL.protocolIsData())
-            type = mimeTypeFromDataURL(mediaURL);
+            type = mimeTypeFromDataURL(mediaURL.string());
         if (!type.isEmpty()) {
             if (shouldLog)
                 INFO_LOG(LOGIDENTIFIER, "'type' is ", type);
index b174b1f..60cb4fe 100644 (file)
@@ -163,7 +163,7 @@ bool HTMLPlugInImageElement::canLoadURL(const String& relativeURL) const
 // Note that unlike HTMLFrameElementBase::canLoadURL this uses SecurityOrigin::canAccess.
 bool HTMLPlugInImageElement::canLoadURL(const URL& completeURL) const
 {
-    if (WTF::protocolIsJavaScript(completeURL)) {
+    if (completeURL.protocolIsJavaScript()) {
         RefPtr<Document> contentDocument = this->contentDocument();
         if (contentDocument && !document().securityOrigin().canAccess(contentDocument->securityOrigin()))
             return false;
index f6dc3ea..37ea741 100644 (file)
@@ -376,7 +376,7 @@ std::unique_ptr<XSSInfo> XSSAuditor::filterToken(const FilterTokenRequest& reque
         return nullptr;
 
     bool didBlockEntirePage = m_xssProtection == XSSProtectionDisposition::BlockEnabled;
-    return makeUnique<XSSInfo>(m_documentURL, didBlockEntirePage, m_didSendValidXSSProtectionHeader);
+    return makeUnique<XSSInfo>(m_documentURL.string(), didBlockEntirePage, m_didSendValidXSSProtectionHeader);
 }
 
 bool XSSAuditor::filterStartToken(const FilterTokenRequest& request)
index 1b3b4bd..00148e0 100644 (file)
@@ -69,7 +69,7 @@ ExceptionOr<Vector<InspectorAuditResourcesObject::Resource>> InspectorAuditResou
 
     for (auto* cachedResource : InspectorPageAgent::cachedResourcesForFrame(frame)) {
         Resource resource;
-        resource.url = cachedResource->url();
+        resource.url = cachedResource->url().string();
         resource.mimeType = cachedResource->mimeType();
 
         bool exists = false;
index d113beb..eaab064 100644 (file)
@@ -461,7 +461,7 @@ static Ref<JSON::ArrayOf<Inspector::Protocol::CSS::Grouping>> buildArrayForGroup
 
         if (ruleGroupingPayload) {
             if (auto* parentStyleSheet = parentRule->parentStyleSheet()) {
-                String sourceURL = parentStyleSheet->contents().baseURL();
+                String sourceURL = parentStyleSheet->contents().baseURL().string();
                 if (sourceURL.isEmpty()) {
                     if (auto* ownerDocument = parentStyleSheet->ownerDocument())
                         sourceURL = InspectorDOMAgent::documentURLString(ownerDocument);
@@ -489,9 +489,9 @@ static Ref<JSON::ArrayOf<Inspector::Protocol::CSS::Grouping>> buildArrayForGroup
 
                 String sourceURL;
                 if (auto* ownerDocument = styleSheet->ownerDocument())
-                    sourceURL = ownerDocument->url();
+                    sourceURL = ownerDocument->url().string();
                 else if (!styleSheet->contents().baseURL().isEmpty())
-                    sourceURL = styleSheet->contents().baseURL();
+                    sourceURL = styleSheet->contents().baseURL().string();
                 if (!sourceURL.isEmpty())
                     sheetGroupingPayload->setSourceURL(sourceURL);
 
index fd7cad3..7b59670 100644 (file)
@@ -157,7 +157,7 @@ void NetworkResourcesData::responseReceived(const String& requestId, const Strin
         return;
 
     resourceData->setFrameId(frameId);
-    resourceData->setURL(response.url());
+    resourceData->setURL(response.url().string());
     resourceData->setHTTPStatusCode(response.httpStatusCode());
     resourceData->setType(type);
     resourceData->setForceBufferData(forceBufferData);
index 0a0bad0..16fe745 100644 (file)
@@ -398,7 +398,7 @@ RefPtr<Inspector::Protocol::Network::Response> InspectorNetworkAgent::buildObjec
 Ref<Inspector::Protocol::Network::CachedResource> InspectorNetworkAgent::buildObjectForCachedResource(CachedResource* cachedResource)
 {
     auto resourceObject = Inspector::Protocol::Network::CachedResource::create()
-        .setUrl(cachedResource->url())
+        .setUrl(cachedResource->url().string())
         .setType(InspectorPageAgent::cachedResourceTypeJSON(*cachedResource))
         .setBodySize(cachedResource->encodedSize())
         .release();
@@ -458,7 +458,7 @@ void InspectorNetworkAgent::willSendRequest(unsigned long identifier, DocumentLo
     Document* document = loader && loader->frame() ? loader->frame()->document() : nullptr;
     auto initiatorObject = buildInitiatorObject(document, request);
 
-    String url = loader ? loader->url().string() : request.url();
+    String url = loader ? loader->url().string() : request.url().string();
     m_frontendDispatcher->requestWillBeSent(requestId, frameId, loaderId, url, buildObjectForResourceRequest(request), sendTimestamp, walltime.secondsSinceEpoch().seconds(), initiatorObject, buildObjectForResourceResponse(redirectResponse, nullptr), type != InspectorPageAgent::OtherResource ? &protocolResourceType : nullptr, targetId.isEmpty() ? nullptr : &targetId);
 }
 
index 3e8680e..30ebdd3 100644 (file)
@@ -530,7 +530,7 @@ void InspectorPageAgent::getCookies(ErrorString&, RefPtr<JSON::ArrayOf<Inspector
 
         for (auto& url : allResourcesURLsForFrame(frame)) {
             Vector<Cookie> rawCookiesForURLInDocument;
-            if (!document->page()->cookieJar().getRawCookies(*document, URL({ }, url), rawCookiesForURLInDocument))
+            if (!document->page()->cookieJar().getRawCookies(*document, url, rawCookiesForURLInDocument))
                 continue;
 
             for (auto& rawCookieForURLInDocument : rawCookiesForURLInDocument)
@@ -723,7 +723,7 @@ void InspectorPageAgent::searchInResources(ErrorString&, const String& text, con
             if (auto textContent = InspectorNetworkAgent::textContentForCachedResource(*cachedResource)) {
                 int matchesCount = ContentSearchUtilities::countRegularExpressionMatches(regex, *textContent);
                 if (matchesCount)
-                    result->addItem(buildObjectForSearchResult(frameId(frame), cachedResource->url(), matchesCount));
+                    result->addItem(buildObjectForSearchResult(frameId(frame), cachedResource->url().string(), matchesCount));
             }
         }
     }
@@ -924,7 +924,7 @@ Ref<Inspector::Protocol::Page::FrameResourceTree> InspectorPageAgent::buildObjec
 
     for (auto* cachedResource : cachedResourcesForFrame(frame)) {
         auto resourceObject = Inspector::Protocol::Page::FrameResource::create()
-            .setUrl(cachedResource->url())
+            .setUrl(cachedResource->url().string())
             .setType(cachedResourceTypeJSON(*cachedResource))
             .setMimeType(cachedResource->response().mimeType())
             .release();
index 5b7d17a..29d8a2b 100644 (file)
@@ -160,7 +160,7 @@ void InspectorWorkerAgent::connectToWorkerInspectorProxy(WorkerInspectorProxy* p
 
     m_connectedProxies.set(proxy->identifier(), proxy);
 
-    m_frontendDispatcher->workerCreated(proxy->identifier(), proxy->url());
+    m_frontendDispatcher->workerCreated(proxy->identifier(), proxy->url().string());
 }
 
 void InspectorWorkerAgent::disconnectFromWorkerInspectorProxy(WorkerInspectorProxy* proxy)
index 32994a3..fbc8128 100644 (file)
@@ -85,7 +85,7 @@ void WebConsoleAgent::didFailLoading(unsigned long requestIdentifier, const Reso
         message.append(error.localizedDescription());
     }
 
-    addMessageToConsole(makeUnique<ConsoleMessage>(MessageSource::Network, MessageType::Log, MessageLevel::Error, message.toString(), error.failingURL(), 0, 0, nullptr, requestIdentifier));
+    addMessageToConsole(makeUnique<ConsoleMessage>(MessageSource::Network, MessageType::Log, MessageLevel::Error, message.toString(), error.failingURL().string(), 0, 0, nullptr, requestIdentifier));
 }
 
 } // namespace WebCore
index 47a9c5a..18a60c3 100644 (file)
@@ -59,7 +59,7 @@ void ServiceWorkerAgent::getInitializationInfo(ErrorString&, RefPtr<Inspector::P
     info = Inspector::Protocol::ServiceWorker::Configuration::create()
         .setTargetId(m_serviceWorkerGlobalScope.identifier())
         .setSecurityOrigin(m_serviceWorkerGlobalScope.securityOrigin()->toRawString())
-        .setUrl(m_serviceWorkerGlobalScope.thread().contextData().scriptURL)
+        .setUrl(m_serviceWorkerGlobalScope.thread().contextData().scriptURL.string())
         .setContent(m_serviceWorkerGlobalScope.thread().contextData().script)
         .release();
 }
index a2d5d10..24fabb4 100644 (file)
@@ -1511,7 +1511,7 @@ Vector<Ref<ArchiveResource>> DocumentLoader::subresources() const
 
     Vector<Ref<ArchiveResource>> subresources;
     for (auto& handle : m_cachedResourceLoader->allCachedResources().values()) {
-        if (auto subresource = this->subresource({ { }, handle->url() }))
+        if (auto subresource = this->subresource(handle->url()))
             subresources.append(subresource.releaseNonNull());
     }
     return subresources;
index cc9d1c1..c049234 100644 (file)
@@ -267,11 +267,11 @@ public:
     // item were created. This allows WebKit to link history items reflecting
     // redirects into a chain from start to finish.
     String clientRedirectSourceForHistory() const { return m_clientRedirectSourceForHistory; } // null if no client redirect occurred.
-    String clientRedirectDestinationForHistory() const { return urlForHistory(); }
+    String clientRedirectDestinationForHistory() const { return urlForHistory().string(); }
     void setClientRedirectSourceForHistory(const String& clientRedirectSourceForHistory) { m_clientRedirectSourceForHistory = clientRedirectSourceForHistory; }
     
     String serverRedirectSourceForHistory() const { return (urlForHistory() == url() || url() == aboutBlankURL()) ? String() : urlForHistory().string(); } // null if no server redirect occurred.
-    String serverRedirectDestinationForHistory() const { return url(); }
+    String serverRedirectDestinationForHistory() const { return url().string(); }
 
     bool didCreateGlobalHistoryEntry() const { return m_didCreateGlobalHistoryEntry; }
     void setDidCreateGlobalHistoryEntry(bool didCreateGlobalHistoryEntry) { m_didCreateGlobalHistoryEntry = didCreateGlobalHistoryEntry; }
index 3241705..5c1ca3e 100644 (file)
@@ -469,7 +469,7 @@ void FrameLoader::submitForm(Ref<FormSubmission>&& submission)
         return;
     }
 
-    if (WTF::protocolIsJavaScript(submission->action())) {
+    if (submission->action().protocolIsJavaScript()) {
         if (!m_frame.document()->contentSecurityPolicy()->allowFormAction(URL(submission->action())))
             return;
         m_isExecutingJavaScriptFormAction = true;
@@ -736,7 +736,7 @@ void FrameLoader::receivedFirstData()
     if (!parseMetaHTTPEquivRefresh(documentLoader.response().httpHeaderField(HTTPHeaderName::Refresh), delay, urlString))
         return;
     auto completedURL = urlString.isEmpty() ? document.url() : document.completeURL(urlString);
-    if (!WTF::protocolIsJavaScript(completedURL))
+    if (!completedURL.protocolIsJavaScript())
         m_frame.navigationScheduler().scheduleRedirect(document, delay, completedURL);
     else {
         auto message = "Refused to refresh " + document.url().stringCenterEllipsizedToLength() + " to a javascript: URL";
@@ -1191,7 +1191,7 @@ void FrameLoader::loadInSameDocument(const URL& url, SerializedScriptValue* stat
     m_client->dispatchDidPopStateWithinPage();
     
     if (hashChange) {
-        m_frame.document()->enqueueHashchangeEvent(oldURL, url);
+        m_frame.document()->enqueueHashchangeEvent(oldURL.string(), url.string());
         m_client->dispatchDidChangeLocationWithinPage();
     }
     
@@ -3558,7 +3558,7 @@ void FrameLoader::loadedResourceFromMemoryCache(CachedResource& resource, Resour
     if (!page)
         return;
 
-    if (!resource.shouldSendResourceLoadCallbacks() || m_documentLoader->haveToldClientAboutLoad(resource.url()))
+    if (!resource.shouldSendResourceLoadCallbacks() || m_documentLoader->haveToldClientAboutLoad(resource.url().string()))
         return;
 
     // Main resource delegate messages are synthesized in MainResourceLoader, so we must not send them here.
@@ -3568,13 +3568,13 @@ void FrameLoader::loadedResourceFromMemoryCache(CachedResource& resource, Resour
     if (!page->areMemoryCacheClientCallsEnabled()) {
         InspectorInstrumentation::didLoadResourceFromMemoryCache(*page, m_documentLoader.get(), &resource);
         m_documentLoader->recordMemoryCacheLoadForFutureClientNotification(resource.resourceRequest());
-        m_documentLoader->didTellClientAboutLoad(resource.url());
+        m_documentLoader->didTellClientAboutLoad(resource.url().string());
         return;
     }
 
     if (m_client->dispatchDidLoadResourceFromMemoryCache(m_documentLoader.get(), newRequest, resource.response(), resource.encodedSize())) {
         InspectorInstrumentation::didLoadResourceFromMemoryCache(*page, m_documentLoader.get(), &resource);
-        m_documentLoader->didTellClientAboutLoad(resource.url());
+        m_documentLoader->didTellClientAboutLoad(resource.url().string());
         return;
     }
 
@@ -4052,7 +4052,7 @@ RefPtr<Frame> createWindow(Frame& openerFrame, Frame& lookupFrame, FrameLoadRequ
     created = false;
 
     // FIXME: Provide line number information with respect to the opener's document.
-    if (WTF::protocolIsJavaScript(request.resourceRequest().url()) && !openerFrame.document()->contentSecurityPolicy()->allowJavaScriptURLs(openerFrame.document()->url(), { }))
+    if (request.resourceRequest().url().protocolIsJavaScript() && !openerFrame.document()->contentSecurityPolicy()->allowJavaScriptURLs(openerFrame.document()->url().string(), { }))
         return nullptr;
 
     if (!request.frameName().isEmpty() && !equalIgnoringASCIICase(request.frameName(), "_blank")) {
index af76eab..519cf7b 100644 (file)
@@ -614,7 +614,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(), aboutBlankURL());
+    return m_currentItem && !m_previousItem && equalIgnoringASCIICase(m_currentItem->urlString(), aboutBlankURL().string());
 }
 
 void HistoryController::clearPreviousItem()
index d4d2a54..c9b4396 100644 (file)
@@ -203,7 +203,7 @@ void ImageLoader::updateFromElement()
             newImage = new CachedImage(WTFMove(request), page->sessionID(), &page->cookieJar());
             newImage->setStatus(CachedResource::Pending);
             newImage->setLoading(true);
-            document.cachedResourceLoader().m_documentResources.set(newImage->url(), newImage.get());
+            document.cachedResourceLoader().m_documentResources.set(newImage->url().string(), newImage.get());
             document.cachedResourceLoader().setAutoLoadImages(autoLoadOtherImages);
         } else {
             if (m_lazyImageLoadState == LazyImageLoadState::None && isImageElement) {
@@ -507,7 +507,7 @@ void ImageLoader::dispatchPendingBeforeLoadEvent()
         return;
     m_hasPendingBeforeLoadEvent = false;
     Ref<Document> originalDocument = element().document();
-    if (element().dispatchBeforeLoadEvent(m_image->url())) {
+    if (element().dispatchBeforeLoadEvent(m_image->url().string())) {
         bool didEventListenerDisconnectThisElement = !element().isConnected() || &element().document() != originalDocument.ptr();
         if (didEventListenerDisconnectThisElement)
             return;
index 54be35f..575b9a8 100644 (file)
@@ -248,9 +248,9 @@ std::unique_ptr<LinkPreloadResourceClient> LinkLoader::preloadIfNeeded(const Lin
     if (RuntimeEnabledFeatures::sharedFeatures().linkPreloadResponsiveImagesEnabled() && type == CachedResource::Type::ImageResource && !params.imageSrcSet.isEmpty()) {
         auto sourceSize = SizesAttributeParser(params.imageSizes, document).length();
         auto candidate = bestFitSourceForImageAttributes(document.deviceScaleFactor(), params.href.string(), params.imageSrcSet, sourceSize);
-        url = document.completeURL(URL({ }, candidate.string.toString()));
+        url = document.completeURL(URL({ }, candidate.string.toString()).string());
     } else
-        url = document.completeURL(params.href);
+        url = document.completeURL(params.href.string());
 
     if (!url.isValid()) {
         if (params.imageSrcSet.isEmpty())
@@ -305,7 +305,7 @@ void LinkLoader::prefetchIfNeeded(const LinkLoadParameters& params, Document& do
     options.mode = FetchOptions::Mode::Navigate;
     options.serviceWorkersMode = ServiceWorkersMode::None;
     options.cachingPolicy = CachingPolicy::DisallowCaching;
-    m_cachedLinkResource = document.cachedResourceLoader().requestLinkResource(type, CachedResourceRequest(ResourceRequest { document.completeURL(params.href) }, options, priority)).value_or(nullptr);
+    m_cachedLinkResource = document.cachedResourceLoader().requestLinkResource(type, CachedResourceRequest(ResourceRequest { document.completeURL(params.href.string()) }, options, priority)).value_or(nullptr);
     if (m_cachedLinkResource)
         m_cachedLinkResource->addClient(*this);
 }
index 3461241..a7b6bf6 100644 (file)
@@ -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 (WTF::protocolIsJavaScript(url))
+    if (url.protocolIsJavaScript())
         return;
 
     if (!isMixedContent(securityOrigin, url))
index 59f6d58..b8e7157 100644 (file)
@@ -401,7 +401,7 @@ inline bool NavigationScheduler::shouldScheduleNavigation(const URL& url) const
 {
     if (!shouldScheduleNavigation())
         return false;
-    if (WTF::protocolIsJavaScript(url))
+    if (url.protocolIsJavaScript())
         return true;
     return NavigationDisabler::isNavigationAllowed(m_frame);
 }
@@ -453,7 +453,7 @@ void NavigationScheduler::scheduleLocationChange(Document& initiatingDocument, S
     // If the URL we're going to navigate to is the same as the current one, except for the
     // fragment part, we don't need to schedule the location change.
     if (url.hasFragmentIdentifier() && equalIgnoringFragmentIdentifier(m_frame.document()->url(), url)) {
-        ResourceRequest resourceRequest { m_frame.document()->completeURL(url), referrer, ResourceRequestCachePolicy::UseProtocolCachePolicy };
+        ResourceRequest resourceRequest { m_frame.document()->completeURL(url.string()), referrer, ResourceRequestCachePolicy::UseProtocolCachePolicy };
         auto* frame = lexicalFrameFromCommonVM();
         auto initiatedByMainFrame = frame && frame->isMainFrame() ? InitiatedByMainFrame::Yes : InitiatedByMainFrame::Unknown;
         
index 38b9924..d1b3567 100644 (file)
@@ -86,7 +86,7 @@ void PingLoader::loadImage(Frame& frame, const URL& url)
     auto& document = *frame.document();
 
     if (!document.securityOrigin().canDisplay(url)) {
-        FrameLoader::reportLocalLoadFailed(&frame, url);
+        FrameLoader::reportLocalLoadFailed(&frame, url.string());
         return;
     }
 
@@ -141,9 +141,9 @@ void PingLoader::sendPing(Frame& frame, const URL& pingURL, const URL& destinati
         request.setHTTPOrigin(origin);
     }
     frame.loader().addExtraFieldsToRequest(request, IsMainResource::No);
-    request.setHTTPHeaderField(HTTPHeaderName::PingTo, destinationURL);
+    request.setHTTPHeaderField(HTTPHeaderName::PingTo, destinationURL.string());
     if (!SecurityPolicy::shouldHideReferrer(pingURL, frame.loader().outgoingReferrer()))
-        request.setHTTPHeaderField(HTTPHeaderName::PingFrom, document.url());
+        request.setHTTPHeaderField(HTTPHeaderName::PingFrom, document.url().string());
 
     startPingLoad(frame, request, WTFMove(originalRequestHeader), ShouldFollowRedirects::Yes, ContentSecurityPolicyImposition::DoPolicyCheck, ReferrerPolicy::NoReferrer);
 }
index 0b6f788..73e7ac8 100644 (file)
@@ -131,7 +131,7 @@ void ResourceLoadNotifier::dispatchWillSendRequest(DocumentLoader* loader, unsig
 
     ASSERT(m_frame.loader().documentLoader());
     if (m_frame.loader().documentLoader())
-        m_frame.loader().documentLoader()->didTellClientAboutLoad(request.url());
+        m_frame.loader().documentLoader()->didTellClientAboutLoad(request.url().string());
 
     if (auto* page = m_frame.page()) {
         if (!page->loadsSubresources()) {
@@ -147,7 +147,7 @@ void ResourceLoadNotifier::dispatchWillSendRequest(DocumentLoader* loader, unsig
 
     // If the URL changed, then we want to put that new URL in the "did tell client" set too.
     if (!request.isNull() && oldRequestURL != request.url().string() && m_frame.loader().documentLoader())
-        m_frame.loader().documentLoader()->didTellClientAboutLoad(request.url());
+        m_frame.loader().documentLoader()->didTellClientAboutLoad(request.url().string());
 
     InspectorInstrumentation::willSendRequest(&m_frame, identifier, loader, request, redirectResponse);
 }
index 08f58a3..1bd3e42 100644 (file)
@@ -236,7 +236,7 @@ bool SubframeLoader::requestObject(HTMLPlugInImageElement& ownerElement, const S
     bool useFallback;
     if (shouldUsePlugin(completedURL, mimeType, hasFallbackContent, useFallback)) {
         bool success = requestPlugin(ownerElement, completedURL, mimeType, paramNames, paramValues, useFallback);
-        logPluginRequest(document.page(), mimeType, completedURL, success);
+        logPluginRequest(document.page(), mimeType, completedURL.string(), success);
         return success;
     }
 
index 5a3ef63..9737474 100644 (file)
@@ -148,7 +148,8 @@ bool TextTrackLoader::load(const URL& url, HTMLTrackElement& element)
     options.sameOriginDataURLFlag = SameOriginDataURLFlag::Set;
     options.contentSecurityPolicyImposition = element.isInUserAgentShadowTree() ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck;
 
-    ResourceRequest resourceRequest(m_document.completeURL(url));
+    // FIXME: Do we really need to call completeURL here?
+    ResourceRequest resourceRequest(m_document.completeURL(url.string()));
 
     if (auto mediaElement = element.mediaElement())
         resourceRequest.setInspectorInitiatorNodeIdentifier(InspectorInstrumentation::identifierForNode(*mediaElement));
index 98b66ee..a94b531 100644 (file)
@@ -86,8 +86,8 @@ void ApplicationCache::addResource(Ref<ApplicationCacheResource>&& resource)
 {
     auto& url = resource->url();
 
-    ASSERT(!URL({ }, url).hasFragmentIdentifier());
-    ASSERT(!m_resources.contains(url));
+    ASSERT(!url.hasFragmentIdentifier());
+    ASSERT(!m_resources.contains(url.string()));
 
     if (m_storageID) {
         ASSERT(!resource->storageID());
@@ -99,7 +99,7 @@ void ApplicationCache::addResource(Ref<ApplicationCacheResource>&& resource)
 
     m_estimatedSizeInStorage += resource->estimatedSizeInStorage();
 
-    m_resources.set(url, WTFMove(resource));
+    m_resources.set(url.string(), WTFMove(resource));
 }
 
 ApplicationCacheResource* ApplicationCache::resourceForURL(const String& url)
@@ -121,7 +121,7 @@ ApplicationCacheResource* ApplicationCache::resourceForRequest(const ResourceReq
 
     URL url(request.url());
     url.removeFragmentIdentifier();
-    return resourceForURL(url);
+    return resourceForURL(url.string());
 }
 
 void ApplicationCache::setOnlineWhitelist(const Vector<URL>& onlineWhitelist)
index b63df7e..1e4cbdc 100644 (file)
@@ -163,8 +163,8 @@ void ApplicationCacheGroup::selectCache(Frame& frame, const URL& passedManifestU
             URL resourceURL { documentLoader.responseURL() };
             resourceURL.removeFragmentIdentifier();
 
-            ASSERT(mainResourceCache->resourceForURL(resourceURL));
-            auto& resource = *mainResourceCache->resourceForURL(resourceURL);
+            ASSERT(mainResourceCache->resourceForURL(resourceURL.string()));
+            auto& resource = *mainResourceCache->resourceForURL(resourceURL.string());
 
             bool inStorage = resource.storageID();
             resource.addType(ApplicationCacheResource::Foreign);
@@ -239,7 +239,7 @@ void ApplicationCacheGroup::finishedLoadingMainResource(DocumentLoader& loader)
     case NoUpdate:
         ASSERT(!m_cacheBeingUpdated);
         associateDocumentLoaderWithCache(&loader, m_newestCache.get());
-        if (auto* resource = m_newestCache->resourceForURL(url)) {
+        if (auto* resource = m_newestCache->resourceForURL(url.string())) {
             if (!(resource->type() & ApplicationCacheResource::Master)) {
                 resource->addType(ApplicationCacheResource::Master);
                 ASSERT(!resource->storageID());
@@ -257,7 +257,7 @@ void ApplicationCacheGroup::finishedLoadingMainResource(DocumentLoader& loader)
         break;
     case Completed:
         ASSERT(m_associatedDocumentLoaders.contains(&loader));
-        if (auto* resource = m_cacheBeingUpdated->resourceForURL(url)) {
+        if (auto* resource = m_cacheBeingUpdated->resourceForURL(url.string())) {
             if (!(resource->type() & ApplicationCacheResource::Master)) {
                 resource->addType(ApplicationCacheResource::Master);
                 ASSERT(!resource->storageID());
@@ -496,16 +496,16 @@ void ApplicationCacheGroup::didFinishLoadingEntry(const URL& entryURL)
     NetworkLoadMetrics emptyMetrics;
     InspectorInstrumentation::didFinishLoading(m_frame, m_frame->loader().documentLoader(), m_currentResourceIdentifier, emptyMetrics, nullptr);
 
-    ASSERT(m_pendingEntries.contains(entryURL));
+    ASSERT(m_pendingEntries.contains(entryURL.string()));
     
-    auto type = m_pendingEntries.take(entryURL);
+    auto type = m_pendingEntries.take(entryURL.string());
     
     ASSERT(m_cacheBeingUpdated);
 
     // Did we received a 304?
     if (!m_currentResource) {
         if (m_newestCache) {
-            ApplicationCacheResource* newestCachedResource = m_newestCache->resourceForURL(entryURL);
+            ApplicationCacheResource* newestCachedResource = m_newestCache->resourceForURL(entryURL.string());
             if (newestCachedResource) {
                 m_cacheBeingUpdated->addResource(ApplicationCacheResource::create(entryURL, newestCachedResource->response(), type, &newestCachedResource->data(), newestCachedResource->path()));
                 m_entryLoader = nullptr;
@@ -548,9 +548,9 @@ void ApplicationCacheGroup::didFailLoadingEntry(ApplicationCacheResourceLoader::
     URL url(entryURL);
     url.removeFragmentIdentifier();
 
-    ASSERT(!m_currentResource || !m_pendingEntries.contains(url));
+    ASSERT(!m_currentResource || !m_pendingEntries.contains(url.string()));
     m_currentResource = nullptr;
-    m_pendingEntries.remove(url);
+    m_pendingEntries.remove(url.string());
 
     if ((type & ApplicationCacheResource::Explicit) || (type & ApplicationCacheResource::Fallback)) {
         m_frame->document()->addConsoleMessage(MessageSource::AppCache, MessageLevel::Error, makeString("Application Cache update failed, because ", url.stringCenterEllipsizedToLength(), (m_entryLoader && m_entryLoader->hasRedirection() ? " was redirected." : " could not be fetched.")));
@@ -561,7 +561,7 @@ void ApplicationCacheGroup::didFailLoadingEntry(ApplicationCacheResourceLoader::
 
     if (error == ApplicationCacheResourceLoader::Error::NotFound) {
         // Skip this resource. It is dropped from the cache.
-        m_pendingEntries.remove(url);
+        m_pendingEntries.remove(url.string());
         startLoadingEntry();
         return;
     }
@@ -569,7 +569,7 @@ void ApplicationCacheGroup::didFailLoadingEntry(ApplicationCacheResourceLoader::
     // Copy the resource and its metadata from the newest application cache in cache group whose completeness flag is complete, and act
     // as if that was the fetched resource, ignoring the resource obtained from the network.
     ASSERT(m_newestCache);
-    ApplicationCacheResource* newestCachedResource = m_newestCache->resourceForURL(url);
+    ApplicationCacheResource* newestCachedResource = m_newestCache->resourceForURL(url.string());
     ASSERT(newestCachedResource);
     m_cacheBeingUpdated->addResource(ApplicationCacheResource::create(url, newestCachedResource->response(), type, &newestCachedResource->data(), newestCachedResource->path()));
     // Load the next resource, if any.
@@ -639,7 +639,7 @@ void ApplicationCacheGroup::didFinishLoadingManifest()
         addEntry(explicitURL, ApplicationCacheResource::Explicit);
 
     for (auto& fallbackURL : manifest.fallbackURLs)
-        addEntry(fallbackURL.second, ApplicationCacheResource::Fallback);
+        addEntry(fallbackURL.second.string(), ApplicationCacheResource::Fallback);
     
     m_cacheBeingUpdated->setOnlineWhitelist(manifest.onlineWhitelistedURLs);
     m_cacheBeingUpdated->setFallbackURLs(manifest.fallbackURLs);
index 4882d77..f99d6d1 100644 (file)
@@ -429,7 +429,7 @@ bool ApplicationCacheHost::shouldLoadResourceFromApplicationCache(const Resource
 
     // If the resource's URL is an master entry, the manifest, an explicit entry, or a fallback entry
     // in the application cache, then get the resource from the cache (instead of fetching it).
-    resource = cache->resourceForURL(request.url());
+    resource = cache->resourceForURL(request.url().string());
 
     // Resources that match fallback namespaces or online whitelist entries are fetched from the network,
     // unless they are also cached.
@@ -461,7 +461,7 @@ bool ApplicationCacheHost::getApplicationCacheFallbackResource(const ResourceReq
     if (!cache->urlMatchesFallbackNamespace(request.url(), &fallbackURL))
         return false;
 
-    resource = cache->resourceForURL(fallbackURL);
+    resource = cache->resourceForURL(fallbackURL.string());
     ASSERT(resource);
     return true;
 }
index 23f31f1..c983b29 100644 (file)
@@ -102,7 +102,7 @@ ApplicationCacheGroup* ApplicationCacheStorage::loadCacheGroup(const URL& manife
     if (statement.prepare() != SQLITE_OK)
         return nullptr;
     
-    statement.bindText(1, manifestURL);
+    statement.bindText(1, manifestURL.string());
    
     int result = statement.step();
     if (result == SQLITE_DONE)
@@ -129,7 +129,7 @@ ApplicationCacheGroup* ApplicationCacheStorage::findOrCreateCacheGroup(const URL
 {
     ASSERT(!manifestURL.hasFragmentIdentifier());
 
-    auto result = m_cachesInMemory.add(manifestURL, nullptr);
+    auto result = m_cachesInMemory.add(manifestURL.string(), nullptr);
     if (!result.isNewEntry) {
         ASSERT(result.iterator->value);
         return result.iterator->value;
@@ -150,7 +150,7 @@ ApplicationCacheGroup* ApplicationCacheStorage::findOrCreateCacheGroup(const URL
 
 ApplicationCacheGroup* ApplicationCacheStorage::findInMemoryCacheGroup(const URL& manifestURL) const
 {
-    return m_cachesInMemory.get(manifestURL);
+    return m_cachesInMemory.get(manifestURL.string());
 }
 
 void ApplicationCacheStorage::loadManifestHostHashes()
@@ -197,7 +197,7 @@ ApplicationCacheGroup* ApplicationCacheStorage::cacheGroupForURL(const URL& url)
             continue;
         
         if (ApplicationCache* cache = group->newestCache()) {
-            ApplicationCacheResource* resource = cache->resourceForURL(url);
+            ApplicationCacheResource* resource = cache->resourceForURL(url.string());
             if (!resource)
                 continue;
             if (resource->type() & ApplicationCacheResource::Foreign)
@@ -220,7 +220,7 @@ ApplicationCacheGroup* ApplicationCacheStorage::cacheGroupForURL(const URL& url)
     while ((result = statement.step()) == SQLITE_ROW) {
         URL manifestURL = URL({ }, statement.getColumnText(1));
 
-        if (m_cachesInMemory.contains(manifestURL))
+        if (m_cachesInMemory.contains(manifestURL.string()))
             continue;
 
         if (!protocolHostAndPortAreEqual(url, manifestURL))
@@ -233,7 +233,7 @@ ApplicationCacheGroup* ApplicationCacheStorage::cacheGroupForURL(const URL& url)
         if (!cache)
             continue;
 
-        auto* resource = cache->resourceForURL(url);
+        auto* resource = cache->resourceForURL(url.string());
         if (!resource)
             continue;
         if (resource->type() & ApplicationCacheResource::Foreign)
@@ -242,7 +242,7 @@ ApplicationCacheGroup* ApplicationCacheStorage::cacheGroupForURL(const URL& url)
         auto& group = *new ApplicationCacheGroup(*this, manifestURL);
         group.setStorageID(static_cast<unsigned>(statement.getColumnInt64(0)));
         group.setNewestCache(cache.releaseNonNull());
-        m_cachesInMemory.set(group.manifestURL(), &group);
+        m_cachesInMemory.set(group.manifestURL().string(), &group);
 
         return &group;
     }
@@ -269,7 +269,7 @@ ApplicationCacheGroup* ApplicationCacheStorage::fallbackCacheGroupForURL(const U
                 continue;
             if (!cache->urlMatchesFallbackNamespace(url, &fallbackURL))
                 continue;
-            if (cache->resourceForURL(fallbackURL)->type() & ApplicationCacheResource::Foreign)
+            if (cache->resourceForURL(fallbackURL.string())->type() & ApplicationCacheResource::Foreign)
                 continue;
             return group;
         }
@@ -287,7 +287,7 @@ ApplicationCacheGroup* ApplicationCacheStorage::fallbackCacheGroupForURL(const U
     while ((result = statement.step()) == SQLITE_ROW) {
         URL manifestURL = URL({ }, statement.getColumnText(1));
 
-        if (m_cachesInMemory.contains(manifestURL))
+        if (m_cachesInMemory.contains(manifestURL.string()))
             continue;
 
         // Fallback namespaces always have the same origin as manifest URL, so we can avoid loading caches that cannot match.
@@ -304,14 +304,14 @@ ApplicationCacheGroup* ApplicationCacheStorage::fallbackCacheGroupForURL(const U
             continue;
         if (!cache->urlMatchesFallbackNamespace(url, &fallbackURL))
             continue;
-        if (cache->resourceForURL(fallbackURL)->type() & ApplicationCacheResource::Foreign)
+        if (cache->resourceForURL(fallbackURL.string())->type() & ApplicationCacheResource::Foreign)
             continue;
 
         auto& group = *new ApplicationCacheGroup(*this, manifestURL);
         group.setStorageID(static_cast<unsigned>(statement.getColumnInt64(0)));
         group.setNewestCache(cache.releaseNonNull());
 
-        m_cachesInMemory.set(group.manifestURL(), &group);
+        m_cachesInMemory.set(group.manifestURL().string(), &group);
 
         return &group;
     }
@@ -326,13 +326,13 @@ void ApplicationCacheStorage::cacheGroupDestroyed(ApplicationCacheGroup& group)
 {
     if (group.isObsolete()) {
         ASSERT(!group.storageID());
-        ASSERT(m_cachesInMemory.get(group.manifestURL()) != &group);
+        ASSERT(m_cachesInMemory.get(group.manifestURL().string()) != &group);
         return;
     }
 
-    ASSERT(m_cachesInMemory.get(group.manifestURL()) == &group);
+    ASSERT(m_cachesInMemory.get(group.manifestURL().string()) == &group);
 
-    m_cachesInMemory.remove(group.manifestURL());
+    m_cachesInMemory.remove(group.manifestURL().string());
     
     // If the cache group is half-created, we don't want it in the saved set (as it is not stored in database).
     if (!group.storageID())
@@ -341,13 +341,13 @@ void ApplicationCacheStorage::cacheGroupDestroyed(ApplicationCacheGroup& group)
 
 void ApplicationCacheStorage::cacheGroupMadeObsolete(ApplicationCacheGroup& group)
 {
-    ASSERT(m_cachesInMemory.get(group.manifestURL()) == &group);
+    ASSERT(m_cachesInMemory.get(group.manifestURL().string()) == &group);
     ASSERT(m_cacheHostSet.contains(urlHostHash(group.manifestURL())));
 
     if (auto* newestCache = group.newestCache())
         remove(newestCache);
 
-    m_cachesInMemory.remove(group.manifestURL());
+    m_cachesInMemory.remove(group.manifestURL().string());
     m_cacheHostSet.remove(urlHostHash(group.manifestURL()));
 }
 
@@ -668,14 +668,14 @@ bool ApplicationCacheStorage::store(ApplicationCacheGroup* group, GroupStorageID
     // a cache group with an identical manifest URL and associated cache entries. We want to remove
     // this cache group and its associated cache entries so that we can create it again (below) as
     // a way to repair it.
-    deleteCacheGroupRecord(group->manifestURL());
+    deleteCacheGroupRecord(group->manifestURL().string());
 
     SQLiteStatement statement(m_database, "INSERT INTO CacheGroups (manifestHostHash, manifestURL, origin) VALUES (?, ?, ?)");
     if (statement.prepare() != SQLITE_OK)
         return false;
 
     statement.bindInt64(1, urlHostHash(group->manifestURL()));
-    statement.bindText(2, group->manifestURL());
+    statement.bindText(2, group->manifestURL().string());
     statement.bindText(3, group->origin().data().databaseIdentifier());
 
     if (!executeStatement(statement))
@@ -728,7 +728,7 @@ bool ApplicationCacheStorage::store(ApplicationCache* cache, ResourceStorageIDJo
             SQLiteStatement statement(m_database, "INSERT INTO CacheWhitelistURLs (url, cache) VALUES (?, ?)");
             statement.prepare();
 
-            statement.bindText(1, whitelistURL);
+            statement.bindText(1, whitelistURL.string());
             statement.bindInt64(2, cacheStorageID);
 
             if (!executeStatement(statement))
@@ -755,8 +755,8 @@ bool ApplicationCacheStorage::store(ApplicationCache* cache, ResourceStorageIDJo
             SQLiteStatement statement(m_database, "INSERT INTO FallbackURLs (namespace, fallbackURL, cache) VALUES (?, ?, ?)");
             statement.prepare();
 
-            statement.bindText(1, fallbackURL.first);
-            statement.bindText(2, fallbackURL.second);
+            statement.bindText(1, fallbackURL.first.string());
+            statement.bindText(2, fallbackURL.second.string());
             statement.bindInt64(3, cacheStorageID);
 
             if (!executeStatement(statement))
@@ -850,9 +850,9 @@ bool ApplicationCacheStorage::store(ApplicationCacheResource* resource, unsigned
     // The same ApplicationCacheResource are used in ApplicationCacheResource::size()
     // to calculate the approximate size of an ApplicationCacheResource object. If
     // you change the code below, please also change ApplicationCacheResource::size().
-    resourceStatement.bindText(1, resource->url());
+    resourceStatement.bindText(1, resource->url().string());
     resourceStatement.bindInt64(2, resource->response().httpStatusCode());
-    resourceStatement.bindText(3, resource->response().url());
+    resourceStatement.bindText(3, resource->response().url().string());
     resourceStatement.bindText(4, headers);
     resourceStatement.bindInt64(5, dataId);
     resourceStatement.bindText(6, resource->response().mimeType());
@@ -1514,7 +1514,7 @@ void ApplicationCacheStorage::deleteCacheForOrigin(const SecurityOrigin& securit
         if (auto* group = findInMemoryCacheGroup(url))
             group->makeObsolete();
         else
-            deleteCacheGroup(url);
+            deleteCacheGroup(url.string());
     }
 }
 
index a3705ec..812679c 100644 (file)
@@ -36,7 +36,7 @@ namespace WebCore {
 void ArchiveResourceCollection::addAllResources(Archive& archive)
 {
     for (auto& subresource : archive.subresources())
-        m_subresources.set(subresource->url(), subresource.ptr());
+        m_subresources.set(subresource->url().string(), subresource.ptr());
 
     for (auto& subframeArchive : archive.subframeArchives()) {
         ASSERT(subframeArchive->mainResource());
@@ -54,12 +54,12 @@ void ArchiveResourceCollection::addAllResources(Archive& archive)
 void ArchiveResourceCollection::addResource(Ref<ArchiveResource>&& resource)
 {
     auto& url = resource->url();
-    m_subresources.set(url, WTFMove(resource));
+    m_subresources.set(url.string(), WTFMove(resource));
 }
 
 ArchiveResource* ArchiveResourceCollection::archiveResourceForURL(const URL& url)
 {
-    return m_subresources.get(url);
+    return m_subresources.get(url.string());
 }
 
 RefPtr<Archive> ArchiveResourceCollection::popSubframeArchive(const String& frameName, const URL& url)
index 3ce0956..2100b33 100644 (file)
@@ -59,7 +59,7 @@ void CachedCSSStyleSheet::didAddClient(CachedResourceClient& client)
     CachedResource::didAddClient(client);
 
     if (!isLoading())
-        static_cast<CachedStyleSheetClient&>(client).setCSSStyleSheet(m_resourceRequest.url(), m_response.url(), m_decoder->encoding().name(), this);
+        static_cast<CachedStyleSheetClient&>(client).setCSSStyleSheet(m_resourceRequest.url().string(), m_response.url(), m_decoder->encoding().name(), this);
 }
 
 void CachedCSSStyleSheet::setEncoding(const String& chs)
@@ -117,7 +117,7 @@ void CachedCSSStyleSheet::checkNotify()
 
     CachedResourceClientWalker<CachedStyleSheetClient> w(m_clients);
     while (CachedStyleSheetClient* c = w.next())
-        c->setCSSStyleSheet(m_resourceRequest.url(), m_response.url(), m_decoder->encoding().name(), this);
+        c->setCSSStyleSheet(m_resourceRequest.url().string(), m_response.url(), m_decoder->encoding().name(), this);
 }
 
 String CachedCSSStyleSheet::responseMIMEType() const
index ae302fc..231edec 100644 (file)
@@ -190,7 +190,7 @@ CachedResource* CachedResourceLoader::cachedResource(const String& resourceURL)
 CachedResource* CachedResourceLoader::cachedResource(const URL& url) const
 {
     ASSERT(!MemoryCache::shouldRemoveFragmentIdentifier(url));
-    return m_documentResources.get(url).get();
+    return m_documentResources.get(url.string()).get();
 }
 
 Frame* CachedResourceLoader::frame() const
@@ -1005,10 +1005,10 @@ ResourceErrorOr<CachedResourceHandle<CachedResource>> CachedResourceLoader::requ
     }
 
     if (document() && !document()->loadEventFinished() && !resource->resourceRequest().url().protocolIsData())
-        m_validatedURLs.add(resource->resourceRequest().url());
+        m_validatedURLs.add(resource->resourceRequest().url().string());
 
     ASSERT(resource->url() == url.string());
-    m_documentResources.set(resource->url(), resource);
+    m_documentResources.set(resource->url().string(), resource);
 #if ENABLE(RESOURCE_LOAD_STATISTICS)
     frame.loader().client().didLoadFromRegistrableDomain(RegistrableDomain(resource->resourceRequest().url()));
 #endif
@@ -1212,7 +1212,7 @@ CachedResourceLoader::RevalidationPolicy CachedResourceLoader::determineRevalida
     }
 
     // During the initial load, avoid loading the same resource multiple times for a single document, even if the cache policies would tell us to.
-    if (document() && !document()->loadEventFinished() && m_validatedURLs.contains(existingResource->url()))
+    if (document() && !document()->loadEventFinished() && m_validatedURLs.contains(existingResource->url().string()))
         return Use;
 
     // CachePolicyReload always reloads
@@ -1418,7 +1418,7 @@ void CachedResourceLoader::decrementRequestCount(const CachedResource& resource)
 void CachedResourceLoader::notifyFinished(const CachedResource& resource)
 {
     if (isSVGImageCachedResource(&resource))
-        m_cachedSVGImagesURLs.add(resource.url());
+        m_cachedSVGImagesURLs.add(resource.url().string());
 }
 
 Vector<Ref<SVGImage>> CachedResourceLoader::allCachedSVGImages() const
index 195effb..f7a8378 100644 (file)
@@ -48,7 +48,7 @@ void CachedXSLStyleSheet::didAddClient(CachedResourceClient& client)
 {
     ASSERT(client.resourceClientType() == CachedStyleSheetClient::expectedType());
     if (!isLoading())
-        static_cast<CachedStyleSheetClient&>(client).setXSLStyleSheet(m_resourceRequest.url(), m_response.url(), m_sheet);
+        static_cast<CachedStyleSheetClient&>(client).setXSLStyleSheet(m_resourceRequest.url().string(), m_response.url(), m_sheet);
 }
 
 void CachedXSLStyleSheet::setEncoding(const String& chs)
@@ -78,7 +78,7 @@ void CachedXSLStyleSheet::checkNotify()
     
     CachedResourceClientWalker<CachedStyleSheetClient> w(m_clients);
     while (CachedStyleSheetClient* c = w.next())
-        c->setXSLStyleSheet(m_resourceRequest.url(), m_response.url(), m_sheet);
+        c->setXSLStyleSheet(m_resourceRequest.url().string(), m_response.url(), m_sheet);
 }
 
 #endif
index 4e492bb..08dbc34 100644 (file)
@@ -1348,7 +1348,7 @@ void ContextMenuController::checkOrEnableIfNeeded(ContextMenuItem& item) const
             break;
         case ContextMenuItemTagDownloadImageToDisk:
 #if PLATFORM(MAC)
-            if (WTF::protocolIs(m_context.hitTestResult().absoluteImageURL(), "file"))
+            if (m_context.hitTestResult().absoluteImageURL().protocolIs("file"))
                 shouldEnable = false;
 #endif
             break;
@@ -1363,7 +1363,7 @@ void ContextMenuController::checkOrEnableIfNeeded(ContextMenuItem& item) const
                 item.setTitle(contextMenuItemTagDownloadVideoToDisk());
             else
                 item.setTitle(contextMenuItemTagDownloadAudioToDisk());
-            if (WTF::protocolIs(m_context.hitTestResult().absoluteImageURL(), "file"))
+            if (m_context.hitTestResult().absoluteImageURL().protocolIs("file"))
                 shouldEnable = false;
             break;
         case ContextMenuItemTagCopyMediaLinkToClipboard:
index fac0671..a1b2536 100644 (file)
@@ -2326,7 +2326,7 @@ void DOMWindow::setLocation(DOMWindow& activeWindow, const URL& completedURL, Se
     if (!activeDocument->canNavigate(frame, completedURL))
         return;
 
-    if (isInsecureScriptAccess(activeWindow, completedURL))
+    if (isInsecureScriptAccess(activeWindow, completedURL.string()))
         return;
 
     // We want a new history item if we are processing a user gesture.
@@ -2458,7 +2458,7 @@ ExceptionOr<RefPtr<Frame>> DOMWindow::createWindow(const String& urlString, cons
     if (created)
         newFrame->page()->setOpenedByDOM();
 
-    if (newFrame->document()->domWindow()->isInsecureScriptAccess(activeWindow, completedURL))
+    if (newFrame->document()->domWindow()->isInsecureScriptAccess(activeWindow, completedURL.string()))
         return noopener ? RefPtr<Frame> { nullptr } : newFrame;
 
     if (prepareDialogFunction)
@@ -2535,7 +2535,7 @@ ExceptionOr<RefPtr<WindowProxy>> DOMWindow::open(DOMWindow& activeWindow, DOMWin
 
         URL completedURL = firstFrame->document()->completeURL(urlString);
 
-        if (targetFrame->document()->domWindow()->isInsecureScriptAccess(activeWindow, completedURL))
+        if (targetFrame->document()->domWindow()->isInsecureScriptAccess(activeWindow, completedURL.string()))
             return &targetFrame->windowProxy();
 
         if (urlString.isEmpty())
index 36c1c9b..297d8ca 100644 (file)
@@ -259,7 +259,7 @@ void Location::reload(DOMWindow& activeWindow)
         return;
     }
 
-    if (WTF::protocolIsJavaScript(targetDocument.url()))
+    if (targetDocument.url().protocolIsJavaScript())
         return;
 
     frame->navigationScheduler().scheduleRefresh(activeDocument);
index 6c1359b..dca406b 100644 (file)
@@ -312,7 +312,7 @@ void PageSerializer::retrieveResourcesForProperties(const StyleProperties* style
         if (!image)
             continue;
 
-        addImageToResources(image, nullptr, document->completeURL(image->url()));
+        addImageToResources(image, nullptr, document->completeURL(image->url().string()));
     }
 }
 
index c494ac7..8dd1ed2 100644 (file)
@@ -58,7 +58,7 @@ static bool schemeRequiresHost(const URL& url)
 
 bool SecurityOrigin::shouldIgnoreHost(const URL& url)
 {
-    return url.protocolIsData() || url.protocolIsAbout() || protocolIsJavaScript(url) || url.protocolIs("file");
+    return url.protocolIsData() || url.protocolIsAbout() || url.protocolIsJavaScript() || url.protocolIs("file");
 }
 
 bool SecurityOrigin::shouldUseInnerURL(const URL& url)
index ca5c11d..745cb21 100644 (file)
@@ -176,13 +176,13 @@ bool SecurityPolicy::shouldInheritSecurityOriginFromOwner(const URL& url)
     //
     // Note: We generalize this to invalid URLs because we treat such URLs as about:blank.
     // FIXME: We also allow some URLs like "about:BLANK". We should probably block navigation to these URLs, see rdar://problem/57966056.
-    return url.isEmpty() || url.isAboutBlank() || url.isAboutSrcDoc() || equalIgnoringASCIICase(url.string(), aboutBlankURL());
+    return url.isEmpty() || url.isAboutBlank() || url.isAboutSrcDoc() || equalIgnoringASCIICase(url.string(), aboutBlankURL().string());
 }
 
 bool SecurityPolicy::isBaseURLSchemeAllowed(const URL& url)
 {
     // See <https://github.com/whatwg/html/issues/2249>.
-    return !url.protocolIsData() && !WTF::protocolIsJavaScript(url);
+    return !url.protocolIsData() && !url.protocolIsJavaScript();
 }
 
 void SecurityPolicy::setLocalLoadPolicy(LocalLoadPolicy policy)
index ad6f520..fbfe9fe 100644 (file)
@@ -685,7 +685,7 @@ void ContentSecurityPolicy::reportViolation(const String& effectiveViolatedDirec
 
     // FIXME: Support sending reports from worker.
     CSPInfo info;
-    info.documentURI = blockedURL;
+    info.documentURI = blockedURL.string();
     if (m_client)
         m_client->willSendCSPViolationReport(info);
     else {
index 2e54670..c022be7 100644 (file)
@@ -299,7 +299,7 @@ protected:
     
     void invalidateCachedDuration();
 
-    const String& assetURL() const { return m_assetURL; }
+    const String& assetURL() const { return m_assetURL.string(); }
 
     MediaPlayer* player() { return m_player; }
     const MediaPlayer* player() const { return m_player; }
index 2386911..be330a5 100644 (file)
@@ -330,7 +330,7 @@ void BlobRegistryImpl::writeBlobsToTemporaryFiles(const Vector<String>& blobURLs
 void BlobRegistryImpl::writeBlobToFilePath(const URL& blobURL, const String& path, Function<void(bool success)>&& completionHandler)
 {
     Vector<BlobForFileWriting> blobsForWriting;
-    if (!populateBlobsForFileWriting({ blobURL }, blobsForWriting) || blobsForWriting.size() != 1) {
+    if (!populateBlobsForFileWriting({ blobURL.string() }, blobsForWriting) || blobsForWriting.size() != 1) {
         completionHandler(false);
         return;
     }
index 0b55a02..1ce670c 100644 (file)
@@ -164,7 +164,7 @@ void ResourceError::platformLazyInit()
     else
         m_failingURL = URL((NSURL *)[[m_platformError.get() userInfo] valueForKey:@"NSErrorFailingURLKey"]);
     // Workaround for <rdar://problem/6554067>
-    m_localizedDescription = m_failingURL;
+    m_localizedDescription = m_failingURL.string();
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
     m_localizedDescription = [m_platformError.get() _web_localizedDescription];
     END_BLOCK_OBJC_EXCEPTIONS;
index 5a569fc..2866aa9 100644 (file)
@@ -56,7 +56,7 @@ void StorageEventDispatcher::dispatchSessionStorageEvents(const String& key, con
             frames.append(frame);
     }
 
-    dispatchSessionStorageEventsToFrames(*page, frames, key, oldValue, newValue, sourceFrame->document()->url(), securityOrigin);
+    dispatchSessionStorageEventsToFrames(*page, frames, key, oldValue, newValue, sourceFrame->document()->url().string(), securityOrigin);
 }
 
 void StorageEventDispatcher::dispatchLocalStorageEvents(const String& key, const String& oldValue, const String& newValue, const SecurityOriginData& securityOrigin, Frame* sourceFrame)
@@ -77,7 +77,7 @@ void StorageEventDispatcher::dispatchLocalStorageEvents(const String& key, const
         }
     }
 
-    dispatchLocalStorageEventsToFrames(page->group(), frames, key, oldValue, newValue, sourceFrame->document()->url(), securityOrigin);
+    dispatchLocalStorageEventsToFrames(page->group(), frames, key, oldValue, newValue, sourceFrame->document()->url().string(), securityOrigin);
 }
 
 void StorageEventDispatcher::dispatchSessionStorageEventsToFrames(Page& page, const Vector<RefPtr<Frame>>& frames, const String& key, const String& oldValue, const String& newValue, const String& url, const SecurityOriginData& securityOrigin)
index aeb1d5d..fd96f76 100644 (file)
@@ -49,7 +49,7 @@ String SVGImageLoader::sourceURI(const AtomString& attribute) const
     URL base = element().baseURI();
     if (base != aboutBlankURL())
         return URL(base, stripLeadingAndTrailingHTMLSpaces(attribute)).string();
-    return element().document().completeURL(stripLeadingAndTrailingHTMLSpaces(attribute));
+    return element().document().completeURL(stripLeadingAndTrailingHTMLSpaces(attribute)).string();
 }
 
 }
index 340067e..7ba3c56 100644 (file)
@@ -61,7 +61,7 @@ Optional<Exception> WorkerScriptLoader::loadSynchronously(ScriptExecutionContext
     if (isServiceWorkerGlobalScope) {
         if (auto* scriptResource = downcast<ServiceWorkerGlobalScope>(workerGlobalScope).scriptResource(url)) {
             m_script.append(scriptResource->script);
-            m_responseURL = URL { URL { }, scriptResource->responseURL };
+            m_responseURL = scriptResource->responseURL;
             m_responseMIMEType = scriptResource->mimeType;
             return WTF::nullopt;
         }
index bea32a5..94a0270 100644 (file)
@@ -112,7 +112,7 @@ ServiceWorker* ServiceWorkerRegistration::getNewestWorker() const
 
 const String& ServiceWorkerRegistration::scope() const
 {
-    return m_registrationData.scopeURL;
+    return m_registrationData.scopeURL.string();
 }
 
 ServiceWorkerUpdateViaCache ServiceWorkerRegistration::updateViaCache() const
index 1896c24..4ce70a1 100644 (file)
@@ -49,7 +49,7 @@ unsigned ServiceWorkerRegistrationKey::hash() const
 {
     unsigned hashes[2];
     hashes[0] = SecurityOriginDataHash::hash(m_topOrigin);
-    hashes[1] = StringHash::hash(m_scope);
+    hashes[1] = StringHash::hash(m_scope.string());
 
     return StringHasher::hashMemory(hashes, sizeof(hashes));
 }
@@ -66,7 +66,7 @@ ServiceWorkerRegistrationKey ServiceWorkerRegistrationKey::isolatedCopy() const
 
 bool ServiceWorkerRegistrationKey::isMatching(const SecurityOriginData& topOrigin, const URL& clientURL) const
 {
-    return originIsMatching(topOrigin, clientURL) && clientURL.string().startsWith(m_scope);
+    return originIsMatching(topOrigin, clientURL) && clientURL.string().startsWith(m_scope.string());
 }
 
 bool ServiceWorkerRegistrationKey::originIsMatching(const SecurityOriginData& topOrigin, const URL& clientURL) const
index 9a3832a..412e569 100644 (file)
@@ -38,7 +38,7 @@ using namespace Inspector;
 
 ServiceWorkerDebuggable::ServiceWorkerDebuggable(ServiceWorkerThreadProxy& serviceWorkerThreadProxy, const ServiceWorkerContextData& data)
     : m_serviceWorkerThreadProxy(serviceWorkerThreadProxy)
-    , m_scopeURL(data.registration.scopeURL)
+    , m_scopeURL(data.registration.scopeURL.string())
 {
 }
 
index dbb595b..a3f706b 100644 (file)
@@ -453,7 +453,7 @@ void SWServer::startScriptFetch(const ServiceWorkerJobData& jobData, bool should
 
         request.setHTTPHeaderField(HTTPHeaderName::Origin, origin->toString());
         request.setHTTPHeaderField(HTTPHeaderName::ServiceWorker, "script"_s);
-        request.setHTTPReferrer(originURL(origin));
+        request.setHTTPReferrer(originURL(origin).string());
         request.setHTTPUserAgent(serviceWorkerClientUserAgent(ClientOrigin { jobData.topOrigin, SecurityOrigin::create(jobData.scriptURL)->data() }));
         request.setPriority(ResourceLoadPriority::Low);
 
index a0de49f..19c6292 100644 (file)
@@ -443,7 +443,7 @@ Optional<ExceptionOr<void>> XMLHttpRequest::prepareToSend()
 
 ExceptionOr<void> XMLHttpRequest::send(Optional<SendTypes>&& sendType)
 {
-    InspectorInstrumentation::willSendXMLHttpRequest(scriptExecutionContext(), url());
+    InspectorInstrumentation::willSendXMLHttpRequest(scriptExecutionContext(), url().string());
     m_userGestureToken = UserGestureIndicator::currentUserGesture();
 
     ExceptionOr<void> result;
index 6734314..8cd87e7 100644 (file)
@@ -1,3 +1,59 @@
+2020-04-25  Alex Christensen  <achristensen@webkit.org>
+
+        Prepare to remove automatic URL->String conversion operators
+        https://bugs.webkit.org/show_bug.cgi?id=211007
+
+        Reviewed by Darin Adler.
+
+        * Shared/API/APIError.h:
+        (API::Error::failingURL const):
+        * Shared/API/c/WKSharedAPICast.h:
+        (WebKit::toCopiedURLAPI):
+        * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
+        (setUpPagePolicyClient):
+        * UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm:
+        (WebKit::reportAnErrorURL):
+        * UIProcess/Cocoa/UIDelegate.mm:
+        (WebKit::requestUserMediaAuthorizationForFrame):
+        (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin):
+        * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
+        (WebKit::WebPasteboardProxy::readURLFromPasteboard):
+        * UIProcess/ProvisionalPageProxy.cpp:
+        (WebKit::ProvisionalPageProxy::cancel):
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
+        (WebKit::WebPageProxy::loadRequestWithNavigationShared):
+        (WebKit::WebPageProxy::loadAlternateHTML):
+        (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
+        (WebKit::WebPageProxy::didExplicitOpenForFrame):
+        (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrameShared):
+        (WebKit::WebPageProxy::didChangeProvisionalURLForFrameShared):
+        (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
+        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
+        (WebKit::WebPageProxy::createNewPage):
+        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
+        (-[WKWebProcessPlugInFrame URL]):
+        * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
+        (WebKit::NetscapePluginStream::didReceiveResponse):
+        * WebProcess/Plugins/PDF/PDFPlugin.mm:
+        (WebKit::PDFPlugin::clickedLink):
+        (WebKit::PDFPlugin::openWithNativeApplication):
+        * WebProcess/Plugins/PluginView.cpp:
+        (WebKit::PluginView::performURLRequest):
+        (WebKit::PluginView::performJavaScriptURLRequest):
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::dispatchWillPerformClientRedirect):
+        (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
+        (WebKit::WebFrameLoaderClient::shouldForceUniversalAccessFromLocalURL):
+        * WebProcess/WebPage/WebFrame.cpp:
+        (WebKit::WebFrame::info const):
+        * WebProcess/WebStorage/StorageAreaMap.cpp:
+        (WebKit::StorageAreaMap::setItem):
+        (WebKit::StorageAreaMap::removeItem):
+        (WebKit::StorageAreaMap::clear):
+        * WebProcess/cocoa/WebProcessCocoa.mm:
+        (WebKit::origin):
+
 2020-04-25  Darin Adler  <darin@apple.com>
 
         Move URL to use StringView when returning substrings of the URL
index e016ed0..9f63914 100644 (file)
@@ -100,7 +100,7 @@ public:
 
     const WTF::String& domain() const { return m_platformError.domain(); }
     int errorCode() const { return m_platformError.errorCode(); }
-    const WTF::String& failingURL() const { return m_platformError.failingURL(); }
+    const WTF::String& failingURL() const { return m_platformError.failingURL().string(); }
     const WTF::String& localizedDescription() const { return m_platformError.localizedDescription(); }
 
     const WebCore::ResourceError& platformError() const { return m_platformError; }
index 37c7d96..5bfeab8 100644 (file)
@@ -179,6 +179,11 @@ inline WKURLRef toCopiedURLAPI(const String& string)
     return toAPI(&API::URL::create(string).leakRef());
 }
 
+inline WKURLRef toCopiedURLAPI(const URL& url)
+{
+    return toCopiedURLAPI(url.string());
+}
+
 inline String toWTFString(WKStringRef stringRef)
 {
     if (!stringRef)
index 79ed25e..0ee3c04 100644 (file)
@@ -491,7 +491,7 @@ static void setUpPagePolicyClient(WKBrowsingContextController *browsingContext,
 
             if (originatingFrame) {
                 actionDictionary = [[actionDictionary mutableCopy] autorelease];
-                [(NSMutableDictionary *)actionDictionary setObject:[NSURL _web_URLWithWTFString:WebKit::toImpl(originatingFrame)->url()] forKey:WKActionOriginatingFrameURLKey];
+                [(NSMutableDictionary *)actionDictionary setObject:[NSURL _web_URLWithWTFString:WebKit::toImpl(originatingFrame)->url().string()] forKey:WKActionOriginatingFrameURLKey];
             }
             
             [policyDelegate browsingContextController:browsingContext decidePolicyForNavigationAction:actionDictionary decisionHandler:makePolicyDecisionBlock(listener)];
index d36c86b..8a99ec4 100644 (file)
@@ -83,7 +83,7 @@ static void addLinkAndReplace(NSMutableAttributedString *string, NSString *toRep
 
 static NSURL *reportAnErrorURL(const URL& url, SSBServiceLookupResult *result)
 {
-    return URL({ }, makeString(reportAnErrorBase(result), "&url=", encodeWithURLEscapeSequences(url), "&hl=", defaultLanguage()));
+    return URL({ }, makeString(reportAnErrorBase(result), "&url=", encodeWithURLEscapeSequences(url.string()), "&hl=", defaultLanguage()));
 }
 
 static NSURL *malwareDetailsURL(const URL& url, SSBServiceLookupResult *result)
index 216295e..d6a4d29 100644 (file)
@@ -916,8 +916,8 @@ static void requestUserMediaAuthorizationForFrame(const WebFrameProxy& frame, AP
         return;
     }
 
-    URL requestFrameURL { URL(), frame.url() };
-    URL mainFrameURL { URL(), mainFrame->url() };
+    URL requestFrameURL { frame.url() };
+    URL mainFrameURL { mainFrame->url() };
 
     [delegate _webView:&webView requestUserMediaAuthorizationForDevices:devices url:requestFrameURL mainFrameURL:mainFrameURL decisionHandler:decisionHandler.get()];
 }
@@ -1034,8 +1034,8 @@ void UIDelegate::UIClient::checkUserMediaPermissionForOrigin(WebPageProxy& page,
         protectedRequest->setUserMediaAccessInfo(authorized);
     });
 
-    URL requestFrameURL { URL(), frame.url() };
-    URL mainFrameURL { URL(), mainFrame->url() };
+    URL requestFrameURL { frame.url() };
+    URL mainFrameURL { mainFrame->url() };
 
     [(id <WKUIDelegatePrivate>)delegate _webView:m_uiDelegate.m_webView checkUserMediaPermissionForURL:requestFrameURL mainFrameURL:mainFrameURL frameIdentifier:frame.frameID().toUInt64() decisionHandler:decisionHandler.get()];
 }
index da1088f..60515b2 100644 (file)
@@ -366,7 +366,7 @@ void WebPasteboardProxy::readURLFromPasteboard(IPC::Connection& connection, size
         return completionHandler({ }, { });
 
     String title;
-    String url = PlatformPasteboard(pasteboardName).readURL(index, title);
+    String url = PlatformPasteboard(pasteboardName).readURL(index, title).string();
     completionHandler(WTFMove(url), WTFMove(title));
 }
 
index ce2cd2c..3118e3d 100644 (file)
@@ -140,7 +140,7 @@ void ProvisionalPageProxy::cancel()
         m_mainFrame->frameID(),
         WTF::nullopt,
     };
-    didFailProvisionalLoadForFrame(m_mainFrame->frameID(), WTFMove(frameInfo), ResourceRequest { m_request }, m_navigationID, m_provisionalLoadURL, error, WebCore::WillContinueLoading::No, UserData { }); // Will delete |this|.
+    didFailProvisionalLoadForFrame(m_mainFrame->frameID(), WTFMove(frameInfo), ResourceRequest { m_request }, m_navigationID, m_provisionalLoadURL.string(), error, WebCore::WillContinueLoading::No, UserData { }); // Will delete |this|.
 }
 
 void ProvisionalPageProxy::initializeWebPage(RefPtr<API::WebsitePolicies>&& websitePolicies)
index 4aa6ff8..23e0481 100644 (file)
@@ -1213,12 +1213,12 @@ void WebPageProxy::maybeInitializeSandboxExtensionHandle(WebProcessProxy& proces
             createdExtension = SandboxExtension::createHandle(resourceDirectoryURL.fileSystemPath(), SandboxExtension::Type::ReadOnly, sandboxExtensionHandle);
 
         if (createdExtension) {
-            process.assumeReadAccessToBaseURL(*this, resourceDirectoryURL);
+            process.assumeReadAccessToBaseURL(*this, resourceDirectoryURL.string());
             return;
         }
 #else
         if (SandboxExtension::createHandle(resourceDirectoryURL.fileSystemPath(), SandboxExtension::Type::ReadOnly, sandboxExtensionHandle)) {
-            process.assumeReadAccessToBaseURL(*this, resourceDirectoryURL);
+            process.assumeReadAccessToBaseURL(*this, resourceDirectoryURL.string());
             return;
         }
 #endif
@@ -1266,10 +1266,10 @@ void WebPageProxy::maybeInitializeSandboxExtensionHandle(WebProcessProxy& proces
         createdExtension = SandboxExtension::createHandle(basePath, SandboxExtension::Type::ReadOnly, sandboxExtensionHandle);
     
     if (createdExtension)
-        process.assumeReadAccessToBaseURL(*this, baseURL);
+        process.assumeReadAccessToBaseURL(*this, baseURL.string());
 #else
     if (SandboxExtension::createHandle(basePath, SandboxExtension::Type::ReadOnly, sandboxExtensionHandle))
-        process.assumeReadAccessToBaseURL(*this, baseURL);
+        process.assumeReadAccessToBaseURL(*this, baseURL.string());
 #endif
 }
 
@@ -1316,7 +1316,7 @@ void WebPageProxy::loadRequestWithNavigationShared(Ref<WebProcessProxy>&& proces
 
     auto url = request.url();
     if (shouldTreatAsContinuingLoad != ShouldTreatAsContinuingLoad::Yes)
-        m_pageLoadState.setPendingAPIRequest(transaction, { navigation.navigationID(), url });
+        m_pageLoadState.setPendingAPIRequest(transaction, { navigation.navigationID(), url.string() });
 
     LoadParameters loadParameters;
     loadParameters.navigationID = navigation.navigationID();
@@ -1479,8 +1479,8 @@ void WebPageProxy::loadAlternateHTML(const IPC::DataReference& htmlData, const S
 
     auto transaction = m_pageLoadState.transaction();
 
-    m_pageLoadState.setPendingAPIRequest(transaction, { 0, unreachableURL });
-    m_pageLoadState.setUnreachableURL(transaction, unreachableURL);
+    m_pageLoadState.setPendingAPIRequest(transaction, { 0, unreachableURL.string() });
+    m_pageLoadState.setUnreachableURL(transaction, unreachableURL.string());
 
     if (m_mainFrame)
         m_mainFrame->setUnreachableURL(unreachableURL);
@@ -1490,14 +1490,14 @@ void WebPageProxy::loadAlternateHTML(const IPC::DataReference& htmlData, const S
     loadParameters.data = htmlData;
     loadParameters.MIMEType = "text/html"_s;
     loadParameters.encodingName = encoding;
-    loadParameters.baseURLString = baseURL;
-    loadParameters.unreachableURLString = unreachableURL;
+    loadParameters.baseURLString = baseURL.string();
+    loadParameters.unreachableURLString = unreachableURL.string();
     loadParameters.provisionalLoadErrorURLString = m_failingProvisionalLoadURL;
     loadParameters.userData = UserData(process().transformObjectsToHandles(userData).get());
     addPlatformLoadParameters(loadParameters);
 
-    m_process->assumeReadAccessToBaseURL(*this, baseURL);
-    m_process->assumeReadAccessToBaseURL(*this, unreachableURL);
+    m_process->assumeReadAccessToBaseURL(*this, baseURL.string());
+    m_process->assumeReadAccessToBaseURL(*this, unreachableURL.string());
     send(Messages::WebPage::LoadAlternateHTML(loadParameters));
     m_process->startResponsivenessTimer();
 }
@@ -4426,7 +4426,7 @@ void WebPageProxy::didStartProvisionalLoadForFrameShared(Ref<WebProcessProxy>&&
         process->didStartProvisionalLoadForMainFrame(url);
         reportPageLoadResult(ResourceError { ResourceError::Type::Cancellation });
         m_pageLoadStart = MonotonicTime::now();
-        m_pageLoadState.didStartProvisionalLoad(transaction, url, unreachableURL);
+        m_pageLoadState.didStartProvisionalLoad(transaction, url.string(), unreachableURL.string());
         pageClient().didStartProvisionalLoadForMainFrame();
         closeOverlayedViews();
     }
@@ -4461,7 +4461,7 @@ void WebPageProxy::didExplicitOpenForFrame(FrameIdentifier frameID, URL&& url, S
     auto transaction = m_pageLoadState.transaction();
 
     if (frame->isMainFrame())
-        m_pageLoadState.didExplicitOpen(transaction, url);
+        m_pageLoadState.didExplicitOpen(transaction, url.string());
 
     frame->didExplicitOpen(WTFMove(url), WTFMove(mimeType));
 
@@ -4495,7 +4495,7 @@ void WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrameShared(Ref<
     auto transaction = m_pageLoadState.transaction();
 
     if (frame->isMainFrame())
-        m_pageLoadState.didReceiveServerRedirectForProvisionalLoad(transaction, request.url());
+        m_pageLoadState.didReceiveServerRedirectForProvisionalLoad(transaction, request.url().string());
 
     frame->didReceiveServerRedirectForProvisionalLoad(request.url());
 
@@ -4551,7 +4551,7 @@ void WebPageProxy::didChangeProvisionalURLForFrameShared(Ref<WebProcessProxy>&&
     // Internally, we handle this the same way we handle a server redirect. There are no client callbacks
     // for this, but if this is the main frame, clients may observe a change to the page's URL.
     if (frame->isMainFrame())
-        m_pageLoadState.didReceiveServerRedirectForProvisionalLoad(transaction, url);
+        m_pageLoadState.didReceiveServerRedirectForProvisionalLoad(transaction, url.string());
 
     frame->didReceiveServerRedirectForProvisionalLoad(url);
 }
@@ -4906,7 +4906,7 @@ void WebPageProxy::didSameDocumentNavigationForFrame(FrameIdentifier frameID, ui
 
     bool isMainFrame = frame->isMainFrame();
     if (isMainFrame)
-        m_pageLoadState.didSameDocumentNavigation(transaction, url);
+        m_pageLoadState.didSameDocumentNavigation(transaction, url.string());
 
     if (m_controlledByAutomation) {
         if (auto* automationSession = process().processPool().automationSession())
@@ -5190,7 +5190,7 @@ void WebPageProxy::decidePolicyForNavigationAction(Ref<WebProcessProxy>&& proces
         if (safeBrowsingWarning) {
             if (frame->isMainFrame() && safeBrowsingWarning->url().isValid()) {
                 auto transaction = m_pageLoadState.transaction();
-                m_pageLoadState.setPendingAPIRequest(transaction, { navigation->navigationID(), safeBrowsingWarning->url() });
+                m_pageLoadState.setPendingAPIRequest(transaction, { navigation->navigationID(), safeBrowsingWarning->url().string() });
                 m_pageLoadState.commitChanges();
             }
 
@@ -5570,7 +5570,7 @@ void WebPageProxy::createNewPage(FrameInfoData&& originatingFrameInfoData, Optio
 
         reply(newPage->webPageID(), newPage->creationParameters(m_process, *newPage->drawingArea()));
 
-        newPage->m_shouldSuppressAppLinksInNextNavigationPolicyDecision = URL({ }, mainFrameURL).host() == request.url().host();
+        newPage->m_shouldSuppressAppLinksInNextNavigationPolicyDecision = mainFrameURL.host() == request.url().host();
 
 #if HAVE(APP_SSO)
         newPage->m_shouldSuppressSOAuthorizationInNextNavigationPolicyDecision = true;
index 03c27c4..297630f 100644 (file)
@@ -87,7 +87,7 @@
 
 - (NSURL *)URL
 {
-    return [NSURL _web_URLWithWTFString:_frame->url()];
+    return [NSURL _web_URLWithWTFString:_frame->url().string()];
 }
 
 - (NSArray *)childFrames
index b0d81a0..2a601cc 100644 (file)
@@ -74,7 +74,7 @@ void NetscapePluginStream::didReceiveResponse(const URL& responseURL, uint32_t s
     // Starting the stream could cause the plug-in stream to go away so we keep a reference to it here.
     Ref<NetscapePluginStream> protect(*this);
 
-    start(responseURL, streamLength, lastModifiedTime, mimeType, headers);
+    start(responseURL.string(), streamLength, lastModifiedTime, mimeType, headers);
 }
 
 void NetscapePluginStream::didReceiveData(const char* bytes, int length)
index e4efa48..88014fe 100644 (file)
@@ -2299,7 +2299,7 @@ bool PDFPlugin::handlesPageScaleFactor() const
 void PDFPlugin::clickedLink(NSURL *url)
 {
     URL coreURL = url;
-    if (WTF::protocolIsJavaScript(coreURL))
+    if (coreURL.protocolIsJavaScript())
         return;
 
     auto* frame = m_frame.coreFrame();
@@ -2395,7 +2395,7 @@ void PDFPlugin::openWithNativeApplication()
         m_temporaryPDFUUID = createCanonicalUUIDString();
         ASSERT(m_temporaryPDFUUID);
 
-        m_frame.page()->savePDFToTemporaryFolderAndOpenWithNativeApplication(m_suggestedFilename, m_frame.url(), static_cast<const unsigned char *>([data bytes]), [data length], m_temporaryPDFUUID);
+        m_frame.page()->savePDFToTemporaryFolderAndOpenWithNativeApplication(m_suggestedFilename, m_frame.url().string(), static_cast<const unsigned char *>([data bytes]), [data length], m_temporaryPDFUUID);
         return;
     }
 
index eb91e90..c3e83b3 100644 (file)
@@ -1168,7 +1168,7 @@ void PluginView::performURLRequest(URLRequest* request)
     Ref<PluginView> protect(*this);
 
     // First, check if this is a javascript: url.
-    if (WTF::protocolIsJavaScript(request->request().url())) {
+    if (request->request().url().protocolIsJavaScript()) {
         performJavaScriptURLRequest(request);
         return;
     }
@@ -1233,7 +1233,7 @@ void PluginView::performFrameLoadURLRequest(URLRequest* request)
 
 void PluginView::performJavaScriptURLRequest(URLRequest* request)
 {
-    ASSERT(WTF::protocolIsJavaScript(request->request().url()));
+    ASSERT(request->request().url().protocolIs("javasript"));
 
     RefPtr<Frame> frame = m_pluginElement->document().frame();
     if (!frame)
index c62c1c3..96a5d9d 100644 (file)
@@ -375,7 +375,7 @@ void WebFrameLoaderClient::dispatchWillPerformClientRedirect(const URL& url, dou
         return;
 
     // Notify the bundle client.
-    webPage->injectedBundleLoaderClient().willPerformClientRedirectForFrame(*webPage, m_frame, url, interval, fireDate);
+    webPage->injectedBundleLoaderClient().willPerformClientRedirectForFrame(*webPage, m_frame, url.string(), interval, fireDate);
 
     // Notify the UIProcess.
     webPage->send(Messages::WebPageProxy::WillPerformClientRedirectForFrame(m_frame->frameID(), url.string(), interval, lockBackForwardList));
@@ -594,7 +594,7 @@ void WebFrameLoaderClient::dispatchDidFailProvisionalLoad(const ResourceError& e
 
     // Notify the UIProcess.
     WebCore::Frame* coreFrame = m_frame->coreFrame();
-    webPage->send(Messages::WebPageProxy::DidFailProvisionalLoadForFrame(m_frame->frameID(), m_frame->info(), request, navigationID, coreFrame->loader().provisionalLoadErrorBeingHandledURL(), error, willContinueLoading, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));
+    webPage->send(Messages::WebPageProxy::DidFailProvisionalLoadForFrame(m_frame->frameID(), m_frame->info(), request, navigationID, coreFrame->loader().provisionalLoadErrorBeingHandledURL().string(), error, willContinueLoading, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));
 
     // If we have a load listener, notify it.
     if (WebFrame::LoadListener* loadListener = m_frame->loadListener())
@@ -1851,7 +1851,7 @@ bool WebFrameLoaderClient::shouldForceUniversalAccessFromLocalURL(const URL& url
     if (!webPage)
         return false;
 
-    return webPage->injectedBundleLoaderClient().shouldForceUniversalAccessFromLocalURL(*webPage, url);
+    return webPage->injectedBundleLoaderClient().shouldForceUniversalAccessFromLocalURL(*webPage, url.string());
 }
 
 Ref<FrameNetworkingContext> WebFrameLoaderClient::createNetworkingContext()
index 679cc4c..d78b124 100644 (file)
@@ -184,7 +184,7 @@ FrameInfoData WebFrame::info() const
     FrameInfoData info {
         isMainFrame(),
         // FIXME: This should use the full request.
-        ResourceRequest(URL(URL(), url())),
+        ResourceRequest(url()),
         SecurityOriginData::fromFrame(m_coreFrame),
         m_frameID,
         parent ? Optional<WebCore::FrameIdentifier> { parent->frameID() } : WTF::nullopt,
index 4687e03..73e2b4c 100644 (file)
@@ -95,7 +95,7 @@ void StorageAreaMap::setItem(Frame* sourceFrame, StorageAreaImpl* sourceArea, co
     m_pendingValueChanges.add(key);
 
     if (m_mapID)
-        WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::StorageManagerSet::SetItem(*m_mapID, sourceArea->identifier(), m_currentSeed, key, value, sourceFrame->document()->url()), 0);
+        WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::StorageManagerSet::SetItem(*m_mapID, sourceArea->identifier(), m_currentSeed, key, value, sourceFrame->document()->url().string()), 0);
     else
         RELEASE_LOG_ERROR(Storage, "StorageAreaMap::setItem failed because storage map ID is invalid");
 }
@@ -114,7 +114,7 @@ void StorageAreaMap::removeItem(WebCore::Frame* sourceFrame, StorageAreaImpl* so
     m_pendingValueChanges.add(key);
 
     if (m_mapID)
-        WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::StorageManagerSet::RemoveItem(*m_mapID, sourceArea->identifier(), m_currentSeed, key, sourceFrame->document()->url()), 0);
+        WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::StorageManagerSet::RemoveItem(*m_mapID, sourceArea->identifier(), m_currentSeed, key, sourceFrame->document()->url().string()), 0);
     else
         RELEASE_LOG_ERROR(Storage, "StorageAreaMap::removeItem failed because storage map ID is invalid");
 }
@@ -129,7 +129,7 @@ void StorageAreaMap::clear(WebCore::Frame* sourceFrame, StorageAreaImpl* sourceA
     m_map = StorageMap::create(m_quotaInBytes);
 
     if (m_mapID)
-        WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::StorageManagerSet::Clear(*m_mapID, sourceArea->identifier(), m_currentSeed, sourceFrame->document()->url()), 0);
+        WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::StorageManagerSet::Clear(*m_mapID, sourceArea->identifier(), m_currentSeed, sourceFrame->document()->url().string()), 0);
     else
         RELEASE_LOG_ERROR(Storage, "StorageAreaMap::clear failed because storage map ID is invalid");
 }
index f945187..4feea5d 100644 (file)
@@ -627,7 +627,7 @@ static NSURL *origin(WebPage& page)
 {
     auto& mainFrame = page.mainWebFrame();
 
-    URL mainFrameURL = { URL(), mainFrame.url() };
+    URL mainFrameURL = mainFrame.url();
     Ref<SecurityOrigin> mainFrameOrigin = SecurityOrigin::create(mainFrameURL);
     String mainFrameOriginString;
     if (!mainFrameOrigin->isUnique())
index bab9c71..e50ca13 100644 (file)
@@ -1,3 +1,62 @@
+2020-04-25  Alex Christensen  <achristensen@webkit.org>
+
+        Prepare to remove automatic URL->String conversion operators
+        https://bugs.webkit.org/show_bug.cgi?id=211007
+
+        Reviewed by Darin Adler.
+
+        * DOM/DOMDocument.mm:
+        (-[DOMDocument URL]):
+        * DOM/DOMHTMLAnchorElement.mm:
+        (-[DOMHTMLAnchorElement href]):
+        * DOM/DOMHTMLAreaElement.mm:
+        (-[DOMHTMLAreaElement href]):
+        * DOM/DOMHTMLEmbedElement.mm:
+        (-[DOMHTMLEmbedElement src]):
+        * DOM/DOMHTMLFormElement.mm:
+        (-[DOMHTMLFormElement action]):
+        * DOM/DOMHTMLFrameElement.mm:
+        (-[DOMHTMLFrameElement src]):
+        (-[DOMHTMLFrameElement location]):
+        * DOM/DOMHTMLHtmlElement.mm:
+        (-[DOMHTMLHtmlElement manifest]):
+        * DOM/DOMHTMLIFrameElement.mm:
+        (-[DOMHTMLIFrameElement src]):
+        * DOM/DOMHTMLImageElement.mm:
+        (-[DOMHTMLImageElement longDesc]):
+        (-[DOMHTMLImageElement src]):
+        (-[DOMHTMLImageElement currentSrc]):
+        (-[DOMHTMLImageElement lowsrc]):
+        * DOM/DOMHTMLInputElement.mm:
+        (-[DOMHTMLInputElement src]):
+        * DOM/DOMHTMLLinkElement.mm:
+        (-[DOMHTMLLinkElement href]):
+        * DOM/DOMHTMLMediaElement.mm:
+        (-[DOMHTMLMediaElement src]):
+        (-[DOMHTMLMediaElement currentSrc]):
+        * DOM/DOMHTMLModElement.mm:
+        (-[DOMHTMLModElement cite]):
+        * DOM/DOMHTMLObjectElement.mm:
+        (-[DOMHTMLObjectElement data]):
+        * DOM/DOMHTMLQuoteElement.mm:
+        (-[DOMHTMLQuoteElement cite]):
+        * DOM/DOMHTMLScriptElement.mm:
+        (-[DOMHTMLScriptElement src]):
+        * DOM/DOMHTMLVideoElement.mm:
+        (-[DOMHTMLVideoElement poster]):
+        * DOM/DOMNode.mm:
+        (-[DOMNode baseURI]):
+        * WebCoreSupport/WebFrameLoaderClient.mm:
+        (WebFrameLoaderClient::updateGlobalHistory):
+        (WebFrameLoaderClient::setTitle):
+        * WebView/WebImmediateActionController.mm:
+        (-[WebImmediateActionController _animationControllerForDataDetectedLink]):
+        * WebView/WebNotification.mm:
+        (-[WebNotification iconURL]):
+        * WebView/WebScriptDebugger.mm:
+        (WebScriptDebugger::sourceParsed):
+        (toNSURL): Deleted.
+
 2020-04-25  Darin Adler  <darin@apple.com>
 
         Move URL to use StringView when returning substrings of the URL
index d1e2c34..0119d3b 100644 (file)
 - (NSString *)URL
 {
     WebCore::JSMainThreadNullState state;
-    return IMPL->urlForBindings();
+    return IMPL->urlForBindings().string();
 }
 
 - (NSString *)cookie
index d60dd4b..eae8026 100644 (file)
 - (NSString *)href
 {
     WebCore::JSMainThreadNullState state;
-    return IMPL->getURLAttribute(WebCore::HTMLNames::hrefAttr);
+    return IMPL->getURLAttribute(WebCore::HTMLNames::hrefAttr).string();
 }
 
 - (void)setHref:(NSString *)newHref
index db55642..fe8a853 100644 (file)
 - (NSString *)href
 {
     WebCore::JSMainThreadNullState state;
-    return IMPL->getURLAttribute(WebCore::HTMLNames::hrefAttr);
+    return IMPL->getURLAttribute(WebCore::HTMLNames::hrefAttr).string();
 }
 
 - (void)setHref:(NSString *)newHref
index 07eb081..976141b 100644 (file)
@@ -78,7 +78,7 @@
 - (NSString *)src
 {
     WebCore::JSMainThreadNullState state;
-    return IMPL->getURLAttribute(WebCore::HTMLNames::srcAttr);
+    return IMPL->getURLAttribute(WebCore::HTMLNames::srcAttr).string();
 }
 
 - (void)setSrc:(NSString *)newSrc
index 7bc61ab..c2efe46 100644 (file)
@@ -56,7 +56,7 @@
 - (NSString *)action
 {
     WebCore::JSMainThreadNullState state;
-    return IMPL->getURLAttribute(WebCore::HTMLNames::actionAttr);
+    return IMPL->getURLAttribute(WebCore::HTMLNames::actionAttr).string();
 }
 
 - (void)setAction:(NSString *)newAction
index d740b1b..266946b 100644 (file)
 - (NSString *)src
 {
     WebCore::JSMainThreadNullState state;
-    return IMPL->getURLAttribute(WebCore::HTMLNames::srcAttr);
+    return IMPL->getURLAttribute(WebCore::HTMLNames::srcAttr).string();
 }
 
 - (void)setSrc:(NSString *)newSrc
 - (NSString *)location
 {
     WebCore::JSMainThreadNullState state;
-    return IMPL->location();
+    return IMPL->location().string();
 }
 
 - (void)setLocation:(NSString *)newLocation
index e00e874..27059ed 100644 (file)
@@ -54,7 +54,7 @@
 - (NSString *)manifest
 {
     WebCore::JSMainThreadNullState state;
-    return IMPL->getURLAttribute(WebCore::HTMLNames::manifestAttr);
+    return IMPL->getURLAttribute(WebCore::HTMLNames::manifestAttr).string();
 }
 
 - (void)setManifest:(NSString *)newManifest
index 177c8c8..f00ac85 100644 (file)
 - (NSString *)src
 {
     WebCore::JSMainThreadNullState state;
-    return IMPL->getURLAttribute(WebCore::HTMLNames::srcAttr);
+    return IMPL->getURLAttribute(WebCore::HTMLNames::srcAttr).string();
 }
 
 - (void)setSrc:(NSString *)newSrc
index 6dde187..f952e2c 100644 (file)
 - (NSString *)longDesc
 {
     WebCore::JSMainThreadNullState state;
-    return IMPL->getURLAttribute(WebCore::HTMLNames::longdescAttr);
+    return IMPL->getURLAttribute(WebCore::HTMLNames::longdescAttr).string();
 }
 
 - (void)setLongDesc:(NSString *)newLongDesc
 - (NSString *)src
 {
     WebCore::JSMainThreadNullState state;
-    return IMPL->getURLAttribute(WebCore::HTMLNames::srcAttr);
+    return IMPL->getURLAttribute(WebCore::HTMLNames::srcAttr).string();
 }
 
 - (void)setSrc:(NSString *)newSrc
 - (NSString *)currentSrc
 {
     WebCore::JSMainThreadNullState state;
-    return IMPL->currentSrc();
+    return IMPL->currentSrc().string();
 }
 
 - (NSString *)useMap
 - (NSString *)lowsrc
 {
     WebCore::JSMainThreadNullState state;
-    return IMPL->getURLAttribute(WebCore::HTMLNames::lowsrcAttr);
+    return IMPL->getURLAttribute(WebCore::HTMLNames::lowsrcAttr).string();
 }
 
 - (void)setLowsrc:(NSString *)newLowsrc
index c3f42e1..d1a4876 100644 (file)
 - (NSString *)src
 {
     WebCore::JSMainThreadNullState state;
-    return IMPL->getURLAttribute(WebCore::HTMLNames::srcAttr);
+    return IMPL->getURLAttribute(WebCore::HTMLNames::srcAttr).string();
 }
 
 - (void)setSrc:(NSString *)newSrc
index 3adf4e5..39b70f5 100644 (file)
@@ -71,7 +71,7 @@
 - (NSString *)href
 {
     WebCore::JSMainThreadNullState state;
-    return IMPL->getURLAttribute(WebCore::HTMLNames::hrefAttr);
+    return IMPL->getURLAttribute(WebCore::HTMLNames::hrefAttr).string();
 }
 
 - (void)setHref:(NSString *)newHref
index e834ef3..3f2bee3 100644 (file)
@@ -55,7 +55,7 @@
 - (NSString *)src
 {
     WebCore::JSMainThreadNullState state;
-    return IMPL->getURLAttribute(WebCore::HTMLNames::srcAttr);
+    return IMPL->getURLAttribute(WebCore::HTMLNames::srcAttr).string();
 }
 
 - (void)setSrc:(NSString *)newSrc
@@ -67,7 +67,7 @@
 - (NSString *)currentSrc
 {
     WebCore::JSMainThreadNullState state;
-    return IMPL->currentSrc();
+    return IMPL->currentSrc().string();
 }
 
 - (NSString *)crossOrigin
index b24baf0..8402300 100644 (file)
@@ -42,7 +42,7 @@
 - (NSString *)cite
 {
     WebCore::JSMainThreadNullState state;
-    return IMPL->getURLAttribute(WebCore::HTMLNames::citeAttr);
+    return IMPL->getURLAttribute(WebCore::HTMLNames::citeAttr).string();
 }
 
 - (void)setCite:(NSString *)newCite
index c1e8910..df9a2d4 100644 (file)
 - (NSString *)data
 {
     WebCore::JSMainThreadNullState state;
-    return IMPL->getURLAttribute(WebCore::HTMLNames::dataAttr);
+    return IMPL->getURLAttribute(WebCore::HTMLNames::dataAttr).string();
 }
 
 - (void)setData:(NSString *)newData
index f4047af..6a8362e 100644 (file)
@@ -42,7 +42,7 @@
 - (NSString *)cite
 {
     WebCore::JSMainThreadNullState state;
-    return IMPL->getURLAttribute(WebCore::HTMLNames::citeAttr);
+    return IMPL->getURLAttribute(WebCore::HTMLNames::citeAttr).string();
 }
 
 - (void)setCite:(NSString *)newCite
index f96daac..7d4eb86 100644 (file)
 - (NSString *)src
 {
     WebCore::JSMainThreadNullState state;
-    return IMPL->getURLAttribute(WebCore::HTMLNames::srcAttr);
+    return IMPL->getURLAttribute(WebCore::HTMLNames::srcAttr).string();
 }
 
 - (void)setSrc:(NSString *)newSrc
index 1e9790f..e7ff039 100644 (file)
@@ -81,7 +81,7 @@
 - (NSString *)poster
 {
     WebCore::JSMainThreadNullState state;
-    return IMPL->getURLAttribute(WebCore::HTMLNames::posterAttr);
+    return IMPL->getURLAttribute(WebCore::HTMLNames::posterAttr).string();
 }
 
 - (void)setPoster:(NSString *)newPoster
index 25e4784..2cd9b33 100644 (file)
@@ -181,7 +181,7 @@ DOMNode *kit(Node* value)
 - (NSString *)baseURI
 {
     JSMainThreadNullState state;
-    return unwrap(*self).baseURI();
+    return unwrap(*self).baseURI().string();
 }
 
 - (NSString *)textContent
index ccae212..96a8891 100644 (file)
@@ -1041,7 +1041,7 @@ void WebFrameLoaderClient::updateGlobalHistory()
     if ([view historyDelegate]) {
         WebHistoryDelegateImplementationCache* implementations = WebViewGetHistoryDelegateImplementations(view);
         if (implementations->navigatedFunc) {
-            WebNavigationData *data = [[WebNavigationData alloc] initWithURLString:loader->url()
+            WebNavigationData *data = [[WebNavigationData alloc] initWithURLString:loader->url().string()
                 title:nilOrNSString(loader->title().string)
                 originalRequest:loader->originalRequestCopy().nsURLRequest(WebCore::HTTPBodyUpdatePolicy::UpdateHTTPBody)
                 response:loader->response().nsURLResponse()
@@ -1352,11 +1352,11 @@ void WebFrameLoaderClient::setTitle(const WebCore::StringWithDirection& title, c
         WebHistoryDelegateImplementationCache* implementations = WebViewGetHistoryDelegateImplementations(view);
         // FIXME: Use direction of title.
         if (implementations->setTitleFunc)
-            CallHistoryDelegate(implementations->setTitleFunc, view, @selector(webView:updateHistoryTitle:forURL:inFrame:), (NSString *)title.string, (NSString *)url, m_webFrame.get());
+            CallHistoryDelegate(implementations->setTitleFunc, view, @selector(webView:updateHistoryTitle:forURL:inFrame:), (NSString *)title.string, (NSString *)url.string(), m_webFrame.get());
         else if (implementations->deprecatedSetTitleFunc) {
-IGNORE_WARNINGS_BEGIN("undeclared-selector")
-            CallHistoryDelegate(implementations->deprecatedSetTitleFunc, view, @selector(webView:updateHistoryTitle:forURL:), (NSString *)title.string, (NSString *)url);
-IGNORE_WARNINGS_END
+            IGNORE_WARNINGS_BEGIN("undeclared-selector")
+            CallHistoryDelegate(implementations->deprecatedSetTitleFunc, view, @selector(webView:updateHistoryTitle:forURL:), (NSString *)title.string, (NSString *)url.string());
+            IGNORE_WARNINGS_END
         }
         return;
     }
index f141863..a2d99b6 100644 (file)
@@ -484,7 +484,7 @@ static WebCore::IntRect elementBoundingBoxInWindowCoordinatesFromNode(WebCore::N
 
     [_currentActionContext setHighlightFrame:[_webView.window convertRectToScreen:elementBoundingBoxInWindowCoordinatesFromNode(_hitTestResult.URLElement())]];
 
-    NSArray *menuItems = [[getDDActionsManagerClass() sharedManager] menuItemsForTargetURL:_hitTestResult.absoluteLinkURL() actionContext:_currentActionContext.get()];
+    NSArray *menuItems = [[getDDActionsManagerClass() sharedManager] menuItemsForTargetURL:_hitTestResult.absoluteLinkURL().string() actionContext:_currentActionContext.get()];
     if (menuItems.count != 1)
         return nil;
     
index 8beda0d..d1ff835 100644 (file)
@@ -116,7 +116,7 @@ Notification* core(WebNotification *notification)
 - (NSString *)iconURL
 {
 #if ENABLE(NOTIFICATIONS)
-    return core(self)->icon();
+    return core(self)->icon().string();
 #else
     return nil;
 #endif
index 1457398..1a58842 100644 (file)
@@ -54,14 +54,6 @@ static NSString *toNSString(JSC::SourceProvider* sourceProvider)
     return sourceString;
 }
 
-// Convert String to NSURL.
-static NSURL *toNSURL(const String& s)
-{
-    if (s.isEmpty())
-        return nil;
-    return URL({ }, s);
-}
-
 static WebFrame *toWebFrame(JSC::JSGlobalObject* globalObject)
 {
     WebCore::JSDOMWindow* window = static_cast<WebCore::JSDOMWindow*>(globalObject);
@@ -87,7 +79,7 @@ void WebScriptDebugger::sourceParsed(JSC::JSGlobalObject* lexicalGlobalObject, J
     m_callingDelegate = true;
 
     NSString *nsSource = toNSString(sourceProvider);
-    NSURL *nsURL = toNSURL(sourceProvider->url());
+    NSURL *nsURL = sourceProvider->url();
     int firstLine = sourceProvider->startPosition().m_line.oneBasedInt();
 
     JSC::VM& vm = lexicalGlobalObject->vm();