[arch-commits] Commit in electron11/repos (18 files)

Evangelos Foutras foutrelis at gemini.archlinux.org
Sun Jan 30 20:26:45 UTC 2022


    Date: Sunday, January 30, 2022 @ 20:26:45
  Author: foutrelis
Revision: 1120871

archrelease: copy trunk to community-staging-x86_64

Added:
  electron11/repos/community-staging-x86_64/
  electron11/repos/community-staging-x86_64/PKGBUILD
    (from rev 1120870, electron11/trunk/PKGBUILD)
  electron11/repos/community-staging-x86_64/chromium-glibc-2.33.patch
    (from rev 1120870, electron11/trunk/chromium-glibc-2.33.patch)
  electron11/repos/community-staging-x86_64/chromium-harfbuzz-3.0.0.patch
    (from rev 1120870, electron11/trunk/chromium-harfbuzz-3.0.0.patch)
  electron11/repos/community-staging-x86_64/chromium-include-limits.patch
    (from rev 1120870, electron11/trunk/chromium-include-limits.patch)
  electron11/repos/community-staging-x86_64/chromium-include-stddef.patch
    (from rev 1120870, electron11/trunk/chromium-include-stddef.patch)
  electron11/repos/community-staging-x86_64/chromium-skia-harmony.patch
    (from rev 1120870, electron11/trunk/chromium-skia-harmony.patch)
  electron11/repos/community-staging-x86_64/d62de64e2fd20a4811593cb2248bb476aebfadf5.patch
    (from rev 1120870, electron11/trunk/d62de64e2fd20a4811593cb2248bb476aebfadf5.patch)
  electron11/repos/community-staging-x86_64/default_app-icon.patch
    (from rev 1120870, electron11/trunk/default_app-icon.patch)
  electron11/repos/community-staging-x86_64/electron11.desktop
    (from rev 1120870, electron11/trunk/electron11.desktop)
  electron11/repos/community-staging-x86_64/enable-dse-memoryssa.patch
    (from rev 1120870, electron11/trunk/enable-dse-memoryssa.patch)
  electron11/repos/community-staging-x86_64/ffmpeg5.patch
    (from rev 1120870, electron11/trunk/ffmpeg5.patch)
  electron11/repos/community-staging-x86_64/icu68.patch
    (from rev 1120870, electron11/trunk/icu68.patch)
  electron11/repos/community-staging-x86_64/skia-harfbuzz-3.0.0.patch
    (from rev 1120870, electron11/trunk/skia-harfbuzz-3.0.0.patch)
  electron11/repos/community-staging-x86_64/sql-make-VirtualCursor-standard-layout-type.patch
    (from rev 1120870, electron11/trunk/sql-make-VirtualCursor-standard-layout-type.patch)
  electron11/repos/community-staging-x86_64/use-system-libraries-in-node.patch
    (from rev 1120870, electron11/trunk/use-system-libraries-in-node.patch)
  electron11/repos/community-staging-x86_64/v8-call-new-ListFormatter-createInstance.patch
    (from rev 1120870, electron11/trunk/v8-call-new-ListFormatter-createInstance.patch)
  electron11/repos/community-staging-x86_64/v8-icu68.patch
    (from rev 1120870, electron11/trunk/v8-icu68.patch)

---------------------------------------------------+
 PKGBUILD                                          |  252 +++++++++++
 chromium-glibc-2.33.patch                         |  144 ++++++
 chromium-harfbuzz-3.0.0.patch                     |   20 
 chromium-include-limits.patch                     |   21 
 chromium-include-stddef.patch                     |   10 
 chromium-skia-harmony.patch                       |   14 
 d62de64e2fd20a4811593cb2248bb476aebfadf5.patch    |   35 +
 default_app-icon.patch                            |   21 
 electron11.desktop                                |    7 
 enable-dse-memoryssa.patch                        |   50 ++
 ffmpeg5.patch                                     |  142 ++++++
 icu68.patch                                       |  421 ++++++++++++++++++++
 skia-harfbuzz-3.0.0.patch                         |  100 ++++
 sql-make-VirtualCursor-standard-layout-type.patch |  238 +++++++++++
 use-system-libraries-in-node.patch                |   53 ++
 v8-call-new-ListFormatter-createInstance.patch    |   95 ++++
 v8-icu68.patch                                    |  192 +++++++++
 17 files changed, 1815 insertions(+)

Copied: electron11/repos/community-staging-x86_64/PKGBUILD (from rev 1120870, electron11/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD	                        (rev 0)
+++ community-staging-x86_64/PKGBUILD	2022-01-30 20:26:45 UTC (rev 1120871)
@@ -0,0 +1,252 @@
+# Maintainer: Nicola Squartini <tensor5 at gmail.com>
+
+pkgname=electron11
+pkgver=11.5.0
+_commit=3d0705d81fd8b829372a732577b5c275352a9da6
+_chromiumver=87.0.4280.141
+pkgrel=4
+pkgdesc='Build cross platform desktop apps with web technologies'
+arch=('x86_64')
+url='https://electronjs.org/'
+license=('MIT' 'custom')
+depends=('c-ares' 'ffmpeg' 'gtk3' 'http-parser' 'libevent' 'libnghttp2'
+         'libxslt' 'minizip' 'nss' 're2' 'snappy')
+makedepends=('clang' 'git' 'gn-m87' 'gperf' 'harfbuzz-icu' 'java-runtime-headless'
+             'jsoncpp' 'libnotify' 'lld' 'llvm' 'ninja' 'npm' 'pciutils' 'yarn'
+             'python2' 'wget')
+optdepends=('kde-cli-tools: file deletion support (kioclient5)'
+            'libappindicator-gtk3: StatusNotifierItem support'
+            'trash-cli: file deletion support (trash-put)'
+            "xdg-utils: open URLs with desktop's default (xdg-email, xdg-open)")
+options=('!lto') # Electron adds its own flags for ThinLTO
+source=('git+https://github.com/electron/electron.git'
+        'git+https://chromium.googlesource.com/chromium/tools/depot_tools.git'
+        "${pkgname}.desktop"
+        'default_app-icon.patch'
+        'use-system-libraries-in-node.patch'
+        'icu68.patch'
+        'v8-icu68.patch'
+        'v8-call-new-ListFormatter-createInstance.patch'
+        'chromium-glibc-2.33.patch'
+        'chromium-harfbuzz-3.0.0.patch'
+        'skia-harfbuzz-3.0.0.patch'
+        'enable-dse-memoryssa.patch'
+        'chromium-include-limits.patch'
+        'chromium-include-stddef.patch'
+        'chromium-skia-harmony.patch'
+        'sql-make-VirtualCursor-standard-layout-type.patch'
+        'ffmpeg5.patch'
+        'd62de64e2fd20a4811593cb2248bb476aebfadf5.patch'
+       )
+sha256sums=('SKIP'
+            'SKIP'
+            '9e3a2329e7226ff25541f80f541e7a06548193f1c9650a64ccf98dcc75fda7b3'
+            'dd2d248831dd4944d385ebf008426e66efe61d6fdf66f8932c963a12167947b4'
+            '0c54e488780e984c4be5879fa43d0e6fd23edc2207a7ec607c7886fca5115a12'
+            '38fb5218331d6e03915490dab64f7b8bf26833a581d1aaa02090437c67e9439c'
+            '6e919c9712d8fe6c2918778df1f8c2ee0675a87a48be5d2aaa54e320703ced4b'
+            '44ebcff050a1c849819d66399c14bd711801d0eb64f518d292d3d6efedce3b3a'
+            '2fccecdcd4509d4c36af873988ca9dbcba7fdb95122894a9fdf502c33a1d7a4b'
+            '7ce947944a139e66774dfc7249bf7c3069f07f83a0f1b2c1a1b14287a7e15928'
+            'c9ed1dbadaf4be6097e25bc5577b91751799befc2d0376b143e1bd10def5754e'
+            '0760a499534588674a173605f6bad1336e9a35ef97209cb0fed0f3573ce170cf'
+            'de7090b3f449372dd721b64eb10a02d15a1018961def0b4f35d2c90167ded524'
+            '2c76f4b2572ec9f065433199e0cfaf58a5cfc869920c6c851150e9bcfe4d6d2a'
+            '771292942c0901092a402cc60ee883877a99fb804cb54d568c8c6c94565a48e1'
+            'dd317f85e5abfdcfc89c6f23f4c8edbcdebdd5e083dcec770e5da49ee647d150'
+            '4f32b815349357ef1f17b36059cee588c994472b9754a194fff41ec21a93826b'
+            '6aa5b18ae8fcc9c5bacf28dc5cb8bd06f04574087c951ec3bc3ae795a2cd696c'
+           )
+
+_system_libs=('ffmpeg'
+              'flac'
+              'fontconfig'
+              'freetype'
+              'harfbuzz-ng'
+              'icu'
+              'libdrm'
+              'libevent'
+              'libjpeg'
+              'libpng'
+#              'libvpx'
+              'libwebp'
+              'libxml'
+              'libxslt'
+#              'openh264'
+              'opus'
+              're2'
+              'snappy'
+              'zlib'
+             )
+
+prepare() {
+  mkdir -p "${srcdir}"/python2-path
+  ln -sf /usr/bin/python2 "${srcdir}/python2-path/python"
+  export PATH="${srcdir}/python2-path:${PATH}:${srcdir}/depot_tools"
+
+  echo "Fetching chromium..."
+  git clone --branch=${_chromiumver} --depth=1 \
+      https://chromium.googlesource.com/chromium/src.git
+
+  echo "solutions = [
+  {
+    \"name\": \"src/electron\",
+    \"url\": \"file://${srcdir}/electron@${_commit}\",
+    \"deps_file\": \"DEPS\",
+    \"managed\": False,
+    \"custom_deps\": {
+      \"src\": None,
+    },
+    \"custom_vars\": {},
+  },
+]" > .gclient
+
+  python2 "${srcdir}/depot_tools/gclient.py" sync \
+      --with_branch_heads \
+      --with_tags \
+      --nohooks
+
+  sed -e "s/'am'/'apply'/" -i src/electron/script/lib/git.py
+
+  echo "Running hooks..."
+  # python2 "${srcdir}/depot_tools/gclient.py" runhooks
+  python2 src/build/landmines.py
+  python2 src/build/util/lastchange.py -o src/build/util/LASTCHANGE
+  python2 src/build/util/lastchange.py -m GPU_LISTS_VERSION \
+    --revision-id-only --header src/gpu/config/gpu_lists_version.h
+  python2 src/build/util/lastchange.py -m SKIA_COMMIT_HASH \
+    -s src/third_party/skia --header src/skia/ext/skia_commit_hash.h
+  # Create sysmlink to system clang-format
+  ln -s /usr/bin/clang-format src/buildtools/linux64
+  # Create sysmlink to system Node.js
+  mkdir -p src/third_party/node/linux/node-linux-x64/bin
+  ln -sf /usr/bin/node src/third_party/node/linux/node-linux-x64/bin
+  #python2 src/third_party/depot_tools/download_from_google_storage.py \
+  #  --no_resume --extract --no_auth --bucket chromium-nodejs \
+  #  -s src/third_party/node/node_modules.tar.gz.sha1
+  cd src/third_party/node
+  npm ci
+  cd ../../..
+  vpython src/tools/download_optimization_profile.py \
+    --newest_state=src/chrome/android/profiles/newest.txt \
+    --local_state=src/chrome/android/profiles/local.txt \
+    --output_name=src/chrome/android/profiles/afdo.prof \
+    --gs_url_base=chromeos-prebuilt/afdo-job/llvm
+  #vpython src/tools/update_pgo_profiles.py \
+  #  --target=linux \
+  #  update \
+  #  --gs-url-base=chromium-optimization-profiles/pgo_profiles
+  python2 src/electron/script/apply_all_patches.py \
+      src/electron/patches/config.json
+  cd src/electron
+  yarn install --frozen-lockfile
+  cd ..
+
+  echo "Applying local patches..."
+
+  patch -Np1 -i ../ffmpeg5.patch
+  # Patches to build with ffmpeg 4.4; remove when ffmpeg 5.0 moves to stable
+  if ! pkg-config --atleast-version 59 libavformat; then
+    patch -Rp1 -i ../ffmpeg5.patch
+  fi
+
+  patch -Np1 -i ../icu68.patch
+  patch -Np1 -d v8 <../v8-icu68.patch
+  patch -Np1 -d v8 <../v8-call-new-ListFormatter-createInstance.patch
+  patch -Np0 -i ../chromium-skia-harmony.patch
+  patch -Np1 -i ../chromium-glibc-2.33.patch
+  patch -Np1 -i ../chromium-harfbuzz-3.0.0.patch
+  patch -Np1 -i ../enable-dse-memoryssa.patch
+  patch -Np1 -d third_party/skia <../skia-harfbuzz-3.0.0.patch
+  patch -Np1 -i ../chromium-include-limits.patch
+  patch -Np1 -i ../chromium-include-stddef.patch
+  patch -Np1 -i ../sql-make-VirtualCursor-standard-layout-type.patch
+  patch -Np1 -i ../d62de64e2fd20a4811593cb2248bb476aebfadf5.patch
+  patch -Np1 -i ../use-system-libraries-in-node.patch
+  patch -Np1 -i ../default_app-icon.patch  # Icon from .desktop file
+
+  echo "Patching Chromium for using system libraries..."
+  sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \
+      tools/generate_shim_headers/generate_shim_headers.py
+  for lib in $(printf "%s\n" "${_system_libs[@]}" | sed 's/^libjpeg$/&_turbo/'); do
+      third_party_dir="third_party/${lib}"
+      if [ ! -d ${third_party_dir} ]; then
+        third_party_dir="base/${third_party_dir}"
+      fi
+      find ${third_party_dir} -type f \
+          \! -path "${third_party_dir}/chromium/*" \
+          \! -path "${third_party_dir}/google/*" \
+          \! -path 'third_party/harfbuzz-ng/utils/hb_scoped.h' \
+          \! -regex '.*\.\(gn\|gni\|isolate\)' \
+          -delete
+  done
+  python2 build/linux/unbundle/replace_gn_files.py \
+      --system-libraries \
+      "${_system_libs[@]}"
+}
+
+build() {
+  export CC=clang
+  export CXX=clang++
+  export AR=ar
+  export NM=nm
+
+  CFLAGS="${CFLAGS/-fexceptions/}"
+  CXXFLAGS="${CXXFLAGS/-fexceptions/}"
+
+  # This appears to cause random segfaults when combined with ThinLTO
+  # https://bugs.archlinux.org/task/73518
+  CFLAGS=${CFLAGS/-fstack-clash-protection}
+  CXXFLAGS=${CXXFLAGS/-fstack-clash-protection}
+
+  # Do not warn about unknown warning options
+  CFLAGS+='   -Wno-unknown-warning-option'
+  CXXFLAGS+=' -Wno-unknown-warning-option'
+
+  cd src
+  export CHROMIUM_BUILDTOOLS_PATH="${PWD}/buildtools"
+  GN_EXTRA_ARGS='
+    blink_symbol_level = 0
+    chrome_pgo_phase = 0
+    clang_use_chrome_plugins = false
+    custom_toolchain = "//build/toolchain/linux/unbundle:default"
+    host_toolchain = "//build/toolchain/linux/unbundle:default"
+    icu_use_data_file = false
+    is_component_ffmpeg = false
+    link_pulseaudio = true
+    treat_warnings_as_errors = false
+    use_custom_libcxx = false
+    use_gnome_keyring = false
+    use_sysroot = false
+  '
+  gn-m87 gen out/Release \
+      --args="import(\"//electron/build/args/release.gn\") ${GN_EXTRA_ARGS}"
+  ninja -C out/Release electron
+  # Strip before zip to avoid
+  # zipfile.LargeZipFile: Filesize would require ZIP64 extensions
+  strip -s out/Release/electron
+  ninja -C out/Release electron_dist_zip
+  # ninja -C out/Release third_party/electron_node:headers
+}
+
+package() {
+  install -dm755 "${pkgdir}/usr/lib/${pkgname}"
+  bsdtar -xf src/out/Release/dist.zip -C "${pkgdir}/usr/lib/${pkgname}"
+
+  chmod u+s "${pkgdir}/usr/lib/${pkgname}/chrome-sandbox"
+
+  install -dm755 "${pkgdir}/usr/share/licenses/${pkgname}"
+  for l in "${pkgdir}/usr/lib/${pkgname}"/{LICENSE,LICENSES.chromium.html}; do
+    ln -s  \
+      "$(realpath --relative-to="${pkgdir}/usr/share/licenses/${pkgname}" "${l}")" \
+      "${pkgdir}/usr/share/licenses/${pkgname}"
+  done
+
+  install -dm755 "${pkgdir}"/usr/bin
+  ln -s "../lib/${pkgname}/electron" "${pkgdir}/usr/bin/${pkgname}"
+
+  # Install .desktop and icon file (see default_app-icon.patch)
+  install -Dm644 -t "${pkgdir}/usr/share/applications" "${pkgname}.desktop"
+  install -Dm644 src/electron/default_app/icon.png \
+          "${pkgdir}/usr/share/pixmaps/${pkgname}.png"  # hicolor has no 1024x1024
+}

