Make TextCodecCJK and TextCodecSingleByte thread-safe and refactor a bit to share code
Created attachment 408129 [details] Patch
Created attachment 408130 [details] Patch
Created attachment 408132 [details] Patch
Created attachment 408134 [details] Patch
Created attachment 408156 [details] Patch
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Comment on attachment 408156 [details] 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.
Committed r266703: <https://trac.webkit.org/changeset/266703>
<rdar://problem/68468669>
Comment on attachment 408156 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=408156&action=review > LayoutTests/platform/mac-wk2/TestExpectations:-1112 > # <rdar://problem/37330377> ASan tests exiting early due to timeouts > -[ Release ] imported/w3c/web-platform-tests/encoding [ Skip ] We probably still want to skip these tests in ASan builds, or at least the tests that just test that each code point is correct. They take too long.
Comment on attachment 408156 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=408156&action=review >> LayoutTests/platform/mac-wk2/TestExpectations:-1112 >> -[ Release ] imported/w3c/web-platform-tests/encoding [ Skip ] > > We probably still want to skip these tests in ASan builds, or at least the tests that just test that each code point is correct. They take too long. Oops, yes, I checked this in accidentally. The reason I un-skipped is that a lot of the encoding tests are skipped in all Debug builds due to an entry in TestExpectations, also due to the fact that they are too slow. Thus, also skipping them in Release builds means never running them at all. Luckily this is (for some reason) specifically Mac Modern WebKit only? If the intent is to skip specifically in ASan builds, we need to find a way to do that. The bug cited just above this was closed in 2018, so I think itβs in a strange state. What do you think we should do?
(In reply to Darin Adler from comment #11) > What do you think we should do? I think we should revert this one line. WK1 release runs all these tests.
(In reply to Alex Christensen from comment #12) > I think we should revert this one line. WK1 release runs all these tests. OK, done in r266704.