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)
commitcc8a202bfca914d2a32be91a561058c39b213fb0
treec9dc7aecabab8a3664eda7bb6fd2dafac827dcaf
parent5086d3e8f0497d568be24547e4a565b908f30244
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: https://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