WebKit Bugzilla
Attachment 341499 Details for
Bug 186054
: Avoid unnecessary String allocation in isPublicSuffix(const String&)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186054-20180529105236.patch (text/plain), 1.96 KB, created by
Chris Dumez
on 2018-05-29 10:52:37 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2018-05-29 10:52:37 PDT
Size:
1.96 KB
patch
obsolete
>Subversion Revision: 232263 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index bc0ea74ecb7dc89c21a3c320b511504c1e2f43df..e1b3a043e5a0dbf90a18d176d169b86d57ca9e1c 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,18 @@ >+2018-05-29 Chris Dumez <cdumez@apple.com> >+ >+ Avoid unnecessary String allocation in isPublicSuffix(const String&) >+ https://bugs.webkit.org/show_bug.cgi?id=186054 >+ >+ Reviewed by Sam Weinig. >+ >+ Avoid unnecessary String allocation in isPublicSuffix(const String&) by calling directly >+ the decodeHostName() overload taking in a NSString*. This overload returns a NSString*, >+ which is what we need. We would previously call the overloading taking in a String, which >+ would return a String, which we would have to convert back to a NSString*. >+ >+ * platform/mac/PublicSuffixMac.mm: >+ (WebCore::isPublicSuffix): >+ > 2018-05-29 Nan Wang <n_wang@apple.com> > > AX: setValue on contenteditable should preserve whitespace >diff --git a/Source/WebCore/platform/mac/PublicSuffixMac.mm b/Source/WebCore/platform/mac/PublicSuffixMac.mm >index 6736e2d295bb99865e790e678d4a6e4dbdcf1399..b3889fb655606651bdffc19161e8ed3edb08a230 100644 >--- a/Source/WebCore/platform/mac/PublicSuffixMac.mm >+++ b/Source/WebCore/platform/mac/PublicSuffixMac.mm >@@ -36,7 +36,8 @@ namespace WebCore { > > bool isPublicSuffix(const String& domain) > { >- NSString *host = decodeHostName(domain); >+ // Explicitly cast the domain to a NSString before calling decodeHostName() so we get a NSString back instead of a String. >+ NSString *host = decodeHostName((NSString *)domain); > return host && _CFHostIsDomainTopLevel((CFStringRef)host); > } > >@@ -62,7 +63,7 @@ String topPrivatelyControlledDomain(const String& domain) > > String decodeHostName(const String& domain) > { >- return decodeHostName(static_cast<NSString*>(domain)); >+ return decodeHostName((NSString *)(domain)); > } > > }
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 186054
:
341494
| 341499