Date: Thursday, January 12, 2023 @ 08:32:21
  Author: foutrelis
Revision: 466367

Re-enable system ICU; add upstream patch for crash

Added:
  chromium/trunk/fix-the-way-to-handle-codecs-in-the-system-icu.patch
Modified:
  chromium/trunk/PKGBUILD

------------------------------------------------------+
 PKGBUILD                                             |    5 +
 fix-the-way-to-handle-codecs-in-the-system-icu.patch |   60 +++++++++++++++++
 2 files changed, 64 insertions(+), 1 deletion(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2023-01-12 06:49:58 UTC (rev 466366)
+++ PKGBUILD    2023-01-12 08:32:21 UTC (rev 466367)
@@ -27,6 +27,7 @@
         
https://github.com/foutrelis/chromium-launcher/archive/v$_launcher_ver/chromium-launcher-$_launcher_ver.tar.gz
         
https://github.com/stha09/chromium-patches/releases/download/chromium-${pkgver%%.*}-patchset-$_gcc_patchset/chromium-${pkgver%%.*}-patchset-$_gcc_patchset.tar.xz
         v8-enhance-Date-parser-to-take-Unicode-SPACE.patch
+        fix-the-way-to-handle-codecs-in-the-system-icu.patch
         REVERT-roll-src-third_party-ffmpeg-m102.patch
         REVERT-roll-src-third_party-ffmpeg-m106.patch
         disable-GlobalMediaControlsCastStartStop.patch
@@ -36,6 +37,7 @@
             '213e50f48b67feb4441078d50b0fd431df34323be15be97c55302d3fdac4483a'
             '1ca780a2ad5351f60671a828064392096c8da7b589086ee999f25c9e6e799a7b'
             'b83406a881d66627757d9cbc05e345cbb2bd395a48b6d4c970e5e1cb3f6ed454'
+            'a5d5c532b0b059895bc13aaaa600d21770eab2afa726421b78cb597a78a3c7e3'
             '30df59a9e2d95dcb720357ec4a83d9be51e59cc5551365da4c0073e68ccdec44'
             '4c12d31d020799d31355faa7d1fe2a5a807f7458e7f0c374adf55edb37032152'
             '7f3b1b22d6a271431c1f9fc92b6eb49c6d80b8b3f868bdee07a6a1a16630a302'
@@ -52,7 +54,7 @@
   [fontconfig]=fontconfig
   [freetype]=freetype2
   [harfbuzz-ng]=harfbuzz
-  #[icu]=icu                 # https://crbug.com/1382032
+  [icu]=icu
   [jsoncpp]=jsoncpp
   [libaom]=aom
   [libavif]=libavif
@@ -103,6 +105,7 @@
 
   # Upstream fixes
   patch -Np1 -d v8 <../v8-enhance-Date-parser-to-take-Unicode-SPACE.patch
+  patch -Np1 -i ../fix-the-way-to-handle-codecs-in-the-system-icu.patch
 
   # Revert ffmpeg roll requiring new channel layout API support
   # https://crbug.com/1325301

Added: fix-the-way-to-handle-codecs-in-the-system-icu.patch
===================================================================
--- fix-the-way-to-handle-codecs-in-the-system-icu.patch                        
        (rev 0)
+++ fix-the-way-to-handle-codecs-in-the-system-icu.patch        2023-01-12 
08:32:21 UTC (rev 466367)
@@ -0,0 +1,60 @@
+From 4885090741554be61cb2ed10194cefb29bf8be64 Mon Sep 17 00:00:00 2001
+From: Yoshisato Yanagisawa <[email protected]>
+Date: Wed, 11 Jan 2023 23:51:39 +0000
+Subject: [PATCH] Fix the way to handle codecs in the system icu.
+
+The previous code does not register codecs whose standard name is
+different from the bundled ICU.  As a result, looking up such codecs
+seems to fail unexpectedly.
+
+Bug: 1382032
+Change-Id: I8a61f77d0f70104415d24dd954b3b7061ffca556
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4154277
+Reviewed-by: Kent Tamura <[email protected]>
+Commit-Queue: Yoshisato Yanagisawa <[email protected]>
+Cr-Commit-Position: refs/heads/main@{#1091571}
+---
+ .../renderer/platform/wtf/text/text_codec_icu.cc   | 14 ++++++++++----
+ 1 file changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/third_party/blink/renderer/platform/wtf/text/text_codec_icu.cc 
b/third_party/blink/renderer/platform/wtf/text/text_codec_icu.cc
+index a70b359984f..33ce43f3563 100644
+--- a/third_party/blink/renderer/platform/wtf/text/text_codec_icu.cc
++++ b/third_party/blink/renderer/platform/wtf/text/text_codec_icu.cc
+@@ -116,6 +116,10 @@ void 
TextCodecICU::RegisterEncodingNames(EncodingNameRegistrar registrar) {
+       continue;
+     }
+ #endif
++    // Avoid codecs supported by `TextCodecCJK`.
++    if (is_text_codec_cjk_enabled && 
TextCodecCJK::IsSupported(standard_name)) {
++      continue;
++    }
+ 
+ // A number of these aliases are handled in Chrome's copy of ICU, but
+ // Chromium can be compiled with the system ICU.
+@@ -144,12 +148,13 @@ void 
TextCodecICU::RegisterEncodingNames(EncodingNameRegistrar registrar) {
+     }
+ #endif
+ 
+-    if (is_text_codec_cjk_enabled && 
TextCodecCJK::IsSupported(standard_name)) {
+-      continue;
++    // Avoid registering codecs registered by
++    // `TextCodecCJK::RegisterEncodingNames`.
++    if (!is_text_codec_cjk_enabled ||
++        !TextCodecCJK::IsSupported(standard_name)) {
++      registrar(standard_name, standard_name);
+     }
+ 
+-    registrar(standard_name, standard_name);
+-
+     uint16_t num_aliases = ucnv_countAliases(name, &error);
+     DCHECK(U_SUCCESS(error));
+     if (U_SUCCESS(error))
+@@ -289,6 +294,7 @@ void TextCodecICU::RegisterCodecs(TextCodecRegistrar 
registrar) {
+       continue;
+     }
+ #endif
++    // Avoid codecs supported by `TextCodecCJK`.
+     if (is_text_codec_cjk_enabled && 
TextCodecCJK::IsSupported(standard_name)) {
+       continue;
+     }

Reply via email to