URL::host should return a StringView to reduce allocations
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 May 2018 20:39:37 +0000 (20:39 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 May 2018 20:39:37 +0000 (20:39 +0000)
commit93d7a1e5932a9c309bb8966beef64c2ec34fe745
tree6284e2e0e23bf51f0fa978f1fffede5743ec922b
parente565cda0532cad255d065a87b0316855d708e95b
URL::host should return a StringView to reduce allocations
https://bugs.webkit.org/show_bug.cgi?id=185986

Reviewed by Geoff Garen.

Source/WebCore:

No change in behaviour.  Just fewer allocations.

* Modules/plugins/YouTubePluginReplacement.cpp:
(WebCore::isYouTubeURL):
(WebCore::processAndCreateYouTubeURL):
* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::hostName):
(WebCore::WebSocketHandshake::host const):
* contentextensions/ContentExtension.cpp:
(WebCore::ContentExtensions::ContentExtension::populateConditionCacheIfNeeded):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parseAttribute):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaSessionTitle const):
(WebCore::needsSeekingSupportQuirk):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::restartSimilarPlugIns):
(WebCore::HTMLPlugInImageElement::userDidClickSnapshot):
(WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn):
* html/ImageDocument.cpp:
(WebCore::ImageDocument::finishedParsing):
* html/URLUtils.h:
(WebCore::URLUtils<T>::hostname const):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::setFirstPartyForCookies):
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::loadLink):
* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::primaryDomain):
* loader/mac/LoaderNSURLExtras.mm:
(suggestedFilenameWithMIMEType):
* page/Chrome.cpp:
(WebCore::Chrome::mouseDidMoveOverElement):
* page/Location.cpp:
(WebCore::Location::hostname const):
* page/Page.cpp:
(WebCore::Page::mainFrameLoadStarted):
* page/PerformanceMonitor.cpp:
(WebCore::reportPageOverPostLoadResourceThreshold):
* page/SecurityOrigin.cpp:
(WebCore::isLoopbackIPAddress):
(WebCore::shouldTreatAsPotentiallyTrustworthy):
(WebCore::SecurityOrigin::isLocalHostOrLoopbackIPAddress):
* page/SecurityOrigin.h:
* page/SecurityOriginData.h:
(WebCore::SecurityOriginData::fromURL):
* page/UserContentURLPattern.cpp:
(WebCore::UserContentURLPattern::matchesHost const):
* page/csp/ContentSecurityPolicySource.cpp:
(WebCore::ContentSecurityPolicySource::hostMatches const):
* platform/PublicSuffix.h:
* platform/URL.cpp:
(WebCore::URL::host const):
(WebCore::URL::hostAndPort const):
(WebCore::URL::isMatchingDomain const):
* platform/URL.h:
* platform/mac/SSLKeyGeneratorMac.mm:
(WebCore::signedPublicKeyAndChallengeString):
* platform/network/ResourceRequestBase.h:
(WebCore::registrableDomainsAreEqual):
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::getPartitioningDomain):
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::SocketStreamHandleImpl::createStreams):
* workers/WorkerLocation.cpp:
(WebCore::WorkerLocation::hostname const):
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::performGetOriginsWithRegistrationsCallbacks):

Source/WebKit:

* NetworkProcess/NetworkProcess.cpp:
(WebKit::fetchDiskCacheEntries):
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::areFrameAncestorsSameSite):
* NetworkProcess/mac/NetworkProcessMac.mm:
(WebKit::overrideSystemProxies):
* Shared/API/APIURL.h:
(API::URL::host const):
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::addSingleCookie):
(WebKit::WebAutomationSession::deleteAllCookies):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::pluginDidReceiveUserInteraction):
* WebProcess/Plugins/WebPluginInfoProvider.cpp:
(WebKit::WebPluginInfoProvider::populatePluginCache):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::needsHiddenContentEditableQuirk):
(WebKit::needsPlainTextQuirk):
(WebKit::WebPage::determinePrimarySnapshottedPlugIn):

Source/WebKitLegacy:

* WebCoreSupport/WebResourceLoadScheduler.cpp:
(WebResourceLoadScheduler::hostForURL):

Tools:

* TestWebKitAPI/Tests/WebCore/URL.cpp:
(TestWebKitAPI::TEST_F):
* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::eq):
* TestWebKitAPI/Tests/mac/SSLKeyGenerator.mm:
(TestWebKitAPI::SSLKeyGeneratorTest::TearDown):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232198 268f45cc-cd09-0410-ab3c-d52691b4dbfc
52 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/plugins/YouTubePluginReplacement.cpp
Source/WebCore/Modules/websockets/WebSocketHandshake.cpp
Source/WebCore/contentextensions/ContentExtension.cpp
Source/WebCore/html/HTMLAnchorElement.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLPlugInImageElement.cpp
Source/WebCore/html/ImageDocument.cpp
Source/WebCore/html/URLUtils.h
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/LinkLoader.cpp
Source/WebCore/loader/ResourceLoadStatistics.cpp
Source/WebCore/loader/mac/LoaderNSURLExtras.mm
Source/WebCore/page/Chrome.cpp
Source/WebCore/page/Location.cpp
Source/WebCore/page/Page.cpp
Source/WebCore/page/PerformanceMonitor.cpp
Source/WebCore/page/SecurityOrigin.cpp
Source/WebCore/page/SecurityOrigin.h
Source/WebCore/page/SecurityOriginData.h
Source/WebCore/page/UserContentURLPattern.cpp
Source/WebCore/page/csp/ContentSecurityPolicySource.cpp
Source/WebCore/platform/PublicSuffix.h
Source/WebCore/platform/URL.cpp
Source/WebCore/platform/URL.h
Source/WebCore/platform/UserAgentQuirks.cpp
Source/WebCore/platform/mac/SSLKeyGeneratorMac.mm
Source/WebCore/platform/network/ResourceRequestBase.h
Source/WebCore/platform/network/cf/NetworkStorageSessionCFNet.cpp
Source/WebCore/platform/network/cf/SocketStreamHandleImplCFNet.cpp
Source/WebCore/platform/network/curl/CookieJarDB.cpp
Source/WebCore/platform/network/soup/SoupNetworkSession.cpp
Source/WebCore/platform/win/PasteboardWin.cpp
Source/WebCore/workers/WorkerLocation.cpp
Source/WebCore/workers/service/server/SWServer.cpp
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/NetworkProcess.cpp
Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp
Source/WebKit/NetworkProcess/mac/NetworkProcessMac.mm
Source/WebKit/Shared/API/APIURL.h
Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebProcessProxy.cpp
Source/WebKit/WebProcess/Plugins/PluginView.cpp
Source/WebKit/WebProcess/Plugins/WebPluginInfoProvider.cpp
Source/WebKit/WebProcess/WebPage/WebPage.cpp
Source/WebKitLegacy/ChangeLog
Source/WebKitLegacy/WebCoreSupport/WebResourceLoadScheduler.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebCore/URL.cpp
Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp
Tools/TestWebKitAPI/Tests/mac/SSLKeyGenerator.mm