Copied: electron11/repos/community-staging-x86_64/chromium-glibc-2.33.patch (from rev 1120870, electron11/trunk/chromium-glibc-2.33.patch)
===================================================================
--- community-staging-x86_64/chromium-glibc-2.33.patch	                        (rev 0)
+++ community-staging-x86_64/chromium-glibc-2.33.patch	2022-01-30 20:26:45 UTC (rev 1120871)
@@ -0,0 +1,144 @@
+# Patch made by Kevin Kofler <Kevin at tigcc.ticalc.org>
+# https://bugzilla.redhat.com/show_bug.cgi?id=1904652
+
+diff -up chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc.fstatfix chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
+--- chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc.fstatfix	2021-01-25 10:11:45.427436398 -0500
++++ chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc	2021-01-25 10:12:51.337699003 -0500
+@@ -257,6 +257,18 @@ ResultExpr EvaluateSyscallImpl(int fs_de
+     return RestrictKillTarget(current_pid, sysno);
+   }
+ 
++#if defined(__NR_newfstatat)
++  if (sysno == __NR_newfstatat) {
++    return RewriteFstatatSIGSYS();
++  }
++#endif
++
++#if defined(__NR_fstatat64)
++  if (sysno == __NR_fstatat64) {
++    return RewriteFstatatSIGSYS();
++  }
++#endif
++
+   if (SyscallSets::IsFileSystem(sysno) ||
+       SyscallSets::IsCurrentDirectory(sysno)) {
+     return Error(fs_denied_errno);
+diff -up chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc.fstatfix chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc
+--- chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc.fstatfix	2021-01-25 10:13:10.179774081 -0500
++++ chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc	2021-01-25 10:16:18.790525746 -0500
+@@ -6,6 +6,8 @@
+ 
+ #include "sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h"
+ 
++#include <errno.h>
++#include <fcntl.h>
+ #include <stddef.h>
+ #include <stdint.h>
+ #include <string.h>
+@@ -355,6 +357,35 @@ intptr_t SIGSYSSchedHandler(const struct
+   return -ENOSYS;
+ }
+ 
++intptr_t SIGSYSFstatatHandler(const struct arch_seccomp_data& args,
++                              void* aux) {
++  switch (args.nr) {
++#if defined(__NR_newfstatat)
++    case __NR_newfstatat:
++#endif
++#if defined(__NR_fstatat64)
++    case __NR_fstatat64:
++#endif
++#if defined(__NR_newfstatat) || defined(__NR_fstatat64)
++      if (*reinterpret_cast<const char *>(args.args[1]) == '\0'
++          && args.args[3] == static_cast<uint64_t>(AT_EMPTY_PATH)) {
++        return sandbox::sys_fstat64(static_cast<int>(args.args[0]),
++                                    reinterpret_cast<struct stat64 *>(args.args[2]));
++      } else {
++        errno = EACCES;
++        return -1;
++      }
++      break;
++#endif
++  }
++
++  CrashSIGSYS_Handler(args, aux);
++
++  // Should never be reached.
++  RAW_CHECK(false);
++  return -ENOSYS;
++}
++
+ bpf_dsl::ResultExpr CrashSIGSYS() {
+   return bpf_dsl::Trap(CrashSIGSYS_Handler, NULL);
+ }
+@@ -387,6 +418,10 @@ bpf_dsl::ResultExpr RewriteSchedSIGSYS()
+   return bpf_dsl::Trap(SIGSYSSchedHandler, NULL);
+ }
+ 
++bpf_dsl::ResultExpr RewriteFstatatSIGSYS() {
++  return bpf_dsl::Trap(SIGSYSFstatatHandler, NULL);
++}
++
+ void AllocateCrashKeys() {
+ #if !defined(OS_NACL_NONSFI)
+   if (seccomp_crash_key)
+diff -up chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h.fstatfix chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h
+--- chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h.fstatfix	2021-01-25 10:16:36.982598236 -0500
++++ chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h	2021-01-25 10:18:45.705111027 -0500
+@@ -62,6 +62,10 @@ SANDBOX_EXPORT intptr_t SIGSYSPtraceFail
+ // sched_setparam(), sched_setscheduler()
+ SANDBOX_EXPORT intptr_t SIGSYSSchedHandler(const arch_seccomp_data& args,
+                                            void* aux);
++// If the fstatat syscall is actually a disguised fstat, calls the regular fstat
++// syscall, otherwise, crashes in the same way as CrashSIGSYS_Handler.
++SANDBOX_EXPORT intptr_t SIGSYSFstatatHandler(const struct arch_seccomp_data& args, 
++                                             void* aux);
+ 
+ // Variants of the above functions for use with bpf_dsl.
+ SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYS();
+@@ -72,6 +76,7 @@ SANDBOX_EXPORT bpf_dsl::ResultExpr Crash
+ SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYSFutex();
+ SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYSPtrace();
+ SANDBOX_EXPORT bpf_dsl::ResultExpr RewriteSchedSIGSYS();
++SANDBOX_EXPORT bpf_dsl::ResultExpr RewriteFstatatSIGSYS();
+ 
+ // Allocates a crash key so that Seccomp information can be recorded.
+ void AllocateCrashKeys();
+diff -up chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.cc.fstatfix chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.cc
+--- chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.cc.fstatfix	2021-01-25 10:18:53.307141311 -0500
++++ chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.cc	2021-01-25 10:19:46.982355293 -0500
+@@ -261,4 +261,13 @@ int sys_sigaction(int signum,
+ 
+ #endif  // defined(MEMORY_SANITIZER)
+ 
++SANDBOX_EXPORT int sys_fstat64(int fd, struct stat64 *buf)
++{
++#if defined(__NR_fstat64)
++    return syscall(__NR_fstat64, fd, buf);
++#else
++    return syscall(__NR_fstat, fd, buf);
++#endif
++}
++
+ }  // namespace sandbox
+diff -up chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.h.fstatfix chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.h
+--- chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.h.fstatfix	2021-01-25 10:19:53.115379741 -0500
++++ chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.h	2021-01-25 10:20:45.485588421 -0500
+@@ -17,6 +17,7 @@ struct sock_fprog;
+ struct rlimit64;
+ struct cap_hdr;
+ struct cap_data;
++struct stat64;
+ 
+ namespace sandbox {
+ 
+@@ -84,6 +85,9 @@ SANDBOX_EXPORT int sys_sigaction(int sig
+                                  const struct sigaction* act,
+                                  struct sigaction* oldact);
+ 
++// Recent glibc rewrites fstat to fstatat.
++SANDBOX_EXPORT int sys_fstat64(int fd, struct stat64 *buf);
++
+ }  // namespace sandbox
+ 
+ #endif  // SANDBOX_LINUX_SERVICES_SYSCALL_WRAPPERS_H_

Copied: electron11/repos/community-staging-x86_64/chromium-harfbuzz-3.0.0.patch (from rev 1120870, electron11/trunk/chromium-harfbuzz-3.0.0.patch)
===================================================================
--- community-staging-x86_64/chromium-harfbuzz-3.0.0.patch	                        (rev 0)
+++ community-staging-x86_64/chromium-harfbuzz-3.0.0.patch	2022-01-30 20:26:45 UTC (rev 1120871)
@@ -0,0 +1,20 @@
+# https://github.com/chromium/chromium/commit/b289f6f3fcbc
+
+diff --git a/components/paint_preview/common/subset_font.cc b/components/paint_preview/common/subset_font.cc
+index 8ff0540d9a..20a7d37474 100644
+--- a/components/paint_preview/common/subset_font.cc
++++ b/components/paint_preview/common/subset_font.cc
+@@ -72,9 +72,11 @@ sk_sp<SkData> SubsetFont(SkTypeface* typeface, const GlyphUsage& usage) {
+   hb_set_t* glyphs =
+       hb_subset_input_glyph_set(input.get());  // Owned by |input|.
+   usage.ForEach(base::BindRepeating(&AddGlyphs, base::Unretained(glyphs)));
+-  hb_subset_input_set_retain_gids(input.get(), true);
++  hb_subset_input_set_flags(input.get(), HB_SUBSET_FLAGS_RETAIN_GIDS);
+ 
+-  HbScoped<hb_face_t> subset_face(hb_subset(face.get(), input.get()));
++  HbScoped<hb_face_t> subset_face(hb_subset_or_fail(face.get(), input.get()));
++  if (!subset_face)
++    return nullptr;
+   HbScoped<hb_blob_t> subset_blob(hb_face_reference_blob(subset_face.get()));
+   if (!subset_blob)
+     return nullptr;

Copied: electron11/repos/community-staging-x86_64/chromium-include-limits.patch (from rev 1120870, electron11/trunk/chromium-include-limits.patch)
===================================================================
--- community-staging-x86_64/chromium-include-limits.patch	                        (rev 0)
+++ community-staging-x86_64/chromium-include-limits.patch	2022-01-30 20:26:45 UTC (rev 1120871)
@@ -0,0 +1,21 @@
+--- a/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc
++++ b/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc
+@@ -37,6 +37,7 @@
+ 
+ #include <algorithm>
+ #include <array>
++#include <limits>
+ #include "absl/base/internal/hide_ptr.h"
+ #include "absl/base/internal/raw_logging.h"
+ #include "absl/base/internal/spinlock.h"
+--- a/third_party/perfetto/src/trace_processor/containers/string_pool.h
++++ b/third_party/perfetto/src/trace_processor/containers/string_pool.h
+@@ -17,6 +17,8 @@
+ #ifndef SRC_TRACE_PROCESSOR_CONTAINERS_STRING_POOL_H_
+ #define SRC_TRACE_PROCESSOR_CONTAINERS_STRING_POOL_H_
+ 
++#include <limits>
++
+ #include <stddef.h>
+ #include <stdint.h>
+ 

Copied: electron11/repos/community-staging-x86_64/chromium-include-stddef.patch (from rev 1120870, electron11/trunk/chromium-include-stddef.patch)
===================================================================
--- community-staging-x86_64/chromium-include-stddef.patch	                        (rev 0)
+++ community-staging-x86_64/chromium-include-stddef.patch	2022-01-30 20:26:45 UTC (rev 1120871)
@@ -0,0 +1,10 @@
+--- a/net/dns/dns_server_iterator.h
++++ b/net/dns/dns_server_iterator.h
+@@ -5,6 +5,7 @@
+ #ifndef NET_DNS_DNS_SERVER_ITERATOR_H_
+ #define NET_DNS_DNS_SERVER_ITERATOR_H_
+ 
++#include <stddef.h>
+ #include <vector>
+ 
+ #include "net/base/net_export.h"

Copied: electron11/repos/community-staging-x86_64/chromium-skia-harmony.patch (from rev 1120870, electron11/trunk/chromium-skia-harmony.patch)
===================================================================
--- community-staging-x86_64/chromium-skia-harmony.patch	                        (rev 0)
+++ community-staging-x86_64/chromium-skia-harmony.patch	2022-01-30 20:26:45 UTC (rev 1120871)
@@ -0,0 +1,14 @@
+--- third_party/skia/src/ports/SkFontHost_FreeType.cpp.orig	2019-07-19 11:08:34.770972665 +0000
++++ third_party/skia/src/ports/SkFontHost_FreeType.cpp	2019-07-19 11:08:44.274442065 +0000
+@@ -128,9 +128,9 @@ public:
+         : fGetVarDesignCoordinates(nullptr)
+         , fGetVarAxisFlags(nullptr)
+         , fLibrary(nullptr)
+-        , fIsLCDSupported(false)
++        , fIsLCDSupported(true)
+         , fLightHintingIsYOnly(false)
+-        , fLCDExtra(0)
++        , fLCDExtra(2)
+     {
+         if (FT_New_Library(&gFTMemory, &fLibrary)) {
+             return;

Copied: electron11/repos/community-staging-x86_64/d62de64e2fd20a4811593cb2248bb476aebfadf5.patch (from rev 1120870, electron11/trunk/d62de64e2fd20a4811593cb2248bb476aebfadf5.patch)
===================================================================
--- community-staging-x86_64/d62de64e2fd20a4811593cb2248bb476aebfadf5.patch	                        (rev 0)
+++ community-staging-x86_64/d62de64e2fd20a4811593cb2248bb476aebfadf5.patch	2022-01-30 20:26:45 UTC (rev 1120871)
@@ -0,0 +1,35 @@
+From d62de64e2fd20a4811593cb2248bb476aebfadf5 Mon Sep 17 00:00:00 2001
+From: Arthur Eubanks <aeubanks at google.com>
+Date: Sat, 2 Jan 2021 08:11:55 +0000
+Subject: [PATCH] Fix ill-formed C++ code
+
+See https://reviews.llvm.org/D92936.
+
+Bug: 1162717
+Change-Id: Ia44176774dbb4b1d90db08afbe95994c57f8387d
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2608756
+Reviewed-by: Kentaro Hara <haraken at chromium.org>
+Commit-Queue: Arthur Eubanks <aeubanks at google.com>
+Cr-Commit-Position: refs/heads/master@{#839931}
+---
+ third_party/blink/renderer/platform/disk_data_metadata.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/third_party/blink/renderer/platform/disk_data_metadata.h b/third_party/blink/renderer/platform/disk_data_metadata.h
+index 7c66cff4773c1..94d62b3f7a585 100644
+--- a/third_party/blink/renderer/platform/disk_data_metadata.h
++++ b/third_party/blink/renderer/platform/disk_data_metadata.h
+@@ -14,12 +14,12 @@ class DiskDataMetadata {
+  public:
+   int64_t start_offset() const { return start_offset_; }
+   size_t size() const { return size_; }
+-  DiskDataMetadata(DiskDataMetadata&& other) = delete;
+ 
+  private:
+   DiskDataMetadata(int64_t start_offset, size_t size)
+       : start_offset_(start_offset), size_(size) {}
+   DiskDataMetadata(const DiskDataMetadata& other) = default;
++  DiskDataMetadata(DiskDataMetadata&& other) = default;
+   DiskDataMetadata& operator=(const DiskDataMetadata& other) = default;
+ 
+   int64_t start_offset_;

Copied: electron11/repos/community-staging-x86_64/default_app-icon.patch (from rev 1120870, electron11/trunk/default_app-icon.patch)
===================================================================
--- community-staging-x86_64/default_app-icon.patch	                        (rev 0)
+++ community-staging-x86_64/default_app-icon.patch	2022-01-30 20:26:45 UTC (rev 1120871)
@@ -0,0 +1,21 @@
+--- a/electron/default_app/default_app.ts
++++ b/electron/default_app/default_app.ts
+@@ -60,7 +60,7 @@
+   };
+ 
+   if (process.platform === 'linux') {
+-    options.icon = path.join(__dirname, 'icon.png');
++    options.icon = '/usr/share/pixmaps/electron.png';
+   }
+ 
+   mainWindow = new BrowserWindow(options);
+--- a/electron/filenames.gni
++++ b/electron/filenames.gni
+@@ -6,7 +6,6 @@
+   ]
+ 
+   default_app_static_sources = [
+-    "default_app/icon.png",
+     "default_app/index.html",
+     "default_app/package.json",
+     "default_app/styles.css",

Copied: electron11/repos/community-staging-x86_64/electron11.desktop (from rev 1120870, electron11/trunk/electron11.desktop)
===================================================================
--- community-staging-x86_64/electron11.desktop	                        (rev 0)
+++ community-staging-x86_64/electron11.desktop	2022-01-30 20:26:45 UTC (rev 1120871)
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Type=Application
+Name=Electron 11
+Icon=electron11
+Exec=electron11 %u
+Categories=Development;GTK;
+StartupNotify=true

Copied: electron11/repos/community-staging-x86_64/enable-dse-memoryssa.patch (from rev 1120870, electron11/trunk/enable-dse-memoryssa.patch)
===================================================================
--- community-staging-x86_64/enable-dse-memoryssa.patch	                        (rev 0)
+++ community-staging-x86_64/enable-dse-memoryssa.patch	2022-01-30 20:26:45 UTC (rev 1120871)
@@ -0,0 +1,50 @@
+From 4f59b0a437416e001ba96be22dfcd39806af70e6 Mon Sep 17 00:00:00 2001
+From: Nico Weber <thakis at chromium.org>
+Date: Fri, 6 Nov 2020 18:50:33 +0000
+Subject: [PATCH] build: Enable MemorySSA DSE with pinned clang.
+
+The feature has been on on the tot bots for a while now and it's been
+on by default upstream for a while, and things seem to work.
+
+Since we just rolled in a clang with all the fixes, let's turn this on.
+
+Bug: 1127713
+Change-Id: I56805d576bea5936d58c653da994dc738c2a79a3
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2520013
+Commit-Queue: Nico Weber <thakis at chromium.org>
+Reviewed-by: Hans Wennborg <hans at chromium.org>
+Cr-Commit-Position: refs/heads/master@{#824947}
+---
+ build/config/compiler/BUILD.gn | 19 -------------------
+ 1 file changed, 19 deletions(-)
+
+diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
+index 6f8c779040251..52912b1cb546a 100644
+--- a/build/config/compiler/BUILD.gn
++++ b/build/config/compiler/BUILD.gn
+@@ -490,25 +490,6 @@ config("compiler") {
+       "-mllvm",
+       "-instcombine-lower-dbg-declare=0",
+     ]
+-
+-    # Pinned clang has enable-dse-memoryssa enabled by default but it's broken,
+-    # so we have to force it off.
+-    # Trunk clang has it disabled by default but it might work, so we force it
+-    # on so the ToT bots can check if it works now.
+-    if (!llvm_force_head_revision) {
+-      cflags += [
+-        # TODO(https://crbug.com/1127713): Investigate, remove.
+-        "-mllvm",
+-        "-enable-dse-memoryssa=false",
+-      ]
+-    }
+-    if (llvm_force_head_revision) {
+-      cflags += [
+-        # TODO(https://crbug.com/1127713): Investigate, remove.
+-        "-mllvm",
+-        "-enable-dse-memoryssa=true",
+-      ]
+-    }
+   }
+ 
+   # C11/C++11 compiler flags setup.

Copied: electron11/repos/community-staging-x86_64/ffmpeg5.patch (from rev 1120870, electron11/trunk/ffmpeg5.patch)
===================================================================
--- community-staging-x86_64/ffmpeg5.patch	                        (rev 0)
+++ community-staging-x86_64/ffmpeg5.patch	2022-01-30 20:26:45 UTC (rev 1120871)
@@ -0,0 +1,142 @@
+diff --git a/media/ffmpeg/ffmpeg_common.h b/chromium/media/ffmpeg/ffmpeg_common.h
+index 2734a485cbd..70b1877a43c 100644
+--- a/media/ffmpeg/ffmpeg_common.h
++++ b/media/ffmpeg/ffmpeg_common.h
+@@ -29,6 +29,7 @@ extern "C" {
+ #include <libavformat/avformat.h>
+ #include <libavformat/avio.h>
+ #include <libavutil/avutil.h>
++#include <libavutil/channel_layout.h>
+ #include <libavutil/imgutils.h>
+ #include <libavutil/log.h>
+ #include <libavutil/mastering_display_metadata.h>
+diff --git a/media/filters/audio_file_reader.cc b/chromium/media/filters/audio_file_reader.cc
+index cb81d920def..bd73908d0ca 100644
+--- a/media/filters/audio_file_reader.cc
++++ b/media/filters/audio_file_reader.cc
+@@ -85,7 +85,7 @@ bool AudioFileReader::OpenDemuxer() {
+ }
+ 
+ bool AudioFileReader::OpenDecoder() {
+-  AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
++  const AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
+   if (codec) {
+     // MP3 decodes to S16P which we don't support, tell it to use S16 instead.
+     if (codec_context_->sample_fmt == AV_SAMPLE_FMT_S16P)
+diff --git a/media/filters/ffmpeg_audio_decoder.cc b/chromium/media/filters/ffmpeg_audio_decoder.cc
+index 0d825ed791b..72fac6167ef 100644
+--- a/media/filters/ffmpeg_audio_decoder.cc
++++ b/media/filters/ffmpeg_audio_decoder.cc
+@@ -329,7 +329,7 @@ bool FFmpegAudioDecoder::ConfigureDecoder(const AudioDecoderConfig& config) {
+     }
+   }
+ 
+-  AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
++  const AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
+   if (!codec ||
+       avcodec_open2(codec_context_.get(), codec, &codec_options) < 0) {
+     DLOG(ERROR) << "Could not initialize audio decoder: "
+diff --git a/media/filters/ffmpeg_demuxer.cc b/chromium/media/filters/ffmpeg_demuxer.cc
+index d34db63f3ef..427565b00c1 100644
+--- a/media/filters/ffmpeg_demuxer.cc
++++ b/media/filters/ffmpeg_demuxer.cc
+@@ -98,12 +98,12 @@ static base::TimeDelta ExtractStartTime(AVStream* stream) {
+ 
+   // Next try to use the first DTS value, for codecs where we know PTS == DTS
+   // (excludes all H26x codecs). The start time must be returned in PTS.
+-  if (stream->first_dts != kNoFFmpegTimestamp &&
++  if (av_stream_get_first_dts(stream) != kNoFFmpegTimestamp &&
+       stream->codecpar->codec_id != AV_CODEC_ID_HEVC &&
+       stream->codecpar->codec_id != AV_CODEC_ID_H264 &&
+       stream->codecpar->codec_id != AV_CODEC_ID_MPEG4) {
+     const base::TimeDelta first_pts =
+-        ConvertFromTimeBase(stream->time_base, stream->first_dts);
++        ConvertFromTimeBase(stream->time_base, av_stream_get_first_dts(stream));
+     if (first_pts < start_time)
+       start_time = first_pts;
+   }
+@@ -408,11 +408,11 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
+   scoped_refptr<DecoderBuffer> buffer;
+ 
+   if (type() == DemuxerStream::TEXT) {
+-    int id_size = 0;
++    size_t id_size = 0;
+     uint8_t* id_data = av_packet_get_side_data(
+         packet.get(), AV_PKT_DATA_WEBVTT_IDENTIFIER, &id_size);
+ 
+-    int settings_size = 0;
++    size_t settings_size = 0;
+     uint8_t* settings_data = av_packet_get_side_data(
+         packet.get(), AV_PKT_DATA_WEBVTT_SETTINGS, &settings_size);
+ 
+@@ -424,7 +424,7 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
+     buffer = DecoderBuffer::CopyFrom(packet->data, packet->size,
+                                      side_data.data(), side_data.size());
+   } else {
+-    int side_data_size = 0;
++    size_t side_data_size = 0;
+     uint8_t* side_data = av_packet_get_side_data(
+         packet.get(), AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, &side_data_size);
+ 
+@@ -485,7 +485,7 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
+                                        packet->size - data_offset);
+     }
+ 
+-    int skip_samples_size = 0;
++    size_t skip_samples_size = 0;
+     const uint32_t* skip_samples_ptr =
+         reinterpret_cast<const uint32_t*>(av_packet_get_side_data(
+             packet.get(), AV_PKT_DATA_SKIP_SAMPLES, &skip_samples_size));
+diff --git a/media/filters/ffmpeg_glue.cc b/chromium/media/filters/ffmpeg_glue.cc
+index 0ef3521473d..8483ecc348f 100644
+--- a/media/filters/ffmpeg_glue.cc
++++ b/media/filters/ffmpeg_glue.cc
+@@ -95,9 +94,6 @@ FFmpegGlue::FFmpegGlue(FFmpegURLProtocol* protocol) {
+   // Enable fast, but inaccurate seeks for MP3.
+   format_context_->flags |= AVFMT_FLAG_FAST_SEEK;
+ 
+-  // Ensures we can read out various metadata bits like vp8 alpha.
+-  format_context_->flags |= AVFMT_FLAG_KEEP_SIDE_DATA;
+-
+   // Ensures format parsing errors will bail out. From an audit on 11/2017, all
+   // instances were real failures. Solves bugs like http://crbug.com/710791.
+   format_context_->error_recognition |= AV_EF_EXPLODE;
+diff --git a/media/filters/ffmpeg_video_decoder.cc b/chromium/media/filters/ffmpeg_video_decoder.cc
+index ef12477ee89..7996606f5f9 100644
+--- a/media/filters/ffmpeg_video_decoder.cc
++++ b/media/filters/ffmpeg_video_decoder.cc
+@@ -391,7 +391,7 @@ bool FFmpegVideoDecoder::ConfigureDecoder(const VideoDecoderConfig& config,
+   if (decode_nalus_)
+     codec_context_->flags2 |= AV_CODEC_FLAG2_CHUNKS;
+ 
+-  AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
++  const AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
+   if (!codec || avcodec_open2(codec_context_.get(), codec, NULL) < 0) {
+     ReleaseFFmpegResources();
+     return false;
+diff --git a/media/filters/media_file_checker.cc b/chromium/media/filters/media_file_checker.cc
+index 59c2a2fc618..1a9872c7acb 100644
+--- a/media/filters/media_file_checker.cc
++++ b/media/filters/media_file_checker.cc
+@@ -68,7 +68,7 @@ bool MediaFileChecker::Start(base::TimeDelta check_time) {
+       auto context = AVStreamToAVCodecContext(format_context->streams[i]);
+       if (!context)
+         continue;
+-      AVCodec* codec = avcodec_find_decoder(cp->codec_id);
++      const AVCodec* codec = avcodec_find_decoder(cp->codec_id);
+       if (codec && avcodec_open2(context.get(), codec, nullptr) >= 0) {
+         auto loop = std::make_unique<FFmpegDecodingLoop>(context.get());
+         stream_contexts[i] = {std::move(context), std::move(loop)};
+diff --git a/third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc b/chromium/third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc
+index 9002b874611..d12fade8b63 100644
+--- a/third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc
++++ b/third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc
+@@ -203,7 +203,7 @@ int32_t H264DecoderImpl::InitDecode(const VideoCodec* codec_settings,
+   // a pointer |this|.
+   av_context_->opaque = this;
+ 
+-  AVCodec* codec = avcodec_find_decoder(av_context_->codec_id);
++  const AVCodec* codec = avcodec_find_decoder(av_context_->codec_id);
+   if (!codec) {
+     // This is an indication that FFmpeg has not been initialized or it has not
+     // been compiled/initialized with the correct set of codecs.

Copied: electron11/repos/community-staging-x86_64/icu68.patch (from rev 1120870, electron11/trunk/icu68.patch)
===================================================================
--- community-staging-x86_64/icu68.patch	                        (rev 0)
+++ community-staging-x86_64/icu68.patch	2022-01-30 20:26:45 UTC (rev 1120871)
@@ -0,0 +1,421 @@
+From 4d16e52a5e6771c4aa5f892e14486bf0e87027d1 Mon Sep 17 00:00:00 2001
+From: Frank Tang <ftang at chromium.org>
+Date: Tue, 20 Oct 2020 00:11:50 +0000
+Subject: [PATCH] Prepare for landing ICU68
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+In the landing process of ICU68 we found these need to be changed
+since ICU68 no longer define TRUE and FALSE for UBool to
+avoid C++20 problem.
+
+Bug: 1138555
+Change-Id: I64fd98c99864aa86b07280537a780105cb0eabbe
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2473522
+Reviewed-by: Frank Tang <ftang at chromium.org>
+Reviewed-by: Colin Blundell <blundell at chromium.org>
+Reviewed-by: Dominic Battré <battre at chromium.org>
+Reviewed-by: Guillaume Jenkins <gujen at google.com>
+Reviewed-by: Jungshik Shin <jshin at chromium.org>
+Reviewed-by: Mihai Sardarescu <msarda at chromium.org>
+Reviewed-by: Dave Tapuska <dtapuska at chromium.org>
+Reviewed-by: Mustafa Emre Acer <meacer at chromium.org>
+Reviewed-by: Marian Fechete <marianfe at google.com>
+Reviewed-by: Matthew Denton <mpdenton at chromium.org>
+Commit-Queue: Frank Tang <ftang at chromium.org>
+Cr-Commit-Position: refs/heads/master@{#818713}
+---
+ base/i18n/icu_util.cc                            |  2 +-
+ base/i18n/string_compare.cc                      |  4 ++--
+ base/i18n/time_formatting.cc                     |  2 +-
+ .../autofill/core/common/autofill_regexes.cc     |  8 ++++----
+ .../browser/string_conversions_util.cc           |  6 +++---
+ .../public/identity_manager/identity_utils.cc    |  2 +-
+ .../renderer/spellcheck_worditerator.cc          |  2 +-
+ .../spoof_checks/idn_spoof_checker.cc            |  4 ++--
+ .../spoof_checks/skeleton_generator.cc           |  2 +-
+ content/zygote/zygote_linux.cc                   |  2 +-
+ .../time_zone_monitor_android.cc                 |  2 +-
+ .../renderer/core/exported/web_view_test.cc      | 12 ++++++------
+ .../blink/renderer/platform/text/locale_icu.cc   |  4 ++--
+ .../platform/text/text_break_iterator_icu.cc     | 16 ++++++++--------
+ .../renderer/platform/text/unicode_utilities.cc  |  2 +-
+ .../renderer/platform/wtf/text/text_codec_icu.cc |  2 +-
+ ui/base/l10n/formatter.cc                        |  6 +++---
+ 17 files changed, 39 insertions(+), 39 deletions(-)
+
+diff --git a/base/i18n/icu_util.cc b/base/i18n/icu_util.cc
+index b225f1d46c0b7..20debbe655c46 100644
+--- a/base/i18n/icu_util.cc
++++ b/base/i18n/icu_util.cc
+@@ -327,7 +327,7 @@ void InitializeIcuTimeZone() {
+   // https://ssl.icu-project.org/trac/ticket/13208 .
+   string16 zone_id = android::GetDefaultTimeZoneId();
+   icu::TimeZone::adoptDefault(icu::TimeZone::createTimeZone(
+-      icu::UnicodeString(FALSE, zone_id.data(), zone_id.length())));
++      icu::UnicodeString(false, zone_id.data(), zone_id.length())));
+ #elif defined(OS_FUCHSIA)
+   // The platform-specific mechanisms used by ICU's detectHostTimeZone() to
+   // determine the default time zone will not work on Fuchsia. Therefore,
+diff --git a/base/i18n/string_compare.cc b/base/i18n/string_compare.cc
+index c0e83c6f7306f..e4fb687c14884 100644
+--- a/base/i18n/string_compare.cc
++++ b/base/i18n/string_compare.cc
+@@ -18,8 +18,8 @@ UCollationResult CompareString16WithCollator(const icu::Collator& collator,
+                                              StringPiece16 rhs) {
+   UErrorCode error = U_ZERO_ERROR;
+   UCollationResult result = collator.compare(
+-      icu::UnicodeString(FALSE, lhs.data(), static_cast<int>(lhs.length())),
+-      icu::UnicodeString(FALSE, rhs.data(), static_cast<int>(rhs.length())),
++      icu::UnicodeString(false, lhs.data(), static_cast<int>(lhs.length())),
++      icu::UnicodeString(false, rhs.data(), static_cast<int>(rhs.length())),
+       error);
+   DCHECK(U_SUCCESS(error));
+   return result;
+diff --git a/base/i18n/time_formatting.cc b/base/i18n/time_formatting.cc
+index c769b57d7162a..c085f5ef2448a 100644
+--- a/base/i18n/time_formatting.cc
++++ b/base/i18n/time_formatting.cc
+@@ -240,7 +240,7 @@ bool TimeDurationFormatWithSeconds(const TimeDelta time,
+   icu::FieldPosition ignore(icu::FieldPosition::DONT_CARE);
+   measure_format.formatMeasures(measures, 3, formatted, ignore, status);
+   *out = i18n::UnicodeStringToString16(formatted);
+-  return U_SUCCESS(status) == TRUE;
++  return U_SUCCESS(status);
+ }
+ 
+ string16 DateIntervalFormat(const Time& begin_time,
+diff --git a/components/autofill/core/common/autofill_regexes.cc b/components/autofill/core/common/autofill_regexes.cc
+index 02254fa266ac5..1cf12f310d077 100644
+--- a/components/autofill/core/common/autofill_regexes.cc
++++ b/components/autofill/core/common/autofill_regexes.cc
+@@ -43,7 +43,7 @@ class AutofillRegexes {
+ icu::RegexMatcher* AutofillRegexes::GetMatcher(const base::string16& pattern) {
+   auto it = matchers_.find(pattern);
+   if (it == matchers_.end()) {
+-    const icu::UnicodeString icu_pattern(FALSE, pattern.data(),
++    const icu::UnicodeString icu_pattern(false, pattern.data(),
+                                          pattern.length());
+ 
+     UErrorCode status = U_ZERO_ERROR;
+@@ -71,21 +71,21 @@ bool MatchesPattern(const base::string16& input,
+   base::AutoLock lock(*g_lock);
+ 
+   icu::RegexMatcher* matcher = g_autofill_regexes->GetMatcher(pattern);
+-  icu::UnicodeString icu_input(FALSE, input.data(), input.length());
++  icu::UnicodeString icu_input(false, input.data(), input.length());
+   matcher->reset(icu_input);
+ 
+   UErrorCode status = U_ZERO_ERROR;
+   UBool matched = matcher->find(0, status);
+   DCHECK(U_SUCCESS(status));
+ 
+-  if (matched == TRUE && match) {
++  if (matched && match) {
+     icu::UnicodeString match_unicode =
+         matcher->group(group_to_be_captured, status);
+     DCHECK(U_SUCCESS(status));
+     *match = base::i18n::UnicodeStringToString16(match_unicode);
+   }
+ 
+-  return matched == TRUE;
++  return matched;
+ }
+ 
+ }  // namespace autofill
+diff --git a/components/autofill_assistant/browser/string_conversions_util.cc b/components/autofill_assistant/browser/string_conversions_util.cc
+index 212bafa637288..1d00d68019fa3 100644
+--- a/components/autofill_assistant/browser/string_conversions_util.cc
++++ b/components/autofill_assistant/browser/string_conversions_util.cc
+@@ -39,13 +39,13 @@ bool UnicodeToUTF8(const std::vector<UChar32>& source, std::string* target) {
+ // |target|.
+ bool AppendUnicodeToUTF8(const UChar32 source, std::string* target) {
+   char bytes[4];
+-  UBool error = FALSE;
++  UBool error = false;
+   size_t offset = 0;
+   U8_APPEND(bytes, offset, base::size(bytes), source, error);
+-  if (error == FALSE) {
++  if (error == false) {
+     target->append(bytes, offset);
+   }
+-  return error == FALSE;
++  return !error;
+ }
+ 
+ }  // namespace autofill_assistant
+diff --git a/components/signin/public/identity_manager/identity_utils.cc b/components/signin/public/identity_manager/identity_utils.cc
+index 1c414e20e5de4..014d6746d95f2 100644
+--- a/components/signin/public/identity_manager/identity_utils.cc
++++ b/components/signin/public/identity_manager/identity_utils.cc
+@@ -33,7 +33,7 @@ bool IsUsernameAllowedByPattern(base::StringPiece username,
+ 
+   // See if the username matches the policy-provided pattern.
+   UErrorCode status = U_ZERO_ERROR;
+-  const icu::UnicodeString icu_pattern(FALSE, utf16_pattern.data(),
++  const icu::UnicodeString icu_pattern(false, utf16_pattern.data(),
+                                        utf16_pattern.length());
+   icu::RegexMatcher matcher(icu_pattern, UREGEX_CASE_INSENSITIVE, status);
+   if (!U_SUCCESS(status)) {
+diff --git a/components/spellcheck/renderer/spellcheck_worditerator.cc b/components/spellcheck/renderer/spellcheck_worditerator.cc
+index ec16fefbebc91..3b1f060866021 100644
+--- a/components/spellcheck/renderer/spellcheck_worditerator.cc
++++ b/components/spellcheck/renderer/spellcheck_worditerator.cc
+@@ -442,7 +442,7 @@ bool SpellcheckWordIterator::Normalize(size_t input_start,
+   // spellchecker and we need manual normalization as well. The normalized
+   // text does not have to be NUL-terminated since its characters are copied to
+   // string16, which adds a NUL character when we need.
+-  icu::UnicodeString input(FALSE, &text_[input_start],
++  icu::UnicodeString input(false, &text_[input_start],
+                            base::checked_cast<int32_t>(input_length));
+   UErrorCode status = U_ZERO_ERROR;
+   icu::UnicodeString output;
+diff --git a/components/url_formatter/spoof_checks/idn_spoof_checker.cc b/components/url_formatter/spoof_checks/idn_spoof_checker.cc
+index 6d66a7c4db885..d73192b1426a4 100644
+--- a/components/url_formatter/spoof_checks/idn_spoof_checker.cc
++++ b/components/url_formatter/spoof_checks/idn_spoof_checker.cc
+@@ -368,7 +368,7 @@ IDNSpoofChecker::Result IDNSpoofChecker::SafeToDisplayAsUnicode(
+     return Result::kICUSpoofChecks;
+   }
+ 
+-  icu::UnicodeString label_string(FALSE /* isTerminated */, label.data(),
++  icu::UnicodeString label_string(false /* isTerminated */, label.data(),
+                                   base::checked_cast<int32_t>(label.size()));
+ 
+   // A punycode label with 'xn--' prefix is not subject to the URL
+@@ -711,7 +711,7 @@ bool IDNSpoofChecker::IsWholeScriptConfusableAllowedForTLD(
+     base::StringPiece tld,
+     base::StringPiece16 tld_unicode) {
+   icu::UnicodeString tld_string(
+-      FALSE /* isTerminated */, tld_unicode.data(),
++      false /* isTerminated */, tld_unicode.data(),
+       base::checked_cast<int32_t>(tld_unicode.size()));
+   // Allow if the TLD contains any letter from the script, in which case it's
+   // likely to be a TLD in that script.
+diff --git a/components/url_formatter/spoof_checks/skeleton_generator.cc b/components/url_formatter/spoof_checks/skeleton_generator.cc
+index 9628626600df5..9a779018ebfae 100644
+--- a/components/url_formatter/spoof_checks/skeleton_generator.cc
++++ b/components/url_formatter/spoof_checks/skeleton_generator.cc
+@@ -116,7 +116,7 @@ SkeletonGenerator::~SkeletonGenerator() = default;
+ Skeletons SkeletonGenerator::GetSkeletons(base::StringPiece16 hostname) {
+   Skeletons skeletons;
+   size_t hostname_length = hostname.length() - (hostname.back() == '.' ? 1 : 0);
+-  icu::UnicodeString host(FALSE, hostname.data(), hostname_length);
++  icu::UnicodeString host(false, hostname.data(), hostname_length);
+   // If input has any characters outside Latin-Greek-Cyrillic and [0-9._-],
+   // there is no point in getting rid of diacritics because combining marks
+   // attached to non-LGC characters are already blocked.
+diff --git a/content/zygote/zygote_linux.cc b/content/zygote/zygote_linux.cc
+index 95d5a82c25082..b6d8e5a29c55e 100644
+--- a/content/zygote/zygote_linux.cc
++++ b/content/zygote/zygote_linux.cc
+@@ -557,7 +557,7 @@ base::ProcessId Zygote::ReadArgsAndFork(base::PickleIterator iter,
+   if (!iter.ReadString16(&timezone_id))
+     return -1;
+   icu::TimeZone::adoptDefault(icu::TimeZone::createTimeZone(
+-      icu::UnicodeString(FALSE, timezone_id.data(), timezone_id.length())));
++      icu::UnicodeString(false, timezone_id.data(), timezone_id.length())));
+ 
+   if (!iter.ReadInt(&numfds))
+     return -1;
+diff --git a/services/device/time_zone_monitor/time_zone_monitor_android.cc b/services/device/time_zone_monitor/time_zone_monitor_android.cc
+index 818670a821e41..f57f9724e5d48 100644
+--- a/services/device/time_zone_monitor/time_zone_monitor_android.cc
++++ b/services/device/time_zone_monitor/time_zone_monitor_android.cc
+@@ -34,7 +34,7 @@ void TimeZoneMonitorAndroid::TimeZoneChangedFromJava(
+   // See base/i18n/icu_util.cc:InitializeIcuTimeZone() for more information.
+   base::string16 zone_id = base::android::GetDefaultTimeZoneId();
+   std::unique_ptr<icu::TimeZone> new_zone(icu::TimeZone::createTimeZone(
+-      icu::UnicodeString(FALSE, zone_id.data(), zone_id.length())));
++      icu::UnicodeString(false, zone_id.data(), zone_id.length())));
+   UpdateIcuAndNotifyClients(std::move(new_zone));
+ }
+ 
+diff --git a/third_party/blink/renderer/core/exported/web_view_test.cc b/third_party/blink/renderer/core/exported/web_view_test.cc
+index a6b9552bb18d9..36809d914d1af 100644
+--- a/third_party/blink/renderer/core/exported/web_view_test.cc
++++ b/third_party/blink/renderer/core/exported/web_view_test.cc
+@@ -4868,18 +4868,18 @@ TEST_F(ShowUnhandledTapTest, ShowUnhandledTapUIIfNeeded) {
+ 
+ TEST_F(ShowUnhandledTapTest, ShowUnhandledTapUIIfNeededWithMutateDom) {
+   // Test dom mutation.
+-  TestEachMouseEvent("mutateDom", FALSE);
++  TestEachMouseEvent("mutateDom", false);
+ 
+   // Test without any DOM mutation.
+-  TestEachMouseEvent("none", TRUE);
++  TestEachMouseEvent("none", true);
+ }
+ 
+ TEST_F(ShowUnhandledTapTest, ShowUnhandledTapUIIfNeededWithMutateStyle) {
+   // Test style mutation.
+-  TestEachMouseEvent("mutateStyle", FALSE);
++  TestEachMouseEvent("mutateStyle", false);
+ 
+   // Test checkbox:indeterminate style mutation.
+-  TestEachMouseEvent("mutateIndeterminate", FALSE);
++  TestEachMouseEvent("mutateIndeterminate", false);
+ 
+   // Test click div with :active style.
+   Tap("style_active");
+@@ -4888,10 +4888,10 @@ TEST_F(ShowUnhandledTapTest, ShowUnhandledTapUIIfNeededWithMutateStyle) {
+ 
+ TEST_F(ShowUnhandledTapTest, ShowUnhandledTapUIIfNeededWithPreventDefault) {
+   // Test swallowing.
+-  TestEachMouseEvent("preventDefault", FALSE);
++  TestEachMouseEvent("preventDefault", false);
+ 
+   // Test without any preventDefault.
+-  TestEachMouseEvent("none", TRUE);
++  TestEachMouseEvent("none", true);
+ }
+ 
+ TEST_F(ShowUnhandledTapTest, ShowUnhandledTapUIIfNeededWithNonTriggeringNodes) {
+diff --git a/third_party/blink/renderer/platform/text/locale_icu.cc b/third_party/blink/renderer/platform/text/locale_icu.cc
+index 92fb99e0cc027..f991b5137728c 100644
+--- a/third_party/blink/renderer/platform/text/locale_icu.cc
++++ b/third_party/blink/renderer/platform/text/locale_icu.cc
+@@ -169,12 +169,12 @@ static String GetDateFormatPattern(const UDateFormat* date_format) {
+     return g_empty_string;
+ 
+   UErrorCode status = U_ZERO_ERROR;
+-  int32_t length = udat_toPattern(date_format, TRUE, nullptr, 0, &status);
++  int32_t length = udat_toPattern(date_format, true, nullptr, 0, &status);
+   if (status != U_BUFFER_OVERFLOW_ERROR || !length)
+     return g_empty_string;
+   StringBuffer<UChar> buffer(length);
+   status = U_ZERO_ERROR;
+-  udat_toPattern(date_format, TRUE, buffer.Characters(), length, &status);
++  udat_toPattern(date_format, true, buffer.Characters(), length, &status);
+   if (U_FAILURE(status))
+     return g_empty_string;
+   return String::Adopt(buffer);
+diff --git a/third_party/blink/renderer/platform/text/text_break_iterator_icu.cc b/third_party/blink/renderer/platform/text/text_break_iterator_icu.cc
+index 5bea0079dd343..0e8c60a31599e 100644
+--- a/third_party/blink/renderer/platform/text/text_break_iterator_icu.cc
++++ b/third_party/blink/renderer/platform/text/text_break_iterator_icu.cc
+@@ -312,13 +312,13 @@ static inline bool TextInChunkOrOutOfRange(UText* text,
+       text->chunkOffset = offset <= std::numeric_limits<int32_t>::max()
+                               ? static_cast<int32_t>(offset)
+                               : 0;
+-      is_accessible = TRUE;
++      is_accessible = true;
+       return true;
+     }
+     if (native_index >= native_length &&
+         text->chunkNativeLimit == native_length) {
+       text->chunkOffset = text->chunkLength;
+-      is_accessible = FALSE;
++      is_accessible = false;
+       return true;
+     }
+   } else {
+@@ -331,12 +331,12 @@ static inline bool TextInChunkOrOutOfRange(UText* text,
+       text->chunkOffset = offset <= std::numeric_limits<int32_t>::max()
+                               ? static_cast<int32_t>(offset)
+                               : 0;
+-      is_accessible = TRUE;
++      is_accessible = true;
+       return true;
+     }
+     if (native_index <= 0 && !text->chunkNativeStart) {
+       text->chunkOffset = 0;
+-      is_accessible = FALSE;
++      is_accessible = false;
+       return true;
+     }
+   }
+@@ -347,7 +347,7 @@ static UBool TextLatin1Access(UText* text,
+                               int64_t native_index,
+                               UBool forward) {
+   if (!text->context)
+-    return FALSE;
++    return false;
+   int64_t native_length = TextNativeLength(text);
+   UBool is_accessible;
+   if (TextInChunkOrOutOfRange(text, native_index, native_length, forward,
+@@ -371,7 +371,7 @@ static UBool TextLatin1Access(UText* text,
+     DCHECK_EQ(new_context, kPriorContext);
+     TextLatin1SwitchToPriorContext(text, native_index, native_length, forward);
+   }
+-  return TRUE;
++  return true;
+ }
+ 
+ static const struct UTextFuncs kTextLatin1Funcs = {
+@@ -511,7 +511,7 @@ static void TextUTF16SwitchToPriorContext(UText* text,
+ 
+ static UBool TextUTF16Access(UText* text, int64_t native_index, UBool forward) {
+   if (!text->context)
+-    return FALSE;
++    return false;
+   int64_t native_length = TextNativeLength(text);
+   UBool is_accessible;
+   if (TextInChunkOrOutOfRange(text, native_index, native_length, forward,
+@@ -533,7 +533,7 @@ static UBool TextUTF16Access(UText* text, int64_t native_index, UBool forward) {
+     DCHECK_EQ(new_context, kPriorContext);
+     TextUTF16SwitchToPriorContext(text, native_index, native_length, forward);
+   }
+-  return TRUE;
++  return true;
+ }
+ 
+ static const struct UTextFuncs kTextUTF16Funcs = {
+diff --git a/third_party/blink/renderer/platform/text/unicode_utilities.cc b/third_party/blink/renderer/platform/text/unicode_utilities.cc
+index 2cefd5390b6b0..b8c4515dc13ca 100644
+--- a/third_party/blink/renderer/platform/text/unicode_utilities.cc
++++ b/third_party/blink/renderer/platform/text/unicode_utilities.cc
+@@ -300,7 +300,7 @@ void NormalizeCharactersIntoNFCForm(const UChar* characters,
+   DCHECK(U_SUCCESS(status));
+   int32_t input_length = static_cast<int32_t>(length);
+   // copy-on-write.
+-  icu::UnicodeString normalized(FALSE, characters, input_length);
++  icu::UnicodeString normalized(false, characters, input_length);
+   // In the vast majority of cases, input is already NFC. Run a quick check
+   // to avoid normalizing the entire input unnecessarily.
+   int32_t normalized_prefix_length =
+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 b62573550a1cb..fb8ab0530c51e 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
+@@ -327,7 +327,7 @@ void TextCodecICU::CreateICUConverter() const {
+   DLOG_IF(ERROR, err == U_AMBIGUOUS_ALIAS_WARNING)
+       << "ICU ambiguous alias warning for encoding: " << encoding_.GetName();
+   if (converter_icu_)
+-    ucnv_setFallback(converter_icu_, TRUE);
++    ucnv_setFallback(converter_icu_, true);
+ }
+ 
+ int TextCodecICU::DecodeToBuffer(UChar* target,
+diff --git a/ui/base/l10n/formatter.cc b/ui/base/l10n/formatter.cc
+index e4446d4786f49..684ead8c0a0df 100644
+--- a/ui/base/l10n/formatter.cc
++++ b/ui/base/l10n/formatter.cc
+@@ -234,7 +234,7 @@ void Formatter::Format(Unit unit,
+                        int value,
+                        icu::UnicodeString* formatted_string) const {
+   DCHECK(simple_format_[unit]);
+-  DCHECK(formatted_string->isEmpty() == TRUE);
++  DCHECK(formatted_string->isEmpty());
+   UErrorCode error = U_ZERO_ERROR;
+   FormatNumberInPlural(*simple_format_[unit],
+                         value, formatted_string, &error);
+@@ -250,7 +250,7 @@ void Formatter::Format(TwoUnits units,
+       << "Detailed() not implemented for your (format, length) combination!";
+   DCHECK(detailed_format_[units][1])
+       << "Detailed() not implemented for your (format, length) combination!";
+-  DCHECK(formatted_string->isEmpty() == TRUE);
++  DCHECK(formatted_string->isEmpty());
+   UErrorCode error = U_ZERO_ERROR;
+   FormatNumberInPlural(*detailed_format_[units][0], value_1,
+                        formatted_string, &error);
+@@ -283,7 +283,7 @@ std::unique_ptr<icu::MessageFormat> Formatter::InitFormat(
+     base::string16 pattern = l10n_util::GetStringUTF16(pluralities.id);
+     UErrorCode error = U_ZERO_ERROR;
+     std::unique_ptr<icu::MessageFormat> format(new icu::MessageFormat(
+-        icu::UnicodeString(FALSE, pattern.data(), pattern.length()), error));
++        icu::UnicodeString(false, pattern.data(), pattern.length()), error));
+     DCHECK(U_SUCCESS(error));
+     if (format.get())
+       return format;

Copied: electron11/repos/community-staging-x86_64/skia-harfbuzz-3.0.0.patch (from rev 1120870, electron11/trunk/skia-harfbuzz-3.0.0.patch)
===================================================================
--- community-staging-x86_64/skia-harfbuzz-3.0.0.patch	                        (rev 0)
+++ community-staging-x86_64/skia-harfbuzz-3.0.0.patch	2022-01-30 20:26:45 UTC (rev 1120871)
@@ -0,0 +1,100 @@
+# Minimal diff for harfbuzz 3.0.0 support; based on:
+# https://github.com/google/skia/commit/66684b17b382
+# https://github.com/google/skia/commit/51d83abcd24a
+
+diff --git a/gn/skia.gni b/gn/skia.gni
+index d98fdc19ee..199335d5c4 100644
+--- a/gn/skia.gni
++++ b/gn/skia.gni
+@@ -34,8 +34,6 @@ declare_args() {
+   skia_include_multiframe_procs = false
+   skia_lex = false
+   skia_libgifcodec_path = "third_party/externals/libgifcodec"
+-  skia_pdf_subset_harfbuzz =
+-      false  # TODO: set skia_pdf_subset_harfbuzz to skia_use_harfbuzz.
+   skia_qt_path = getenv("QT_PATH")
+   skia_skqp_global_error_tolerance = 0
+   skia_tools_require_resources = false
+@@ -99,6 +97,10 @@ declare_args() {
+   skia_use_libfuzzer_defaults = true
+ }
+ 
++declare_args() {
++  skia_pdf_subset_harfbuzz = skia_use_harfbuzz
++}
++
+ declare_args() {
+   skia_compile_sksl_tests = skia_compile_processors
+   skia_enable_fontmgr_android = skia_use_expat && skia_use_freetype
+diff --git a/src/pdf/SkPDFSubsetFont.cpp b/src/pdf/SkPDFSubsetFont.cpp
+index 81c37eef3a..2340a7937b 100644
+--- a/src/pdf/SkPDFSubsetFont.cpp
++++ b/src/pdf/SkPDFSubsetFont.cpp
+@@ -49,6 +49,37 @@ static sk_sp<SkData> to_data(HBBlob blob) {
+                                 blob.release());
+ }
+ 
++template<typename...> using void_t = void;
++template<typename T, typename = void>
++struct SkPDFHarfBuzzSubset {
++    // This is the HarfBuzz 3.0 interface.
++    // hb_subset_flags_t does not exist in 2.0. It isn't dependent on T, so inline the value of
++    // HB_SUBSET_FLAGS_RETAIN_GIDS until 2.0 is no longer supported.
++    static HBFace Make(T input, hb_face_t* face) {
++        // TODO: When possible, check if a font is 'tricky' with FT_IS_TRICKY.
++        // If it isn't known if a font is 'tricky', retain the hints.
++        hb_subset_input_set_flags(input, 2/*HB_SUBSET_FLAGS_RETAIN_GIDS*/);
++        return HBFace(hb_subset_or_fail(face, input));
++    }
++};
++template<typename T>
++struct SkPDFHarfBuzzSubset<T, void_t<
++    decltype(hb_subset_input_set_retain_gids(std::declval<T>(), std::declval<bool>())),
++    decltype(hb_subset_input_set_drop_hints(std::declval<T>(), std::declval<bool>())),
++    decltype(hb_subset(std::declval<hb_face_t*>(), std::declval<T>()))
++    >>
++{
++    // This is the HarfBuzz 2.0 (non-public) interface, used if it exists.
++    // This code should be removed as soon as all users are migrated to the newer API.
++    static HBFace Make(T input, hb_face_t* face) {
++        hb_subset_input_set_retain_gids(input, true);
++        // TODO: When possible, check if a font is 'tricky' with FT_IS_TRICKY.
++        // If it isn't known if a font is 'tricky', retain the hints.
++        hb_subset_input_set_drop_hints(input, false);
++        return HBFace(hb_subset(face, input));
++    }
++};
++
+ static sk_sp<SkData> subset_harfbuzz(sk_sp<SkData> fontData,
+                                      const SkPDFGlyphUse& glyphUsage,
+                                      int ttcIndex) {
+@@ -71,11 +102,10 @@ static sk_sp<SkData> subset_harfbuzz(sk_sp<SkData> fontData,
+     hb_set_t* glyphs = hb_subset_input_glyph_set(input.get());
+     glyphUsage.getSetValues([&glyphs](unsigned gid) { hb_set_add(glyphs, gid);});
+ 
+-    hb_subset_input_set_retain_gids(input.get(), true);
+-    // TODO: When possible, check if a font is 'tricky' with FT_IS_TRICKY.
+-    // If it isn't known if a font is 'tricky', retain the hints.
+-    hb_subset_input_set_drop_hints(input.get(), false);
+-    HBFace subset(hb_subset(face.get(), input.get()));
++    HBFace subset = SkPDFHarfBuzzSubset<hb_subset_input_t*>::Make(input.get(), face.get());
++    if (!subset) {
++        return nullptr;
++    }
+     HBBlob result(hb_face_reference_blob(subset.get()));
+     return to_data(std::move(result));
+ }
+diff --git a/third_party/harfbuzz/BUILD.gn b/third_party/harfbuzz/BUILD.gn
+index 173830de62..4156607ef9 100644
+--- a/third_party/harfbuzz/BUILD.gn
++++ b/third_party/harfbuzz/BUILD.gn
+@@ -14,6 +14,9 @@ if (skia_use_system_harfbuzz) {
+       "harfbuzz",
+       "harfbuzz-icu",
+     ]
++    if (skia_pdf_subset_harfbuzz) {
++      libs += [ "harfbuzz-subset" ]
++    }
+   }
+ } else {
+   third_party("harfbuzz") {

Copied: electron11/repos/community-staging-x86_64/sql-make-VirtualCursor-standard-layout-type.patch (from rev 1120870, electron11/trunk/sql-make-VirtualCursor-standard-layout-type.patch)
===================================================================
--- community-staging-x86_64/sql-make-VirtualCursor-standard-layout-type.patch	                        (rev 0)
+++ community-staging-x86_64/sql-make-VirtualCursor-standard-layout-type.patch	2022-01-30 20:26:45 UTC (rev 1120871)
@@ -0,0 +1,238 @@
+From 80368f8ba7a8bab13440463a254888311efe3986 Mon Sep 17 00:00:00 2001
+From: Stephan Hartmann <stha09 at googlemail.com>
+Date: Tue, 4 May 2021 15:00:19 +0000
+Subject: [PATCH] sql: make VirtualCursor standard layout type
+
+sql::recover::VirtualCursor needs to be a standard layout type, but
+has members of type std::unique_ptr. However, std::unique_ptr is not
+guaranteed to be standard layout. Compiling with clang combined with
+gcc-11 libstdc++ fails because of this. Replace std::unique_ptr with
+raw pointers.
+
+Bug: 1189788
+Change-Id: Ia6dc388cc5ef1c0f2afc75f8ca45b9f12687ca9c
+---
+ sql/recover_module/btree.cc  | 21 +++++++++++++++------
+ sql/recover_module/btree.h   | 17 +++++++++++++----
+ sql/recover_module/cursor.cc | 24 ++++++++++++------------
+ sql/recover_module/cursor.h  |  2 +-
+ sql/recover_module/pager.cc  |  7 +++----
+ sql/recover_module/pager.h   |  5 +++--
+ 6 files changed, 47 insertions(+), 29 deletions(-)
+
+diff --git a/sql/recover_module/btree.cc b/sql/recover_module/btree.cc
+index 9ecaafe8a3..839318abf9 100644
+--- a/sql/recover_module/btree.cc
++++ b/sql/recover_module/btree.cc
+@@ -135,16 +135,25 @@ static_assert(std::is_trivially_destructible<LeafPageDecoder>::value,
+               "Move the destructor to the .cc file if it's non-trival");
+ #endif  // !DCHECK_IS_ON()
+ 
+-LeafPageDecoder::LeafPageDecoder(DatabasePageReader* db_reader) noexcept
+-    : page_id_(db_reader->page_id()),
+-      db_reader_(db_reader),
+-      cell_count_(ComputeCellCount(db_reader)),
+-      next_read_index_(0),
+-      last_record_size_(0) {
++void LeafPageDecoder::Initialize(DatabasePageReader* db_reader) {
++  DCHECK(db_reader);
+   DCHECK(IsOnValidPage(db_reader));
++  page_id_ = db_reader->page_id();
++  db_reader_ = db_reader;
++  cell_count_ = ComputeCellCount(db_reader);
++  next_read_index_ = 0;
++  last_record_size_ = 0;
+   DCHECK(DatabasePageReader::IsValidPageId(page_id_));
+ }
+ 
++void LeafPageDecoder::Reset() {
++  db_reader_ = nullptr;
++  page_id_ = 0;
++  cell_count_ = 0;
++  next_read_index_ = 0;
++  last_record_size_ = 0;
++}
++
+ bool LeafPageDecoder::TryAdvance() {
+   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+   DCHECK(CanAdvance());
+diff --git a/sql/recover_module/btree.h b/sql/recover_module/btree.h
+index d76d076bf6..33114b01fa 100644
+--- a/sql/recover_module/btree.h
++++ b/sql/recover_module/btree.h
+@@ -102,7 +102,7 @@ class LeafPageDecoder {
+   //
+   // |db_reader| must have been used to read an inner page of a table B-tree.
+   // |db_reader| must outlive this instance.
+-  explicit LeafPageDecoder(DatabasePageReader* db_reader) noexcept;
++  explicit LeafPageDecoder() noexcept = default;
+   ~LeafPageDecoder() noexcept = default;
+ 
+   LeafPageDecoder(const LeafPageDecoder&) = delete;
+@@ -150,6 +150,15 @@ class LeafPageDecoder {
+   // read as long as CanAdvance() returns true.
+   bool TryAdvance();
+ 
++  // Initialize with DatabasePageReader
++  void Initialize(DatabasePageReader* db_reader);
++
++  // Reset internal DatabasePageReader
++  void Reset();
++
++  // True if DatabasePageReader is valid
++  bool IsValid() { return (db_reader_ != nullptr); }
++
+   // True if the given reader may point to an inner page in a table B-tree.
+   //
+   // The last ReadPage() call on |db_reader| must have succeeded.
+@@ -163,14 +172,14 @@ class LeafPageDecoder {
+   static int ComputeCellCount(DatabasePageReader* db_reader);
+ 
+   // The number of the B-tree page this reader is reading.
+-  const int64_t page_id_;
++  int64_t page_id_;
+   // Used to read the tree page.
+   //
+   // Raw pointer usage is acceptable because this instance's owner is expected
+   // to ensure that the DatabasePageReader outlives this.
+-  DatabasePageReader* const db_reader_;
++  DatabasePageReader* db_reader_;
+   // Caches the ComputeCellCount() value for this reader's page.
+-  const int cell_count_ = ComputeCellCount(db_reader_);
++  int cell_count_;
+ 
+   // The reader's cursor state.
+   //
+diff --git a/sql/recover_module/cursor.cc b/sql/recover_module/cursor.cc
+index 0029ff9295..42548bc4b5 100644
+--- a/sql/recover_module/cursor.cc
++++ b/sql/recover_module/cursor.cc
+@@ -26,7 +26,7 @@ VirtualCursor::~VirtualCursor() {
+ int VirtualCursor::First() {
+   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+   inner_decoders_.clear();
+-  leaf_decoder_ = nullptr;
++  leaf_decoder_.Reset();
+ 
+   AppendPageDecoder(table_->root_page_id());
+   return Next();
+@@ -36,18 +36,18 @@ int VirtualCursor::Next() {
+   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+   record_reader_.Reset();
+ 
+-  while (!inner_decoders_.empty() || leaf_decoder_.get()) {
+-    if (leaf_decoder_.get()) {
+-      if (!leaf_decoder_->CanAdvance()) {
++  while (!inner_decoders_.empty() || leaf_decoder_.IsValid()) {
++    if (leaf_decoder_.IsValid()) {
++      if (!leaf_decoder_.CanAdvance()) {
+         // The leaf has been exhausted. Remove it from the DFS stack.
+-        leaf_decoder_ = nullptr;
++        leaf_decoder_.Reset();
+         continue;
+       }
+-      if (!leaf_decoder_->TryAdvance())
++      if (!leaf_decoder_.TryAdvance())
+         continue;
+ 
+-      if (!payload_reader_.Initialize(leaf_decoder_->last_record_size(),
+-                                      leaf_decoder_->last_record_offset())) {
++      if (!payload_reader_.Initialize(leaf_decoder_.last_record_size(),
++                                      leaf_decoder_.last_record_offset())) {
+         continue;
+       }
+       if (!record_reader_.Initialize())
+@@ -99,13 +99,13 @@ int VirtualCursor::ReadColumn(int column_index,
+ int64_t VirtualCursor::RowId() {
+   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+   DCHECK(record_reader_.IsInitialized());
+-  DCHECK(leaf_decoder_.get());
+-  return leaf_decoder_->last_record_rowid();
++  DCHECK(leaf_decoder_.IsValid());
++  return leaf_decoder_.last_record_rowid();
+ }
+ 
+ void VirtualCursor::AppendPageDecoder(int page_id) {
+   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+-  DCHECK(leaf_decoder_.get() == nullptr)
++  DCHECK(!leaf_decoder_.IsValid())
+       << __func__
+       << " must only be called when the current path has no leaf decoder";
+ 
+@@ -113,7 +113,7 @@ void VirtualCursor::AppendPageDecoder(int page_id) {
+     return;
+ 
+   if (LeafPageDecoder::IsOnValidPage(&db_reader_)) {
+-    leaf_decoder_ = std::make_unique<LeafPageDecoder>(&db_reader_);
++    leaf_decoder_.Initialize(&db_reader_);
+     return;
+   }
+ 
+diff --git a/sql/recover_module/cursor.h b/sql/recover_module/cursor.h
+index afcd6900e1..b15c31d425 100644
+--- a/sql/recover_module/cursor.h
++++ b/sql/recover_module/cursor.h
+@@ -129,7 +129,7 @@ class VirtualCursor {
+   std::vector<std::unique_ptr<InnerPageDecoder>> inner_decoders_;
+ 
+   // Decodes the leaf page containing records.
+-  std::unique_ptr<LeafPageDecoder> leaf_decoder_;
++  LeafPageDecoder leaf_decoder_;
+ 
+   SEQUENCE_CHECKER(sequence_checker_);
+ };
+diff --git a/sql/recover_module/pager.cc b/sql/recover_module/pager.cc
+index 58e75de270..5fe96204e5 100644
+--- a/sql/recover_module/pager.cc
++++ b/sql/recover_module/pager.cc
+@@ -23,8 +23,7 @@ static_assert(DatabasePageReader::kMaxPageId <= std::numeric_limits<int>::max(),
+               "ints are not appropriate for representing page IDs");
+ 
+ DatabasePageReader::DatabasePageReader(VirtualTable* table)
+-    : page_data_(std::make_unique<uint8_t[]>(table->page_size())),
+-      table_(table) {
++    : page_data_(), table_(table) {
+   DCHECK(table != nullptr);
+   DCHECK(IsValidPageSize(table->page_size()));
+ }
+@@ -57,8 +56,8 @@ int DatabasePageReader::ReadPage(int page_id) {
+                     std::numeric_limits<int64_t>::max(),
+                 "The |read_offset| computation above may overflow");
+ 
+-  int sqlite_status =
+-      RawRead(sqlite_file, read_size, read_offset, page_data_.get());
++  int sqlite_status = RawRead(sqlite_file, read_size, read_offset,
++                              const_cast<uint8_t*>(page_data_.data()));
+ 
+   // |page_id_| needs to be set to kInvalidPageId if the read failed.
+   // Otherwise, future ReadPage() calls with the previous |page_id_| value
+diff --git a/sql/recover_module/pager.h b/sql/recover_module/pager.h
+index 0e388ddc3b..99314e30ff 100644
+--- a/sql/recover_module/pager.h
++++ b/sql/recover_module/pager.h
+@@ -5,6 +5,7 @@
+ #ifndef SQL_RECOVER_MODULE_PAGER_H_
+ #define SQL_RECOVER_MODULE_PAGER_H_
+ 
++#include <array>
+ #include <cstdint>
+ #include <memory>
+ 
+@@ -70,7 +71,7 @@ class DatabasePageReader {
+     DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+     DCHECK_NE(page_id_, kInvalidPageId)
+         << "Successful ReadPage() required before accessing pager state";
+-    return page_data_.get();
++    return page_data_.data();
+   }
+ 
+   // The number of bytes in the page read by the last ReadPage() call.
+@@ -137,7 +138,7 @@ class DatabasePageReader {
+   int page_id_ = kInvalidPageId;
+   // Stores the bytes of the last page successfully read by ReadPage().
+   // The content is undefined if the last call to ReadPage() did not succeed.
+-  const std::unique_ptr<uint8_t[]> page_data_;
++  const std::array<uint8_t, kMaxPageSize> page_data_;
+   // Raw pointer usage is acceptable because this instance's owner is expected
+   // to ensure that the VirtualTable outlives this.
+   VirtualTable* const table_;

Copied: electron11/repos/community-staging-x86_64/use-system-libraries-in-node.patch (from rev 1120870, electron11/trunk/use-system-libraries-in-node.patch)
===================================================================
--- community-staging-x86_64/use-system-libraries-in-node.patch	                        (rev 0)
+++ community-staging-x86_64/use-system-libraries-in-node.patch	2022-01-30 20:26:45 UTC (rev 1120871)
@@ -0,0 +1,53 @@
+--- a/third_party/electron_node/BUILD.gn
++++ b/third_party/electron_node/BUILD.gn
+@@ -42,6 +42,18 @@
+   node_module_version = ""
+ }
+ 
++if (is_linux) {
++  import("//build/config/linux/pkg_config.gni")
++
++  pkg_config("cares") {
++    packages = [ "libcares" ]
++  }
++
++  pkg_config("nghttp2") {
++    packages = [ "libnghttp2" ]
++  }
++}
++
+ assert(!node_use_dtrace, "node_use_dtrace not supported in GN")
+ assert(!node_use_etw, "node_use_etw not supported in GN")
+ 
+@@ -190,11 +202,8 @@
+ component("node_lib") {
+   deps = [
+     ":node_js2c",
+-    "deps/cares",
+     "deps/histogram",
+-    "deps/http_parser",
+     "deps/llhttp",
+-    "deps/nghttp2",
+     "deps/uvwasi",
+     "//third_party/zlib",
+     "//third_party/brotli:dec",
+@@ -210,6 +219,19 @@
+   public_configs = [ ":node_lib_config" ]
+   include_dirs = [ "src" ]
+   libs = []
++  if (is_linux) {
++    configs += [
++      ":cares",
++      ":nghttp2",
++    ]
++    libs += [ "http_parser" ]
++  } else {
++    deps += [
++      "deps/cares",
++      "deps/http_parser",
++      "deps/nghttp2",
++    ]
++  }
+   frameworks = []
+   cflags_cc = [
+     "-Wno-deprecated-declarations",

Copied: electron11/repos/community-staging-x86_64/v8-call-new-ListFormatter-createInstance.patch (from rev 1120870, electron11/trunk/v8-call-new-ListFormatter-createInstance.patch)
===================================================================
--- community-staging-x86_64/v8-call-new-ListFormatter-createInstance.patch	                        (rev 0)
+++ community-staging-x86_64/v8-call-new-ListFormatter-createInstance.patch	2022-01-30 20:26:45 UTC (rev 1120871)
@@ -0,0 +1,95 @@
+From 035c305ce7761f51328b45f1bd83e26aef267c9d Mon Sep 17 00:00:00 2001
+From: Frank Tang <ftang at chromium.org>
+Date: Thu, 15 Oct 2020 22:44:27 -0700
+Subject: [PATCH] [Intl] call new ListFormatter::createInstance
+
+The one we currently using is now marked as internal and to be removed
+for 68. Migrating to the style which already avaiable in ICU 67-1.
+
+Bug: v8:11031
+Change-Id: I668382a2e1b8602ddca02bf231c5008a6c92bf2d
+Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2477751
+Reviewed-by: Jakob Kummerow <jkummerow at chromium.org>
+Commit-Queue: Frank Tang <ftang at chromium.org>
+Cr-Commit-Position: refs/heads/master@{#70638}
+---
+ src/objects/js-list-format.cc | 55 ++++++++++++-----------------------
+ 1 file changed, 18 insertions(+), 37 deletions(-)
+
+diff --git a/src/objects/js-list-format.cc b/src/objects/js-list-format.cc
+index b17d38c43ff5..e48a387be50f 100644
+--- a/src/objects/js-list-format.cc
++++ b/src/objects/js-list-format.cc
+@@ -29,46 +29,27 @@ namespace v8 {
+ namespace internal {
+ 
+ namespace {
+-const char* kStandard = "standard";
+-const char* kOr = "or";
+-const char* kUnit = "unit";
+-const char* kStandardShort = "standard-short";
+-const char* kOrShort = "or-short";
+-const char* kUnitShort = "unit-short";
+-const char* kStandardNarrow = "standard-narrow";
+-const char* kOrNarrow = "or-narrow";
+-const char* kUnitNarrow = "unit-narrow";
+-
+-const char* GetIcuStyleString(JSListFormat::Style style,
+-                              JSListFormat::Type type) {
++
++UListFormatterWidth GetIcuWidth(JSListFormat::Style style) {
++  switch (style) {
++    case JSListFormat::Style::LONG:
++      return ULISTFMT_WIDTH_WIDE;
++    case JSListFormat::Style::SHORT:
++      return ULISTFMT_WIDTH_SHORT;
++    case JSListFormat::Style::NARROW:
++      return ULISTFMT_WIDTH_NARROW;
++  }
++  UNREACHABLE();
++}
++
++UListFormatterType GetIcuType(JSListFormat::Type type) {
+   switch (type) {
+     case JSListFormat::Type::CONJUNCTION:
+-      switch (style) {
+-        case JSListFormat::Style::LONG:
+-          return kStandard;
+-        case JSListFormat::Style::SHORT:
+-          return kStandardShort;
+-        case JSListFormat::Style::NARROW:
+-          return kStandardNarrow;
+-      }
++      return ULISTFMT_TYPE_AND;
+     case JSListFormat::Type::DISJUNCTION:
+-      switch (style) {
+-        case JSListFormat::Style::LONG:
+-          return kOr;
+-        case JSListFormat::Style::SHORT:
+-          return kOrShort;
+-        case JSListFormat::Style::NARROW:
+-          return kOrNarrow;
+-      }
++      return ULISTFMT_TYPE_OR;
+     case JSListFormat::Type::UNIT:
+-      switch (style) {
+-        case JSListFormat::Style::LONG:
+-          return kUnit;
+-        case JSListFormat::Style::SHORT:
+-          return kUnitShort;
+-        case JSListFormat::Style::NARROW:
+-          return kUnitNarrow;
+-      }
++      return ULISTFMT_TYPE_UNITS;
+   }
+   UNREACHABLE();
+ }
+@@ -143,7 +124,7 @@ MaybeHandle<JSListFormat> JSListFormat::New(Isolate* isolate, Handle<Map> map,
+   icu::Locale icu_locale = r.icu_locale;
+   UErrorCode status = U_ZERO_ERROR;
+   icu::ListFormatter* formatter = icu::ListFormatter::createInstance(
+-      icu_locale, GetIcuStyleString(style_enum, type_enum), status);
++      icu_locale, GetIcuType(type_enum), GetIcuWidth(style_enum), status);
+   if (U_FAILURE(status) || formatter == nullptr) {
+     delete formatter;
+     THROW_NEW_ERROR(isolate, NewRangeError(MessageTemplate::kIcuError),

Copied: electron11/repos/community-staging-x86_64/v8-icu68.patch (from rev 1120870, electron11/trunk/v8-icu68.patch)
===================================================================
--- community-staging-x86_64/v8-icu68.patch	                        (rev 0)
+++ community-staging-x86_64/v8-icu68.patch	2022-01-30 20:26:45 UTC (rev 1120871)
@@ -0,0 +1,192 @@
+From b0a7f5691113534c2cf771f2dd3cece5e93bc7d4 Mon Sep 17 00:00:00 2001
+From: Frank Tang <ftang at chromium.org>
+Date: Tue, 03 Nov 2020 23:20:37 -0800
+Subject: [PATCH] Update to ICU68-1
+
+ICU68-1 change the output skeleton format. So we need to change
+resolvedOptions code for 68 migration.
+
+Chromium roll
+https://chromium-review.googlesource.com/c/chromium/src/+/2474093
+
+Bug: v8:10945
+Change-Id: I3b2c7fbe8abb22df8fa51287c498ca3245b8c55b
+Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2477431
+Commit-Queue: Frank Tang <ftang at chromium.org>
+Reviewed-by: Jakob Kummerow <jkummerow at chromium.org>
+Reviewed-by: Shu-yu Guo <syg at chromium.org>
+Cr-Commit-Position: refs/heads/master@{#70972}
+
+(ported to work with <ICU-68.1 -- https://bugs.gentoo.org/757606)
+---
+
+diff --git a/src/objects/js-number-format.cc b/src/objects/js-number-format.cc
+index 45b0eab..d18b133 100644
+--- a/src/objects/js-number-format.cc
++++ b/src/objects/js-number-format.cc
+@@ -389,17 +389,20 @@ Handle<String> CurrencySignString(Isolate* isolate,
+ Handle<String> UnitDisplayString(Isolate* isolate,
+                                  const icu::UnicodeString& skeleton) {
+   // Ex: skeleton as
+-  // "measure-unit/length-meter .### rounding-mode-half-up unit-width-full-name"
++  // <ICU-68.1:  "measure-unit/length-meter .### rounding-mode-half-up unit-width-full-name".
++  // >=ICU-68.1: "unit/length-meter .### rounding-mode-half-up unit-width-full-name"
+   if (skeleton.indexOf("unit-width-full-name") >= 0) {
+     return ReadOnlyRoots(isolate).long_string_handle();
+   }
+   // Ex: skeleton as
+-  // "measure-unit/length-meter .### rounding-mode-half-up unit-width-narrow".
++  // <ICU-68.1:  "measure-unit/length-meter .### rounding-mode-half-up unit-width-narrow".
++  // >=ICU-68.1: "unit/length-meter .### rounding-mode-half-up unit-width-narrow".
+   if (skeleton.indexOf("unit-width-narrow") >= 0) {
+     return ReadOnlyRoots(isolate).narrow_string_handle();
+   }
+   // Ex: skeleton as
+-  // "measure-unit/length-foot .### rounding-mode-half-up"
++  // <ICU-68.1:  "measure-unit/length-foot .### rounding-mode-half-up"
++  // >=ICU-68.1: "unit/length-foot .### rounding-mode-half-up"
+   return ReadOnlyRoots(isolate).short_string_handle();
+ }
+ 
+@@ -422,7 +425,8 @@ Notation NotationFromSkeleton(const icu::UnicodeString& skeleton) {
+     return Notation::COMPACT;
+   }
+   // Ex: skeleton as
+-  // "measure-unit/length-foot .### rounding-mode-half-up"
++  // <ICU-68.1:  "measure-unit/length-foot .### rounding-mode-half-up"
++  // >=ICU-68.1: "unit/length-foot .### rounding-mode-half-up"
+   return Notation::STANDARD;
+ }
+ 
+@@ -562,14 +566,23 @@ namespace {
+ 
+ // Ex: percent .### rounding-mode-half-up
+ // Special case for "percent"
+-// Ex: "measure-unit/length-kilometer per-measure-unit/duration-hour .###
+-// rounding-mode-half-up" should return "kilometer-per-unit".
+-// Ex: "measure-unit/duration-year .### rounding-mode-half-up" should return
+-// "year".
++// <ICU-68.1:
++//   Ex: "measure-unit/length-kilometer per-measure-unit/duration-hour .###
++//   rounding-mode-half-up" should return "kilometer-per-unit".
++//   Ex: "measure-unit/duration-year .### rounding-mode-half-up" should return
++// >=ICU-68.1:
++//   Ex: "unit/milliliter-per-acre .### rounding-mode-half-up"
++//   should return "milliliter-per-acre".
++//   Ex: "unit/year .### rounding-mode-half-up" should return
++//   "year".
+ std::string UnitFromSkeleton(const icu::UnicodeString& skeleton) {
+   std::string str;
+   str = skeleton.toUTF8String<std::string>(str);
++#if U_ICU_VERSION_MAJOR_NUM < 68
+   std::string search("measure-unit/");
++#else
++  std::string search("unit/");
++#endif
+   size_t begin = str.find(search);
+   if (begin == str.npos) {
+     // Special case for "percent".
+@@ -578,20 +591,41 @@ std::string UnitFromSkeleton(const icu::UnicodeString& skeleton) {
+     }
+     return "";
+   }
++#if U_ICU_VERSION_MAJOR_NUM < 68
+   // Skip the type (ex: "length").
+   // "measure-unit/length-kilometer per-measure-unit/duration-hour"
+   //                     b
+   begin = str.find("-", begin + search.size());
++#else
++  // Ex:
++  // "unit/acre .### rounding-mode-half-up"
++  //       b
++  // Ex:
++  // "unit/milliliter-per-acre .### rounding-mode-half-up"
++  //       b
++  begin += search.size();
++#endif
+   if (begin == str.npos) {
+     return "";
+   }
++#if U_ICU_VERSION_MAJOR_NUM < 68
+   begin++;  // Skip the '-'.
++#endif
+   // Find the end of the subtype.
+   size_t end = str.find(" ", begin);
+-  // "measure-unit/length-kilometer per-measure-unit/duration-hour"
+-  //                      b        e
++  // <ICU-68.1:
++  //   "measure-unit/length-kilometer per-measure-unit/duration-hour"
++  //                        b        e
++  // >=ICU-68.1:
++  //   Ex:
++  //   "unit/acre .### rounding-mode-half-up"
++  //         b   e
++  //   Ex:
++  //   "unit/milliliter-per-acre .### rounding-mode-half-up"
++  //         b                  e
+   if (end == str.npos) {
+     end = str.size();
++#if U_ICU_VERSION_MAJOR_NUM < 68
+     return str.substr(begin, end - begin);
+   }
+   // "measure-unit/length-kilometer per-measure-unit/duration-hour"
+@@ -625,17 +659,36 @@ std::string UnitFromSkeleton(const icu::UnicodeString& skeleton) {
+   // "measure-unit/length-kilometer per-measure-unit/duration-hour"
+   //                      [result ]                           b   e
+   return result + "-per-" + str.substr(begin, end - begin);
++#else
++  }
++  return str.substr(begin, end - begin);
++#endif
+ }
+ 
+ Style StyleFromSkeleton(const icu::UnicodeString& skeleton) {
+   if (skeleton.indexOf("currency/") >= 0) {
+     return Style::CURRENCY;
+   }
++#if U_ICU_VERSION_MAJOR_NUM < 68
+   if (skeleton.indexOf("measure-unit/") >= 0) {
+     if (skeleton.indexOf("scale/100") >= 0 &&
+         skeleton.indexOf("measure-unit/concentr-percent") >= 0) {
++#else
++  if (skeleton.indexOf("percent") >= 0) {
++    // percent precision-integer rounding-mode-half-up scale/100
++    if (skeleton.indexOf("scale/100") >= 0) {
++#endif
+       return Style::PERCENT;
++#if U_ICU_VERSION_MAJOR_NUM >= 68
++    } else {
++      return Style::UNIT;
++#endif
+     }
++#if U_ICU_VERSION_MAJOR_NUM >= 68
++  }
++  // Before ICU68: "measure-unit/", since ICU68 "unit/"
++  if (skeleton.indexOf("unit/") >= 0) {
++#endif
+     return Style::UNIT;
+   }
+   return Style::DECIMAL;
+diff --git a/src/objects/js-relative-time-format.cc b/src/objects/js-relative-time-format.cc
+index 267343aaae..64d56a1c12 100644
+--- a/src/objects/js-relative-time-format.cc
++++ b/src/objects/js-relative-time-format.cc
+@@ -195,9 +195,18 @@ MaybeHandle<JSRelativeTimeFormat> JSRelativeTimeFormat::New(
+     }
+   }
+ 
++#if U_ICU_VERSION_MAJOR_NUM < 68
+   icu::DecimalFormat* decimal_format =
+       static_cast<icu::DecimalFormat*>(number_format);
+   decimal_format->setMinimumGroupingDigits(-2);
++#else
++  if (number_format->getDynamicClassID() ==
++      icu::DecimalFormat::getStaticClassID()) {
++    icu::DecimalFormat* decimal_format =
++        static_cast<icu::DecimalFormat*>(number_format);
++    decimal_format->setMinimumGroupingDigits(-2);
++  }
++#endif
+ 
+   // Change UDISPCTX_CAPITALIZATION_NONE to other values if
+   // ECMA402 later include option to change capitalization.



More information about the arch-commits mailing list