Title: [233755] trunk
Revision
233755
Author
commit-qu...@webkit.org
Date
2018-07-11 20:37:51 -0700 (Wed, 11 Jul 2018)

Log Message

Unreviewed, rolling out r233742.
https://bugs.webkit.org/show_bug.cgi?id=187577

Binary incompatible change with respect to Service Worker
registration map (Requested by dydz on #webkit).

Reverted changeset:

"Reduce size of WebCore::URL"
https://bugs.webkit.org/show_bug.cgi?id=186820
https://trac.webkit.org/changeset/233742

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (233754 => 233755)


--- trunk/Source/WebCore/ChangeLog	2018-07-12 03:36:18 UTC (rev 233754)
+++ trunk/Source/WebCore/ChangeLog	2018-07-12 03:37:51 UTC (rev 233755)
@@ -1,3 +1,17 @@
+2018-07-11  Commit Queue  <commit-qu...@webkit.org>
+
+        Unreviewed, rolling out r233742.
+        https://bugs.webkit.org/show_bug.cgi?id=187577
+
+        Binary incompatible change with respect to Service Worker
+        registration map (Requested by dydz on #webkit).
+
+        Reverted changeset:
+
+        "Reduce size of WebCore::URL"
+        https://bugs.webkit.org/show_bug.cgi?id=186820
+        https://trac.webkit.org/changeset/233742
+
 2018-07-11  Aditya Keerthi  <akeer...@apple.com>
 
         REGRESSION (231276): Attempting to copy an image fails

Modified: trunk/Source/WebCore/platform/URL.cpp (233754 => 233755)


--- trunk/Source/WebCore/platform/URL.cpp	2018-07-12 03:36:18 UTC (rev 233754)
+++ trunk/Source/WebCore/platform/URL.cpp	2018-07-12 03:37:51 UTC (rev 233755)
@@ -84,7 +84,7 @@
     m_userEnd = 0;
     m_passwordEnd = 0;
     m_hostEnd = 0;
-    m_portLength = 0;
+    m_portEnd = 0;
     m_pathEnd = 0;
     m_pathAfterLastSlash = 0;
     m_queryEnd = 0;
@@ -144,7 +144,7 @@
         --end;
 
     size_t start = m_string.reverseFind('/', end);
-    if (start < static_cast<unsigned>(m_hostEnd + m_portLength))
+    if (start < static_cast<unsigned>(m_portEnd))
         return String();
     ++start;
 
@@ -164,15 +164,15 @@
 
 std::optional<uint16_t> URL::port() const
 {
-    if (!m_portLength)
+    if (!m_portEnd || m_hostEnd >= m_portEnd - 1)
         return std::nullopt;
 
     bool ok = false;
     unsigned number;
     if (m_string.is8Bit())
-        number = charactersToUIntStrict(m_string.characters8() + m_hostEnd + 1, m_portLength - 1, &ok);
+        number = charactersToUIntStrict(m_string.characters8() + m_hostEnd + 1, m_portEnd - m_hostEnd - 1, &ok);
     else
-        number = charactersToUIntStrict(m_string.characters16() + m_hostEnd + 1, m_portLength - 1, &ok);
+        number = charactersToUIntStrict(m_string.characters16() + m_hostEnd + 1, m_portEnd - m_hostEnd - 1, &ok);
     if (!ok || number > std::numeric_limits<uint16_t>::max())
         return std::nullopt;
     return number;
@@ -187,7 +187,7 @@
 
 String URL::protocolHostAndPort() const
 {
-    String result = m_string.substring(0, m_hostEnd + m_portLength);
+    String result = m_string.substring(0, m_portEnd);
 
     if (m_passwordEnd - m_userStart > 0) {
         const int allowForTrailingAtSign = 1;
@@ -370,8 +370,7 @@
 
 String URL::path() const
 {
-    unsigned portEnd = m_hostEnd + m_portLength;
-    return m_string.substring(portEnd, m_pathEnd - portEnd);
+    return m_string.substring(m_portEnd, m_pathEnd - m_portEnd);
 }
 
 bool URL::setProtocol(const String& s)
@@ -456,9 +455,9 @@
 
 void URL::removePort()
 {
-    if (!m_portLength)
+    if (m_hostEnd == m_portEnd)
         return;
-    URLParser parser(m_string.left(m_hostEnd) + m_string.substring(m_hostEnd + m_portLength));
+    URLParser parser(m_string.left(m_hostEnd) + m_string.substring(m_portEnd));
     *this = parser.result();
 }
 
@@ -467,10 +466,10 @@
     if (!m_isValid)
         return;
 
-    bool colonNeeded = !m_portLength;
+    bool colonNeeded = m_portEnd == m_hostEnd;
     unsigned portStart = (colonNeeded ? m_hostEnd : m_hostEnd + 1);
 
-    URLParser parser(makeString(m_string.left(portStart), (colonNeeded ? ":" : ""), String::number(i), m_string.substring(m_hostEnd + m_portLength)));
+    URLParser parser(makeString(m_string.left(portStart), (colonNeeded ? ":" : ""), String::number(i), m_string.substring(m_portEnd)));
     *this = parser.result();
 }
 
@@ -510,7 +509,7 @@
         builder.appendLiteral(":");
         builder.append(port);
     }
-    builder.append(m_string.substring(m_hostEnd + m_portLength));
+    builder.append(m_string.substring(m_portEnd));
 
     URLParser parser(builder.toString());
     *this = parser.result();
@@ -659,7 +658,7 @@
     auto questionMarkOrNumberSign = [] (UChar character) {
         return character == '?' || character == '#';
     };
-    URLParser parser(makeString(StringView(m_string).left(m_hostEnd + m_portLength), percentEncodeCharacters(path, questionMarkOrNumberSign), StringView(m_string).substring(m_pathEnd)));
+    URLParser parser(makeString(StringView(m_string).left(m_portEnd), percentEncodeCharacters(path, questionMarkOrNumberSign), StringView(m_string).substring(m_pathEnd)));
     *this = parser.result();
 }
 

Modified: trunk/Source/WebCore/platform/URL.h (233754 => 233755)


--- trunk/Source/WebCore/platform/URL.h	2018-07-12 03:36:18 UTC (rev 233754)
+++ trunk/Source/WebCore/platform/URL.h	2018-07-12 03:37:51 UTC (rev 233755)
@@ -219,28 +219,21 @@
     void copyToBuffer(Vector<char, 512>& buffer) const;
 
     String m_string;
+    bool m_isValid : 1;
+    bool m_protocolIsInHTTPFamily : 1;
+    bool m_cannotBeABaseURL : 1;
 
-    unsigned m_isValid : 1;
-    unsigned m_protocolIsInHTTPFamily : 1;
-    unsigned m_cannotBeABaseURL : 1;
-
-    // This is out of order to allign the bits better. The port is after the host.
-    unsigned m_portLength : 3;
-    static constexpr unsigned maxPortLength = (1 << 3) - 1;
-
-    static constexpr unsigned maxSchemeLength = (1 << 26) - 1;
-    unsigned m_schemeEnd : 26;
+    unsigned m_schemeEnd;
     unsigned m_userStart;
     unsigned m_userEnd;
     unsigned m_passwordEnd;
     unsigned m_hostEnd;
+    unsigned m_portEnd;
     unsigned m_pathAfterLastSlash;
     unsigned m_pathEnd;
     unsigned m_queryEnd;
 };
 
-static_assert(sizeof(URL) == sizeof(String) + 8 * sizeof(unsigned), "URL should stay small");
-
 template <class Encoder>
 void URL::encode(Encoder& encoder) const
 {
@@ -249,13 +242,12 @@
     if (!m_isValid)
         return;
     encoder << static_cast<bool>(m_protocolIsInHTTPFamily);
-    encoder << static_cast<bool>(m_cannotBeABaseURL);
-    encoder << static_cast<unsigned>(m_schemeEnd);
+    encoder << m_schemeEnd;
     encoder << m_userStart;
     encoder << m_userEnd;
     encoder << m_passwordEnd;
     encoder << m_hostEnd;
-    encoder << static_cast<unsigned>(m_portLength);
+    encoder << m_portEnd;
     encoder << m_pathAfterLastSlash;
     encoder << m_pathEnd;
     encoder << m_queryEnd;
@@ -287,18 +279,8 @@
     if (!decoder.decode(protocolIsInHTTPFamily))
         return std::nullopt;
     url.m_protocolIsInHTTPFamily = protocolIsInHTTPFamily;
-    bool cannotBeABaseURL;
-    if (!decoder.decode(cannotBeABaseURL))
+    if (!decoder.decode(url.m_schemeEnd))
         return std::nullopt;
-    url.m_cannotBeABaseURL = cannotBeABaseURL;
-    unsigned schemeEnd;
-    if (!decoder.decode(schemeEnd))
-        return std::nullopt;
-    if (schemeEnd >= maxSchemeLength) {
-        ASSERT_NOT_REACHED();
-        return std::nullopt;
-    }
-    url.m_schemeEnd = schemeEnd;
     if (!decoder.decode(url.m_userStart))
         return std::nullopt;
     if (!decoder.decode(url.m_userEnd))
@@ -307,14 +289,8 @@
         return std::nullopt;
     if (!decoder.decode(url.m_hostEnd))
         return std::nullopt;
-    unsigned portLength;
-    if (!decoder.decode(portLength))
+    if (!decoder.decode(url.m_portEnd))
         return std::nullopt;
-    if (portLength > maxPortLength) {
-        ASSERT_NOT_REACHED();
-        return std::nullopt;
-    }
-    url.m_portLength = portLength;
     if (!decoder.decode(url.m_pathAfterLastSlash))
         return std::nullopt;
     if (!decoder.decode(url.m_pathEnd))
@@ -424,7 +400,7 @@
 
 inline bool URL::hasPath() const
 {
-    return m_pathEnd != m_hostEnd + m_portLength;
+    return m_pathEnd != m_portEnd;
 }
 
 inline bool URL::hasUsername() const
@@ -464,7 +440,7 @@
 
 inline unsigned URL::pathStart() const
 {
-    return m_hostEnd + m_portLength;
+    return m_portEnd;
 }
 
 inline unsigned URL::pathEnd() const

Modified: trunk/Source/WebCore/platform/URLParser.cpp (233754 => 233755)


--- trunk/Source/WebCore/platform/URLParser.cpp	2018-07-12 03:36:18 UTC (rev 233754)
+++ trunk/Source/WebCore/platform/URLParser.cpp	2018-07-12 03:37:51 UTC (rev 233755)
@@ -502,10 +502,10 @@
 bool URLParser::copyBaseWindowsDriveLetter(const URL& base)
 {
     if (base.protocolIs("file")) {
-        RELEASE_ASSERT(base.m_hostEnd + base.m_portLength < base.m_string.length());
+        RELEASE_ASSERT(base.m_portEnd < base.m_string.length());
         if (base.m_string.is8Bit()) {
             const LChar* begin = base.m_string.characters8();
-            CodePointIterator<LChar> c(begin + base.m_hostEnd + base.m_portLength + 1, begin + base.m_string.length());
+            CodePointIterator<LChar> c(begin + base.m_portEnd + 1, begin + base.m_string.length());
             if (isWindowsDriveLetter(c)) {
                 appendWindowsDriveLetter(c);
                 return true;
@@ -512,7 +512,7 @@
             }
         } else {
             const UChar* begin = base.m_string.characters16();
-            CodePointIterator<UChar> c(begin + base.m_hostEnd + base.m_portLength + 1, begin + base.m_string.length());
+            CodePointIterator<UChar> c(begin + base.m_portEnd + 1, begin + base.m_string.length());
             if (isWindowsDriveLetter(c)) {
                 appendWindowsDriveLetter(c);
                 return true;
@@ -846,7 +846,7 @@
     case URLPart::PathAfterLastSlash:
         return url.m_pathAfterLastSlash;
     case URLPart::PortEnd:
-        return url.m_hostEnd + url.m_portLength;
+        return url.m_portEnd;
     case URLPart::HostEnd:
         return url.m_hostEnd;
     case URLPart::PasswordEnd:
@@ -898,7 +898,7 @@
         m_url.m_pathAfterLastSlash = base.m_pathAfterLastSlash;
         FALLTHROUGH;
     case URLPart::PortEnd:
-        m_url.m_portLength = base.m_portLength;
+        m_url.m_portEnd = base.m_portEnd;
         FALLTHROUGH;
     case URLPart::HostEnd:
         m_url.m_hostEnd = base.m_hostEnd;
@@ -1043,7 +1043,7 @@
 
     ASSERT(m_url.m_pathAfterLastSlash <= m_asciiBuffer.size());
     CodePointIterator<LChar> componentToPop(&m_asciiBuffer[newPathAfterLastSlash], &m_asciiBuffer[0] + m_url.m_pathAfterLastSlash);
-    if (newPathAfterLastSlash == m_url.m_hostEnd + m_url.m_portLength + 1 && isWindowsDriveLetter(componentToPop))
+    if (newPathAfterLastSlash == m_url.m_portEnd + 1 && isWindowsDriveLetter(componentToPop))
         return false;
     return true;
 }
@@ -1051,11 +1051,11 @@
 void URLParser::popPath()
 {
     ASSERT(m_didSeeSyntaxViolation);
-    if (m_url.m_pathAfterLastSlash > m_url.m_hostEnd + m_url.m_portLength + 1) {
+    if (m_url.m_pathAfterLastSlash > m_url.m_portEnd + 1) {
         auto newPathAfterLastSlash = m_url.m_pathAfterLastSlash - 1;
         if (m_asciiBuffer[newPathAfterLastSlash] == '/')
             newPathAfterLastSlash--;
-        while (newPathAfterLastSlash > m_url.m_hostEnd + m_url.m_portLength && m_asciiBuffer[newPathAfterLastSlash] != '/')
+        while (newPathAfterLastSlash > m_url.m_portEnd && m_asciiBuffer[newPathAfterLastSlash] != '/')
             newPathAfterLastSlash--;
         newPathAfterLastSlash++;
         if (shouldPopPath(newPathAfterLastSlash))
@@ -1271,12 +1271,7 @@
                     syntaxViolation(c);
                 appendToASCIIBuffer(toASCIILower(*c));
             } else if (*c == ':') {
-                unsigned schemeEnd = currentPosition(c);
-                if (schemeEnd > URL::maxSchemeLength) {
-                    failure();
-                    return;
-                }
-                m_url.m_schemeEnd = schemeEnd;
+                m_url.m_schemeEnd = currentPosition(c);
                 StringView urlScheme = parsedDataView(0, m_url.m_schemeEnd);
                 appendToASCIIBuffer(':');
                 switch (scheme(urlScheme)) {
@@ -1326,7 +1321,7 @@
                         m_url.m_userEnd = m_url.m_userStart;
                         m_url.m_passwordEnd = m_url.m_userStart;
                         m_url.m_hostEnd = m_url.m_userStart;
-                        m_url.m_portLength = 0;
+                        m_url.m_portEnd = m_url.m_userStart;
                         m_url.m_pathAfterLastSlash = m_url.m_userStart;
                         m_url.m_cannotBeABaseURL = true;
                         state = State::CannotBeABaseURLPath;
@@ -1400,7 +1395,7 @@
                 m_url.m_userEnd = m_url.m_userStart;
                 m_url.m_passwordEnd = m_url.m_userStart;
                 m_url.m_hostEnd = m_url.m_userStart;
-                m_url.m_portLength = 0;
+                m_url.m_portEnd = m_url.m_userStart;
                 m_url.m_pathAfterLastSlash = m_url.m_userStart + 1;
                 state = State::Path;
             }
@@ -1456,7 +1451,7 @@
             } else {
                 copyURLPartsUntil(base, URLPart::PortEnd, c, isUTF8Encoding);
                 appendToASCIIBuffer('/');
-                m_url.m_pathAfterLastSlash = base.m_hostEnd + base.m_portLength + 1;
+                m_url.m_pathAfterLastSlash = base.m_portEnd + 1;
                 state = State::Path;
             }
             break;
@@ -1525,7 +1520,7 @@
                         m_url.m_userEnd = currentPosition(c);
                         m_url.m_passwordEnd = m_url.m_userEnd;
                         m_url.m_hostEnd = m_url.m_userEnd;
-                        m_url.m_portLength = 0;
+                        m_url.m_portEnd = m_url.m_userEnd;
                         m_url.m_pathAfterLastSlash = m_url.m_userEnd;
                     } else {
                         m_url.m_userEnd = currentPosition(authorityOrHostBegin);
@@ -1595,7 +1590,7 @@
                     m_url.m_userEnd = m_url.m_userStart;
                     m_url.m_passwordEnd = m_url.m_userStart;
                     m_url.m_hostEnd = m_url.m_userStart;
-                    m_url.m_portLength = 0;
+                    m_url.m_portEnd = m_url.m_userStart;
                     m_url.m_pathAfterLastSlash = m_url.m_userStart + 1;
                     m_url.m_pathEnd = m_url.m_pathAfterLastSlash;
                 }
@@ -1617,7 +1612,7 @@
                     m_url.m_userEnd = m_url.m_userStart;
                     m_url.m_passwordEnd = m_url.m_userStart;
                     m_url.m_hostEnd = m_url.m_userStart;
-                    m_url.m_portLength = 0;
+                    m_url.m_portEnd = m_url.m_userStart;
                     m_url.m_pathAfterLastSlash = m_url.m_userStart + 1;
                     m_url.m_pathEnd = m_url.m_pathAfterLastSlash;
                     m_url.m_queryEnd = m_url.m_pathAfterLastSlash;
@@ -1635,7 +1630,7 @@
                     m_url.m_userEnd = m_url.m_userStart;
                     m_url.m_passwordEnd = m_url.m_userStart;
                     m_url.m_hostEnd = m_url.m_userStart;
-                    m_url.m_portLength = 0;
+                    m_url.m_portEnd = m_url.m_userStart;
                     m_url.m_pathAfterLastSlash = m_url.m_userStart + 1;
                     if (isWindowsDriveLetter(c))
                         appendWindowsDriveLetter(c);
@@ -1655,7 +1650,7 @@
                 m_url.m_userEnd = m_url.m_userStart;
                 m_url.m_passwordEnd = m_url.m_userStart;
                 m_url.m_hostEnd = m_url.m_userStart;
-                m_url.m_portLength = 0;
+                m_url.m_portEnd = m_url.m_userStart;
                 authorityOrHostBegin = c;
                 state = State::FileHost;
                 break;
@@ -1666,7 +1661,7 @@
             m_url.m_userEnd = m_url.m_userStart;
             m_url.m_passwordEnd = m_url.m_userStart;
             m_url.m_hostEnd = m_url.m_userStart;
-            m_url.m_portLength = 0;
+            m_url.m_portEnd = m_url.m_userStart;
             if (isWindowsDriveLetter(c)) {
                 appendWindowsDriveLetter(c);
                 m_url.m_pathAfterLastSlash = m_url.m_userStart + 1;
@@ -1725,7 +1720,7 @@
                         syntaxViolation(c);
                         m_asciiBuffer.shrink(m_url.m_passwordEnd);
                         m_url.m_hostEnd = currentPosition(c);
-                        m_url.m_portLength = 0;
+                        m_url.m_portEnd = m_url.m_hostEnd;
                     }
                     
                     state = State::PathStart;
@@ -1880,7 +1875,7 @@
         m_url.m_userEnd = m_url.m_userStart;
         m_url.m_passwordEnd = m_url.m_userStart;
         m_url.m_hostEnd = m_url.m_userStart;
-        m_url.m_portLength = 0;
+        m_url.m_portEnd = m_url.m_userStart;
         m_url.m_pathAfterLastSlash = m_url.m_userStart + 1;
         m_url.m_pathEnd = m_url.m_pathAfterLastSlash;
         m_url.m_queryEnd = m_url.m_pathAfterLastSlash;
@@ -1892,7 +1887,7 @@
         LOG_FINAL_STATE("RelativeSlash");
         copyURLPartsUntil(base, URLPart::PortEnd, c, isUTF8Encoding);
         appendToASCIIBuffer('/');
-        m_url.m_pathAfterLastSlash = m_url.m_hostEnd + m_url.m_portLength + 1;
+        m_url.m_pathAfterLastSlash = base.m_portEnd + 1;
         m_url.m_pathEnd = m_url.m_pathAfterLastSlash;
         m_url.m_queryEnd = m_url.m_pathAfterLastSlash;
         break;
@@ -1902,7 +1897,7 @@
         m_url.m_userEnd = m_url.m_userStart;
         m_url.m_passwordEnd = m_url.m_userStart;
         m_url.m_hostEnd = m_url.m_userStart;
-        m_url.m_portLength = 0;
+        m_url.m_portEnd = m_url.m_userStart;
         m_url.m_pathAfterLastSlash = m_url.m_userStart;
         m_url.m_pathEnd = m_url.m_userStart;
         m_url.m_queryEnd = m_url.m_userStart;
@@ -1919,7 +1914,7 @@
             m_url.m_userEnd = m_url.m_userStart;
             m_url.m_passwordEnd = m_url.m_userStart;
             m_url.m_hostEnd = m_url.m_userStart;
-            m_url.m_portLength = 0;
+            m_url.m_portEnd = m_url.m_userStart;
             m_url.m_pathEnd = m_url.m_userStart;
         } else if (!parseHostAndPort(authorityOrHostBegin)) {
             failure();
@@ -1928,9 +1923,9 @@
             if (m_urlIsSpecial) {
                 syntaxViolation(c);
                 appendToASCIIBuffer('/');
-                m_url.m_pathEnd = m_url.m_hostEnd + m_url.m_portLength + 1;
+                m_url.m_pathEnd = m_url.m_portEnd + 1;
             } else
-                m_url.m_pathEnd = m_url.m_hostEnd + m_url.m_portLength;
+                m_url.m_pathEnd = m_url.m_portEnd;
         }
         m_url.m_pathAfterLastSlash = m_url.m_pathEnd;
         m_url.m_queryEnd = m_url.m_pathEnd;
@@ -1944,9 +1939,9 @@
         if (m_urlIsSpecial) {
             syntaxViolation(c);
             appendToASCIIBuffer('/');
-            m_url.m_pathEnd = m_url.m_hostEnd + m_url.m_portLength + 1;
+            m_url.m_pathEnd = m_url.m_portEnd + 1;
         } else
-            m_url.m_pathEnd = m_url.m_hostEnd + m_url.m_portLength;
+            m_url.m_pathEnd = m_url.m_portEnd;
         m_url.m_pathAfterLastSlash = m_url.m_pathEnd;
         m_url.m_queryEnd = m_url.m_pathEnd;
         break;
@@ -1962,7 +1957,7 @@
         m_url.m_userEnd = m_url.m_userStart;
         m_url.m_passwordEnd = m_url.m_userStart;
         m_url.m_hostEnd = m_url.m_userStart;
-        m_url.m_portLength = 0;
+        m_url.m_portEnd = m_url.m_userStart;
         m_url.m_pathAfterLastSlash = m_url.m_userStart + 1;
         m_url.m_pathEnd = m_url.m_pathAfterLastSlash;
         m_url.m_queryEnd = m_url.m_pathAfterLastSlash;
@@ -1975,7 +1970,7 @@
         m_url.m_userEnd = m_url.m_userStart;
         m_url.m_passwordEnd = m_url.m_userStart;
         m_url.m_hostEnd = m_url.m_userStart;
-        m_url.m_portLength = 0;
+        m_url.m_portEnd = m_url.m_userStart;
         if (copyBaseWindowsDriveLetter(base)) {
             appendToASCIIBuffer('/');
             m_url.m_pathAfterLastSlash = m_url.m_userStart + 4;
@@ -2004,7 +1999,7 @@
             m_url.m_userEnd = m_url.m_userStart;
             m_url.m_passwordEnd = m_url.m_userStart;
             m_url.m_hostEnd = m_url.m_userStart;
-            m_url.m_portLength = 0;
+            m_url.m_portEnd = m_url.m_userStart;
             m_url.m_pathAfterLastSlash = m_url.m_userStart + 1;
             m_url.m_pathEnd = m_url.m_pathAfterLastSlash;
             m_url.m_queryEnd = m_url.m_pathAfterLastSlash;
@@ -2020,10 +2015,10 @@
         if (isLocalhost(parsedDataView(m_url.m_passwordEnd, currentPosition(c) - m_url.m_passwordEnd))) {
             m_asciiBuffer.shrink(m_url.m_passwordEnd);
             m_url.m_hostEnd = currentPosition(c);
-            m_url.m_portLength = 0;
+            m_url.m_portEnd = m_url.m_hostEnd;
         }
         appendToASCIIBuffer('/');
-        m_url.m_pathAfterLastSlash = m_url.m_hostEnd + m_url.m_portLength + 1;
+        m_url.m_pathAfterLastSlash = m_url.m_portEnd + 1;
         m_url.m_pathEnd = m_url.m_pathAfterLastSlash;
         m_url.m_queryEnd = m_url.m_pathAfterLastSlash;
         break;
@@ -2606,9 +2601,7 @@
     advance(iterator, colonIterator);
     uint32_t port = 0;
     if (UNLIKELY(iterator.atEnd())) {
-        unsigned portLength = currentPosition(colonIterator) - m_url.m_hostEnd;
-        RELEASE_ASSERT(portLength <= URL::maxPortLength);
-        m_url.m_portLength = portLength;
+        m_url.m_portEnd = currentPosition(colonIterator);
         syntaxViolation(colonIterator);
         return true;
     }
@@ -2645,9 +2638,7 @@
         appendNumberToASCIIBuffer<uint16_t>(static_cast<uint16_t>(port));
     }
 
-    unsigned portLength = currentPosition(iterator) - m_url.m_hostEnd;
-    RELEASE_ASSERT(portLength <= URL::maxPortLength);
-    m_url.m_portLength = portLength;
+    m_url.m_portEnd = currentPosition(iterator);
     return true;
 }
 
@@ -2673,7 +2664,7 @@
                     return parsePort(ipv6End);
                 }
                 m_url.m_hostEnd = currentPosition(ipv6End);
-                m_url.m_portLength = 0;
+                m_url.m_portEnd = m_url.m_hostEnd;
                 return true;
             }
             m_url.m_hostEnd = currentPosition(ipv6End);
@@ -2696,7 +2687,7 @@
         }
         m_url.m_hostEnd = currentPosition(iterator);
         if (iterator.atEnd()) {
-            m_url.m_portLength = 0;
+            m_url.m_portEnd = currentPosition(iterator);
             return true;
         }
         return parsePort(iterator);
@@ -2717,7 +2708,7 @@
             serializeIPv4(address.value());
             m_url.m_hostEnd = currentPosition(iterator);
             if (iterator.atEnd()) {
-                m_url.m_portLength = 0;
+                m_url.m_portEnd = currentPosition(iterator);
                 return true;
             }
             return parsePort(iterator);
@@ -2736,9 +2727,7 @@
         m_url.m_hostEnd = currentPosition(iterator);
         if (!hostIterator.atEnd())
             return parsePort(hostIterator);
-        unsigned portLength = currentPosition(iterator) - m_url.m_hostEnd;
-        RELEASE_ASSERT(portLength <= URL::maxPortLength);
-        m_url.m_portLength = portLength;
+        m_url.m_portEnd = currentPosition(iterator);
         return true;
     }
     
