WebKit Bugzilla
Attachment 349557 Details for
Bug 189528
: Expose fewer of URL's internal members
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189528-20180912101649.patch (text/plain), 5.02 KB, created by
Alex Christensen
on 2018-09-12 10:16:50 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Alex Christensen
Created:
2018-09-12 10:16:50 PDT
Size:
5.02 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 235942) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,20 @@ >+2018-09-12 Alex Christensen <achristensen@webkit.org> >+ >+ Expose fewer of URL's internal members >+ https://bugs.webkit.org/show_bug.cgi?id=189528 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * loader/appcache/ApplicationCacheStorage.cpp: >+ (WebCore::urlHostHash): >+ * platform/URL.cpp: >+ (WebCore::URL::hostStart const): >+ (WebCore::protocolHostAndPortAreEqual): >+ (WebCore::hostsAreEqual): >+ * platform/URL.h: >+ (WebCore::URL::hostStart const): Deleted. >+ (WebCore::URL::hostEnd const): Deleted. >+ > 2018-09-12 Fujii Hironori <Hironori.Fujii@sony.com> > > [Win][Clang] error: non-constant-expression cannot be narrowed from type 'int' to 'SHORT' >Index: Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp >=================================================================== >--- Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp (revision 235942) >+++ Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp (working copy) >@@ -84,15 +84,10 @@ private: > > static unsigned urlHostHash(const URL& url) > { >- unsigned hostStart = url.hostStart(); >- unsigned hostEnd = url.hostEnd(); >- >- const String& urlString = url.string(); >- >- if (urlString.is8Bit()) >- return AlreadyHashed::avoidDeletedValue(StringHasher::computeHashAndMaskTop8Bits(urlString.characters8() + hostStart, hostEnd - hostStart)); >- >- return AlreadyHashed::avoidDeletedValue(StringHasher::computeHashAndMaskTop8Bits(urlString.characters16() + hostStart, hostEnd - hostStart)); >+ StringView host = url.host(); >+ if (host.is8Bit()) >+ return AlreadyHashed::avoidDeletedValue(StringHasher::computeHashAndMaskTop8Bits(host.characters8(), host.length())); >+ return AlreadyHashed::avoidDeletedValue(StringHasher::computeHashAndMaskTop8Bits(host.characters16(), host.length())); > } > > ApplicationCacheGroup* ApplicationCacheStorage::loadCacheGroup(const URL& manifestURL) >Index: Source/WebCore/platform/URL.cpp >=================================================================== >--- Source/WebCore/platform/URL.cpp (revision 235942) >+++ Source/WebCore/platform/URL.cpp (working copy) >@@ -427,7 +427,12 @@ static bool appendEncodedHostname(UCharB > } > return false; > } >- >+ >+unsigned URL::hostStart() const >+{ >+ return (m_passwordEnd == m_userStart) ? m_passwordEnd : m_passwordEnd + 1; >+} >+ > void URL::setHost(const String& s) > { > if (!m_isValid) >@@ -742,9 +747,9 @@ bool protocolHostAndPortAreEqual(const U > return false; > > unsigned hostStartA = a.hostStart(); >- unsigned hostLengthA = a.hostEnd() - hostStartA; >+ unsigned hostLengthA = a.m_hostEnd - hostStartA; > unsigned hostStartB = b.hostStart(); >- unsigned hostLengthB = b.hostEnd() - b.hostStart(); >+ unsigned hostLengthB = b.m_hostEnd - b.hostStart(); > if (hostLengthA != hostLengthB) > return false; > >@@ -769,9 +774,9 @@ bool protocolHostAndPortAreEqual(const U > bool hostsAreEqual(const URL& a, const URL& b) > { > unsigned hostStartA = a.hostStart(); >- unsigned hostLengthA = a.hostEnd() - hostStartA; >+ unsigned hostLengthA = a.m_hostEnd - hostStartA; > unsigned hostStartB = b.hostStart(); >- unsigned hostLengthB = b.hostEnd() - hostStartB; >+ unsigned hostLengthB = b.m_hostEnd - hostStartB; > if (hostLengthA != hostLengthB) > return false; > >Index: Source/WebCore/platform/URL.h >=================================================================== >--- Source/WebCore/platform/URL.h (revision 235942) >+++ Source/WebCore/platform/URL.h (working copy) >@@ -170,13 +170,6 @@ public: > > WEBCORE_EXPORT void removeQueryAndFragmentIdentifier(); > >- WEBCORE_EXPORT friend bool equalIgnoringFragmentIdentifier(const URL&, const URL&); >- >- WEBCORE_EXPORT friend bool protocolHostAndPortAreEqual(const URL&, const URL&); >- >- unsigned hostStart() const; >- unsigned hostEnd() const; >- > WEBCORE_EXPORT static bool hostIsIPAddress(StringView); > > unsigned pathStart() const; >@@ -217,6 +210,11 @@ private: > static bool protocolIs(const String&, const char*); > void init(const URL&, const String&, const TextEncoding&); > void copyToBuffer(Vector<char, 512>& buffer) const; >+ unsigned hostStart() const; >+ >+ WEBCORE_EXPORT friend bool equalIgnoringFragmentIdentifier(const URL&, const URL&); >+ WEBCORE_EXPORT friend bool protocolHostAndPortAreEqual(const URL&, const URL&); >+ WEBCORE_EXPORT friend bool hostsAreEqual(const URL&, const URL&); > > String m_string; > >@@ -394,16 +392,6 @@ inline bool URL::protocolIsInHTTPFamily( > return m_protocolIsInHTTPFamily; > } > >-inline unsigned URL::hostStart() const >-{ >- return (m_passwordEnd == m_userStart) ? m_passwordEnd : m_passwordEnd + 1; >-} >- >-inline unsigned URL::hostEnd() const >-{ >- return m_hostEnd; >-} >- > inline unsigned URL::pathStart() const > { > return m_hostEnd + m_portLength;
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 189528
:
349484
| 349557