Reduce URL size
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Jul 2017 17:02:14 +0000 (17:02 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Jul 2017 17:02:14 +0000 (17:02 +0000)
commitea08edd3388c8a669ed44127d31847b4aa55d2c8
treec9dc7aecabab8a3664eda7bb6fd2dafac827dcaf
parent9cfc53ca732ed58bc1ba86179a230c0c57b85dcc
Reduce URL size
https://bugs.webkit.org/show_bug.cgi?id=174319

Patch by Alex Christensen <achristensen@webkit.org> on 2017-07-11
Reviewed by Andreas Kling.

m_fragmentEnd is redundant information. If a URL is valid, then it is always m_string.length().
If a URL is not valid, then it is always 0. Rather than storing additional information,
deduce the fragment end from the validity of the URL and the String's length.

No change in behavior.  This reduces sizeof(URL) from 56 to 48 and reduces operations when parsing.

* platform/URL.cpp:
(WebCore::URL::invalidate):
(WebCore::URL::fragmentIdentifier):
(WebCore::URL::hasFragmentIdentifier):
(WebCore::URL::removeFragmentIdentifier):
* platform/URL.h:
(WebCore::URL::encode):
(WebCore::URL::decode):
(WebCore::URL::hasFragment):
* platform/URLParser.cpp:
(WebCore::URLParser::urlLengthUntilPart):
(WebCore::URLParser::copyURLPartsUntil):
(WebCore::URLParser::parse):
(WebCore::URLParser::allValuesEqual):
(WebCore::URLParser::internalValuesConsistent):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@219338 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/URL.cpp
Source/WebCore/platform/URL.h
Source/WebCore/platform/URLParser.cpp