@@ -2780,7 +2769,7 @@
         serializeIPv4(address.value());
         m_url.m_hostEnd = currentPosition(iterator);
         if (iterator.atEnd()) {
-            m_url.m_portLength = 0;
+            m_url.m_portEnd = currentPosition(iterator);
             return true;
         }
         return parsePort(iterator);
@@ -2792,7 +2781,7 @@
     m_url.m_hostEnd = currentPosition(iterator);
     if (!iterator.atEnd())
         return parsePort(iterator);
-    m_url.m_portLength = 0;
+    m_url.m_portEnd = currentPosition(iterator);
     return true;
 }
 
@@ -2879,9 +2868,10 @@
 
 bool URLParser::allValuesEqual(const URL& a, const URL& b)
 {
-    URL_PARSER_LOG("%d %d %d %d %d %d %d %d %d %d %d %d %s\n%d %d %d %d %d %d %d %d %d %d %d %d %s",
+    // FIXME: m_cannotBeABaseURL is not compared because the old URL::parse did not use it,
+    // but once we get rid of URL::parse its value should be tested.
+    URL_PARSER_LOG("%d %d %d %d %d %d %d %d %d %d %d %s\n%d %d %d %d %d %d %d %d %d %d %d %s",
         a.m_isValid,
-        a.m_cannotBeABaseURL,
         a.m_protocolIsInHTTPFamily,
         a.m_schemeEnd,
         a.m_userStart,
@@ -2888,13 +2878,12 @@
         a.m_userEnd,
         a.m_passwordEnd,
         a.m_hostEnd,
-        a.m_hostEnd + a.m_portLength,
+        a.m_portEnd,
         a.m_pathAfterLastSlash,
         a.m_pathEnd,
         a.m_queryEnd,
         a.m_string.utf8().data(),
         b.m_isValid,
-        b.m_cannotBeABaseURL,
         b.m_protocolIsInHTTPFamily,
         b.m_schemeEnd,
         b.m_userStart,
@@ -2901,7 +2890,7 @@
         b.m_userEnd,
         b.m_passwordEnd,
         b.m_hostEnd,
-        b.m_hostEnd + b.m_portLength,
+        b.m_portEnd,
         b.m_pathAfterLastSlash,
         b.m_pathEnd,
         b.m_queryEnd,
@@ -2909,7 +2898,6 @@
 
     return a.m_string == b.m_string
         && a.m_isValid == b.m_isValid
-        && a.m_cannotBeABaseURL == b.m_cannotBeABaseURL
         && a.m_protocolIsInHTTPFamily == b.m_protocolIsInHTTPFamily
         && a.m_schemeEnd == b.m_schemeEnd
         && a.m_userStart == b.m_userStart
@@ -2916,7 +2904,7 @@
         && a.m_userEnd == b.m_userEnd
         && a.m_passwordEnd == b.m_passwordEnd
         && a.m_hostEnd == b.m_hostEnd
-        && a.m_portLength == b.m_portLength
+        && a.m_portEnd == b.m_portEnd
         && a.m_pathAfterLastSlash == b.m_pathAfterLastSlash
         && a.m_pathEnd == b.m_pathEnd
         && a.m_queryEnd == b.m_queryEnd;
@@ -2928,7 +2916,8 @@
         && url.m_userStart <= url.m_userEnd
         && url.m_userEnd <= url.m_passwordEnd
         && url.m_passwordEnd <= url.m_hostEnd
-        && url.m_hostEnd + url.m_portLength <= url.m_pathAfterLastSlash
+        && url.m_hostEnd <= url.m_portEnd
+        && url.m_portEnd <= url.m_pathAfterLastSlash
         && url.m_pathAfterLastSlash <= url.m_pathEnd
         && url.m_pathEnd <= url.m_queryEnd
         && url.m_queryEnd <= url.m_string.length();

Modified: trunk/Tools/ChangeLog (233754 => 233755)


--- trunk/Tools/ChangeLog	2018-07-12 03:36:18 UTC (rev 233754)
+++ trunk/Tools/ChangeLog	2018-07-12 03:37:51 UTC (rev 233755)
@@ -1,3 +1,17 @@
+2018-07-11  Commit Queue  <commit-qu...@webkit.org>
+
+        Unreviewed, rolling out r233742.
+        https://bugs.webkit.org/show_bug.cgi?id=187577
+
+        Binary incompatible change with respect to Service Worker
+        registration map (Requested by dydz on #webkit).
+
+        Reverted changeset:
+
+        "Reduce size of WebCore::URL"
+        https://bugs.webkit.org/show_bug.cgi?id=186820
+        https://trac.webkit.org/changeset/233742
+
 2018-07-11  Aditya Keerthi  <akeer...@apple.com>
 
         REGRESSION (231276): Attempting to copy an image fails

Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp (233754 => 233755)


--- trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp	2018-07-12 03:36:18 UTC (rev 233754)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp	2018-07-12 03:37:51 UTC (rev 233755)
@@ -1179,9 +1179,6 @@
     checkURLDifferences("file://:0/path",
         {"", "", "", "", 0, "", "", "", "file://:0/path"},
         {"file", "", "", "", 0, "/path", "", "", "file://:0/path"});
-    
-    checkURL("http://example.com:0000000000000077", {"http", "", "", "example.com", 77, "/", "", "", "http://example.com:77/"});
-    checkURL("http://example.com:0000000000000080", {"http", "", "", "example.com", 0, "/", "", "", "http://example.com/"});
 }
 
 TEST_F(URLParserTest, ParserFailures)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to