diff options
author | Yixun Lan <dlan@gentoo.org> | 2021-12-14 16:37:56 +0800 |
---|---|---|
committer | Yixun Lan <dlan@gentoo.org> | 2021-12-14 16:38:01 +0800 |
commit | 8c94b1452b69a7673c69e1985d8e5747f8b938f2 (patch) | |
tree | 17ec83b163866d135bca93e1e989e286ea1f29cb /www-client/chromium/files | |
parent | app-emulation/spike: add golden reference RISC-V ISA simulator (diff) | |
download | riscv-8c94b1452b69a7673c69e1985d8e5747f8b938f2.tar.gz riscv-8c94b1452b69a7673c69e1985d8e5747f8b938f2.tar.bz2 riscv-8c94b1452b69a7673c69e1985d8e5747f8b938f2.zip |
www-client/chromium: initial import chromium-98
from commit: c4437ce25f70c016fb51c438f421ddafd580ad9a
Signed-off-by: Yixun Lan <dlan@gentoo.org>
Diffstat (limited to 'www-client/chromium/files')
11 files changed, 413 insertions, 0 deletions
diff --git a/www-client/chromium/files/chromium-93-InkDropHost-crash.patch b/www-client/chromium/files/chromium-93-InkDropHost-crash.patch new file mode 100644 index 0000000..54d16db --- /dev/null +++ b/www-client/chromium/files/chromium-93-InkDropHost-crash.patch @@ -0,0 +1,25 @@ +diff --git a/ui/views/animation/ink_drop_host_view.h b/ui/views/animation/ink_drop_host_view.h +index bd0975b..e5df288 100644 +--- a/ui/views/animation/ink_drop_host_view.h ++++ b/ui/views/animation/ink_drop_host_view.h +@@ -238,6 +238,11 @@ class VIEWS_EXPORT InkDropHost { + // Used to observe View and inform the InkDrop of host-transform changes. + ViewLayerTransformObserver host_view_transform_observer_; + ++ // Declared before |ink_drop_|, because InkDropImpl may call ++ // RemoveInkDropLayer on partly destructed InkDropHost. In ++ // that case |ink_drop_mask_| must be still valid. ++ std::unique_ptr<views::InkDropMask> ink_drop_mask_; ++ + // Should not be accessed directly. Use GetInkDrop() instead. + std::unique_ptr<InkDrop> ink_drop_; + +@@ -261,8 +266,6 @@ class VIEWS_EXPORT InkDropHost { + int ink_drop_small_corner_radius_ = 2; + int ink_drop_large_corner_radius_ = 4; + +- std::unique_ptr<views::InkDropMask> ink_drop_mask_; +- + base::RepeatingCallback<std::unique_ptr<InkDrop>()> create_ink_drop_callback_; + base::RepeatingCallback<std::unique_ptr<InkDropRipple>()> + create_ink_drop_ripple_callback_; diff --git a/www-client/chromium/files/chromium-96-EnumTable-crash.patch b/www-client/chromium/files/chromium-96-EnumTable-crash.patch new file mode 100644 index 0000000..9736739 --- /dev/null +++ b/www-client/chromium/files/chromium-96-EnumTable-crash.patch @@ -0,0 +1,76 @@ +diff --git a/components/cast_channel/enum_table.h b/components/cast_channel/enum_table.h +index aad9e08..2f3fcad 100644 +--- a/components/cast_channel/enum_table.h ++++ b/components/cast_channel/enum_table.h +@@ -8,6 +8,7 @@ + #include <cstdint> + #include <cstring> + #include <ostream> ++#include <vector> + + #include "base/check_op.h" + #include "base/macros.h" +@@ -188,7 +189,6 @@ class + inline constexpr GenericEnumTableEntry(int32_t value); + inline constexpr GenericEnumTableEntry(int32_t value, base::StringPiece str); + +- GenericEnumTableEntry(const GenericEnumTableEntry&) = delete; + GenericEnumTableEntry& operator=(const GenericEnumTableEntry&) = delete; + + private: +@@ -254,7 +254,6 @@ class EnumTable { + constexpr Entry(E value, base::StringPiece str) + : GenericEnumTableEntry(static_cast<int32_t>(value), str) {} + +- Entry(const Entry&) = delete; + Entry& operator=(const Entry&) = delete; + }; + +@@ -313,15 +312,14 @@ class EnumTable { + if (is_sorted_) { + const std::size_t index = static_cast<std::size_t>(value); + if (ANALYZER_ASSUME_TRUE(index < data_.size())) { +- const auto& entry = data_.begin()[index]; ++ const auto& entry = data_[index]; + if (ANALYZER_ASSUME_TRUE(entry.has_str())) + return entry.str(); + } + return absl::nullopt; + } + return GenericEnumTableEntry::FindByValue( +- reinterpret_cast<const GenericEnumTableEntry*>(data_.begin()), +- data_.size(), static_cast<int32_t>(value)); ++ &data_[0], data_.size(), static_cast<int32_t>(value)); + } + + // This overload of GetString is designed for cases where the argument is a +@@ -349,8 +347,7 @@ class EnumTable { + // enum value directly. + absl::optional<E> GetEnum(base::StringPiece str) const { + auto* entry = GenericEnumTableEntry::FindByString( +- reinterpret_cast<const GenericEnumTableEntry*>(data_.begin()), +- data_.size(), str); ++ &data_[0], data_.size(), str); + return entry ? static_cast<E>(entry->value) : absl::optional<E>(); + } + +@@ -365,7 +362,7 @@ class EnumTable { + // Align the data on a cache line boundary. + alignas(64) + #endif +- std::initializer_list<Entry> data_; ++ const std::vector<Entry> data_; + bool is_sorted_; + + constexpr EnumTable(std::initializer_list<Entry> data, bool is_sorted) +@@ -377,8 +374,8 @@ class EnumTable { + + for (std::size_t i = 0; i < data.size(); i++) { + for (std::size_t j = i + 1; j < data.size(); j++) { +- const Entry& ei = data.begin()[i]; +- const Entry& ej = data.begin()[j]; ++ const Entry& ei = data[i]; ++ const Entry& ej = data[j]; + DCHECK(ei.value != ej.value) + << "Found duplicate enum values at indices " << i << " and " << j; + DCHECK(!(ei.has_str() && ej.has_str() && ei.str() == ej.str())) diff --git a/www-client/chromium/files/chromium-96-freetype-unbundle.patch b/www-client/chromium/files/chromium-96-freetype-unbundle.patch new file mode 100644 index 0000000..6ef5ff6 --- /dev/null +++ b/www-client/chromium/files/chromium-96-freetype-unbundle.patch @@ -0,0 +1,10 @@ +--- a/build/linux/BUILD.gn ++++ b/build/linux/BUILD.gn +@@ -23,6 +23,7 @@ + # the system, use with caution,for details see build/config/freetype/BUILD.gn. + pkg_config("freetype_from_pkgconfig") { + visibility = [ ++ "//build/config/freetype:freetype", + "//third_party:freetype_harfbuzz", + "//third_party/harfbuzz-ng:harfbuzz_source", + ] diff --git a/www-client/chromium/files/chromium-98-EnumTable-crash.patch b/www-client/chromium/files/chromium-98-EnumTable-crash.patch new file mode 100644 index 0000000..f058ec1 --- /dev/null +++ b/www-client/chromium/files/chromium-98-EnumTable-crash.patch @@ -0,0 +1,76 @@ +diff --git a/components/cast_channel/enum_table.h b/components/cast_channel/enum_table.h +index 842553a..89de703 100644 +--- a/components/cast_channel/enum_table.h ++++ b/components/cast_channel/enum_table.h +@@ -8,6 +8,7 @@ + #include <cstdint> + #include <cstring> + #include <ostream> ++#include <vector> + + #include "base/check_op.h" + #include "base/notreached.h" +@@ -187,7 +188,6 @@ class + inline constexpr GenericEnumTableEntry(int32_t value); + inline constexpr GenericEnumTableEntry(int32_t value, base::StringPiece str); + +- GenericEnumTableEntry(const GenericEnumTableEntry&) = delete; + GenericEnumTableEntry& operator=(const GenericEnumTableEntry&) = delete; + + private: +@@ -253,7 +253,6 @@ class EnumTable { + constexpr Entry(E value, base::StringPiece str) + : GenericEnumTableEntry(static_cast<int32_t>(value), str) {} + +- Entry(const Entry&) = delete; + Entry& operator=(const Entry&) = delete; + }; + +@@ -312,15 +311,14 @@ class EnumTable { + if (is_sorted_) { + const std::size_t index = static_cast<std::size_t>(value); + if (ANALYZER_ASSUME_TRUE(index < data_.size())) { +- const auto& entry = data_.begin()[index]; ++ const auto& entry = data_[index]; + if (ANALYZER_ASSUME_TRUE(entry.has_str())) + return entry.str(); + } + return absl::nullopt; + } + return GenericEnumTableEntry::FindByValue( +- reinterpret_cast<const GenericEnumTableEntry*>(data_.begin()), +- data_.size(), static_cast<int32_t>(value)); ++ &data_[0], data_.size(), static_cast<int32_t>(value)); + } + + // This overload of GetString is designed for cases where the argument is a +@@ -348,8 +346,7 @@ class EnumTable { + // enum value directly. + absl::optional<E> GetEnum(base::StringPiece str) const { + auto* entry = GenericEnumTableEntry::FindByString( +- reinterpret_cast<const GenericEnumTableEntry*>(data_.begin()), +- data_.size(), str); ++ &data_[0], data_.size(), str); + return entry ? static_cast<E>(entry->value) : absl::optional<E>(); + } + +@@ -364,7 +361,7 @@ class EnumTable { + // Align the data on a cache line boundary. + alignas(64) + #endif +- std::initializer_list<Entry> data_; ++ const std::vector<Entry> data_; + bool is_sorted_; + + constexpr EnumTable(std::initializer_list<Entry> data, bool is_sorted) +@@ -376,8 +373,8 @@ class EnumTable { + + for (std::size_t i = 0; i < data.size(); i++) { + for (std::size_t j = i + 1; j < data.size(); j++) { +- const Entry& ei = data.begin()[i]; +- const Entry& ej = data.begin()[j]; ++ const Entry& ei = data[i]; ++ const Entry& ej = data[j]; + DCHECK(ei.value != ej.value) + << "Found duplicate enum values at indices " << i << " and " << j; + DCHECK(!(ei.has_str() && ej.has_str() && ei.str() == ej.str())) diff --git a/www-client/chromium/files/chromium-98-system-libdrm.patch b/www-client/chromium/files/chromium-98-system-libdrm.patch new file mode 100644 index 0000000..f2f18be --- /dev/null +++ b/www-client/chromium/files/chromium-98-system-libdrm.patch @@ -0,0 +1,34 @@ +diff --git a/media/gpu/chromeos/BUILD.gn b/media/gpu/chromeos/BUILD.gn +index a5c8945..d742d80 100644 +--- a/media/gpu/chromeos/BUILD.gn ++++ b/media/gpu/chromeos/BUILD.gn +@@ -32,6 +32,7 @@ source_set("chromeos") { + + if (use_vaapi) { + deps += [ ++ "//build/config/linux/libdrm", + "//media/gpu/vaapi", + "//media/gpu/vaapi:common", + ] +diff --git a/media/gpu/chromeos/video_decoder_pipeline.cc b/media/gpu/chromeos/video_decoder_pipeline.cc +index 2d77cd9..1883fd4 100644 +--- a/media/gpu/chromeos/video_decoder_pipeline.cc ++++ b/media/gpu/chromeos/video_decoder_pipeline.cc +@@ -4,6 +4,9 @@ + + #include "media/gpu/chromeos/video_decoder_pipeline.h" + ++#if BUILDFLAG(USE_VAAPI) ++#include <drm_fourcc.h> ++#endif + #include <memory> + + #include "base/bind.h" +@@ -28,7 +31,6 @@ + + #if BUILDFLAG(USE_VAAPI) + #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 diff --git a/www-client/chromium/files/chromium-browser.xml b/www-client/chromium/files/chromium-browser.xml new file mode 100644 index 0000000..2c95a55 --- /dev/null +++ b/www-client/chromium/files/chromium-browser.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE default-apps SYSTEM "gnome-da-list.dtd"> +<default-apps> + <web-browsers> + <web-browser> + <name>Chromium</name> + <executable>chromium-browser</executable> + <command>chromium-browser %s</command> + <icon-name>chromium-browser</icon-name> + <run-in-terminal>false</run-in-terminal> + </web-browser> + </web-browsers> +</default-apps> diff --git a/www-client/chromium/files/chromium-glibc-2.34.patch b/www-client/chromium/files/chromium-glibc-2.34.patch new file mode 100644 index 0000000..64c03a6 --- /dev/null +++ b/www-client/chromium/files/chromium-glibc-2.34.patch @@ -0,0 +1,50 @@ +From 600d63c2c59a9892dbc5423d7d8bb1565a9f91e7 Mon Sep 17 00:00:00 2001 +From: Michel Salim <michel@fb.com> +Date: Thu, 04 Nov 2021 14:22:40 -0700 +Subject: [PATCH] Handle long SIGSTKSZ in glibc > 2.33 + +`SIGSTKSZ` is no longer constant in glibc > 2.33 but a function +returning a long. Cast before taking `max`. + +See https://sourceware.org/git/?p=glibc.git;a=blob;f=NEWS;h=85e84fe53699fe9e392edffa993612ce08b2954a;hb=HEAD + +Signed-off-by: Michel Salim <michel@fb.com> +Change-Id: I197f8ff3053eede80d6aed096be4f0113dd43241 +(relocated to chromium repo, removed static) +--- + +diff --git a/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc b/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc +index ca353c4..5cdabcf 100644 +--- a/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc ++++ b/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc +@@ -138,7 +138,7 @@ + // 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(16384U, (unsigned)SIGSTKSZ); + + // Only set an alternative stack if there isn't already one, or if the current + // one is too small. +diff --git a/sandbox/linux/services/credentials.cc b/sandbox/linux/services/credentials.cc +index ca6b595..1c1ee42 100644 +--- a/sandbox/linux/services/credentials.cc ++++ b/sandbox/linux/services/credentials.cc +@@ -11,6 +11,7 @@ + #include <stddef.h> + #include <stdint.h> + #include <stdio.h> ++#include <string.h> + #include <sys/syscall.h> + #include <sys/types.h> + #include <sys/wait.h> +@@ -100,7 +101,8 @@ 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}; ++ char tls_buf[PTHREAD_STACK_MIN]; ++ memset(tls_buf, 0, PTHREAD_STACK_MIN); + tls = tls_buf; + #endif + diff --git a/www-client/chromium/files/chromium-launcher-r7.sh b/www-client/chromium/files/chromium-launcher-r7.sh new file mode 100644 index 0000000..1163ff3 --- /dev/null +++ b/www-client/chromium/files/chromium-launcher-r7.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +# Allow the user to override command-line flags, bug #357629. +# This is based on Debian's chromium-browser package, and is intended +# to be consistent with Debian. +for f in /etc/chromium/*; do + [[ -f ${f} ]] && source "${f}" +done + +# Prefer user defined CHROMIUM_USER_FLAGS (from env) over system +# default CHROMIUM_FLAGS (from /etc/chromium/default). +CHROMIUM_FLAGS=${CHROMIUM_USER_FLAGS:-"$CHROMIUM_FLAGS"} + +# Let the wrapped binary know that it has been run through the wrapper +export CHROME_WRAPPER=$(readlink -f "$0") + +PROGDIR=${CHROME_WRAPPER%/*} + +case ":$PATH:" in + *:$PROGDIR:*) + # $PATH already contains $PROGDIR + ;; + *) + # Append $PROGDIR to $PATH + export PATH="$PATH:$PROGDIR" + ;; +esac + +if [[ ${EUID} == 0 && -O ${XDG_CONFIG_HOME:-${HOME}} ]]; then + # Running as root with HOME owned by root. + # Pass --user-data-dir to work around upstream failsafe. + CHROMIUM_FLAGS="--user-data-dir=${XDG_CONFIG_HOME:-${HOME}/.config}/chromium + ${CHROMIUM_FLAGS}" +fi + +# Select session type and platform +if @@OZONE_AUTO_SESSION@@; then + platform= + if [[ ${XDG_SESSION_TYPE} == x11 ]]; then + platform=x11 + elif [[ ${XDG_SESSION_TYPE} == wayland ]]; then + platform=wayland + else + if [[ -n ${WAYLAND_DISPLAY} ]]; then + platform=wayland + else + platform=x11 + fi + fi + if ${DISABLE_OZONE_PLATFORM:-false}; then + platform=x11 + fi + CHROMIUM_FLAGS="--ozone-platform=${platform} ${CHROMIUM_FLAGS}" +fi + +# Set the .desktop file name +export CHROME_DESKTOP="chromium-browser-chromium.desktop" + +exec -a "chromium-browser" "$PROGDIR/chrome" --extra-plugin-dir=/usr/lib/nsbrowser/plugins ${CHROMIUM_FLAGS} "$@" diff --git a/www-client/chromium/files/chromium-shim_headers.patch b/www-client/chromium/files/chromium-shim_headers.patch new file mode 100644 index 0000000..9372632 --- /dev/null +++ b/www-client/chromium/files/chromium-shim_headers.patch @@ -0,0 +1,48 @@ +From e273172bbafedca36984fc40f4aa6c44b79ac2ef Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann <stha09@googlemail.com> +Date: Fri, 25 Dec 2020 09:10:32 +0000 +Subject: [PATCH] shim_headers: fix outputs generation + +--- + build/shim_headers.gni | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/build/shim_headers.gni b/build/shim_headers.gni +index 0900cba..5138647 100644 +--- a/build/shim_headers.gni ++++ b/build/shim_headers.gni +@@ -6,6 +6,8 @@ template("shim_headers") { + action_name = "gen_${target_name}" + config_name = "${target_name}_config" + shim_headers_path = "${root_gen_dir}/shim_headers/${target_name}" ++ shim_root_path = rebase_path(invoker.root_path) ++ shim_rel_path = rebase_path("${shim_root_path}", rebase_path("//")) + + config(config_name) { + include_dirs = [ shim_headers_path ] +@@ -16,7 +18,7 @@ template("shim_headers") { + args = [ + "--generate", + "--headers-root", +- rebase_path(invoker.root_path), ++ "${shim_root_path}", + "--output-directory", + rebase_path(shim_headers_path), + ] +@@ -27,9 +29,10 @@ template("shim_headers") { + ] + } + args += invoker.headers +- +- outputs = process_file_template(invoker.headers, +- "${shim_headers_path}/{{source_file_part}}") ++ outputs = [] ++ foreach(shim_header, invoker.headers) { ++ outputs += [ "${shim_headers_path}/${shim_rel_path}/" + shim_header ] ++ } + } + + group(target_name) { +-- +2.26.2 + diff --git a/www-client/chromium/files/chromium-use-oauth2-client-switches-as-default.patch b/www-client/chromium/files/chromium-use-oauth2-client-switches-as-default.patch new file mode 100644 index 0000000..9d9c57b --- /dev/null +++ b/www-client/chromium/files/chromium-use-oauth2-client-switches-as-default.patch @@ -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 diff --git a/www-client/chromium/files/chromium.default b/www-client/chromium/files/chromium.default new file mode 100644 index 0000000..c140cde --- /dev/null +++ b/www-client/chromium/files/chromium.default @@ -0,0 +1,5 @@ +# Default settings for chromium. This file is sourced by /bin/bash from +# the chromium launcher. + +# Options to pass to chromium. +#CHROMIUM_FLAGS="" |