[arch-commits] Commit in chromium/repos/extra-x86_64 (18 files)
Evangelos Foutras
foutrelis at gemini.archlinux.org
Tue Feb 15 11:08:48 UTC 2022
Date: Tuesday, February 15, 2022 @ 11:08:48
Author: foutrelis
Revision: 437355
archrelease: copy trunk to extra-x86_64
Added:
chromium/repos/extra-x86_64/PKGBUILD
(from rev 437354, chromium/trunk/PKGBUILD)
chromium/repos/extra-x86_64/breakpad-fix-for-non-constant-SIGSTKSZ.patch
(from rev 437354, chromium/trunk/breakpad-fix-for-non-constant-SIGSTKSZ.patch)
chromium/repos/extra-x86_64/chromium-93-ffmpeg-4.4.patch
(from rev 437354, chromium/trunk/chromium-93-ffmpeg-4.4.patch)
chromium/repos/extra-x86_64/downgrade-duplicate-peer-error-to-dvlog.patch
(from rev 437354, chromium/trunk/downgrade-duplicate-peer-error-to-dvlog.patch)
chromium/repos/extra-x86_64/fix-build-break-with-system-libdrm.patch
(from rev 437354, chromium/trunk/fix-build-break-with-system-libdrm.patch)
chromium/repos/extra-x86_64/sandbox-build-if-glibc-2.34-dynamic-stack-size-is-en.patch
(from rev 437354, chromium/trunk/sandbox-build-if-glibc-2.34-dynamic-stack-size-is-en.patch)
chromium/repos/extra-x86_64/sql-make-VirtualCursor-standard-layout-type.patch
(from rev 437354, chromium/trunk/sql-make-VirtualCursor-standard-layout-type.patch)
chromium/repos/extra-x86_64/unbundle-ffmpeg-av_stream_get_first_dts.patch
(from rev 437354, chromium/trunk/unbundle-ffmpeg-av_stream_get_first_dts.patch)
chromium/repos/extra-x86_64/use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch
(from rev 437354, chromium/trunk/use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch)
chromium/repos/extra-x86_64/use-oauth2-client-switches-as-default.patch
(from rev 437354, chromium/trunk/use-oauth2-client-switches-as-default.patch)
Deleted:
chromium/repos/extra-x86_64/PKGBUILD
chromium/repos/extra-x86_64/chromium-93-ffmpeg-4.4.patch
chromium/repos/extra-x86_64/downgrade-duplicate-peer-error-to-dvlog.patch
chromium/repos/extra-x86_64/fix-build-break-with-system-libdrm.patch
chromium/repos/extra-x86_64/sql-make-VirtualCursor-standard-layout-type.patch
chromium/repos/extra-x86_64/unbundle-ffmpeg-av_stream_get_first_dts.patch
chromium/repos/extra-x86_64/use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch
chromium/repos/extra-x86_64/use-oauth2-client-switches-as-default.patch
------------------------------------------------------------+
PKGBUILD | 570 +++++------
breakpad-fix-for-non-constant-SIGSTKSZ.patch | 35
chromium-93-ffmpeg-4.4.patch | 72 -
downgrade-duplicate-peer-error-to-dvlog.patch | 66 -
fix-build-break-with-system-libdrm.patch | 124 +-
sandbox-build-if-glibc-2.34-dynamic-stack-size-is-en.patch | 39
sql-make-VirtualCursor-standard-layout-type.patch | 476 ++++-----
unbundle-ffmpeg-av_stream_get_first_dts.patch | 24
use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch | 144 +-
use-oauth2-client-switches-as-default.patch | 34
10 files changed, 832 insertions(+), 752 deletions(-)
Deleted: PKGBUILD
===================================================================
--- PKGBUILD 2022-02-15 11:04:35 UTC (rev 437354)
+++ PKGBUILD 2022-02-15 11:08:48 UTC (rev 437355)
@@ -1,282 +0,0 @@
-# Maintainer: Evangelos Foutras <evangelos at foutrelis.com>
-# Contributor: Pierre Schmitz <pierre at archlinux.de>
-# Contributor: Jan "heftig" Steffens <jan.steffens at gmail.com>
-# Contributor: Daniel J Griffiths <ghost1227 at archlinux.us>
-
-pkgname=chromium
-pkgver=98.0.4758.80
-pkgrel=1
-_launcher_ver=8
-_gcc_patchset=5
-pkgdesc="A web browser built for speed, simplicity, and security"
-arch=('x86_64')
-url="https://www.chromium.org/Home"
-license=('BSD')
-depends=('gtk3' 'nss' 'alsa-lib' 'xdg-utils' 'libxss' 'libcups' 'libgcrypt'
- 'ttf-liberation' 'systemd' 'dbus' 'libpulse' 'pciutils' 'libva'
- 'desktop-file-utils' 'hicolor-icon-theme')
-makedepends=('python' 'gn' 'ninja' 'clang' 'lld' 'gperf' 'nodejs' 'pipewire'
- 'java-runtime-headless')
-optdepends=('pipewire: WebRTC desktop sharing under Wayland'
- 'kdialog: support for native dialogs in Plasma'
- 'org.freedesktop.secrets: password storage backend on GNOME / Xfce'
- 'kwallet: support for storing passwords in KWallet on Plasma')
-options=('debug' '!lto') # Chromium adds its own flags for ThinLTO
-source=(https://commondatastorage.googleapis.com/chromium-browser-official/$pkgname-$pkgver.tar.xz
- 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
- downgrade-duplicate-peer-error-to-dvlog.patch
- fix-build-break-with-system-libdrm.patch
- use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch
- sql-make-VirtualCursor-standard-layout-type.patch
- chromium-93-ffmpeg-4.4.patch
- unbundle-ffmpeg-av_stream_get_first_dts.patch
- use-oauth2-client-switches-as-default.patch)
-sha256sums=('c87266e20f860a32c48affc70a769368d1b876dbad768e3aa93ee3c335944171'
- '213e50f48b67feb4441078d50b0fd431df34323be15be97c55302d3fdac4483a'
- 'f561145514e9d30a696a82f6a6a4eca06e664b58d7cda30dad9afb2cef341a4d'
- '291c6a6ad44c06ae8d1b13433f0c4e37d280c70fb06eaa97a1cc9b0dcc122aaa'
- 'edf4d973ff197409d319bb6fbbaa529e53bc62347d26b0733c45a116a1b23f37'
- '9c9c280be968f06d269167943680fb72a26fbb05d8c15f60507e316e8a9075d5'
- 'b94b2e88f63cfb7087486508b8139599c89f96d7a4181c61fec4b4e250ca327a'
- '1a9e074f417f8ffd78bcd6874d8e2e74a239905bf662f76a7755fa40dc476b57'
- '1f0c1a7a1eb67d91765c9f28df815f58e1c6dc7b37d0acd4d68cac8e5515786c'
- 'e393174d7695d0bafed69e868c5fbfecf07aa6969f3b64596d0bae8b067e1711')
-
-# Possible replacements are listed in build/linux/unbundle/replace_gn_files.py
-# Keys are the names in the above script; values are the dependencies in Arch
-declare -gA _system_libs=(
- [ffmpeg]=ffmpeg
- [flac]=flac
- [fontconfig]=fontconfig
- [freetype]=freetype2
- [harfbuzz-ng]=harfbuzz
- [icu]=icu
- [libdrm]=
- [libjpeg]=libjpeg
- [libpng]=libpng
- #[libvpx]=libvpx
- [libwebp]=libwebp
- [libxml]=libxml2
- [libxslt]=libxslt
- [opus]=opus
- [re2]=re2
- [snappy]=snappy
- [zlib]=minizip
-)
-_unwanted_bundled_libs=(
- $(printf "%s\n" ${!_system_libs[@]} | sed 's/^libjpeg$/&_turbo/')
-)
-depends+=(${_system_libs[@]})
-
-# Google API keys (see https://www.chromium.org/developers/how-tos/api-keys)
-# Note: These are for Arch Linux use ONLY. For your own distribution, please
-# get your own set of keys.
-#
-# Starting with Chromium 89 (2021-03-02) the OAuth2 credentials have been left
-# out: https://archlinux.org/news/chromium-losing-sync-support-in-early-march/
-_google_api_key=AIzaSyDwr302FpOSkGRpLlUpPThNTDPbXcIn_FM
-
-prepare() {
- cd "$srcdir/$pkgname-$pkgver"
-
- # Allow building against system libraries in official builds
- sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \
- tools/generate_shim_headers/generate_shim_headers.py
-
- # https://crbug.com/893950
- sed -i -e 's/\<xmlMalloc\>/malloc/' -e 's/\<xmlFree\>/free/' \
- third_party/blink/renderer/core/xml/*.cc \
- third_party/blink/renderer/core/xml/parser/xml_document_parser.cc \
- third_party/libxml/chromium/*.cc \
- third_party/maldoca/src/maldoca/ole/oss_utils.h
-
- # Use the --oauth2-client-id= and --oauth2-client-secret= switches for
- # setting GOOGLE_DEFAULT_CLIENT_ID and GOOGLE_DEFAULT_CLIENT_SECRET at
- # runtime -- this allows signing into Chromium without baked-in values
- patch -Np1 -i ../use-oauth2-client-switches-as-default.patch
-
- # Patches to build with ffmpeg 4.4; remove when ffmpeg 5.0 moves to stable
- if ! pkg-config --atleast-version 59 libavformat; then
- # Fix build with older ffmpeg
- patch -Np1 -i ../chromium-93-ffmpeg-4.4.patch
-
- # Substitute the custom function 'av_stream_get_first_dts' for ffmpeg 4.4;
- # drop this for ffmpeg 5.0 which is patched to include the above function.
- # https://crbug.com/1251779
- patch -Np1 -i ../unbundle-ffmpeg-av_stream_get_first_dts.patch
- fi
-
- # Upstream fixes
- patch -Np1 -F3 -i ../downgrade-duplicate-peer-error-to-dvlog.patch
- patch -Np1 -i ../fix-build-break-with-system-libdrm.patch
- patch -Np1 -d third_party/pdfium <../use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch
-
- # https://chromium-review.googlesource.com/c/chromium/src/+/2862724
- patch -Np1 -i ../sql-make-VirtualCursor-standard-layout-type.patch
-
- # Fixes for building with libstdc++ instead of libc++
- #patch -Np1 -i ../patches/
-
- # Link to system tools required by the build
- mkdir -p third_party/node/linux/node-linux-x64/bin
- ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/
- ln -s /usr/bin/java third_party/jdk/current/bin/
-
- # Remove bundled libraries for which we will use the system copies; this
- # *should* do what the remove_bundled_libraries.py script does, with the
- # added benefit of not having to list all the remaining libraries
- local _lib
- for _lib in ${_unwanted_bundled_libs[@]}; do
- find "third_party/$_lib" -type f \
- \! -path "third_party/$_lib/chromium/*" \
- \! -path "third_party/$_lib/google/*" \
- \! -path "third_party/harfbuzz-ng/utils/hb_scoped.h" \
- \! -regex '.*\.\(gn\|gni\|isolate\)' \
- -delete
- done
-
- ./build/linux/unbundle/replace_gn_files.py \
- --system-libraries "${!_system_libs[@]}"
-}
-
-build() {
- make -C chromium-launcher-$_launcher_ver
-
- cd "$srcdir/$pkgname-$pkgver"
-
- export CC=clang
- export CXX=clang++
- export AR=ar
- export NM=nm
-
- local _flags=(
- 'custom_toolchain="//build/toolchain/linux/unbundle:default"'
- 'host_toolchain="//build/toolchain/linux/unbundle:default"'
- 'clang_use_chrome_plugins=false'
- 'is_official_build=true' # implies is_cfi=true on x86_64
- 'symbol_level=0' # sufficient for backtraces on x86(_64)
- 'treat_warnings_as_errors=false'
- 'disable_fieldtrial_testing_config=true'
- 'blink_enable_generated_code_formatting=false'
- 'ffmpeg_branding="Chrome"'
- 'proprietary_codecs=true'
- 'rtc_use_pipewire=true'
- 'link_pulseaudio=true'
- 'use_gnome_keyring=false'
- 'use_sysroot=false'
- 'use_custom_libcxx=false'
- 'enable_hangout_services_extension=true'
- 'enable_widevine=true'
- 'enable_nacl=false'
- "google_api_key=\"$_google_api_key\""
- )
-
- if [[ -n ${_system_libs[icu]+set} ]]; then
- _flags+=('icu_use_data_file=false')
- fi
-
- # Facilitate deterministic builds (taken from build/config/compiler/BUILD.gn)
- CFLAGS+=' -Wno-builtin-macro-redefined'
- CXXFLAGS+=' -Wno-builtin-macro-redefined'
- CPPFLAGS+=' -D__DATE__= -D__TIME__= -D__TIMESTAMP__='
-
- # Do not warn about unknown warning options
- CFLAGS+=' -Wno-unknown-warning-option'
- CXXFLAGS+=' -Wno-unknown-warning-option'
-
- # Let Chromium set its own symbol level
- CFLAGS=${CFLAGS/-g }
- CXXFLAGS=${CXXFLAGS/-g }
- # -fvar-tracking-assignments is not recognized by clang
- CFLAGS=${CFLAGS/-fvar-tracking-assignments}
- CXXFLAGS=${CXXFLAGS/-fvar-tracking-assignments}
-
- # https://github.com/ungoogled-software/ungoogled-chromium-archlinux/issues/123
- CFLAGS=${CFLAGS/-fexceptions}
- CFLAGS=${CFLAGS/-fcf-protection}
- CXXFLAGS=${CXXFLAGS/-fexceptions}
- CXXFLAGS=${CXXFLAGS/-fcf-protection}
-
- # 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}
-
- # https://crbug.com/957519#c122
- CXXFLAGS=${CXXFLAGS/-Wp,-D_GLIBCXX_ASSERTIONS}
-
- gn gen out/Release --args="${_flags[*]}"
- ninja -C out/Release chrome chrome_sandbox chromedriver.unstripped
-}
-
-package() {
- cd chromium-launcher-$_launcher_ver
- make PREFIX=/usr DESTDIR="$pkgdir" install
- install -Dm644 LICENSE \
- "$pkgdir/usr/share/licenses/chromium/LICENSE.launcher"
-
- cd "$srcdir/$pkgname-$pkgver"
-
- install -D out/Release/chrome "$pkgdir/usr/lib/chromium/chromium"
- install -D out/Release/chromedriver.unstripped "$pkgdir/usr/bin/chromedriver"
- install -Dm4755 out/Release/chrome_sandbox "$pkgdir/usr/lib/chromium/chrome-sandbox"
-
- install -Dm644 chrome/installer/linux/common/desktop.template \
- "$pkgdir/usr/share/applications/chromium.desktop"
- install -Dm644 chrome/app/resources/manpage.1.in \
- "$pkgdir/usr/share/man/man1/chromium.1"
- sed -i \
- -e 's/@@MENUNAME@@/Chromium/g' \
- -e 's/@@PACKAGE@@/chromium/g' \
- -e 's/@@USR_BIN_SYMLINK_NAME@@/chromium/g' \
- "$pkgdir/usr/share/applications/chromium.desktop" \
- "$pkgdir/usr/share/man/man1/chromium.1"
-
- install -Dm644 chrome/installer/linux/common/chromium-browser/chromium-browser.appdata.xml \
- "$pkgdir/usr/share/metainfo/chromium.appdata.xml"
- sed -ni \
- -e 's/chromium-browser\.desktop/chromium.desktop/' \
- -e '/<update_contact>/d' \
- -e '/<p>/N;/<p>\n.*\(We invite\|Chromium supports Vorbis\)/,/<\/p>/d' \
- -e '/^<?xml/,$p' \
- "$pkgdir/usr/share/metainfo/chromium.appdata.xml"
-
- local toplevel_files=(
- chrome_100_percent.pak
- chrome_200_percent.pak
- chrome_crashpad_handler
- resources.pak
- v8_context_snapshot.bin
-
- # ANGLE
- libEGL.so
- libGLESv2.so
-
- # SwiftShader ICD
- libvk_swiftshader.so
- vk_swiftshader_icd.json
- )
-
- if [[ -z ${_system_libs[icu]+set} ]]; then
- toplevel_files+=(icudtl.dat)
- fi
-
- cp "${toplevel_files[@]/#/out/Release/}" "$pkgdir/usr/lib/chromium/"
- install -Dm644 -t "$pkgdir/usr/lib/chromium/locales" out/Release/locales/*.pak
- install -Dm755 -t "$pkgdir/usr/lib/chromium/swiftshader" out/Release/swiftshader/*.so
-
- for size in 24 48 64 128 256; do
- install -Dm644 "chrome/app/theme/chromium/product_logo_$size.png" \
- "$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/chromium.png"
- done
-
- for size in 16 32; do
- install -Dm644 "chrome/app/theme/default_100_percent/chromium/product_logo_$size.png" \
- "$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/chromium.png"
- done
-
- install -Dm644 LICENSE "$pkgdir/usr/share/licenses/chromium/LICENSE"
-}
-
-# vim:set ts=2 sw=2 et:
Copied: chromium/repos/extra-x86_64/PKGBUILD (from rev 437354, chromium/trunk/PKGBUILD)
===================================================================
--- PKGBUILD (rev 0)
+++ PKGBUILD 2022-02-15 11:08:48 UTC (rev 437355)
@@ -0,0 +1,288 @@
+# Maintainer: Evangelos Foutras <evangelos at foutrelis.com>
+# Contributor: Pierre Schmitz <pierre at archlinux.de>
+# Contributor: Jan "heftig" Steffens <jan.steffens at gmail.com>
+# Contributor: Daniel J Griffiths <ghost1227 at archlinux.us>
+
+pkgname=chromium
+pkgver=98.0.4758.102
+pkgrel=1
+_launcher_ver=8
+_gcc_patchset=5
+pkgdesc="A web browser built for speed, simplicity, and security"
+arch=('x86_64')
+url="https://www.chromium.org/Home"
+license=('BSD')
+depends=('gtk3' 'nss' 'alsa-lib' 'xdg-utils' 'libxss' 'libcups' 'libgcrypt'
+ 'ttf-liberation' 'systemd' 'dbus' 'libpulse' 'pciutils' 'libva'
+ 'desktop-file-utils' 'hicolor-icon-theme')
+makedepends=('python' 'gn' 'ninja' 'clang' 'lld' 'gperf' 'nodejs' 'pipewire'
+ 'java-runtime-headless')
+optdepends=('pipewire: WebRTC desktop sharing under Wayland'
+ 'kdialog: support for native dialogs in Plasma'
+ 'org.freedesktop.secrets: password storage backend on GNOME / Xfce'
+ 'kwallet: support for storing passwords in KWallet on Plasma')
+options=('debug' '!lto') # Chromium adds its own flags for ThinLTO
+source=(https://commondatastorage.googleapis.com/chromium-browser-official/$pkgname-$pkgver.tar.xz
+ 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
+ downgrade-duplicate-peer-error-to-dvlog.patch
+ fix-build-break-with-system-libdrm.patch
+ sandbox-build-if-glibc-2.34-dynamic-stack-size-is-en.patch
+ breakpad-fix-for-non-constant-SIGSTKSZ.patch
+ use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch
+ sql-make-VirtualCursor-standard-layout-type.patch
+ chromium-93-ffmpeg-4.4.patch
+ unbundle-ffmpeg-av_stream_get_first_dts.patch
+ use-oauth2-client-switches-as-default.patch)
+sha256sums=('415b47e912766cd07f9f52e95bc6470b835acf1d6f566ae32e66ba8be608f33e'
+ '213e50f48b67feb4441078d50b0fd431df34323be15be97c55302d3fdac4483a'
+ 'f561145514e9d30a696a82f6a6a4eca06e664b58d7cda30dad9afb2cef341a4d'
+ '291c6a6ad44c06ae8d1b13433f0c4e37d280c70fb06eaa97a1cc9b0dcc122aaa'
+ 'edf4d973ff197409d319bb6fbbaa529e53bc62347d26b0733c45a116a1b23f37'
+ 'f910be9370c880de6e1d61cc30383c069e421d7acf406166e4fbfad324fc7d61'
+ 'b4d28867c1fabde6c50a2cfa3f784730446c4d86e5191e0f0000fbf7b0f91ecf'
+ '9c9c280be968f06d269167943680fb72a26fbb05d8c15f60507e316e8a9075d5'
+ 'b94b2e88f63cfb7087486508b8139599c89f96d7a4181c61fec4b4e250ca327a'
+ '1a9e074f417f8ffd78bcd6874d8e2e74a239905bf662f76a7755fa40dc476b57'
+ '1f0c1a7a1eb67d91765c9f28df815f58e1c6dc7b37d0acd4d68cac8e5515786c'
+ 'e393174d7695d0bafed69e868c5fbfecf07aa6969f3b64596d0bae8b067e1711')
+
+# Possible replacements are listed in build/linux/unbundle/replace_gn_files.py
+# Keys are the names in the above script; values are the dependencies in Arch
+declare -gA _system_libs=(
+ [ffmpeg]=ffmpeg
+ [flac]=flac
+ [fontconfig]=fontconfig
+ [freetype]=freetype2
+ [harfbuzz-ng]=harfbuzz
+ [icu]=icu
+ [libdrm]=
+ [libjpeg]=libjpeg
+ [libpng]=libpng
+ #[libvpx]=libvpx
+ [libwebp]=libwebp
+ [libxml]=libxml2
+ [libxslt]=libxslt
+ [opus]=opus
+ [re2]=re2
+ [snappy]=snappy
+ [zlib]=minizip
+)
+_unwanted_bundled_libs=(
+ $(printf "%s\n" ${!_system_libs[@]} | sed 's/^libjpeg$/&_turbo/')
+)
+depends+=(${_system_libs[@]})
+
+# Google API keys (see https://www.chromium.org/developers/how-tos/api-keys)
+# Note: These are for Arch Linux use ONLY. For your own distribution, please
+# get your own set of keys.
+#
+# Starting with Chromium 89 (2021-03-02) the OAuth2 credentials have been left
+# out: https://archlinux.org/news/chromium-losing-sync-support-in-early-march/
+_google_api_key=AIzaSyDwr302FpOSkGRpLlUpPThNTDPbXcIn_FM
+
+prepare() {
+ cd "$srcdir/$pkgname-$pkgver"
+
+ # Allow building against system libraries in official builds
+ sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \
+ tools/generate_shim_headers/generate_shim_headers.py
+
+ # https://crbug.com/893950
+ sed -i -e 's/\<xmlMalloc\>/malloc/' -e 's/\<xmlFree\>/free/' \
+ third_party/blink/renderer/core/xml/*.cc \
+ third_party/blink/renderer/core/xml/parser/xml_document_parser.cc \
+ third_party/libxml/chromium/*.cc \
+ third_party/maldoca/src/maldoca/ole/oss_utils.h
+
+ # Use the --oauth2-client-id= and --oauth2-client-secret= switches for
+ # setting GOOGLE_DEFAULT_CLIENT_ID and GOOGLE_DEFAULT_CLIENT_SECRET at
+ # runtime -- this allows signing into Chromium without baked-in values
+ patch -Np1 -i ../use-oauth2-client-switches-as-default.patch
+
+ # Patches to build with ffmpeg 4.4; remove when ffmpeg 5.0 moves to stable
+ if ! pkg-config --atleast-version 59 libavformat; then
+ # Fix build with older ffmpeg
+ patch -Np1 -i ../chromium-93-ffmpeg-4.4.patch
+
+ # Substitute the custom function 'av_stream_get_first_dts' for ffmpeg 4.4;
+ # drop this for ffmpeg 5.0 which is patched to include the above function.
+ # https://crbug.com/1251779
+ patch -Np1 -i ../unbundle-ffmpeg-av_stream_get_first_dts.patch
+ fi
+
+ # Upstream fixes
+ patch -Np1 -F3 -i ../downgrade-duplicate-peer-error-to-dvlog.patch
+ patch -Np1 -i ../fix-build-break-with-system-libdrm.patch
+ patch -Np1 -i ../sandbox-build-if-glibc-2.34-dynamic-stack-size-is-en.patch
+ patch -Np1 -d third_party//breakpad/breakpad <../breakpad-fix-for-non-constant-SIGSTKSZ.patch
+ patch -Np1 -d third_party/pdfium <../use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch
+
+ # https://chromium-review.googlesource.com/c/chromium/src/+/2862724
+ patch -Np1 -i ../sql-make-VirtualCursor-standard-layout-type.patch
+
+ # Fixes for building with libstdc++ instead of libc++
+ #patch -Np1 -i ../patches/
+
+ # Link to system tools required by the build
+ mkdir -p third_party/node/linux/node-linux-x64/bin
+ ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/
+ ln -s /usr/bin/java third_party/jdk/current/bin/
+
+ # Remove bundled libraries for which we will use the system copies; this
+ # *should* do what the remove_bundled_libraries.py script does, with the
+ # added benefit of not having to list all the remaining libraries
+ local _lib
+ for _lib in ${_unwanted_bundled_libs[@]}; do
+ find "third_party/$_lib" -type f \
+ \! -path "third_party/$_lib/chromium/*" \
+ \! -path "third_party/$_lib/google/*" \
+ \! -path "third_party/harfbuzz-ng/utils/hb_scoped.h" \
+ \! -regex '.*\.\(gn\|gni\|isolate\)' \
+ -delete
+ done
+
+ ./build/linux/unbundle/replace_gn_files.py \
+ --system-libraries "${!_system_libs[@]}"
+}
+
+build() {
+ make -C chromium-launcher-$_launcher_ver
+
+ cd "$srcdir/$pkgname-$pkgver"
+
+ export CC=clang
+ export CXX=clang++
+ export AR=ar
+ export NM=nm
+
+ local _flags=(
+ 'custom_toolchain="//build/toolchain/linux/unbundle:default"'
+ 'host_toolchain="//build/toolchain/linux/unbundle:default"'
+ 'clang_use_chrome_plugins=false'
+ 'is_official_build=true' # implies is_cfi=true on x86_64
+ 'symbol_level=0' # sufficient for backtraces on x86(_64)
+ 'treat_warnings_as_errors=false'
+ 'disable_fieldtrial_testing_config=true'
+ 'blink_enable_generated_code_formatting=false'
+ 'ffmpeg_branding="Chrome"'
+ 'proprietary_codecs=true'
+ 'rtc_use_pipewire=true'
+ 'link_pulseaudio=true'
+ 'use_gnome_keyring=false'
+ 'use_sysroot=false'
+ 'use_custom_libcxx=false'
+ 'enable_hangout_services_extension=true'
+ 'enable_widevine=true'
+ 'enable_nacl=false'
+ "google_api_key=\"$_google_api_key\""
+ )
+
+ if [[ -n ${_system_libs[icu]+set} ]]; then
+ _flags+=('icu_use_data_file=false')
+ fi
+
+ # Facilitate deterministic builds (taken from build/config/compiler/BUILD.gn)
+ CFLAGS+=' -Wno-builtin-macro-redefined'
+ CXXFLAGS+=' -Wno-builtin-macro-redefined'
+ CPPFLAGS+=' -D__DATE__= -D__TIME__= -D__TIMESTAMP__='
+
+ # Do not warn about unknown warning options
+ CFLAGS+=' -Wno-unknown-warning-option'
+ CXXFLAGS+=' -Wno-unknown-warning-option'
+
+ # Let Chromium set its own symbol level
+ CFLAGS=${CFLAGS/-g }
+ CXXFLAGS=${CXXFLAGS/-g }
+ # -fvar-tracking-assignments is not recognized by clang
+ CFLAGS=${CFLAGS/-fvar-tracking-assignments}
+ CXXFLAGS=${CXXFLAGS/-fvar-tracking-assignments}
+
+ # https://github.com/ungoogled-software/ungoogled-chromium-archlinux/issues/123
+ CFLAGS=${CFLAGS/-fexceptions}
+ CFLAGS=${CFLAGS/-fcf-protection}
+ CXXFLAGS=${CXXFLAGS/-fexceptions}
+ CXXFLAGS=${CXXFLAGS/-fcf-protection}
+
+ # 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}
+
+ # https://crbug.com/957519#c122
+ CXXFLAGS=${CXXFLAGS/-Wp,-D_GLIBCXX_ASSERTIONS}
+
+ gn gen out/Release --args="${_flags[*]}"
+ ninja -C out/Release chrome chrome_sandbox chromedriver.unstripped
+}
+
+package() {
+ cd chromium-launcher-$_launcher_ver
+ make PREFIX=/usr DESTDIR="$pkgdir" install
+ install -Dm644 LICENSE \
+ "$pkgdir/usr/share/licenses/chromium/LICENSE.launcher"
+
+ cd "$srcdir/$pkgname-$pkgver"
+
+ install -D out/Release/chrome "$pkgdir/usr/lib/chromium/chromium"
+ install -D out/Release/chromedriver.unstripped "$pkgdir/usr/bin/chromedriver"
+ install -Dm4755 out/Release/chrome_sandbox "$pkgdir/usr/lib/chromium/chrome-sandbox"
+
+ install -Dm644 chrome/installer/linux/common/desktop.template \
+ "$pkgdir/usr/share/applications/chromium.desktop"
+ install -Dm644 chrome/app/resources/manpage.1.in \
+ "$pkgdir/usr/share/man/man1/chromium.1"
+ sed -i \
+ -e 's/@@MENUNAME@@/Chromium/g' \
+ -e 's/@@PACKAGE@@/chromium/g' \
+ -e 's/@@USR_BIN_SYMLINK_NAME@@/chromium/g' \
+ "$pkgdir/usr/share/applications/chromium.desktop" \
+ "$pkgdir/usr/share/man/man1/chromium.1"
+
+ install -Dm644 chrome/installer/linux/common/chromium-browser/chromium-browser.appdata.xml \
+ "$pkgdir/usr/share/metainfo/chromium.appdata.xml"
+ sed -ni \
+ -e 's/chromium-browser\.desktop/chromium.desktop/' \
+ -e '/<update_contact>/d' \
+ -e '/<p>/N;/<p>\n.*\(We invite\|Chromium supports Vorbis\)/,/<\/p>/d' \
+ -e '/^<?xml/,$p' \
+ "$pkgdir/usr/share/metainfo/chromium.appdata.xml"
+
+ local toplevel_files=(
+ chrome_100_percent.pak
+ chrome_200_percent.pak
+ chrome_crashpad_handler
+ resources.pak
+ v8_context_snapshot.bin
+
+ # ANGLE
+ libEGL.so
+ libGLESv2.so
+
+ # SwiftShader ICD
+ libvk_swiftshader.so
+ vk_swiftshader_icd.json
+ )
+
+ if [[ -z ${_system_libs[icu]+set} ]]; then
+ toplevel_files+=(icudtl.dat)
+ fi
+
+ cp "${toplevel_files[@]/#/out/Release/}" "$pkgdir/usr/lib/chromium/"
+ install -Dm644 -t "$pkgdir/usr/lib/chromium/locales" out/Release/locales/*.pak
+ install -Dm755 -t "$pkgdir/usr/lib/chromium/swiftshader" out/Release/swiftshader/*.so
+
+ for size in 24 48 64 128 256; do
+ install -Dm644 "chrome/app/theme/chromium/product_logo_$size.png" \
+ "$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/chromium.png"
+ done
+
+ for size in 16 32; do
+ install -Dm644 "chrome/app/theme/default_100_percent/chromium/product_logo_$size.png" \
+ "$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/chromium.png"
+ done
+
+ install -Dm644 LICENSE "$pkgdir/usr/share/licenses/chromium/LICENSE"
+}
+
+# vim:set ts=2 sw=2 et:
Copied: chromium/repos/extra-x86_64/breakpad-fix-for-non-constant-SIGSTKSZ.patch (from rev 437354, chromium/trunk/breakpad-fix-for-non-constant-SIGSTKSZ.patch)
===================================================================
--- breakpad-fix-for-non-constant-SIGSTKSZ.patch (rev 0)
+++ breakpad-fix-for-non-constant-SIGSTKSZ.patch 2022-02-15 11:08:48 UTC (rev 437355)
@@ -0,0 +1,35 @@
+From 605c51ed96ad44b34c457bbca320e74e194c317e Mon Sep 17 00:00:00 2001
+From: David Faure <david.faure at kdab.com>
+Date: Wed, 15 Dec 2021 22:26:40 +0100
+Subject: [PATCH] Fix for non-constant SIGSTKSZ
+
+On glibc > 2.33, `SIGSTKSZ` might not be constant (in which case
+it expands to a call to `sysconf` which returns a `long int`); see
+https://sourceware.org/pipermail/libc-alpha/2020-October/118513.html
+
+Pass unsigned explicitly to std::max, to avoid relying on template
+argument deduction. This works both with the old-style constant
+`SIGSTKSZ` and the new configurable one.
+
+Initially based on https://chromium-review.googlesource.com/c/2776379
+
+Change-Id: I9fc95337f973e871b84735ce822b5e11ba73ea8c
+Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3340721
+Reviewed-by: Mark Mentovai <mark at chromium.org>
+---
+ src/client/linux/handler/exception_handler.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/client/linux/handler/exception_handler.cc b/src/client/linux/handler/exception_handler.cc
+index ca353c40..499be0a9 100644
+--- a/src/client/linux/handler/exception_handler.cc
++++ b/src/client/linux/handler/exception_handler.cc
+@@ -138,7 +138,7 @@ void InstallAlternateStackLocked() {
+ // SIGSTKSZ may be too small to prevent the signal handlers from overrunning
+ // the alternative stack. Ensure that the size of the alternative stack is
+ // large enough.
+- static const unsigned kSigStackSize = std::max(16384, SIGSTKSZ);
++ const unsigned kSigStackSize = std::max<unsigned>(16384, SIGSTKSZ);
+
+ // Only set an alternative stack if there isn't already one, or if the current
+ // one is too small.
Deleted: chromium-93-ffmpeg-4.4.patch
===================================================================
--- chromium-93-ffmpeg-4.4.patch 2022-02-15 11:04:35 UTC (rev 437354)
+++ chromium-93-ffmpeg-4.4.patch 2022-02-15 11:08:48 UTC (rev 437355)
@@ -1,36 +0,0 @@
-diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc
-index ac4713b07268..492a9a37d096 100644
---- a/media/filters/ffmpeg_demuxer.cc
-+++ b/media/filters/ffmpeg_demuxer.cc
-@@ -427,11 +427,11 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
- scoped_refptr<DecoderBuffer> buffer;
-
- if (type() == DemuxerStream::TEXT) {
-- size_t id_size = 0;
-+ int id_size = 0;
- uint8_t* id_data = av_packet_get_side_data(
- packet.get(), AV_PKT_DATA_WEBVTT_IDENTIFIER, &id_size);
-
-- size_t settings_size = 0;
-+ int settings_size = 0;
- uint8_t* settings_data = av_packet_get_side_data(
- packet.get(), AV_PKT_DATA_WEBVTT_SETTINGS, &settings_size);
-
-@@ -443,7 +443,7 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
- buffer = DecoderBuffer::CopyFrom(packet->data, packet->size,
- side_data.data(), side_data.size());
- } else {
-- size_t side_data_size = 0;
-+ int side_data_size = 0;
- uint8_t* side_data = av_packet_get_side_data(
- packet.get(), AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, &side_data_size);
-
-@@ -504,7 +504,7 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
- packet->size - data_offset);
- }
-
-- size_t skip_samples_size = 0;
-+ int 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));
Copied: chromium/repos/extra-x86_64/chromium-93-ffmpeg-4.4.patch (from rev 437354, chromium/trunk/chromium-93-ffmpeg-4.4.patch)
===================================================================
--- chromium-93-ffmpeg-4.4.patch (rev 0)
+++ chromium-93-ffmpeg-4.4.patch 2022-02-15 11:08:48 UTC (rev 437355)
@@ -0,0 +1,36 @@
+diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc
+index ac4713b07268..492a9a37d096 100644
+--- a/media/filters/ffmpeg_demuxer.cc
++++ b/media/filters/ffmpeg_demuxer.cc
+@@ -427,11 +427,11 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
+ scoped_refptr<DecoderBuffer> buffer;
+
+ if (type() == DemuxerStream::TEXT) {
+- size_t id_size = 0;
++ int id_size = 0;
+ uint8_t* id_data = av_packet_get_side_data(
+ packet.get(), AV_PKT_DATA_WEBVTT_IDENTIFIER, &id_size);
+
+- size_t settings_size = 0;
++ int settings_size = 0;
+ uint8_t* settings_data = av_packet_get_side_data(
+ packet.get(), AV_PKT_DATA_WEBVTT_SETTINGS, &settings_size);
+
+@@ -443,7 +443,7 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
+ buffer = DecoderBuffer::CopyFrom(packet->data, packet->size,
+ side_data.data(), side_data.size());
+ } else {
+- size_t side_data_size = 0;
++ int side_data_size = 0;
+ uint8_t* side_data = av_packet_get_side_data(
+ packet.get(), AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, &side_data_size);
+
+@@ -504,7 +504,7 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
+ packet->size - data_offset);
+ }
+
+- size_t skip_samples_size = 0;
++ int 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));
Deleted: downgrade-duplicate-peer-error-to-dvlog.patch
===================================================================
--- downgrade-duplicate-peer-error-to-dvlog.patch 2022-02-15 11:04:35 UTC (rev 437354)
+++ downgrade-duplicate-peer-error-to-dvlog.patch 2022-02-15 11:08:48 UTC (rev 437355)
@@ -1,33 +0,0 @@
-From 00604ca8ed6d669fb6cb3ae8bacd6028d5ef10ac Mon Sep 17 00:00:00 2001
-From: Stephen Roettger <sroettger at google.com>
-Date: Thu, 20 Jan 2022 10:04:04 +0000
-Subject: [PATCH] Downgrade duplicate peer error to dvlog
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Downgrading since this case can happen in non-error situations. There can be
-duplicate introductions in flight in which case we simply drop the second one.
-
-Change-Id: I2c51b177913ccd9634e9bb6343d468101d9735ed
-Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3398794
-Reviewed-by: Ken Rockot <rockot at google.com>
-Commit-Queue: Stephen Röttger <sroettger at google.com>
-Cr-Commit-Position: refs/heads/main@{#961389}
----
- mojo/core/node_controller.cc | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/mojo/core/node_controller.cc b/mojo/core/node_controller.cc
-index 7cde7719687..81712676733 100644
---- a/mojo/core/node_controller.cc
-+++ b/mojo/core/node_controller.cc
-@@ -594,7 +594,7 @@ void NodeController::AddPeer(const ports::NodeName& name,
- }
-
- if (dropped_peers_.Contains(name)) {
-- LOG(ERROR) << "Trying to re-add dropped peer " << name;
-+ DVLOG(1) << "Trying to re-add dropped peer " << name;
- return;
- }
-
Copied: chromium/repos/extra-x86_64/downgrade-duplicate-peer-error-to-dvlog.patch (from rev 437354, chromium/trunk/downgrade-duplicate-peer-error-to-dvlog.patch)
===================================================================
--- downgrade-duplicate-peer-error-to-dvlog.patch (rev 0)
+++ downgrade-duplicate-peer-error-to-dvlog.patch 2022-02-15 11:08:48 UTC (rev 437355)
@@ -0,0 +1,33 @@
+From 00604ca8ed6d669fb6cb3ae8bacd6028d5ef10ac Mon Sep 17 00:00:00 2001
+From: Stephen Roettger <sroettger at google.com>
+Date: Thu, 20 Jan 2022 10:04:04 +0000
+Subject: [PATCH] Downgrade duplicate peer error to dvlog
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Downgrading since this case can happen in non-error situations. There can be
+duplicate introductions in flight in which case we simply drop the second one.
+
+Change-Id: I2c51b177913ccd9634e9bb6343d468101d9735ed
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3398794
+Reviewed-by: Ken Rockot <rockot at google.com>
+Commit-Queue: Stephen Röttger <sroettger at google.com>
+Cr-Commit-Position: refs/heads/main@{#961389}
+---
+ mojo/core/node_controller.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/mojo/core/node_controller.cc b/mojo/core/node_controller.cc
+index 7cde7719687..81712676733 100644
+--- a/mojo/core/node_controller.cc
++++ b/mojo/core/node_controller.cc
+@@ -594,7 +594,7 @@ void NodeController::AddPeer(const ports::NodeName& name,
+ }
+
+ if (dropped_peers_.Contains(name)) {
+- LOG(ERROR) << "Trying to re-add dropped peer " << name;
++ DVLOG(1) << "Trying to re-add dropped peer " << name;
+ return;
+ }
+
Deleted: fix-build-break-with-system-libdrm.patch
===================================================================
--- fix-build-break-with-system-libdrm.patch 2022-02-15 11:04:35 UTC (rev 437354)
+++ fix-build-break-with-system-libdrm.patch 2022-02-15 11:08:48 UTC (rev 437355)
@@ -1,62 +0,0 @@
-From 5b287e0be8d8d8475ec6ef81b16eaa61e19db078 Mon Sep 17 00:00:00 2001
-From: "Steinar H. Gunderson" <sesse at chromium.org>
-Date: Tue, 25 Jan 2022 19:14:53 +0000
-Subject: [PATCH] Fix build break with system libdrm.
-
-This patch is submitted on behalf of Andres Salomon
-<dilinger at queued.net> (on Cc). Also adding him to src/AUTHORS
-per policy, as he has signed the CLA.
-
-Original patch:
-https://salsa.debian.org/dilinger/chromium/-/commit/2333c2fb985ac1ef3d7331776a7833d965c63302
-
-Change-Id: I18bd60e2e80f2b9181e74ee7972c3f457ab33b10
-Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3401704
-Reviewed-by: Andres Calderon Jaramillo <andrescj at chromium.org>
-Commit-Queue: Steinar H Gunderson <sesse at chromium.org>
-Auto-Submit: Steinar H Gunderson <sesse at chromium.org>
-Cr-Commit-Position: refs/heads/main@{#963119}
----
- AUTHORS | 1 +
- media/gpu/chromeos/BUILD.gn | 1 +
- media/gpu/chromeos/video_decoder_pipeline.cc | 2 +-
- 3 files changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/AUTHORS b/AUTHORS
-index 0eba3de5065..50edd3f6b38 100644
---- a/AUTHORS
-+++ b/AUTHORS
-@@ -93,6 +93,7 @@ Andreas Papacharalampous <andreas at apap04.com>
- Andrei Borza <andrei.borza at gmail.com>
- Andrei Parvu <andrei.prv at gmail.com>
- Andrei Parvu <parvu at adobe.com>
-+Andres Salomon <dilinger at queued.net>
- Andreu Botella <andreu at andreubotella.com>
- Andrew Boyarshin <andrew.boyarshin at gmail.com>
- Andrew Brampton <me at bramp.net>
-diff --git a/media/gpu/chromeos/BUILD.gn b/media/gpu/chromeos/BUILD.gn
-index 7cb4c3ea39a..6fe21c15ecc 100644
---- a/media/gpu/chromeos/BUILD.gn
-+++ b/media/gpu/chromeos/BUILD.gn
-@@ -25,6 +25,7 @@ source_set("chromeos") {
-
- deps = [
- "//base",
-+ "//build/config/linux/libdrm",
- "//media",
- "//media/gpu:buildflags",
- "//media/gpu:command_buffer_helper",
-diff --git a/media/gpu/chromeos/video_decoder_pipeline.cc b/media/gpu/chromeos/video_decoder_pipeline.cc
-index d2f154ea0d8..416b9434a8d 100644
---- a/media/gpu/chromeos/video_decoder_pipeline.cc
-+++ b/media/gpu/chromeos/video_decoder_pipeline.cc
-@@ -28,8 +28,8 @@
- #include "third_party/abseil-cpp/absl/types/optional.h"
-
- #if BUILDFLAG(USE_VAAPI)
-+#include <drm_fourcc.h>
- #include "media/gpu/vaapi/vaapi_video_decoder.h"
--#include "third_party/libdrm/src/include/drm/drm_fourcc.h"
- #elif BUILDFLAG(USE_V4L2_CODEC)
- #include "media/gpu/v4l2/v4l2_video_decoder.h"
- #else
Copied: chromium/repos/extra-x86_64/fix-build-break-with-system-libdrm.patch (from rev 437354, chromium/trunk/fix-build-break-with-system-libdrm.patch)
===================================================================
--- fix-build-break-with-system-libdrm.patch (rev 0)
+++ fix-build-break-with-system-libdrm.patch 2022-02-15 11:08:48 UTC (rev 437355)
@@ -0,0 +1,62 @@
+From 5b287e0be8d8d8475ec6ef81b16eaa61e19db078 Mon Sep 17 00:00:00 2001
+From: "Steinar H. Gunderson" <sesse at chromium.org>
+Date: Tue, 25 Jan 2022 19:14:53 +0000
+Subject: [PATCH] Fix build break with system libdrm.
+
+This patch is submitted on behalf of Andres Salomon
+<dilinger at queued.net> (on Cc). Also adding him to src/AUTHORS
+per policy, as he has signed the CLA.
+
+Original patch:
+https://salsa.debian.org/dilinger/chromium/-/commit/2333c2fb985ac1ef3d7331776a7833d965c63302
+
+Change-Id: I18bd60e2e80f2b9181e74ee7972c3f457ab33b10
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3401704
+Reviewed-by: Andres Calderon Jaramillo <andrescj at chromium.org>
+Commit-Queue: Steinar H Gunderson <sesse at chromium.org>
+Auto-Submit: Steinar H Gunderson <sesse at chromium.org>
+Cr-Commit-Position: refs/heads/main@{#963119}
+---
+ AUTHORS | 1 +
+ media/gpu/chromeos/BUILD.gn | 1 +
+ media/gpu/chromeos/video_decoder_pipeline.cc | 2 +-
+ 3 files changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/AUTHORS b/AUTHORS
+index 0eba3de5065..50edd3f6b38 100644
+--- a/AUTHORS
++++ b/AUTHORS
+@@ -93,6 +93,7 @@ Andreas Papacharalampous <andreas at apap04.com>
+ Andrei Borza <andrei.borza at gmail.com>
+ Andrei Parvu <andrei.prv at gmail.com>
+ Andrei Parvu <parvu at adobe.com>
++Andres Salomon <dilinger at queued.net>
+ Andreu Botella <andreu at andreubotella.com>
+ Andrew Boyarshin <andrew.boyarshin at gmail.com>
+ Andrew Brampton <me at bramp.net>
+diff --git a/media/gpu/chromeos/BUILD.gn b/media/gpu/chromeos/BUILD.gn
+index 7cb4c3ea39a..6fe21c15ecc 100644
+--- a/media/gpu/chromeos/BUILD.gn
++++ b/media/gpu/chromeos/BUILD.gn
+@@ -25,6 +25,7 @@ source_set("chromeos") {
+
+ deps = [
+ "//base",
++ "//build/config/linux/libdrm",
+ "//media",
+ "//media/gpu:buildflags",
+ "//media/gpu:command_buffer_helper",
+diff --git a/media/gpu/chromeos/video_decoder_pipeline.cc b/media/gpu/chromeos/video_decoder_pipeline.cc
+index d2f154ea0d8..416b9434a8d 100644
+--- a/media/gpu/chromeos/video_decoder_pipeline.cc
++++ b/media/gpu/chromeos/video_decoder_pipeline.cc
+@@ -28,8 +28,8 @@
+ #include "third_party/abseil-cpp/absl/types/optional.h"
+
+ #if BUILDFLAG(USE_VAAPI)
++#include <drm_fourcc.h>
+ #include "media/gpu/vaapi/vaapi_video_decoder.h"
+-#include "third_party/libdrm/src/include/drm/drm_fourcc.h"
+ #elif BUILDFLAG(USE_V4L2_CODEC)
+ #include "media/gpu/v4l2/v4l2_video_decoder.h"
+ #else
Copied: chromium/repos/extra-x86_64/sandbox-build-if-glibc-2.34-dynamic-stack-size-is-en.patch (from rev 437354, chromium/trunk/sandbox-build-if-glibc-2.34-dynamic-stack-size-is-en.patch)
===================================================================
--- sandbox-build-if-glibc-2.34-dynamic-stack-size-is-en.patch (rev 0)
+++ sandbox-build-if-glibc-2.34-dynamic-stack-size-is-en.patch 2022-02-15 11:08:48 UTC (rev 437355)
@@ -0,0 +1,39 @@
+From 28ac6a15411d01301e171b8a8b0019abd57589b9 Mon Sep 17 00:00:00 2001
+From: Stephan Hartmann <stha09 at googlemail.com>
+Date: Mon, 7 Feb 2022 20:09:57 +0000
+Subject: [PATCH] sandbox: build if glibc 2.34+ dynamic stack size is enabled
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Compilation of sandbox fails when using dynamic stack size in glibc
+2.34 or newer. This is because the value is not a literal anymore but
+obtained through sysconf.
+
+To avoid this, use memset to put zeros in the buffer.
+
+Change-Id: Ia479e0f799b77a10a00197aaaa0500e62546f458
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3436947
+Reviewed-by: Jorge Lucangeli Obes <jorgelo at chromium.org>
+Commit-Queue: José Dapena Paz <jdapena at igalia.com>
+Cr-Commit-Position: refs/heads/main@{#967943}
+---
+ sandbox/linux/services/credentials.cc | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/sandbox/linux/services/credentials.cc b/sandbox/linux/services/credentials.cc
+index ca6b5954798..c933eafd163 100644
+--- a/sandbox/linux/services/credentials.cc
++++ b/sandbox/linux/services/credentials.cc
+@@ -100,7 +100,10 @@ bool ChrootToSafeEmptyDir() {
+ // TODO(crbug.com/1247458) Broken in MSan builds after LLVM f1bb30a4956f.
+ clone_flags |= CLONE_VM | CLONE_VFORK | CLONE_SETTLS;
+
+- char tls_buf[PTHREAD_STACK_MIN] = {0};
++ // PTHREAD_STACK_MIN can be dynamic in glibc2.34+, so it is not possible to
++ // zeroify tls_buf assigning { 0 }
++ char tls_buf[PTHREAD_STACK_MIN];
++ memset(tls_buf, 0, PTHREAD_STACK_MIN);
+ tls = tls_buf;
+ #endif
+
Deleted: sql-make-VirtualCursor-standard-layout-type.patch
===================================================================
--- sql-make-VirtualCursor-standard-layout-type.patch 2022-02-15 11:04:35 UTC (rev 437354)
+++ sql-make-VirtualCursor-standard-layout-type.patch 2022-02-15 11:08:48 UTC (rev 437355)
@@ -1,238 +0,0 @@
-From 144479ad7b4287bee4067f95e4218f614798a865 Mon Sep 17 00:00:00 2001
-From: Stephan Hartmann <stha09 at googlemail.com>
-Date: Sun, 16 Jan 2022 19:15:26 +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.
-
-Bug: 1189788
-Change-Id: Ia6dc388cc5ef1c0f2afc75f8ca45b9f12687ca9c
----
- sql/recover_module/btree.cc | 18 ++++++++++++------
- sql/recover_module/btree.h | 21 +++++++++++++++------
- sql/recover_module/cursor.cc | 24 ++++++++++++------------
- sql/recover_module/cursor.h | 2 +-
- sql/recover_module/pager.cc | 5 ++---
- sql/recover_module/pager.h | 6 +++---
- 6 files changed, 45 insertions(+), 31 deletions(-)
-
-diff --git a/sql/recover_module/btree.cc b/sql/recover_module/btree.cc
-index cc9420e5c05..f12d8fa32a2 100644
---- a/sql/recover_module/btree.cc
-+++ b/sql/recover_module/btree.cc
-@@ -136,16 +136,22 @@ 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) {
-+LeafPageDecoder::LeafPageDecoder() noexcept = default;
-+
-+void LeafPageDecoder::Initialize(DatabasePageReader* 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(IsOnValidPage(db_reader));
- DCHECK(DatabasePageReader::IsValidPageId(page_id_));
- }
-
-+void LeafPageDecoder::Reset() {
-+ db_reader_ = nullptr;
-+}
-+
- 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 eaa087a5c52..df0e0c937c0 100644
---- a/sql/recover_module/btree.h
-+++ b/sql/recover_module/btree.h
-@@ -101,9 +101,7 @@ class LeafPageDecoder {
- public:
- // Creates a decoder for a DatabasePageReader's last read page.
- //
-- // |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;
-+ LeafPageDecoder() noexcept;
- ~LeafPageDecoder() noexcept = default;
-
- LeafPageDecoder(const LeafPageDecoder&) = delete;
-@@ -151,6 +149,17 @@ class LeafPageDecoder {
- // read as long as CanAdvance() returns true.
- bool TryAdvance();
-
-+ // Initialize with DatabasePageReader
-+ // |db_reader| must have been used to read an inner page of a table B-tree.
-+ // |db_reader| must outlive this instance.
-+ 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.
-@@ -164,14 +173,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 4f827edf1b4..240de4999fe 100644
---- a/sql/recover_module/cursor.cc
-+++ b/sql/recover_module/cursor.cc
-@@ -28,7 +28,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();
-@@ -38,18 +38,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())
-@@ -101,13 +101,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";
-
-@@ -115,7 +115,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 845b7852648..cc4e85f83f9 100644
---- a/sql/recover_module/cursor.h
-+++ b/sql/recover_module/cursor.h
-@@ -130,7 +130,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 58e75de2704..69d98cef98d 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->page_size()), table_(table) {
- DCHECK(table != nullptr);
- DCHECK(IsValidPageSize(table->page_size()));
- }
-@@ -58,7 +57,7 @@ int DatabasePageReader::ReadPage(int page_id) {
- "The |read_offset| computation above may overflow");
-
- int sqlite_status =
-- RawRead(sqlite_file, read_size, read_offset, page_data_.get());
-+ RawRead(sqlite_file, read_size, read_offset, 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 07cac3cb989..d08f0932fab 100644
---- a/sql/recover_module/pager.h
-+++ b/sql/recover_module/pager.h
-@@ -6,8 +6,8 @@
- #define SQL_RECOVER_MODULE_PAGER_H_
-
- #include <cstdint>
--#include <memory>
- #include <ostream>
-+#include <vector>
-
- #include "base/check_op.h"
- #include "base/memory/raw_ptr.h"
-@@ -72,7 +72,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.
-@@ -139,7 +139,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_;
-+ std::vector<uint8_t> page_data_;
- // Raw pointer usage is acceptable because this instance's owner is expected
- // to ensure that the VirtualTable outlives this.
- const raw_ptr<VirtualTable> table_;
Copied: chromium/repos/extra-x86_64/sql-make-VirtualCursor-standard-layout-type.patch (from rev 437354, chromium/trunk/sql-make-VirtualCursor-standard-layout-type.patch)
===================================================================
--- sql-make-VirtualCursor-standard-layout-type.patch (rev 0)
+++ sql-make-VirtualCursor-standard-layout-type.patch 2022-02-15 11:08:48 UTC (rev 437355)
@@ -0,0 +1,238 @@
+From 144479ad7b4287bee4067f95e4218f614798a865 Mon Sep 17 00:00:00 2001
+From: Stephan Hartmann <stha09 at googlemail.com>
+Date: Sun, 16 Jan 2022 19:15:26 +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.
+
+Bug: 1189788
+Change-Id: Ia6dc388cc5ef1c0f2afc75f8ca45b9f12687ca9c
+---
+ sql/recover_module/btree.cc | 18 ++++++++++++------
+ sql/recover_module/btree.h | 21 +++++++++++++++------
+ sql/recover_module/cursor.cc | 24 ++++++++++++------------
+ sql/recover_module/cursor.h | 2 +-
+ sql/recover_module/pager.cc | 5 ++---
+ sql/recover_module/pager.h | 6 +++---
+ 6 files changed, 45 insertions(+), 31 deletions(-)
+
+diff --git a/sql/recover_module/btree.cc b/sql/recover_module/btree.cc
+index cc9420e5c05..f12d8fa32a2 100644
+--- a/sql/recover_module/btree.cc
++++ b/sql/recover_module/btree.cc
+@@ -136,16 +136,22 @@ 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) {
++LeafPageDecoder::LeafPageDecoder() noexcept = default;
++
++void LeafPageDecoder::Initialize(DatabasePageReader* 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(IsOnValidPage(db_reader));
+ DCHECK(DatabasePageReader::IsValidPageId(page_id_));
+ }
+
++void LeafPageDecoder::Reset() {
++ db_reader_ = nullptr;
++}
++
+ 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 eaa087a5c52..df0e0c937c0 100644
+--- a/sql/recover_module/btree.h
++++ b/sql/recover_module/btree.h
+@@ -101,9 +101,7 @@ class LeafPageDecoder {
+ public:
+ // Creates a decoder for a DatabasePageReader's last read page.
+ //
+- // |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;
++ LeafPageDecoder() noexcept;
+ ~LeafPageDecoder() noexcept = default;
+
+ LeafPageDecoder(const LeafPageDecoder&) = delete;
+@@ -151,6 +149,17 @@ class LeafPageDecoder {
+ // read as long as CanAdvance() returns true.
+ bool TryAdvance();
+
++ // Initialize with DatabasePageReader
++ // |db_reader| must have been used to read an inner page of a table B-tree.
++ // |db_reader| must outlive this instance.
++ 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.
+@@ -164,14 +173,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 4f827edf1b4..240de4999fe 100644
+--- a/sql/recover_module/cursor.cc
++++ b/sql/recover_module/cursor.cc
+@@ -28,7 +28,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();
+@@ -38,18 +38,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())
+@@ -101,13 +101,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";
+
+@@ -115,7 +115,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 845b7852648..cc4e85f83f9 100644
+--- a/sql/recover_module/cursor.h
++++ b/sql/recover_module/cursor.h
+@@ -130,7 +130,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 58e75de2704..69d98cef98d 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->page_size()), table_(table) {
+ DCHECK(table != nullptr);
+ DCHECK(IsValidPageSize(table->page_size()));
+ }
+@@ -58,7 +57,7 @@ int DatabasePageReader::ReadPage(int page_id) {
+ "The |read_offset| computation above may overflow");
+
+ int sqlite_status =
+- RawRead(sqlite_file, read_size, read_offset, page_data_.get());
++ RawRead(sqlite_file, read_size, read_offset, 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 07cac3cb989..d08f0932fab 100644
+--- a/sql/recover_module/pager.h
++++ b/sql/recover_module/pager.h
+@@ -6,8 +6,8 @@
+ #define SQL_RECOVER_MODULE_PAGER_H_
+
+ #include <cstdint>
+-#include <memory>
+ #include <ostream>
++#include <vector>
+
+ #include "base/check_op.h"
+ #include "base/memory/raw_ptr.h"
+@@ -72,7 +72,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.
+@@ -139,7 +139,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_;
++ std::vector<uint8_t> page_data_;
+ // Raw pointer usage is acceptable because this instance's owner is expected
+ // to ensure that the VirtualTable outlives this.
+ const raw_ptr<VirtualTable> table_;
Deleted: unbundle-ffmpeg-av_stream_get_first_dts.patch
===================================================================
--- unbundle-ffmpeg-av_stream_get_first_dts.patch 2022-02-15 11:04:35 UTC (rev 437354)
+++ unbundle-ffmpeg-av_stream_get_first_dts.patch 2022-02-15 11:08:48 UTC (rev 437355)
@@ -1,12 +0,0 @@
-diff --git a/build/linux/unbundle/ffmpeg.gn b/build/linux/unbundle/ffmpeg.gn
-index 16e20744706..6a079b32221 100644
---- a/build/linux/unbundle/ffmpeg.gn
-+++ b/build/linux/unbundle/ffmpeg.gn
-@@ -12,6 +12,7 @@ pkg_config("system_ffmpeg") {
- "libavformat",
- "libavutil",
- ]
-+ defines = [ "av_stream_get_first_dts(stream)=stream->first_dts" ]
- }
-
- buildflag_header("ffmpeg_features") {
Copied: chromium/repos/extra-x86_64/unbundle-ffmpeg-av_stream_get_first_dts.patch (from rev 437354, chromium/trunk/unbundle-ffmpeg-av_stream_get_first_dts.patch)
===================================================================
--- unbundle-ffmpeg-av_stream_get_first_dts.patch (rev 0)
+++ unbundle-ffmpeg-av_stream_get_first_dts.patch 2022-02-15 11:08:48 UTC (rev 437355)
@@ -0,0 +1,12 @@
+diff --git a/build/linux/unbundle/ffmpeg.gn b/build/linux/unbundle/ffmpeg.gn
+index 16e20744706..6a079b32221 100644
+--- a/build/linux/unbundle/ffmpeg.gn
++++ b/build/linux/unbundle/ffmpeg.gn
+@@ -12,6 +12,7 @@ pkg_config("system_ffmpeg") {
+ "libavformat",
+ "libavutil",
+ ]
++ defines = [ "av_stream_get_first_dts(stream)=stream->first_dts" ]
+ }
+
+ buildflag_header("ffmpeg_features") {
Deleted: use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch
===================================================================
--- use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch 2022-02-15 11:04:35 UTC (rev 437354)
+++ use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch 2022-02-15 11:08:48 UTC (rev 437355)
@@ -1,72 +0,0 @@
-From cb0aad687f34629a42053d600cf2947282cea2c0 Mon Sep 17 00:00:00 2001
-From: Lei Zhang <thestig at chromium.org>
-Date: Mon, 31 Jan 2022 22:42:35 +0000
-Subject: [PATCH] Use FT_Done_MM_Var() in CFX_Font::AdjustMMParams() when
- possible.
-
-When FreeType has FT_Done_MM_Var(), use that to free memory in
-CFX_Font::AdjustMMParams() to avoid mismatched alloc/free functions.
-
-Bug: pdfium:1400
-Change-Id: I044540893103921fc64cdd53fcd628cfebf2c9db
-Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/90130
-Reviewed-by: Nigi <nigi at chromium.org>
-Commit-Queue: Lei Zhang <thestig at chromium.org>
-
-(cherry picked from commit ffeb67faf715475f6e463d65c368f556780adf19)
----
- core/fxge/cfx_font.cpp | 28 ++++++++++++++++++++++++++--
- 1 file changed, 26 insertions(+), 2 deletions(-)
-
-diff --git a/core/fxge/cfx_font.cpp b/core/fxge/cfx_font.cpp
-index 7a4e8eb24..0ef421fe7 100644
---- a/core/fxge/cfx_font.cpp
-+++ b/core/fxge/cfx_font.cpp
-@@ -43,6 +43,30 @@ struct OUTLINE_PARAMS {
- float m_CoordUnit;
- };
-
-+// TODO(crbug.com/pdfium/1400): When FT_Done_MM_Var() is more likely to be
-+// available to all users in the future, remove FreeMMVar() and use
-+// FT_Done_MM_Var() directly.
-+//
-+// Use weak symbols to check if FT_Done_MM_Var() is available at runtime.
-+#if !defined(OS_WIN)
-+extern "C" __attribute__((weak)) decltype(FT_Done_MM_Var) FT_Done_MM_Var;
-+#endif
-+
-+void FreeMMVar(FXFT_FaceRec* rec, FXFT_MM_VarPtr variation_desc) {
-+#if defined(OS_WIN)
-+ // Assume `use_system_freetype` GN var is never set on Windows.
-+ constexpr bool has_ft_done_mm_var_func = true;
-+#else
-+ static const bool has_ft_done_mm_var_func = !!FT_Done_MM_Var;
-+#endif
-+ if (has_ft_done_mm_var_func) {
-+ FT_Done_MM_Var(CFX_GEModule::Get()->GetFontMgr()->GetFTLibrary(),
-+ variation_desc);
-+ } else {
-+ FXFT_Free(rec, variation_desc);
-+ }
-+}
-+
- #ifdef PDF_ENABLE_XFA
- unsigned long FTStreamRead(FXFT_StreamRec* stream,
- unsigned long offset,
-@@ -640,14 +664,14 @@ void CFX_Font::AdjustMMParams(int glyph_index,
- int max_width = FXFT_Get_Glyph_HoriAdvance(m_Face->GetRec()) * 1000 /
- FXFT_Get_Face_UnitsPerEM(m_Face->GetRec());
- if (max_width == min_width) {
-- FXFT_Free(m_Face->GetRec(), pMasters);
-+ FreeMMVar(m_Face->GetRec(), pMasters);
- return;
- }
- int param = min_param + (max_param - min_param) * (dest_width - min_width) /
- (max_width - min_width);
- coords[1] = param;
- }
-- FXFT_Free(m_Face->GetRec(), pMasters);
-+ FreeMMVar(m_Face->GetRec(), pMasters);
- FT_Set_MM_Design_Coordinates(m_Face->GetRec(), 2, coords);
- }
-
Copied: chromium/repos/extra-x86_64/use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch (from rev 437354, chromium/trunk/use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch)
===================================================================
--- use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch (rev 0)
+++ use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch 2022-02-15 11:08:48 UTC (rev 437355)
@@ -0,0 +1,72 @@
+From cb0aad687f34629a42053d600cf2947282cea2c0 Mon Sep 17 00:00:00 2001
+From: Lei Zhang <thestig at chromium.org>
+Date: Mon, 31 Jan 2022 22:42:35 +0000
+Subject: [PATCH] Use FT_Done_MM_Var() in CFX_Font::AdjustMMParams() when
+ possible.
+
+When FreeType has FT_Done_MM_Var(), use that to free memory in
+CFX_Font::AdjustMMParams() to avoid mismatched alloc/free functions.
+
+Bug: pdfium:1400
+Change-Id: I044540893103921fc64cdd53fcd628cfebf2c9db
+Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/90130
+Reviewed-by: Nigi <nigi at chromium.org>
+Commit-Queue: Lei Zhang <thestig at chromium.org>
+
+(cherry picked from commit ffeb67faf715475f6e463d65c368f556780adf19)
+---
+ core/fxge/cfx_font.cpp | 28 ++++++++++++++++++++++++++--
+ 1 file changed, 26 insertions(+), 2 deletions(-)
+
+diff --git a/core/fxge/cfx_font.cpp b/core/fxge/cfx_font.cpp
+index 7a4e8eb24..0ef421fe7 100644
+--- a/core/fxge/cfx_font.cpp
++++ b/core/fxge/cfx_font.cpp
+@@ -43,6 +43,30 @@ struct OUTLINE_PARAMS {
+ float m_CoordUnit;
+ };
+
++// TODO(crbug.com/pdfium/1400): When FT_Done_MM_Var() is more likely to be
++// available to all users in the future, remove FreeMMVar() and use
++// FT_Done_MM_Var() directly.
++//
++// Use weak symbols to check if FT_Done_MM_Var() is available at runtime.
++#if !defined(OS_WIN)
++extern "C" __attribute__((weak)) decltype(FT_Done_MM_Var) FT_Done_MM_Var;
++#endif
++
++void FreeMMVar(FXFT_FaceRec* rec, FXFT_MM_VarPtr variation_desc) {
++#if defined(OS_WIN)
++ // Assume `use_system_freetype` GN var is never set on Windows.
++ constexpr bool has_ft_done_mm_var_func = true;
++#else
++ static const bool has_ft_done_mm_var_func = !!FT_Done_MM_Var;
++#endif
++ if (has_ft_done_mm_var_func) {
++ FT_Done_MM_Var(CFX_GEModule::Get()->GetFontMgr()->GetFTLibrary(),
++ variation_desc);
++ } else {
++ FXFT_Free(rec, variation_desc);
++ }
++}
++
+ #ifdef PDF_ENABLE_XFA
+ unsigned long FTStreamRead(FXFT_StreamRec* stream,
+ unsigned long offset,
+@@ -640,14 +664,14 @@ void CFX_Font::AdjustMMParams(int glyph_index,
+ int max_width = FXFT_Get_Glyph_HoriAdvance(m_Face->GetRec()) * 1000 /
+ FXFT_Get_Face_UnitsPerEM(m_Face->GetRec());
+ if (max_width == min_width) {
+- FXFT_Free(m_Face->GetRec(), pMasters);
++ FreeMMVar(m_Face->GetRec(), pMasters);
+ return;
+ }
+ int param = min_param + (max_param - min_param) * (dest_width - min_width) /
+ (max_width - min_width);
+ coords[1] = param;
+ }
+- FXFT_Free(m_Face->GetRec(), pMasters);
++ FreeMMVar(m_Face->GetRec(), pMasters);
+ FT_Set_MM_Design_Coordinates(m_Face->GetRec(), 2, coords);
+ }
+
Deleted: use-oauth2-client-switches-as-default.patch
===================================================================
--- use-oauth2-client-switches-as-default.patch 2022-02-15 11:04:35 UTC (rev 437354)
+++ use-oauth2-client-switches-as-default.patch 2022-02-15 11:08:48 UTC (rev 437355)
@@ -1,17 +0,0 @@
-diff -upr chromium-89.0.4389.58.orig/google_apis/google_api_keys.cc chromium-89.0.4389.58/google_apis/google_api_keys.cc
---- chromium-89.0.4389.58.orig/google_apis/google_api_keys.cc 2021-02-24 22:37:18.494007649 +0000
-+++ chromium-89.0.4389.58/google_apis/google_api_keys.cc 2021-02-24 22:35:00.865777600 +0000
-@@ -154,11 +154,11 @@ class APIKeyCache {
-
- std::string default_client_id = CalculateKeyValue(
- GOOGLE_DEFAULT_CLIENT_ID,
-- STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_ID), nullptr,
-+ STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_ID), ::switches::kOAuth2ClientID,
- std::string(), environment.get(), command_line, gaia_config);
- std::string default_client_secret = CalculateKeyValue(
- GOOGLE_DEFAULT_CLIENT_SECRET,
-- STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_SECRET), nullptr,
-+ STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_SECRET), ::switches::kOAuth2ClientSecret,
- std::string(), environment.get(), command_line, gaia_config);
-
- // We currently only allow overriding the baked-in values for the
Copied: chromium/repos/extra-x86_64/use-oauth2-client-switches-as-default.patch (from rev 437354, chromium/trunk/use-oauth2-client-switches-as-default.patch)
===================================================================
--- use-oauth2-client-switches-as-default.patch (rev 0)
+++ use-oauth2-client-switches-as-default.patch 2022-02-15 11:08:48 UTC (rev 437355)
@@ -0,0 +1,17 @@
+diff -upr chromium-89.0.4389.58.orig/google_apis/google_api_keys.cc chromium-89.0.4389.58/google_apis/google_api_keys.cc
+--- chromium-89.0.4389.58.orig/google_apis/google_api_keys.cc 2021-02-24 22:37:18.494007649 +0000
++++ chromium-89.0.4389.58/google_apis/google_api_keys.cc 2021-02-24 22:35:00.865777600 +0000
+@@ -154,11 +154,11 @@ class APIKeyCache {
+
+ std::string default_client_id = CalculateKeyValue(
+ GOOGLE_DEFAULT_CLIENT_ID,
+- STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_ID), nullptr,
++ STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_ID), ::switches::kOAuth2ClientID,
+ std::string(), environment.get(), command_line, gaia_config);
+ std::string default_client_secret = CalculateKeyValue(
+ GOOGLE_DEFAULT_CLIENT_SECRET,
+- STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_SECRET), nullptr,
++ STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_SECRET), ::switches::kOAuth2ClientSecret,
+ std::string(), environment.get(), command_line, gaia_config);
+
+ // We currently only allow overriding the baked-in values for the
More information about the arch-commits
mailing list