WebKit Bugzilla
Attachment 341348 Details for
Bug 186003
: Do even fewer allocations in URL host operations
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186003-20180525161914.patch (text/plain), 4.84 KB, created by
Alex Christensen
on 2018-05-25 16:19:15 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Alex Christensen
Created:
2018-05-25 16:19:15 PDT
Size:
4.84 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 232210) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,21 @@ >+2018-05-25 Alex Christensen <achristensen@webkit.org> >+ >+ Do even fewer allocations in URL host operations >+ https://bugs.webkit.org/show_bug.cgi?id=186003 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * loader/ResourceLoadStatistics.cpp: >+ (WebCore::ResourceLoadStatistics::primaryDomain): >+ * loader/ResourceLoadStatistics.h: >+ * platform/URL.cpp: >+ (WebCore::URL::hostIsIPAddress): >+ * platform/URL.h: >+ * platform/mac/URLMac.mm: >+ (WebCore::URL::hostIsIPAddress): >+ * platform/soup/URLSoup.cpp: >+ (WebCore::URL::hostIsIPAddress): >+ > 2018-05-25 Jeremy Jones <jeremyj@apple.com> > > Fullscreen element can be clipped by ancestor. >Index: Source/WebCore/loader/ResourceLoadStatistics.cpp >=================================================================== >--- Source/WebCore/loader/ResourceLoadStatistics.cpp (revision 232198) >+++ Source/WebCore/loader/ResourceLoadStatistics.cpp (working copy) >@@ -333,22 +333,23 @@ void ResourceLoadStatistics::merge(const > > String ResourceLoadStatistics::primaryDomain(const URL& url) > { >- return primaryDomain(url.host().toString()); >+ return primaryDomain(url.host()); > } > >-String ResourceLoadStatistics::primaryDomain(const String& host) >+String ResourceLoadStatistics::primaryDomain(StringView host) > { > if (host.isNull() || host.isEmpty()) > return ASCIILiteral("nullOrigin"); > >+ String hostString = host.toString(); > #if ENABLE(PUBLIC_SUFFIX_LIST) >- String primaryDomain = topPrivatelyControlledDomain(host); >+ String primaryDomain = topPrivatelyControlledDomain(hostString); > // We will have an empty string here if there is no TLD. Use the host as a fallback. > if (!primaryDomain.isEmpty()) > return primaryDomain; > #endif > >- return host; >+ return hostString; > } > > } >Index: Source/WebCore/loader/ResourceLoadStatistics.h >=================================================================== >--- Source/WebCore/loader/ResourceLoadStatistics.h (revision 232197) >+++ Source/WebCore/loader/ResourceLoadStatistics.h (working copy) >@@ -51,7 +51,7 @@ struct ResourceLoadStatistics { > ResourceLoadStatistics& operator=(ResourceLoadStatistics&&) = default; > > WEBCORE_EXPORT static String primaryDomain(const URL&); >- WEBCORE_EXPORT static String primaryDomain(const String& host); >+ WEBCORE_EXPORT static String primaryDomain(StringView host); > > WEBCORE_EXPORT void encode(KeyedEncoder&) const; > WEBCORE_EXPORT bool decode(KeyedDecoder&, unsigned modelVersion); >Index: Source/WebCore/platform/URL.cpp >=================================================================== >--- Source/WebCore/platform/URL.cpp (revision 232198) >+++ Source/WebCore/platform/URL.cpp (working copy) >@@ -1060,7 +1060,7 @@ TextStream& operator<<(TextStream& ts, c > } > > #if !PLATFORM(COCOA) && !USE(SOUP) >-bool URL::hostIsIPAddress(const String& host) >+bool URL::hostIsIPAddress(StringView host) > { > // Assume that any host that ends with a digit is trying to be an IP address. > return !host.isEmpty() && isASCIIDigit(host[host.length() - 1]); >Index: Source/WebCore/platform/URL.h >=================================================================== >--- Source/WebCore/platform/URL.h (revision 232198) >+++ Source/WebCore/platform/URL.h (working copy) >@@ -176,7 +176,7 @@ public: > unsigned hostStart() const; > unsigned hostEnd() const; > >- WEBCORE_EXPORT static bool hostIsIPAddress(const String&); >+ WEBCORE_EXPORT static bool hostIsIPAddress(StringView); > > unsigned pathStart() const; > unsigned pathEnd() const; >Index: Source/WebCore/platform/mac/URLMac.mm >=================================================================== >--- Source/WebCore/platform/mac/URLMac.mm (revision 232197) >+++ Source/WebCore/platform/mac/URLMac.mm (working copy) >@@ -79,9 +79,9 @@ RetainPtr<CFURLRef> URL::createCFURL() c > return createCFURLFromBuffer(buffer.data(), buffer.size()); > } > >-bool URL::hostIsIPAddress(const String& host) >+bool URL::hostIsIPAddress(StringView host) > { >- return [host _web_looksLikeIPAddress]; >+ return [host.createNSStringWithoutCopying().get() _web_looksLikeIPAddress]; > } > > } >Index: Source/WebCore/platform/soup/URLSoup.cpp >=================================================================== >--- Source/WebCore/platform/soup/URLSoup.cpp (revision 232197) >+++ Source/WebCore/platform/soup/URLSoup.cpp (working copy) >@@ -66,7 +66,7 @@ GUniquePtr<SoupURI> URL::createSoupURI() > return GUniquePtr<SoupURI>(soup_uri_new(string().utf8().data())); > } > >-bool URL::hostIsIPAddress(const String& host) >+bool URL::hostIsIPAddress(StringView host) > { > return !host.isEmpty() && g_hostname_is_ip_address(host.utf8().data()); > }
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 186003
: 341348