WebKit Bugzilla
Attachment 341311 Details for
Bug 185986
: URL::host should return a StringView to reduce allocations
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185986-20180525125310.patch (text/plain), 49.01 KB, created by
Alex Christensen
on 2018-05-25 12:53:13 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Alex Christensen
Created:
2018-05-25 12:53:13 PDT
Size:
49.01 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 232175) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,79 @@ >+2018-05-25 Alex Christensen <achristensen@webkit.org> >+ >+ URL::host should return a StringView to reduce allocations >+ https://bugs.webkit.org/show_bug.cgi?id=185986 >+ >+ Reviewed by Geoff Garen. >+ >+ 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): >+ > 2018-05-24 Chris Dumez <cdumez@apple.com> > > Reduce copying of FontCascadeDescription objects by moving them around >Index: Source/WebCore/Modules/plugins/YouTubePluginReplacement.cpp >=================================================================== >--- Source/WebCore/Modules/plugins/YouTubePluginReplacement.cpp (revision 232175) >+++ Source/WebCore/Modules/plugins/YouTubePluginReplacement.cpp (working copy) >@@ -176,7 +176,7 @@ static YouTubePluginReplacement::KeyValu > > static bool isYouTubeURL(const URL& url) > { >- String hostName = url.host(); >+ auto hostName = url.host(); > return equalLettersIgnoringASCIICase(hostName, "m.youtube.com") > || equalLettersIgnoringASCIICase(hostName, "youtu.be") > || equalLettersIgnoringASCIICase(hostName, "www.youtube.com") >@@ -203,7 +203,7 @@ static URL processAndCreateYouTubeURL(co > if (!isYouTubeURL(url)) > return URL(); > >- String hostName = url.host(); >+ auto hostName = url.host(); > bool isYouTubeMobileWebAppURL = equalLettersIgnoringASCIICase(hostName, "m.youtube.com"); > isYouTubeShortenedURL = equalLettersIgnoringASCIICase(hostName, "youtu.be"); > >Index: Source/WebCore/Modules/websockets/WebSocketHandshake.cpp >=================================================================== >--- Source/WebCore/Modules/websockets/WebSocketHandshake.cpp (revision 232175) >+++ Source/WebCore/Modules/websockets/WebSocketHandshake.cpp (working copy) >@@ -82,7 +82,7 @@ static String hostName(const URL& url, b > { > ASSERT(url.protocolIs("wss") == secure); > StringBuilder builder; >- builder.append(url.host().convertToASCIILowercase()); >+ builder.append(url.host().toString().convertToASCIILowercase()); > if (url.port() && ((!secure && url.port().value() != 80) || (secure && url.port().value() != 443))) { > builder.append(':'); > builder.appendNumber(url.port().value()); >@@ -146,7 +146,7 @@ void WebSocketHandshake::setURL(const UR > // FIXME: Return type should just be String, not const String. > const String WebSocketHandshake::host() const > { >- return m_url.host().convertToASCIILowercase(); >+ return m_url.host().toString().convertToASCIILowercase(); > } > > const String& WebSocketHandshake::clientProtocol() const >Index: Source/WebCore/contentextensions/ContentExtension.cpp >=================================================================== >--- Source/WebCore/contentextensions/ContentExtension.cpp (revision 232175) >+++ Source/WebCore/contentextensions/ContentExtension.cpp (working copy) >@@ -122,7 +122,7 @@ void ContentExtension::populateCondition > if (m_cachedTopURL != topURL) { > DFABytecodeInterpreter interpreter(m_compiledExtension->topURLFiltersBytecode(), m_compiledExtension->topURLFiltersBytecodeLength()); > const uint16_t allLoadTypesAndResourceTypes = LoadTypeMask | ResourceTypeMask; >- String string = m_compiledExtension->conditionsApplyOnlyToDomain() ? topURL.host() : topURL.string(); >+ String string = m_compiledExtension->conditionsApplyOnlyToDomain() ? topURL.host().toString() : topURL.string(); > auto topURLActions = interpreter.interpret(string.utf8(), allLoadTypesAndResourceTypes); > > m_cachedTopURLActions.clear(); >Index: Source/WebCore/html/HTMLAnchorElement.cpp >=================================================================== >--- Source/WebCore/html/HTMLAnchorElement.cpp (revision 232175) >+++ Source/WebCore/html/HTMLAnchorElement.cpp (working copy) >@@ -244,7 +244,7 @@ void HTMLAnchorElement::parseAttribute(c > String parsedURL = stripLeadingAndTrailingHTMLSpaces(value); > if (document().isDNSPrefetchEnabled() && document().frame()) { > if (protocolIsInHTTPFamily(parsedURL) || parsedURL.startsWith("//")) >- document().frame()->loader().client().prefetchDNS(document().completeURL(parsedURL).host()); >+ document().frame()->loader().client().prefetchDNS(document().completeURL(parsedURL).host().toString()); > } > } > invalidateCachedVisitedLinkHash(); >Index: Source/WebCore/html/HTMLMediaElement.cpp >=================================================================== >--- Source/WebCore/html/HTMLMediaElement.cpp (revision 232175) >+++ Source/WebCore/html/HTMLMediaElement.cpp (working copy) >@@ -7461,7 +7461,7 @@ String HTMLMediaElement::mediaSessionTit > if (!title.isEmpty()) > return title; > >- title = m_currentSrc.host(); >+ title = m_currentSrc.host().toString(); > #if PLATFORM(MAC) || PLATFORM(IOS) > if (!title.isEmpty()) > title = decodeHostName(title); >@@ -7524,7 +7524,7 @@ static bool needsSeekingSupportQuirk(Doc > if (!document.settings().needsSiteSpecificQuirks()) > return false; > >- String host = document.topDocument().url().host(); >+ auto host = document.topDocument().url().host(); > return equalLettersIgnoringASCIICase(host, "netflix.com") || host.endsWithIgnoringASCIICase(".netflix.com"); > } > >Index: Source/WebCore/html/HTMLPlugInImageElement.cpp >=================================================================== >--- Source/WebCore/html/HTMLPlugInImageElement.cpp (revision 232175) >+++ Source/WebCore/html/HTMLPlugInImageElement.cpp (working copy) >@@ -435,7 +435,7 @@ void HTMLPlugInImageElement::restartSimi > // Restart any other snapshotted plugins in the page with the same origin. Note that they > // may be in different frames, so traverse from the top of the document. > >- String plugInOrigin = m_loadedUrl.host(); >+ auto plugInOrigin = m_loadedUrl.host(); > String mimeType = serviceType(); > Vector<Ref<HTMLPlugInImageElement>> similarPlugins; > >@@ -469,9 +469,9 @@ void HTMLPlugInImageElement::userDidClic > if (forwardEvent) > m_pendingClickEventFromSnapshot = &event; > >- String plugInOrigin = m_loadedUrl.host(); >+ auto plugInOrigin = m_loadedUrl.host(); > if (document().page() && !SchemeRegistry::shouldTreatURLSchemeAsLocal(document().page()->mainFrame().document()->baseURL().protocol().toStringWithoutCopying()) && document().page()->settings().autostartOriginPlugInSnapshottingEnabled()) >- document().page()->plugInClient()->didStartFromOrigin(document().page()->mainFrame().document()->baseURL().host(), plugInOrigin, serviceType(), document().page()->sessionID()); >+ document().page()->plugInClient()->didStartFromOrigin(document().page()->mainFrame().document()->baseURL().host().toString(), plugInOrigin.toString(), serviceType(), document().page()->sessionID()); > > LOG(Plugins, "%p User clicked on snapshotted plug-in. Restart.", this); > restartSnapshottedPlugIn(); >@@ -675,7 +675,7 @@ void HTMLPlugInImageElement::subframeLoa > return; > } > >- if (document().page()->settings().autostartOriginPlugInSnapshottingEnabled() && document().page()->plugInClient() && document().page()->plugInClient()->shouldAutoStartFromOrigin(document().page()->mainFrame().document()->baseURL().host(), url.host(), serviceType())) { >+ if (document().page()->settings().autostartOriginPlugInSnapshottingEnabled() && document().page()->plugInClient() && document().page()->plugInClient()->shouldAutoStartFromOrigin(document().page()->mainFrame().document()->baseURL().host().toString(), url.host().toString(), serviceType())) { > LOG(Plugins, "%p Plug-in from (%s, %s) is marked to auto-start, set to play", this, document().page()->mainFrame().document()->baseURL().host().utf8().data(), url.host().utf8().data()); > m_snapshotDecision = NeverSnapshot; > return; >Index: Source/WebCore/html/ImageDocument.cpp >=================================================================== >--- Source/WebCore/html/ImageDocument.cpp (revision 232175) >+++ Source/WebCore/html/ImageDocument.cpp (working copy) >@@ -168,7 +168,7 @@ void ImageDocument::finishedParsing() > // back on the hostname if there is no path. > String name = decodeURLEscapeSequences(url().lastPathComponent()); > if (name.isEmpty()) >- name = url().host(); >+ name = url().host().toString(); > setTitle(imageTitle(name, size)); > } > >Index: Source/WebCore/html/URLUtils.h >=================================================================== >--- Source/WebCore/html/URLUtils.h (revision 232175) >+++ Source/WebCore/html/URLUtils.h (working copy) >@@ -186,7 +186,7 @@ void URLUtils<T>::setHost(const String& > template <typename T> > String URLUtils<T>::hostname() const > { >- return href().host(); >+ return href().host().toString(); > } > > template <typename T> >Index: Source/WebCore/loader/FrameLoader.cpp >=================================================================== >--- Source/WebCore/loader/FrameLoader.cpp (revision 232175) >+++ Source/WebCore/loader/FrameLoader.cpp (working copy) >@@ -1076,7 +1076,7 @@ void FrameLoader::setFirstPartyForCookie > for (Frame* frame = &m_frame; frame; frame = frame->tree().traverseNext(&m_frame)) > frame->document()->setFirstPartyForCookies(url); > >- String registrableDomain = ResourceRequest::partitionName(url.host()); >+ String registrableDomain = ResourceRequest::partitionName(url.host().toString()); > for (Frame* frame = &m_frame; frame; frame = frame->tree().traverseNext(&m_frame)) { > if (SecurityPolicy::shouldInheritSecurityOriginFromOwner(frame->document()->url()) || registrableDomainsAreEqual(frame->document()->url(), registrableDomain)) > frame->document()->setFirstPartyForSameSiteCookies(url); >Index: Source/WebCore/loader/LinkLoader.cpp >=================================================================== >--- Source/WebCore/loader/LinkLoader.cpp (revision 232175) >+++ Source/WebCore/loader/LinkLoader.cpp (working copy) >@@ -294,7 +294,7 @@ bool LinkLoader::loadLink(const LinkRelA > // FIXME: The href attribute of the link element can be in "//hostname" form, and we shouldn't attempt > // to complete that as URL <https://bugs.webkit.org/show_bug.cgi?id=48857>. > if (document.settings().dnsPrefetchingEnabled() && href.isValid() && !href.isEmpty() && document.frame()) >- document.frame()->loader().client().prefetchDNS(href.host()); >+ document.frame()->loader().client().prefetchDNS(href.host().toString()); > } > > preconnectIfNeeded(relAttribute, href, document, crossOrigin); >Index: Source/WebCore/loader/ResourceLoadStatistics.cpp >=================================================================== >--- Source/WebCore/loader/ResourceLoadStatistics.cpp (revision 232175) >+++ Source/WebCore/loader/ResourceLoadStatistics.cpp (working copy) >@@ -333,7 +333,7 @@ void ResourceLoadStatistics::merge(const > > String ResourceLoadStatistics::primaryDomain(const URL& url) > { >- return primaryDomain(url.host()); >+ return primaryDomain(url.host().toString()); > } > > String ResourceLoadStatistics::primaryDomain(const String& host) >Index: Source/WebCore/loader/mac/LoaderNSURLExtras.mm >=================================================================== >--- Source/WebCore/loader/mac/LoaderNSURLExtras.mm (revision 232175) >+++ Source/WebCore/loader/mac/LoaderNSURLExtras.mm (working copy) >@@ -48,7 +48,7 @@ NSString *suggestedFilenameWithMIMEType( > > if ([filename length] == 0 || [lastPathComponent isEqualToString:@"/"]) { > // lastPathComponent is no good, try the host. >- NSString *host = URL(url).host(); >+ NSString *host = URL(url).host().toString(); > filename = filenameByFixingIllegalCharacters(host); > if ([filename length] == 0) { > // Can't make a filename using this URL, use "unknown". >Index: Source/WebCore/page/Chrome.cpp >=================================================================== >--- Source/WebCore/page/Chrome.cpp (revision 232175) >+++ Source/WebCore/page/Chrome.cpp (working copy) >@@ -324,7 +324,7 @@ void Chrome::setStatusbarText(Frame& fra > void Chrome::mouseDidMoveOverElement(const HitTestResult& result, unsigned modifierFlags) > { > if (result.innerNode() && result.innerNode()->document().isDNSPrefetchEnabled()) >- m_page.mainFrame().loader().client().prefetchDNS(result.absoluteLinkURL().host()); >+ m_page.mainFrame().loader().client().prefetchDNS(result.absoluteLinkURL().host().toString()); > m_client.mouseDidMoveOverElement(result, modifierFlags); > > InspectorInstrumentation::mouseDidMoveOverElement(m_page, result, modifierFlags); >Index: Source/WebCore/page/Location.cpp >=================================================================== >--- Source/WebCore/page/Location.cpp (revision 232175) >+++ Source/WebCore/page/Location.cpp (working copy) >@@ -94,7 +94,7 @@ String Location::hostname() const > if (!m_frame) > return String(); > >- return url().host(); >+ return url().host().toString(); > } > > String Location::port() const >Index: Source/WebCore/page/Page.cpp >=================================================================== >--- Source/WebCore/page/Page.cpp (revision 232175) >+++ Source/WebCore/page/Page.cpp (working copy) >@@ -2104,7 +2104,7 @@ void Page::mainFrameLoadStarted(const UR > { > String domain; > #if ENABLE(PUBLIC_SUFFIX_LIST) >- domain = topPrivatelyControlledDomain(destinationURL.host()); >+ domain = topPrivatelyControlledDomain(destinationURL.host().toString()); > #else > UNUSED_PARAM(destinationURL); > #endif >Index: Source/WebCore/page/PerformanceMonitor.cpp >=================================================================== >--- Source/WebCore/page/PerformanceMonitor.cpp (revision 232175) >+++ Source/WebCore/page/PerformanceMonitor.cpp (working copy) >@@ -148,7 +148,7 @@ static void reportPageOverPostLoadResour > if (!document) > return; > >- String domain = topPrivatelyControlledDomain(document->url().host()); >+ String domain = topPrivatelyControlledDomain(document->url().host().toString()); > if (domain.isEmpty()) > return; > >Index: Source/WebCore/page/SecurityOrigin.cpp >=================================================================== >--- Source/WebCore/page/SecurityOrigin.cpp (revision 232175) >+++ Source/WebCore/page/SecurityOrigin.cpp (working copy) >@@ -99,7 +99,7 @@ static bool shouldTreatAsUniqueOrigin(co > return false; > } > >-static bool isLoopbackIPAddress(const String& host) >+static bool isLoopbackIPAddress(StringView host) > { > // The IPv6 loopback address is 0:0:0:0:0:0:0:1, which compresses to ::1. > if (host == "[::1]") >@@ -137,7 +137,7 @@ static bool shouldTreatAsPotentiallyTrus > > bool shouldTreatAsPotentiallyTrustworthy(const URL& url) > { >- return shouldTreatAsPotentiallyTrustworthy(url.protocol().toStringWithoutCopying(), url.host()); >+ return shouldTreatAsPotentiallyTrustworthy(url.protocol().toStringWithoutCopying(), url.host().toStringWithoutCopying()); > } > > SecurityOrigin::SecurityOrigin(const URL& url) >@@ -548,7 +548,7 @@ bool SecurityOrigin::isSameSchemeHostPor > return true; > } > >-bool SecurityOrigin::isLocalHostOrLoopbackIPAddress(const String& host) >+bool SecurityOrigin::isLocalHostOrLoopbackIPAddress(StringView host) > { > if (isLoopbackIPAddress(host)) > return true; >Index: Source/WebCore/page/SecurityOrigin.h >=================================================================== >--- Source/WebCore/page/SecurityOrigin.h (revision 232175) >+++ Source/WebCore/page/SecurityOrigin.h (working copy) >@@ -202,7 +202,7 @@ public: > > bool isPotentiallyTrustworthy() const { return m_isPotentiallyTrustworthy; } > >- static bool isLocalHostOrLoopbackIPAddress(const String& host); >+ static bool isLocalHostOrLoopbackIPAddress(StringView); > > const SecurityOriginData& data() const { return m_data; } > >Index: Source/WebCore/page/SecurityOriginData.h >=================================================================== >--- Source/WebCore/page/SecurityOriginData.h (revision 232175) >+++ Source/WebCore/page/SecurityOriginData.h (working copy) >@@ -50,7 +50,7 @@ struct SecurityOriginData { > { > return SecurityOriginData { > url.protocol().isNull() ? emptyString() : url.protocol().toString().convertToASCIILowercase(), >- url.host().isNull() ? emptyString() : url.host().convertToASCIILowercase(), >+ url.host().isNull() ? emptyString() : url.host().toString().convertToASCIILowercase(), > url.port() > }; > } >Index: Source/WebCore/page/UserContentURLPattern.cpp >=================================================================== >--- Source/WebCore/page/UserContentURLPattern.cpp (revision 232175) >+++ Source/WebCore/page/UserContentURLPattern.cpp (working copy) >@@ -125,7 +125,7 @@ bool UserContentURLPattern::matches(cons > > bool UserContentURLPattern::matchesHost(const URL& test) const > { >- const String& host = test.host(); >+ auto host = test.host(); > if (equalIgnoringASCIICase(host, m_host)) > return true; > >Index: Source/WebCore/page/csp/ContentSecurityPolicySource.cpp >=================================================================== >--- Source/WebCore/page/csp/ContentSecurityPolicySource.cpp (revision 232175) >+++ Source/WebCore/page/csp/ContentSecurityPolicySource.cpp (working copy) >@@ -64,8 +64,8 @@ bool ContentSecurityPolicySource::scheme > > bool ContentSecurityPolicySource::hostMatches(const URL& url) const > { >- const String& host = url.host(); >- return equalIgnoringASCIICase(host, m_host) || (m_hostHasWildcard && host.endsWithIgnoringASCIICase("." + m_host)); >+ auto host = url.host(); >+ return equalIgnoringASCIICase(host, m_host) || (m_hostHasWildcard && host.endsWithIgnoringASCIICase(makeString(".", m_host))); > > } > >Index: Source/WebCore/platform/PublicSuffix.h >=================================================================== >--- Source/WebCore/platform/PublicSuffix.h (revision 232175) >+++ Source/WebCore/platform/PublicSuffix.h (working copy) >@@ -23,8 +23,7 @@ > * THE POSSIBILITY OF SUCH DAMAGE. > */ > >-#ifndef PublicSuffix_h >-#define PublicSuffix_h >+#pragma once > > #include <wtf/text/WTFString.h> > >@@ -39,5 +38,3 @@ String decodeHostName(const String& doma > } // namespace WebCore > > #endif // ENABLE(PUBLIC_SUFFIX_LIST) >- >-#endif // PublicSuffix_h >Index: Source/WebCore/platform/URL.cpp >=================================================================== >--- Source/WebCore/platform/URL.cpp (revision 232175) >+++ Source/WebCore/platform/URL.cpp (working copy) >@@ -155,10 +155,10 @@ StringView URL::protocol() const > return StringView(m_string).substring(0, m_schemeEnd); > } > >-String URL::host() const >+StringView URL::host() const > { > unsigned start = hostStart(); >- return m_string.substring(start, m_hostEnd - start); >+ return StringView(m_string).substring(start, m_hostEnd - start); > } > > std::optional<uint16_t> URL::port() const >@@ -180,8 +180,8 @@ std::optional<uint16_t> URL::port() cons > String URL::hostAndPort() const > { > if (auto port = this->port()) >- return host() + ':' + String::number(port.value()); >- return host(); >+ return makeString(host(), ':', String::number(port.value())); >+ return host().toString(); > } > > String URL::protocolHostAndPort() const >@@ -796,7 +796,7 @@ bool URL::isMatchingDomain(const String& > if (!host.endsWith(domain)) > return false; > >- return host.length() == domain.length() || host.characterAt(host.length() - domain.length() - 1) == '.'; >+ return host.length() == domain.length() || host[host.length() - domain.length() - 1] == '.'; > } > > String encodeWithURLEscapeSequences(const String& input) >Index: Source/WebCore/platform/URL.h >=================================================================== >--- Source/WebCore/platform/URL.h (revision 232175) >+++ Source/WebCore/platform/URL.h (working copy) >@@ -104,7 +104,7 @@ public: > WEBCORE_EXPORT String stringCenterEllipsizedToLength(unsigned length = 1024) const; > > WEBCORE_EXPORT StringView protocol() const; >- WEBCORE_EXPORT String host() const; >+ WEBCORE_EXPORT StringView host() const; > WEBCORE_EXPORT std::optional<uint16_t> port() const; > WEBCORE_EXPORT String hostAndPort() const; > WEBCORE_EXPORT String protocolHostAndPort() const; >Index: Source/WebCore/platform/UserAgentQuirks.cpp >=================================================================== >--- Source/WebCore/platform/UserAgentQuirks.cpp (revision 232175) >+++ Source/WebCore/platform/UserAgentQuirks.cpp (working copy) >@@ -36,7 +36,7 @@ namespace WebCore { > > static bool isGoogle(const URL& url) > { >- String baseDomain = topPrivatelyControlledDomain(url.host()); >+ String baseDomain = topPrivatelyControlledDomain(url.host().toString()); > > // Our Google UA is *very* complicated to get right. Read > // https://webkit.org/b/142074 carefully before changing. Test that Earth >@@ -60,7 +60,7 @@ static bool isGoogle(const URL& url) > // that works in Chrome that WebKit cannot handle. Prefer other quirks instead. > static bool urlRequiresChromeBrowser(const URL& url) > { >- String baseDomain = topPrivatelyControlledDomain(url.host()); >+ String baseDomain = topPrivatelyControlledDomain(url.host().toString()); > > // Needed for fonts on many sites to work with WebKit. > // https://bugs.webkit.org/show_bug.cgi?id=147296 >@@ -78,7 +78,7 @@ static bool urlRequiresChromeBrowser(con > > static bool urlRequiresMacintoshPlatform(const URL& url) > { >- String domain = url.host(); >+ String domain = url.host().toString(); > String baseDomain = topPrivatelyControlledDomain(domain); > > // At least finance.yahoo.com displays a mobile version with WebKitGTK+'s standard user agent. >Index: Source/WebCore/platform/mac/SSLKeyGeneratorMac.mm >=================================================================== >--- Source/WebCore/platform/mac/SSLKeyGeneratorMac.mm (revision 232175) >+++ Source/WebCore/platform/mac/SSLKeyGeneratorMac.mm (working copy) >@@ -246,7 +246,7 @@ String signedPublicKeyAndChallengeString > > auto challenge = challengeString.isAllASCII() ? challengeString.ascii() : ""; > >- return signedPublicKeyAndChallengeString(keySize, challenge, keygenKeychainItemName(url.host())); >+ return signedPublicKeyAndChallengeString(keySize, challenge, keygenKeychainItemName(url.host().toString())); > } > > } >Index: Source/WebCore/platform/network/ResourceRequestBase.h >=================================================================== >--- Source/WebCore/platform/network/ResourceRequestBase.h (revision 232175) >+++ Source/WebCore/platform/network/ResourceRequestBase.h (working copy) >@@ -255,11 +255,11 @@ bool equalIgnoringHeaderFields(const Res > // FIXME: Find a better place for these functions. > inline bool registrableDomainsAreEqual(const URL& a, const URL& b) > { >- return ResourceRequestBase::partitionName(a.host()) == ResourceRequestBase::partitionName(b.host()); >+ return ResourceRequestBase::partitionName(a.host().toString()) == ResourceRequestBase::partitionName(b.host().toString()); > } > inline bool registrableDomainsAreEqual(const URL& a, const String& registrableDomain) > { >- return ResourceRequestBase::partitionName(a.host()) == registrableDomain; >+ return ResourceRequestBase::partitionName(a.host().toString()) == registrableDomain; > } > > inline bool operator==(const ResourceRequest& a, const ResourceRequest& b) { return ResourceRequestBase::equal(a, b); } >Index: Source/WebCore/platform/network/cf/NetworkStorageSessionCFNet.cpp >=================================================================== >--- Source/WebCore/platform/network/cf/NetworkStorageSessionCFNet.cpp (revision 232175) >+++ Source/WebCore/platform/network/cf/NetworkStorageSessionCFNet.cpp (working copy) >@@ -198,11 +198,11 @@ String NetworkStorageSession::cookieStor > static inline String getPartitioningDomain(const URL& url) > { > #if ENABLE(PUBLIC_SUFFIX_LIST) >- auto domain = topPrivatelyControlledDomain(url.host()); >+ auto domain = topPrivatelyControlledDomain(url.host().toString()); > if (domain.isEmpty()) >- domain = url.host(); >+ domain = url.host().toString(); > #else >- auto domain = url.host(); >+ auto domain = url.host().toString(); > #endif > return domain; > } >Index: Source/WebCore/platform/network/cf/SocketStreamHandleImplCFNet.cpp >=================================================================== >--- Source/WebCore/platform/network/cf/SocketStreamHandleImplCFNet.cpp (revision 232175) >+++ Source/WebCore/platform/network/cf/SocketStreamHandleImplCFNet.cpp (working copy) >@@ -312,7 +312,7 @@ void SocketStreamHandleImpl::createStrea > if (m_connectionType == Unknown) > return; > >- RetainPtr<CFStringRef> host = m_url.host().createCFString(); >+ RetainPtr<CFStringRef> host = m_url.host().toString().createCFString(); > > // Creating streams to final destination, not to proxy. > CFReadStreamRef readStream = 0; >Index: Source/WebCore/platform/network/curl/CookieJarDB.cpp >=================================================================== >--- Source/WebCore/platform/network/curl/CookieJarDB.cpp (revision 232175) >+++ Source/WebCore/platform/network/curl/CookieJarDB.cpp (working copy) >@@ -245,7 +245,7 @@ bool CookieJarDB::searchCookies(const St > return false; > > URL requestUrlObj(ParsedURLString, requestUrl); >- String requestHost(requestUrlObj.host().convertToASCIILowercase()); >+ String requestHost(requestUrlObj.host().toString().convertToASCIILowercase()); > String requestPath(requestUrlObj.path().convertToASCIILowercase()); > > if (requestHost.isEmpty()) >@@ -382,7 +382,7 @@ int CookieJarDB::setCookie(const String& > return -1; > > URL urlObj(ParsedURLString, url); >- String host(urlObj.host()); >+ String host(urlObj.host().toString()); > String path(urlObj.path()); > > Cookie cookieObj; >@@ -417,7 +417,7 @@ int CookieJarDB::deleteCookie(const Stri > > URL urlObj(ParsedURLString, urlCopied); > if (urlObj.isValid()) { >- String hostStr(urlObj.host()); >+ String hostStr(urlObj.host().toString()); > String pathStr(urlObj.path()); > int ret = deleteCookieInternal(name, hostStr, pathStr); > ASSERT(checkSQLiteReturnCode(ret, SQLITE_DONE)); >Index: Source/WebCore/platform/network/soup/SoupNetworkSession.cpp >=================================================================== >--- Source/WebCore/platform/network/soup/SoupNetworkSession.cpp (revision 232175) >+++ Source/WebCore/platform/network/soup/SoupNetworkSession.cpp (working copy) >@@ -277,7 +277,7 @@ std::optional<ResourceError> SoupNetwork > if (!tlsErrors) > return std::nullopt; > >- auto it = clientCertificates().find(requestURL.host()); >+ auto it = clientCertificates().find(requestURL.host().toString()); > if (it != clientCertificates().end() && it->value.contains(certificate)) > return std::nullopt; > >Index: Source/WebCore/workers/WorkerLocation.cpp >=================================================================== >--- Source/WebCore/workers/WorkerLocation.cpp (revision 232175) >+++ Source/WebCore/workers/WorkerLocation.cpp (working copy) >@@ -48,7 +48,7 @@ String WorkerLocation::host() const > > String WorkerLocation::hostname() const > { >- return m_url.host(); >+ return m_url.host().toString(); > } > > String WorkerLocation::port() const >Index: Source/WebCore/workers/service/server/SWServer.cpp >=================================================================== >--- Source/WebCore/workers/service/server/SWServer.cpp (revision 232175) >+++ Source/WebCore/workers/service/server/SWServer.cpp (working copy) >@@ -866,7 +866,7 @@ void SWServer::performGetOriginsWithRegi > HashSet<SecurityOriginData> originsWithRegistrations; > for (auto& key : m_registrations.keys()) { > originsWithRegistrations.add(key.topOrigin()); >- originsWithRegistrations.add(SecurityOriginData { key.scope().protocol().toString(), key.scope().host(), key.scope().port() }); >+ originsWithRegistrations.add(SecurityOriginData { key.scope().protocol().toString(), key.scope().host().toString(), key.scope().port() }); > } > > auto callbacks = WTFMove(m_getOriginsWithRegistrationsCallbacks); >Index: Source/WebKit/ChangeLog >=================================================================== >--- Source/WebKit/ChangeLog (revision 232175) >+++ Source/WebKit/ChangeLog (working copy) >@@ -1,3 +1,32 @@ >+2018-05-25 Alex Christensen <achristensen@webkit.org> >+ >+ URL::host should return a StringView to reduce allocations >+ https://bugs.webkit.org/show_bug.cgi?id=185986 >+ >+ Reviewed by Geoff Garen. >+ >+ * 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): >+ > 2018-05-24 Youenn Fablet <youenn@apple.com> > > Update plugin search path to look for user installed plugins >Index: Source/WebKit/NetworkProcess/NetworkProcess.cpp >=================================================================== >--- Source/WebKit/NetworkProcess/NetworkProcess.cpp (revision 232175) >+++ Source/WebKit/NetworkProcess/NetworkProcess.cpp (working copy) >@@ -481,7 +481,7 @@ static void fetchDiskCacheEntries(PAL::S > } > > auto url = traversalEntry->entry.response().url(); >- auto result = originsAndSizes.add({url.protocol().toString(), url.host(), url.port()}, 0); >+ auto result = originsAndSizes.add({url.protocol().toString(), url.host().toString(), url.port()}, 0); > > if (fetchOptions.contains(WebsiteDataFetchOption::ComputeSizes)) > result.iterator->value += traversalEntry->entry.sourceStorageRecord().header.size() + traversalEntry->recordInfo.bodySize; >Index: Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp >=================================================================== >--- Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp (revision 232175) >+++ Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp (working copy) >@@ -364,7 +364,7 @@ void NetworkResourceLoader::abort() > static bool areFrameAncestorsSameSite(const ResourceResponse& response, const Vector<RefPtr<SecurityOrigin>>& frameAncestorOrigins) > { > #if ENABLE(PUBLIC_SUFFIX_LIST) >- auto responsePartition = ResourceRequest::partitionName(response.url().host()); >+ auto responsePartition = ResourceRequest::partitionName(response.url().host().toString()); > return frameAncestorOrigins.findMatching([&](const auto& item) { > return item->isUnique() || ResourceRequest::partitionName(item->host()) != responsePartition; > }) == notFound; >Index: Source/WebKit/NetworkProcess/mac/NetworkProcessMac.mm >=================================================================== >--- Source/WebKit/NetworkProcess/mac/NetworkProcessMac.mm (revision 232175) >+++ Source/WebKit/NetworkProcess/mac/NetworkProcessMac.mm (working copy) >@@ -72,7 +72,7 @@ static void overrideSystemProxies(const > if (!httpProxy.isNull()) { > URL httpProxyURL(URL(), httpProxy); > if (httpProxyURL.isValid()) { >- [proxySettings setObject:nsStringFromWebCoreString(httpProxyURL.host()) forKey:(NSString *)kCFNetworkProxiesHTTPProxy]; >+ [proxySettings setObject:nsStringFromWebCoreString(httpProxyURL.host().toString()) forKey:(NSString *)kCFNetworkProxiesHTTPProxy]; > if (httpProxyURL.port()) { > NSNumber *port = [NSNumber numberWithInt:httpProxyURL.port().value()]; > [proxySettings setObject:port forKey:(NSString *)kCFNetworkProxiesHTTPPort]; >@@ -86,7 +86,7 @@ static void overrideSystemProxies(const > URL httpsProxyURL(URL(), httpsProxy); > if (httpsProxyURL.isValid()) { > #if !ENABLE(MINIMAL_SIMULATOR) >- [proxySettings setObject:nsStringFromWebCoreString(httpsProxyURL.host()) forKey:(NSString *)kCFNetworkProxiesHTTPSProxy]; >+ [proxySettings setObject:nsStringFromWebCoreString(httpsProxyURL.host().toString()) forKey:(NSString *)kCFNetworkProxiesHTTPSProxy]; > if (httpsProxyURL.port()) { > NSNumber *port = [NSNumber numberWithInt:httpsProxyURL.port().value()]; > [proxySettings setObject:port forKey:(NSString *)kCFNetworkProxiesHTTPSPort]; >Index: Source/WebKit/Shared/API/APIURL.h >=================================================================== >--- Source/WebKit/Shared/API/APIURL.h (revision 232175) >+++ Source/WebKit/Shared/API/APIURL.h (working copy) >@@ -64,7 +64,7 @@ public: > WTF::String host() const > { > parseURLIfNecessary(); >- return m_parsedURL->isValid() ? m_parsedURL->host() : WTF::String(); >+ return m_parsedURL->isValid() ? m_parsedURL->host().toString() : WTF::String(); > } > > WTF::String protocol() const >Index: Source/WebKit/UIProcess/WebPageProxy.cpp >=================================================================== >--- Source/WebKit/UIProcess/WebPageProxy.cpp (revision 232175) >+++ Source/WebKit/UIProcess/WebPageProxy.cpp (working copy) >@@ -5799,7 +5799,7 @@ void WebPageProxy::processDidTerminate(P > > #if PLATFORM(IOS) > if (m_process->isUnderMemoryPressure()) { >- String domain = WebCore::topPrivatelyControlledDomain(WebCore::URL(WebCore::ParsedURLString, currentURL()).host()); >+ String domain = WebCore::topPrivatelyControlledDomain(WebCore::URL(WebCore::ParsedURLString, currentURL()).host().toString()); > if (!domain.isEmpty()) > logDiagnosticMessageWithEnhancedPrivacy(WebCore::DiagnosticLoggingKeys::domainCausingJetsamKey(), domain, WebCore::ShouldSample::No); > } >Index: Source/WebKit/UIProcess/WebProcessProxy.cpp >=================================================================== >--- Source/WebKit/UIProcess/WebProcessProxy.cpp (revision 232175) >+++ Source/WebKit/UIProcess/WebProcessProxy.cpp (working copy) >@@ -676,7 +676,7 @@ void WebProcessProxy::processDidTerminat > #if ENABLE(PUBLIC_SUFFIX_LIST) > if (pages.size() == 1) { > auto& page = *pages[0]; >- String domain = topPrivatelyControlledDomain(WebCore::URL(WebCore::ParsedURLString, page.currentURL()).host()); >+ String domain = topPrivatelyControlledDomain(WebCore::URL(WebCore::ParsedURLString, page.currentURL()).host().toString()); > if (!domain.isEmpty()) > page.logDiagnosticMessageWithEnhancedPrivacy(WebCore::DiagnosticLoggingKeys::domainCausingCrashKey(), domain, WebCore::ShouldSample::No); > } >Index: Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp >=================================================================== >--- Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp (revision 232175) >+++ Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp (working copy) >@@ -1317,7 +1317,7 @@ void WebAutomationSession::addSingleCook > > // Inherit the domain/host from the main frame's URL if it is not explicitly set. > if (domain.isEmpty()) >- domain = activeURL.host(); >+ domain = activeURL.host().toString(); > > cookie.domain = domainByAddingDotPrefixIfNeeded(domain); > >@@ -1361,7 +1361,7 @@ void WebAutomationSession::deleteAllCook > ASSERT(activeURL.isValid()); > > WebCookieManagerProxy* cookieManager = m_processPool->supplement<WebCookieManagerProxy>(); >- cookieManager->deleteCookiesForHostname(page->websiteDataStore().sessionID(), domainByAddingDotPrefixIfNeeded(activeURL.host())); >+ cookieManager->deleteCookiesForHostname(page->websiteDataStore().sessionID(), domainByAddingDotPrefixIfNeeded(activeURL.host().toString())); > } > > void WebAutomationSession::getSessionPermissions(ErrorString&, RefPtr<JSON::ArrayOf<Inspector::Protocol::Automation::SessionPermissionData>>& out_permissions) >Index: Source/WebKit/WebProcess/Plugins/PluginView.cpp >=================================================================== >--- Source/WebKit/WebProcess/Plugins/PluginView.cpp (revision 232175) >+++ Source/WebKit/WebProcess/Plugins/PluginView.cpp (working copy) >@@ -1831,8 +1831,8 @@ void PluginView::pluginDidReceiveUserInt > m_didReceiveUserInteraction = true; > > HTMLPlugInImageElement& plugInImageElement = downcast<HTMLPlugInImageElement>(*m_pluginElement); >- String pageOrigin = plugInImageElement.document().page()->mainFrame().document()->baseURL().host(); >- String pluginOrigin = plugInImageElement.loadedUrl().host(); >+ String pageOrigin = plugInImageElement.document().page()->mainFrame().document()->baseURL().host().toString(); >+ String pluginOrigin = plugInImageElement.loadedUrl().host().toString(); > String mimeType = plugInImageElement.serviceType(); > > WebProcess::singleton().plugInDidReceiveUserInteraction(pageOrigin, pluginOrigin, mimeType, plugInImageElement.document().page()->sessionID()); >Index: Source/WebKit/WebProcess/Plugins/WebPluginInfoProvider.cpp >=================================================================== >--- Source/WebKit/WebProcess/Plugins/WebPluginInfoProvider.cpp (revision 232175) >+++ Source/WebKit/WebProcess/Plugins/WebPluginInfoProvider.cpp (working copy) >@@ -156,7 +156,7 @@ void WebPluginInfoProvider::populatePlug > } > > #if PLATFORM(MAC) >- String pageHost = page.mainFrame().loader().documentLoader()->responseURL().host(); >+ String pageHost = page.mainFrame().loader().documentLoader()->responseURL().host().toString(); > if (pageHost.isNull()) > return; > for (auto& info : m_cachedPlugins) { >Index: Source/WebKit/WebProcess/WebPage/WebPage.cpp >=================================================================== >--- Source/WebKit/WebProcess/WebPage/WebPage.cpp (revision 232175) >+++ Source/WebKit/WebProcess/WebPage/WebPage.cpp (working copy) >@@ -4848,8 +4848,7 @@ static bool needsHiddenContentEditableQu > if (!needsQuirks) > return false; > >- String host = url.host(); >- String path = url.path(); >+ auto host = url.host(); > return equalLettersIgnoringASCIICase(host, "docs.google.com"); > } > >@@ -4858,7 +4857,7 @@ static bool needsPlainTextQuirk(bool nee > if (!needsQuirks) > return false; > >- String host = url.host(); >+ auto host = url.host(); > > if (equalLettersIgnoringASCIICase(host, "twitter.com")) > return true; >@@ -5431,8 +5430,8 @@ void WebPage::determinePrimarySnapshotte > > LOG(Plugins, "Primary Plug-In Detection: success - found a candidate plug-in - inform it."); > m_didFindPrimarySnapshottedPlugin = true; >- m_primaryPlugInPageOrigin = m_page->mainFrame().document()->baseURL().host(); >- m_primaryPlugInOrigin = candidatePlugIn->loadedUrl().host(); >+ m_primaryPlugInPageOrigin = m_page->mainFrame().document()->baseURL().host().toString(); >+ m_primaryPlugInOrigin = candidatePlugIn->loadedUrl().host().toString(); > m_primaryPlugInMimeType = candidatePlugIn->serviceType(); > > candidatePlugIn->setIsPrimarySnapshottedPlugIn(true); >Index: Source/WebKitLegacy/ChangeLog >=================================================================== >--- Source/WebKitLegacy/ChangeLog (revision 232175) >+++ Source/WebKitLegacy/ChangeLog (working copy) >@@ -1,3 +1,13 @@ >+2018-05-25 Alex Christensen <achristensen@webkit.org> >+ >+ URL::host should return a StringView to reduce allocations >+ https://bugs.webkit.org/show_bug.cgi?id=185986 >+ >+ Reviewed by Geoff Garen. >+ >+ * WebCoreSupport/WebResourceLoadScheduler.cpp: >+ (WebResourceLoadScheduler::hostForURL): >+ > 2018-05-11 Charles Vazac <cvazac@gmail.com> > > Runtime feature flag for Server-Timing >Index: Source/WebKitLegacy/WebCoreSupport/WebResourceLoadScheduler.cpp >=================================================================== >--- Source/WebKitLegacy/WebCoreSupport/WebResourceLoadScheduler.cpp (revision 232175) >+++ Source/WebKitLegacy/WebCoreSupport/WebResourceLoadScheduler.cpp (working copy) >@@ -66,7 +66,7 @@ WebResourceLoadScheduler::HostInformatio > return m_nonHTTPProtocolHost; > > m_hosts.checkConsistency(); >- String hostName = url.host(); >+ String hostName = url.host().toString(); > HostInformation* host = m_hosts.get(hostName); > if (!host && createHostPolicy == CreateIfNotFound) { > host = new HostInformation(hostName, maxRequestsInFlightPerHost); >Index: Tools/ChangeLog >=================================================================== >--- Tools/ChangeLog (revision 232190) >+++ Tools/ChangeLog (working copy) >@@ -1,3 +1,17 @@ >+2018-05-25 Alex Christensen <achristensen@webkit.org> >+ >+ URL::host should return a StringView to reduce allocations >+ https://bugs.webkit.org/show_bug.cgi?id=185986 >+ >+ Reviewed by Geoff Garen. >+ >+ * TestWebKitAPI/Tests/WebCore/URL.cpp: >+ (TestWebKitAPI::TEST_F): >+ * TestWebKitAPI/Tests/WebCore/URLParser.cpp: >+ (TestWebKitAPI::eq): >+ * TestWebKitAPI/Tests/mac/SSLKeyGenerator.mm: >+ (TestWebKitAPI::SSLKeyGeneratorTest::TearDown): >+ > 2018-05-24 Chris Dumez <cdumez@apple.com> > > Reduce copying of FontCascadeDescription objects by moving them around >Index: Tools/TestWebKitAPI/Tests/WebCore/URL.cpp >=================================================================== >--- Tools/TestWebKitAPI/Tests/WebCore/URL.cpp (revision 232175) >+++ Tools/TestWebKitAPI/Tests/WebCore/URL.cpp (working copy) >@@ -59,7 +59,7 @@ TEST_F(URLTest, URLConstructorConstChar) > EXPECT_TRUE(kurl.isValid()); > > EXPECT_EQ(kurl.protocol() == "http", true); >- EXPECT_EQ(String("www.example.com"), kurl.host()); >+ EXPECT_EQ(String("www.example.com"), kurl.host().toString()); > EXPECT_TRUE(!!kurl.port()); > EXPECT_EQ(8080, kurl.port().value()); > EXPECT_EQ(String("username"), kurl.user()); >Index: Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp >=================================================================== >--- Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp (revision 232175) >+++ Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp (working copy) >@@ -64,7 +64,8 @@ struct ExpectedParts { > } > }; > >-static bool eq(const String& s1, const String& s2) >+template<typename T, typename U> >+bool eq(T&& s1, U&& s2) > { > EXPECT_STREQ(s1.utf8().data(), s2.utf8().data()); > return s1.utf8() == s2.utf8(); >@@ -90,7 +91,7 @@ static void checkURL(const String& urlSt > { > auto url = URL(URL(), urlString); > >- EXPECT_TRUE(eq(parts.protocol, url.protocol().toString())); >+ EXPECT_TRUE(eq(parts.protocol, url.protocol())); > EXPECT_TRUE(eq(parts.user, url.user())); > EXPECT_TRUE(eq(parts.password, url.pass())); > EXPECT_TRUE(eq(parts.host, url.host())); >@@ -117,7 +118,7 @@ static void checkRelativeURL(const Strin > { > auto url = URL(URL(URL(), baseURLString), urlString); > >- EXPECT_TRUE(eq(parts.protocol, url.protocol().toString())); >+ EXPECT_TRUE(eq(parts.protocol, url.protocol())); > EXPECT_TRUE(eq(parts.user, url.user())); > EXPECT_TRUE(eq(parts.password, url.pass())); > EXPECT_TRUE(eq(parts.host, url.host())); >@@ -146,7 +147,7 @@ static void checkURLDifferences(const St > UNUSED_PARAM(partsOld); // FIXME: Remove all the old expected parts. > auto url = URL(URL(), urlString); > >- EXPECT_TRUE(eq(partsNew.protocol, url.protocol().toString())); >+ EXPECT_TRUE(eq(partsNew.protocol, url.protocol())); > EXPECT_TRUE(eq(partsNew.user, url.user())); > EXPECT_TRUE(eq(partsNew.password, url.pass())); > EXPECT_TRUE(eq(partsNew.host, url.host())); >@@ -175,7 +176,7 @@ static void checkRelativeURLDifferences( > UNUSED_PARAM(partsOld); // FIXME: Remove all the old expected parts. > auto url = URL(URL(URL(), baseURLString), urlString); > >- EXPECT_TRUE(eq(partsNew.protocol, url.protocol().toString())); >+ EXPECT_TRUE(eq(partsNew.protocol, url.protocol())); > EXPECT_TRUE(eq(partsNew.user, url.user())); > EXPECT_TRUE(eq(partsNew.password, url.pass())); > EXPECT_TRUE(eq(partsNew.host, url.host())); >@@ -213,7 +214,7 @@ static void checkURL(const String& urlSt > { > URLParser parser(urlString, { }, encoding); > auto url = parser.result(); >- EXPECT_TRUE(eq(parts.protocol, url.protocol().toString())); >+ EXPECT_TRUE(eq(parts.protocol, url.protocol())); > EXPECT_TRUE(eq(parts.user, url.user())); > EXPECT_TRUE(eq(parts.password, url.pass())); > EXPECT_TRUE(eq(parts.host, url.host())); >@@ -239,7 +240,7 @@ static void checkURL(const String& urlSt > URLParser baseParser(baseURLString, { }, encoding); > URLParser parser(urlString, baseParser.result(), encoding); > auto url = parser.result(); >- EXPECT_TRUE(eq(parts.protocol, url.protocol().toString())); >+ EXPECT_TRUE(eq(parts.protocol, url.protocol())); > EXPECT_TRUE(eq(parts.user, url.user())); > EXPECT_TRUE(eq(parts.password, url.pass())); > EXPECT_TRUE(eq(parts.host, url.host())); >Index: Tools/TestWebKitAPI/Tests/mac/SSLKeyGenerator.mm >=================================================================== >--- Tools/TestWebKitAPI/Tests/mac/SSLKeyGenerator.mm (revision 232175) >+++ Tools/TestWebKitAPI/Tests/mac/SSLKeyGenerator.mm (working copy) >@@ -83,12 +83,12 @@ public: > SecItemDelete((__bridge CFDictionaryRef) @{ > (id)kSecClass: (id)kSecClassKey, > (id)kSecAttrKeyClass: (id)kSecAttrKeyClassPrivate, >- (id)kSecAttrLabel: WebCore::keygenKeychainItemName(url.host()), >+ (id)kSecAttrLabel: WebCore::keygenKeychainItemName(url.host().toString()), > }); > SecItemDelete((__bridge CFDictionaryRef) @{ > (id)kSecClass: (id)kSecClassKey, > (id)kSecAttrKeyClass: (id)kSecAttrKeyClassPublic, >- (id)kSecAttrLabel: WebCore::keygenKeychainItemName(url.host()), >+ (id)kSecAttrLabel: WebCore::keygenKeychainItemName(url.host().toString()), > }); > } > };
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185986
:
341305
|
341308
|
341310
|
341311
|
341317