From 184e53cd5a9bf5bb2afaf342a821136145b4d34a Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Sun, 7 Jan 2024 03:03:17 -0500 Subject: chromium 122.0.6226.2 --- .../chromium-122-VirtualCursor-std-layout.patch | 219 +++++++++++++++++++++ .../files/chromium-122-qrgen-disablerust.patch | 92 +++++++++ 2 files changed, 311 insertions(+) create mode 100644 www-client/chromium/files/chromium-122-VirtualCursor-std-layout.patch create mode 100644 www-client/chromium/files/chromium-122-qrgen-disablerust.patch (limited to 'www-client/chromium/files') diff --git a/www-client/chromium/files/chromium-122-VirtualCursor-std-layout.patch b/www-client/chromium/files/chromium-122-VirtualCursor-std-layout.patch new file mode 100644 index 0000000..822a9b7 --- /dev/null +++ b/www-client/chromium/files/chromium-122-VirtualCursor-std-layout.patch @@ -0,0 +1,219 @@ +diff --git a/sql/recover_module/btree.cc b/sql/recover_module/btree.cc +index ad985a3d7c..a013c4df17 100644 +--- a/sql/recover_module/btree.cc ++++ b/sql/recover_module/btree.cc +@@ -136,16 +136,22 @@ static_assert(std::is_trivially_destructible::value, + "Move the destructor to the .cc file if it's non-trival"); + #endif // !DCHECK_IS_ON() + +-LeafPageDecoder::LeafPageDecoder(DatabasePageReader* db_reader) noexcept +- : page_id_(db_reader->page_id()), +- db_reader_(db_reader), +- cell_count_(ComputeCellCount(db_reader)), +- next_read_index_(0), +- last_record_size_(0) { ++LeafPageDecoder::LeafPageDecoder() noexcept = default; ++ ++void LeafPageDecoder::Initialize(DatabasePageReader* db_reader) { ++ page_id_ = db_reader->page_id(); ++ db_reader_ = db_reader; ++ cell_count_ = ComputeCellCount(db_reader); ++ next_read_index_ = 0; ++ last_record_size_ = 0; + DCHECK(IsOnValidPage(db_reader)); + DCHECK(DatabasePageReader::IsValidPageId(page_id_)); + } + ++void LeafPageDecoder::Reset() { ++ db_reader_ = nullptr; ++} ++ + bool LeafPageDecoder::TryAdvance() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK(CanAdvance()); +diff --git a/sql/recover_module/btree.h b/sql/recover_module/btree.h +index 155be1ef17..ed27107804 100644 +--- a/sql/recover_module/btree.h ++++ b/sql/recover_module/btree.h +@@ -104,9 +104,7 @@ class LeafPageDecoder { + public: + // Creates a decoder for a DatabasePageReader's last read page. + // +- // |db_reader| must have been used to read an inner page of a table B-tree. +- // |db_reader| must outlive this instance. +- explicit LeafPageDecoder(DatabasePageReader* db_reader) noexcept; ++ LeafPageDecoder() noexcept; + ~LeafPageDecoder() noexcept = default; + + LeafPageDecoder(const LeafPageDecoder&) = delete; +@@ -154,6 +152,17 @@ class LeafPageDecoder { + // read as long as CanAdvance() returns true. + bool TryAdvance(); + ++ // Initialize with DatabasePageReader ++ // |db_reader| must have been used to read an inner page of a table B-tree. ++ // |db_reader| must outlive this instance. ++ void Initialize(DatabasePageReader* db_reader); ++ ++ // Reset internal DatabasePageReader ++ void Reset(); ++ ++ // True if DatabasePageReader is valid ++ bool IsValid() { return (db_reader_ != nullptr); } ++ + // True if the given reader may point to an inner page in a table B-tree. + // + // The last ReadPage() call on |db_reader| must have succeeded. +@@ -167,16 +176,16 @@ class LeafPageDecoder { + static int ComputeCellCount(DatabasePageReader* db_reader); + + // The number of the B-tree page this reader is reading. +- const int64_t page_id_; ++ int64_t page_id_; + // Used to read the tree page. + // + // Raw pointer usage is acceptable because this instance's owner is expected + // to ensure that the DatabasePageReader outlives this. + // This field is not a raw_ptr<> because it caused a + // std::is_trivially_destructible static_assert failure. +- RAW_PTR_EXCLUSION DatabasePageReader* const db_reader_; ++ RAW_PTR_EXCLUSION 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 8983af57e5..de5157c5a8 100644 +--- a/sql/recover_module/cursor.cc ++++ b/sql/recover_module/cursor.cc +@@ -28,7 +28,7 @@ VirtualCursor::~VirtualCursor() { + int VirtualCursor::First() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + inner_decoders_.clear(); +- leaf_decoder_ = nullptr; ++ leaf_decoder_.Reset(); + + AppendPageDecoder(table_->root_page_id()); + return Next(); +@@ -38,18 +38,18 @@ int VirtualCursor::Next() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + record_reader_.Reset(); + +- while (!inner_decoders_.empty() || leaf_decoder_.get()) { +- if (leaf_decoder_.get()) { +- if (!leaf_decoder_->CanAdvance()) { ++ while (!inner_decoders_.empty() || leaf_decoder_.IsValid()) { ++ if (leaf_decoder_.IsValid()) { ++ if (!leaf_decoder_.CanAdvance()) { + // The leaf has been exhausted. Remove it from the DFS stack. +- leaf_decoder_ = nullptr; ++ leaf_decoder_.Reset(); + continue; + } +- if (!leaf_decoder_->TryAdvance()) ++ if (!leaf_decoder_.TryAdvance()) + continue; + +- if (!payload_reader_.Initialize(leaf_decoder_->last_record_size(), +- leaf_decoder_->last_record_offset())) { ++ if (!payload_reader_.Initialize(leaf_decoder_.last_record_size(), ++ leaf_decoder_.last_record_offset())) { + continue; + } + if (!record_reader_.Initialize()) +@@ -102,13 +102,13 @@ int VirtualCursor::ReadColumn(int column_index, + int64_t VirtualCursor::RowId() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK(record_reader_.IsInitialized()); +- DCHECK(leaf_decoder_.get()); +- return leaf_decoder_->last_record_rowid(); ++ DCHECK(leaf_decoder_.IsValid()); ++ return leaf_decoder_.last_record_rowid(); + } + + void VirtualCursor::AppendPageDecoder(int page_id) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); +- DCHECK(leaf_decoder_.get() == nullptr) ++ DCHECK(!leaf_decoder_.IsValid()) + << __func__ + << " must only be called when the current path has no leaf decoder"; + +@@ -116,7 +116,7 @@ void VirtualCursor::AppendPageDecoder(int page_id) { + return; + + if (LeafPageDecoder::IsOnValidPage(&db_reader_)) { +- leaf_decoder_ = std::make_unique(&db_reader_); ++ leaf_decoder_.Initialize(&db_reader_); + return; + } + +diff --git a/sql/recover_module/cursor.h b/sql/recover_module/cursor.h +index 4cb0655700..4be15393e3 100644 +--- a/sql/recover_module/cursor.h ++++ b/sql/recover_module/cursor.h +@@ -128,7 +128,7 @@ class VirtualCursor { + std::vector> inner_decoders_; + + // Decodes the leaf page containing records. +- std::unique_ptr leaf_decoder_; ++ LeafPageDecoder leaf_decoder_; + + SEQUENCE_CHECKER(sequence_checker_); + }; +diff --git a/sql/recover_module/pager.cc b/sql/recover_module/pager.cc +index 7f5b368e51..cb7e2fda21 100644 +--- a/sql/recover_module/pager.cc ++++ b/sql/recover_module/pager.cc +@@ -24,8 +24,7 @@ static_assert(DatabasePageReader::kMaxPageId <= std::numeric_limits::max(), + "ints are not appropriate for representing page IDs"); + + DatabasePageReader::DatabasePageReader(VirtualTable* table) +- : page_data_(std::make_unique(table->page_size())), +- table_(table) { ++ : page_data_(table->page_size()), table_(table) { + CHECK(table != nullptr); + CHECK(IsValidPageSize(table->page_size())); + } +@@ -59,7 +58,7 @@ int DatabasePageReader::ReadPage(int page_id) { + "The |read_offset| computation above may overflow"); + + int sqlite_status = +- RawRead(sqlite_file, read_size, read_offset, page_data_.get()); ++ RawRead(sqlite_file, read_size, read_offset, page_data_.data()); + + // |page_id_| needs to be set to kHighestInvalidPageId 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 d60c5a4f07..f39ce84d74 100644 +--- a/sql/recover_module/pager.h ++++ b/sql/recover_module/pager.h +@@ -6,8 +6,8 @@ + #define SQL_RECOVER_MODULE_PAGER_H_ + + #include +-#include + #include ++#include + + #include "base/check_op.h" + #include "base/memory/raw_ptr.h" +@@ -73,7 +73,7 @@ class DatabasePageReader { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + CHECK(IsValidPageId(page_id_)) + << "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. +@@ -140,7 +140,7 @@ class DatabasePageReader { + int page_id_ = kHighestInvalidPageId; + // 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 page_data_; ++ const std::vector page_data_; + // Raw pointer usage is acceptable because this instance's owner is expected + // to ensure that the VirtualTable outlives this. + const raw_ptr table_; diff --git a/www-client/chromium/files/chromium-122-qrgen-disablerust.patch b/www-client/chromium/files/chromium-122-qrgen-disablerust.patch new file mode 100644 index 0000000..2f049cf --- /dev/null +++ b/www-client/chromium/files/chromium-122-qrgen-disablerust.patch @@ -0,0 +1,92 @@ +diff --git a/components/qr_code_generator/BUILD.gn b/components/qr_code_generator/BUILD.gn +index c45d0c4039..ba2e27878b 100644 +--- a/components/qr_code_generator/BUILD.gn ++++ b/components/qr_code_generator/BUILD.gn +@@ -3,7 +3,7 @@ + # found in the LICENSE file. + + import("//build/buildflag_header.gni") +-import("//build/config/rust.gni") ++# import("//build/config/rust.gni") + import("//testing/libfuzzer/fuzzer_test.gni") + + declare_args() { +@@ -40,20 +40,20 @@ source_set("qr_code_generator") { + ] + deps = [ + ":qr_code_generator_features", +- ":qr_code_generator_ffi_glue", ++# ":qr_code_generator_ffi_glue", + "//base", + ] + public_deps = [ "//base" ] + } + +-rust_static_library("qr_code_generator_ffi_glue") { +- allow_unsafe = true # Needed for FFI that underpins the `cxx` crate. +- crate_root = "qr_code_generator_ffi_glue.rs" +- sources = [ "qr_code_generator_ffi_glue.rs" ] +- cxx_bindings = [ "qr_code_generator_ffi_glue.rs" ] +- visibility = [ ":qr_code_generator" ] +- deps = [ "//third_party/rust/qr_code/v2:lib" ] +-} ++#rust_static_library("qr_code_generator_ffi_glue") { ++# allow_unsafe = true # Needed for FFI that underpins the `cxx` crate. ++# crate_root = "qr_code_generator_ffi_glue.rs" ++# sources = [ "qr_code_generator_ffi_glue.rs" ] ++# cxx_bindings = [ "qr_code_generator_ffi_glue.rs" ] ++# visibility = [ ":qr_code_generator" ] ++# deps = [ "//third_party/rust/qr_code/v2:lib" ] ++#} + + source_set("unit_tests") { + testonly = true +diff --git a/components/qr_code_generator/qr_code_generator.cc b/components/qr_code_generator/qr_code_generator.cc +index 39c59ee3b4..e0d26ef086 100644 +--- a/components/qr_code_generator/qr_code_generator.cc ++++ b/components/qr_code_generator/qr_code_generator.cc +@@ -11,12 +11,12 @@ + #include + + #include "base/check_op.h" +-#include "base/containers/span_rust.h" ++//#include "base/containers/span_rust.h" + #include "base/memory/raw_ptr.h" + #include "base/notreached.h" + #include "base/numerics/safe_conversions.h" + #include "components/qr_code_generator/features.h" +-#include "components/qr_code_generator/qr_code_generator_ffi_glue.rs.h" ++//#include "components/qr_code_generator/qr_code_generator_ffi_glue.rs.h" + + namespace qr_code_generator { + +@@ -572,7 +572,7 @@ size_t SegmentSpanLength(base::span segments) { + return sum; + } + +-absl::optional GenerateQrCodeUsingRust( ++/*absl::optional GenerateQrCodeUsingRust( + base::span in, + absl::optional min_version) { + rust::Slice rs_in = base::SpanToRustSlice(in); +@@ -595,7 +595,7 @@ absl::optional GenerateQrCodeUsingRust( + code.qr_size = base::checked_cast(result_width); + CHECK_EQ(code.data.size(), static_cast(code.qr_size * code.qr_size)); + return code; +-} ++}*/ + + } // namespace + +@@ -613,9 +613,9 @@ QRCodeGenerator::GeneratedCode::~GeneratedCode() = default; + absl::optional QRCodeGenerator::Generate( + base::span in, + absl::optional min_version) { +- if (IsRustyQrCodeGeneratorFeatureEnabled()) { ++ /*if (IsRustyQrCodeGeneratorFeatureEnabled()) { + return GenerateQrCodeUsingRust(in, min_version); +- } ++ }*/ + + if (in.size() > kMaxInputSize) { + return absl::nullopt; -- cgit v1.2.3