ungoogled-chromium: fix pipewire dep

This commit is contained in:
odrling 2021-12-24 05:41:44 +01:00
parent b53433d0a0
commit b787c81d76
No known key found for this signature in database
GPG Key ID: A0145F975F9F8B75
20 changed files with 2193 additions and 0 deletions

View File

@ -0,0 +1,3 @@
DIST chromium-96-patchset-4.tar.xz 4812 BLAKE2B 5d82d212b8ec1689be6f4a7a0646256311d06c17e74ee0e5b2035c32125a5235e4b6b7605cefffa367cc53e651be17b75f5e339149b4c80dca50cd959b1623f1 SHA512 a72c1bb2c58e9e2912a641093c153f01ad7239dc971c7c96481ba4164204afe41741f3253e8af03070dab8276179784dc6a11761b39ad7902ed2553016778282
DIST chromium-96.0.4664.110.tar.xz 1209944416 BLAKE2B 1cec11b248b9225e47caf6bf8ec243e301bb63df2b0a070fb55b829b712e513b2510944f72306cebde3715704cae5b2c6be83847e91b358cb5135b56d55255b3 SHA512 7db962dc7016f531c33e915408303f06f429b53d1c5a69b281e64f6204d4bdb413fd281c3d891bb696d846f80f6182289c10f4b19b3b4c2c8b7fd72070de3f02
DIST ungoogled-chromium-96.0.4664.110-1.tar.gz 716247 BLAKE2B 8c5e9298fd5c1aba367e92208e720b5a4249a60f831f6d87e1ff848094266bf7d7cc9cc06d30b9e37b80df32ebb2e61b6b47af581583b1e15222e2d53a5d5a33 SHA512 c29c2723df6c984c4102144561f96073250f2a3d228faeb1901ad8a8002dee291471ffdd02891f7b31672f1f6353c93664563c0c39d295dc5f06368b45e2a5d3

View File

@ -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_;

View File

@ -0,0 +1,60 @@
--- chromium-93.0.4577.63/media/filters/ffmpeg_demuxer.cc.orig 2021-09-07 08:38:33.765397601 +0200
+++ chromium-93.0.4577.63/media/filters/ffmpeg_demuxer.cc 2021-09-07 09:03:32.575927180 +0200
@@ -427,11 +427,19 @@
scoped_refptr<DecoderBuffer> buffer;
if (type() == DemuxerStream::TEXT) {
+#if defined FF_API_BUFFER_SIZE_T && ! FF_API_BUFFER_SIZE_T
size_t id_size = 0;
+#else
+ int id_size = 0;
+#endif
uint8_t* id_data = av_packet_get_side_data(
packet.get(), AV_PKT_DATA_WEBVTT_IDENTIFIER, &id_size);
+#if defined FF_API_BUFFER_SIZE_T && ! FF_API_BUFFER_SIZE_T
size_t settings_size = 0;
+#else
+ int settings_size = 0;
+#endif
uint8_t* settings_data = av_packet_get_side_data(
packet.get(), AV_PKT_DATA_WEBVTT_SETTINGS, &settings_size);
@@ -443,7 +451,11 @@
buffer = DecoderBuffer::CopyFrom(packet->data, packet->size,
side_data.data(), side_data.size());
} else {
+#if defined FF_API_BUFFER_SIZE_T && ! FF_API_BUFFER_SIZE_T
size_t side_data_size = 0;
+#else
+ int side_data_size = 0;
+#endif
uint8_t* side_data = av_packet_get_side_data(
packet.get(), AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, &side_data_size);
@@ -504,7 +516,11 @@
packet->size - data_offset);
}
+#if defined FF_API_BUFFER_SIZE_T && ! FF_API_BUFFER_SIZE_T
size_t skip_samples_size = 0;
+#else
+ int skip_samples_size = 0;
+#endif
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));
--- chromium-93.0.4577.63/media/filters/audio_decoder_unittest.cc.orig 2021-09-01 03:39:39.000000000 +0200
+++ chromium-93.0.4577.63/media/filters/audio_decoder_unittest.cc 2021-09-07 09:00:33.311446755 +0200
@@ -109,7 +109,11 @@
}
// If the timestamp is positive, try to use FFmpeg's discard data.
+#if defined FF_API_BUFFER_SIZE_T && ! FF_API_BUFFER_SIZE_T
size_t skip_samples_size = 0;
+#else
+ int skip_samples_size = 0;
+#endif
const uint32_t* skip_samples_ptr =
reinterpret_cast<const uint32_t*>(av_packet_get_side_data(
packet, AV_PKT_DATA_SKIP_SAMPLES, &skip_samples_size));

