[webkit-reviews] review granted: [Bug 216229] Make TextCodecCJK and TextCodecSingleByte thread-safe and refactor a bit to share code : [Attachment 408156] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Sep 7 09:49:18 PDT 2020


Sam Weinig <sam at webkit.org> has granted Darin Adler <darin at apple.com>'s request
for review:
Bug 216229: Make TextCodecCJK and TextCodecSingleByte thread-safe and refactor
a bit to share code
https://bugs.webkit.org/show_bug.cgi?id=216229

Attachment 408156: Patch

https://bugs.webkit.org/attachment.cgi?id=408156&action=review




--- Comment #7 from Sam Weinig <sam at webkit.org> ---
Comment on attachment 408156
  --> https://bugs.webkit.org/attachment.cgi?id=408156
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=408156&action=review

> Source/WebCore/platform/text/EncodingTables.h:45
> +// FIXME: Consider moving these somewhere else since they are likely useful
for by more than just encoding tables.

Seem like a good fit for wtf/StdLibExtras.h in the future.

> Source/WebCore/platform/text/TextCodecCJK.cpp:132
> +    static JIS0208DecodeIndex* table;
> +    static std::once_flag once;
> +    std::call_once(once, [&] {
> +	   table = new JIS0208DecodeIndex;

Not new, but might be useful to have a comment here about why we are choosing
to do this as an allocation / lazy sort rather than a compile time content
table, which I presume is due to jis0208 already being huge, and not wanting to
bloat the WebCore binary even more. Same with eucKREncodingIndex/Big5 below.


More information about the webkit-reviews mailing list