summaryrefslogtreecommitdiffstats
path: root/chromium-ungoogled
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2023-02-22 20:34:38 +0000
committer Eric Hameleers <alien@slackware.com>2023-02-22 20:34:38 +0000
commit468f17a3f762808e5c29cb1240f0628d9dededde (patch)
tree88596ac9cce04fc2d780bf3307156431e2115c4c /chromium-ungoogled
parente1e493513f144208a38abcca4e8b748925f2f8fb (diff)
downloadasb-468f17a3f762808e5c29cb1240f0628d9dededde.tar.gz
asb-468f17a3f762808e5c29cb1240f0628d9dededde.tar.xz
Initial revision
Diffstat (limited to 'chromium-ungoogled')
-rw-r--r--chromium-ungoogled/build/patches/chromium-103-VirtualCursor-std-layout.patch231
-rw-r--r--chromium-ungoogled/build/patches/chromium-110-CredentialUIEntry-const.patch41
-rw-r--r--chromium-ungoogled/build/patches/chromium-110-DarkModeLABColorSpace-pow.patch37
-rw-r--r--chromium-ungoogled/build/patches/chromium-110-InProgressDownloadManager-include.patch30
-rw-r--r--chromium-ungoogled/build/patches/chromium-110-NativeThemeBase-fabs.patch29
-rw-r--r--chromium-ungoogled/build/patches/chromium_clang_versiondetect.patch17
6 files changed, 385 insertions, 0 deletions
diff --git a/chromium-ungoogled/build/patches/chromium-103-VirtualCursor-std-layout.patch b/chromium-ungoogled/build/patches/chromium-103-VirtualCursor-std-layout.patch
new file mode 100644
index 00000000..be0502e9
--- /dev/null
+++ b/chromium-ungoogled/build/patches/chromium-103-VirtualCursor-std-layout.patch
@@ -0,0 +1,231 @@
+From 144479ad7b4287bee4067f95e4218f614798a865 Mon Sep 17 00:00:00 2001
+From: Stephan Hartmann <stha09@googlemail.com>
+Date: Sun, 16 Jan 2022 19:15:26 +0000
+Subject: [PATCH] sql: make VirtualCursor standard layout type
+
+sql::recover::VirtualCursor needs to be a standard layout type, but
+has members of type std::unique_ptr. However, std::unique_ptr is not
+guaranteed to be standard layout. Compiling with clang combined with
+gcc-11 libstdc++ fails because of this.
+
+Bug: 1189788
+Change-Id: Ia6dc388cc5ef1c0f2afc75f8ca45b9f12687ca9c
+---
+
+diff --git a/sql/recover_module/btree.cc b/sql/recover_module/btree.cc
+index cc9420e5..f12d8fa 100644
+--- a/sql/recover_module/btree.cc
++++ b/sql/recover_module/btree.cc
+@@ -136,16 +136,22 @@
+ "Move the destructor to the .cc file if it's non-trival");
+ #endif // !DCHECK_IS_ON()
+
+-LeafPageDecoder::LeafPageDecoder(DatabasePageReader* db_reader) noexcept
+- : page_id_(db_reader->page_id()),
+- db_reader_(db_reader),
+- cell_count_(ComputeCellCount(db_reader)),
+- next_read_index_(0),
+- last_record_size_(0) {
++LeafPageDecoder::LeafPageDecoder() noexcept = default;
++
++void LeafPageDecoder::Initialize(DatabasePageReader* db_reader) {
++ page_id_ = db_reader->page_id();
++ db_reader_ = db_reader;
++ cell_count_ = ComputeCellCount(db_reader);
++ next_read_index_ = 0;
++ last_record_size_ = 0;
+ DCHECK(IsOnValidPage(db_reader));
+ DCHECK(DatabasePageReader::IsValidPageId(page_id_));
+ }
+
++void LeafPageDecoder::Reset() {
++ db_reader_ = nullptr;
++}
++
+ bool LeafPageDecoder::TryAdvance() {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ DCHECK(CanAdvance());
+diff --git a/sql/recover_module/btree.h b/sql/recover_module/btree.h
+index eaa087a5..df0e0c9 100644
+--- a/sql/recover_module/btree.h
++++ b/sql/recover_module/btree.h
+@@ -101,9 +101,7 @@
+ public:
+ // Creates a decoder for a DatabasePageReader's last read page.
+ //
+- // |db_reader| must have been used to read an inner page of a table B-tree.
+- // |db_reader| must outlive this instance.
+- explicit LeafPageDecoder(DatabasePageReader* db_reader) noexcept;
++ LeafPageDecoder() noexcept;
+ ~LeafPageDecoder() noexcept = default;
+
+ LeafPageDecoder(const LeafPageDecoder&) = delete;
+@@ -151,6 +149,17 @@
+ // read as long as CanAdvance() returns true.
+ bool TryAdvance();
+
++ // Initialize with DatabasePageReader
++ // |db_reader| must have been used to read an inner page of a table B-tree.
++ // |db_reader| must outlive this instance.
++ void Initialize(DatabasePageReader* db_reader);
++
++ // Reset internal DatabasePageReader
++ void Reset();
++
++ // True if DatabasePageReader is valid
++ bool IsValid() { return (db_reader_ != nullptr); }
++
+ // True if the given reader may point to an inner page in a table B-tree.
+ //
+ // The last ReadPage() call on |db_reader| must have succeeded.
+@@ -164,14 +173,14 @@
+ 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 4f827ed..240de499 100644
+--- a/sql/recover_module/cursor.cc
++++ b/sql/recover_module/cursor.cc
+@@ -28,7 +28,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();
+@@ -38,18 +38,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())
+@@ -101,13 +101,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";
+
+@@ -115,7 +115,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 845b785..cc4e85f8 100644
+--- a/sql/recover_module/cursor.h
++++ b/sql/recover_module/cursor.h
+@@ -130,7 +130,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..69d98cef 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->page_size()), table_(table) {
+ DCHECK(table != nullptr);
+ DCHECK(IsValidPageSize(table->page_size()));
+ }
+@@ -58,7 +57,7 @@
+ "The |read_offset| computation above may overflow");
+
+ int sqlite_status =
+- RawRead(sqlite_file, read_size, read_offset, page_data_.get());
++ RawRead(sqlite_file, read_size, read_offset, page_data_.data());
+
+ // |page_id_| needs to be set to kInvalidPageId if the read failed.
+ // Otherwise, future ReadPage() calls with the previous |page_id_| value
+diff --git a/sql/recover_module/pager.h b/sql/recover_module/pager.h
+index 07cac3cb..d08f093 100644
+--- a/sql/recover_module/pager.h
++++ b/sql/recover_module/pager.h
+@@ -6,8 +6,8 @@
+ #define SQL_RECOVER_MODULE_PAGER_H_
+
+ #include <cstdint>
+-#include <memory>
+ #include <ostream>
++#include <vector>
+
+ #include "base/check_op.h"
+ #include "base/memory/raw_ptr.h"
+@@ -72,7 +72,7 @@
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ DCHECK_NE(page_id_, kInvalidPageId)
+ << "Successful ReadPage() required before accessing pager state";
+- return page_data_.get();
++ return page_data_.data();
+ }
+
+ // The number of bytes in the page read by the last ReadPage() call.
+@@ -139,7 +139,7 @@
+ int page_id_ = kInvalidPageId;
+ // Stores the bytes of the last page successfully read by ReadPage().
+ // The content is undefined if the last call to ReadPage() did not succeed.
+- const std::unique_ptr<uint8_t[]> page_data_;
++ std::vector<uint8_t> page_data_;
+ // Raw pointer usage is acceptable because this instance's owner is expected
+ // to ensure that the VirtualTable outlives this.
+ const raw_ptr<VirtualTable> table_;
diff --git a/chromium-ungoogled/build/patches/chromium-110-CredentialUIEntry-const.patch b/chromium-ungoogled/build/patches/chromium-110-CredentialUIEntry-const.patch
new file mode 100644
index 00000000..eb68aa27
--- /dev/null
+++ b/chromium-ungoogled/build/patches/chromium-110-CredentialUIEntry-const.patch
@@ -0,0 +1,41 @@
+From b4e56d22275cae5a910463a966a96345430a83ea Mon Sep 17 00:00:00 2001
+From: Ivan Murashov <ivan.murashov@lge.com>
+Date: Sat, 17 Dec 2022 12:06:01 +0000
+Subject: [PATCH] libstdc++: Don't use const members in std::vector in password_manager::CredentialUIEntry
+
+Otherwise build fails when building with use_custom_libcxx=false.
+The error example:
+std::vector must have a non-const, non-volatile value_type
+
+Implementation of std::vector in libstdc++ does not allow const.
+
+Bug: 957519
+Change-Id: I089de2d52df25138d74dbf01fdf61d6301b4d871
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4111037
+Reviewed-by: Mohamed Amir Yosef <mamir@chromium.org>
+Commit-Queue: Mohamed Amir Yosef <mamir@chromium.org>
+Cr-Commit-Position: refs/heads/main@{#1084697}
+---
+
+diff --git a/components/password_manager/core/browser/ui/credential_ui_entry.cc b/components/password_manager/core/browser/ui/credential_ui_entry.cc
+index 1e0766a..a9a34f7 100644
+--- a/components/password_manager/core/browser/ui/credential_ui_entry.cc
++++ b/components/password_manager/core/browser/ui/credential_ui_entry.cc
+@@ -97,7 +97,7 @@
+ // For cases when the notes differ within grouped passwords (e.g: a
+ // credential exists in both account and profile stores), respective notes
+ // should be concatenated and linebreak used as a delimiter.
+- std::vector<const std::u16string> notes_with_duplicates;
++ std::vector<std::u16string> notes_with_duplicates;
+ for (const auto& form : forms) {
+ // Only notes with an empty `unique_display_name` are supported in the
+ // settings UI.
+@@ -109,7 +109,7 @@
+ }
+ auto unique_notes =
+ base::MakeFlatSet<std::u16string>(std::move(notes_with_duplicates));
+- note = base::JoinString(std::vector<const std::u16string>(
++ note = base::JoinString(std::vector<std::u16string>(
+ unique_notes.begin(), unique_notes.end()),
+ u"\n");
+
diff --git a/chromium-ungoogled/build/patches/chromium-110-DarkModeLABColorSpace-pow.patch b/chromium-ungoogled/build/patches/chromium-110-DarkModeLABColorSpace-pow.patch
new file mode 100644
index 00000000..91f1aee0
--- /dev/null
+++ b/chromium-ungoogled/build/patches/chromium-110-DarkModeLABColorSpace-pow.patch
@@ -0,0 +1,37 @@
+From 795c311aae4b718585bc6194189f061000c823a1 Mon Sep 17 00:00:00 2001
+From: Stephan Hartmann <stha09@googlemail.com>
+Date: Fri, 23 Dec 2022 14:28:55 +0000
+Subject: [PATCH] libstdc++: fix narrowing in blink::DarkModeLABColorSpace
+
+Clang-14 errors out with narrowing from double to float. Use std::pow
+instead.
+---
+ .../renderer/platform/graphics/dark_mode_lab_color_space.h | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/third_party/blink/renderer/platform/graphics/dark_mode_lab_color_space.h b/third_party/blink/renderer/platform/graphics/dark_mode_lab_color_space.h
+index 999c3e5..c18ea7b 100644
+--- a/third_party/blink/renderer/platform/graphics/dark_mode_lab_color_space.h
++++ b/third_party/blink/renderer/platform/graphics/dark_mode_lab_color_space.h
+@@ -125,7 +125,7 @@ class DarkModeLABColorSpace {
+ // https://en.wikipedia.org/wiki/CIELAB_color_space#Reverse_transformation.
+ SkV3 FromXYZ(const SkV3& v) const {
+ auto f = [](float x) {
+- return x > kSigma3 ? pow(x, 1.0f / 3.0f)
++ return x > kSigma3 ? std::pow(x, 1.0f / 3.0f)
+ : x / (3 * kSigma2) + 4.0f / 29.0f;
+ };
+
+@@ -145,7 +145,8 @@ class DarkModeLABColorSpace {
+ // https://en.wikipedia.org/wiki/CIELAB_color_space#Forward_transformation.
+ SkV3 ToXYZ(const SkV3& lab) const {
+ auto invf = [](float x) {
+- return x > kSigma ? pow(x, 3.0f) : 3.0f * kSigma2 * (x - 4.0f / 29.0f);
++ return x > kSigma ? std::pow(x, 3.0f)
++ : 3.0f * kSigma2 * (x - 4.0f / 29.0f);
+ };
+
+ SkV3 v = {Clamp(lab.x, 0.0f, 100.0f), Clamp(lab.y, -128.0f, 128.0f),
+--
+2.38.2
+
diff --git a/chromium-ungoogled/build/patches/chromium-110-InProgressDownloadManager-include.patch b/chromium-ungoogled/build/patches/chromium-110-InProgressDownloadManager-include.patch
new file mode 100644
index 00000000..adc51dbb
--- /dev/null
+++ b/chromium-ungoogled/build/patches/chromium-110-InProgressDownloadManager-include.patch
@@ -0,0 +1,30 @@
+From 63027c62eaa1b6c5b0d2762a511f1611b15d3728 Mon Sep 17 00:00:00 2001
+From: Stephan Hartmann <stha09@googlemail.com>
+Date: Mon, 19 Dec 2022 13:56:17 +0000
+Subject: [PATCH] libstdc++: fix incomplete type of download::InProgressDownloadManager
+
+Destructor of std::unique_ptr in libstdc++ uses sizeof() which
+requires full definition of download::InProgressDownloadManager
+for return type of content::BrowserContext::
+RetrieveInProgressDownloadManager().
+
+Bug: 957519
+Change-Id: If99aa8d52238bacb1cb559a300e14ed3a05b7297
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4111526
+Reviewed-by: Bo Liu <boliu@chromium.org>
+Commit-Queue: Stephan Hartmann <stha09@googlemail.com>
+Cr-Commit-Position: refs/heads/main@{#1084924}
+---
+
+diff --git a/content/browser/browser_context.cc b/content/browser/browser_context.cc
+index 6180969..22e9dbb 100644
+--- a/content/browser/browser_context.cc
++++ b/content/browser/browser_context.cc
+@@ -30,6 +30,7 @@
+ #include "base/unguessable_token.h"
+ #include "build/build_config.h"
+ #include "build/chromeos_buildflags.h"
++#include "components/download/public/common/in_progress_download_manager.h"
+ #include "components/services/storage/privileged/mojom/indexed_db_control.mojom.h"
+ #include "content/browser/blob_storage/chrome_blob_storage_context.h"
+ #include "content/browser/browser_context_impl.h"
diff --git a/chromium-ungoogled/build/patches/chromium-110-NativeThemeBase-fabs.patch b/chromium-ungoogled/build/patches/chromium-110-NativeThemeBase-fabs.patch
new file mode 100644
index 00000000..c7d0e8b1
--- /dev/null
+++ b/chromium-ungoogled/build/patches/chromium-110-NativeThemeBase-fabs.patch
@@ -0,0 +1,29 @@
+From 07f0a87e4409f27854b3a1d17f270a3497f38947 Mon Sep 17 00:00:00 2001
+From: Stephan Hartmann <stha09@googlemail.com>
+Date: Mon, 19 Dec 2022 19:07:37 +0000
+Subject: [PATCH] GCC: use fabsf in ui::NativeThemeBase::OutlineColor
+
+Template deduction fails for base::clamp, because return type of
+fabs is double and all other parameters are float.
+
+Bug: 819294
+Change-Id: I34f1c9c99d13f69097d899bfcb0526cbdf4fe1c1
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4110869
+Reviewed-by: Peter Kasting <pkasting@chromium.org>
+Commit-Queue: Stephan Hartmann <stha09@googlemail.com>
+Cr-Commit-Position: refs/heads/main@{#1085034}
+---
+
+diff --git a/ui/native_theme/native_theme_base.cc b/ui/native_theme/native_theme_base.cc
+index 169c60c..36db49a 100644
+--- a/ui/native_theme/native_theme_base.cc
++++ b/ui/native_theme/native_theme_base.cc
+@@ -1336,7 +1336,7 @@
+ // The following code has been tested to look OK with all of the
+ // default GTK themes.
+ SkScalar min_diff = base::clamp((hsv1[1] + hsv2[1]) * 1.2f, 0.28f, 0.5f);
+- SkScalar diff = base::clamp(fabs(hsv1[2] - hsv2[2]) / 2, min_diff, 0.5f);
++ SkScalar diff = base::clamp(fabsf(hsv1[2] - hsv2[2]) / 2, min_diff, 0.5f);
+
+ if (hsv1[2] + hsv2[2] > 1.0)
+ diff = -diff;
diff --git a/chromium-ungoogled/build/patches/chromium_clang_versiondetect.patch b/chromium-ungoogled/build/patches/chromium_clang_versiondetect.patch
new file mode 100644
index 00000000..2e0aec2e
--- /dev/null
+++ b/chromium-ungoogled/build/patches/chromium_clang_versiondetect.patch
@@ -0,0 +1,17 @@
+Avoid
+
+ unexpected clang version 16.0.0 (not 16), update RELEASE_VERSION in update.py
+
+error at the end of the clang building process.
+
+--- tools/clang/scripts/build.py.orig 2023-02-13 00:41:59.394397795 +0100
++++ tools/clang/scripts/build.py 2023-02-13 13:47:32.941126748 +0100
+@@ -430,7 +430,7 @@
+ clang += '-cl.exe'
+ version_out = subprocess.check_output([clang, '--version'],
+ universal_newlines=True)
+- version_out = re.match(r'clang version ([0-9.]+)', version_out).group(1)
++ version_out = re.match(r'clang version ([0-9]+)', version_out).group(1)
+ if version_out != RELEASE_VERSION:
+ print(('unexpected clang version %s (not %s), '
+ 'update RELEASE_VERSION in update.py')