View File

@ -0,0 +1,49 @@
From b94755e4633045be96ab5e0bdde0db7e16a804bd Mon Sep 17 00:00:00 2001
From: "liberato@chromium.org" <liberato@chromium.org>
Date: Fri, 6 Aug 2021 04:25:31 +0000
Subject: [PATCH] FFmpeg M94 roll.
Contains DEPS update + chromium-side fixes.
Bug: 1227259
Change-Id: I61c5eaa789ea12c17d0cbcbf837435b9cf32479b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3011889
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Commit-Queue: Frank Liberato <liberato@chromium.org>
Cr-Commit-Position: refs/heads/master@{#909174}
---
media/ffmpeg/ffmpeg_common.h | 1 +
media/filters/ffmpeg_demuxer.cc | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/media/ffmpeg/ffmpeg_common.h b/media/ffmpeg/ffmpeg_common.h
index cede8ac5a7..97d6307e28 100644
--- a/media/ffmpeg/ffmpeg_common.h
+++ b/media/ffmpeg/ffmpeg_common.h
@@ -29,6 +29,7 @@ extern "C" {
#include <libavformat/avformat.h>
#include <libavformat/avio.h>
#include <libavutil/avutil.h>
+#include <libavutil/channel_layout.h>
#include <libavutil/imgutils.h>
#include <libavutil/log.h>
#include <libavutil/mastering_display_metadata.h>
diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc
index ac4713b072..605001d935 100644
--- a/media/filters/ffmpeg_demuxer.cc
+++ b/media/filters/ffmpeg_demuxer.cc
@@ -106,12 +106,12 @@ static base::TimeDelta ExtractStartTime(AVStream* stream) {
// Next try to use the first DTS value, for codecs where we know PTS == DTS
// (excludes all H26x codecs). The start time must be returned in PTS.
- if (stream->first_dts != kNoFFmpegTimestamp &&
+ if (av_stream_get_first_dts(stream) != kNoFFmpegTimestamp &&
stream->codecpar->codec_id != AV_CODEC_ID_HEVC &&
stream->codecpar->codec_id != AV_CODEC_ID_H264 &&
stream->codecpar->codec_id != AV_CODEC_ID_MPEG4) {
const base::TimeDelta first_pts =
- ConvertFromTimeBase(stream->time_base, stream->first_dts);
+ ConvertFromTimeBase(stream->time_base, av_stream_get_first_dts(stream));
if (first_pts < start_time)
start_time = first_pts;
}

View File

@ -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()))

View File

@ -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",
]

View File

@ -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>

View File

@ -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

View File

@ -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} "$@"

View File

@ -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

View File

