Commit a9271675 authored by Koji Ishii's avatar Koji Ishii Committed by Commit Bot

Eliminate DeprecatedLower in LayoutQuote

This patch changes LayoutQuote to use LowerASCII instead of
DeprecatedLower.

DeprecatedLower has partial Unicode conversions, such as
converting U+212A to 'k', but lowering only ASCII should be
sufficient for most web platform usages.

This case matches to a static set of lang-code, which are all
in ASCII. There will be slight behavior changes, such as
U+212A no longer matches to 'k', but such conversion should
not be expected.

Currently, there are 6 usages of AtomicString::DeprecatedLower
and 37 usages of String::DeprecatedLower. This patch reduces
one from the former.

Bug: 627682
Change-Id: I4bf36ffa4ad2e88bfcbd5b47e5bb836131003123
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1721075
Auto-Submit: Koji Ishii <kojii@chromium.org>
Reviewed-by: default avatarEmil A Eklund <eae@chromium.org>
Commit-Queue: Emil A Eklund <eae@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#681394}
parent 57fef891
......@@ -235,7 +235,7 @@ const QuotesData* QuotesDataForLanguage(const AtomicString& lang) {
// This could be just a hash table, but doing that adds 200k to LayoutQuote.o
Language* languages_end = g_languages + base::size(g_languages);
std::string lowercase_lang = lang.DeprecatedLower().Utf8();
std::string lowercase_lang = lang.LowerASCII().Utf8();
Language key = {lowercase_lang.c_str(), 0, 0, 0, 0, nullptr};
Language* match = std::lower_bound(g_languages, languages_end, key);
if (match == languages_end || strcmp(match->lang, key.lang))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment