extra/chromium to 106.0.5249.61-1

This commit is contained in:
Kevin Mihelich 2022-09-27 23:45:56 +00:00
parent 7693a707c6
commit a41c685190
10 changed files with 122 additions and 502 deletions

View file

@ -1,4 +1,4 @@
From cf677b5c83f06a2c43e414c730396bb9b948fa9e Mon Sep 17 00:00:00 2001 From 3311ca967f715a5db12affdcd06e5cf90e6afaeb Mon Sep 17 00:00:00 2001
From: Kevin Mihelich <kevin@archlinuxarm.org> From: Kevin Mihelich <kevin@archlinuxarm.org>
Date: Thu, 18 Feb 2021 19:35:58 -0700 Date: Thu, 18 Feb 2021 19:35:58 -0700
Subject: [PATCH 1/3] widevine support for arm Subject: [PATCH 1/3] widevine support for arm
@ -21,5 +21,5 @@ index 4933cf6cdd2d5..37db4965c5b4c 100644
(target_os == "win" && (target_os == "win" &&
(target_cpu == "x86" || target_cpu == "x64" || target_cpu == "arm64")) (target_cpu == "x86" || target_cpu == "x64" || target_cpu == "arm64"))
-- --
2.37.0 2.37.3

View file

@ -1,4 +1,4 @@
From 3fe56be59d35a8394d00431b0ea8cc46b193ffcd Mon Sep 17 00:00:00 2001 From 12647123677280381e88451287fefdbafde994d0 Mon Sep 17 00:00:00 2001
From: Kevin Mihelich <kevin@archlinuxarm.org> From: Kevin Mihelich <kevin@archlinuxarm.org>
Date: Tue, 2 Feb 2021 13:58:59 -0700 Date: Tue, 2 Feb 2021 13:58:59 -0700
Subject: [PATCH 2/3] Run blink bindings generation single threaded Subject: [PATCH 2/3] Run blink bindings generation single threaded
@ -9,7 +9,7 @@ When not single threaded this process will eat all the RAM.
1 file changed, 1 insertion(+) 1 file changed, 1 insertion(+)
diff --git a/third_party/blink/renderer/bindings/BUILD.gn b/third_party/blink/renderer/bindings/BUILD.gn diff --git a/third_party/blink/renderer/bindings/BUILD.gn b/third_party/blink/renderer/bindings/BUILD.gn
index 354e106e46b77..d7ca31f2e1ace 100644 index c468bf2c8fa43..b135cb435a2e1 100644
--- a/third_party/blink/renderer/bindings/BUILD.gn --- a/third_party/blink/renderer/bindings/BUILD.gn
+++ b/third_party/blink/renderer/bindings/BUILD.gn +++ b/third_party/blink/renderer/bindings/BUILD.gn
@@ -148,6 +148,7 @@ template("generate_bindings") { @@ -148,6 +148,7 @@ template("generate_bindings") {
@ -21,5 +21,5 @@ index 354e106e46b77..d7ca31f2e1ace 100644
rebase_path(web_idl_database, root_build_dir), rebase_path(web_idl_database, root_build_dir),
"--root_src_dir", "--root_src_dir",
-- --
2.37.0 2.37.3

View file

@ -1,4 +1,4 @@
From 94e4009ec6278f0cd9f926d9b9c012ecb9d7c2c9 Mon Sep 17 00:00:00 2001 From e06264f0e37e789ffd120eed9add04f8e28b843c Mon Sep 17 00:00:00 2001
From: Kevin Mihelich <kevin@archlinuxarm.org> From: Kevin Mihelich <kevin@archlinuxarm.org>
Date: Wed, 21 Jul 2021 21:37:31 -0600 Date: Wed, 21 Jul 2021 21:37:31 -0600
Subject: [PATCH 3/3] Fix eu-strip build for newer GCC Subject: [PATCH 3/3] Fix eu-strip build for newer GCC
@ -693,5 +693,5 @@ index 86f2b67f6bbd1..c073e9a15827a 100755
cd build cd build
../configure --enable-maintainer-mode ../configure --enable-maintainer-mode
-- --
2.37.0 2.37.3

View file

@ -15,10 +15,10 @@
highmem=1 highmem=1
pkgname=chromium pkgname=chromium
pkgver=105.0.5195.125 pkgver=106.0.5249.61
pkgrel=3 pkgrel=1
_launcher_ver=8 _launcher_ver=8
_gcc_patchset=1 _gcc_patchset=2
pkgdesc="A web browser built for speed, simplicity, and security" pkgdesc="A web browser built for speed, simplicity, and security"
arch=('x86_64') arch=('x86_64')
url="https://www.chromium.org/Home" url="https://www.chromium.org/Home"
@ -36,27 +36,27 @@ options=('!lto') # Chromium adds its own flags for ThinLTO
source=(https://commondatastorage.googleapis.com/chromium-browser-official/chromium-$pkgver.tar.xz source=(https://commondatastorage.googleapis.com/chromium-browser-official/chromium-$pkgver.tar.xz
https://github.com/foutrelis/chromium-launcher/archive/v$_launcher_ver/chromium-launcher-$_launcher_ver.tar.gz 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 https://github.com/stha09/chromium-patches/releases/download/chromium-${pkgver%%.*}-patchset-$_gcc_patchset/chromium-${pkgver%%.*}-patchset-$_gcc_patchset.tar.xz
fix-TFLite-build-on-linux-with-system-zlib.patch unbundle-jsoncpp-avoid-CFI-faults-with-is_cfi-true.patch
fix-debug-crash-and-log-spam-with-GTK3-Wayland.patch REVERT-enable-GlobalMediaControlsCastStartStop.patch
enable-GlobalMediaControlsCastStartStop.patch REVERT-roll-src-third_party-ffmpeg-m102.patch
roll-src-third_party-ffmpeg.patch REVERT-roll-src-third_party-ffmpeg-m106.patch
angle-wayland-include-protocol.patch angle-wayland-include-protocol.patch
use-oauth2-client-switches-as-default.patch use-oauth2-client-switches-as-default.patch
0001-widevine-support-for-arm.patch 0001-widevine-support-for-arm.patch
0002-Run-blink-bindings-generation-single-threaded.patch 0002-Run-blink-bindings-generation-single-threaded.patch
0003-Fix-eu-strip-build-for-newer-GCC.patch) 0003-Fix-eu-strip-build-for-newer-GCC.patch)
sha256sums=('201b5c44668a415e3e05c0a806ab43a0904024340531332fc3ce39eb0cf10a66' sha256sums=('f27acb929b12fc9e60b035c2f9f1879866eec7cfe1665dccf544048e9e931497'
'213e50f48b67feb4441078d50b0fd431df34323be15be97c55302d3fdac4483a' '213e50f48b67feb4441078d50b0fd431df34323be15be97c55302d3fdac4483a'
'f0c437c02cab7a6efc958f82fbb4ea35d5440f73d65731bad7c0dcaecb932121' '2ad419439379d17385b7fd99039aca875ba36ca31b591b9cd4ccef84273be121'
'5db1fae8a452774b5b177e493a2d1a435b980137b16ed74616d1fb86fe342ec7' 'b908f37c5a886e855953f69e4dd6b90baa35e79f5c74673f7425f2cdb642eb00'
'a9a30d16ad6b0689c2c4a85a3c508f49254fc8e69e791a45302673812461eb58'
'779fb13f2494209d3a7f1f23a823e59b9dded601866d3ab095937a1a04e19ac6' '779fb13f2494209d3a7f1f23a823e59b9dded601866d3ab095937a1a04e19ac6'
'30df59a9e2d95dcb720357ec4a83d9be51e59cc5551365da4c0073e68ccdec44' '30df59a9e2d95dcb720357ec4a83d9be51e59cc5551365da4c0073e68ccdec44'
'4c12d31d020799d31355faa7d1fe2a5a807f7458e7f0c374adf55edb37032152'
'cd0d9d2a1d6a522d47c3c0891dabe4ad72eabbebc0fe5642b9e22efa3d5ee572' 'cd0d9d2a1d6a522d47c3c0891dabe4ad72eabbebc0fe5642b9e22efa3d5ee572'
'e393174d7695d0bafed69e868c5fbfecf07aa6969f3b64596d0bae8b067e1711' 'e393174d7695d0bafed69e868c5fbfecf07aa6969f3b64596d0bae8b067e1711'
'f2c5e08e05ab6a63aba6f6ba408a5ed7b692876bb85adffeea1ac9037b8cf756' '603de7189fd57df3fe9b5cd593d8a2eb50ef889c484bba9b837d0f9d59d79d3d'
'bfd9793c43ead48068c1f1021e9b43aec0105827100ed62a16424e49e9d49b70' '02eba3f1edc339558b262ab8755ce00fec26c834ea89fbb5bc89337969db9506'
'34e038012db6e4d2bd1c5352c916e003db71e5830fe6c349449e9b4832df68f9') 'bf4bcdb6ab8eba1475e87a5f50cc9f696bedb812a320a9545f2aed1965b26be9')
# Possible replacements are listed in build/linux/unbundle/replace_gn_files.py # 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 # Keys are the names in the above script; values are the dependencies in Arch
@ -69,9 +69,9 @@ declare -gA _system_libs=(
[freetype]=freetype2 [freetype]=freetype2
[harfbuzz-ng]=harfbuzz [harfbuzz-ng]=harfbuzz
[icu]=icu [icu]=icu
#[jsoncpp]=jsoncpp # triggers a CFI violation (https://crbug.com/1365218) [jsoncpp]=jsoncpp
[libaom]=aom [libaom]=aom
[libavif]=libavif #[libavif]=libavif # needs https://github.com/AOMediaCodec/libavif/commit/d22d4de94120
[libdrm]= [libdrm]=
[libjpeg]=libjpeg [libjpeg]=libjpeg
[libpng]=libpng [libpng]=libpng
@ -132,25 +132,24 @@ prepare() {
patch -Np1 -i ../use-oauth2-client-switches-as-default.patch patch -Np1 -i ../use-oauth2-client-switches-as-default.patch
# Upstream fixes # Upstream fixes
patch -Np1 -i ../fix-TFLite-build-on-linux-with-system-zlib.patch patch -Np1 -i ../unbundle-jsoncpp-avoid-CFI-faults-with-is_cfi-true.patch
patch -Np1 -i ../fix-debug-crash-and-log-spam-with-GTK3-Wayland.patch
# Revert kGlobalMediaControlsCastStartStop enabled by default # Revert kGlobalMediaControlsCastStartStop enabled by default
# https://crbug.com/1314342 # https://crbug.com/1314342
patch -Rp1 -F3 -i ../enable-GlobalMediaControlsCastStartStop.patch patch -Rp1 -F3 -i ../REVERT-enable-GlobalMediaControlsCastStartStop.patch
# Revert ffmpeg roll requiring new channel layout API support # Revert ffmpeg roll requiring new channel layout API support
# https://crbug.com/1325301 # https://crbug.com/1325301
patch -Rp1 -i ../roll-src-third_party-ffmpeg.patch patch -Rp1 -i ../REVERT-roll-src-third_party-ffmpeg-m102.patch
# Revert switch from AVFrame::pkt_duration to AVFrame::duration
patch -Rp1 -i ../REVERT-roll-src-third_party-ffmpeg-m106.patch
# https://crbug.com/angleproject/7582 # https://crbug.com/angleproject/7582
patch -Np0 -i ../angle-wayland-include-protocol.patch patch -Np0 -i ../angle-wayland-include-protocol.patch
# Fixes for building with libstdc++ instead of libc++ # Fixes for building with libstdc++ instead of libc++
patch -Np1 -i ../patches/chromium-103-VirtualCursor-std-layout.patch patch -Np1 -i ../patches/chromium-103-VirtualCursor-std-layout.patch
patch -Np1 -i ../patches/chromium-105-Bitmap-include.patch patch -Np1 -i ../patches/chromium-106-AutofillPopupControllerImpl-namespace.patch
patch -Np1 -i ../patches/chromium-105-browser_finder-include.patch
patch -Np1 -i ../patches/chromium-105-AdjustMaskLayerGeometry-ceilf.patch
# Link to system tools required by the build # Link to system tools required by the build
mkdir -p third_party/node/linux/node-linux-x64/bin mkdir -p third_party/node/linux/node-linux-x64/bin

View file

@ -0,0 +1,55 @@
From ded379824f5de39357b6b1894578101aba5cdf05 Mon Sep 17 00:00:00 2001
From: Eugene Zemtsov <eugene@chromium.org>
Date: Fri, 29 Jul 2022 04:41:04 +0000
Subject: [PATCH] Roll src/third_party/ffmpeg/ 880df5ede..b71ecd02b (279
commits)
https://chromium.googlesource.com/chromium/third_party/ffmpeg.git/+log/880df5ede50a..b71ecd02b479
$ git log 880df5ede..b71ecd02b --date=short --no-merges --format='%ad %ae %s'
2022-07-27 eugene Roll for M106
2022-07-25 andreas.rheinhardt avcodec/x86/pngdsp: Remove obsolete ff_add_bytes_l2_mmx()
2022-07-22 andreas.rheinhardt avcodec/hevcdec: Output MD5-message in one piece
2022-07-24 epirat07 configure: properly require libx264 if enabled
2022-07-24 zane avformat/argo_cvg: expose loop/reverb/checksum via metadata
(...)
2022-05-03 leo.izen avcodec/libjxldec: properly tag output colorspace
2022-06-25 ffmpeg avfilter/Makefile: always make colorspace.o
2022-03-02 brad avutil/ppc/cpu: Use proper header for OpenBSD PPC CPU detection
2022-06-24 jamrial avformat/http: include version.h
2022-05-16 mbonda-at-nvidia.com AV1 VDPAU hwaccel Decode support
Created with:
roll-dep src/third_party/ffmpeg
ffmpeg usage fix:
Switch from AVFrame::pkt_duration to AVFrame::duration,
AVFrame::pkt_duration is deprecated
Bug: 1344646
Change-Id: Iaa3abf48ef81dae6d282bca8f0fa2a8dffeeba25
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3788638
Reviewed-by: Will Cassella <cassew@chromium.org>
Commit-Queue: Eugene Zemtsov <eugene@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1029623}
---
media/filters/audio_file_reader.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/media/filters/audio_file_reader.cc b/media/filters/audio_file_reader.cc
index e1be5aa9a5b..951c003956f 100644
--- a/media/filters/audio_file_reader.cc
+++ b/media/filters/audio_file_reader.cc
@@ -243,10 +243,10 @@ bool AudioFileReader::OnNewFrame(
// silence from being output. In the case where we are also discarding some
// portion of the packet (as indicated by a negative pts), we further want to
// adjust the duration downward by however much exists before zero.
- if (audio_codec_ == AudioCodec::kAAC && frame->pkt_duration) {
+ if (audio_codec_ == AudioCodec::kAAC && frame->duration) {
const base::TimeDelta pkt_duration = ConvertFromTimeBase(
glue_->format_context()->streams[stream_index_]->time_base,
- frame->pkt_duration + std::min(static_cast<int64_t>(0), frame->pts));
+ frame->duration + std::min(static_cast<int64_t>(0), frame->pts));
const base::TimeDelta frame_duration =
base::Seconds(frames_read / static_cast<double>(sample_rate_));

View file

@ -1,291 +0,0 @@
From ae0f9adb7e14c0d19ca695ef6ad40b321a8cb64c Mon Sep 17 00:00:00 2001
From: Andres Salomon <dilinger@queued.net>
Date: Mon, 8 Aug 2022 23:01:53 +0000
Subject: [PATCH] Fix TFLite build errors on linux when using the system zlib
The commit a3be9805c1601d3fabe1e5adb6b9199c033aa2c5 updated TFLite,
which included the new zip_*_mem_file.* files that include minizip's
ioapi.h. To support that, it also declared that tflite_support depends
on minizip (in third_party/tflite_support/BUILD.gn). However, that's not
enough, and results in a build error when building using the stub linux
zlib build scripts.
Other places that depend on minizip use a longer path to its header
files. For example, chrome/chrome_cleaner/zip_archiver/'s test_support
depends on minizip, and
chrome/chrome_cleaner/zip_archiver/target/zip_archiver_impl.cc
includes "third_party/zlib/contrib/minizip/ioapi.h".
The new tensorflow stuff should do the same, instead of just including
"contrib/minizip/ioapi.h". This patch fixes that, as well as other
places where ioapi.h or zip.h/unzip.h are included without a fuller
path.
Note: if you prefer to not modify the tflite code, let me know and I
can instead do a change that adds third_party/zlib as an include path
for minizip.
R=mcrouse@chromium.org, robertogden@chromium.org, sesse@chromium.org, thestig@chromium.org
Bug: 1348787
Change-Id: I922d18b3d1c0e459437624fd248c21afc1be6bb8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3797828
Commit-Queue: Andres Salomon <dilinger@queued.net>
Auto-Submit: Andres Salomon <dilinger@queued.net>
Reviewed-by: Michael Crouse <mcrouse@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1032774}
---
third_party/tflite_support/README.chromium | 2 +
...-errors-on-linux-when-using-the-syst.patch | 129 ++++++++++++++++++
.../metadata/cc/metadata_extractor.cc | 4 +-
.../metadata/cc/metadata_populator.cc | 4 +-
.../cc/utils/zip_readonly_mem_file.cc | 2 +-
.../metadata/cc/utils/zip_readonly_mem_file.h | 2 +-
.../cc/utils/zip_writable_mem_file.cc | 2 +-
.../metadata/cc/utils/zip_writable_mem_file.h | 2 +-
8 files changed, 139 insertions(+), 8 deletions(-)
create mode 100644 third_party/tflite_support/patches/0010-Fix-TFLite-build-errors-on-linux-when-using-the-syst.patch
diff --git a/third_party/tflite_support/README.chromium b/third_party/tflite_support/README.chromium
index cfaf220adb..91f4baf82b 100644
--- a/third_party/tflite_support/README.chromium
+++ b/third_party/tflite_support/README.chromium
@@ -36,6 +36,8 @@ is a no-op in chromium builds and upsets clang.
* This patch intentionally does not apply because it was made with
`--irreversible-delete` because it is deleting a large .tflite file causing
the chromium-presubmit bot to fail.
+10) Fix minizip path inclusion. Upstream uses contrib/minizip/, but chromium
+uses third_party/zlib/contrib/minizip/.
Update Process (internal: http://shortn/_nwz8liqimy):
1) Run these commands:
diff --git a/third_party/tflite_support/patches/0010-Fix-TFLite-build-errors-on-linux-when-using-the-syst.patch b/third_party/tflite_support/patches/0010-Fix-TFLite-build-errors-on-linux-when-using-the-syst.patch
new file mode 100644
index 0000000000..34acf277fc
--- /dev/null
+++ b/third_party/tflite_support/patches/0010-Fix-TFLite-build-errors-on-linux-when-using-the-syst.patch
@@ -0,0 +1,129 @@
+From 12da2fa8f2d779e2fc14f48de73af79e9040c141 Mon Sep 17 00:00:00 2001
+From: Andres Salomon <dilinger@queued.net>
+Date: Sun, 31 Jul 2022 19:07:24 -0400
+Subject: [PATCH] Fix TFLite build errors on linux when using the system zlib
+
+The commit a3be9805c1601d3fabe1e5adb6b9199c033aa2c5 updated TFLite,
+which included the new zip_*_mem_file.* files that include minizip's
+ioapi.h. To support that, it also declared that tflite_support depends
+on minizip (in third_party/tflite_support/BUILD.gn). However, that's not
+enough, and results in a build error when building using the stub linux
+zlib build scripts.
+
+Other places that depend on minizip use a longer path to its header
+files. For example, chrome/chrome_cleaner/zip_archiver/'s test_support
+depends on minizip, and
+chrome/chrome_cleaner/zip_archiver/target/zip_archiver_impl.cc
+includes "third_party/zlib/contrib/minizip/ioapi.h".
+
+The new tensorflow stuff should do the same, instead of just including
+"contrib/minizip/ioapi.h". This patch fixes that, as well as other
+places where ioapi.h or zip.h/unzip.h are included without a fuller
+path.
+---
+ .../tensorflow_lite_support/metadata/cc/metadata_extractor.cc | 4 ++--
+ .../tensorflow_lite_support/metadata/cc/metadata_populator.cc | 4 ++--
+ .../metadata/cc/utils/zip_readonly_mem_file.cc | 2 +-
+ .../metadata/cc/utils/zip_readonly_mem_file.h | 2 +-
+ .../metadata/cc/utils/zip_writable_mem_file.cc | 2 +-
+ .../metadata/cc/utils/zip_writable_mem_file.h | 2 +-
+ 6 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc
+index 2a72338741626..62d0910182877 100644
+--- a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc
++++ b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc
+@@ -21,14 +21,14 @@ limitations under the License.
+ #include "absl/status/status.h" // from @com_google_absl
+ #include "absl/strings/str_format.h" // from @com_google_absl
+ #include "absl/strings/string_view.h" // from @com_google_absl
+-#include "contrib/minizip/ioapi.h"
+-#include "contrib/minizip/unzip.h"
+ #include "flatbuffers/flatbuffers.h" // from @flatbuffers
+ #include "tensorflow/lite/schema/schema_generated.h"
+ #include "tensorflow_lite_support/cc/common.h"
+ #include "tensorflow_lite_support/cc/port/status_macros.h"
+ #include "tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.h"
+ #include "tensorflow_lite_support/metadata/metadata_schema_generated.h"
++#include "third_party/zlib/contrib/minizip/ioapi.h"
++#include "third_party/zlib/contrib/minizip/unzip.h"
+
+ namespace tflite {
+ namespace metadata {
+diff --git a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc
+index 299ade3e95d54..8e13fa63dafbc 100644
+--- a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc
++++ b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc
+@@ -19,8 +19,6 @@ limitations under the License.
+ #include <cstring>
+ #include <functional>
+
+-#include "contrib/minizip/ioapi.h"
+-#include "contrib/minizip/zip.h"
+ #include "flatbuffers/flatbuffers.h" // from @flatbuffers
+ #include "tensorflow/lite/schema/schema_generated.h"
+ #include "tensorflow_lite_support/cc/common.h"
+@@ -28,6 +26,8 @@ limitations under the License.
+ #include "tensorflow_lite_support/cc/port/statusor.h"
+ #include "tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h"
+ #include "tensorflow_lite_support/metadata/metadata_schema_generated.h"
++#include "third_party/zlib/contrib/minizip/ioapi.h"
++#include "third_party/zlib/contrib/minizip/zip.h"
+
+ namespace tflite {
+ namespace metadata {
+diff --git a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc
+index 392b6b411fe03..525ae4a2b45bd 100644
+--- a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc
++++ b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc
+@@ -19,7 +19,7 @@ limitations under the License.
+ #include <cstdio>
+
+ #include "absl/strings/string_view.h" // from @com_google_absl
+-#include "contrib/minizip/ioapi.h"
++#include "third_party/zlib/contrib/minizip/ioapi.h"
+
+ namespace tflite {
+ namespace metadata {
+diff --git a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.h b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.h
+index a1799ff509de5..72413a0a56252 100644
+--- a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.h
++++ b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.h
+@@ -19,7 +19,7 @@ limitations under the License.
+ #include <cstdlib>
+
+ #include "absl/strings/string_view.h" // from @com_google_absl
+-#include "contrib/minizip/ioapi.h"
++#include "third_party/zlib/contrib/minizip/ioapi.h"
+
+ namespace tflite {
+ namespace metadata {
+diff --git a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc
+index 38ad17ad8935c..3ba91b5e22890 100644
+--- a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc
++++ b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc
+@@ -19,7 +19,7 @@ limitations under the License.
+ #include <cstdio>
+
+ #include "absl/strings/string_view.h" // from @com_google_absl
+-#include "contrib/minizip/ioapi.h"
++#include "third_party/zlib/contrib/minizip/ioapi.h"
+
+ namespace tflite {
+ namespace metadata {
+diff --git a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h
+index 30e42fdb72a31..3d329925df756 100644
+--- a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h
++++ b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h
+@@ -19,7 +19,7 @@ limitations under the License.
+ #include <cstdlib>
+
+ #include "absl/strings/string_view.h" // from @com_google_absl
+-#include "contrib/minizip/ioapi.h"
++#include "third_party/zlib/contrib/minizip/ioapi.h"
+
+ namespace tflite {
+ namespace metadata {
+--
+2.30.2
+
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc
index 2a72338741..62d0910182 100644
--- a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc
+++ b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc
@@ -21,14 +21,14 @@ limitations under the License.
#include "absl/status/status.h" // from @com_google_absl
#include "absl/strings/str_format.h" // from @com_google_absl
#include "absl/strings/string_view.h" // from @com_google_absl
-#include "contrib/minizip/ioapi.h"
-#include "contrib/minizip/unzip.h"
#include "flatbuffers/flatbuffers.h" // from @flatbuffers
#include "tensorflow/lite/schema/schema_generated.h"
#include "tensorflow_lite_support/cc/common.h"
#include "tensorflow_lite_support/cc/port/status_macros.h"
#include "tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.h"
#include "tensorflow_lite_support/metadata/metadata_schema_generated.h"
+#include "third_party/zlib/contrib/minizip/ioapi.h"
+#include "third_party/zlib/contrib/minizip/unzip.h"
namespace tflite {
namespace metadata {
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc
index 299ade3e95..8e13fa63da 100644
--- a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc
+++ b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc
@@ -19,8 +19,6 @@ limitations under the License.
#include <cstring>
#include <functional>
-#include "contrib/minizip/ioapi.h"
-#include "contrib/minizip/zip.h"
#include "flatbuffers/flatbuffers.h" // from @flatbuffers
#include "tensorflow/lite/schema/schema_generated.h"
#include "tensorflow_lite_support/cc/common.h"
@@ -28,6 +26,8 @@ limitations under the License.
#include "tensorflow_lite_support/cc/port/statusor.h"
#include "tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h"
#include "tensorflow_lite_support/metadata/metadata_schema_generated.h"
+#include "third_party/zlib/contrib/minizip/ioapi.h"
+#include "third_party/zlib/contrib/minizip/zip.h"
namespace tflite {
namespace metadata {
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc
index 392b6b411f..525ae4a2b4 100644
--- a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc
+++ b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc
@@ -19,7 +19,7 @@ limitations under the License.
#include <cstdio>
#include "absl/strings/string_view.h" // from @com_google_absl
-#include "contrib/minizip/ioapi.h"
+#include "third_party/zlib/contrib/minizip/ioapi.h"
namespace tflite {
namespace metadata {
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.h b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.h
index a1799ff509..72413a0a56 100644
--- a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.h
+++ b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.h
@@ -19,7 +19,7 @@ limitations under the License.
#include <cstdlib>
#include "absl/strings/string_view.h" // from @com_google_absl
-#include "contrib/minizip/ioapi.h"
+#include "third_party/zlib/contrib/minizip/ioapi.h"
namespace tflite {
namespace metadata {
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc
index 38ad17ad89..3ba91b5e22 100644
--- a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc
+++ b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc
@@ -19,7 +19,7 @@ limitations under the License.
#include <cstdio>
#include "absl/strings/string_view.h" // from @com_google_absl
-#include "contrib/minizip/ioapi.h"
+#include "third_party/zlib/contrib/minizip/ioapi.h"
namespace tflite {
namespace metadata {
diff --git a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h
index 30e42fdb72..3d329925df 100644
--- a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h
+++ b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h
@@ -19,7 +19,7 @@ limitations under the License.
#include <cstdlib>
#include "absl/strings/string_view.h" // from @com_google_absl
-#include "contrib/minizip/ioapi.h"
+#include "third_party/zlib/contrib/minizip/ioapi.h"
namespace tflite {
namespace metadata {

View file

@ -1,181 +0,0 @@
From f40f0f994d6fbabf75f6acf796fa4b62809851c0 Mon Sep 17 00:00:00 2001
From: Tom Anderson <thomasanderson@chromium.org>
Date: Thu, 18 Aug 2022 23:00:41 +0000
Subject: [PATCH] Fix debug crash and log spam with
GTK3+Wayland+text-input-unstable-v3
This fixes a regression after [1]. The GTK IME doesn't work on
Wayland+GTK3, so this change skips GTK IME creation for that case.
This effectively restores the behavior to before [1].
[1] https://chromium-review.googlesource.com/c/chromium/src/+/3759236
Change-Id: I4019e8da6929489e302ba7f8699ad62ca604b4aa
Fixed: 1347979
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3836775
Auto-Submit: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: Nick Yamane <nickdiego@igalia.com>
Commit-Queue: Nick Yamane <nickdiego@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1036838}
---
ui/gtk/gtk_ui.cc | 2 +-
ui/gtk/gtk_ui_platform.h | 10 +++++++++-
ui/gtk/gtk_ui_platform_stub.cc | 6 ++++++
ui/gtk/gtk_ui_platform_stub.h | 2 ++
ui/gtk/wayland/gtk_ui_platform_wayland.cc | 12 ++++++++++++
ui/gtk/wayland/gtk_ui_platform_wayland.h | 2 ++
ui/gtk/x/gtk_ui_platform_x11.cc | 7 +++++++
ui/gtk/x/gtk_ui_platform_x11.h | 2 ++
8 files changed, 41 insertions(+), 2 deletions(-)
diff --git a/ui/gtk/gtk_ui.cc b/ui/gtk/gtk_ui.cc
index 1fbb58152c..dd42b1e87c 100644
--- a/ui/gtk/gtk_ui.cc
+++ b/ui/gtk/gtk_ui.cc
@@ -447,7 +447,7 @@ void GtkUi::SetWindowFrameAction(WindowFrameActionSource source,
std::unique_ptr<ui::LinuxInputMethodContext> GtkUi::CreateInputMethodContext(
ui::LinuxInputMethodContextDelegate* delegate) const {
- return std::make_unique<InputMethodContextImplGtk>(delegate);
+ return GetPlatform()->CreateInputMethodContext(delegate);
}
gfx::FontRenderParams GtkUi::GetDefaultFontRenderParams() const {
diff --git a/ui/gtk/gtk_ui_platform.h b/ui/gtk/gtk_ui_platform.h
index 390d90af83..633efbcf16 100644
--- a/ui/gtk/gtk_ui_platform.h
+++ b/ui/gtk/gtk_ui_platform.h
@@ -10,11 +10,15 @@
#include "ui/gfx/native_widget_types.h"
#include "ui/gtk/gtk_compat.h"
-using GdkKeymap = struct _GdkKeymap;
using GtkWindow = struct _GtkWindow;
using GtkWidget = struct _GtkWidget;
using GdkWindow = struct _GdkWindow;
+namespace ui {
+class LinuxInputMethodContext;
+class LinuxInputMethodContextDelegate;
+} // namespace ui
+
namespace gtk {
// GtkUiPlatform encapsulates platform-specific functionalities required by
@@ -52,6 +56,10 @@ class GtkUiPlatform {
// Presents |window|, doing all the necessary platform-specific operations
// needed, if any.
virtual void ShowGtkWindow(GtkWindow* window) = 0;
+
+ // Creates a new IME context or may return nullptr.
+ virtual std::unique_ptr<ui::LinuxInputMethodContext> CreateInputMethodContext(
+ ui::LinuxInputMethodContextDelegate* delegate) const = 0;
};
} // namespace gtk
diff --git a/ui/gtk/gtk_ui_platform_stub.cc b/ui/gtk/gtk_ui_platform_stub.cc
index 76746254ef..5f01c8bd8f 100644
--- a/ui/gtk/gtk_ui_platform_stub.cc
+++ b/ui/gtk/gtk_ui_platform_stub.cc
@@ -43,4 +43,10 @@ void GtkUiPlatformStub::ShowGtkWindow(GtkWindow* window) {
gtk_window_present(window);
}
+std::unique_ptr<ui::LinuxInputMethodContext>
+GtkUiPlatformStub::CreateInputMethodContext(
+ ui::LinuxInputMethodContextDelegate* delegate) const {
+ return nullptr;
+}
+
} // namespace gtk
diff --git a/ui/gtk/gtk_ui_platform_stub.h b/ui/gtk/gtk_ui_platform_stub.h
index ae186455bd..708e05ab04 100644
--- a/ui/gtk/gtk_ui_platform_stub.h
+++ b/ui/gtk/gtk_ui_platform_stub.h
@@ -26,6 +26,8 @@ class GtkUiPlatformStub : public GtkUiPlatform {
gfx::AcceleratedWidget parent) override;
void ClearTransientFor(gfx::AcceleratedWidget parent) override;
void ShowGtkWindow(GtkWindow* window) override;
+ std::unique_ptr<ui::LinuxInputMethodContext> CreateInputMethodContext(
+ ui::LinuxInputMethodContextDelegate* delegate) const override;
};
} // namespace gtk
diff --git a/ui/gtk/wayland/gtk_ui_platform_wayland.cc b/ui/gtk/wayland/gtk_ui_platform_wayland.cc
index 13fb58a84a..cae3475b14 100644
--- a/ui/gtk/wayland/gtk_ui_platform_wayland.cc
+++ b/ui/gtk/wayland/gtk_ui_platform_wayland.cc
@@ -11,7 +11,9 @@
#include "base/logging.h"
#include "ui/base/glib/glib_cast.h"
#include "ui/events/event_utils.h"
+#include "ui/gtk/gtk_compat.h"
#include "ui/gtk/gtk_util.h"
+#include "ui/gtk/input_method_context_impl_gtk.h"
#include "ui/linux/linux_ui_delegate.h"
namespace gtk {
@@ -145,4 +147,14 @@ void GtkUiPlatformWayland::OnHandleSetTransient(GtkWidget* widget,
}
}
+std::unique_ptr<ui::LinuxInputMethodContext>
+GtkUiPlatformWayland::CreateInputMethodContext(
+ ui::LinuxInputMethodContextDelegate* delegate) const {
+ // GDK3 doesn't have a way to create foreign wayland windows, so we can't
+ // translate from ui::KeyEvent to GdkEventKey for InputMethodContextImplGtk.
+ if (!GtkCheckVersion(4))
+ return nullptr;
+ return std::make_unique<InputMethodContextImplGtk>(delegate);
+}
+
} // namespace gtk
diff --git a/ui/gtk/wayland/gtk_ui_platform_wayland.h b/ui/gtk/wayland/gtk_ui_platform_wayland.h
index 2c444793db..315d6ced31 100644
--- a/ui/gtk/wayland/gtk_ui_platform_wayland.h
+++ b/ui/gtk/wayland/gtk_ui_platform_wayland.h
@@ -31,6 +31,8 @@ class GtkUiPlatformWayland : public GtkUiPlatform {
gfx::AcceleratedWidget parent) override;
void ClearTransientFor(gfx::AcceleratedWidget parent) override;
void ShowGtkWindow(GtkWindow* window) override;
+ std::unique_ptr<ui::LinuxInputMethodContext> CreateInputMethodContext(
+ ui::LinuxInputMethodContextDelegate* delegate) const override;
private:
GdkDisplay* GetDefaultGdkDisplay();
diff --git a/ui/gtk/x/gtk_ui_platform_x11.cc b/ui/gtk/x/gtk_ui_platform_x11.cc
index 5fa9d040c6..f7ba25c30c 100644
--- a/ui/gtk/x/gtk_ui_platform_x11.cc
+++ b/ui/gtk/x/gtk_ui_platform_x11.cc
@@ -19,6 +19,7 @@
#include "ui/gfx/x/xproto_util.h"
#include "ui/gtk/gtk_compat.h"
#include "ui/gtk/gtk_util.h"
+#include "ui/gtk/input_method_context_impl_gtk.h"
#include "ui/gtk/x/gtk_event_loop_x11.h"
#include "ui/linux/linux_ui_delegate.h"
@@ -114,4 +115,10 @@ void GtkUiPlatformX11::ShowGtkWindow(GtkWindow* window) {
static_cast<uint32_t>(ui::X11EventSource::GetInstance()->GetTimestamp()));
}
+std::unique_ptr<ui::LinuxInputMethodContext>
+GtkUiPlatformX11::CreateInputMethodContext(
+ ui::LinuxInputMethodContextDelegate* delegate) const {
+ return std::make_unique<InputMethodContextImplGtk>(delegate);
+}
+
} // namespace gtk
diff --git a/ui/gtk/x/gtk_ui_platform_x11.h b/ui/gtk/x/gtk_ui_platform_x11.h
index 3055b7d7ff..74011a8a1c 100644
--- a/ui/gtk/x/gtk_ui_platform_x11.h
+++ b/ui/gtk/x/gtk_ui_platform_x11.h
@@ -34,6 +34,8 @@ class GtkUiPlatformX11 : public GtkUiPlatform {
gfx::AcceleratedWidget parent) override;
void ClearTransientFor(gfx::AcceleratedWidget parent) override;
void ShowGtkWindow(GtkWindow* window) override;
+ std::unique_ptr<ui::LinuxInputMethodContext> CreateInputMethodContext(
+ ui::LinuxInputMethodContextDelegate* delegate) const override;
private:
GdkDisplay* GetGdkDisplay();

View file

@ -0,0 +1,38 @@
From ed8d931e35f81d8566835a579caf7d61368f85b7 Mon Sep 17 00:00:00 2001
From: Evangelos Foutras <evangelos@foutrelis.com>
Date: Tue, 27 Sep 2022 22:20:41 +0000
Subject: [PATCH] unbundle/jsoncpp: avoid CFI faults with is_cfi=true
Ensure jsoncpp symbols have public visibility and are thus excluded from
CFI checks and whole-program optimization. This is achieved by defining
JSON_DLL_BUILD which in turn causes json/config.h to define JSON_API as
__attribute__((visibility("default"))). The latter macro is used to tag
jsoncpp classes and namespace functions throughout jsoncpp's headers.
BUG=1365218
Change-Id: I56277737b7d9ecaeb5e17c8d21a2e55f3d5d5bc9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3919652
Reviewed-by: Thomas Anderson <thomasanderson@chromium.org>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1052077}
---
build/linux/unbundle/jsoncpp.gn | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/build/linux/unbundle/jsoncpp.gn b/build/linux/unbundle/jsoncpp.gn
index 544f9d13c9..e84a0ef27a 100644
--- a/build/linux/unbundle/jsoncpp.gn
+++ b/build/linux/unbundle/jsoncpp.gn
@@ -3,6 +3,11 @@ import("//build/shim_headers.gni")
pkg_config("jsoncpp_config") {
packages = [ "jsoncpp" ]
+
+ # Defining JSON_DLL_BUILD applies public visibility to jsoncpp classes
+ # thus deactivating CFI checks for them. This avoids CFI violations in
+ # virtual calls to system jsoncpp library (https://crbug.com/1365218).
+ defines = [ "JSON_DLL_BUILD" ]
}
shim_headers("jsoncpp_shim") {