Chromium Code Reviews
DescriptionUse StringView for equalIgnoringCase.
This lets us merge the code paths and simplifies the code a bunch.
In doing this I removed the ASCII fast path that was in the
equalsIgnoringCase(const StringImpl*, const LChar*) function, though
curiously it wasn't in the (const UChar*, const LChar*) one, but that
function is also used a lot less often. Lets try removing this ancient
fast path for now (from 2006 with no comments about why it exists [1])
and instead opt for simpler code.
For comparing LChar strings the new path should be just as fast if not
faster. For comparing LChar to UChar strings we end up doing a foldCase
call which will be slower, but we should see how bad it is first.
Long term almost all callers of equalIgnoringCase need to switch to
equalIgnoringASCIICase anyway since that's what the specs require
(and what Webkit does now), which will put this fast path back in
place. We can also add the fast path back in the (LChar, UChar) path
if needed.
Switching all of the callers over to the new StringView version of
equalIgnoringCase also exposed that the CSP parsing logic was
accidentally using the function incorrectly and doing prefix matches
instead of actually comparing to the expected values as described in
issue 634217. This patches fixes that mistake.
[1] https://chromium.googlesource.com/chromium/src/+/6f022a05a21fc5ed091d7bcb6b81104ea2afdf8e
BUG=615174, 634217
Committed: https://crrev.com/9a8e5154f97acb2d9ccdee61e464e0d2b33b100e
Cr-Commit-Position: refs/heads/master@{#409987}
Patch Set 1 #Patch Set 2 : Fix CSPSourceList::parseNonce. #Patch Set 3 : fix. #Patch Set 4 : fix. #
Total comments: 3
Patch Set 5 : add rebaselines. #
Total comments: 7
Patch Set 6 : Add back ptr compare step. #
Total comments: 1
Patch Set 7 : DCHECK is silly. #Messages
Total messages: 47 (35 generated)
|