@ -0,0 +1,56 @@
--- a/third_party/jsoncpp/BUILD.gn
+++ b/third_party/jsoncpp/BUILD.gn
@@ -3,49 +3,15 @@
# found in the LICENSE file.
import("//testing/libfuzzer/fuzzer_test.gni")
+import("//build/config/linux/pkg_config.gni")
-config("jsoncpp_config") {
- include_dirs = [ "source/include" ]
-
- # TODO(crbug.com/983223): Update JsonCpp BUILD.gn to remove deprecated
- # declaration flag.
- # This temporary flag allowing clients to update to the new version, and then
- # update to the new StreamWriter and CharReader classes.
- if (!is_win || is_clang) {
- cflags_cc = [ "-Wno-deprecated-declarations" ]
- }
+pkg_config("jsoncpp_config") {
+ packages = [ "jsoncpp" ]
}
-source_set("jsoncpp") {
- sources = [
- "source/include/json/allocator.h",
- "source/include/json/assertions.h",
- "source/include/json/config.h",
- "source/include/json/forwards.h",
- "source/include/json/json.h",
- "source/include/json/json_features.h",
- "source/include/json/reader.h",
- "source/include/json/value.h",
- "source/include/json/version.h",
- "source/include/json/writer.h",
- "source/src/lib_json/json_reader.cpp",
- "source/src/lib_json/json_tool.h",
- "source/src/lib_json/json_value.cpp",
- "source/src/lib_json/json_writer.cpp",
- ]
-
+group("jsoncpp") {
public_configs = [ ":jsoncpp_config" ]
- defines = [
- "JSON_USE_EXCEPTION=0",
- "JSON_USE_NULLREF=0",
- ]
-
- include_dirs = [ "source/src/lib_json" ]
-
- if (!is_win || is_clang) {
- cflags_cc = [ "-Wno-implicit-fallthrough" ]
- }
}
if (build_with_chromium) {

View File

@ -0,0 +1,26 @@
description: build using system openjpeg
author: Michael Gilbert <mgilbert@debian.org>
--- a/third_party/pdfium/core/fpdfapi/render/BUILD.gn
+++ b/third_party/pdfium/core/fpdfapi/render/BUILD.gn
@@ -43,6 +43,7 @@ jumbo_source_set("render") {
]
configs += [ "../../../:pdfium_core_config" ]
deps = [
+ "../../../third_party:libopenjpeg2",
"../../../constants",
"../../fxcodec",
"../../fxcrt",
--- a/third_party/pdfium/core/fxcodec/jpx/cjpx_decoder.h
+++ b/third_party/pdfium/core/fxcodec/jpx/cjpx_decoder.h
@@ -13,8 +13,8 @@
#include "core/fxcrt/unowned_ptr.h"
#include "third_party/base/span.h"
-#if defined(USE_SYSTEM_LIBOPENJPEG2)
-#include <openjpeg.h>
+#if 1
+#include <openjpeg-2.4/openjpeg.h>
#else
#include "third_party/libopenjpeg20/openjpeg.h"
#endif

View File

@ -0,0 +1,111 @@
Taken from
https://github.com/qvint/ungoogled-chromium-fedora/commit/a68fdd679566da5134d916776f14e00c8e6a8042
--- a/chrome/tools/convert_dict/convert_dict.cc
+++ b/chrome/tools/convert_dict/convert_dict.cc
@@ -24,6 +24,7 @@
#include "build/build_config.h"
#include "chrome/tools/convert_dict/aff_reader.h"
#include "chrome/tools/convert_dict/dic_reader.h"
+#include "components/spellcheck/common/spellcheck_common.h"
#include "third_party/hunspell/google/bdict_reader.h"
#include "third_party/hunspell/google/bdict_writer.h"
@@ -76,13 +77,32 @@ bool VerifyWords(const convert_dict::Dic
}
int PrintHelp() {
- printf("Usage: convert_dict <dicfile base name>\n\n");
- printf("Example:\n");
- printf(" convert_dict en-US\nwill read en-US.dic, en-US.dic_delta, and "
- "en-US.aff from the current directory and generate en-US.bdic\n\n");
+ printf(
+ "Usage:\n"
+ " dict-utility list\n"
+ " dict-utility convert <aff_path> <dic_path> <out_path>\n");
return 1;
}
+int PrintList() {
+ base::FilePath root("/");
+ std::vector<std::string> languages = spellcheck::SpellCheckLanguages();
+
+ for (auto &language : languages) {
+ std::string language_region =
+ spellcheck::GetSpellCheckLanguageRegion(language);
+ base::FilePath language_bdic_path =
+ spellcheck::GetVersionedFileName(language, root).BaseName();
+
+ printf("%s\t%s\t%s\n",
+ language.c_str(),
+ language_region.c_str(),
+ language_bdic_path.value().c_str());
+ }
+
+ return 0;
+}
+
} // namespace
#if defined(OS_WIN)
@@ -91,16 +111,15 @@ int wmain(int argc, wchar_t* argv[]) {
int main(int argc, char* argv[]) {
#endif
base::EnableTerminationOnHeapCorruption();
- if (argc != 2)
+ if (argc == 2 && strcmp(argv[1], "list") == 0)
+ return PrintList();
+ if (argc != 5 || strcmp(argv[1], "convert") != 0)
return PrintHelp();
base::AtExitManager exit_manager;
base::i18n::InitializeICU();
- base::FilePath file_base = base::FilePath(argv[1]);
-
- base::FilePath aff_path =
- file_base.ReplaceExtension(FILE_PATH_LITERAL(".aff"));
+ base::FilePath aff_path = base::FilePath(argv[2]);
printf("Reading %" PRFilePath " ...\n", aff_path.value().c_str());
convert_dict::AffReader aff_reader(aff_path);
if (!aff_reader.Read()) {
@@ -108,8 +127,7 @@ int main(int argc, char* argv[]) {
return 1;
}
- base::FilePath dic_path =
- file_base.ReplaceExtension(FILE_PATH_LITERAL(".dic"));
+ base::FilePath dic_path = base::FilePath(argv[3]);
printf("Reading %" PRFilePath " ...\n", dic_path.value().c_str());
// DicReader will also read the .dic_delta file.
convert_dict::DicReader dic_reader(dic_path);
@@ -135,8 +153,7 @@ int main(int argc, char* argv[]) {
return 1;
}
- base::FilePath out_path =
- file_base.ReplaceExtension(FILE_PATH_LITERAL(".bdic"));
+ base::FilePath out_path = base::FilePath(argv[4]);
printf("Writing %" PRFilePath " ...\n", out_path.value().c_str());
FILE* out_file = base::OpenFile(out_path, "wb");
if (!out_file) {
--- a/chrome/tools/convert_dict/BUILD.gn
+++ b/chrome/tools/convert_dict/BUILD.gn
@@ -34,6 +34,7 @@ executable("convert_dict") {
"//base",
"//base:i18n",
"//build/win:default_exe_manifest",
+ "//components/spellcheck/common",
"//third_party/hunspell",
]
}
--- a/components/spellcheck/common/spellcheck_common.h
+++ b/components/spellcheck/common/spellcheck_common.h
@@ -30,6 +30,8 @@ static const size_t kMaxSyncableDictiona
// chrome/browser/resources/settings/languages_page/edit_dictionary_page.js
static const size_t kMaxCustomDictionaryWordBytes = 99;
+std::string GetSpellCheckLanguageRegion(base::StringPiece input_language);
+
base::FilePath GetVersionedFileName(base::StringPiece input_language,
const base::FilePath& dict_dir);

View File

@ -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

View File

@ -0,0 +1,10 @@
# Default settings for ungoogled-chromium. This file is sourced by /bin/bash
# from the chromium launcher.
# Uncomment this to spoof timezone to UTC
#export TZ='Etc/UTC'
# Options to pass to ungoogled-chromium.
# See https://github.com/Eloston/ungoogled-chromium#features for additional
# command-line switches.
#CHROMIUM_FLAGS=""

View File

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

View File

@ -0,0 +1,58 @@
#!/usr/bin/env bash
# Taken from
# https://github.com/qvint/ungoogled-chromium-fedora/commit/a68fdd679566da5134d916776f14e00c8e6a8042
self="$(readlink -f "${0}")"
self_dir="$(dirname "${self}")"
dict_utility="${self_dir}/convert_dict"
# Defaults.
hunspell_dicts_dir="/usr/share/myspell"
user_data_dir="${HOME}/.config/chromium"
# Parse command-line arguments.
while [[ $# -gt 0 ]]; do
arg_name="${1}"
case "${arg_name}" in
"--hunspell-dicts-dir")
hunspell_dicts_dir="${2}"
shift; shift
;;
"--user-data-dir")
user_data_dir="${2}"
shift; shift
;;
*)
echo -n "Usage: ungoogled-chromium-update-dicts "
echo "[--hunspell-dicts-dir DIR] [--user-data-dir DIR]"
exit 1
esac
done
# List all chromium language entries.
chromium_language_entries="$("${dict_utility}" list)"
# Iterate through chromium language entries and make *.bdic files.
chromium_dicts_dir="${user_data_dir}/Dictionaries"
mkdir -p "${chromium_dicts_dir}"
while read -r chromium_language_entry; do
while read \
chromium_language \
chromium_language_region \
chromium_bdic_basename; do
hunspell_language_region="${chromium_language_region//-/_}"
aff_path="${hunspell_dicts_dir}/${hunspell_language_region}.aff"
dic_path="${hunspell_dicts_dir}/${hunspell_language_region}.dic"
bdic_path="${chromium_dicts_dir}/${chromium_bdic_basename}"
if \
[[ -f "${aff_path}" ]] && \
[[ -f "${dic_path}" ]] && \
[[ ! -f "${bdic_path}" ]]; then
"${dict_utility}" convert "${aff_path}" "${dic_path}" "${bdic_path}"
fi
done <<< "${chromium_language_entry}"
done <<< "${chromium_language_entries}"

View File

@ -0,0 +1,56 @@
--- a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
+++ b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
@@ -705,7 +705,7 @@
// implementation we get from |vaapi_picture_factory_| requires the video
// processing pipeline for downloading the decoded frame from the internal
// surface, we need to create a |vpp_vaapi_wrapper_|.
- if (requires_vpp && buffer_allocation_mode_ != BufferAllocationMode::kNone) {
+ if (requires_vpp && buffer_allocation_mode_ != BufferAllocationMode::kWrapVdpau) {
if (!vpp_vaapi_wrapper_) {
vpp_vaapi_wrapper_ = VaapiWrapper::Create(
VaapiWrapper::kVideoProcess, VAProfileNone,
@@ -1209,6 +1209,11 @@
VaapiVideoDecodeAccelerator::BufferAllocationMode
VaapiVideoDecodeAccelerator::DecideBufferAllocationMode() {
+ // NVIDIA blobs use VDPAU
+ if (VaapiWrapper::GetImplementationType() == VAImplementation::kNVIDIAVDPAU) {
+ LOG(INFO) << "VA-API driver on VDPAU backend";
+ return BufferAllocationMode::kWrapVdpau;
+ }
#if BUILDFLAG(USE_VAAPI_X11)
// The IMPORT mode is used for Android on Chrome OS, so this doesn't apply
// here.
--- a/media/gpu/vaapi/vaapi_video_decode_accelerator.h
+++ b/media/gpu/vaapi/vaapi_video_decode_accelerator.h
@@ -204,6 +204,7 @@ class MEDIA_GPU_EXPORT VaapiVideoDecodeAccelerator
// Using |client_|s provided PictureBuffers and as many internally
// allocated.
kNormal,
+ kWrapVdpau,
};
// Decides the concrete buffer allocation mode, depending on the hardware
--- a/media/gpu/vaapi/vaapi_wrapper.cc
+++ b/media/gpu/vaapi/vaapi_wrapper.cc
@@ -131,6 +131,9 @@ media::VAImplementation VendorStringToImplementationType(
} else if (base::StartsWith(va_vendor_string, "Intel iHD driver",
base::CompareCase::SENSITIVE)) {
return media::VAImplementation::kIntelIHD;
+ } else if (base::StartsWith(va_vendor_string, "Splitted-Desktop Systems VDPAU",
+ base::CompareCase::SENSITIVE)) {
+ return media::VAImplementation::kNVIDIAVDPAU;
}
return media::VAImplementation::kOther;
}
--- a/media/gpu/vaapi/vaapi_wrapper.h
+++ b/media/gpu/vaapi/vaapi_wrapper.h
@@ -79,6 +79,7 @@ enum class VAImplementation {
kIntelIHD,
kOther,
kInvalid,
+ kNVIDIAVDPAU,
};
// This class handles VA-API calls and ensures proper locking of VA-API calls

View File

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>PF4Public@users.noreply.github.com</email>
</maintainer>
<upstream>
<remote-id type="github">Eloston/ungoogled-chromium</remote-id>
<bugs-to>https://github.com/Eloston/ungoogled-chromium/issues</bugs-to>
<doc>https://ungoogled-software.github.io/ungoogled-chromium-wiki/</doc>
</upstream>
<longdescription>
ungoogled-chromium is Google Chromium, sans integration with Google.
It also features some tweaks to enhance privacy, control, and
transparency (almost all of which require manual activation or enabling).
ungoogled-chromium retains the default Chromium experience as closely as
possible. Unlike other Chromium forks that have their own visions of a
web browser, ungoogled-chromium is essentially a drop-in replacement for
Chromium.
</longdescription>
<use>
<flag name="cfi">Build with CFI (Control Flow Integrity) enabled. It requires "-stdlib=libc++", see #40 for more details.</flag>
<flag name="clang">Use Clang compiler instead of GCC</flag>
<flag name="convert-dict">Patch and build the convert_dict utility. The script will be installed into /usr/lib64/chromium-browser/update-dicts.sh. More info here: https://github.com/Eloston/ungoogled-chromium/issues/188#issuecomment-444752907</flag>
<flag name="debug">Enable DCHECK feature with severity configurable at runtime. Mostly intended for debugging and development, NOT RECOMMENDED for general use.</flag>
<flag name="enable-driver">Build chromedriver</flag>
<flag name="hangouts">Enable support for Google Hangouts features such as screen sharing</flag>
<flag name="headless">Build Ozone only with headless backend, NOT RECOMMENDED for general uses</flag>
<flag name="js-type-check">Enable JavaScript type-checking for Chrome's web technology-based UI. Requires Java.</flag>
<flag name="official">Enable Official build instead of Developer build.</flag>
<flag name="optimize-thinlto">Whether to enable ThinLTO optimizations. Turning ThinLTO optimizations on can substantially increase link time and binary size, but they generally also make binaries a fair bit faster.</flag>
<flag name="optimize-webui">Optimize parts of Chromium's UI written with web technologies (HTML/CSS/JS) for runtime performance purposes. This does more work at compile time for speed benefits at runtime.</flag>
<flag name="partition">Use PartitionAlloc explicitly</flag>
<flag name="pgo">Enable PGO. Requires clang and bundled binary profile data in sources tree.</flag>
<flag name="proprietary-codecs">Enable proprietary codecs like H.264, MP3</flag>
<flag name="screencast">Enable support for remote desktop and screen cast using <pkg>media-video/pipewire</pkg></flag>
<flag name="suid">Build the SUID sandbox, which is only needed on CONFIG_USER_NS=n kernels</flag>
<flag name="system-ffmpeg">Use the system <pkg>media-video/ffmpeg</pkg> instead of the bundled one</flag>
<flag name="system-harfbuzz">Use the system <pkg>media-libs/harfbuzz</pkg> instead of the bundled one</flag>
<flag name="system-icu">Use the system <pkg>dev-libs/icu</pkg> instead of the bundled one</flag>
<flag name="system-jsoncpp">Use the system <pkg>dev-libs/jsoncpp</pkg> instead of the bundled one</flag>
<flag name="system-libevent">Use the system <pkg>dev-libs/libevent</pkg> instead of the bundled one</flag>
<flag name="system-libvpx">Use the system <pkg>media-libs/libvpx</pkg> instead of the bundled one</flag>
<flag name="system-openh264">Use the system <pkg>media-libs/openh264</pkg> instead of the bundled one. If disabled, it will restrict USE=bindist.</flag>
<flag name="system-openjpeg">Use the system-wide <pkg>media-libs/openjpeg</pkg> instead of the bundled one. OpenJPEG use are exclusively for Chromium's PDF viewer.</flag>
<flag name="system-re2">Use the system-wide <pkg>dev-libs/re2</pkg> instead of the bundled one</flag>
<flag name="tcmalloc">Use tcmalloc explicitly</flag>
<flag name="thinlto">Build with ThinLTO support. LTO (Link Time Optimization) achieves better runtime performance through whole-program analysis and cross-module optimization (highly recommended).</flag>
<flag name="widevine">Unsupported closed-source DRM capability (required by Netflix VOD)</flag>
</use>
</pkgmetadata>

File diff suppressed because it is too large Load Diff