Compare commits
27 Commits
| Author | SHA256 | Date | |
|---|---|---|---|
| 0f89da960d | |||
| 2713ef1712 | |||
| ec5006ea2e | |||
| 260ba0122d | |||
| f6dde4469c | |||
| e8dda073d6 | |||
| 85d8cae8fd | |||
| fff53f3c2e | |||
| 9dda8dd120 | |||
| d74ae9ab23 | |||
| 805ede6b84 | |||
| 26d96f1da7 | |||
| b817b0df97 | |||
| 4c06b33c6b | |||
| 754f344fe0 | |||
| a03e893c19 | |||
| 26d8b6ddb5 | |||
| 29251bbf34 | |||
| 73c6162442 | |||
| 94ec34be6b | |||
| e95bf3c296 | |||
| d83e41ea5c | |||
| 8fdf2bc55f | |||
| 8a7b712932 | |||
| 9d30973976 | |||
| 669e2448d0 | |||
| b798aa04c9 |
@@ -1,25 +0,0 @@
|
||||
Manual backport of https://github.com/nodejs/undici/commit/6805746680d27a5369d7fb67bc05f95a28247d75
|
||||
|
||||
--- src/third_party/electron_node/deps/undici/src/lib/handler/RedirectHandler.js.old 2024-04-04 09:55:39.696980900 +0000
|
||||
+++ src/third_party/electron_node/deps/undici/src/lib/handler/RedirectHandler.js 2024-04-09 16:52:37.888616200 +0000
|
||||
@@ -188,7 +188,8 @@ function shouldRemoveHeader (header, rem
|
||||
(header.length === 4 && header.toString().toLowerCase() === 'host') ||
|
||||
(removeContent && header.toString().toLowerCase().indexOf('content-') === 0) ||
|
||||
(unknownOrigin && header.length === 13 && header.toString().toLowerCase() === 'authorization') ||
|
||||
- (unknownOrigin && header.length === 6 && header.toString().toLowerCase() === 'cookie')
|
||||
+ (unknownOrigin && header.length === 6 && header.toString().toLowerCase() === 'cookie') ||
|
||||
+ (unknownOrigin && header.length === 19 && header.toString().toLowerCase() === 'proxy-authorization')
|
||||
)
|
||||
}
|
||||
|
||||
--- src/third_party/electron_node/deps/undici/undici.js.old 2024-04-04 10:02:38.059765300 +0000
|
||||
+++ src/third_party/electron_node/deps/undici/undici.js 2024-04-09 16:51:15.754041100 +0000
|
||||
@@ -7902,7 +7902,7 @@ var require_RedirectHandler = __commonJS
|
||||
}
|
||||
__name(parseLocation, "parseLocation");
|
||||
function shouldRemoveHeader(header, removeContent, unknownOrigin) {
|
||||
- return header.length === 4 && header.toString().toLowerCase() === "host" || removeContent && header.toString().toLowerCase().indexOf("content-") === 0 || unknownOrigin && header.length === 13 && header.toString().toLowerCase() === "authorization" || unknownOrigin && header.length === 6 && header.toString().toLowerCase() === "cookie";
|
||||
+ return header.length === 4 && header.toString().toLowerCase() === "host" || removeContent && header.toString().toLowerCase().indexOf("content-") === 0 || unknownOrigin && header.length === 13 && header.toString().toLowerCase() === "authorization" || unknownOrigin && header.length === 6 && header.toString().toLowerCase() === "cookie" || unknownOrigin && header.length === 19 && header.toString().toLowerCase() === "proxy-authorization"
|
||||
}
|
||||
__name(shouldRemoveHeader, "shouldRemoveHeader");
|
||||
function cleanRequestHeaders(headers, removeContent, unknownOrigin) {
|
||||
@@ -1,136 +0,0 @@
|
||||
Port https://github.com/nodejs/undici/commit/d542b8c to apply to amalgamated undici code in nodejs (the original copy in deps/undici/src is not used and i'm not bothering with patching it)
|
||||
|
||||
These chunks were manually cherry-picked from upstream nodejs commit https://github.com/nodejs/node/commit/60d24938 to match the undici changes.
|
||||
|
||||
|
||||
--- a/third_party/electron_node/deps/undici/undici.js
|
||||
+++ b/third_party/electron_node/deps/undici/undici.js
|
||||
@@ -992,9 +992,12 @@ var require_util2 = __commonJS({
|
||||
var { isBlobLike, toUSVString, ReadableStreamFrom } = require_util();
|
||||
var assert = require("assert");
|
||||
var { isUint8Array } = require("util/types");
|
||||
+ var supportedHashes = [];
|
||||
var crypto;
|
||||
try {
|
||||
crypto = require("crypto");
|
||||
+ const possibleRelevantHashes = ["sha256", "sha384", "sha512"];
|
||||
+ supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash));
|
||||
} catch {
|
||||
}
|
||||
function responseURL(response) {
|
||||
@@ -1277,46 +1280,38 @@ var require_util2 = __commonJS({
|
||||
if (parsedMetadata.length === 0) {
|
||||
return true;
|
||||
}
|
||||
- const list = parsedMetadata.sort((c, d) => d.algo.localeCompare(c.algo));
|
||||
- const strongest = list[0].algo;
|
||||
- const metadata = list.filter((item) => item.algo === strongest);
|
||||
+ const strongest = getStrongestMetadata(parsedMetadata);
|
||||
+ const metadata = filterMetadataListByAlgorithm(parsedMetadata, strongest);
|
||||
for (const item of metadata) {
|
||||
const algorithm = item.algo;
|
||||
- let expectedValue = item.hash;
|
||||
- if (expectedValue.endsWith("==")) {
|
||||
- expectedValue = expectedValue.slice(0, -2);
|
||||
- }
|
||||
+ const expectedValue = item.hash;
|
||||
let actualValue = crypto.createHash(algorithm).update(bytes).digest("base64");
|
||||
- if (actualValue.endsWith("==")) {
|
||||
- actualValue = actualValue.slice(0, -2);
|
||||
- }
|
||||
- if (actualValue === expectedValue) {
|
||||
- return true;
|
||||
- }
|
||||
- let actualBase64URL = crypto.createHash(algorithm).update(bytes).digest("base64url");
|
||||
- if (actualBase64URL.endsWith("==")) {
|
||||
- actualBase64URL = actualBase64URL.slice(0, -2);
|
||||
+ if (actualValue[actualValue.length - 1] === "=") {
|
||||
+ if (actualValue[actualValue.length - 2] === "=") {
|
||||
+ actualValue = actualValue.slice(0, -2);
|
||||
+ } else {
|
||||
+ actualValue = actualValue.slice(0, -1);
|
||||
+ }
|
||||
}
|
||||
- if (actualBase64URL === expectedValue) {
|
||||
+ if (compareBase64Mixed(actualValue, expectedValue)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
__name(bytesMatch, "bytesMatch");
|
||||
- var parseHashWithOptions = /((?<algo>sha256|sha384|sha512)-(?<hash>[A-z0-9+/]{1}.*={0,2}))( +[\x21-\x7e]?)?/i;
|
||||
+ var parseHashWithOptions = /(?<algo>sha256|sha384|sha512)-((?<hash>[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i;
|
||||
function parseMetadata(metadata) {
|
||||
const result = [];
|
||||
let empty = true;
|
||||
- const supportedHashes = crypto.getHashes();
|
||||
for (const token of metadata.split(" ")) {
|
||||
empty = false;
|
||||
const parsedToken = parseHashWithOptions.exec(token);
|
||||
- if (parsedToken === null || parsedToken.groups === void 0) {
|
||||
+ if (parsedToken === null || parsedToken.groups === void 0 || parsedToken.groups.algo === void 0) {
|
||||
continue;
|
||||
}
|
||||
- const algorithm = parsedToken.groups.algo;
|
||||
- if (supportedHashes.includes(algorithm.toLowerCase())) {
|
||||
+ const algorithm = parsedToken.groups.algo.toLowerCase();
|
||||
+ if (supportedHashes.includes(algorithm)) {
|
||||
result.push(parsedToken.groups);
|
||||
}
|
||||
}
|
||||
@@ -1326,6 +1321,54 @@ var require_util2 = __commonJS({
|
||||
return result;
|
||||
}
|
||||
__name(parseMetadata, "parseMetadata");
|
||||
+ function getStrongestMetadata(metadataList) {
|
||||
+ let algorithm = metadataList[0].algo;
|
||||
+ if (algorithm[3] === "5") {
|
||||
+ return algorithm;
|
||||
+ }
|
||||
+ for (let i = 1; i < metadataList.length; ++i) {
|
||||
+ const metadata = metadataList[i];
|
||||
+ if (metadata.algo[3] === "5") {
|
||||
+ algorithm = "sha512";
|
||||
+ break;
|
||||
+ } else if (algorithm[3] === "3") {
|
||||
+ continue;
|
||||
+ } else if (metadata.algo[3] === "3") {
|
||||
+ algorithm = "sha384";
|
||||
+ }
|
||||
+ }
|
||||
+ return algorithm;
|
||||
+ }
|
||||
+ __name(getStrongestMetadata, "getStrongestMetadata");
|
||||
+ function filterMetadataListByAlgorithm(metadataList, algorithm) {
|
||||
+ if (metadataList.length === 1) {
|
||||
+ return metadataList;
|
||||
+ }
|
||||
+ let pos = 0;
|
||||
+ for (let i = 0; i < metadataList.length; ++i) {
|
||||
+ if (metadataList[i].algo === algorithm) {
|
||||
+ metadataList[pos++] = metadataList[i];
|
||||
+ }
|
||||
+ }
|
||||
+ metadataList.length = pos;
|
||||
+ return metadataList;
|
||||
+ }
|
||||
+ __name(filterMetadataListByAlgorithm, "filterMetadataListByAlgorithm");
|
||||
+ function compareBase64Mixed(actualValue, expectedValue) {
|
||||
+ if (actualValue.length !== expectedValue.length) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ for (let i = 0; i < actualValue.length; ++i) {
|
||||
+ if (actualValue[i] !== expectedValue[i]) {
|
||||
+ if (actualValue[i] === "+" && expectedValue[i] === "-" || actualValue[i] === "/" && expectedValue[i] === "_") {
|
||||
+ continue;
|
||||
+ }
|
||||
+ return false;
|
||||
+ }
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
+ __name(compareBase64Mixed, "compareBase64Mixed");
|
||||
function tryUpgradeRequestToAPotentiallyTrustworthyURL(request) {
|
||||
}
|
||||
__name(tryUpgradeRequestToAPotentiallyTrustworthyURL, "tryUpgradeRequestToAPotentiallyTrustworthyURL");
|
||||
33
DesktopNativeWidgetAura-HandleActivationChanged-crash.patch
Normal file
33
DesktopNativeWidgetAura-HandleActivationChanged-crash.patch
Normal file
@@ -0,0 +1,33 @@
|
||||
From f9819bb70b413c8310cd209c75cc555495e28564 Mon Sep 17 00:00:00 2001
|
||||
From: Allen Bauer <kylixrd@chromium.org>
|
||||
Date: Fri, 31 May 2024 15:55:13 +0000
|
||||
Subject: [PATCH] Harden DesktopNativeWidgetAura against a destroyed Widget.
|
||||
|
||||
Under CLIENT_OWNS_WIDGET ownership mode, it is possible for the Widget to have already been destroyed. This hardens the NativeWidget to handle this case without crashing.
|
||||
|
||||
Bug: 40242079, 40232479
|
||||
Change-Id: I455e1690b49ff50e4eac3b9a085d9f15ccb6adec
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5585758
|
||||
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
|
||||
Reviewed-by: Thomas Anderson <thomasanderson@chromium.org>
|
||||
Commit-Queue: Allen Bauer <kylixrd@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#1308668}
|
||||
---
|
||||
ui/views/widget/desktop_aura/desktop_native_widget_aura.cc | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
|
||||
index 9ae19505357c6b..1974865e8c8a8f 100644
|
||||
--- a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
|
||||
+++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
|
||||
@@ -431,8 +431,8 @@ DesktopNativeWidgetAura::tooltip_controller() {
|
||||
}
|
||||
|
||||
void DesktopNativeWidgetAura::HandleActivationChanged(bool active) {
|
||||
- DCHECK(native_widget_delegate_);
|
||||
- if (!native_widget_delegate_->ShouldHandleNativeWidgetActivationChanged(
|
||||
+ if (!native_widget_delegate_ ||
|
||||
+ !native_widget_delegate_->ShouldHandleNativeWidgetActivationChanged(
|
||||
active)) {
|
||||
return;
|
||||
}
|
||||
@@ -6,3 +6,4 @@ Exec=electron %u
|
||||
Categories=Development;GTK;
|
||||
NoDisplay=true
|
||||
StartupNotify=true
|
||||
StartupWMClass=electron
|
||||
@@ -1,55 +0,0 @@
|
||||
From ee6e6d3e45af1f7210e144a17f14fb21a7e86588 Mon Sep 17 00:00:00 2001
|
||||
From: mikt <mikt@google.com>
|
||||
Date: Tue, 30 Jan 2024 03:09:24 +0000
|
||||
Subject: [PATCH] [PA] Fix InternalAllocator for GCC builds
|
||||
|
||||
Internal Allocator has a few missing member functions, that are required
|
||||
as a part of named requirement Allocator.
|
||||
https://en.cppreference.com/w/cpp/named_req/Allocator
|
||||
|
||||
It broke builds on GCC, so adding these to fix.
|
||||
https://crrev.com/c/5196856/comments/0c4bbfd9_6433016b
|
||||
|
||||
Change-Id: Ifce5f3e47c94c7bb1e298ac4cd7d0d1e4c6de59c
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5231905
|
||||
Commit-Queue: Mikihito Matsuura <mikt@google.com>
|
||||
Reviewed-by: Kalvin Lee <kdlee@chromium.org>
|
||||
Reviewed-by: Takashi Sakamoto <tasak@google.com>
|
||||
Cr-Commit-Position: refs/heads/main@{#1253709}
|
||||
---
|
||||
.../internal_allocator_forward.h | 21 +++++++++++++++----
|
||||
1 file changed, 17 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/base/allocator/partition_allocator/src/partition_alloc/internal_allocator_forward.h b/base/allocator/partition_allocator/src/partition_alloc/internal_allocator_forward.h
|
||||
index 45fec29f8cc93..b31a145ff6e99 100644
|
||||
--- a/base/allocator/partition_allocator/src/partition_alloc/internal_allocator_forward.h
|
||||
+++ b/base/allocator/partition_allocator/src/partition_alloc/internal_allocator_forward.h
|
||||
@@ -27,11 +27,24 @@ PartitionRoot& InternalAllocatorRoot();
|
||||
template <typename T>
|
||||
class InternalAllocator {
|
||||
public:
|
||||
- // Member types required by allocator completeness requirements.
|
||||
using value_type = T;
|
||||
- using size_type = std::size_t;
|
||||
- using difference_type = std::ptrdiff_t;
|
||||
- using propagate_on_container_move_assignment = std::true_type;
|
||||
+ using is_always_equal = std::true_type;
|
||||
+
|
||||
+ InternalAllocator() = default;
|
||||
+
|
||||
+ template <typename U>
|
||||
+ InternalAllocator(const InternalAllocator<U>&) {} // NOLINT
|
||||
+
|
||||
+ template <typename U>
|
||||
+ InternalAllocator& operator=(const InternalAllocator<U>&) {
|
||||
+ return *this;
|
||||
+ }
|
||||
+
|
||||
+ template <typename U>
|
||||
+ bool operator==(const InternalAllocator<U>&) {
|
||||
+ // InternalAllocator<T> can free allocations made by InternalAllocator<U>.
|
||||
+ return true;
|
||||
+ }
|
||||
|
||||
value_type* allocate(std::size_t count);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- src/content/browser/renderer_host/render_frame_host_impl.cc.orig 2023-02-08 21:38:09.974003318 +0100
|
||||
+++ src/content/browser/renderer_host/render_frame_host_impl.cc 2023-02-13 14:13:50.217792624 +0100
|
||||
@@ -5,6 +5,7 @@
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <deque>
|
||||
#include <limits>
|
||||
#include <memory>
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <optional>
|
||||
#include <tuple>
|
||||
#include <unordered_map>
|
||||
@@ -1876,7 +1877,12 @@
|
||||
@@ -1818,7 +1819,12 @@ RenderFrameHostImpl::~RenderFrameHostImp
|
||||
// `DocumentService` and `RenderFrameHostUserData` subclasses are still valid
|
||||
// when their destructors run.
|
||||
document_associated_data_->RemoveAllServices();
|
||||
@@ -22,3 +22,14 @@
|
||||
|
||||
// If this was the last active frame in the SiteInstanceGroup, the
|
||||
// DecrementActiveFrameCount call will trigger the deletion of the
|
||||
@@ -13254,7 +13260,9 @@ bool RenderFrameHostImpl::DidCommitNavig
|
||||
// RenderFrameHost commits before the navigation commits. This happens
|
||||
// when the current RenderFrameHost crashes before navigating to a new
|
||||
// URL.
|
||||
- document_associated_data_.emplace(*this,
|
||||
+ // bsc#1227307 — same root cause as above
|
||||
+ document_associated_data_->~DocumentAssociatedData();
|
||||
+ new(&document_associated_data_) std::optional<DocumentAssociatedData>(std::in_place, *this,
|
||||
navigation_request->GetDocumentToken());
|
||||
} else {
|
||||
// Cross-RenderFrameHost navigations that commit into a speculative
|
||||
|
||||
39
angle-FramebufferVk-powf.patch
Normal file
39
angle-FramebufferVk-powf.patch
Normal file
@@ -0,0 +1,39 @@
|
||||
From 2f934a47e9709cac9ce04d312b7aa496948bced6 Mon Sep 17 00:00:00 2001
|
||||
From: Jose Dapena Paz <jdapena@igalia.com>
|
||||
Date: Mon, 18 Mar 2024 12:53:27 +0100
|
||||
Subject: [PATCH] libstdc++: replace std::powf with std:pow
|
||||
|
||||
libstdc++ before GCC 14 does not provide std::powf. So replace the
|
||||
call with std::pow, that provides an overload for floats.
|
||||
|
||||
For reference of the bug tracking the missing methods in libstdc++:
|
||||
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79700
|
||||
|
||||
Bug: chromium:41455655
|
||||
Change-Id: Idfb53fe3c71f4dc0198cf6ba3e26c07895f65bc6
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5379670
|
||||
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
|
||||
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
|
||||
---
|
||||
src/libANGLE/renderer/vulkan/FramebufferVk.cpp | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/libANGLE/renderer/vulkan/FramebufferVk.cpp b/src/libANGLE/renderer/vulkan/FramebufferVk.cpp
|
||||
index 98831436adb..e88339521e6 100644
|
||||
--- a/third_party/angle/src/libANGLE/renderer/vulkan/FramebufferVk.cpp
|
||||
+++ b/third_party/angle/src/libANGLE/renderer/vulkan/FramebufferVk.cpp
|
||||
@@ -1726,10 +1726,10 @@ angle::Result FramebufferVk::generateFragmentShadingRateWithCPU(
|
||||
for (uint32_t point = 0; point < activeFocalPoints.size(); point++)
|
||||
{
|
||||
float density =
|
||||
- 1.0f / std::max(std::powf(activeFocalPoints[point].focalX - px, 2) *
|
||||
- std::powf(activeFocalPoints[point].gainX, 2) +
|
||||
- std::powf(activeFocalPoints[point].focalY - py, 2) *
|
||||
- std::powf(activeFocalPoints[point].gainY, 2) -
|
||||
+ 1.0f / std::max(std::pow(activeFocalPoints[point].focalX - px, 2.0f) *
|
||||
+ std::pow(activeFocalPoints[point].gainX, 2.0f) +
|
||||
+ std::pow(activeFocalPoints[point].focalY - py, 2.0f) *
|
||||
+ std::pow(activeFocalPoints[point].gainY, 2.0f) -
|
||||
activeFocalPoints[point].foveaArea,
|
||||
1.0f);
|
||||
|
||||
@@ -2,7 +2,7 @@ Remove this code which is disabled (media/base/media_switches.cc) and depends on
|
||||
|
||||
--- src/media/base/libaom_thread_wrapper.cc.old 2024-04-02 09:53:17.097624400 +0000
|
||||
+++ src/media/base/libaom_thread_wrapper.cc 2024-04-08 17:15:53.578155000 +0000
|
||||
@@ -5,16 +5,8 @@
|
||||
@@ -5,17 +5,8 @@
|
||||
#include "base/logging.h"
|
||||
#include "media/base/codec_worker_impl.h"
|
||||
#include "media/base/libvpx_thread_wrapper.h"
|
||||
@@ -13,15 +13,16 @@ Remove this code which is disabled (media/base/media_switches.cc) and depends on
|
||||
-void InitLibAomThreadWrapper() {
|
||||
- const AVxWorkerInterface interface =
|
||||
- CodecWorkerImpl<AVxWorkerInterface, AVxWorkerImpl, AVxWorker,
|
||||
- AVxWorkerStatus, NOT_OK, OK,
|
||||
- WORK>::GetCodecWorkerInterface();
|
||||
- AVxWorkerStatus, AVX_WORKER_STATUS_NOT_OK,
|
||||
- AVX_WORKER_STATUS_OK,
|
||||
- AVX_WORKER_STATUS_WORKING>::GetCodecWorkerInterface();
|
||||
- CHECK(aom_set_worker_interface(&interface));
|
||||
-}
|
||||
|
||||
} // namespace media
|
||||
--- src/media/base/libvpx_thread_wrapper.cc.old 2024-04-02 09:53:17.097624400 +0000
|
||||
+++ src/media/base/libvpx_thread_wrapper.cc 2024-04-08 17:15:46.565471400 +0000
|
||||
@@ -5,17 +5,8 @@
|
||||
@@ -5,18 +5,8 @@
|
||||
#include "media/base/libvpx_thread_wrapper.h"
|
||||
|
||||
#include "media/base/codec_worker_impl.h"
|
||||
@@ -32,8 +33,9 @@ Remove this code which is disabled (media/base/media_switches.cc) and depends on
|
||||
-void InitLibVpxThreadWrapper() {
|
||||
- const VPxWorkerInterface interface =
|
||||
- CodecWorkerImpl<VPxWorkerInterface, VPxWorkerImpl, VPxWorker,
|
||||
- VPxWorkerStatus, NOT_OK, OK,
|
||||
- WORK>::GetCodecWorkerInterface();
|
||||
- VPxWorkerStatus, VPX_WORKER_STATUS_NOT_OK,
|
||||
- VPX_WORKER_STATUS_OK,
|
||||
- VPX_WORKER_STATUS_WORKING>::GetCodecWorkerInterface();
|
||||
-
|
||||
- CHECK(vpx_set_worker_interface(&interface));
|
||||
-}
|
||||
|
||||
98
async_iterable-forwarding.patch
Normal file
98
async_iterable-forwarding.patch
Normal file
@@ -0,0 +1,98 @@
|
||||
From e4d212302ed2e71c224ae67bdaf2a2816be34f21 Mon Sep 17 00:00:00 2001
|
||||
From: Mattias Buelens <mattias.buelens@gmail.com>
|
||||
Date: Tue, 26 Mar 2024 19:25:54 +0000
|
||||
Subject: [PATCH] streams: Fix gcc compatibility for
|
||||
ReadableStream::valuesForBinding()
|
||||
|
||||
The perfect forwarding technique we used turned out to be incompatible
|
||||
with gcc. Revert to something simpler.
|
||||
|
||||
Bug: 40612900
|
||||
Change-Id: I45f3588354fe96159c7f84d969ac222a935b1c1a
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5372645
|
||||
Reviewed-by: Adam Rice <ricea@chromium.org>
|
||||
Reviewed-by: Yuki Shiino <yukishiino@chromium.org>
|
||||
Commit-Queue: Adam Rice <ricea@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#1278534}
|
||||
---
|
||||
.../bindings/core/v8/async_iterable.h | 32 +++++++++----------
|
||||
1 file changed, 16 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/third_party/blink/renderer/bindings/core/v8/async_iterable.h b/third_party/blink/renderer/bindings/core/v8/async_iterable.h
|
||||
index 115ee5303414c..8a0d085b8174e 100644
|
||||
--- a/third_party/blink/renderer/bindings/core/v8/async_iterable.h
|
||||
+++ b/third_party/blink/renderer/bindings/core/v8/async_iterable.h
|
||||
@@ -200,42 +200,42 @@ class PairAsyncIterable {
|
||||
PairAsyncIterable(const PairAsyncIterable&) = delete;
|
||||
PairAsyncIterable& operator=(const PairAsyncIterable&) = delete;
|
||||
|
||||
+ template <typename... ArgsAndExceptionState>
|
||||
AsyncIteratorType* keysForBinding(
|
||||
ScriptState* script_state,
|
||||
- std::convertible_to<InitArgs> auto&&... args,
|
||||
- ExceptionState& exception_state) {
|
||||
+ ArgsAndExceptionState&&... args_and_exception_state) {
|
||||
const auto kind = IterationSource::Kind::kKey;
|
||||
IterationSource* source = CreateIterationSource(
|
||||
- script_state, kind, std::forward<decltype(args)>(args)...,
|
||||
- exception_state);
|
||||
+ script_state, kind,
|
||||
+ std::forward<ArgsAndExceptionState>(args_and_exception_state)...);
|
||||
if (!source) {
|
||||
return nullptr;
|
||||
}
|
||||
return MakeGarbageCollected<AsyncIteratorType>(source);
|
||||
}
|
||||
|
||||
+ template <typename... ArgsAndExceptionState>
|
||||
AsyncIteratorType* valuesForBinding(
|
||||
ScriptState* script_state,
|
||||
- std::convertible_to<InitArgs> auto&&... args,
|
||||
- ExceptionState& exception_state) {
|
||||
+ ArgsAndExceptionState&&... args_and_exception_state) {
|
||||
const auto kind = IterationSource::Kind::kValue;
|
||||
IterationSource* source = CreateIterationSource(
|
||||
- script_state, kind, std::forward<decltype(args)>(args)...,
|
||||
- exception_state);
|
||||
+ script_state, kind,
|
||||
+ std::forward<ArgsAndExceptionState>(args_and_exception_state)...);
|
||||
if (!source) {
|
||||
return nullptr;
|
||||
}
|
||||
return MakeGarbageCollected<AsyncIteratorType>(source);
|
||||
}
|
||||
|
||||
+ template <typename... ArgsAndExceptionState>
|
||||
AsyncIteratorType* entriesForBinding(
|
||||
ScriptState* script_state,
|
||||
- std::convertible_to<InitArgs> auto&&... args,
|
||||
- ExceptionState& exception_state) {
|
||||
+ ArgsAndExceptionState&&... args_and_exception_state) {
|
||||
const auto kind = IterationSource::Kind::kKeyValue;
|
||||
IterationSource* source = CreateIterationSource(
|
||||
- script_state, kind, std::forward<decltype(args)>(args)...,
|
||||
- exception_state);
|
||||
+ script_state, kind,
|
||||
+ std::forward<ArgsAndExceptionState>(args_and_exception_state)...);
|
||||
if (!source) {
|
||||
return nullptr;
|
||||
}
|
||||
@@ -274,14 +274,14 @@ class ValueAsyncIterable {
|
||||
ValueAsyncIterable(const ValueAsyncIterable&) = delete;
|
||||
ValueAsyncIterable& operator=(const ValueAsyncIterable&) = delete;
|
||||
|
||||
+ template <typename... ArgsAndExceptionState>
|
||||
AsyncIteratorType* valuesForBinding(
|
||||
ScriptState* script_state,
|
||||
- std::convertible_to<InitArgs> auto&&... args,
|
||||
- ExceptionState& exception_state) {
|
||||
+ ArgsAndExceptionState&&... args_and_exception_state) {
|
||||
const auto kind = IterationSource::Kind::kValue;
|
||||
IterationSource* source = CreateIterationSource(
|
||||
- script_state, kind, std::forward<decltype(args)>(args)...,
|
||||
- exception_state);
|
||||
+ script_state, kind,
|
||||
+ std::forward<ArgsAndExceptionState>(args_and_exception_state)...);
|
||||
if (!source) {
|
||||
return nullptr;
|
||||
}
|
||||
250
bad-font-gc0.patch
Normal file
250
bad-font-gc0.patch
Normal file
@@ -0,0 +1,250 @@
|
||||
Revert the following commit:
|
||||
|
||||
commit 886c849ee96e3026d28d7615cdd5af9628a2e5c8
|
||||
Author: Ian Kilpatrick <ikilpatrick@chromium.org>
|
||||
Date: Tue Feb 20 18:18:04 2024 +0000
|
||||
|
||||
[gc] Make UnicodeRangeSet gc'd.
|
||||
|
||||
There should be no user-visible behaviour change.
|
||||
|
||||
Bug: 41490008
|
||||
Change-Id: I7f0003b7ff7c464d4ee36442bcff8c63da79b20c
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5302778
|
||||
Reviewed-by: Dominik Röttsches <drott@chromium.org>
|
||||
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#1262789}
|
||||
|
||||
--- a/third_party/blink/renderer/core/css/css_font_face.cc
|
||||
+++ b/third_party/blink/renderer/core/css/css_font_face.cc
|
||||
@@ -291,7 +291,6 @@ bool CSSFontFace::UpdatePeriod() {
|
||||
void CSSFontFace::Trace(Visitor* visitor) const {
|
||||
visitor->Trace(segmented_font_faces_);
|
||||
visitor->Trace(sources_);
|
||||
- visitor->Trace(ranges_);
|
||||
visitor->Trace(font_face_);
|
||||
}
|
||||
|
||||
--- a/third_party/blink/renderer/core/css/css_font_face.h
|
||||
+++ b/third_party/blink/renderer/core/css/css_font_face.h
|
||||
@@ -47,8 +47,8 @@ class SimpleFontData;
|
||||
|
||||
class CORE_EXPORT CSSFontFace final : public GarbageCollected<CSSFontFace> {
|
||||
public:
|
||||
- CSSFontFace(FontFace* font_face, HeapVector<UnicodeRange>&& ranges)
|
||||
- : ranges_(MakeGarbageCollected<UnicodeRangeSet>(std::move(ranges))),
|
||||
+ CSSFontFace(FontFace* font_face, Vector<UnicodeRange>& ranges)
|
||||
+ : ranges_(base::AdoptRef(new UnicodeRangeSet(ranges))),
|
||||
font_face_(font_face) {
|
||||
DCHECK(font_face_);
|
||||
}
|
||||
@@ -61,7 +61,7 @@ class CORE_EXPORT CSSFontFace final : pu
|
||||
}
|
||||
FontFace* GetFontFace() const { return font_face_.Get(); }
|
||||
|
||||
- const UnicodeRangeSet* Ranges() { return ranges_.Get(); }
|
||||
+ scoped_refptr<UnicodeRangeSet> Ranges() { return ranges_; }
|
||||
|
||||
void AddSegmentedFontFace(CSSSegmentedFontFace*);
|
||||
void RemoveSegmentedFontFace(CSSSegmentedFontFace*);
|
||||
@@ -98,9 +98,9 @@ class CORE_EXPORT CSSFontFace final : pu
|
||||
private:
|
||||
void SetLoadStatus(FontFace::LoadStatusType);
|
||||
|
||||
+ scoped_refptr<UnicodeRangeSet> ranges_;
|
||||
HeapHashSet<Member<CSSSegmentedFontFace>> segmented_font_faces_;
|
||||
HeapDeque<Member<CSSFontFaceSource>> sources_;
|
||||
- Member<const UnicodeRangeSet> ranges_;
|
||||
Member<FontFace> font_face_;
|
||||
};
|
||||
|
||||
--- a/third_party/blink/renderer/core/css/font_face.cc
|
||||
+++ b/third_party/blink/renderer/core/css/font_face.cc
|
||||
@@ -90,7 +90,7 @@ const CSSValue* ParseCSSValue(const Exec
|
||||
|
||||
CSSFontFace* CreateCSSFontFace(FontFace* font_face,
|
||||
const CSSValue* unicode_range) {
|
||||
- HeapVector<UnicodeRange> ranges;
|
||||
+ Vector<UnicodeRange> ranges;
|
||||
if (const auto* range_list = To<CSSValueList>(unicode_range)) {
|
||||
unsigned num_ranges = range_list->length();
|
||||
for (unsigned i = 0; i < num_ranges; i++) {
|
||||
@@ -100,7 +100,7 @@ CSSFontFace* CreateCSSFontFace(FontFace*
|
||||
}
|
||||
}
|
||||
|
||||
- return MakeGarbageCollected<CSSFontFace>(font_face, std::move(ranges));
|
||||
+ return MakeGarbageCollected<CSSFontFace>(font_face, ranges);
|
||||
}
|
||||
|
||||
const CSSValue* ConvertFontMetricOverrideValue(const CSSValue* parsed_value) {
|
||||
--- a/third_party/blink/renderer/platform/fonts/font_data_for_range_set.h
|
||||
+++ b/third_party/blink/renderer/platform/fonts/font_data_for_range_set.h
|
||||
@@ -39,18 +39,16 @@ class SimpleFontData;
|
||||
class PLATFORM_EXPORT FontDataForRangeSet
|
||||
: public GarbageCollected<FontDataForRangeSet> {
|
||||
public:
|
||||
- explicit FontDataForRangeSet(const SimpleFontData* font_data = nullptr,
|
||||
- const UnicodeRangeSet* range_set = nullptr)
|
||||
- : font_data_(font_data), range_set_(range_set) {}
|
||||
+ explicit FontDataForRangeSet(
|
||||
+ const SimpleFontData* font_data = nullptr,
|
||||
+ scoped_refptr<UnicodeRangeSet> range_set = nullptr)
|
||||
+ : font_data_(font_data), range_set_(std::move(range_set)) {}
|
||||
|
||||
FontDataForRangeSet(const FontDataForRangeSet& other);
|
||||
|
||||
virtual ~FontDataForRangeSet() = default;
|
||||
|
||||
- void Trace(Visitor* visitor) const {
|
||||
- visitor->Trace(font_data_);
|
||||
- visitor->Trace(range_set_);
|
||||
- }
|
||||
+ void Trace(Visitor* visitor) const { visitor->Trace(font_data_); }
|
||||
|
||||
bool Contains(UChar32 test_char) const {
|
||||
return !range_set_ || range_set_->Contains(test_char);
|
||||
@@ -58,7 +56,7 @@ class PLATFORM_EXPORT FontDataForRangeSe
|
||||
bool IsEntireRange() const {
|
||||
return !range_set_ || range_set_->IsEntireRange();
|
||||
}
|
||||
- const UnicodeRangeSet* Ranges() const { return range_set_.Get(); }
|
||||
+ UnicodeRangeSet* Ranges() const { return range_set_.get(); }
|
||||
bool HasFontData() const { return font_data_; }
|
||||
const SimpleFontData* FontData() const { return font_data_.Get(); }
|
||||
|
||||
@@ -74,7 +72,7 @@ class PLATFORM_EXPORT FontDataForRangeSe
|
||||
|
||||
protected:
|
||||
Member<const SimpleFontData> font_data_;
|
||||
- Member<const UnicodeRangeSet> range_set_;
|
||||
+ scoped_refptr<UnicodeRangeSet> range_set_;
|
||||
};
|
||||
|
||||
} // namespace blink
|
||||
--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc
|
||||
+++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc
|
||||
@@ -508,10 +508,10 @@ const OpenTypeVerticalData& HarfBuzzFace
|
||||
return *harfbuzz_font_data_->VerticalData();
|
||||
}
|
||||
|
||||
-hb_font_t* HarfBuzzFace::GetScaledFont(const UnicodeRangeSet* range_set,
|
||||
+hb_font_t* HarfBuzzFace::GetScaledFont(scoped_refptr<UnicodeRangeSet> range_set,
|
||||
VerticalLayoutCallbacks vertical_layout,
|
||||
float specified_size) const {
|
||||
- harfbuzz_font_data_->range_set_ = range_set;
|
||||
+ harfbuzz_font_data_->range_set_ = std::move(range_set);
|
||||
harfbuzz_font_data_->UpdateFallbackMetricsAndScale(*platform_data_,
|
||||
vertical_layout);
|
||||
|
||||
--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h
|
||||
+++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h
|
||||
@@ -66,7 +66,7 @@ class HarfBuzzFace final : public Garbag
|
||||
// Passing in specified_size in order to control selecting the right value
|
||||
// from the trak table. If not set, the size of the internal FontPlatformData
|
||||
// object will be used.
|
||||
- hb_font_t* GetScaledFont(const UnicodeRangeSet*,
|
||||
+ hb_font_t* GetScaledFont(scoped_refptr<UnicodeRangeSet>,
|
||||
VerticalLayoutCallbacks,
|
||||
float specified_size) const;
|
||||
|
||||
--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_data.h
|
||||
+++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_data.h
|
||||
@@ -32,7 +32,7 @@ struct HarfBuzzFontData final : public G
|
||||
HarfBuzzFontData(const HarfBuzzFontData&) = delete;
|
||||
HarfBuzzFontData& operator=(const HarfBuzzFontData&) = delete;
|
||||
|
||||
- void Trace(Visitor* visitor) const { visitor->Trace(range_set_); }
|
||||
+ void Trace(Visitor*) const {}
|
||||
|
||||
// The vertical origin and vertical advance functions in HarfBuzzFace require
|
||||
// the ascent and height metrics as fallback in case no specific vertical
|
||||
@@ -98,7 +98,7 @@ struct HarfBuzzFontData final : public G
|
||||
SpaceGlyphInOpenTypeTables::kUnknown;
|
||||
|
||||
scoped_refptr<OpenTypeVerticalData> vertical_data_;
|
||||
- Member<const UnicodeRangeSet> range_set_;
|
||||
+ scoped_refptr<UnicodeRangeSet> range_set_;
|
||||
};
|
||||
|
||||
} // namespace blink
|
||||
--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_shaper.cc
|
||||
+++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_shaper.cc
|
||||
@@ -289,7 +289,7 @@ void RoundHarfBuzzBufferPositions(hb_buf
|
||||
inline bool ShapeRange(hb_buffer_t* buffer,
|
||||
const FontFeatures& font_features,
|
||||
const SimpleFontData* current_font,
|
||||
- const UnicodeRangeSet* current_font_range_set,
|
||||
+ scoped_refptr<UnicodeRangeSet> current_font_range_set,
|
||||
UScriptCode current_run_script,
|
||||
hb_direction_t direction,
|
||||
hb_language_t language,
|
||||
@@ -325,7 +325,7 @@ inline bool ShapeRange(hb_buffer_t* buff
|
||||
hb_buffer_set_direction(buffer, direction);
|
||||
|
||||
hb_font_t* hb_font =
|
||||
- face->GetScaledFont(current_font_range_set,
|
||||
+ face->GetScaledFont(std::move(current_font_range_set),
|
||||
HB_DIRECTION_IS_VERTICAL(direction)
|
||||
? HarfBuzzFace::kPrepareForVerticalLayout
|
||||
: HarfBuzzFace::kNoVerticalLayout,
|
||||
--- a/third_party/blink/renderer/platform/fonts/unicode_range_set.cc
|
||||
+++ b/third_party/blink/renderer/platform/fonts/unicode_range_set.cc
|
||||
@@ -31,8 +31,8 @@
|
||||
|
||||
namespace blink {
|
||||
|
||||
-UnicodeRangeSet::UnicodeRangeSet(HeapVector<UnicodeRange>&& ranges)
|
||||
- : ranges_(std::move(ranges)) {
|
||||
+UnicodeRangeSet::UnicodeRangeSet(const Vector<UnicodeRange>& ranges)
|
||||
+ : ranges_(ranges) {
|
||||
if (ranges_.empty())
|
||||
return;
|
||||
|
||||
--- a/third_party/blink/renderer/platform/fonts/unicode_range_set.h
|
||||
+++ b/third_party/blink/renderer/platform/fonts/unicode_range_set.h
|
||||
@@ -26,12 +26,13 @@
|
||||
#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_UNICODE_RANGE_SET_H_
|
||||
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_UNICODE_RANGE_SET_H_
|
||||
|
||||
-#include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h"
|
||||
-#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
|
||||
#include "third_party/blink/renderer/platform/platform_export.h"
|
||||
+#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
|
||||
#include "third_party/blink/renderer/platform/wtf/text/character_names.h"
|
||||
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
|
||||
#include "third_party/blink/renderer/platform/wtf/text/wtf_uchar.h"
|
||||
+#include "third_party/blink/renderer/platform/wtf/thread_safe_ref_counted.h"
|
||||
+#include "third_party/blink/renderer/platform/wtf/vector.h"
|
||||
|
||||
namespace blink {
|
||||
|
||||
@@ -55,14 +56,13 @@ struct PLATFORM_EXPORT UnicodeRange fina
|
||||
UChar32 to_;
|
||||
};
|
||||
|
||||
-class PLATFORM_EXPORT UnicodeRangeSet
|
||||
- : public GarbageCollected<UnicodeRangeSet> {
|
||||
+class PLATFORM_EXPORT UnicodeRangeSet : public RefCounted<UnicodeRangeSet> {
|
||||
+ USING_FAST_MALLOC(UnicodeRangeSet);
|
||||
+
|
||||
public:
|
||||
- explicit UnicodeRangeSet(HeapVector<UnicodeRange>&&);
|
||||
+ explicit UnicodeRangeSet(const Vector<UnicodeRange>&);
|
||||
UnicodeRangeSet() = default;
|
||||
|
||||
- void Trace(Visitor* visitor) const { visitor->Trace(ranges_); }
|
||||
-
|
||||
bool Contains(UChar32) const;
|
||||
bool IntersectsWith(const String&) const;
|
||||
bool IsEntireRange() const { return ranges_.empty(); }
|
||||
@@ -71,8 +71,7 @@ class PLATFORM_EXPORT UnicodeRangeSet
|
||||
bool operator==(const UnicodeRangeSet& other) const;
|
||||
|
||||
private:
|
||||
- HeapVector<UnicodeRange>
|
||||
- ranges_; // If empty, represents the whole code space.
|
||||
+ Vector<UnicodeRange> ranges_; // If empty, represents the whole code space.
|
||||
};
|
||||
|
||||
} // namespace blink
|
||||
159
bad-font-gc00.patch
Normal file
159
bad-font-gc00.patch
Normal file
@@ -0,0 +1,159 @@
|
||||
Revert the following commit:
|
||||
|
||||
commit 59daae50fc3c47f7a8dbcc828446fdaa9f8c12c4
|
||||
Author: Ian Kilpatrick <ikilpatrick@chromium.org>
|
||||
Date: Tue Feb 20 18:35:11 2024 +0000
|
||||
|
||||
[gc] Make OpenTypeVerticalData gc'd.
|
||||
|
||||
There should be no user-visible behaviour change.
|
||||
|
||||
Bug: 41490008
|
||||
Change-Id: Id93c85a7beb710944e07cff614cff2409c818436
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5302893
|
||||
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
|
||||
Reviewed-by: Dominik Röttsches <drott@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#1262805}
|
||||
|
||||
--- a/third_party/blink/renderer/platform/fonts/font_platform_data.cc
|
||||
+++ b/third_party/blink/renderer/platform/fonts/font_platform_data.cc
|
||||
@@ -308,6 +308,11 @@ SkFont FontPlatformData::CreateSkFont(co
|
||||
}
|
||||
#endif // !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_IOS)
|
||||
|
||||
+scoped_refptr<OpenTypeVerticalData> FontPlatformData::CreateVerticalData()
|
||||
+ const {
|
||||
+ return OpenTypeVerticalData::CreateUnscaled(typeface_);
|
||||
+}
|
||||
+
|
||||
IdentifiableToken FontPlatformData::ComputeTypefaceDigest() const {
|
||||
DCHECK(typeface_);
|
||||
int table_count = typeface_->countTables();
|
||||
--- a/third_party/blink/renderer/platform/fonts/font_platform_data.h
|
||||
+++ b/third_party/blink/renderer/platform/fonts/font_platform_data.h
|
||||
@@ -59,6 +59,7 @@ typedef const struct __CTFont* CTFontRef
|
||||
namespace blink {
|
||||
|
||||
class HarfBuzzFace;
|
||||
+class OpenTypeVerticalData;
|
||||
|
||||
class PLATFORM_EXPORT FontPlatformData
|
||||
: public GarbageCollected<FontPlatformData> {
|
||||
@@ -137,6 +138,8 @@ class PLATFORM_EXPORT FontPlatformData
|
||||
|
||||
SkFont CreateSkFont(const FontDescription* = nullptr) const;
|
||||
|
||||
+ scoped_refptr<OpenTypeVerticalData> CreateVerticalData() const;
|
||||
+
|
||||
// Computes a digest from the typeface. The digest only depends on the
|
||||
// underlying font itself, and does not vary by the style (size, weight,
|
||||
// italics, etc). This is aimed at discovering the fingerprinting information
|
||||
--- a/third_party/blink/renderer/platform/fonts/opentype/open_type_vertical_data.h
|
||||
+++ b/third_party/blink/renderer/platform/fonts/opentype/open_type_vertical_data.h
|
||||
@@ -27,10 +27,10 @@
|
||||
|
||||
#include "base/memory/scoped_refptr.h"
|
||||
#include "third_party/blink/renderer/platform/fonts/glyph.h"
|
||||
-#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
|
||||
#include "third_party/blink/renderer/platform/platform_export.h"
|
||||
#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
|
||||
#include "third_party/blink/renderer/platform/wtf/hash_map.h"
|
||||
+#include "third_party/blink/renderer/platform/wtf/ref_counted.h"
|
||||
#include "third_party/blink/renderer/platform/wtf/vector.h"
|
||||
#include "third_party/skia/include/core/SkRefCnt.h"
|
||||
#include "third_party/skia/include/core/SkTypeface.h"
|
||||
@@ -40,11 +40,14 @@ class SkFont;
|
||||
namespace blink {
|
||||
|
||||
class PLATFORM_EXPORT OpenTypeVerticalData
|
||||
- : public GarbageCollected<OpenTypeVerticalData> {
|
||||
- public:
|
||||
- explicit OpenTypeVerticalData(sk_sp<SkTypeface>);
|
||||
+ : public RefCounted<OpenTypeVerticalData> {
|
||||
+ USING_FAST_MALLOC(OpenTypeVerticalData);
|
||||
|
||||
- void Trace(Visitor*) const {}
|
||||
+ public:
|
||||
+ static scoped_refptr<OpenTypeVerticalData> CreateUnscaled(
|
||||
+ sk_sp<SkTypeface> typeface) {
|
||||
+ return base::AdoptRef(new OpenTypeVerticalData(typeface));
|
||||
+ }
|
||||
|
||||
void SetScaleAndFallbackMetrics(float size_per_unit,
|
||||
float ascent,
|
||||
@@ -60,6 +63,8 @@ class PLATFORM_EXPORT OpenTypeVerticalDa
|
||||
float* out_xy_array) const;
|
||||
|
||||
private:
|
||||
+ explicit OpenTypeVerticalData(sk_sp<SkTypeface>);
|
||||
+
|
||||
void LoadMetrics(sk_sp<SkTypeface>);
|
||||
bool HasVORG() const { return !vert_origin_y_.empty(); }
|
||||
|
||||
--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc
|
||||
+++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc
|
||||
@@ -167,7 +167,8 @@ static hb_bool_t HarfBuzzGetGlyphVertica
|
||||
void* user_data) {
|
||||
HarfBuzzFontData* hb_font_data =
|
||||
reinterpret_cast<HarfBuzzFontData*>(font_data);
|
||||
- OpenTypeVerticalData* vertical_data = hb_font_data->VerticalData();
|
||||
+ scoped_refptr<OpenTypeVerticalData> vertical_data =
|
||||
+ hb_font_data->VerticalData();
|
||||
if (!vertical_data)
|
||||
return false;
|
||||
|
||||
@@ -186,7 +187,8 @@ static hb_position_t HarfBuzzGetGlyphVer
|
||||
void* user_data) {
|
||||
HarfBuzzFontData* hb_font_data =
|
||||
reinterpret_cast<HarfBuzzFontData*>(font_data);
|
||||
- OpenTypeVerticalData* vertical_data = hb_font_data->VerticalData();
|
||||
+ scoped_refptr<OpenTypeVerticalData> vertical_data =
|
||||
+ hb_font_data->VerticalData();
|
||||
if (!vertical_data) {
|
||||
return SkiaScalarToHarfBuzzPosition(hb_font_data->height_fallback_);
|
||||
}
|
||||
--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_data.h
|
||||
+++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_data.h
|
||||
@@ -32,10 +32,7 @@ struct HarfBuzzFontData final : public G
|
||||
HarfBuzzFontData(const HarfBuzzFontData&) = delete;
|
||||
HarfBuzzFontData& operator=(const HarfBuzzFontData&) = delete;
|
||||
|
||||
- void Trace(Visitor* visitor) const {
|
||||
- visitor->Trace(vertical_data_);
|
||||
- visitor->Trace(range_set_);
|
||||
- }
|
||||
+ void Trace(Visitor* visitor) const { visitor->Trace(range_set_); }
|
||||
|
||||
// The vertical origin and vertical advance functions in HarfBuzzFace require
|
||||
// the ascent and height metrics as fallback in case no specific vertical
|
||||
@@ -70,18 +67,18 @@ struct HarfBuzzFontData final : public G
|
||||
}
|
||||
}
|
||||
|
||||
- OpenTypeVerticalData* VerticalData() {
|
||||
+ scoped_refptr<OpenTypeVerticalData> VerticalData() {
|
||||
if (!vertical_data_) {
|
||||
DCHECK_NE(ascent_fallback_, kInvalidFallbackMetricsValue);
|
||||
DCHECK_NE(height_fallback_, kInvalidFallbackMetricsValue);
|
||||
DCHECK_NE(size_per_unit_, kInvalidFallbackMetricsValue);
|
||||
|
||||
vertical_data_ =
|
||||
- MakeGarbageCollected<OpenTypeVerticalData>(font_.refTypeface());
|
||||
+ OpenTypeVerticalData::CreateUnscaled(font_.refTypeface());
|
||||
}
|
||||
vertical_data_->SetScaleAndFallbackMetrics(size_per_unit_, ascent_fallback_,
|
||||
height_fallback_);
|
||||
- return vertical_data_.Get();
|
||||
+ return vertical_data_;
|
||||
}
|
||||
|
||||
const hb::unique_ptr<hb_font_t> unscaled_font_;
|
||||
@@ -100,7 +97,7 @@ struct HarfBuzzFontData final : public G
|
||||
SpaceGlyphInOpenTypeTables space_in_gsub_ =
|
||||
SpaceGlyphInOpenTypeTables::kUnknown;
|
||||
|
||||
- Member<OpenTypeVerticalData> vertical_data_;
|
||||
+ scoped_refptr<OpenTypeVerticalData> vertical_data_;
|
||||
Member<const UnicodeRangeSet> range_set_;
|
||||
};
|
||||
|
||||
107
bad-font-gc000.patch
Normal file
107
bad-font-gc000.patch
Normal file
@@ -0,0 +1,107 @@
|
||||
Revert the following commit:
|
||||
|
||||
commit 5ffa0446f51e34d06dc0539810a8a5d35ec9e3fc
|
||||
Author: Ian Kilpatrick <ikilpatrick@chromium.org>
|
||||
Date: Thu Feb 22 17:08:22 2024 +0000
|
||||
|
||||
[fonts][perf] Explicitly leak SimpleFontDatas via a LRU cache.
|
||||
|
||||
This adds a strong LRU cache to FontDataCache to retain the most
|
||||
recently used fonts.
|
||||
|
||||
This covers the case where a large amount of DOM is destroyed, and
|
||||
previously we'd release all the font related objects if the GC kicked
|
||||
in.
|
||||
|
||||
Speedometer3 appears to peak at ~75 objects in the cache.
|
||||
|
||||
Results for different cache sizes:
|
||||
|
||||
Cache size: 64 | 32 | 16
|
||||
Speedometer3: +0.9% | +0.5% | +0%
|
||||
|
||||
Bug: 41490008
|
||||
Change-Id: I131b6a79f246e61e13a7d44dddbc1f9e625ed44a
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5314842
|
||||
Reviewed-by: Dominik Röttsches <drott@chromium.org>
|
||||
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#1264027}
|
||||
|
||||
--- a/third_party/blink/renderer/platform/fonts/font_data_cache.cc
|
||||
+++ b/third_party/blink/renderer/platform/fonts/font_data_cache.cc
|
||||
@@ -36,15 +36,6 @@
|
||||
|
||||
namespace blink {
|
||||
|
||||
-namespace {
|
||||
-
|
||||
-// The maximum number of strong references to retain via the LRU.
|
||||
-// This explicitly leaks fonts (and related objects) unless under extreme
|
||||
-// memory pressure where it will be cleared. DO NOT increase unnecessarily.
|
||||
-const wtf_size_t kMaxSize = 64;
|
||||
-
|
||||
-} // namespace
|
||||
-
|
||||
const SimpleFontData* FontDataCache::Get(const FontPlatformData* platform_data,
|
||||
bool subpixel_ascent_descent) {
|
||||
if (!platform_data)
|
||||
@@ -64,16 +55,7 @@ const SimpleFontData* FontDataCache::Get
|
||||
add_result.stored_value->value = MakeGarbageCollected<SimpleFontData>(
|
||||
platform_data, nullptr, subpixel_ascent_descent);
|
||||
}
|
||||
-
|
||||
- const SimpleFontData* result = add_result.stored_value->value;
|
||||
-
|
||||
- // Update our LRU to keep a strong reference to `result`.
|
||||
- strong_reference_lru_.PrependOrMoveToFirst(result);
|
||||
- while (strong_reference_lru_.size() > kMaxSize) {
|
||||
- strong_reference_lru_.pop_back();
|
||||
- }
|
||||
-
|
||||
- return result;
|
||||
+ return add_result.stored_value->value;
|
||||
}
|
||||
|
||||
} // namespace blink
|
||||
--- a/third_party/blink/renderer/platform/fonts/font_data_cache.h
|
||||
+++ b/third_party/blink/renderer/platform/fonts/font_data_cache.h
|
||||
@@ -34,7 +34,6 @@
|
||||
#include "third_party/blink/renderer/platform/fonts/font_platform_data.h"
|
||||
#include "third_party/blink/renderer/platform/fonts/simple_font_data.h"
|
||||
#include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_map.h"
|
||||
-#include "third_party/blink/renderer/platform/heap/collection_support/heap_linked_hash_set.h"
|
||||
|
||||
namespace blink {
|
||||
|
||||
@@ -59,29 +58,17 @@ class FontDataCache final {
|
||||
FontDataCache(const FontDataCache&) = delete;
|
||||
FontDataCache& operator=(const FontDataCache&) = delete;
|
||||
|
||||
- void Trace(Visitor* visitor) const {
|
||||
- visitor->Trace(cache_);
|
||||
- visitor->Trace(strong_reference_lru_);
|
||||
- }
|
||||
+ void Trace(Visitor* visitor) const { visitor->Trace(cache_); }
|
||||
|
||||
const SimpleFontData* Get(const FontPlatformData*,
|
||||
bool subpixel_ascent_descent = false);
|
||||
- void Clear() {
|
||||
- cache_.clear();
|
||||
- strong_reference_lru_.clear();
|
||||
- }
|
||||
+ void Clear() { cache_.clear(); }
|
||||
|
||||
private:
|
||||
HeapHashMap<Member<const FontPlatformData>,
|
||||
WeakMember<const SimpleFontData>,
|
||||
FontDataCacheKeyHashTraits>
|
||||
cache_;
|
||||
-
|
||||
- // The above `cache_` is weak, meaning its entries will potentially be
|
||||
- // cleared if no other references exist.
|
||||
- // This LRU keeps a small (limited) number of strong references alive so they
|
||||
- // won't be cleared in the above cache for performance reasons.
|
||||
- HeapLinkedHashSet<Member<const SimpleFontData>> strong_reference_lru_;
|
||||
};
|
||||
|
||||
} // namespace blink
|
||||
425
bad-font-gc0000.patch
Normal file
425
bad-font-gc0000.patch
Normal file
@@ -0,0 +1,425 @@
|
||||
Revert the following commit:
|
||||
|
||||
|
||||
commit cc6c0b2a9e1dbc96f3ebed713dc71960a29dc4f1
|
||||
Author: Ian Kilpatrick <ikilpatrick@chromium.org>
|
||||
Date: Tue Mar 5 20:27:13 2024 +0000
|
||||
|
||||
Reland "[gc] Make FontFamily immutable."
|
||||
|
||||
This reverts commit 748ed11510ec5bb09cc8b92f67f1f62964f023fa.
|
||||
|
||||
Reason for revert: Previous patch which caused MSAN issue was reapplied.
|
||||
|
||||
Original change's description:
|
||||
> Revert "[gc] Make FontFamily immutable."
|
||||
>
|
||||
> This reverts commit ca3d3085d8b01fc74623d639c615fc57842cd26d.
|
||||
>
|
||||
> Reason for revert: crrev.com/c/5328767 is the reason for failure on some tests on MSAN. Please see crbug.com/327969288 for more details.
|
||||
>
|
||||
> Original change's description:
|
||||
> > [gc] Make FontFamily immutable.
|
||||
> >
|
||||
> > Previously we'd build up font-family lists front to back, but would
|
||||
> > need to mutate them to do so. Instead just build them backwards.
|
||||
> >
|
||||
> > This removes a bunch of problematic APIs (like AppendFamily - which
|
||||
> > doesn't append), and simplifies the code.
|
||||
> >
|
||||
> > This will help avoid atomic write barriers once converted to oilpan.
|
||||
> >
|
||||
> > Bug: 41490008
|
||||
> > Change-Id: Icfcec2d0a1716585cf42985616c02b42b6647943
|
||||
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5322929
|
||||
> > Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
|
||||
> > Reviewed-by: Dominik Röttsches <drott@chromium.org>
|
||||
> > Cr-Commit-Position: refs/heads/main@{#1267168}
|
||||
>
|
||||
> Bug: 41490008, 327969288
|
||||
> Change-Id: Ic69a5707d00cc98b97dcae3f4b8207b452ce5cbd
|
||||
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5333950
|
||||
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
|
||||
> Commit-Queue: Taiyo Mizuhashi <taiyo@chromium.org>
|
||||
> Owners-Override: Taiyo Mizuhashi <taiyo@chromium.org>
|
||||
> Cr-Commit-Position: refs/heads/main@{#1267674}
|
||||
|
||||
Bug: 41490008, 327969288
|
||||
Change-Id: If1d395e324b0be15488ef5410e9bcdb219bb19c6
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5344844
|
||||
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
|
||||
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
|
||||
Cr-Commit-Position: refs/heads/main@{#1268654}
|
||||
|
||||
--- a/third_party/blink/renderer/core/css/css_font_face.cc
|
||||
+++ b/third_party/blink/renderer/core/css/css_font_face.cc
|
||||
@@ -216,8 +216,9 @@ bool CSSFontFace::MaybeLoadFont(const Fo
|
||||
|
||||
void CSSFontFace::Load() {
|
||||
FontDescription font_description;
|
||||
- font_description.SetFamily(
|
||||
- FontFamily(font_face_->family(), FontFamily::Type::kFamilyName));
|
||||
+ FontFamily font_family;
|
||||
+ font_family.SetFamily(font_face_->family(), FontFamily::Type::kFamilyName);
|
||||
+ font_description.SetFamily(font_family);
|
||||
Load(font_description);
|
||||
}
|
||||
|
||||
--- a/third_party/blink/renderer/core/css/font_face_set_document.cc
|
||||
+++ b/third_party/blink/renderer/core/css/font_face_set_document.cc
|
||||
@@ -195,10 +195,13 @@ bool FontFaceSetDocument::ResolveFontSty
|
||||
ComputedStyleBuilder builder =
|
||||
GetDocument()->GetStyleResolver().CreateComputedStyleBuilder();
|
||||
|
||||
- FontDescription default_font_description;
|
||||
- default_font_description.SetFamily(FontFamily(
|
||||
+ FontFamily font_family;
|
||||
+ font_family.SetFamily(
|
||||
FontFaceSet::DefaultFontFamily(),
|
||||
- FontFamily::InferredTypeFor(FontFaceSet::DefaultFontFamily())));
|
||||
+ FontFamily::InferredTypeFor(FontFaceSet::DefaultFontFamily()));
|
||||
+
|
||||
+ FontDescription default_font_description;
|
||||
+ default_font_description.SetFamily(font_family);
|
||||
default_font_description.SetSpecifiedSize(FontFaceSet::kDefaultFontSize);
|
||||
default_font_description.SetComputedSize(FontFaceSet::kDefaultFontSize);
|
||||
|
||||
--- a/third_party/blink/renderer/core/css/font_face_set_worker.cc
|
||||
+++ b/third_party/blink/renderer/core/css/font_face_set_worker.cc
|
||||
@@ -84,10 +84,13 @@ bool FontFaceSetWorker::ResolveFontStyle
|
||||
return false;
|
||||
}
|
||||
|
||||
- FontDescription default_font_description;
|
||||
- default_font_description.SetFamily(FontFamily(
|
||||
+ FontFamily font_family;
|
||||
+ font_family.SetFamily(
|
||||
FontFaceSet::DefaultFontFamily(),
|
||||
- FontFamily::InferredTypeFor(FontFaceSet::DefaultFontFamily())));
|
||||
+ FontFamily::InferredTypeFor(FontFaceSet::DefaultFontFamily()));
|
||||
+
|
||||
+ FontDescription default_font_description;
|
||||
+ default_font_description.SetFamily(font_family);
|
||||
default_font_description.SetSpecifiedSize(FontFaceSet::kDefaultFontSize);
|
||||
default_font_description.SetComputedSize(FontFaceSet::kDefaultFontSize);
|
||||
|
||||
--- a/third_party/blink/renderer/core/css/resolver/font_builder.cc
|
||||
+++ b/third_party/blink/renderer/core/css/resolver/font_builder.cc
|
||||
@@ -54,9 +54,11 @@ void FontBuilder::DidChangeWritingMode()
|
||||
}
|
||||
|
||||
FontFamily FontBuilder::StandardFontFamily() const {
|
||||
+ FontFamily family;
|
||||
const AtomicString& standard_font_family = StandardFontFamilyName();
|
||||
- return FontFamily(standard_font_family,
|
||||
- FontFamily::InferredTypeFor(standard_font_family));
|
||||
+ family.SetFamily(standard_font_family,
|
||||
+ FontFamily::InferredTypeFor(standard_font_family));
|
||||
+ return family;
|
||||
}
|
||||
|
||||
AtomicString FontBuilder::StandardFontFamilyName() const {
|
||||
--- a/third_party/blink/renderer/core/css/resolver/style_builder_converter.cc
|
||||
+++ b/third_party/blink/renderer/core/css/resolver/style_builder_converter.cc
|
||||
@@ -379,8 +379,8 @@ FontDescription::FamilyDescription Style
|
||||
|
||||
if (const auto* system_font =
|
||||
DynamicTo<cssvalue::CSSPendingSystemFontValue>(value)) {
|
||||
- desc.family = FontFamily(system_font->ResolveFontFamily(),
|
||||
- FontFamily::Type::kFamilyName);
|
||||
+ desc.family.SetFamily(system_font->ResolveFontFamily(),
|
||||
+ FontFamily::Type::kFamilyName);
|
||||
return desc;
|
||||
}
|
||||
|
||||
@@ -410,8 +410,10 @@ FontDescription::FamilyDescription Style
|
||||
// Take the previous value and wrap it in a `SharedFontFamily` adding to
|
||||
// the linked list.
|
||||
if (has_value) {
|
||||
- next =
|
||||
- SharedFontFamily::Create(family_name, family_type, std::move(next));
|
||||
+ scoped_refptr<SharedFontFamily> shared = SharedFontFamily::Create();
|
||||
+ shared->SetFamily(family_name, family_type);
|
||||
+ shared->AppendFamily(next);
|
||||
+ next = shared;
|
||||
}
|
||||
family_name = next_family_name;
|
||||
family_type = is_generic ? FontFamily::Type::kGenericFamily
|
||||
@@ -442,7 +444,8 @@ FontDescription::FamilyDescription Style
|
||||
}
|
||||
#endif
|
||||
|
||||
- desc.family = FontFamily(family_name, family_type, std::move(next));
|
||||
+ desc.family.SetFamily(family_name, family_type);
|
||||
+ desc.family.AppendFamily(next);
|
||||
return desc;
|
||||
}
|
||||
|
||||
--- a/third_party/blink/renderer/core/html/canvas/canvas_font_cache.cc
|
||||
+++ b/third_party/blink/renderer/core/html/canvas/canvas_font_cache.cc
|
||||
@@ -29,9 +29,11 @@ const int defaultFontSize = 10;
|
||||
|
||||
const ComputedStyle* CreateDefaultFontStyle(const Document& document) {
|
||||
const AtomicString& default_font_family = font_family_names::kSansSerif;
|
||||
+ FontFamily font_family;
|
||||
+ font_family.SetFamily(default_font_family,
|
||||
+ FontFamily::InferredTypeFor(default_font_family));
|
||||
FontDescription default_font_description;
|
||||
- default_font_description.SetFamily(FontFamily(
|
||||
- default_font_family, FontFamily::InferredTypeFor(default_font_family)));
|
||||
+ default_font_description.SetFamily(font_family);
|
||||
default_font_description.SetSpecifiedSize(defaultFontSize);
|
||||
default_font_description.SetComputedSize(defaultFontSize);
|
||||
ComputedStyleBuilder builder =
|
||||
--- a/third_party/blink/renderer/core/page/drag_image.cc
|
||||
+++ b/third_party/blink/renderer/core/page/drag_image.cc
|
||||
@@ -127,9 +127,11 @@ static Font DeriveDragLabelFont(int size
|
||||
const AtomicString& family =
|
||||
LayoutThemeFontProvider::SystemFontFamily(CSSValueID::kNone);
|
||||
|
||||
+ FontFamily font_family;
|
||||
+ font_family.SetFamily(family, FontFamily::InferredTypeFor(family));
|
||||
+
|
||||
FontDescription description;
|
||||
- description.SetFamily(
|
||||
- FontFamily(family, FontFamily::InferredTypeFor(family)));
|
||||
+ description.SetFamily(font_family);
|
||||
description.SetWeight(font_weight);
|
||||
description.SetSpecifiedSize(size);
|
||||
description.SetComputedSize(size);
|
||||
--- a/third_party/blink/renderer/core/paint/embedded_object_painter.cc
|
||||
+++ b/third_party/blink/renderer/core/paint/embedded_object_painter.cc
|
||||
@@ -32,9 +32,11 @@ static Font ReplacementTextFont(const Do
|
||||
const float size = LayoutThemeFontProvider::SystemFontSize(
|
||||
CSSValueID::kWebkitSmallControl, document);
|
||||
|
||||
+ FontFamily font_family;
|
||||
+ font_family.SetFamily(family, FontFamily::InferredTypeFor(family));
|
||||
+
|
||||
FontDescription font_description;
|
||||
- font_description.SetFamily(
|
||||
- FontFamily(family, FontFamily::InferredTypeFor(family)));
|
||||
+ font_description.SetFamily(font_family);
|
||||
font_description.SetWeight(kBoldWeightValue);
|
||||
font_description.SetSpecifiedSize(size);
|
||||
font_description.SetComputedSize(size);
|
||||
--- a/third_party/blink/renderer/platform/exported/web_font_description.cc
|
||||
+++ b/third_party/blink/renderer/platform/exported/web_font_description.cc
|
||||
@@ -49,10 +49,13 @@ WebFontDescription::WebFontDescription(c
|
||||
}
|
||||
|
||||
WebFontDescription::operator FontDescription() const {
|
||||
+ FontFamily font_family;
|
||||
+ font_family.SetFamily(family, family_is_generic
|
||||
+ ? FontFamily::Type::kGenericFamily
|
||||
+ : FontFamily::Type::kFamilyName);
|
||||
+
|
||||
FontDescription desc;
|
||||
- desc.SetFamily(FontFamily(family, family_is_generic
|
||||
- ? FontFamily::Type::kGenericFamily
|
||||
- : FontFamily::Type::kFamilyName));
|
||||
+ desc.SetFamily(font_family);
|
||||
desc.SetGenericFamily(
|
||||
static_cast<FontDescription::GenericFamilyType>(generic_family));
|
||||
desc.SetSpecifiedSize(size);
|
||||
--- a/third_party/blink/renderer/platform/fonts/font_description.h
|
||||
+++ b/third_party/blink/renderer/platform/fonts/font_description.h
|
||||
@@ -195,6 +195,7 @@ class PLATFORM_EXPORT FontDescription {
|
||||
FamilyDescription GetFamilyDescription() const {
|
||||
return FamilyDescription(GenericFamily(), Family());
|
||||
}
|
||||
+ FontFamily& FirstFamily() { return family_list_; }
|
||||
const FontFamily& FirstFamily() const { return family_list_; }
|
||||
Size GetSize() const {
|
||||
return Size(KeywordSize(), SpecifiedSize(), IsAbsoluteSize());
|
||||
@@ -450,6 +451,10 @@ class PLATFORM_EXPORT FontDescription {
|
||||
return fields_.subpixel_ascent_descent_;
|
||||
}
|
||||
|
||||
+ void SetHashCategory(HashCategory category) {
|
||||
+ fields_.hash_category_ = category;
|
||||
+ }
|
||||
+
|
||||
HashCategory GetHashCategory() const {
|
||||
return static_cast<HashCategory>(fields_.hash_category_);
|
||||
}
|
||||
--- a/third_party/blink/renderer/platform/fonts/font_fallback_list.cc
|
||||
+++ b/third_party/blink/renderer/platform/fonts/font_fallback_list.cc
|
||||
@@ -178,8 +178,9 @@ const FontData* FontFallbackList::GetFon
|
||||
|
||||
if (font_selector_) {
|
||||
// Try the user's preferred standard font.
|
||||
- FontFamily font_family(font_family_names::kWebkitStandard,
|
||||
- FontFamily::Type::kGenericFamily);
|
||||
+ FontFamily font_family;
|
||||
+ font_family.SetFamily(font_family_names::kWebkitStandard,
|
||||
+ FontFamily::Type::kGenericFamily);
|
||||
if (const FontData* data =
|
||||
font_selector_->GetFontData(font_description, font_family)) {
|
||||
return data;
|
||||
--- a/third_party/blink/renderer/platform/fonts/font_family.cc
|
||||
+++ b/third_party/blink/renderer/platform/fonts/font_family.cc
|
||||
@@ -49,6 +49,20 @@ bool operator==(const FontFamily& a, con
|
||||
return true;
|
||||
}
|
||||
|
||||
+wtf_size_t FontFamily::CountNames() const {
|
||||
+ wtf_size_t count = 0;
|
||||
+ for (const FontFamily* font_family = this; font_family;
|
||||
+ font_family = font_family->Next())
|
||||
+ ++count;
|
||||
+ return count;
|
||||
+}
|
||||
+
|
||||
+void FontFamily::AppendFamily(AtomicString family_name, Type family_type) {
|
||||
+ scoped_refptr<SharedFontFamily> appended_family = SharedFontFamily::Create();
|
||||
+ appended_family->SetFamily(family_name, family_type);
|
||||
+ AppendFamily(appended_family);
|
||||
+}
|
||||
+
|
||||
String FontFamily::ToString() const {
|
||||
StringBuilder builder;
|
||||
builder.Append(family_name_);
|
||||
--- a/third_party/blink/renderer/platform/fonts/font_family.h
|
||||
+++ b/third_party/blink/renderer/platform/fonts/font_family.h
|
||||
@@ -39,18 +39,16 @@ class PLATFORM_EXPORT FontFamily {
|
||||
DISALLOW_NEW();
|
||||
|
||||
public:
|
||||
- // https://drafts.csswg.org/css-fonts/#font-family-prop
|
||||
- enum class Type : uint8_t { kFamilyName, kGenericFamily };
|
||||
-
|
||||
- FontFamily(const AtomicString& family_name,
|
||||
- Type family_type,
|
||||
- scoped_refptr<SharedFontFamily> next = nullptr)
|
||||
- : family_name_(family_name),
|
||||
- next_(std::move(next)),
|
||||
- family_type_(family_type) {}
|
||||
FontFamily() = default;
|
||||
~FontFamily();
|
||||
|
||||
+ // https://drafts.csswg.org/css-fonts/#font-family-prop
|
||||
+ enum class Type : uint8_t { kFamilyName, kGenericFamily };
|
||||
+
|
||||
+ void SetFamily(const AtomicString& family_name, Type family_type) {
|
||||
+ family_name_ = family_name;
|
||||
+ family_type_ = family_type;
|
||||
+ }
|
||||
// Return this font family's name. Note that it is never quoted nor escaped.
|
||||
// For web-exposed serialization, please rely instead on the functions
|
||||
// ComputedStyleUtils::ValueForFontFamily(const FontFamily&) and
|
||||
@@ -59,8 +57,13 @@ class PLATFORM_EXPORT FontFamily {
|
||||
const AtomicString& FamilyName() const { return family_name_; }
|
||||
bool FamilyIsGeneric() const { return family_type_ == Type::kGenericFamily; }
|
||||
|
||||
+ // Returns number of linked `FontFamily` including `this`, so return value is
|
||||
+ // greater than or equal to 1. When `Next()` is `nullptr`, return value is 1.
|
||||
+ wtf_size_t CountNames() const;
|
||||
const FontFamily* Next() const;
|
||||
|
||||
+ void AppendFamily(scoped_refptr<SharedFontFamily>);
|
||||
+ void AppendFamily(AtomicString family_name, Type family_type);
|
||||
scoped_refptr<SharedFontFamily> ReleaseNext();
|
||||
|
||||
bool IsPrewarmed() const { return is_prewarmed_; }
|
||||
@@ -93,19 +96,12 @@ class PLATFORM_EXPORT SharedFontFamily :
|
||||
SharedFontFamily(const SharedFontFamily&) = delete;
|
||||
SharedFontFamily& operator=(const SharedFontFamily&) = delete;
|
||||
|
||||
- static scoped_refptr<SharedFontFamily> Create(
|
||||
- const AtomicString& family_name,
|
||||
- Type family_type,
|
||||
- scoped_refptr<SharedFontFamily> next = nullptr) {
|
||||
- return base::AdoptRef(
|
||||
- new SharedFontFamily(family_name, family_type, std::move(next)));
|
||||
+ static scoped_refptr<SharedFontFamily> Create() {
|
||||
+ return base::AdoptRef(new SharedFontFamily);
|
||||
}
|
||||
|
||||
private:
|
||||
- SharedFontFamily(const AtomicString& family_name,
|
||||
- Type family_type,
|
||||
- scoped_refptr<SharedFontFamily> next)
|
||||
- : FontFamily(family_name, family_type, std::move(next)) {}
|
||||
+ SharedFontFamily() = default;
|
||||
};
|
||||
|
||||
PLATFORM_EXPORT bool operator==(const FontFamily&, const FontFamily&);
|
||||
@@ -125,6 +121,10 @@ inline const FontFamily* FontFamily::Nex
|
||||
return next_.get();
|
||||
}
|
||||
|
||||
+inline void FontFamily::AppendFamily(scoped_refptr<SharedFontFamily> family) {
|
||||
+ next_ = std::move(family);
|
||||
+}
|
||||
+
|
||||
inline scoped_refptr<SharedFontFamily> FontFamily::ReleaseNext() {
|
||||
return std::move(next_);
|
||||
}
|
||||
--- a/third_party/blink/renderer/platform/graphics/placeholder_image.cc
|
||||
+++ b/third_party/blink/renderer/platform/graphics/placeholder_image.cc
|
||||
@@ -85,18 +85,23 @@ void DrawCenteredIcon(cc::PaintCanvas* c
|
||||
}
|
||||
|
||||
FontDescription CreatePlaceholderFontDescription(float scale_factor) {
|
||||
- scoped_refptr<SharedFontFamily> arial = SharedFontFamily::Create(
|
||||
- font_family_names::kArial, FontFamily::Type::kFamilyName);
|
||||
- scoped_refptr<SharedFontFamily> helvetica = SharedFontFamily::Create(
|
||||
- font_family_names::kHelvetica, FontFamily::Type::kFamilyName, arial);
|
||||
- scoped_refptr<SharedFontFamily> helvetica_neue =
|
||||
- SharedFontFamily::Create(font_family_names::kHelveticaNeue,
|
||||
- FontFamily::Type::kFamilyName, helvetica);
|
||||
- FontFamily roboto(font_family_names::kRoboto, FontFamily::Type::kFamilyName,
|
||||
- helvetica_neue);
|
||||
-
|
||||
FontDescription description;
|
||||
- description.SetFamily(roboto);
|
||||
+ description.FirstFamily().SetFamily(font_family_names::kRoboto,
|
||||
+ FontFamily::Type::kFamilyName);
|
||||
+
|
||||
+ scoped_refptr<SharedFontFamily> helvetica_neue = SharedFontFamily::Create();
|
||||
+ helvetica_neue->SetFamily(font_family_names::kHelveticaNeue,
|
||||
+ FontFamily::Type::kFamilyName);
|
||||
+ scoped_refptr<SharedFontFamily> helvetica = SharedFontFamily::Create();
|
||||
+ helvetica->SetFamily(font_family_names::kHelvetica,
|
||||
+ FontFamily::Type::kFamilyName);
|
||||
+ scoped_refptr<SharedFontFamily> arial = SharedFontFamily::Create();
|
||||
+ arial->SetFamily(font_family_names::kArial, FontFamily::Type::kFamilyName);
|
||||
+
|
||||
+ helvetica->AppendFamily(std::move(arial));
|
||||
+ helvetica_neue->AppendFamily(std::move(helvetica));
|
||||
+ description.FirstFamily().AppendFamily(std::move(helvetica_neue));
|
||||
+
|
||||
description.SetGenericFamily(FontDescription::kSansSerifFamily);
|
||||
description.SetComputedSize(scale_factor * kFontSize);
|
||||
description.SetWeight(FontSelectionValue(500));
|
||||
--- a/third_party/blink/renderer/platform/testing/font_test_helpers.cc
|
||||
+++ b/third_party/blink/renderer/platform/testing/font_test_helpers.cc
|
||||
@@ -127,9 +127,11 @@ Font CreateTestFont(const AtomicString&
|
||||
size_t data_size,
|
||||
float size,
|
||||
const FontDescription::VariantLigatures* ligatures) {
|
||||
+ FontFamily family;
|
||||
+ family.SetFamily(family_name, FontFamily::Type::kFamilyName);
|
||||
+
|
||||
FontDescription font_description;
|
||||
- font_description.SetFamily(
|
||||
- FontFamily(family_name, FontFamily::Type::kFamilyName));
|
||||
+ font_description.SetFamily(family);
|
||||
font_description.SetSpecifiedSize(size);
|
||||
font_description.SetComputedSize(size);
|
||||
if (ligatures)
|
||||
@@ -143,9 +145,11 @@ Font CreateTestFont(const AtomicString&
|
||||
float size,
|
||||
const FontDescription::VariantLigatures* ligatures,
|
||||
void (*init_font_description)(FontDescription*)) {
|
||||
+ FontFamily family;
|
||||
+ family.SetFamily(family_name, FontFamily::Type::kFamilyName);
|
||||
+
|
||||
FontDescription font_description;
|
||||
- font_description.SetFamily(
|
||||
- FontFamily(family_name, FontFamily::Type::kFamilyName));
|
||||
+ font_description.SetFamily(family);
|
||||
font_description.SetSpecifiedSize(size);
|
||||
font_description.SetComputedSize(size);
|
||||
if (ligatures)
|
||||
258
bad-font-gc1.patch
Normal file
258
bad-font-gc1.patch
Normal file
@@ -0,0 +1,258 @@
|
||||
This is a revert of the commit below. While it doesn't strictly fix any
|
||||
bugs, it's needed to support bad-font-gc2.patch building.
|
||||
|
||||
commit 9a8fc2e22363c954af239c06798bf85a9c928295
|
||||
Author: Ian Kilpatrick <ikilpatrick@chromium.org>
|
||||
Date: Wed Feb 14 19:35:11 2024 +0000
|
||||
|
||||
[gc] Make FontCustomPlatformData gc'd.
|
||||
|
||||
There should be no user-visible behaviour change.
|
||||
|
||||
Bug: 41490008
|
||||
Change-Id: I6364bf4c5b5dce9f99d8e2d7e1f84537c5493c33
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5293060
|
||||
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
|
||||
Reviewed-by: Dominik Röttsches <drott@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#1260637}
|
||||
|
||||
--- a/third_party/blink/renderer/core/css/binary_data_font_face_source.cc
|
||||
+++ b/third_party/blink/renderer/core/css/binary_data_font_face_source.cc
|
||||
@@ -27,16 +27,13 @@ BinaryDataFontFaceSource::BinaryDataFont
|
||||
return;
|
||||
}
|
||||
probe::FontsUpdated(context, font_face, String(),
|
||||
- custom_platform_data_.Get());
|
||||
+ custom_platform_data_.get());
|
||||
}
|
||||
|
||||
-void BinaryDataFontFaceSource::Trace(Visitor* visitor) const {
|
||||
- visitor->Trace(custom_platform_data_);
|
||||
- CSSFontFaceSource::Trace(visitor);
|
||||
-}
|
||||
+BinaryDataFontFaceSource::~BinaryDataFontFaceSource() = default;
|
||||
|
||||
bool BinaryDataFontFaceSource::IsValid() const {
|
||||
- return custom_platform_data_;
|
||||
+ return custom_platform_data_.get();
|
||||
}
|
||||
|
||||
SimpleFontData* BinaryDataFontFaceSource::CreateFontData(
|
||||
--- a/third_party/blink/renderer/core/css/binary_data_font_face_source.h
|
||||
+++ b/third_party/blink/renderer/core/css/binary_data_font_face_source.h
|
||||
@@ -16,14 +16,14 @@ class FontCustomPlatformData;
|
||||
class BinaryDataFontFaceSource final : public CSSFontFaceSource {
|
||||
public:
|
||||
BinaryDataFontFaceSource(CSSFontFace*, SharedBuffer*, String&);
|
||||
- void Trace(Visitor*) const override;
|
||||
+ ~BinaryDataFontFaceSource() override;
|
||||
bool IsValid() const override;
|
||||
|
||||
private:
|
||||
SimpleFontData* CreateFontData(const FontDescription&,
|
||||
const FontSelectionCapabilities&) override;
|
||||
|
||||
- Member<const FontCustomPlatformData> custom_platform_data_;
|
||||
+ scoped_refptr<FontCustomPlatformData> custom_platform_data_;
|
||||
};
|
||||
|
||||
} // namespace blink
|
||||
--- a/third_party/blink/renderer/core/css/remote_font_face_source.cc
|
||||
+++ b/third_party/blink/renderer/core/css/remote_font_face_source.cc
|
||||
@@ -262,7 +262,7 @@ void RemoteFontFaceSource::NotifyFinishe
|
||||
FontInvalidationReason::kFontFaceLoaded);
|
||||
if (custom_font_data_) {
|
||||
probe::FontsUpdated(execution_context, face_->GetFontFace(),
|
||||
- resource->Url().GetString(), custom_font_data_.Get());
|
||||
+ resource->Url().GetString(), custom_font_data_.get());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -456,7 +456,6 @@ void RemoteFontFaceSource::BeginLoadIfNe
|
||||
void RemoteFontFaceSource::Trace(Visitor* visitor) const {
|
||||
visitor->Trace(face_);
|
||||
visitor->Trace(font_selector_);
|
||||
- visitor->Trace(custom_font_data_);
|
||||
CSSFontFaceSource::Trace(visitor);
|
||||
FontResourceClient::Trace(visitor);
|
||||
}
|
||||
--- a/third_party/blink/renderer/core/css/remote_font_face_source.h
|
||||
+++ b/third_party/blink/renderer/core/css/remote_font_face_source.h
|
||||
@@ -43,7 +43,7 @@ class RemoteFontFaceSource final : publi
|
||||
bool IsPendingDataUrl() const override;
|
||||
|
||||
const FontCustomPlatformData* GetCustomPlaftormData() const override {
|
||||
- return custom_font_data_.Get();
|
||||
+ return custom_font_data_.get();
|
||||
}
|
||||
|
||||
void BeginLoadIfNeeded() override;
|
||||
@@ -157,7 +157,7 @@ class RemoteFontFaceSource final : publi
|
||||
Member<FontSelector> font_selector_;
|
||||
|
||||
// |nullptr| if font is not loaded or failed to decode.
|
||||
- Member<const FontCustomPlatformData> custom_font_data_;
|
||||
+ scoped_refptr<FontCustomPlatformData> custom_font_data_;
|
||||
// |nullptr| if font is not loaded or failed to decode.
|
||||
String url_;
|
||||
|
||||
--- a/third_party/blink/renderer/core/loader/resource/font_resource.cc
|
||||
+++ b/third_party/blink/renderer/core/loader/resource/font_resource.cc
|
||||
@@ -112,7 +112,7 @@ void FontResource::StartLoadLimitTimersI
|
||||
kFontLoadWaitLong);
|
||||
}
|
||||
|
||||
-const FontCustomPlatformData* FontResource::GetCustomFontData() {
|
||||
+scoped_refptr<FontCustomPlatformData> FontResource::GetCustomFontData() {
|
||||
if (!font_data_ && !ErrorOccurred() && !IsLoading()) {
|
||||
if (Data()) {
|
||||
auto decode_start_time = base::TimeTicks::Now();
|
||||
@@ -225,7 +225,6 @@ void FontResource::AddClearDataObserver(
|
||||
}
|
||||
|
||||
void FontResource::Trace(Visitor* visitor) const {
|
||||
- visitor->Trace(font_data_);
|
||||
visitor->Trace(clear_data_observers_);
|
||||
Resource::Trace(visitor);
|
||||
}
|
||||
--- a/third_party/blink/renderer/core/loader/resource/font_resource.h
|
||||
+++ b/third_party/blink/renderer/core/loader/resource/font_resource.h
|
||||
@@ -72,7 +72,7 @@ class CORE_EXPORT FontResource final : p
|
||||
|
||||
String OtsParsingMessage() const { return ots_parsing_message_; }
|
||||
|
||||
- const FontCustomPlatformData* GetCustomFontData();
|
||||
+ scoped_refptr<FontCustomPlatformData> GetCustomFontData();
|
||||
|
||||
// Returns true if the loading priority of the remote font resource can be
|
||||
// lowered. The loading priority of the font can be lowered only if the
|
||||
@@ -112,7 +112,7 @@ class CORE_EXPORT FontResource final : p
|
||||
kMaxValue = kLongLimitExceeded,
|
||||
};
|
||||
|
||||
- Member<FontCustomPlatformData> font_data_;
|
||||
+ scoped_refptr<FontCustomPlatformData> font_data_;
|
||||
String ots_parsing_message_;
|
||||
LoadLimitState load_limit_state_;
|
||||
bool cors_failed_;
|
||||
--- a/third_party/blink/renderer/platform/fonts/font_custom_platform_data.cc
|
||||
+++ b/third_party/blink/renderer/platform/fonts/font_custom_platform_data.cc
|
||||
@@ -115,7 +115,7 @@ const FontPlatformData* FontCustomPlatfo
|
||||
const ResolvedFontFeatures& resolved_font_features,
|
||||
FontOrientation orientation,
|
||||
const FontVariationSettings* variation_settings,
|
||||
- const FontPalette* palette) const {
|
||||
+ const FontPalette* palette) {
|
||||
DCHECK(base_typeface_);
|
||||
|
||||
sk_sp<SkTypeface> return_typeface = base_typeface_;
|
||||
@@ -304,7 +304,7 @@ String FontCustomPlatformData::FamilyNam
|
||||
localized_string.fString.size());
|
||||
}
|
||||
|
||||
-FontCustomPlatformData* FontCustomPlatformData::Create(
|
||||
+scoped_refptr<FontCustomPlatformData> FontCustomPlatformData::Create(
|
||||
SharedBuffer* buffer,
|
||||
String& ots_parse_message) {
|
||||
DCHECK(buffer);
|
||||
@@ -321,8 +321,8 @@ FontCustomPlatformData* FontCustomPlatfo
|
||||
if (v8::Isolate* isolate = v8::Isolate::TryGetCurrent()) {
|
||||
isolate->AdjustAmountOfExternalAllocatedMemory(data_size);
|
||||
}
|
||||
- return MakeGarbageCollected<FontCustomPlatformData>(std::move(typeface),
|
||||
- data_size);
|
||||
+ return base::AdoptRef(
|
||||
+ new FontCustomPlatformData(std::move(typeface), data_size));
|
||||
}
|
||||
|
||||
bool FontCustomPlatformData::MayBeIconFont() const {
|
||||
--- a/third_party/blink/renderer/platform/fonts/font_custom_platform_data.h
|
||||
+++ b/third_party/blink/renderer/platform/fonts/font_custom_platform_data.h
|
||||
@@ -39,7 +39,6 @@
|
||||
#include "third_party/blink/renderer/platform/fonts/opentype/variable_axes_names.h"
|
||||
#include "third_party/blink/renderer/platform/fonts/resolved_font_features.h"
|
||||
#include "third_party/blink/renderer/platform/fonts/text_rendering_mode.h"
|
||||
-#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
|
||||
#include "third_party/blink/renderer/platform/platform_export.h"
|
||||
#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
|
||||
#include "third_party/blink/renderer/platform/wtf/forward.h"
|
||||
@@ -55,17 +54,16 @@ class FontPlatformData;
|
||||
class FontVariationSettings;
|
||||
|
||||
class PLATFORM_EXPORT FontCustomPlatformData
|
||||
- : public GarbageCollected<FontCustomPlatformData> {
|
||||
+ : public RefCounted<FontCustomPlatformData> {
|
||||
+ USING_FAST_MALLOC(FontCustomPlatformData);
|
||||
+
|
||||
public:
|
||||
- static FontCustomPlatformData* Create(SharedBuffer*,
|
||||
- String& ots_parse_message);
|
||||
- FontCustomPlatformData(sk_sp<SkTypeface>, size_t data_size);
|
||||
+ static scoped_refptr<FontCustomPlatformData> Create(SharedBuffer*,
|
||||
+ String& ots_parse_message);
|
||||
FontCustomPlatformData(const FontCustomPlatformData&) = delete;
|
||||
FontCustomPlatformData& operator=(const FontCustomPlatformData&) = delete;
|
||||
~FontCustomPlatformData();
|
||||
|
||||
- void Trace(Visitor*) const {}
|
||||
-
|
||||
// The size argument should come from EffectiveFontSize() and
|
||||
// adjusted_specified_size should come from AdjustedSpecifiedSize() of
|
||||
// FontDescription. The latter is needed for correctly applying
|
||||
@@ -82,7 +80,7 @@ class PLATFORM_EXPORT FontCustomPlatform
|
||||
const ResolvedFontFeatures& resolved_font_features,
|
||||
FontOrientation = FontOrientation::kHorizontal,
|
||||
const FontVariationSettings* = nullptr,
|
||||
- const FontPalette* = nullptr) const;
|
||||
+ const FontPalette* = nullptr);
|
||||
|
||||
String FamilyNameForInspector() const;
|
||||
|
||||
@@ -93,6 +91,7 @@ class PLATFORM_EXPORT FontCustomPlatform
|
||||
bool MayBeIconFont() const;
|
||||
|
||||
private:
|
||||
+ FontCustomPlatformData(sk_sp<SkTypeface>, size_t data_size);
|
||||
sk_sp<SkTypeface> base_typeface_;
|
||||
size_t data_size_;
|
||||
|
||||
--- a/third_party/blink/renderer/platform/testing/font_test_helpers.cc
|
||||
+++ b/third_party/blink/renderer/platform/testing/font_test_helpers.cc
|
||||
@@ -29,7 +29,7 @@ class TestFontSelector : public FontSele
|
||||
static TestFontSelector* Create(const uint8_t* data, size_t size) {
|
||||
scoped_refptr<SharedBuffer> font_buffer = SharedBuffer::Create(data, size);
|
||||
String ots_parse_message;
|
||||
- FontCustomPlatformData* font_custom_platform_data =
|
||||
+ scoped_refptr<FontCustomPlatformData> font_custom_platform_data =
|
||||
FontCustomPlatformData::Create(font_buffer.get(), ots_parse_message);
|
||||
if (!font_custom_platform_data)
|
||||
return nullptr;
|
||||
@@ -37,17 +37,12 @@ class TestFontSelector : public FontSele
|
||||
std::move(font_custom_platform_data));
|
||||
}
|
||||
|
||||
- TestFontSelector(FontCustomPlatformData* custom_platform_data)
|
||||
- : custom_platform_data_(custom_platform_data) {
|
||||
+ TestFontSelector(scoped_refptr<FontCustomPlatformData> custom_platform_data)
|
||||
+ : custom_platform_data_(std::move(custom_platform_data)) {
|
||||
DCHECK(custom_platform_data_);
|
||||
}
|
||||
~TestFontSelector() override = default;
|
||||
|
||||
- void Trace(Visitor* visitor) const override {
|
||||
- visitor->Trace(custom_platform_data_);
|
||||
- FontSelector::Trace(visitor);
|
||||
- }
|
||||
-
|
||||
FontData* GetFontData(const FontDescription& font_description,
|
||||
const FontFamily&) override {
|
||||
FontSelectionCapabilities normal_capabilities(
|
||||
@@ -117,7 +112,7 @@ class TestFontSelector : public FontSele
|
||||
}
|
||||
|
||||
private:
|
||||
- Member<FontCustomPlatformData> custom_platform_data_;
|
||||
+ scoped_refptr<FontCustomPlatformData> custom_platform_data_;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
411
bad-font-gc11.patch
Normal file
411
bad-font-gc11.patch
Normal file
@@ -0,0 +1,411 @@
|
||||
Revert the following commit:
|
||||
|
||||
commit 2eefeabb12fb7e92f2508116a5ed959c57659be1
|
||||
Author: Ian Kilpatrick <ikilpatrick@chromium.org>
|
||||
Date: Tue Feb 20 17:40:39 2024 +0000
|
||||
|
||||
[gc] Make HarfBuzzFontData & friends gc'd.
|
||||
|
||||
Previously we had a HbFontCacheEntry which was used to hold onto the
|
||||
HarfBuzzFontData, and a hb_font_t.
|
||||
|
||||
HarfBuzzFontData is used for holding data specific for various
|
||||
harfbuzz callbacks, but we can also hold onto the hb_font_t there.
|
||||
|
||||
There should be no user-visible behaviour change.
|
||||
|
||||
Bug: 41490008
|
||||
Change-Id: Icaa7ad3b2f75e9807b88014a9a15406cb76eb52e
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5302175
|
||||
Reviewed-by: Dominik Röttsches <drott@chromium.org>
|
||||
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#1262752}
|
||||
|
||||
--- a/third_party/blink/renderer/platform/fonts/font_global_context.cc
|
||||
+++ b/third_party/blink/renderer/platform/fonts/font_global_context.cc
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "third_party/blink/renderer/platform/fonts/font_cache.h"
|
||||
#include "third_party/blink/renderer/platform/fonts/font_unique_name_lookup.h"
|
||||
#include "third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h"
|
||||
+#include "third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.h"
|
||||
#include "third_party/blink/renderer/platform/privacy_budget/identifiability_digest_helpers.h"
|
||||
#include "third_party/blink/renderer/platform/wtf/thread_specific.h"
|
||||
|
||||
@@ -50,6 +51,15 @@ FontUniqueNameLookup* FontGlobalContext:
|
||||
return Get().font_unique_name_lookup_.get();
|
||||
}
|
||||
|
||||
+HarfBuzzFontCache& FontGlobalContext::GetHarfBuzzFontCache() {
|
||||
+ std::unique_ptr<HarfBuzzFontCache>& global_context_harfbuzz_font_cache =
|
||||
+ Get().harfbuzz_font_cache_;
|
||||
+ if (!global_context_harfbuzz_font_cache) {
|
||||
+ global_context_harfbuzz_font_cache = std::make_unique<HarfBuzzFontCache>();
|
||||
+ }
|
||||
+ return *global_context_harfbuzz_font_cache;
|
||||
+}
|
||||
+
|
||||
IdentifiableToken FontGlobalContext::GetOrComputeTypefaceDigest(
|
||||
const FontPlatformData& source) {
|
||||
SkTypeface* typeface = source.Typeface();
|
||||
--- a/third_party/blink/renderer/platform/fonts/font_global_context.h
|
||||
+++ b/third_party/blink/renderer/platform/fonts/font_global_context.h
|
||||
@@ -9,7 +9,6 @@
|
||||
#include "base/types/pass_key.h"
|
||||
#include "third_party/blink/public/common/privacy_budget/identifiable_token.h"
|
||||
#include "third_party/blink/renderer/platform/fonts/font_cache.h"
|
||||
-#include "third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.h"
|
||||
#include "third_party/blink/renderer/platform/platform_export.h"
|
||||
#include "third_party/blink/renderer/platform/text/layout_locale.h"
|
||||
#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
|
||||
@@ -34,19 +33,14 @@ class PLATFORM_EXPORT FontGlobalContext
|
||||
static FontGlobalContext& Get();
|
||||
static FontGlobalContext* TryGet();
|
||||
|
||||
- void Trace(Visitor* visitor) const {
|
||||
- visitor->Trace(font_cache_);
|
||||
- visitor->Trace(harfbuzz_font_cache_);
|
||||
- }
|
||||
+ void Trace(Visitor* visitor) const { visitor->Trace(font_cache_); }
|
||||
|
||||
FontGlobalContext(const FontGlobalContext&) = delete;
|
||||
FontGlobalContext& operator=(const FontGlobalContext&) = delete;
|
||||
|
||||
static inline FontCache& GetFontCache() { return Get().font_cache_; }
|
||||
|
||||
- static HarfBuzzFontCache& GetHarfBuzzFontCache() {
|
||||
- return Get().harfbuzz_font_cache_;
|
||||
- }
|
||||
+ static HarfBuzzFontCache& GetHarfBuzzFontCache();
|
||||
|
||||
static FontUniqueNameLookup* GetFontUniqueNameLookup();
|
||||
|
||||
@@ -62,7 +56,7 @@ class PLATFORM_EXPORT FontGlobalContext
|
||||
|
||||
private:
|
||||
FontCache font_cache_;
|
||||
- HarfBuzzFontCache harfbuzz_font_cache_;
|
||||
+ std::unique_ptr<HarfBuzzFontCache> harfbuzz_font_cache_;
|
||||
std::unique_ptr<FontUniqueNameLookup> font_unique_name_lookup_;
|
||||
base::HashingLRUCache<SkTypefaceID, IdentifiableToken> typeface_digest_cache_;
|
||||
base::HashingLRUCache<SkTypefaceID, IdentifiableToken>
|
||||
--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc
|
||||
+++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc
|
||||
@@ -64,14 +64,20 @@ namespace blink {
|
||||
|
||||
HarfBuzzFace::HarfBuzzFace(const FontPlatformData* platform_data,
|
||||
uint64_t unique_id)
|
||||
- : platform_data_(platform_data),
|
||||
- harfbuzz_font_data_(FontGlobalContext::GetHarfBuzzFontCache().GetOrCreate(
|
||||
- unique_id,
|
||||
- platform_data)) {}
|
||||
+ : platform_data_(platform_data), unique_id_(unique_id) {
|
||||
+ HbFontCacheEntry* const cache_entry =
|
||||
+ FontGlobalContext::GetHarfBuzzFontCache().RefOrNew(unique_id_,
|
||||
+ platform_data);
|
||||
+ unscaled_font_ = cache_entry->HbFont();
|
||||
+ harfbuzz_font_data_ = cache_entry->HbFontData();
|
||||
+}
|
||||
+
|
||||
+HarfBuzzFace::~HarfBuzzFace() {
|
||||
+ FontGlobalContext::GetHarfBuzzFontCache().Remove(unique_id_);
|
||||
+}
|
||||
|
||||
void HarfBuzzFace::Trace(Visitor* visitor) const {
|
||||
visitor->Trace(platform_data_);
|
||||
- visitor->Trace(harfbuzz_font_data_);
|
||||
}
|
||||
|
||||
static hb_bool_t HarfBuzzGetGlyph(hb_font_t* hb_font,
|
||||
@@ -234,17 +240,14 @@ bool HarfBuzzFace::HasSpaceInLigaturesOr
|
||||
|
||||
hb::unique_ptr<hb_set_t> glyphs(hb_set_create());
|
||||
|
||||
- hb_font_t* unscaled_font = harfbuzz_font_data_->unscaled_font_.get();
|
||||
-
|
||||
// Check whether computing is needed and compute for gpos/gsub.
|
||||
if (features & kKerning &&
|
||||
harfbuzz_font_data_->space_in_gpos_ ==
|
||||
HarfBuzzFontData::SpaceGlyphInOpenTypeTables::kUnknown) {
|
||||
- if (space == kInvalidCodepoint && !GetSpaceGlyph(unscaled_font, space)) {
|
||||
+ if (space == kInvalidCodepoint && !GetSpaceGlyph(unscaled_font_, space))
|
||||
return false;
|
||||
- }
|
||||
// Compute for gpos.
|
||||
- hb_face_t* face = hb_font_get_face(unscaled_font);
|
||||
+ hb_face_t* face = hb_font_get_face(unscaled_font_);
|
||||
DCHECK(face);
|
||||
harfbuzz_font_data_->space_in_gpos_ =
|
||||
hb_ot_layout_has_positioning(face) &&
|
||||
@@ -258,11 +261,10 @@ bool HarfBuzzFace::HasSpaceInLigaturesOr
|
||||
if (features & kLigatures &&
|
||||
harfbuzz_font_data_->space_in_gsub_ ==
|
||||
HarfBuzzFontData::SpaceGlyphInOpenTypeTables::kUnknown) {
|
||||
- if (space == kInvalidCodepoint && !GetSpaceGlyph(unscaled_font, space)) {
|
||||
+ if (space == kInvalidCodepoint && !GetSpaceGlyph(unscaled_font_, space))
|
||||
return false;
|
||||
- }
|
||||
// Compute for gpos.
|
||||
- hb_face_t* face = hb_font_get_face(unscaled_font);
|
||||
+ hb_face_t* face = hb_font_get_face(unscaled_font_);
|
||||
DCHECK(face);
|
||||
harfbuzz_font_data_->space_in_gsub_ =
|
||||
hb_ot_layout_has_substitution(face) &&
|
||||
@@ -280,14 +282,14 @@ bool HarfBuzzFace::HasSpaceInLigaturesOr
|
||||
}
|
||||
|
||||
unsigned HarfBuzzFace::UnitsPerEmFromHeadTable() {
|
||||
- hb_face_t* face = hb_font_get_face(harfbuzz_font_data_->unscaled_font_.get());
|
||||
+ hb_face_t* face = hb_font_get_face(unscaled_font_);
|
||||
return hb_face_get_upem(face);
|
||||
}
|
||||
|
||||
Glyph HarfBuzzFace::HbGlyphForCharacter(UChar32 character) {
|
||||
hb_codepoint_t glyph = 0;
|
||||
- HarfBuzzGetNominalGlyph(harfbuzz_font_data_->unscaled_font_.get(),
|
||||
- harfbuzz_font_data_, character, &glyph, nullptr);
|
||||
+ HarfBuzzGetNominalGlyph(unscaled_font_, harfbuzz_font_data_, character,
|
||||
+ &glyph, nullptr);
|
||||
return glyph;
|
||||
}
|
||||
|
||||
@@ -444,10 +446,9 @@ static hb::unique_ptr<hb_face_t> CreateF
|
||||
return face;
|
||||
}
|
||||
|
||||
-namespace {
|
||||
-
|
||||
-HarfBuzzFontData* CreateHarfBuzzFontData(hb_face_t* face,
|
||||
- SkTypeface* typeface) {
|
||||
+static scoped_refptr<HbFontCacheEntry> CreateHbFontCacheEntry(
|
||||
+ hb_face_t* face,
|
||||
+ SkTypeface* typeface) {
|
||||
hb::unique_ptr<hb_font_t> ot_font(hb_font_create(face));
|
||||
hb_ot_font_set_funcs(ot_font.get());
|
||||
|
||||
@@ -466,26 +467,25 @@ HarfBuzzFontData* CreateHarfBuzzFontData
|
||||
// Creating a sub font means that non-available functions
|
||||
// are found from the parent.
|
||||
hb_font_t* const unscaled_font = hb_font_create_sub_font(ot_font.get());
|
||||
- HarfBuzzFontData* data =
|
||||
- MakeGarbageCollected<HarfBuzzFontData>(unscaled_font);
|
||||
+ scoped_refptr<HbFontCacheEntry> cache_entry =
|
||||
+ HbFontCacheEntry::Create(unscaled_font);
|
||||
hb_font_set_funcs(unscaled_font,
|
||||
- HarfBuzzSkiaFontFuncs::Get().GetFunctions(typeface), data,
|
||||
- nullptr);
|
||||
- return data;
|
||||
+ HarfBuzzSkiaFontFuncs::Get().GetFunctions(typeface),
|
||||
+ cache_entry->HbFontData(), nullptr);
|
||||
+ return cache_entry;
|
||||
}
|
||||
|
||||
-} // namespace
|
||||
-
|
||||
-HarfBuzzFontData* HarfBuzzFontCache::GetOrCreate(
|
||||
+HbFontCacheEntry* HarfBuzzFontCache::RefOrNew(
|
||||
uint64_t unique_id,
|
||||
const FontPlatformData* platform_data) {
|
||||
const auto& result = font_map_.insert(unique_id, nullptr);
|
||||
if (result.is_new_entry) {
|
||||
hb::unique_ptr<hb_face_t> face = CreateFace(platform_data);
|
||||
result.stored_value->value =
|
||||
- CreateHarfBuzzFontData(face.get(), platform_data->Typeface());
|
||||
+ CreateHbFontCacheEntry(face.get(), platform_data->Typeface());
|
||||
}
|
||||
- return result.stored_value->value.Get();
|
||||
+ result.stored_value->value->AddRef();
|
||||
+ return result.stored_value->value.get();
|
||||
}
|
||||
|
||||
static_assert(
|
||||
@@ -516,18 +516,17 @@ hb_font_t* HarfBuzzFace::GetScaledFont(s
|
||||
vertical_layout);
|
||||
|
||||
int scale = SkiaScalarToHarfBuzzPosition(platform_data_->size());
|
||||
- hb_font_t* unscaled_font = harfbuzz_font_data_->unscaled_font_.get();
|
||||
- hb_font_set_scale(unscaled_font, scale, scale);
|
||||
+ hb_font_set_scale(unscaled_font_, scale, scale);
|
||||
// See contended discussion in https://github.com/harfbuzz/harfbuzz/pull/1484
|
||||
// Setting ptem here is critical for HarfBuzz to know where to lookup spacing
|
||||
// offset in the AAT trak table, the unit pt in ptem here means "CoreText"
|
||||
// points. After discussion on the pull request and with Apple developers, the
|
||||
// meaning of HarfBuzz' hb_font_set_ptem API was changed to expect the
|
||||
// equivalent of CSS pixels here.
|
||||
- hb_font_set_ptem(unscaled_font, specified_size > 0 ? specified_size
|
||||
- : platform_data_->size());
|
||||
+ hb_font_set_ptem(unscaled_font_, specified_size > 0 ? specified_size
|
||||
+ : platform_data_->size());
|
||||
|
||||
- return unscaled_font;
|
||||
+ return unscaled_font_;
|
||||
}
|
||||
|
||||
hb_font_t* HarfBuzzFace::GetScaledFont() const {
|
||||
--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h
|
||||
+++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h
|
||||
@@ -55,6 +55,7 @@ class HarfBuzzFace final : public Garbag
|
||||
HarfBuzzFace(const FontPlatformData* platform_data, uint64_t);
|
||||
HarfBuzzFace(const HarfBuzzFace&) = delete;
|
||||
HarfBuzzFace& operator=(const HarfBuzzFace&) = delete;
|
||||
+ ~HarfBuzzFace();
|
||||
|
||||
void Trace(Visitor*) const;
|
||||
|
||||
@@ -90,7 +91,11 @@ class HarfBuzzFace final : public Garbag
|
||||
void PrepareHarfBuzzFontData();
|
||||
|
||||
Member<const FontPlatformData> platform_data_;
|
||||
- Member<HarfBuzzFontData> harfbuzz_font_data_;
|
||||
+ const uint64_t unique_id_;
|
||||
+ // TODO(crbug.com/1489080): When briefly given MiraclePtr protection,
|
||||
+ // these members were both found dangling.
|
||||
+ hb_font_t* unscaled_font_;
|
||||
+ HarfBuzzFontData* harfbuzz_font_data_;
|
||||
};
|
||||
|
||||
} // namespace blink
|
||||
--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.cc
|
||||
+++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.cc
|
||||
@@ -8,8 +8,38 @@
|
||||
|
||||
namespace blink {
|
||||
|
||||
-void HarfBuzzFontCache::Trace(Visitor* visitor) const {
|
||||
- visitor->Trace(font_map_);
|
||||
+HbFontCacheEntry::HbFontCacheEntry(hb_font_t* font)
|
||||
+ : hb_font_(hb::unique_ptr<hb_font_t>(font)),
|
||||
+ hb_font_data_(std::make_unique<HarfBuzzFontData>()) {}
|
||||
+
|
||||
+HbFontCacheEntry::~HbFontCacheEntry() = default;
|
||||
+
|
||||
+scoped_refptr<HbFontCacheEntry> HbFontCacheEntry::Create(hb_font_t* hb_font) {
|
||||
+ DCHECK(hb_font);
|
||||
+ return base::AdoptRef(new HbFontCacheEntry(hb_font));
|
||||
+}
|
||||
+
|
||||
+HarfBuzzFontCache::HarfBuzzFontCache() = default;
|
||||
+HarfBuzzFontCache::~HarfBuzzFontCache() = default;
|
||||
+
|
||||
+// See "harfbuzz_face.cc" for |HarfBuzzFontCache::GetOrCreateFontData()|
|
||||
+// implementation.
|
||||
+
|
||||
+void HarfBuzzFontCache::Remove(uint64_t unique_id) {
|
||||
+ auto it = font_map_.find(unique_id);
|
||||
+ // TODO(https://crbug.com/1417160): In tests such as FontObjectThreadedTest
|
||||
+ // that test taking down FontGlobalContext an object may not be found due to
|
||||
+ // existing issues with refcounting of font objects at thread destruction
|
||||
+ // time.
|
||||
+ if (it == font_map_.end()) {
|
||||
+ return;
|
||||
+ }
|
||||
+ DCHECK(!it.Get()->value->HasOneRef());
|
||||
+ it.Get()->value->Release();
|
||||
+ if (!it.Get()->value->HasOneRef()) {
|
||||
+ return;
|
||||
+ }
|
||||
+ font_map_.erase(it);
|
||||
}
|
||||
|
||||
} // namespace blink
|
||||
--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.h
|
||||
+++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.h
|
||||
@@ -6,9 +6,12 @@
|
||||
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_SHAPING_HARFBUZZ_FONT_CACHE_H_
|
||||
|
||||
#include "third_party/blink/renderer/platform/fonts/font_metrics.h"
|
||||
-#include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_map.h"
|
||||
-#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
|
||||
-#include "third_party/blink/renderer/platform/heap/member.h"
|
||||
+#include "third_party/blink/renderer/platform/fonts/unicode_range_set.h"
|
||||
+
|
||||
+#include <hb.h>
|
||||
+#include <hb-cplusplus.hh>
|
||||
+
|
||||
+#include <memory>
|
||||
|
||||
namespace blink {
|
||||
|
||||
@@ -22,21 +25,39 @@ struct HarfBuzzFontData;
|
||||
// FIXME, crbug.com/609099: We should fix the FontCache to only keep one
|
||||
// FontPlatformData object independent of size, then consider using this here.
|
||||
|
||||
-class HarfBuzzFontCache final {
|
||||
- DISALLOW_NEW();
|
||||
+class HbFontCacheEntry : public RefCounted<HbFontCacheEntry> {
|
||||
+ USING_FAST_MALLOC(HbFontCacheEntry);
|
||||
+
|
||||
+ public:
|
||||
+ static scoped_refptr<HbFontCacheEntry> Create(hb_font_t* hb_font);
|
||||
+
|
||||
+ hb_font_t* HbFont() { return hb_font_.get(); }
|
||||
+ HarfBuzzFontData* HbFontData() { return hb_font_data_.get(); }
|
||||
+
|
||||
+ ~HbFontCacheEntry();
|
||||
|
||||
+ private:
|
||||
+ explicit HbFontCacheEntry(hb_font_t* font);
|
||||
+
|
||||
+ hb::unique_ptr<hb_font_t> hb_font_;
|
||||
+ std::unique_ptr<HarfBuzzFontData> hb_font_data_;
|
||||
+};
|
||||
+
|
||||
+class HarfBuzzFontCache final {
|
||||
public:
|
||||
- void Trace(Visitor* visitor) const;
|
||||
- // See "harfbuzz_face.cc" for |HarfBuzzFontCache::GetOrCreateFontData()|
|
||||
- // implementation.
|
||||
- HarfBuzzFontData* GetOrCreate(uint64_t unique_id,
|
||||
- const FontPlatformData* platform_data);
|
||||
+ HarfBuzzFontCache();
|
||||
+ ~HarfBuzzFontCache();
|
||||
+
|
||||
+ HbFontCacheEntry* RefOrNew(uint64_t unique_id,
|
||||
+ const FontPlatformData* platform_data);
|
||||
+ void Remove(uint64_t unique_id);
|
||||
|
||||
private:
|
||||
- HeapHashMap<uint64_t,
|
||||
- WeakMember<HarfBuzzFontData>,
|
||||
- IntWithZeroKeyHashTraits<uint64_t>>
|
||||
- font_map_;
|
||||
+ using HbFontDataMap = HashMap<uint64_t,
|
||||
+ scoped_refptr<HbFontCacheEntry>,
|
||||
+ IntWithZeroKeyHashTraits<uint64_t>>;
|
||||
+
|
||||
+ HbFontDataMap font_map_;
|
||||
};
|
||||
|
||||
} // namespace blink
|
||||
--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_data.h
|
||||
+++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_data.h
|
||||
@@ -22,18 +22,15 @@ const unsigned kInvalidFallbackMetricsVa
|
||||
// The HarfBuzzFontData struct carries user-pointer data for
|
||||
// |hb_font_t| callback functions/operations. It contains metrics and OpenType
|
||||
// layout information related to a font scaled to a particular size.
|
||||
-struct HarfBuzzFontData final : public GarbageCollected<HarfBuzzFontData> {
|
||||
+struct HarfBuzzFontData final {
|
||||
+ USING_FAST_MALLOC(HarfBuzzFontData);
|
||||
+
|
||||
public:
|
||||
- explicit HarfBuzzFontData(hb_font_t* unscaled_font)
|
||||
- : unscaled_font_(hb::unique_ptr<hb_font_t>(unscaled_font)),
|
||||
- vertical_data_(nullptr),
|
||||
- range_set_(nullptr) {}
|
||||
+ HarfBuzzFontData() : vertical_data_(nullptr), range_set_(nullptr) {}
|
||||
|
||||
HarfBuzzFontData(const HarfBuzzFontData&) = delete;
|
||||
HarfBuzzFontData& operator=(const HarfBuzzFontData&) = delete;
|
||||
|
||||
- void Trace(Visitor*) const {}
|
||||
-
|
||||
// The vertical origin and vertical advance functions in HarfBuzzFace require
|
||||
// the ascent and height metrics as fallback in case no specific vertical
|
||||
// layout information is found from the font.
|
||||
@@ -81,7 +78,6 @@ struct HarfBuzzFontData final : public G
|
||||
return vertical_data_;
|
||||
}
|
||||
|
||||
- const hb::unique_ptr<hb_font_t> unscaled_font_;
|
||||
SkFont font_;
|
||||
|
||||
// Capture these scaled fallback metrics from FontPlatformData so that a
|
||||
3715
bad-font-gc2.patch
Normal file
3715
bad-font-gc2.patch
Normal file
File diff suppressed because it is too large
Load Diff
38
bad-font-gc3.patch
Normal file
38
bad-font-gc3.patch
Normal file
@@ -0,0 +1,38 @@
|
||||
Revert the following commit (to support bad-font-gc2.patch):
|
||||
|
||||
commit d4806d20fda56e9bac259fddf10b7439ce749add
|
||||
Author: Hao Liu <haoliuk@chromium.org>
|
||||
Date: Mon Mar 18 22:56:31 2024 +0000
|
||||
|
||||
Cleanup leftover non-used custom_font_data methods
|
||||
|
||||
This is to clean up non-used custom_font_data methods. Their usage has
|
||||
been deleted in a previous CL.
|
||||
https://chromium-review.googlesource.com/c/chromium/src/+/5262982/29/third_party/blink/renderer/core/css/css_font_face_source.cc#b95
|
||||
|
||||
Change-Id: I90c3ae794a6caf71526c81a56795e95c23cc3fb5
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5368244
|
||||
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
|
||||
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#1274525}
|
||||
|
||||
--- a/third_party/blink/renderer/core/css/css_custom_font_data.h
|
||||
+++ b/third_party/blink/renderer/core/css/css_custom_font_data.h
|
||||
@@ -55,6 +55,7 @@ class CSSCustomFontData final : public C
|
||||
|
||||
bool IsLoading() const override { return is_loading_; }
|
||||
bool IsLoadingFallback() const override { return true; }
|
||||
+ void ClearFontFaceSource() override { font_face_source_ = nullptr; }
|
||||
|
||||
bool IsPendingDataUrl() const override {
|
||||
return font_face_source_ && font_face_source_->IsPendingDataUrl();
|
||||
--- a/third_party/blink/renderer/platform/fonts/custom_font_data.h
|
||||
+++ b/third_party/blink/renderer/platform/fonts/custom_font_data.h
|
||||
@@ -46,6 +46,7 @@ class PLATFORM_EXPORT CustomFontData : p
|
||||
virtual bool IsLoading() const { return false; }
|
||||
virtual bool IsLoadingFallback() const { return false; }
|
||||
virtual bool ShouldSkipDrawing() const { return false; }
|
||||
+ virtual void ClearFontFaceSource() {}
|
||||
virtual bool IsPendingDataUrl() const { return false; }
|
||||
|
||||
protected:
|
||||
@@ -8,7 +8,7 @@
|
||||
+#include <prtime.h>
|
||||
#include "base/time/time_override.h"
|
||||
#include "build/build_config.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
--- a/base/BUILD.gn 2022-06-30 13:13:20.315537859 +0200
|
||||
+++ b/base/BUILD.gn 2022-06-30 13:25:39.947410797 +0200
|
||||
@@ -1,3 +1,8 @@
|
||||
|
||||
46
bitset-missing-uint8_t-memcpy.patch
Normal file
46
bitset-missing-uint8_t-memcpy.patch
Normal file
@@ -0,0 +1,46 @@
|
||||
From df291ec5472fa14e828633378b8c97a8c7a2e7de Mon Sep 17 00:00:00 2001
|
||||
From: Jose Dapena Paz <jdapena@igalia.com>
|
||||
Date: Wed, 20 Mar 2024 12:38:04 +0000
|
||||
Subject: [PATCH] IWYU: missing includes in ukm::BitSet
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Usage of uint8_t and std::memcpy require includes.
|
||||
|
||||
Bug: 41455655
|
||||
Change-Id: Ib96b3c3595660fc05d37d61ba9ec36add18eba57
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5370063
|
||||
Commit-Queue: José Dapena Paz <jdapena@igalia.com>
|
||||
Reviewed-by: Cait Phillips <caitkp@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#1275509}
|
||||
---
|
||||
components/ukm/bitset.cc | 2 ++
|
||||
components/ukm/bitset.h | 1 +
|
||||
2 files changed, 3 insertions(+)
|
||||
|
||||
diff --git a/components/ukm/bitset.cc b/components/ukm/bitset.cc
|
||||
index 0c4faff95ed29..da83c35aa5c58 100644
|
||||
--- a/components/ukm/bitset.cc
|
||||
+++ b/components/ukm/bitset.cc
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
#include "components/ukm/bitset.h"
|
||||
|
||||
+#include <cstring>
|
||||
+
|
||||
#include "base/check_op.h"
|
||||
|
||||
namespace ukm {
|
||||
diff --git a/components/ukm/bitset.h b/components/ukm/bitset.h
|
||||
index 9b1f88c844ef6..005ce6e329db2 100644
|
||||
--- a/components/ukm/bitset.h
|
||||
+++ b/components/ukm/bitset.h
|
||||
@@ -5,6 +5,7 @@
|
||||
#ifndef COMPONENTS_UKM_BITSET_H_
|
||||
#define COMPONENTS_UKM_BITSET_H_
|
||||
|
||||
+#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@@ -64,7 +64,7 @@ This feature does not build with brotli < 1.1
|
||||
"CompressionDictionaryTransportBackend",
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
const base::FeatureParam<CompressionDictionaryTransportBackendVersion>::Option
|
||||
kCompressionDictionaryTransportBackendVersionOptions[] = {
|
||||
{CompressionDictionaryTransportBackendVersion::kV1, "v1"},
|
||||
|
||||
// When both this feature and the kCompressionDictionaryTransportBackend feature
|
||||
// are enabled, the following will happen:
|
||||
|
||||
|
||||
@@ -8,16 +8,14 @@ This is not upstreamable as the problem is due to Electron changes to chromium,
|
||||
|
||||
--- src/extensions/browser/guest_view/web_view/web_view_guest.cc.old 2023-09-28 10:14:03.660044621 +0200
|
||||
+++ src/extensions/browser/guest_view/web_view/web_view_guest.cc 2023-09-29 08:05:41.827245244 +0200
|
||||
@@ -285,9 +285,6 @@ std::string WebViewGuest::GetPartitionID
|
||||
@@ -285,7 +285,6 @@ std::string WebViewGuest::GetPartitionID
|
||||
}
|
||||
|
||||
// static
|
||||
-const char WebViewGuest::Type[] = "webview";
|
||||
-
|
||||
-// static
|
||||
int WebViewGuest::GetOrGenerateRulesRegistryID(int embedder_process_id,
|
||||
int webview_instance_id) {
|
||||
bool is_web_view = embedder_process_id && webview_instance_id;
|
||||
const guest_view::GuestViewHistogramValue WebViewGuest::HistogramValue =
|
||||
guest_view::GuestViewHistogramValue::kWebView;
|
||||
|
||||
--- src/extensions/browser/guest_view/web_view/web_view_guest.h.old 2023-09-28 10:14:03.660044621 +0200
|
||||
+++ src/extensions/browser/guest_view/web_view/web_view_guest.h 2023-09-29 08:06:13.200529820 +0200
|
||||
@@ -49,7 +49,7 @@ class WebViewGuest : public guest_view::
|
||||
@@ -26,6 +24,6 @@ This is not upstreamable as the problem is due to Electron changes to chromium,
|
||||
|
||||
- static const char Type[];
|
||||
+ constexpr static const char Type[] = "webview";
|
||||
static const guest_view::GuestViewHistogramValue HistogramValue;
|
||||
|
||||
// Returns the WebView partition ID associated with the render process
|
||||
// represented by |render_process_host|, if any. Otherwise, an empty string is
|
||||
|
||||
@@ -4,6 +4,7 @@ SUSE: Disable the following:
|
||||
and global CFLAGS go at the end of the commandline
|
||||
* Submodel options (-march and friends). Upstream notoriously forces SSE3 despite the code not requiring it.
|
||||
* note that cpu options for ARM are currently left in, as they do not seem to do harm and V8 needs to know the exact target anyway
|
||||
* libstdc++ assertions. Enabling them or not should in general be the distro's decision. Electron does not run untrusted code (unlike browsers) and as such does not really benefit from security paranoia.
|
||||
* Debuginfo format. Upstream seems to force something that is not recognized by rpmbuild.
|
||||
* per-target debuginfo level is left in as it is still useful (-g2 everywhere does not work)
|
||||
* Emitting code for the PIC model. It is needed in case of shared libraries, but results in a larger executable (and Electron is already enormous)
|
||||
@@ -24,7 +25,7 @@ diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
|
||||
index d40843b..b92f03b 100644
|
||||
--- a/build/config/compiler/BUILD.gn
|
||||
+++ b/build/config/compiler/BUILD.gn
|
||||
@@ -274,9 +274,7 @@
|
||||
@@ -322,9 +322,7 @@ config("compiler") {
|
||||
|
||||
configs += [
|
||||
# See the definitions below.
|
||||
@@ -34,7 +35,7 @@ index d40843b..b92f03b 100644
|
||||
":compiler_codegen",
|
||||
":compiler_deterministic",
|
||||
]
|
||||
@@ -305,7 +303,12 @@
|
||||
@@ -353,7 +351,12 @@ config("compiler") {
|
||||
if (!is_win) {
|
||||
# Common POSIX compiler flags setup.
|
||||
# --------------------------------
|
||||
@@ -48,7 +49,7 @@ index d40843b..b92f03b 100644
|
||||
|
||||
# Stack protection. ShadowCallStack and Stack protector address the same
|
||||
# problems. Therefore, we only enable one or the other. Clang advertises SCS as
|
||||
@@ -432,10 +435,6 @@
|
||||
@@ -494,10 +497,6 @@ config("compiler") {
|
||||
# Linux/Android/Fuchsia common flags setup.
|
||||
# ---------------------------------
|
||||
if (is_linux || is_chromeos || is_android || is_fuchsia) {
|
||||
@@ -59,7 +60,7 @@ index d40843b..b92f03b 100644
|
||||
|
||||
if (!is_clang) {
|
||||
# Use pipes for communicating between sub-processes. Faster.
|
||||
@@ -527,55 +527,6 @@
|
||||
@@ -590,55 +589,6 @@ config("compiler") {
|
||||
ldflags += [ "-Wl,-z,keep-text-section-prefix" ]
|
||||
}
|
||||
|
||||
@@ -115,7 +116,19 @@ index d40843b..b92f03b 100644
|
||||
# C11/C++11 compiler flags setup.
|
||||
# ---------------------------
|
||||
if (is_linux || is_chromeos || is_android || (is_nacl && is_clang) ||
|
||||
@@ -862,7 +837,8 @@
|
||||
@@ -1070,11 +1020,6 @@ config("compiler") {
|
||||
defines += [ "_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE" ]
|
||||
}
|
||||
|
||||
- # Enable libstdc++ hardening lightweight assertions. Those have a low
|
||||
- # performance penalty but are considered a bare minimum for security.
|
||||
- if (use_safe_libstdcxx) {
|
||||
- defines += [ "_GLIBCXX_ASSERTIONS=1" ]
|
||||
- }
|
||||
}
|
||||
|
||||
# The BUILDCONFIG file sets this config on targets by default, which means when
|
||||
@@ -1140,7 +1085,8 @@ config("thinlto_optimize_max") {
|
||||
# without using everything that "compiler" brings in. Options that
|
||||
# tweak code generation for a particular CPU do not belong here!
|
||||
# See "compiler_codegen", below.
|
||||
@@ -125,7 +138,7 @@ index d40843b..b92f03b 100644
|
||||
cflags = []
|
||||
ldflags = []
|
||||
defines = []
|
||||
@@ -1227,46 +1203,6 @@
|
||||
@@ -1523,46 +1469,6 @@ config("compiler_deterministic") {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,7 +185,7 @@ index d40843b..b92f03b 100644
|
||||
# Tells the compiler not to use absolute paths when passing the default
|
||||
# paths to the tools it invokes. We don't want this because we don't
|
||||
# really need it and it can mess up the goma cache entries.
|
||||
@@ -1400,7 +1337,8 @@
|
||||
@@ -1739,7 +1645,8 @@ config("treat_warnings_as_errors") {
|
||||
# Collects all warning flags that are used by default. This is used as a
|
||||
# subconfig of both chromium_code and no_chromium_code. This way these
|
||||
# flags are guaranteed to appear on the compile command line after -Wall.
|
||||
@@ -182,20 +195,20 @@ index d40843b..b92f03b 100644
|
||||
cflags = []
|
||||
cflags_c = []
|
||||
cflags_cc = []
|
||||
@@ -1597,11 +1535,7 @@
|
||||
@@ -1983,11 +1890,7 @@ config("chromium_code") {
|
||||
defines = [ "_HAS_NODISCARD" ]
|
||||
}
|
||||
} else {
|
||||
- cflags = [ "-Wall" ]
|
||||
+ cflags = []
|
||||
- if (is_clang) {
|
||||
- # Enable extra warnings for chromium_code when we control the compiler.
|
||||
- cflags += [ "-Wextra" ]
|
||||
- }
|
||||
+ cflags = []
|
||||
|
||||
# In Chromium code, we define __STDC_foo_MACROS in order to get the
|
||||
# C99 macros on Mac and Linux.
|
||||
@@ -1618,24 +1552,6 @@
|
||||
@@ -1996,24 +1899,6 @@ config("chromium_code") {
|
||||
"__STDC_FORMAT_MACROS",
|
||||
]
|
||||
|
||||
@@ -220,7 +233,7 @@ index d40843b..b92f03b 100644
|
||||
if (is_apple) {
|
||||
cflags_objc = [ "-Wimplicit-retain-self" ]
|
||||
cflags_objcc = [ "-Wimplicit-retain-self" ]
|
||||
@@ -1841,7 +1841,6 @@
|
||||
@@ -2159,7 +2044,6 @@ config("no_rtti") {
|
||||
config("export_dynamic") {
|
||||
# TODO(crbug.com/1052397): Revisit after target_os flip is completed.
|
||||
if (is_linux || is_chromeos_lacros || export_libcxxabi_from_executables) {
|
||||
@@ -228,7 +241,7 @@ index d40843b..b92f03b 100644
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1887,7 +1811,8 @@
|
||||
@@ -2247,7 +2131,8 @@ config("wexit_time_destructors") {
|
||||
# gcc 4.9 and earlier had no way of suppressing this warning without
|
||||
# suppressing the rest of them. Here we centralize the identification of
|
||||
# the gcc 4.9 toolchains.
|
||||
@@ -238,7 +251,7 @@ index d40843b..b92f03b 100644
|
||||
cflags = []
|
||||
if (is_clang) {
|
||||
cflags += [ "-Wno-incompatible-pointer-types" ]
|
||||
@@ -1990,7 +1915,8 @@
|
||||
@@ -2362,7 +2247,8 @@ if (is_win) {
|
||||
common_optimize_on_cflags += [ "-fno-math-errno" ]
|
||||
}
|
||||
|
||||
@@ -248,7 +261,7 @@ index d40843b..b92f03b 100644
|
||||
if (!is_win) {
|
||||
if (enable_frame_pointers) {
|
||||
cflags = [ "-fno-omit-frame-pointer" ]
|
||||
@@ -2017,7 +1943,8 @@
|
||||
@@ -2389,7 +2275,8 @@ config("default_stack_frames") {
|
||||
}
|
||||
|
||||
# Default "optimization on" config.
|
||||
@@ -256,9 +269,9 @@ index d40843b..b92f03b 100644
|
||||
+config("optimize") { }
|
||||
+config("xoptimize") {
|
||||
if (is_win) {
|
||||
if (chrome_pgo_phase != 2) {
|
||||
# Favor size over speed, /O1 must be before the common flags.
|
||||
@@ -2055,7 +1982,8 @@
|
||||
cflags = [ "/O2" ] + common_optimize_on_cflags
|
||||
|
||||
@@ -2430,7 +2317,8 @@ config("optimize") {
|
||||
}
|
||||
|
||||
# Turn off optimizations.
|
||||
@@ -268,7 +281,7 @@ index d40843b..b92f03b 100644
|
||||
if (is_win) {
|
||||
cflags = [
|
||||
"/Od", # Disable optimization.
|
||||
@@ -2095,7 +2023,8 @@
|
||||
@@ -2470,7 +2358,8 @@ config("no_optimize") {
|
||||
# Turns up the optimization level. On Windows, this implies whole program
|
||||
# optimization and link-time code generation which is very expensive and should
|
||||
# be used sparingly.
|
||||
@@ -278,7 +291,7 @@ index d40843b..b92f03b 100644
|
||||
if (is_nacl && is_nacl_irt) {
|
||||
# The NaCl IRT is a special case and always wants its own config.
|
||||
# Various components do:
|
||||
@@ -2128,7 +2057,8 @@
|
||||
@@ -2503,7 +2392,8 @@ config("optimize_max") {
|
||||
#
|
||||
# TODO(crbug.com/621335) - rework how all of these configs are related
|
||||
# so that we don't need this disclaimer.
|
||||
@@ -288,7 +301,7 @@ index d40843b..b92f03b 100644
|
||||
if (is_nacl && is_nacl_irt) {
|
||||
# The NaCl IRT is a special case and always wants its own config.
|
||||
# Various components do:
|
||||
@@ -2154,7 +2084,8 @@
|
||||
@@ -2529,7 +2419,8 @@ config("optimize_speed") {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -298,7 +311,7 @@ index d40843b..b92f03b 100644
|
||||
cflags = [ "-O1" ] + common_optimize_on_cflags
|
||||
rustflags = [ "-Copt-level=1" ]
|
||||
ldflags = common_optimize_on_ldflags
|
||||
@@ -2273,7 +2204,8 @@
|
||||
@@ -2662,7 +2553,8 @@ config("win_pdbaltpath") {
|
||||
}
|
||||
|
||||
# Full symbols.
|
||||
@@ -308,7 +321,7 @@ index d40843b..b92f03b 100644
|
||||
rustflags = []
|
||||
if (is_win) {
|
||||
if (is_clang) {
|
||||
@@ -2398,7 +2330,8 @@
|
||||
@@ -2811,7 +2703,8 @@ config("symbols") {
|
||||
# Minimal symbols.
|
||||
# This config guarantees to hold symbol for stack trace which are shown to user
|
||||
# when crash happens in unittests running on buildbot.
|
||||
@@ -318,7 +331,7 @@ index d40843b..b92f03b 100644
|
||||
rustflags = []
|
||||
if (is_win) {
|
||||
# Functions, files, and line tables only.
|
||||
@@ -2470,7 +2403,8 @@
|
||||
@@ -2896,7 +2789,8 @@ config("minimal_symbols") {
|
||||
# This configuration contains function names only. That is, the compiler is
|
||||
# told to not generate debug information and the linker then just puts function
|
||||
# names in the final debug information.
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
commit 04866680f4f9a8475ae3795ad6ed59649ba478d7
|
||||
Author: Jose Dapena Paz <jdapena@igalia.com>
|
||||
Date: Tue Jan 23 12:04:05 2024 +0000
|
||||
|
||||
libstdc++: fix static assertion in NodeUuidEquality
|
||||
|
||||
libstdc++ equality checks in static assertion that it is possible to
|
||||
compare for equality base::Uuid to BookmarkNode*. This was a missing
|
||||
operator in NodeUuidEquality that this changeset adds.
|
||||
|
||||
Bug: 957519
|
||||
Change-Id: Icc9809cb43d321f0b3e3394ef27ab55672aec5e7
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5227686
|
||||
Reviewed-by: Mikel Astiz <mastiz@chromium.org>
|
||||
Commit-Queue: José Dapena Paz <jdapena@igalia.com>
|
||||
Cr-Commit-Position: refs/heads/main@{#1250753}
|
||||
|
||||
diff --git a/components/bookmarks/browser/uuid_index.h b/components/bookmarks/browser/uuid_index.h
|
||||
index 77cb1a1a54dd9..639d6fefcd831 100644
|
||||
--- a/components/bookmarks/browser/uuid_index.h
|
||||
+++ b/components/bookmarks/browser/uuid_index.h
|
||||
@@ -23,6 +23,10 @@ class NodeUuidEquality {
|
||||
bool operator()(const BookmarkNode* n1, const base::Uuid& uuid2) const {
|
||||
return n1->uuid() == uuid2;
|
||||
}
|
||||
+
|
||||
+ bool operator()(const base::Uuid& uuid1, const BookmarkNode* n2) const {
|
||||
+ return uuid1 == n2->uuid();
|
||||
+ }
|
||||
};
|
||||
|
||||
// Used to hash BookmarkNode instances by UUID.
|
||||
@@ -1,80 +0,0 @@
|
||||
diff --git a/base/types/to_address.h.new b/base/types/to_address.h.new
|
||||
new file mode 100644
|
||||
index 0000000..ac71b01
|
||||
--- /dev/null
|
||||
+++ b/base/types/to_address.h
|
||||
@@ -0,0 +1,40 @@
|
||||
+// Copyright 2024 The Chromium Authors
|
||||
+// Use of this source code is governed by a BSD-style license that can be
|
||||
+// found in the LICENSE file.
|
||||
+
|
||||
+#ifndef BASE_TYPES_TO_ADDRESS_H_
|
||||
+#define BASE_TYPES_TO_ADDRESS_H_
|
||||
+
|
||||
+#include <memory>
|
||||
+#include <type_traits>
|
||||
+
|
||||
+// SFINAE-compatible wrapper for `std::to_address()`.
|
||||
+//
|
||||
+// The standard does not require `std::to_address()` to be SFINAE-compatible
|
||||
+// when code attempts instantiation with non-pointer-like types, and libstdc++'s
|
||||
+// implementation hard errors. For the sake of templated code that wants simple,
|
||||
+// unified handling, Chromium instead uses this wrapper, which provides that
|
||||
+// guarantee. This allows code to use "`to_address()` would be valid here" as a
|
||||
+// constraint to detect pointer-like types.
|
||||
+namespace base {
|
||||
+
|
||||
+// Note that calling `std::to_address()` with a function pointer renders the
|
||||
+// program ill-formed.
|
||||
+template <typename T>
|
||||
+ requires(!std::is_function_v<T>)
|
||||
+constexpr T* to_address(T* p) noexcept {
|
||||
+ return p;
|
||||
+}
|
||||
+
|
||||
+// These constraints cover the cases where `std::to_address()`'s fancy pointer
|
||||
+// overload is well-specified.
|
||||
+template <typename P>
|
||||
+ requires requires(const P& p) { std::pointer_traits<P>::to_address(p); } ||
|
||||
+ requires(const P& p) { p.operator->(); }
|
||||
+constexpr auto to_address(const P& p) noexcept {
|
||||
+ return std::to_address(p);
|
||||
+}
|
||||
+
|
||||
+} // namespace base
|
||||
+
|
||||
+#endif // BASE_TYPES_TO_ADDRESS_H_
|
||||
diff --git a/mojo/public/cpp/bindings/type_converter.h b/mojo/public/cpp/bindings/type_converter.h.new
|
||||
index 2eddbb0..317245f 100644
|
||||
--- a/mojo/public/cpp/bindings/type_converter.h
|
||||
+++ b/mojo/public/cpp/bindings/type_converter.h
|
||||
@@ -11,6 +11,8 @@
|
||||
#include <memory>
|
||||
#include <type_traits>
|
||||
|
||||
+#include "base/types/to_address.h"
|
||||
+
|
||||
namespace mojo {
|
||||
|
||||
// NOTE: When possible, please consider using StructTraits / UnionTraits /
|
||||
@@ -99,16 +99,16 @@
|
||||
|
||||
template <typename T, typename U>
|
||||
requires requires(const U& obj) {
|
||||
- not std::is_pointer_v<U>;
|
||||
- { mojo::ConvertTo<T>(std::to_address(obj)) } -> std::same_as<T>;
|
||||
+ !std::is_pointer_v<U>;
|
||||
+ { mojo::ConvertTo<T>(base::to_address(obj)) } -> std::same_as<T>;
|
||||
}
|
||||
inline T ConvertTo(const U& obj) {
|
||||
- return mojo::ConvertTo<T>(std::to_address(obj));
|
||||
+ return mojo::ConvertTo<T>(base::to_address(obj));
|
||||
}
|
||||
|
||||
template <typename T, typename U>
|
||||
requires requires(const U& obj) {
|
||||
- not std::is_pointer_v<U>;
|
||||
+ !std::is_pointer_v<U>;
|
||||
TypeConverter<T, U>::Convert(obj);
|
||||
}
|
||||
inline T ConvertTo(const U& obj) {
|
||||
215
chromium-124-shims.patch
Normal file
215
chromium-124-shims.patch
Normal file
@@ -0,0 +1,215 @@
|
||||
diff '--color=auto' -urp src/build/linux/unbundle.orig/absl_flags.gn src/build/linux/unbundle/absl_flags.gn
|
||||
--- src/build/linux/unbundle.orig/absl_flags.gn
|
||||
+++ src/build/linux/unbundle/absl_flags.gn
|
||||
@@ -5,14 +5,36 @@ pkg_config("system_absl_flags") {
|
||||
packages = [ "absl_flags" ]
|
||||
}
|
||||
|
||||
+pkg_config("absl_flags_config") {
|
||||
+ packages = [ "absl_flags_config" ]
|
||||
+}
|
||||
+
|
||||
pkg_config("system_absl_flags_parse") {
|
||||
packages = [ "absl_flags_parse" ]
|
||||
}
|
||||
|
||||
+pkg_config("system_absl_flags_reflection") {
|
||||
+ packages = [ "absl_flags_reflection" ]
|
||||
+}
|
||||
+
|
||||
pkg_config("system_absl_flags_usage") {
|
||||
packages = [ "absl_flags_usage" ]
|
||||
}
|
||||
|
||||
+shim_headers("flags_config_shim") {
|
||||
+ root_path = "."
|
||||
+ prefix = "absl/flags/"
|
||||
+ headers = [
|
||||
+ "config.h",
|
||||
+ "usage_config.h",
|
||||
+ ]
|
||||
+}
|
||||
+
|
||||
+source_set("config") {
|
||||
+ deps = [ ":flags_config_shim" ]
|
||||
+ public_configs = [ ":absl_flags_config" ]
|
||||
+}
|
||||
+
|
||||
shim_headers("flag_shim") {
|
||||
root_path = "."
|
||||
prefix = "absl/flags/"
|
||||
@@ -38,6 +60,20 @@ source_set("parse") {
|
||||
public_configs = [ ":system_absl_flags_parse" ]
|
||||
}
|
||||
|
||||
+shim_headers("flags_reflection_shim") {
|
||||
+ root_path = "."
|
||||
+ prefix = "absl/flags/"
|
||||
+ headers = [
|
||||
+ "internal/registry.h",
|
||||
+ "reflection.h",
|
||||
+ ]
|
||||
+}
|
||||
+
|
||||
+source_set("reflection") {
|
||||
+ deps = [ ":flags_reflection_shim" ]
|
||||
+ public_configs = [ ":system_absl_flags_reflection" ]
|
||||
+}
|
||||
+
|
||||
shim_headers("usage_shim") {
|
||||
root_path = "."
|
||||
prefix = "absl/flags/"
|
||||
diff '--color=auto' -urp src/build/linux/unbundle.orig/absl_log.gn src/build/linux/unbundle/absl_log.gn
|
||||
--- src/build/linux/unbundle.orig/absl_log.gn
|
||||
+++ src/build/linux/unbundle/absl_log.gn
|
||||
@@ -13,9 +13,22 @@ pkg_config("system_absl_die_if_null") {
|
||||
packages = [ "absl_die_if_null" ]
|
||||
}
|
||||
|
||||
+pkg_config("system_absl_check") {
|
||||
+ packages = [ "absl_check" ]
|
||||
+}
|
||||
+
|
||||
pkg_config("system_absl_log") {
|
||||
packages = [ "absl_log" ]
|
||||
}
|
||||
+
|
||||
+pkg_config("system_absl_log_globals") {
|
||||
+ packages = [ "absl_log_globals" ]
|
||||
+}
|
||||
+
|
||||
+pkg_config("system_absl_log_initialize") {
|
||||
+ packages = [ "absl_log_initialize" ]
|
||||
+}
|
||||
+
|
||||
shim_headers("absl_check_shim") {
|
||||
root_path = "."
|
||||
prefix = "absl/log/"
|
||||
@@ -49,6 +62,39 @@ source_set("die_if_null") {
|
||||
public_configs = [ ":system_absl_die_if_null" ]
|
||||
}
|
||||
|
||||
+shim_headers("check_shim") {
|
||||
+ root_path = "."
|
||||
+ prefix = "absl/log/"
|
||||
+ headers = [ "check.h" ]
|
||||
+}
|
||||
+
|
||||
+source_set("check") {
|
||||
+ deps = [ ":check_shim" ]
|
||||
+ public_configs = [ ":system_absl_check" ]
|
||||
+}
|
||||
+
|
||||
+shim_headers("globals_shim") {
|
||||
+ root_path = "."
|
||||
+ prefix = "absl/log/"
|
||||
+ headers = [ "globals.h" ]
|
||||
+}
|
||||
+
|
||||
+source_set("globals") {
|
||||
+ deps = [ ":globals_shim" ]
|
||||
+ public_configs = [ ":system_absl_log_globals" ]
|
||||
+}
|
||||
+
|
||||
+shim_headers("initialize_shim") {
|
||||
+ root_path = "."
|
||||
+ prefix = "absl/log/"
|
||||
+ headers = [ "initialize.h" ]
|
||||
+}
|
||||
+
|
||||
+source_set("initialize") {
|
||||
+ deps = [ ":initialize_shim" ]
|
||||
+ public_configs = [ ":system_absl_log_initialize" ]
|
||||
+}
|
||||
+
|
||||
shim_headers("log_shim") {
|
||||
root_path = "."
|
||||
prefix = "absl/log/"
|
||||
diff '--color=auto' -urp src/build/linux/unbundle.orig/libwebp.gn src/build/linux/unbundle/libwebp.gn
|
||||
--- src/build/linux/unbundle.orig/libwebp.gn
|
||||
+++ src/build/linux/unbundle/libwebp.gn
|
||||
@@ -33,3 +33,7 @@ source_set("libwebp_webp") {
|
||||
group("libwebp") {
|
||||
deps = [ ":libwebp_webp" ]
|
||||
}
|
||||
+
|
||||
+source_set("libwebp_sharpyuv") {
|
||||
+ # Unused in Chromium. Empty to enable building with old webp which does not have sharpyuv
|
||||
+}
|
||||
diff '--color=auto' -urp src/build/linux/unbundle.orig/re2.gn src/build/linux/unbundle/re2.gn
|
||||
--- src/build/linux/unbundle.orig/re2.gn
|
||||
+++ src/build/linux/unbundle/re2.gn
|
||||
@@ -3,6 +3,7 @@
|
||||
# found in the LICENSE file.
|
||||
|
||||
import("//build/config/c++/c++.gni")
|
||||
+import("//build/config/linux/pkg_config.gni")
|
||||
import("//build/shim_headers.gni")
|
||||
|
||||
assert(!use_custom_libcxx,
|
||||
@@ -10,6 +11,10 @@ assert(!use_custom_libcxx,
|
||||
"use_custom_libcxx=true because the library's interface relies on " +
|
||||
"libstdc++'s std::string and std::vector.")
|
||||
|
||||
+pkg_config("re2_config") {
|
||||
+ packages = [ "re2" ]
|
||||
+}
|
||||
+
|
||||
shim_headers("re2_shim") {
|
||||
root_path = "src"
|
||||
headers = [
|
||||
@@ -23,5 +28,5 @@ shim_headers("re2_shim") {
|
||||
|
||||
source_set("re2") {
|
||||
deps = [ ":re2_shim" ]
|
||||
- libs = [ "re2" ]
|
||||
+ public_configs = [ ":re2_config" ]
|
||||
}
|
||||
--- src/build/linux/unbundle/absl_container.gn.orig
|
||||
+++ src/build/linux/unbundle/absl_container.gn
|
||||
@@ -117,6 +117,8 @@ source_set("flat_hash_map_test") {
|
||||
}
|
||||
source_set("flat_hash_set_test") {
|
||||
}
|
||||
+source_set("hash_function_defaults_test") {
|
||||
+}
|
||||
source_set("inlined_vector_test") {
|
||||
}
|
||||
source_set("node_slot_policy_test") {
|
||||
--- src/build/linux/unbundle/replace_gn_files.py.orig
|
||||
+++ src/build/linux/unbundle/replace_gn_files.py
|
||||
@@ -80,6 +80,7 @@ REPLACEMENTS = {
|
||||
'vulkan_memory_allocator' : 'third_party/vulkan_memory_allocator/BUILD.gn',
|
||||
'woff2': 'third_party/woff2/BUILD.gn',
|
||||
'zlib': 'third_party/zlib/BUILD.gn',
|
||||
+ 'zstd': 'third_party/zstd/BUILD.gn',
|
||||
}
|
||||
|
||||
|
||||
--- /dev/null
|
||||
+++ src/build/linux/unbundle/zstd.gn
|
||||
@@ -0,0 +1,24 @@
|
||||
+import("//build/config/linux/pkg_config.gni")
|
||||
+import("//build/shim_headers.gni")
|
||||
+
|
||||
+pkg_config("system_zstd") {
|
||||
+ packages = [ "libzstd" ]
|
||||
+}
|
||||
+
|
||||
+shim_headers("zstd_shim") {
|
||||
+ root_path = "src/lib"
|
||||
+ headers = [
|
||||
+ "zstd.h",
|
||||
+ "zstd_errors.h",
|
||||
+ ]
|
||||
+}
|
||||
+
|
||||
+source_set("decompress") {
|
||||
+ deps = [ ":zstd_shim" ]
|
||||
+ public_configs = [ ":system_zstd" ]
|
||||
+}
|
||||
+
|
||||
+source_set("headers") {
|
||||
+ deps = [ ":zstd_shim" ]
|
||||
+ public_configs = [ ":system_zstd" ]
|
||||
+}
|
||||
@@ -1,76 +0,0 @@
|
||||
diff --git a/components/cast_channel/enum_table.h b/components/cast_channel/enum_table.h
|
||||
index 842553a..89de703 100644
|
||||
--- a/components/media_router/common/providers/cast/channel/enum_table.h
|
||||
+++ b/components/media_router/common/providers/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()))
|
||||
@@ -1,37 +0,0 @@
|
||||
Index: electron-17.1.0/third_party/perfetto/src/trace_processor/db/column.cc
|
||||
===================================================================
|
||||
--- electron-17.1.0.orig/third_party/perfetto/src/trace_processor/db/column.cc 2022-03-07 17:28:24.814737660 +0100
|
||||
+++ electron-17.1.0/third_party/perfetto/src/trace_processor/db/column.cc 2022-03-09 08:25:10.346569313 +0100
|
||||
@@ -14,6 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
+#include <limits>
|
||||
#include "src/trace_processor/db/column.h"
|
||||
|
||||
#include "perfetto/base/logging.h"
|
||||
Index: electron-17.1.0/ui/gtk/gtk_key_bindings_handler.cc
|
||||
===================================================================
|
||||
--- electron-17.1.0.orig/chrome/browser/ui/bookmarks/bookmark_tab_helper.cc 2022-03-07 17:20:31.788817015 +0100
|
||||
+++ electron-17.1.0/chrome/browser/ui/bookmarks/bookmark_tab_helper.cc 2022-03-09 08:25:10.346569313 +0100
|
||||
@@ -2,6 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
+#include <cstddef>
|
||||
#include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h"
|
||||
|
||||
#include "base/observer_list.h"
|
||||
Index: electron-17.1.0/components/bookmarks/browser/base_bookmark_model_observer.cc
|
||||
===================================================================
|
||||
--- electron-17.1.0.orig/components/bookmarks/browser/base_bookmark_model_observer.cc 2022-03-07 17:20:33.308823187 +0100
|
||||
+++ electron-17.1.0/components/bookmarks/browser/base_bookmark_model_observer.cc 2022-03-09 08:25:10.346569313 +0100
|
||||
@@ -2,6 +2,8 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
+#include <cstddef>
|
||||
+
|
||||
#include "components/bookmarks/browser/base_bookmark_model_observer.h"
|
||||
|
||||
namespace bookmarks {
|
||||
@@ -20,7 +20,7 @@ This font is already available in opensuse and can be installed systemwide
|
||||
- }
|
||||
|
||||
public_deps = [
|
||||
"cr_elements:build_grdp",
|
||||
"cr_components/commerce:build_grdp",
|
||||
'roboto.css' -> 'roboto.css.new'
|
||||
--- a/ui/webui/resources/css/roboto.css 2022-06-15 15:58:23.846426661 +0200
|
||||
+++ b/ui/webui/resources/css/roboto.css 2022-06-21 15:53:08.931243442 +0200
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
--- a/components/crash/core/app/crashpad.cc
|
||||
+++ b/components/crash/core/app/crashpad.cc
|
||||
@@ -28,8 +28,8 @@
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "build/chromeos_buildflags.h"
|
||||
#include "components/crash/core/app/crash_reporter_client.h"
|
||||
#include "components/crash/core/common/crash_key.h"
|
||||
-#include "third_party/abseil-cpp/absl/base/internal/raw_logging.h"
|
||||
-#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
+#include <absl/base/internal/raw_logging.h>
|
||||
+#include <absl/types/optional.h>
|
||||
#include "third_party/crashpad/crashpad/client/annotation.h"
|
||||
#include "third_party/crashpad/crashpad/client/annotation_list.h"
|
||||
#include "third_party/crashpad/crashpad/client/crash_report_database.h"
|
||||
@@ -20,4 +18,4 @@
|
||||
+#endif
|
||||
namespace crash_reporter {
|
||||
|
||||
namespace {
|
||||
#if BUILDFLAG(IS_IOS)
|
||||
|
||||
@@ -214,7 +214,6 @@ keeplibs=(
|
||||
third_party/devtools-frontend/src/front_end/third_party #various javascript code compiled into chrome, see README.md
|
||||
third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/esm/third_party/mitt
|
||||
third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/esm/third_party/rxjs
|
||||
third_party/devtools-frontend/src/test/unittests/front_end/third_party/i18n # javascript
|
||||
third_party/devtools-frontend/src/third_party/i18n #javascript
|
||||
third_party/devtools-frontend/src/third_party/typescript #Chromium added code
|
||||
third_party/distributed_point_functions #not in any distro
|
||||
@@ -223,6 +222,7 @@ keeplibs=(
|
||||
third_party/electron_node #Integral part of electron
|
||||
third_party/emoji-segmenter #not available as a shared library
|
||||
third_party/fdlibm #derived code, not vendored dep
|
||||
third_party/fp16 #Fedora 41 has it (but an old version?) Not in openSUSE. Header-only library thus we're not debundling it rn.
|
||||
third_party/hunspell #heavily forked version
|
||||
third_party/inspector_protocol #integral part of chrome
|
||||
third_party/ipcz #not in any distro
|
||||
@@ -327,6 +327,7 @@ rm -rf third_party/electron_node/deps/{googletest/{include,src},icu-small} #292M
|
||||
find third_party/electron_node/deps/brotli -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete
|
||||
find third_party/electron_node/deps/cares -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete
|
||||
find third_party/electron_node/deps/nghttp2 -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete
|
||||
find third_party/electron_node/deps/ngtcp2 -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete
|
||||
find third_party/electron_node/deps/openssl -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete
|
||||
find third_party/electron_node/deps/v8 -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete
|
||||
rm -rvf third_party/electron_node/deps/v8/tools
|
||||
|
||||
@@ -181,7 +181,7 @@ author: Michael Gilbert <mgilbert@debian.org>
|
||||
deps += [
|
||||
"//chrome/browser/resources:component_extension_resources",
|
||||
@@ -199,7 +197,6 @@ template("chrome_extra_paks") {
|
||||
"//chrome/browser/resources:dev_ui_paks",
|
||||
"//chrome/browser/resources/lens/overlay:resources",
|
||||
"//chrome/browser/resources/search_engine_choice:resources",
|
||||
"//content/browser/devtools:devtools_resources",
|
||||
- "//content/browser/tracing:resources",
|
||||
|
||||
@@ -38,7 +38,7 @@ index 19b45dc1268..67dcd7752d0 100644
|
||||
"speech/speech_synthesis_impl.cc",
|
||||
"speech/speech_synthesis_impl.h",
|
||||
"speech/tts_controller_impl.cc",
|
||||
@@ -2956,17 +2951,6 @@ source_set("browser") {
|
||||
@@ -2956,19 +2951,6 @@ source_set("browser") {
|
||||
"service_worker/service_worker_usb_delegate_observer.cc",
|
||||
"service_worker/service_worker_usb_delegate_observer.h",
|
||||
|
||||
@@ -49,6 +49,8 @@ index 19b45dc1268..67dcd7752d0 100644
|
||||
- "speech/endpointer/energy_endpointer.h",
|
||||
- "speech/endpointer/energy_endpointer_params.cc",
|
||||
- "speech/endpointer/energy_endpointer_params.h",
|
||||
- "speech/network_speech_recognition_engine_impl.cc",
|
||||
- "speech/network_speech_recognition_engine_impl.h",
|
||||
- "speech/speech_recognition_engine.cc",
|
||||
- "speech/speech_recognition_engine.h",
|
||||
- "speech/speech_recognizer_impl.cc",
|
||||
|
||||
@@ -4,13 +4,14 @@ Index: electron-17.1.0/chrome/browser/process_singleton.h
|
||||
+++ electron-17.1.0/chrome/browser/process_singleton.h 2022-03-09 08:29:01.682773127 +0100
|
||||
@@ -102,7 +102,7 @@ class ProcessSingleton {
|
||||
using NotificationCallback =
|
||||
base::RepeatingCallback<bool(const base::CommandLine& command_line,
|
||||
base::RepeatingCallback<bool(base::CommandLine command_line,
|
||||
const base::FilePath& current_directory,
|
||||
- const std::vector<const uint8_t> additional_data)>;
|
||||
+ const std::vector<uint8_t> additional_data)>;
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
ProcessSingleton(const std::string& program_name,
|
||||
|
||||
Index: electron-17.1.0/chrome/browser/process_singleton_posix.cc
|
||||
===================================================================
|
||||
--- electron-17.1.0.orig/chrome/browser/process_singleton_posix.cc 2022-03-07 17:39:06.993345117 +0100
|
||||
@@ -88,20 +89,20 @@ Index: electron-17.1.0/electron/shell/browser/api/electron_api_app.cc
|
||||
+++ electron-17.1.0/electron/shell/browser/api/electron_api_app.cc 2022-03-09 08:29:01.682773127 +0100
|
||||
@@ -517,10 +517,10 @@ bool NotificationCallbackWrapper(
|
||||
const base::RepeatingCallback<
|
||||
void(const base::CommandLine& command_line,
|
||||
void(base::CommandLine command_line,
|
||||
const base::FilePath& current_directory,
|
||||
- const std::vector<const uint8_t> additional_data)>& callback,
|
||||
+ const std::vector<uint8_t> additional_data)>& callback,
|
||||
const base::CommandLine& cmd,
|
||||
base::CommandLine cmd,
|
||||
const base::FilePath& cwd,
|
||||
- const std::vector<const uint8_t> additional_data) {
|
||||
+ const std::vector<uint8_t> additional_data) {
|
||||
// Make sure the callback is called after app gets ready.
|
||||
if (Browser::Get()->is_ready()) {
|
||||
callback.Run(cmd, cwd, std::move(additional_data));
|
||||
callback.Run(std::move(cmd), cwd, std::move(additional_data));
|
||||
@@ -1081,7 +1081,7 @@ std::string App::GetLocaleCountryCode()
|
||||
|
||||
void App::OnSecondInstance(const base::CommandLine& cmd,
|
||||
void App::OnSecondInstance(base::CommandLine cmd,
|
||||
const base::FilePath& cwd,
|
||||
- const std::vector<const uint8_t> additional_data) {
|
||||
+ const std::vector<uint8_t> additional_data) {
|
||||
@@ -114,7 +115,7 @@ Index: electron-17.1.0/electron/shell/browser/api/electron_api_app.h
|
||||
+++ electron-17.1.0/electron/shell/browser/api/electron_api_app.h 2022-03-09 08:29:01.682773127 +0100
|
||||
@@ -194,7 +194,7 @@ class App : public ElectronBrowserClient
|
||||
std::string GetSystemLocale(gin_helper::ErrorThrower thrower) const;
|
||||
void OnSecondInstance(const base::CommandLine& cmd,
|
||||
void OnSecondInstance(base::CommandLine cmd,
|
||||
const base::FilePath& cwd,
|
||||
- const std::vector<const uint8_t> additional_data);
|
||||
+ const std::vector<uint8_t> additional_data);
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:56fe6478254038ecc1060de6ca3cb1c5db3882b1c298d85b98b24974fb99cfeb
|
||||
size 572715929
|
||||
3
electron-30.5.0.tar.zst
Normal file
3
electron-30.5.0.tar.zst
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:85fa505a8c6b0d13e0af3dc2932a99bc556d0172fc1ef73d8fc2f40c80356270
|
||||
size 588034335
|
||||
25
enable_stack_trace_line_numbers-symbol_level.patch
Normal file
25
enable_stack_trace_line_numbers-symbol_level.patch
Normal file
@@ -0,0 +1,25 @@
|
||||
Reducing symbol_level is a kludge and should have no effect on generated code.
|
||||
|
||||
--- src/base/BUILD.gn.orig
|
||||
+++ src/base/BUILD.gn
|
||||
@@ -2531,11 +2531,6 @@ buildflag_header("debugging_buildflags")
|
||||
enable_commandline_sequence_checks =
|
||||
(is_debug || dcheck_always_on) && !is_android
|
||||
|
||||
- if (enable_stack_trace_line_numbers) {
|
||||
- assert(
|
||||
- symbol_level > 0,
|
||||
- "symbol_level must be set to greater than 0 for source line numbers.")
|
||||
- }
|
||||
|
||||
flags = [
|
||||
"DCHECK_IS_CONFIGURABLE=$dcheck_is_configurable",
|
||||
--- src/build/config/logging.gni.orig
|
||||
+++ src/build/config/logging.gni
|
||||
@@ -11,5 +11,5 @@ declare_args() {
|
||||
enable_log_error_not_reached =
|
||||
is_chromeos_ash && !(is_debug || dcheck_always_on)
|
||||
|
||||
- enable_stack_trace_line_numbers = symbol_level > 0
|
||||
+ enable_stack_trace_line_numbers = true
|
||||
}
|
||||
119
ffmpeg-7-ffmpeg_video_decoder-reordered_opaque.patch
Normal file
119
ffmpeg-7-ffmpeg_video_decoder-reordered_opaque.patch
Normal file
@@ -0,0 +1,119 @@
|
||||
From 62274859104bd828373ae406aa9309e610449ac5 Mon Sep 17 00:00:00 2001
|
||||
From: Ted Meyer <tmathmeyer@chromium.org>
|
||||
Date: Fri, 22 Mar 2024 19:56:55 +0000
|
||||
Subject: [PATCH] Replace deprecated use of AVCodecContext::reordered_opaque
|
||||
|
||||
We can use the AV_CODEC_FLAG_COPY_OPAQUE flag on the codec context
|
||||
now to trigger timestamp propagation.
|
||||
|
||||
Bug: 330573128
|
||||
Change-Id: I6bc57241a35ab5283742aad8d42acb4dc5e85858
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5384308
|
||||
Commit-Queue: Ted (Chromium) Meyer <tmathmeyer@chromium.org>
|
||||
Reviewed-by: Dan Sanders <sandersd@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#1277051}
|
||||
---
|
||||
media/filters/ffmpeg_video_decoder.cc | 17 +++++++++++++----
|
||||
media/filters/ffmpeg_video_decoder.h | 16 ++++++++++++++++
|
||||
2 files changed, 29 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/media/filters/ffmpeg_video_decoder.cc b/media/filters/ffmpeg_video_decoder.cc
|
||||
index bd75477feeabb7..8a658a58caac5b 100644
|
||||
--- a/media/filters/ffmpeg_video_decoder.cc
|
||||
+++ b/media/filters/ffmpeg_video_decoder.cc
|
||||
@@ -134,7 +134,7 @@ bool FFmpegVideoDecoder::IsCodecSupported(VideoCodec codec) {
|
||||
}
|
||||
|
||||
FFmpegVideoDecoder::FFmpegVideoDecoder(MediaLog* media_log)
|
||||
- : media_log_(media_log) {
|
||||
+ : media_log_(media_log), timestamp_map_(128) {
|
||||
DVLOG(1) << __func__;
|
||||
DETACH_FROM_SEQUENCE(sequence_checker_);
|
||||
}
|
||||
@@ -213,10 +213,6 @@ int FFmpegVideoDecoder::GetVideoBuffer(struct AVCodecContext* codec_context,
|
||||
frame->linesize[plane] = layout->planes()[plane].stride;
|
||||
}
|
||||
|
||||
- // This seems unsafe, given threaded decoding. However, `reordered_opaque` is
|
||||
- // also going away upstream, so we need a whole new mechanism either way.
|
||||
- frame->reordered_opaque = codec_context->reordered_opaque;
|
||||
-
|
||||
// This will be freed by `ReleaseVideoBufferImpl`.
|
||||
auto* opaque = new OpaqueData(fb_priv, frame_pool_, data, allocation_size,
|
||||
std::move(*layout));
|
||||
@@ -363,8 +363,10 @@ bool FFmpegVideoDecoder::FFmpegDecode(const DecoderBuffer& buffer) {
|
||||
DCHECK(packet->data);
|
||||
DCHECK_GT(packet->size, 0);
|
||||
|
||||
- // Let FFmpeg handle presentation timestamp reordering.
|
||||
- codec_context_->reordered_opaque = buffer.timestamp().InMicroseconds();
|
||||
+ const int64_t timestamp = buffer.timestamp().InMicroseconds();
|
||||
+ const TimestampId timestamp_id = timestamp_id_generator_.GenerateNextId();
|
||||
+ timestamp_map_.Put(std::make_pair(timestamp_id, timestamp));
|
||||
+ packet->opaque = reinterpret_cast<void*>(timestamp_id.GetUnsafeValue());
|
||||
}
|
||||
FFmpegDecodingLoop::DecodeStatus decode_status = decoding_loop_->DecodePacket(
|
||||
packet, base::BindRepeating(&FFmpegVideoDecoder::OnNewFrame,
|
||||
@@ -423,7 +425,12 @@ bool FFmpegVideoDecoder::OnNewFrame(AVFrame* frame) {
|
||||
}
|
||||
gfx::Size natural_size = aspect_ratio.GetNaturalSize(visible_rect);
|
||||
|
||||
- const auto pts = base::Microseconds(frame->reordered_opaque);
|
||||
+ const auto ts_id = TimestampId(reinterpret_cast<size_t>(frame->opaque));
|
||||
+ const auto ts_lookup = timestamp_map_.Get(ts_id);
|
||||
+ if (ts_lookup == timestamp_map_.end()) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ const auto pts = base::Microseconds(std::get<1>(*ts_lookup));
|
||||
auto video_frame = VideoFrame::WrapExternalDataWithLayout(
|
||||
opaque->layout, visible_rect, natural_size, opaque->data, opaque->size,
|
||||
pts);
|
||||
@@ -498,8 +505,10 @@ bool FFmpegVideoDecoder::ConfigureDecoder(const VideoDecoderConfig& config,
|
||||
codec_context_->thread_count = GetFFmpegVideoDecoderThreadCount(config);
|
||||
codec_context_->thread_type =
|
||||
FF_THREAD_SLICE | (low_delay ? 0 : FF_THREAD_FRAME);
|
||||
+
|
||||
codec_context_->opaque = this;
|
||||
codec_context_->get_buffer2 = GetVideoBufferImpl;
|
||||
+ codec_context_->flags |= AV_CODEC_FLAG_COPY_OPAQUE;
|
||||
|
||||
if (base::FeatureList::IsEnabled(kFFmpegAllowLists)) {
|
||||
// Note: FFmpeg will try to free this string, so we must duplicate it.
|
||||
diff --git a/media/filters/ffmpeg_video_decoder.h b/media/filters/ffmpeg_video_decoder.h
|
||||
index d02cb89c3ddf7c..0a2de1c623ffff 100644
|
||||
--- a/media/filters/ffmpeg_video_decoder.h
|
||||
+++ b/media/filters/ffmpeg_video_decoder.h
|
||||
@@ -7,10 +7,12 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
+#include "base/containers/lru_cache.h"
|
||||
#include "base/functional/callback.h"
|
||||
#include "base/memory/raw_ptr.h"
|
||||
#include "base/memory/scoped_refptr.h"
|
||||
#include "base/sequence_checker.h"
|
||||
+#include "base/types/id_type.h"
|
||||
#include "media/base/frame_buffer_pool.h"
|
||||
#include "media/base/supported_video_decoder_config.h"
|
||||
#include "media/base/video_decoder.h"
|
||||
@@ -87,6 +89,20 @@ class MEDIA_EXPORT FFmpegVideoDecoder : public VideoDecoder {
|
||||
// FFmpeg structures owned by this object.
|
||||
std::unique_ptr<AVCodecContext, ScopedPtrAVFreeContext> codec_context_;
|
||||
|
||||
+ // The gist here is that timestamps need to be 64 bits to store microsecond
|
||||
+ // precision. A 32 bit integer would overflow at ~35 minutes at this level of
|
||||
+ // precision. We can't cast the timestamp to the void ptr object used by the
|
||||
+ // opaque field in ffmpeg then, because it would lose data on a 32 bit build.
|
||||
+ // However, we don't actually have 2^31 timestamped frames in a single
|
||||
+ // playback, so it's fine to use the 32 bit value as a key in a map which
|
||||
+ // contains the actual timestamps. Additionally, we've in the past set 128
|
||||
+ // outstanding frames for re-ordering as a limit for cross-thread decoding
|
||||
+ // tasks, so we'll do that here too with the LRU cache.
|
||||
+ using TimestampId = base::IdType<int64_t, size_t, 0>;
|
||||
+
|
||||
+ TimestampId::Generator timestamp_id_generator_;
|
||||
+ base::LRUCache<TimestampId, int64_t> timestamp_map_;
|
||||
+
|
||||
VideoDecoderConfig config_;
|
||||
|
||||
scoped_refptr<FrameBufferPool> frame_pool_;
|
||||
@@ -0,0 +1,31 @@
|
||||
From 072b9f3bc340020325cf3dd7bff1991cd22de171 Mon Sep 17 00:00:00 2001
|
||||
From: Jose Dapena Paz <jdapena@igalia.com>
|
||||
Date: Tue, 19 Mar 2024 16:27:55 +0000
|
||||
Subject: [PATCH] IWYU: missing include for std::optional usage in
|
||||
first_party_sets_handler_database_helper.h
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Bug: 41455655
|
||||
Change-Id: Ia644d2e6baa904190d162575dd16264e66ea227e
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5377063
|
||||
Reviewed-by: Chris Fredrickson <cfredric@chromium.org>
|
||||
Commit-Queue: José Dapena Paz <jdapena@igalia.com>
|
||||
Cr-Commit-Position: refs/heads/main@{#1274977}
|
||||
---
|
||||
.../first_party_sets/first_party_sets_handler_database_helper.h | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/content/browser/first_party_sets/first_party_sets_handler_database_helper.h b/content/browser/first_party_sets/first_party_sets_handler_database_helper.h
|
||||
index a12af718abda0..92afb98d64ea4 100644
|
||||
--- a/content/browser/first_party_sets/first_party_sets_handler_database_helper.h
|
||||
+++ b/content/browser/first_party_sets/first_party_sets_handler_database_helper.h
|
||||
@@ -6,6 +6,7 @@
|
||||
#define CONTENT_BROWSER_FIRST_PARTY_SETS_FIRST_PARTY_SETS_HANDLER_DATABASE_HELPER_H_
|
||||
|
||||
#include <memory>
|
||||
+#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
32
gpu_adapter_info-missing-optional.patch
Normal file
32
gpu_adapter_info-missing-optional.patch
Normal file
@@ -0,0 +1,32 @@
|
||||
From 15e24abc1646ad9984923234a041cd0c3b8b1607 Mon Sep 17 00:00:00 2001
|
||||
From: Jose Dapena Paz <jdapena@igalia.com>
|
||||
Date: Tue, 19 Mar 2024 16:21:06 +0000
|
||||
Subject: [PATCH] IWYU: missing include for usage of std::optional in
|
||||
gpu_adapter_info.h
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Bug: 41455655
|
||||
Change-Id: I42d6c9f99ea7718fa87267ebcf3368d0f46f5053
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5374260
|
||||
Commit-Queue: José Dapena Paz <jdapena@igalia.com>
|
||||
Reviewed-by: Austin Eng <enga@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#1274974}
|
||||
---
|
||||
third_party/blink/renderer/modules/webgpu/gpu_adapter_info.h | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_adapter_info.h b/third_party/blink/renderer/modules/webgpu/gpu_adapter_info.h
|
||||
index 70b15d5c055aa..2084afbe6e877 100644
|
||||
--- a/third_party/blink/renderer/modules/webgpu/gpu_adapter_info.h
|
||||
+++ b/third_party/blink/renderer/modules/webgpu/gpu_adapter_info.h
|
||||
@@ -5,6 +5,8 @@
|
||||
#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_ADAPTER_INFO_H_
|
||||
#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_ADAPTER_INFO_H_
|
||||
|
||||
+#include <optional>
|
||||
+
|
||||
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
|
||||
#include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h"
|
||||
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
|
||||
@@ -1,37 +0,0 @@
|
||||
From 05a74771fed5491740588ec7b39ba64a7b710013 Mon Sep 17 00:00:00 2001
|
||||
From: Jose Dapena Paz <jdapena@igalia.com>
|
||||
Date: Thu, 1 Feb 2024 17:34:38 +0000
|
||||
Subject: [PATCH] GCC: avoid clash between getter and type in
|
||||
grid_sizing_tree.h
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Rename GridSubsizingTree::GridItems getter to GetGridItems to avoid
|
||||
type clash.
|
||||
|
||||
Bug: 819294
|
||||
Change-Id: I4112929d9f85dc4573002b429cc982d50085d3c9
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5224147
|
||||
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
|
||||
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
|
||||
Commit-Queue: José Dapena Paz <jdapena@igalia.com>
|
||||
Cr-Commit-Position: refs/heads/main@{#1255116}
|
||||
---
|
||||
.../core/layout/grid/grid_layout_algorithm.cc | 13 +++++++------
|
||||
.../renderer/core/layout/grid/grid_sizing_tree.h | 2 +-
|
||||
2 files changed, 8 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/layout/grid/grid_sizing_tree.h b/third_party/blink/renderer/core/layout/grid/grid_sizing_tree.h
|
||||
index 45d55e2b36da4..2148ea9ea0657 100644
|
||||
--- a/third_party/blink/renderer/core/layout/grid/grid_sizing_tree.h
|
||||
+++ b/third_party/blink/renderer/core/layout/grid/grid_sizing_tree.h
|
||||
@@ -188,7 +188,7 @@ class GridSizingSubtree
|
||||
/* subtree_root */ grid_tree_->LookupSubgridIndex(subgrid_data));
|
||||
}
|
||||
|
||||
- GridItems& GridItems() const {
|
||||
+ ::blink::GridItems& GridItems() const {
|
||||
DCHECK(grid_tree_);
|
||||
return grid_tree_->At(subtree_root_).grid_items;
|
||||
}
|
||||
@@ -439,15 +439,6 @@ index caf5d49..0d4b6f9 100644
|
||||
#include "base/check_op.h"
|
||||
#include "third_party/blink/renderer/platform/fonts/font_platform_data.h"
|
||||
#include "third_party/blink/renderer/platform/fonts/opentype/open_type_vertical_data.h"
|
||||
@@ -81,7 +83,7 @@
|
||||
return vertical_data_;
|
||||
}
|
||||
|
||||
- HbScoped<hb_font_t> unscaled_font_;
|
||||
+ hb::unique_ptr<hb_font_t> unscaled_font_;
|
||||
SkFont font_;
|
||||
|
||||
// Capture these scaled fallback metrics from FontPlatformData so that a
|
||||
diff --git a/third_party/harfbuzz-ng/BUILD.gn b/third_party/harfbuzz-ng/BUILD.gn
|
||||
index 522e164d..4b64e1b 100644
|
||||
--- a/third_party/harfbuzz-ng/BUILD.gn
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
From 3a75d7f8dc3a08a38dd893031f8996b91a00764b Mon Sep 17 00:00:00 2001
|
||||
From: Jose Dapena Paz <jdapena@igalia.com>
|
||||
Date: Tue, 23 Jan 2024 17:55:15 +0000
|
||||
Subject: [PATCH] IWYU: usage of std::optional in hit_test_request.h requires
|
||||
include
|
||||
|
||||
Bug: 957519
|
||||
Change-Id: I1ec32af603720d13bfa4e22e20142459802284b4
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5227329
|
||||
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
|
||||
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#1250917}
|
||||
---
|
||||
third_party/blink/renderer/core/layout/hit_test_request.h | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/layout/hit_test_request.h b/third_party/blink/renderer/core/layout/hit_test_request.h
|
||||
index c33144dc975b6..38968126fe520 100644
|
||||
--- a/third_party/blink/renderer/core/layout/hit_test_request.h
|
||||
+++ b/third_party/blink/renderer/core/layout/hit_test_request.h
|
||||
@@ -23,6 +23,8 @@
|
||||
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_HIT_TEST_REQUEST_H_
|
||||
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_HIT_TEST_REQUEST_H_
|
||||
|
||||
+#include <optional>
|
||||
+
|
||||
#include "base/functional/callback.h"
|
||||
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
|
||||
#include "third_party/blink/renderer/platform/heap/member.h"
|
||||
@@ -0,0 +1,13 @@
|
||||
--- src/third_party/webrtc/modules/video_coding/codecs/av1/libaom_av1_encoder.cc.orig 2024-05-29 12:13:50.205359130 +0200
|
||||
+++ src/third_party/webrtc/modules/video_coding/codecs/av1/libaom_av1_encoder.cc 2024-05-29 23:55:59.239008160 +0200
|
||||
@@ -311,8 +311,10 @@ int LibaomAv1Encoder::InitEncode(const V
|
||||
|
||||
if (codec_settings->mode == VideoCodecMode::kRealtimeVideo &&
|
||||
encoder_settings_.GetFrameDropEnabled() && max_consec_frame_drop_ > 0) {
|
||||
+#ifdef AOM_CTRL_AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR
|
||||
SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR,
|
||||
max_consec_frame_drop_);
|
||||
+#endif
|
||||
}
|
||||
|
||||
if (cfg_.g_threads == 8) {
|
||||
33
licenses.py-FileNotFoundError.patch
Normal file
33
licenses.py-FileNotFoundError.patch
Normal file
@@ -0,0 +1,33 @@
|
||||
[154/40125] python3 ../../tools/licenses/licenses.py --target-os=linux --depfile gen/components/resources/about_credits.d credits gen/components/resources/about_credits.html
|
||||
FAILED: gen/components/resources/about_credits.html
|
||||
python3 ../../tools/licenses/licenses.py --target-os=linux --depfile gen/components/resources/about_credits.d credits gen/components/resources/about_credits.html
|
||||
Traceback (most recent call last):
|
||||
File "/home/abuild/rpmbuild/BUILD/src/out/Release/../../tools/licenses/licenses.py", line 1445, in <module>
|
||||
sys.exit(main())
|
||||
^^^^^^
|
||||
File "/home/abuild/rpmbuild/BUILD/src/out/Release/../../tools/licenses/licenses.py", line 1428, in main
|
||||
if not GenerateCredits(
|
||||
^^^^^^^^^^^^^^^^
|
||||
File "/home/abuild/rpmbuild/BUILD/src/out/Release/../../tools/licenses/licenses.py", line 1069, in GenerateCredits
|
||||
directory_metadata, _ = ParseDir(path,
|
||||
^^^^^^^^^^^^^^
|
||||
File "/home/abuild/rpmbuild/BUILD/src/out/Release/../../tools/licenses/licenses.py", line 670, in ParseDir
|
||||
if not os.listdir(os.path.join(root, path)):
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
FileNotFoundError: [Errno 2] No such file or directory: '/home/abuild/rpmbuild/BUILD/src/third_party/angle/src/common/third_party/xxhash'
|
||||
|
||||
|
||||
--- src/tools/licenses/licenses.py.orig 2024-05-29 12:20:01.514877976 +0200
|
||||
+++ src/tools/licenses/licenses.py 2024-05-29 22:54:04.691863557 +0200
|
||||
@@ -667,7 +667,10 @@ def ParseDir(path,
|
||||
return [], []
|
||||
|
||||
# gclient creates empty directories for conditionally downloaded submodules.
|
||||
- if not os.listdir(os.path.join(root, path)):
|
||||
+ try:
|
||||
+ if not os.listdir(os.path.join(root, path)):
|
||||
+ return [], []
|
||||
+ except FileNotFoundError: #This gets thrown if directory is missing instead of empty.
|
||||
return [], []
|
||||
|
||||
# Get the metadata values, from
|
||||
@@ -1,10 +0,0 @@
|
||||
--- src/third_party/material_color_utilities/src/cpp/palettes/tones.cc.old 2023-10-11 11:30:46.080385500 +0200
|
||||
+++ src/third_party/material_color_utilities/src/cpp/palettes/tones.cc 2023-10-11 21:04:10.234128500 +0200
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
#include "cpp/palettes/tones.h"
|
||||
|
||||
+#include <cmath>
|
||||
#include "cpp/cam/cam.h"
|
||||
#include "cpp/cam/hct.h"
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
description: fix build error when building with clang & GNU libstdc++
|
||||
author: Stephan Hartmann <stha09@googlemail.com>
|
||||
|
||||
Apparently this doesn't happen with the embedded clang, but we get this:
|
||||
|
||||
In file included from ../../components/autofill/core/browser/form_parsing/regex_patterns.cc:5:
|
||||
In file included from ../../components/autofill/core/browser/form_parsing/regex_patterns.h:8:
|
||||
In file included from ../../base/containers/span.h:10:
|
||||
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/algorithm:74:
|
||||
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/pstl/glue_algorithm_defs.h:13:
|
||||
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/functional:54:
|
||||
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/tuple:39:
|
||||
/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/array:268:52: fatal error: instantiating fold expression with 303 arguments exceeded expression nesting limit of 256
|
||||
-> array<enable_if_t<(is_same_v<_Tp, _Up> && ...), _Tp>,
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~^~~~
|
||||
gen/components/autofill/core/browser/form_parsing/regex_patterns_inl.h:77:22: note: while substituting deduced template arguments into function template '<deduction guide for array>' [with _Tp = autofill::MatchingPattern, _Up = <autofill::MatchingPattern, autofill::MatchingPattern, autofill::MatchingPattern, autofill::MatchingPattern, autofill::MatchingPattern, autofill::MatchingPattern, autofill::MatchingPattern, autofill::MatchingPattern, autofill::MatchingPattern, autofill::MatchingPattern, autofill::MatchingPattern, autofill::MatchingPattern, autofill::MatchingPattern, autofill::MatchingPattern, autofill::MatchingPattern, autofill::MatchingPattern, autofill::MatchingPattern, autofill::MatchingPattern, autofill::MatchingPattern, autofill::MatchingPattern, autofill::MatchingPattern, autofill::MatchingPatter[...]
|
||||
|
||||
|
||||
|
||||
|
||||
This is fixed upstream in chromium 103 with the following commit:
|
||||
https://chromium-review.googlesource.com/c/chromium/src/+/3613356
|
||||
|
||||
However, that depends on other stuff and we can't use it without a
|
||||
bunch more changes - so we'll just use this fix which I nabbed from
|
||||
Stephan Hartmann instead:
|
||||
https://github.com/stha09/chromium-patches/blob/master/chromium-102-regex_pattern-array.patch
|
||||
|
||||
|
||||
|
||||
--- a/components/autofill/core/browser/BUILD.gn
|
||||
+++ b/components/autofill/core/browser/BUILD.gn
|
||||
@@ -54,6 +54,11 @@ action("regex_patterns_inl_h") {
|
||||
}
|
||||
|
||||
static_library("browser") {
|
||||
+ if (is_clang) {
|
||||
+ cflags = [
|
||||
+ "-fbracket-depth=1000",
|
||||
+ ]
|
||||
+ }
|
||||
sources = [
|
||||
"address_normalization_manager.cc",
|
||||
"address_normalization_manager.h",
|
||||
@@ -2,15 +2,20 @@ Disable various compiler configs (currently warning suppression). Like chromium
|
||||
|
||||
--- src/third_party/electron_node/BUILD.gn.old
|
||||
+++ src/third_party/electron_node/BUILD.gn
|
||||
@@ -124,7 +124,6 @@ config("node_lib_config") {
|
||||
@@ -142,12 +142,6 @@ config("node_lib_config") {
|
||||
config("node_lib_config") {
|
||||
include_dirs = [ "src" ]
|
||||
|
||||
# FIXME(deepak1556): include paths should be corrected,
|
||||
# refer https://docs.google.com/presentation/d/1oxNHaVjA9Gn_rTzX6HIpJHP7nXRua_0URXxxJ3oYRq0/edit#slide=id.g71ecd450e_2_702
|
||||
- cflags = [ "-Wno-microsoft-include" ]
|
||||
- cflags = [
|
||||
- "-Wno-shadow",
|
||||
- # FIXME(deepak1556): include paths should be corrected,
|
||||
- # refer https://docs.google.com/presentation/d/1oxNHaVjA9Gn_rTzX6HIpJHP7nXRua_0URXxxJ3oYRq0/edit#slide=id.g71ecd450e_2_702
|
||||
- "-Wno-microsoft-include",
|
||||
- ]
|
||||
|
||||
configs = [ ":node_features" ]
|
||||
|
||||
@@ -250,18 +249,6 @@ component("node_lib") {
|
||||
@@ -250,17 +249,6 @@ component("node_lib") {
|
||||
deps += [ "deps/histogram" ]
|
||||
}
|
||||
frameworks = []
|
||||
@@ -24,7 +29,6 @@ Disable various compiler configs (currently warning suppression). Like chromium
|
||||
- "-Wno-unused-label",
|
||||
- "-Wno-unused-private-field",
|
||||
- "-Wno-unused-variable",
|
||||
- "-Wno-shadow",
|
||||
- ]
|
||||
|
||||
if (v8_enable_i18n_support) {
|
||||
@@ -36,79 +40,6 @@ Disable various compiler configs (currently warning suppression). Like chromium
|
||||
- cflags_cc += [ "-Wno-sign-compare" ]
|
||||
}
|
||||
}
|
||||
--- src/third_party/electron_node/deps/base64/BUILD.gn.orig 2024-03-27 16:38:36.306226966 +0100
|
||||
+++ src/third_party/electron_node/deps/base64/BUILD.gn 2024-03-27 20:24:12.219928228 +0100
|
||||
@@ -21,11 +21,6 @@ static_library("base64") {
|
||||
|
||||
public_configs = [ ":base64_config" ]
|
||||
|
||||
- cflags_c = [
|
||||
- "-Wno-implicit-fallthrough",
|
||||
- "-Wno-unused-but-set-variable",
|
||||
- "-Wno-shadow",
|
||||
- ]
|
||||
|
||||
sources = [
|
||||
"base64/include/libbase64.h",
|
||||
@@ -44,7 +39,6 @@ source_set("base64_ssse3") {
|
||||
defines = [ "HAVE_SSSE3=1" ]
|
||||
|
||||
cflags = [ "-mssse3" ]
|
||||
- cflags_c = [ "-Wno-implicit-fallthrough" ]
|
||||
}
|
||||
|
||||
sources = [ "base64/lib/arch/ssse3/codec.c" ]
|
||||
@@ -57,7 +51,6 @@ source_set("base64_sse41") {
|
||||
defines = [ "HAVE_SSE41=1" ]
|
||||
|
||||
cflags = [ "-msse4.1" ]
|
||||
- cflags_c = [ "-Wno-implicit-fallthrough" ]
|
||||
}
|
||||
|
||||
sources = [ "base64/lib/arch/sse41/codec.c" ]
|
||||
@@ -74,7 +67,6 @@ source_set("base64_sse42") {
|
||||
]
|
||||
|
||||
cflags = [ "-msse4.2" ]
|
||||
- cflags_c = [ "-Wno-implicit-fallthrough" ]
|
||||
}
|
||||
|
||||
sources = [ "base64/lib/arch/sse42/codec.c" ]
|
||||
@@ -87,7 +79,6 @@ source_set("base64_avx") {
|
||||
defines = [ "HAVE_AVX=1" ]
|
||||
|
||||
cflags = [ "-mavx" ]
|
||||
- cflags_c = [ "-Wno-implicit-fallthrough" ]
|
||||
}
|
||||
|
||||
sources = [ "base64/lib/arch/avx/codec.c" ]
|
||||
@@ -100,10 +91,6 @@ source_set("base64_avx2") {
|
||||
defines = [ "HAVE_AVX2=1" ]
|
||||
|
||||
cflags = [ "-mavx2" ]
|
||||
- cflags_c = [
|
||||
- "-Wno-implicit-fallthrough",
|
||||
- "-Wno-implicit-function-declaration",
|
||||
- ]
|
||||
}
|
||||
|
||||
sources = [ "base64/lib/arch/avx2/codec.c" ]
|
||||
@@ -116,7 +103,6 @@ source_set("base64_neon32") {
|
||||
defines = [ "HAVE_NEON32=1" ]
|
||||
|
||||
cflags = [ "-mfpu=neon" ]
|
||||
- cflags_c = [ "-Wno-implicit-fallthrough" ]
|
||||
}
|
||||
|
||||
sources = [ "base64/lib/arch/neon32/codec.c" ]
|
||||
@@ -128,7 +114,6 @@ source_set("base64_neon64") {
|
||||
if (target_cpu == "arm64") {
|
||||
defines = [ "HAVE_NEON64=1" ]
|
||||
|
||||
- cflags_c = [ "-Wno-implicit-fallthrough" ]
|
||||
}
|
||||
|
||||
sources = [ "base64/lib/arch/neon64/codec.c" ]
|
||||
--- src/third_party/electron_node/deps/histogram/BUILD.gn.old
|
||||
+++ src/third_party/electron_node/deps/histogram/BUILD.gn
|
||||
@@ -1,12 +1,6 @@
|
||||
|
||||
@@ -1,3 +1,166 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Sep 6 06:16:32 UTC 2024 - Bruno Pitrus <brunopitrus@hotmail.com>
|
||||
|
||||
- New upstream release 30.5.0
|
||||
* Node 20.16.0
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Sep 5 04:59:15 UTC 2024 - Bruno Pitrus <brunopitrus@hotmail.com>
|
||||
|
||||
- v8-strict-aliasing.patch: only use -fno-ipa-strict-aliasing, it's sufficient
|
||||
- aarch64 Tumbleweed: disable LTO and use mold linker due to OOM
|
||||
- change vendor string in process.versions to match what VSCode expects
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Aug 31 09:00:18 UTC 2024 - Bruno Pitrus <brunopitrus@hotmail.com>
|
||||
|
||||
- Fedora 40+, TW: add v8-strict-aliasing.patch to work around GCC14 miscompile
|
||||
- aarch64: remove -jitless from electron_rebuild macro, seems not needed anymore
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Aug 18 07:39:42 UTC 2024 - thod_@gmx.de
|
||||
|
||||
- New upstream release 30.4.0
|
||||
* Added a new property prefersReducedTransparency to nativeTheme, which indicates whether the user has chosen to reduce OS-level transparency via system accessibility settings.
|
||||
* Aligned failure pathway in File System Access API with upstream when attempting to open a file or directory in a blocked path.
|
||||
* Fixed an issue where navigator.serial.getPorts() incorrectly returned an empty array in some cases.
|
||||
* Fixed an issue where the File System Access API did not remember the user's last picked directory as expected.
|
||||
* Fixed the resource leak when using Node.js readable streams as the response body for a custom protocol handler.
|
||||
* Resolved an issue where desktopCapturer.getSources never fulfilled its promise in some cases.
|
||||
* Security fixes for CVE-2024-6989 CVE-2024-6991 (bsc#1228942)
|
||||
* Security fixes for CVE-2024-6776 CVE-2024-6778 CVE-2024-6777 CVE-2024-6773 CVE-2024-6774 CVE-2024-6772 CVE-2024-6775 CVE-2024-6779 (bsc#1227979)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Aug 13 20:28:37 UTC 2024 - Bruno Pitrus <brunopitrus@hotmail.com>
|
||||
|
||||
- Fix ftbfs with ffmpeg 7.x
|
||||
* add backported ffmpeg-7-ffmpeg_video_decoder-reordered_opaque.patch
|
||||
* do not revert audio_file_reader-ffmpeg-AVFrame-duration.patch when building against ffmpeg 6+
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Jul 20 10:02:27 UTC 2024 - Bruno Pitrus <brunopitrus@hotmail.com>
|
||||
|
||||
- New upstream release 30.3.0
|
||||
* Node 20.15.1
|
||||
* Added DownloadItem.getCurrentBytesPerSecond(), DownloadItem.getPercentComplete(), DownloadItem.getEndTime().
|
||||
* Fixed a potential crash when using off screen rendering.
|
||||
* fix crash when resolving proxy with session.resolveProxy api
|
||||
- aarch64 Fedora 40: disable LTO due to linker oom failing build
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jul 12 10:28:06 UTC 2024 - Bruno Pitrus <brunopitrus@hotmail.com>
|
||||
|
||||
- New upstream release 30.2.0
|
||||
* Node 20.15.0
|
||||
* Enabled the Windows Control Overlay API on Linux.
|
||||
* Expose systemPreferences to utilityProcess.
|
||||
* Fixed a focus issue when calling BrowserWindow.setTopBrowserView.
|
||||
* Fixed an issue where fetch-dependent interfaces could be missing in Web Workers with nodeIntegrationInWorker enabled.
|
||||
* Fixed an issue where control could fail to return properly after saving a dialog using showOpenDialogSync on Linux.
|
||||
* Fixes an issue where the user-specified default path did not work in some circumstances when using Linux dialogs.
|
||||
* Fixes potentially incorrect exit code in UtilityProcess.
|
||||
* (Leap 15.5) Fix heap buffer overflow in libaom (CVE-2024-5493 bsc#1225690)
|
||||
* Security fixes for V8: CVE-2024-6100, CVE-2024-6101 (bsc#1226504)
|
||||
* Fix use after free in Swiftshader (CVE-2024-6291 bsc#1226933)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jul 9 10:04:38 UTC 2024 - Bruno Pitrus <brunopitrus@hotmail.com>
|
||||
|
||||
- Update to 30.1.2
|
||||
* ABI break: NODE_MODULE_VERSION is now 123
|
||||
* Chromium 124.0.6367.243
|
||||
* Node 20.14.0
|
||||
* V8 12.4
|
||||
* Added WebContentsView and BaseWindow, replacing the now-deprecated BrowserView APIs.
|
||||
* cross-origin iframes now use Permission Policy to access features
|
||||
* Removed: The --disable-color-correct-rendering switch
|
||||
* The inputFieldType property in the context-menu params has been removed
|
||||
* Removed: process.getIOCounters()
|
||||
* see https://www.electronjs.org/blog/electron-30-0 and https://github.com/electron/electron/releases/tag/v30.0.0 for more
|
||||
- Fedora: use bundled simdutf as the system version is too old
|
||||
- Drop no longer needed patches
|
||||
* chromium-122-avoid-SFINAE-TypeConverter.patch
|
||||
* chromium-122-BookmarkNode-missing-operator.patch
|
||||
* chromium-98-EnumTable-crash.patch
|
||||
* chromium-gcc11.patch
|
||||
* CVE-2024-30260-undici-clear-proxy-authorization.patch
|
||||
* CVE-2024-30261-undici-fetch-integrity.patch
|
||||
* ElectronDesktopWindowTreeHostLinux-OnWindowTiledStateChanged-crash.patch
|
||||
* grid_sizing_tree-Wchanges-meaning.patch
|
||||
* hit_test_request-missing-optional.patch
|
||||
* InternalAllocator-too-many-initializers.patch
|
||||
* material_color_utilities-tones-missing-round.patch
|
||||
* nested-nested-nested-nested-nested-nested-regex-patterns.patch
|
||||
* perfetto-numeric_storage-double_t.patch
|
||||
* plus_address_types-missing-optional.patch
|
||||
* race_network_request_write_buffer_manager-missing-optional.patch
|
||||
* resolution_monitor-missing-bitset.patch
|
||||
* script_promise_resolver-explicit-specialization.patch
|
||||
* search_engine_choice_service-missing-optional.patch
|
||||
* text_break_iterator-icu74-breakAllLineBreakClassTable-should-be-consistent.patch
|
||||
* v8-instance-type-inl-constexpr-used-before-its-definition.patch
|
||||
- Drop no longer needed -Wno-error=narrowing from CXXFLAGS
|
||||
- Add patches to fix build
|
||||
* chromium-124-shims.patch
|
||||
* enable_stack_trace_line_numbers-symbol_level.patch
|
||||
* angle-FramebufferVk-powf.patch
|
||||
* licenses.py-FileNotFoundError.patch
|
||||
* span_reader-missing-optional.patch
|
||||
* bitset-missing-uint8_t-memcpy.patch
|
||||
* temporal_scalability_id_extractor-missing-bitset.patch
|
||||
* gpu_adapter_info-missing-optional.patch
|
||||
* first_party_sets_handler_database_helper-missing-optional.patch
|
||||
* async_iterable-forwarding.patch
|
||||
* preview_cancel_reason-missing-string.patch
|
||||
* script_streamer-atomic-include.patch
|
||||
- Add -Wno-packed-not-aligned -Wno-address to CXXFLAGS to suppress build logspam
|
||||
- Add libaom_av1_encoder-aom37-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR.patch to build with old libaom
|
||||
- Add backported DesktopNativeWidgetAura-HandleActivationChanged-crash.patch
|
||||
- Revert upstream changes which introduce a use-after-free bug causing crashes (bsc#1224178 deb#1067886)
|
||||
* bad-font-gc0000.patch
|
||||
* bad-font-gc000.patch
|
||||
* bad-font-gc00.patch
|
||||
* bad-font-gc0.patch
|
||||
* bad-font-gc11.patch
|
||||
* bad-font-gc1.patch
|
||||
* bad-font-gc2.patch
|
||||
* bad-font-gc3.patch
|
||||
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Jul 4 04:27:14 UTC 2024 - Bruno Pitrus <brunopitrus@hotmail.com>
|
||||
|
||||
- Fix use after free in content::RenderFrameHostImpl::RemoveDocumentService (bsc#1227307)
|
||||
* RenderFrameHostImpl-use-after-free.patch: correct second instance of the same bug
|
||||
- ix86, aarch64: pass --jitless in %electron_rebuild macro to work around crashes on OBS and unblock downstream packages
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jun 28 16:56:51 UTC 2024 - Bruno Pitrus <brunopitrus@hotmail.com>
|
||||
|
||||
- New upstream release 29.4.3
|
||||
* Fixed an issue where navigator.usb.getDevices() could crash in some circumstances.
|
||||
* Fixed an issue where bad flags passed via --js-flags could cause a crash.
|
||||
* Fixed an issue where control could fail to return properly after saving a dialog using showOpenDialogSync on Linux.
|
||||
* Fixed an issue where some calls to WebUSB methods could crash.
|
||||
* Fixed potentially incorrect exit code in UtilityProcess.
|
||||
* Fixed support for multiple folder/file selection in //shell_dialogs portal implementation.
|
||||
* Security fixes for CVE-2024-5499 CVE-2024-5493 CVE-2024-5496 (bsc#1225690)
|
||||
* Security fixes for CVE-2024-5158 CVE-2024-5157 CVE-2024-5159 (bsc#1224818)
|
||||
* Security fixes for CVE-2024-6100 CVE-2024-6101 (bsc#1226504)
|
||||
- Correct .desktop file name to match the CHROME_DESKTOP environment variable.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Jun 12 14:54:32 UTC 2024 - Bruno Pitrus <brunopitrus@hotmail.com>
|
||||
|
||||
- Do not build //components/sync to reduce linker load and binary size (remove-sync.patch)
|
||||
- Add backported ElectronDesktopWindowTreeHostLinux-OnWindowTiledStateChanged-crash.patch
|
||||
to fix segfault due to type confusion (bsc#1223366 gh#electron/electron#41839)
|
||||
- Re-enable custom malloc now that the crash is fixed
|
||||
- Use system vulkan headers wherever system spirv is used
|
||||
- Drop Fedora 38 support
|
||||
* drop v8-icu73-alt_calendar.patch
|
||||
* drop v8-icu73-simple-case-folding.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed May 29 20:19:39 UTC 2024 - Bruno Pitrus <brunopitrus@hotmail.com>
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
%define mod_name electron
|
||||
# https://github.com/nodejs/node/blob/main/doc/abi_version_registry.json
|
||||
%define abi_version 121
|
||||
%define abi_version 123
|
||||
|
||||
# Do not provide libEGL.so, etc…
|
||||
%define __provides_exclude ^lib.*\\.so.*$
|
||||
@@ -55,8 +55,10 @@ BuildArch: i686
|
||||
#(all the widgets use Gtk unconditionally — not sure which of the changed codepaths are used in Electron)
|
||||
%bcond_with qt
|
||||
|
||||
|
||||
|
||||
%ifarch %ix86
|
||||
#work around npm rebuild crashes on OBS
|
||||
%global jitless NODE_OPTIONS=--jitless
|
||||
%endif
|
||||
|
||||
%ifarch aarch64 riscv64
|
||||
#Video acceleration API to support. Useful for e.g. signal messenger.
|
||||
@@ -76,18 +78,36 @@ BuildArch: i686
|
||||
|
||||
|
||||
|
||||
%ifnarch %ix86 %arm
|
||||
|
||||
%ifnarch %ix86 %arm aarch64
|
||||
%if (0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora})
|
||||
%bcond_without lto
|
||||
%else
|
||||
%bcond_with lto
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%else
|
||||
%ifarch %ix86 %arm
|
||||
%bcond_with lto
|
||||
%endif
|
||||
|
||||
%ifarch aarch64
|
||||
%if 0%{?suse_version} || 0%{?fedora} >= 40
|
||||
%bcond_with lto
|
||||
%else
|
||||
%bcond_without lto
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%ifarch aarch64
|
||||
%if 0%{?suse_version}
|
||||
%bcond_without mold
|
||||
%else
|
||||
%bcond_with mold
|
||||
%endif
|
||||
%else
|
||||
%bcond_with mold
|
||||
%endif
|
||||
|
||||
|
||||
|
||||
%if 0%{?suse_version} || 0%{?fedora} < 40
|
||||
@@ -96,11 +116,6 @@ BuildArch: i686
|
||||
%bcond_with system_minizip
|
||||
%endif
|
||||
|
||||
%if 0%{?suse_version} || 0%{?fedora} >= 39
|
||||
%bcond_without icu_73
|
||||
%else
|
||||
%bcond_with icu_73
|
||||
%endif
|
||||
|
||||
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150600 || 0%{?fedora}
|
||||
%bcond_without system_aom
|
||||
@@ -124,31 +139,28 @@ BuildArch: i686
|
||||
%endif
|
||||
|
||||
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora}
|
||||
%bcond_without ffmpeg_5
|
||||
%bcond_without system_vpx
|
||||
%else
|
||||
%bcond_with ffmpeg_5
|
||||
%bcond_with system_vpx
|
||||
%endif
|
||||
|
||||
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora} >= 39
|
||||
%bcond_without bro_11
|
||||
%bcond_without ffmpeg_6
|
||||
%else
|
||||
%bcond_with system_vpx
|
||||
%bcond_with bro_11
|
||||
%bcond_with ffmpeg_6
|
||||
%endif
|
||||
|
||||
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora} >= 40
|
||||
%bcond_without gcc14
|
||||
%else
|
||||
%bcond_with gcc14
|
||||
%endif
|
||||
|
||||
|
||||
%if 0%{?fedora}
|
||||
%bcond_without system_llhttp
|
||||
%bcond_without system_histogram
|
||||
%bcond_without system_simdutf
|
||||
%else
|
||||
%bcond_with system_llhttp
|
||||
%bcond_with system_histogram
|
||||
%bcond_with system_simdutf
|
||||
%endif
|
||||
|
||||
|
||||
@@ -158,6 +170,9 @@ BuildArch: i686
|
||||
%bcond_with system_vma
|
||||
%endif
|
||||
|
||||
# requires `run_convert_utf8_to_latin1_with_errors`
|
||||
%bcond_with system_simdutf
|
||||
|
||||
|
||||
#requires `imageSequenceTrackPresent` and `enableParsingGainMapMetadata` both of which are only in post-1.0.0 nightlies
|
||||
%bcond_with system_avif
|
||||
@@ -214,7 +229,7 @@ BuildArch: i686
|
||||
|
||||
|
||||
Name: nodejs-electron
|
||||
Version: 29.4.2
|
||||
Version: 30.5.0
|
||||
%global tag_version %version
|
||||
Release: 0
|
||||
Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS
|
||||
@@ -224,7 +239,7 @@ URL: https://github.com/electron/electron
|
||||
Source0: %{mod_name}-%{tag_version}.tar.zst
|
||||
Source1: create_tarball.sh
|
||||
Source10: electron-launcher.sh
|
||||
Source11: electron.desktop
|
||||
Source11: Electron.desktop
|
||||
|
||||
|
||||
# Reverse upstream changes to be able to build against ffmpeg-4
|
||||
@@ -234,9 +249,6 @@ Source402: Cr122-ffmpeg-new-channel-layout.patch
|
||||
# and against harfbuzz 4
|
||||
Source415: harfbuzz-replace-chromium-scoped-type.patch
|
||||
Source416: harfbuzz-replace-HbScopedPointer.patch
|
||||
# and icu 71
|
||||
Source417: v8-icu73-alt_calendar.patch
|
||||
Source418: v8-icu73-simple-case-folding.patch
|
||||
# and wayland 1.31
|
||||
Source450: wayland-proto-31-cursor-shape.patch
|
||||
|
||||
@@ -262,6 +274,7 @@ Patch80: icon.patch
|
||||
Patch82: node-compiler.patch
|
||||
Patch84: aarch64-Xclang.patch
|
||||
Patch85: devtools-frontend-compress_files-oom.patch
|
||||
Patch86: enable_stack_trace_line_numbers-symbol_level.patch
|
||||
|
||||
|
||||
# PATCHES that remove code we don't want. Most of them can be reused verbatim by other distributors,
|
||||
@@ -281,6 +294,7 @@ Patch586: aom-vpx-no-thread-wrapper.patch
|
||||
Patch587: remove-openscreen.patch
|
||||
Patch588: remove-password-manager-and-policy.patch
|
||||
Patch589: remove-puffin.patch
|
||||
Patch590: remove-sync.patch
|
||||
|
||||
|
||||
|
||||
@@ -312,10 +326,10 @@ Patch1078: system-simdutf.patch
|
||||
Patch1079: system-libm.patch
|
||||
Patch1080: system-yuv.patch
|
||||
Patch1081: chromium-122-abseil-shims.patch
|
||||
Patch1082: chromium-124-shims.patch
|
||||
|
||||
|
||||
# PATCHES to fix interaction with third-party software
|
||||
Patch2004: chromium-gcc11.patch
|
||||
Patch2010: chromium-93-ffmpeg-4.4.patch
|
||||
|
||||
#Since ffmpeg 5, there is no longer first_dts member in AVFormat. Chromium upstream (and Tumbleweed) patches ffmpeg to add a av_stream_get_first_dts function.
|
||||
@@ -351,43 +365,52 @@ Source2047: bundled-minizip.patch
|
||||
Patch2047: bundled-minizip.patch
|
||||
%endif
|
||||
Patch2048: absl2023-encapsulated_web_transport-StrCat.patch
|
||||
Patch2049: libaom_av1_encoder-aom37-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR.patch
|
||||
# bsc#1224178 deb#1067886
|
||||
Patch2050: bad-font-gc0000.patch
|
||||
Patch2051: bad-font-gc000.patch
|
||||
Patch2052: bad-font-gc00.patch
|
||||
Patch2053: bad-font-gc0.patch
|
||||
Patch2054: bad-font-gc11.patch
|
||||
Patch2055: bad-font-gc1.patch
|
||||
Patch2056: bad-font-gc2.patch
|
||||
Patch2057: bad-font-gc3.patch
|
||||
#Work around gcc14 overly aggressive optimizer. Interestingly applying this patch produces a *different* crash on gcc13 + LTO.
|
||||
%if %{with gcc14}
|
||||
Patch2058: v8-strict-aliasing.patch
|
||||
%else
|
||||
Source2058: v8-strict-aliasing.patch
|
||||
%endif
|
||||
|
||||
# PATCHES that should be submitted upstream verbatim or near-verbatim
|
||||
Patch3016: chromium-98-EnumTable-crash.patch
|
||||
# Fix blink nodestructor
|
||||
Patch3023: electron-13-blink-gcc-ambiguous-nodestructor.patch
|
||||
Patch3027: electron-16-freetype-visibility-list.patch
|
||||
Patch3028: electron-16-third_party-symbolize-missing-include.patch
|
||||
# From https://git.droidware.info/wchen342/ungoogled-chromium-fedora
|
||||
Patch3033: chromium-94.0.4606.71-InkDropHost-crash.patch
|
||||
# https://salsa.debian.org/chromium-team/chromium/-/blob/456851fc808b2a5b5c762921699994e957645917/debian/patches/upstream/nested-nested-nested-nested-nested-nested-regex-patterns.patch
|
||||
Patch3064: nested-nested-nested-nested-nested-nested-regex-patterns.patch
|
||||
Patch3080: compact_enc_det_generated_tables-Wnarrowing.patch
|
||||
Patch3096: remove-date-reproducible-builds.patch
|
||||
Patch3118: material_color_utilities-tones-missing-round.patch
|
||||
Patch3126: perfetto-numeric_storage-double_t.patch
|
||||
Patch3129: text_break_iterator-icu74-breakAllLineBreakClassTable-should-be-consistent.patch
|
||||
Patch3132: v8-instance-type-inl-constexpr-used-before-its-definition.patch
|
||||
Patch3133: swiftshader-llvm18-LLVMReactor-getInt8PtrTy.patch
|
||||
Patch3134: swiftshader-llvm18-LLVMJIT-Host.patch
|
||||
Patch3135: swiftshader-llvm18-LLVMJIT-CodeGenOptLevel.patch
|
||||
Patch3136: CVE-2024-30260-undici-clear-proxy-authorization.patch
|
||||
Patch3137: CVE-2024-30261-undici-fetch-integrity.patch
|
||||
Patch3138: distributed_point_functions-aes_128_fixed_key_hash-missing-StrCat.patch
|
||||
Patch3139: chromium-122-avoid-SFINAE-TypeConverter.patch
|
||||
Patch3140: plus_address_types-missing-optional.patch
|
||||
Patch3141: chromium-122-BookmarkNode-missing-operator.patch
|
||||
Patch3142: search_engine_choice_service-missing-optional.patch
|
||||
Patch3143: race_network_request_write_buffer_manager-missing-optional.patch
|
||||
Patch3144: mt21_util-flax-vector-conversions.patch
|
||||
Patch3145: script_promise_resolver-explicit-specialization.patch
|
||||
Patch3146: hit_test_request-missing-optional.patch
|
||||
Patch3147: grid_sizing_tree-Wchanges-meaning.patch
|
||||
Patch3148: resolution_monitor-missing-bitset.patch
|
||||
Patch3149: boringssl-internal-addc-cxx.patch
|
||||
Patch3150: InternalAllocator-too-many-initializers.patch
|
||||
Patch3151: distributed_point_functions-evaluate_prg_hwy-signature.patch
|
||||
Patch3152: fake_ssl_socket_client-Wlto-type-mismatch.patch
|
||||
Patch3153: angle-FramebufferVk-powf.patch
|
||||
Patch3154: licenses.py-FileNotFoundError.patch
|
||||
Patch3155: span_reader-missing-optional.patch
|
||||
Patch3156: bitset-missing-uint8_t-memcpy.patch
|
||||
Patch3157: temporal_scalability_id_extractor-missing-bitset.patch
|
||||
Patch3158: gpu_adapter_info-missing-optional.patch
|
||||
Patch3159: first_party_sets_handler_database_helper-missing-optional.patch
|
||||
Patch3160: async_iterable-forwarding.patch
|
||||
Patch3161: preview_cancel_reason-missing-string.patch
|
||||
Patch3162: script_streamer-atomic-include.patch
|
||||
Patch3163: DesktopNativeWidgetAura-HandleActivationChanged-crash.patch
|
||||
Patch3164: ffmpeg-7-ffmpeg_video_decoder-reordered_opaque.patch
|
||||
|
||||
# Patches to re-enable upstream force disabled features.
|
||||
# There's no sense in submitting them but they may be reused as-is by other packagers.
|
||||
@@ -430,6 +453,9 @@ BuildRequires: llhttp-devel >= 8
|
||||
BuildRequires: llvm-devel >= 16
|
||||
%endif
|
||||
BuildRequires: memory-constraints
|
||||
%if %{with mold}
|
||||
BuildRequires: mold
|
||||
%endif
|
||||
%ifarch %ix86 x86_64 %x86_64
|
||||
%if %{without system_aom} || %{without system_vpx}
|
||||
BuildRequires: nasm
|
||||
@@ -460,7 +486,7 @@ BuildRequires: (python3-setuptools if python3 >= 3.12)
|
||||
%endif
|
||||
BuildRequires: python%{PYVER}-six
|
||||
%if %{with system_simdutf}
|
||||
BuildRequires: simdutf-devel >= 3
|
||||
BuildRequires: simdutf-devel >= 3.2.17
|
||||
%endif
|
||||
BuildRequires: snappy-devel
|
||||
%if 0%{?suse_version}
|
||||
@@ -525,29 +551,21 @@ BuildRequires: pkgconfig(freetype2)
|
||||
BuildRequires: pkgconfig(gbm)
|
||||
BuildRequires: pkgconfig(glib-2.0)
|
||||
BuildRequires: pkgconfig(glproto)
|
||||
BuildRequires: pkgconfig(gtest)
|
||||
BuildRequires: pkgconfig(gtest) >= 1.12
|
||||
BuildRequires: pkgconfig(gtk+-3.0)
|
||||
BuildRequires: pkgconfig(harfbuzz) >= 3
|
||||
%if %{with harfbuzz_5}
|
||||
BuildRequires: pkgconfig(harfbuzz) >= 5
|
||||
%endif
|
||||
BuildRequires: pkgconfig(icu-i18n) >= 71
|
||||
%if %{with icu_73}
|
||||
BuildRequires: pkgconfig(icu-i18n) >= 73
|
||||
%else
|
||||
BuildRequires: pkgconfig(icu-i18n) >= 71
|
||||
%endif
|
||||
BuildRequires: pkgconfig(jsoncpp)
|
||||
%if 0%{?fedora}
|
||||
Recommends: (ffmpeg-libs%{_isa} or libavcodec-freeworld%{_isa})
|
||||
%endif
|
||||
%if %{with ffmpeg_6}
|
||||
BuildRequires: pkgconfig(libavcodec) >= 60
|
||||
%endif
|
||||
%if %{with ffmpeg_5}
|
||||
BuildRequires: pkgconfig(libavcodec) >= 59
|
||||
BuildRequires: pkgconfig(libavformat) >= 59
|
||||
BuildRequires: pkgconfig(libavutil) >= 57
|
||||
BuildRequires: pkgconfig(libavformat) >= 60
|
||||
BuildRequires: pkgconfig(libavutil) >= 58
|
||||
%if 0%{?fedora}
|
||||
#requires av_stream_get_first_dts, see rhbz#2240127
|
||||
BuildRequires: libavformat-free-devel >= %AVFORMAT_VER
|
||||
@@ -593,6 +611,7 @@ BuildRequires: pkgconfig(libxxhash)
|
||||
# needs I410ToI420
|
||||
BuildRequires: pkgconfig(libyuv) >= 1855
|
||||
%endif
|
||||
BuildRequires: pkgconfig(libzstd)
|
||||
%if %{with system_minizip}
|
||||
%if 0%{?fedora}
|
||||
BuildRequires: minizip-compat-devel
|
||||
@@ -621,6 +640,7 @@ BuildRequires: spirv-headers
|
||||
BuildRequires: spirv-headers-devel
|
||||
%endif
|
||||
BuildRequires: pkgconfig(SPIRV-Tools) >= 2022.2
|
||||
BuildRequires: vulkan-headers >= 1.3
|
||||
%endif
|
||||
%if %{with link_vulkan}
|
||||
BuildRequires: pkgconfig(vulkan) >= 1.3
|
||||
@@ -648,6 +668,9 @@ BuildRequires: gcc-c++ >= 13
|
||||
BuildRequires: gcc13-PIE
|
||||
BuildRequires: gcc13-c++
|
||||
%endif
|
||||
%if %{with gcc14}
|
||||
BuildRequires: gcc-c++ >= 14
|
||||
%endif
|
||||
%if %{with pipewire}
|
||||
BuildRequires: pkgconfig(libpipewire-0.3)
|
||||
BuildRequires: pkgconfig(libspa-0.2)
|
||||
@@ -743,14 +766,14 @@ test $(grep ^node_module_version electron/build/args/all.gn | sed 's/.* = //') =
|
||||
patch -R -p1 < %PATCH1076
|
||||
%endif
|
||||
|
||||
%if %{without ffmpeg_6}
|
||||
patch -R -p1 < %SOURCE402
|
||||
%endif
|
||||
|
||||
%if %{with ffmpeg_5}
|
||||
%if %{with ffmpeg_6}
|
||||
patch -R -p1 < %PATCH2012
|
||||
%else
|
||||
patch -R -p1 < %PATCH3164
|
||||
patch -R -p1 < %SOURCE402
|
||||
patch -R -p1 < %SOURCE400
|
||||
patch -R -p1 < %SOURCE401
|
||||
%endif
|
||||
|
||||
|
||||
@@ -760,18 +783,13 @@ patch -R -p1 < %SOURCE415
|
||||
patch -R -p1 < %SOURCE416
|
||||
%endif
|
||||
|
||||
%if %{without icu_73}
|
||||
patch -R -p1 < %SOURCE417
|
||||
patch -R -p1 < %SOURCE418
|
||||
%endif
|
||||
|
||||
%if %{without wayland_32}
|
||||
patch -R -p1 < %SOURCE450
|
||||
%endif
|
||||
|
||||
|
||||
# This one depends on an ffmpeg nightly, reverting unconditionally.
|
||||
patch -R -p1 < %SOURCE401
|
||||
|
||||
|
||||
# Link system wayland-protocols-devel into where chrome expects them
|
||||
mkdir -p third_party/wayland/src
|
||||
@@ -795,130 +813,7 @@ ln -sf %{_bindir}/eu-strip buildtools/third_party/eu-strip/bin/eu-strip
|
||||
sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \
|
||||
tools/generate_shim_headers/generate_shim_headers.py
|
||||
|
||||
|
||||
%build
|
||||
pushd electron/shell/browser/resources/win
|
||||
[ $(identify electron.ico | wc -l) = 4 ] #Sanity check
|
||||
convert electron.ico -strip extracted.png
|
||||
identify extracted-0.png | grep -F 16x16
|
||||
identify extracted-1.png | grep -F 32x32
|
||||
identify extracted-2.png | grep -F 48x48
|
||||
identify extracted-3.png | grep -F 256x256
|
||||
popd
|
||||
|
||||
|
||||
# GN sets lto on its own and we need just ldflag options, not cflags
|
||||
%define _lto_cflags %{nil}
|
||||
|
||||
# Make sure python is python3
|
||||
install -d -m 0755 python3-path
|
||||
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora}
|
||||
ln -sf %{_bindir}/python3 "$(pwd)/python3-path/python"
|
||||
%else
|
||||
ln -sf %{_bindir}/python3.11 "$(pwd)/python3-path/python"
|
||||
ln -sf %{_bindir}/python3.11 "$(pwd)/python3-path/python3"
|
||||
%endif
|
||||
export PATH="$(pwd)/python3-path:${PATH}"
|
||||
|
||||
#HACK: Those packages on Leap are available only in python3.6 versions.
|
||||
%if 0%{?suse_version} && 0%{?suse_version} < 1550
|
||||
install -d -m 0755 python3-site
|
||||
cp -pr %{python3_sitelib}/{json5,mako} -t "$(pwd)/python3-site"
|
||||
export PYTHONPATH="$(pwd)/python3-site"
|
||||
%endif
|
||||
|
||||
#some Fedora ports still try to build with LTO
|
||||
ARCH_FLAGS=$(echo "%optflags"|sed 's/-f[^ ]*lto[^ ]*//g' )
|
||||
|
||||
#Work around an upstream ODR issue.
|
||||
#Remove this once https://bugs.chromium.org/p/chromium/issues/detail?id=1375049 gets fixed.
|
||||
ARCH_FLAGS="$ARCH_FLAGS -DIS_SERIAL_ENABLED_PLATFORM"
|
||||
|
||||
|
||||
|
||||
|
||||
%if 0%{?fedora}
|
||||
# Fix base/allocator/allocator_shim.cc:408:2: error: #error This code cannot be
|
||||
# used when exceptions are turned on.
|
||||
ARCH_FLAGS="$(echo $ARCH_FLAGS | sed -e 's/ -fexceptions / /g')"
|
||||
%endif
|
||||
|
||||
# for wayland
|
||||
export CXXFLAGS="${ARCH_FLAGS} -I/usr/include/wayland -I/usr/include/libxkbcommon"
|
||||
export CFLAGS="${CXXFLAGS}"
|
||||
|
||||
# Google has a bad coding style, using a macro `NOTREACHED()` that is not properly detected by GCC
|
||||
# multiple times throughout the codebase (including generated code). It is not possible to redefine the macro to __builtin_unreachable,
|
||||
# as it has an astonishing syntax, behaving like an ostream (in debug builds it is supposed to trap and print an error message)
|
||||
export CXXFLAGS="${CXXFLAGS} -Wno-error=return-type"
|
||||
# [ 8947s] gen/third_party/blink/renderer/bindings/modules/v8/v8_gpu_sampler_descriptor.h:212:39: error: narrowing conversion of '4294967295' from 'unsigned int' to 'float' [-Wnarrowing]
|
||||
# [ 8947s] 212 | float member_lod_max_clamp_{0xffffffff};
|
||||
# I have no idea where this code is generated, and it is not something that needs a critical fix.
|
||||
# Remove this once upstream issues a proper patch.
|
||||
export CXXFLAGS="${CXXFLAGS} -Wno-error=narrowing"
|
||||
|
||||
# A bunch of memcpy'ing of JSObject in V8 runs us into “Logfile got too big, killed job.”
|
||||
export CXXFLAGS="${CXXFLAGS} -Wno-class-memaccess"
|
||||
|
||||
# REDUCE DEBUG for C++ as it gets TOO large due to “heavy hemplate use in Blink”. See symbol_level below and chromium-102-compiler.patch
|
||||
export CXXFLAGS="$(echo ${CXXFLAGS} | sed -e 's/-g / /g' -e 's/-g$//g')"
|
||||
|
||||
%ifnarch x86_64 %x86_64
|
||||
export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-g /-g1 /g' -e 's/-g$/-g1/g')"
|
||||
%endif
|
||||
|
||||
#The chromium build process passes lots of .o files directly to the linker instead of using static libraries,
|
||||
#and relies on the linker eliminating unused sections.
|
||||
#Re-add these parameters from build/config/compiler/BUILD.gn.
|
||||
export LDFLAGS="%{?build_ldflags} -Wl,-O2 -Wl,--gc-sections "
|
||||
|
||||
|
||||
|
||||
%ifarch %ix86 %arm
|
||||
#try to reduce memory
|
||||
|
||||
export LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
|
||||
%endif #ifarch ix86 arm
|
||||
|
||||
|
||||
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora}
|
||||
export CC=gcc
|
||||
export CXX=g++
|
||||
export AR=gcc-ar
|
||||
export NM=gcc-nm
|
||||
export RANLIB=gcc-ranlib
|
||||
%else
|
||||
export CC=gcc-13
|
||||
export CXX=g++-13
|
||||
export AR=gcc-ar-13
|
||||
export NM=gcc-nm-13
|
||||
export RANLIB=gcc-ranlib-13
|
||||
%endif
|
||||
|
||||
|
||||
|
||||
# do not eat all memory
|
||||
%ifarch %ix86 %arm
|
||||
%limit_build -m 1200
|
||||
%else
|
||||
%limit_build -m 4000
|
||||
%endif
|
||||
|
||||
%ifarch aarch64
|
||||
#These settings make it use much more memory leading to OOM during linking
|
||||
unset MALLOC_CHECK_
|
||||
unset MALLOC_PERTURB_
|
||||
%endif
|
||||
|
||||
%if %{with lto}
|
||||
%ifarch aarch64
|
||||
export LDFLAGS="$LDFLAGS -flto=2 --param ggc-min-expand=20 --param ggc-min-heapsize=32768 --param lto-max-streaming-parallelism=1 -Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
|
||||
%else
|
||||
# x64 is fine with the the default settings (the machines have 30GB+ ram)
|
||||
export LDFLAGS="$LDFLAGS -flto=auto"
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# Remove bundled libraries
|
||||
gn_system_libraries=(
|
||||
brotli
|
||||
crc32c
|
||||
@@ -947,6 +842,7 @@ gn_system_libraries=(
|
||||
snappy
|
||||
woff2
|
||||
zlib
|
||||
zstd
|
||||
)
|
||||
|
||||
%if %{with system_abseil}
|
||||
@@ -1005,8 +901,7 @@ gn_system_libraries+=( re2 )
|
||||
find third_party/swiftshader/third_party/SPIRV-Headers/ -type f ! -name "*.gn" -a ! -name "*.gni" -delete
|
||||
find third_party/swiftshader/third_party/SPIRV-Tools/ -type f ! -name "*.gn" -a ! -name "*.gni" -delete
|
||||
|
||||
find third_party/vulkan-deps/spirv-headers/ -type f ! -name "*.gn" -a ! -name "*.gni" -delete
|
||||
find third_party/vulkan-deps/spirv-tools/ -type f ! -name "*.gn" -a ! -name "*.gni" -delete
|
||||
find third_party/vulkan-deps/ -type f ! -name "*.gn" -a ! -name "*.gni" -delete
|
||||
|
||||
gn_system_libraries+=(
|
||||
swiftshader-SPIRV-Headers
|
||||
@@ -1051,11 +946,152 @@ find third_party/electron_node/deps/histogram -type f ! -name "*.gn" -a ! -name
|
||||
find third_party/electron_node/deps/simdutf -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete
|
||||
%endif
|
||||
|
||||
|
||||
%build
|
||||
pushd electron/shell/browser/resources/win
|
||||
[ $(identify electron.ico | wc -l) = 4 ] #Sanity check
|
||||
convert electron.ico -strip extracted.png
|
||||
identify extracted-0.png | grep -F 16x16
|
||||
identify extracted-1.png | grep -F 32x32
|
||||
identify extracted-2.png | grep -F 48x48
|
||||
identify extracted-3.png | grep -F 256x256
|
||||
popd
|
||||
|
||||
|
||||
# GN sets lto on its own and we need just ldflag options, not cflags
|
||||
%define _lto_cflags %{nil}
|
||||
|
||||
# Make sure python is python3
|
||||
install -d -m 0755 python3-path
|
||||
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora}
|
||||
ln -sf %{_bindir}/python3 "$(pwd)/python3-path/python"
|
||||
%else
|
||||
ln -sf %{_bindir}/python3.11 "$(pwd)/python3-path/python"
|
||||
ln -sf %{_bindir}/python3.11 "$(pwd)/python3-path/python3"
|
||||
%endif
|
||||
export PATH="$(pwd)/python3-path:${PATH}"
|
||||
|
||||
#HACK: Those packages on Leap are available only in python3.6 versions.
|
||||
%if 0%{?suse_version} && 0%{?suse_version} < 1550
|
||||
install -d -m 0755 python3-site
|
||||
cp -pr %{python3_sitelib}/{json5,mako} -t "$(pwd)/python3-site"
|
||||
export PYTHONPATH="$(pwd)/python3-site"
|
||||
%endif
|
||||
|
||||
#some Fedora ports still try to build with LTO
|
||||
ARCH_FLAGS=$(echo "%optflags"|sed 's/-f[^ ]*lto[^ ]*//g' )
|
||||
|
||||
#Work around an upstream ODR issue.
|
||||
#Remove this once https://bugs.chromium.org/p/chromium/issues/detail?id=1375049 gets fixed.
|
||||
ARCH_FLAGS="$ARCH_FLAGS -DIS_SERIAL_ENABLED_PLATFORM"
|
||||
|
||||
|
||||
|
||||
|
||||
%if 0%{?fedora}
|
||||
# Fix base/allocator/allocator_shim.cc:408:2: error: #error This code cannot be
|
||||
# used when exceptions are turned on.
|
||||
ARCH_FLAGS="$(echo $ARCH_FLAGS | sed -e 's/ -fexceptions / /g')"
|
||||
%endif
|
||||
|
||||
# for wayland
|
||||
export CXXFLAGS="${ARCH_FLAGS} -I/usr/include/wayland -I/usr/include/libxkbcommon"
|
||||
export CFLAGS="${CXXFLAGS}"
|
||||
|
||||
# Google has a bad coding style, using a macro `NOTREACHED()` that is not properly detected by GCC
|
||||
# multiple times throughout the codebase (including generated code). It is not possible to redefine the macro to __builtin_unreachable,
|
||||
# as it has an astonishing syntax, behaving like an ostream (in debug builds it is supposed to trap and print an error message)
|
||||
export CXXFLAGS="${CXXFLAGS} -Wno-error=return-type"
|
||||
|
||||
# A bunch of memcpy'ing of JSObject in V8 runs us into “Logfile got too big, killed job.”
|
||||
export CXXFLAGS="${CXXFLAGS} -Wno-class-memaccess"
|
||||
# Warning spam from generated mojom code again makes the log too big
|
||||
export CXXFLAGS="${CXXFLAGS} -Wno-packed-not-aligned -Wno-address"
|
||||
|
||||
# REDUCE DEBUG for C++ as it gets TOO large due to “heavy hemplate use in Blink”. See symbol_level below and chromium-102-compiler.patch
|
||||
export CXXFLAGS="$(echo ${CXXFLAGS} | sed -e 's/-g / /g' -e 's/-g$//g')"
|
||||
|
||||
%ifarch %ix86 %arm
|
||||
export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-g /-g1 /g' -e 's/-g$/-g1/g')"
|
||||
%endif
|
||||
|
||||
%ifarch aarch64
|
||||
%if %{with lto}
|
||||
export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-g /-g1 /g' -e 's/-g$/-g1/g')"
|
||||
%endif
|
||||
%endif
|
||||
|
||||
|
||||
#The chromium build process passes lots of .o files directly to the linker instead of using static libraries,
|
||||
#and relies on the linker eliminating unused sections.
|
||||
#Re-add these parameters from build/config/compiler/BUILD.gn.
|
||||
export LDFLAGS="%{?build_ldflags} -Wl,-O2 -Wl,--gc-sections "
|
||||
|
||||
# mold does not respect it otherwise
|
||||
export LDFLAGS="$LDFLAGS -Wl,--as-needed"
|
||||
|
||||
|
||||
|
||||
%ifarch %ix86 %arm
|
||||
#try to reduce memory
|
||||
|
||||
export LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
|
||||
%endif #ifarch ix86 arm
|
||||
|
||||
|
||||
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora}
|
||||
export CC=gcc
|
||||
export CXX=g++
|
||||
export AR=gcc-ar
|
||||
export NM=gcc-nm
|
||||
export RANLIB=gcc-ranlib
|
||||
%else
|
||||
export CC=gcc-13
|
||||
export CXX=g++-13
|
||||
export AR=gcc-ar-13
|
||||
export NM=gcc-nm-13
|
||||
export RANLIB=gcc-ranlib-13
|
||||
%endif
|
||||
|
||||
|
||||
|
||||
# do not eat all memory
|
||||
%ifarch %ix86 %arm
|
||||
%limit_build -m 1200
|
||||
%else
|
||||
%limit_build -m 4000
|
||||
%endif
|
||||
|
||||
%ifarch aarch64
|
||||
#These settings make it use much more memory leading to OOM during linking
|
||||
unset MALLOC_CHECK_
|
||||
unset MALLOC_PERTURB_
|
||||
%endif
|
||||
|
||||
%if %{with lto}
|
||||
%ifarch aarch64
|
||||
export LDFLAGS="$LDFLAGS -flto=2 --param ggc-min-expand=20 --param ggc-min-heapsize=32768 --param lto-max-streaming-parallelism=1 -Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
|
||||
%else
|
||||
# x64 is fine with the the default settings (the machines have 30GB+ ram)
|
||||
export LDFLAGS="$LDFLAGS -flto=auto"
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%if %{with mold}
|
||||
export LDFLAGS="$LDFLAGS -fuse-ld=mold"
|
||||
%endif
|
||||
|
||||
# Ccache is truncated to 5GB which is not enough for Electron, leading to slower rebuilds
|
||||
export CCACHE_COMPRESS=1
|
||||
ccache -o max_size=0 || true
|
||||
|
||||
# Create the configuration for GN
|
||||
# Available options: out/Release/gn args --list out/Release/
|
||||
myconf_gn=""
|
||||
myconf_gn+=' override_electron_version="%{tag_version}"'
|
||||
myconf_gn+=' electron_vendor_version="suse:Electron for openSUSE"'
|
||||
# The only known consumer of process.versions.<custom string> is VSCode:
|
||||
# https://github.com/microsoft/vscode/blob/main/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts
|
||||
myconf_gn+=' electron_vendor_version="microsoft-build:Electron for openSUSE"'
|
||||
myconf_gn+=" custom_toolchain=\"//build/toolchain/linux/unbundle:default\""
|
||||
myconf_gn+=" host_toolchain=\"//build/toolchain/linux/unbundle:default\""
|
||||
myconf_gn+=" use_custom_libcxx=false"
|
||||
@@ -1150,7 +1186,6 @@ myconf_gn+=' content_enable_legacy_ipc=true'
|
||||
|
||||
#do not build webextensions support
|
||||
myconf_gn+=' enable_electron_extensions=false'
|
||||
myconf_gn+=' enable_extensions_legacy_ipc=false'
|
||||
|
||||
# The option below get overriden by whatever is in CFLAGS/CXXFLAGS, so they affect only C++ code.
|
||||
# symbol_level=2 is full debug
|
||||
@@ -1158,7 +1193,12 @@ myconf_gn+=' enable_extensions_legacy_ipc=false'
|
||||
# symbol_level=0 no debuginfo (only function names in private symbols)
|
||||
# blink (HTML engine) and v8 (js engine) are template-heavy, trying to compile them with full debug leads to linker errors due to inherent limitations of the DWARF format.
|
||||
%ifnarch %ix86 %arm aarch64
|
||||
%if 0%{?fedora}
|
||||
# [10675s] lto1: internal compiler error: in build_abbrev_table, at dwarf2out.cc:9244
|
||||
myconf_gn+=' symbol_level=1'
|
||||
%else
|
||||
myconf_gn+=' symbol_level=2'
|
||||
%endif
|
||||
myconf_gn+=' blink_symbol_level=1'
|
||||
myconf_gn+=' v8_symbol_level=1'
|
||||
%endif
|
||||
@@ -1169,12 +1209,21 @@ myconf_gn+=" blink_symbol_level=0"
|
||||
myconf_gn+=" v8_symbol_level=0"
|
||||
%endif
|
||||
%ifarch aarch64
|
||||
%if %{with lto}
|
||||
# linker OOM, sorry.
|
||||
# we still seem to get some debug generated during linking when LTO is enabled
|
||||
myconf_gn+=' symbol_level=0'
|
||||
myconf_gn+=' blink_symbol_level=0'
|
||||
myconf_gn+=' v8_symbol_level=0'
|
||||
%else
|
||||
myconf_gn+=' symbol_level=2'
|
||||
myconf_gn+=' blink_symbol_level=1'
|
||||
myconf_gn+=' v8_symbol_level=1'
|
||||
%endif
|
||||
%endif
|
||||
|
||||
#symbol_level should not affect generated code.
|
||||
myconf_gn+=' enable_stack_trace_line_numbers=true'
|
||||
|
||||
|
||||
# do not build some chrome features not used by electron
|
||||
@@ -1191,6 +1240,7 @@ myconf_gn+=" enable_captive_portal_detection=false"
|
||||
myconf_gn+=" enable_browser_speech_service=false"
|
||||
myconf_gn+=" enable_speech_service=false"
|
||||
myconf_gn+=" enable_screen_ai_service=false"
|
||||
myconf_gn+=' enable_screen_ai_browsertests=false'
|
||||
myconf_gn+=" include_transport_security_state_preload_list=false"
|
||||
myconf_gn+=" enable_web_speech=false"
|
||||
myconf_gn+=" chrome_wide_echo_cancellation_supported=false"
|
||||
@@ -1216,9 +1266,11 @@ myconf_gn+=' enable_compose=false'
|
||||
myconf_gn+=' enterprise_cloud_content_analysis=false'
|
||||
myconf_gn+=' enterprise_local_content_analysis=false'
|
||||
myconf_gn+=' enterprise_data_controls=false'
|
||||
myconf_gn+=' enterprise_client_certificates=false'
|
||||
myconf_gn+=' enterprise_watermark=false'
|
||||
myconf_gn+=' enterprise_content_analysis=false'
|
||||
myconf_gn+=' enable_video_effects=false'
|
||||
myconf_gn+=' use_fake_screen_ai=true'
|
||||
myconf_gn+=' webnn_use_tflite=false'
|
||||
|
||||
|
||||
#FIXME: possibly enable this when skia gets built with rust code by default.
|
||||
@@ -1226,9 +1278,6 @@ myconf_gn+=' enterprise_content_analysis=false'
|
||||
myconf_gn+=' enable_rust=false'
|
||||
myconf_gn+=' enable_chromium_prelude=false'
|
||||
|
||||
#See net/base/features.cc. It's not enabled yet.
|
||||
#FIXME: enable this and add shims to build with system zstd when it's enabled
|
||||
myconf_gn+=' disable_zstd_filter=true'
|
||||
|
||||
myconf_gn+=' chrome_certificate_policies_supported=false'
|
||||
myconf_gn+=' use_kerberos=false'
|
||||
@@ -1262,10 +1311,6 @@ myconf_gn+=" is_component_build=false"
|
||||
myconf_gn+=" use_sysroot=false"
|
||||
myconf_gn+=" fatal_linker_warnings=false"
|
||||
|
||||
#disable malloc interposer - bsc#1223366
|
||||
myconf_gn+=' use_allocator_shim=false'
|
||||
myconf_gn+=' enable_backup_ref_ptr_support=false'
|
||||
myconf_gn+=" use_partition_alloc=true"
|
||||
|
||||
|
||||
myconf_gn+=" disable_fieldtrial_testing_config=true"
|
||||
@@ -1428,7 +1473,7 @@ cp /dev/stdin %{buildroot}%{_rpmconfigdir}/macros.d/macros.electron <<"EOF"
|
||||
|
||||
# Build native modules against Electron. This should be done as the first step in ‰build. You must set CFLAGS/LDFLAGS previously.
|
||||
# You can call it multiple times in different directories and pass more parameters to it (seen in vscode)
|
||||
%%electron_rebuild PATH="%{_libexecdir}/electron-node:$PATH" npm rebuild --verbose --foreground-scripts --nodedir=%{_includedir}/electron
|
||||
%%electron_rebuild %{?jitless} PATH="%{_libexecdir}/electron-node:$PATH" npm rebuild --verbose --foreground-scripts --nodedir=%{_includedir}/electron
|
||||
|
||||
# Sanity check that native modules load. You must include this in ‰check if the package includes native modules (possibly in addition to actual test suites)
|
||||
# These do, in order:
|
||||
@@ -1478,7 +1523,7 @@ ln -srv third_party -t out/Release
|
||||
%files
|
||||
%license electron/LICENSE out/Release/LICENSES.chromium.html
|
||||
%{_bindir}/electron
|
||||
%{_datadir}/applications/electron.desktop
|
||||
%{_datadir}/applications/Electron.desktop
|
||||
%{_datadir}/icons/hicolor/16x16/apps/electron.png
|
||||
%{_datadir}/icons/hicolor/32x32/apps/electron.png
|
||||
%{_datadir}/icons/hicolor/48x48/apps/electron.png
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
Fix inconsistent type alias use
|
||||
On linux ix86, `double_t` evaluates to `long double`. This contradicts the `double` expected below.
|
||||
|
||||
--- src/third_party/perfetto/src/trace_processor/db/column/numeric_storage.cc.old 2023-10-13 11:25:09.719946900 +0200
|
||||
+++ src/third_party/perfetto/src/trace_processor/db/column/numeric_storage.cc 2023-10-14 23:54:10.728423000 +0200
|
||||
@@ -39,7 +39,7 @@ namespace trace_processor {
|
||||
namespace column {
|
||||
namespace {
|
||||
|
||||
-using NumericValue = std::variant<uint32_t, int32_t, int64_t, double_t>;
|
||||
+using NumericValue = std::variant<uint32_t, int32_t, int64_t, double>;
|
||||
|
||||
// Using the fact that binary operators in std are operators() of classes, we
|
||||
// can wrap those classes in variants and use them for std::visit in
|
||||
@@ -1,31 +0,0 @@
|
||||
From 8d253767f895b45053c39ea99a8f02bbe7071d3a Mon Sep 17 00:00:00 2001
|
||||
From: Jose Dapena Paz <jdapena@igalia.com>
|
||||
Date: Mon, 19 Feb 2024 19:00:26 +0000
|
||||
Subject: [PATCH] IWYU: usage of std::optional in plus_address_types.h requires
|
||||
include
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Bug: 41455655
|
||||
Change-Id: Ibfda146f5bf7485ad31828f1dc22eb39b57f83b5
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5306779
|
||||
Reviewed-by: Jan Keitel <jkeitel@google.com>
|
||||
Commit-Queue: José Dapena Paz <jdapena@igalia.com>
|
||||
Cr-Commit-Position: refs/heads/main@{#1262436}
|
||||
---
|
||||
components/plus_addresses/plus_address_types.h | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/components/plus_addresses/plus_address_types.h b/components/plus_addresses/plus_address_types.h
|
||||
index 7a7eaa2a818a9..77569d345011a 100644
|
||||
--- a/components/plus_addresses/plus_address_types.h
|
||||
+++ b/components/plus_addresses/plus_address_types.h
|
||||
@@ -5,6 +5,7 @@
|
||||
#ifndef COMPONENTS_PLUS_ADDRESSES_PLUS_ADDRESS_TYPES_H_
|
||||
#define COMPONENTS_PLUS_ADDRESSES_PLUS_ADDRESS_TYPES_H_
|
||||
|
||||
+#include <optional>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
11
preview_cancel_reason-missing-string.patch
Normal file
11
preview_cancel_reason-missing-string.patch
Normal file
@@ -0,0 +1,11 @@
|
||||
--- src/content/public/browser/preview_cancel_reason.h.orig 2024-05-30 22:55:47.180621500 +0000
|
||||
+++ src/content/public/browser/preview_cancel_reason.h 2024-05-31 07:46:06.285116500 +0000
|
||||
@@ -5,6 +5,8 @@
|
||||
#ifndef CONTENT_PUBLIC_BROWSER_PREVIEW_CANCEL_REASON_H_
|
||||
#define CONTENT_PUBLIC_BROWSER_PREVIEW_CANCEL_REASON_H_
|
||||
|
||||
+#include <string>
|
||||
+
|
||||
#include "content/common/content_export.h"
|
||||
#include "third_party/abseil-cpp/absl/types/variant.h"
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
From 5b2d53797e5580cbfea00d732fe25a97c7048b5b Mon Sep 17 00:00:00 2001
|
||||
From: Jose Dapena Paz <jdapena@igalia.com>
|
||||
Date: Wed, 24 Jan 2024 06:46:33 +0000
|
||||
Subject: [PATCH] IWYU: missing include for std::optional usage in
|
||||
race_network_request_write_buffer_manager.h
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Bug: 957519
|
||||
Change-Id: Id3a6c3cc3c1273208bde43b70a2bd298695f7cc4
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5223947
|
||||
Reviewed-by: Shunya Shishido <sisidovski@chromium.org>
|
||||
Commit-Queue: José Dapena Paz <jdapena@igalia.com>
|
||||
Cr-Commit-Position: refs/heads/main@{#1251264}
|
||||
---
|
||||
.../service_worker/race_network_request_write_buffer_manager.h | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/content/common/service_worker/race_network_request_write_buffer_manager.h b/content/common/service_worker/race_network_request_write_buffer_manager.h
|
||||
index 0e7f17417dbd9..ad9ea1348a977 100644
|
||||
--- a/content/common/service_worker/race_network_request_write_buffer_manager.h
|
||||
+++ b/content/common/service_worker/race_network_request_write_buffer_manager.h
|
||||
@@ -5,6 +5,8 @@
|
||||
#ifndef CONTENT_COMMON_SERVICE_WORKER_RACE_NETWORK_REQUEST_WRITE_BUFFER_MANAGER_H_
|
||||
#define CONTENT_COMMON_SERVICE_WORKER_RACE_NETWORK_REQUEST_WRITE_BUFFER_MANAGER_H_
|
||||
|
||||
+#include <optional>
|
||||
+
|
||||
#include "base/containers/span.h"
|
||||
#include "content/common/content_export.h"
|
||||
#include "mojo/public/cpp/system/data_pipe.h"
|
||||
@@ -9,9 +9,9 @@ Remove this unused component which brings a huge dependency on //third_party/daw
|
||||
- "//services/on_device_model:on_device_model_service",
|
||||
- "//services/on_device_model/public/cpp",
|
||||
- "//services/on_device_model/public/mojom",
|
||||
"//services/screen_ai/buildflags",
|
||||
"//services/service_manager/public/cpp",
|
||||
"//services/service_manager/public/mojom",
|
||||
"//services/shape_detection:lib",
|
||||
--- src/content/utility/services.cc.orig
|
||||
+++ src/content/utility/services.cc
|
||||
@@ -31,7 +31,6 @@
|
||||
@@ -23,8 +23,8 @@ Remove this unused component which brings a huge dependency on //third_party/daw
|
||||
#include "services/tracing/tracing_service.h"
|
||||
#include "services/video_capture/public/mojom/video_capture_service.mojom.h"
|
||||
@@ -327,13 +326,6 @@ auto RunVideoCapture(
|
||||
return service;
|
||||
}
|
||||
#endif
|
||||
|
||||
-auto RunOnDeviceModel(
|
||||
- mojo::PendingReceiver<on_device_model::mojom::OnDeviceModelService>
|
||||
@@ -37,8 +37,8 @@ Remove this unused component which brings a huge dependency on //third_party/daw
|
||||
auto RunXrDeviceService(
|
||||
mojo::PendingReceiver<device::mojom::XRDeviceService> receiver) {
|
||||
@@ -408,9 +400,6 @@ void RegisterMainThreadServices(mojo::Se
|
||||
services.Add(RunTracing);
|
||||
services.Add(RunVideoCapture);
|
||||
services.Add(RunVideoEffects);
|
||||
#endif
|
||||
|
||||
- if (optimization_guide::features::CanLaunchOnDeviceModelService()) {
|
||||
- services.Add(RunOnDeviceModel);
|
||||
@@ -53,9 +53,9 @@ Remove this unused component which brings a huge dependency on //third_party/daw
|
||||
#include "sandbox/policy/sandbox.h"
|
||||
#include "sandbox/policy/sandbox_type.h"
|
||||
-#include "services/on_device_model/on_device_model_service.h"
|
||||
#include "services/screen_ai/buildflags/buildflags.h"
|
||||
#include "services/tracing/public/cpp/trace_startup.h"
|
||||
#include "third_party/icu/source/common/unicode/unistr.h"
|
||||
#include "third_party/icu/source/i18n/unicode/timezone.h"
|
||||
@@ -202,10 +201,6 @@ int UtilityMain(MainFunctionParams param
|
||||
? base::MessagePumpType::UI
|
||||
: base::MessagePumpType::DEFAULT;
|
||||
|
||||
@@ -181,7 +181,7 @@ cgit v1.2.3
|
||||
}
|
||||
--- src/components/search_engines/BUILD.gn.old
|
||||
+++ src/components/search_engines/BUILD.gn
|
||||
@@ -15,47 +15,25 @@ static_library("search_engines") {
|
||||
@@ -15,45 +15,23 @@ static_library("search_engines") {
|
||||
"choice_made_location.h",
|
||||
"default_search_manager.cc",
|
||||
"default_search_manager.h",
|
||||
@@ -199,8 +199,6 @@ cgit v1.2.3
|
||||
- "search_engine_choice_utils.cc",
|
||||
- "search_engine_choice_utils.h",
|
||||
"search_engines_pref_names.h",
|
||||
"search_engines_switches.cc",
|
||||
"search_engines_switches.h",
|
||||
- "search_host_to_urls_map.cc",
|
||||
- "search_host_to_urls_map.h",
|
||||
"search_terms_data.cc",
|
||||
@@ -262,7 +260,7 @@ cgit v1.2.3
|
||||
]
|
||||
}
|
||||
|
||||
- if (is_linux || is_win || is_mac || is_chromeos_ash) {
|
||||
- if (is_linux || is_win || is_mac || is_chromeos) {
|
||||
+ if (false) {
|
||||
sources += [
|
||||
"site_search_policy_handler.cc",
|
||||
|
||||
@@ -18,14 +18,16 @@
|
||||
"//components/content_settings/core/common",
|
||||
"//components/crash/core/common",
|
||||
"//components/device_signals/core/common:features",
|
||||
--- src/components/services/screen_ai/BUILD.gn.old
|
||||
+++ src/components/services/screen_ai/BUILD.gn
|
||||
@@ -41,8 +41,6 @@ if (is_linux || is_chromeos) {
|
||||
--- src/content/utility/BUILD.gn.orig
|
||||
+++ src/content/utility/BUILD.gn
|
||||
@@ -144,10 +144,6 @@ source_set("utility") {
|
||||
}
|
||||
}
|
||||
|
||||
deps = [
|
||||
"//base",
|
||||
- "//components/component_updater",
|
||||
- "//components/services/screen_ai/public/cpp:utilities",
|
||||
"//sandbox/linux:sandbox_services",
|
||||
"//ui/accessibility:ax_base",
|
||||
]
|
||||
- if (is_linux || is_chromeos) {
|
||||
- deps += [ "//services/screen_ai:screen_ai_sandbox_hook" ]
|
||||
- }
|
||||
-
|
||||
if (enable_accessibility_service) {
|
||||
deps += [ "//services/accessibility:lib" ]
|
||||
}
|
||||
|
||||
@@ -10,43 +10,93 @@ Remove this dead code which brings a dependency on rustc
|
||||
"//components/query_parser:unit_tests",
|
||||
"//components/reading_list/core:unit_tests",
|
||||
"//components/reporting/client:unit_tests",
|
||||
--- src/chrome/test/BUILD.gn.orig 2024-03-27 16:37:20.829583999 +0100
|
||||
+++ src/chrome/test/BUILD.gn 2024-03-28 23:15:36.696977127 +0100
|
||||
@@ -1765,8 +1765,6 @@ if (!is_android && !is_fuchsia) {
|
||||
"//chrome/common/privacy_budget:test_support",
|
||||
"//chrome/renderer",
|
||||
"//chrome/renderer/companion/visual_query:browser_tests",
|
||||
- "//chrome/services/qrcode_generator/public/cpp",
|
||||
- "//chrome/services/qrcode_generator/public/mojom",
|
||||
"//chrome/services/removable_storage_writer:lib",
|
||||
"//chrome/test/data/webui:resources_grit",
|
||||
"//chrome/test/data/webui/mojo:mojo_bindings",
|
||||
@@ -6818,7 +6816,6 @@ if (!is_fuchsia) {
|
||||
"//chrome/common/themes:unit_tests",
|
||||
"//chrome/renderer/companion/visual_query:unit_tests",
|
||||
"//chrome/services/file_util:unit_tests",
|
||||
- "//chrome/services/qrcode_generator/public/cpp",
|
||||
"//components/account_id",
|
||||
"//components/assist_ranker/proto",
|
||||
"//components/autofill/content/browser:test_support",
|
||||
--- src/chrome/services/qrcode_generator/BUILD.gn.orig 2024-03-27 16:30:07.952978653 +0100
|
||||
+++ src/chrome/services/qrcode_generator/BUILD.gn 2024-03-28 23:20:47.829864401 +0100
|
||||
@@ -15,8 +15,6 @@ source_set("qrcode_generator") {
|
||||
deps = [
|
||||
"//base",
|
||||
"//chrome:strings",
|
||||
- "//components/qr_code_generator",
|
||||
- "//components/qr_code_generator:qr_code_generator_features",
|
||||
"//components/vector_icons",
|
||||
"//mojo/public/cpp/bindings",
|
||||
"//net",
|
||||
--- src/chrome/services/qrcode_generator/public/cpp/BUILD.gn.orig 2024-03-27 16:30:07.952978653 +0100
|
||||
+++ src/chrome/services/qrcode_generator/public/cpp/BUILD.gn 2024-03-28 23:22:28.019734555 +0100
|
||||
@@ -15,7 +15,6 @@ source_set("cpp") {
|
||||
"//chrome:strings",
|
||||
"//chrome/services/qrcode_generator",
|
||||
"//chrome/services/qrcode_generator/public/mojom",
|
||||
- "//components/qr_code_generator:qr_code_generator_features",
|
||||
"//content/public/browser",
|
||||
"//skia",
|
||||
]
|
||||
--- src/chrome/browser/BUILD.gn.orig
|
||||
+++ src/chrome/browser/BUILD.gn
|
||||
@@ -1972,7 +1972,6 @@ static_library("browser") {
|
||||
"//chrome/browser/profiling_host",
|
||||
|
||||
# TODO(crbug.com/1335199): break this dep when favicon is in its own target
|
||||
- "//chrome/browser/share",
|
||||
"//chrome/browser/ui",
|
||||
"//chrome/browser/storage_access_api",
|
||||
"//chrome/browser/top_level_storage_access_api:permissions",
|
||||
@@ -2106,7 +2105,6 @@ static_library("browser") {
|
||||
"//chrome/browser/safe_browsing:advanced_protection",
|
||||
"//chrome/browser/safe_browsing:metrics_collector",
|
||||
"//chrome/browser/safe_browsing:verdict_cache_manager_factory",
|
||||
- "//chrome/browser/share",
|
||||
"//chrome/browser/sharing:buildflags",
|
||||
"//chrome/browser/sharing/proto",
|
||||
"//chrome/browser/signin:identity_manager_provider",
|
||||
@@ -4598,7 +4596,6 @@ static_library("browser") {
|
||||
"//chrome/browser/policy:path_parser",
|
||||
"//chrome/browser/profile_resetter:profile_reset_report_proto",
|
||||
"//chrome/browser/resources:component_extension_resources",
|
||||
- "//chrome/browser/share/proto:proto",
|
||||
"//chrome/browser/smart_card",
|
||||
"//chrome/browser/support_tool:support_tool_proto",
|
||||
"//chrome/browser/ui/actions:actions_headers",
|
||||
@@ -8407,7 +8404,6 @@ static_library("test_support") {
|
||||
"//build:chromeos_buildflags",
|
||||
"//chrome/app/theme:theme_resources",
|
||||
"//chrome/browser/policy/messaging_layer/proto:crd_event_proto",
|
||||
- "//chrome/browser/share:share",
|
||||
"//chrome/common",
|
||||
"//chrome/common/notifications",
|
||||
"//chrome/common/safe_browsing:proto",
|
||||
--- src/chrome/browser/ui/BUILD.gn.orig
|
||||
+++ src/chrome/browser/ui/BUILD.gn
|
||||
@@ -451,7 +451,6 @@ static_library("ui") {
|
||||
"//chrome/browser/resources:dev_ui_resources",
|
||||
"//chrome/browser/resources:resources",
|
||||
"//chrome/browser/safe_browsing",
|
||||
- "//chrome/browser/share",
|
||||
"//chrome/browser/storage_access_api",
|
||||
"//chrome/browser/ui/side_panel:side_panel_enums",
|
||||
"//chrome/browser/ui/webui/location_internals:mojo_bindings",
|
||||
@@ -591,7 +590,6 @@ static_library("ui") {
|
||||
"//components/privacy_sandbox:tracking_protection_settings",
|
||||
"//components/profile_metrics",
|
||||
"//components/proxy_config",
|
||||
- "//components/qr_code_generator:bitmap_generator",
|
||||
"//components/query_parser",
|
||||
"//components/reading_list/core",
|
||||
"//components/reading_list/features:flags",
|
||||
--- src/chrome/test/BUILD.gn.orig
|
||||
+++ src/chrome/test/BUILD.gn
|
||||
@@ -1923,7 +1923,6 @@ if (!is_android) {
|
||||
"//components/privacy_sandbox/privacy_sandbox_attestations:test_support",
|
||||
"//components/privacy_sandbox/privacy_sandbox_attestations/proto:proto",
|
||||
"//components/proxy_config",
|
||||
- "//components/qr_code_generator:bitmap_generator",
|
||||
"//components/reading_list/core",
|
||||
"//components/reading_list/features:flags",
|
||||
"//components/resources",
|
||||
@@ -6774,7 +6773,6 @@ test("unit_tests") {
|
||||
"//chrome/browser/safe_browsing:metrics_collector",
|
||||
"//chrome/browser/safe_browsing:verdict_cache_manager_factory",
|
||||
"//chrome/browser/segmentation_platform:test_utils",
|
||||
- "//chrome/browser/share",
|
||||
"//chrome/browser/sharing/proto",
|
||||
"//chrome/browser/storage_access_api",
|
||||
"//chrome/browser/sync_file_system/drive_backend:sync_file_system_drive_proto",
|
||||
@@ -6927,7 +6925,6 @@ test("unit_tests") {
|
||||
"//components/privacy_sandbox/privacy_sandbox_attestations:test_support",
|
||||
"//components/privacy_sandbox/privacy_sandbox_attestations/proto:proto",
|
||||
"//components/proxy_config",
|
||||
- "//components/qr_code_generator:bitmap_generator",
|
||||
"//components/query_parser",
|
||||
"//components/query_tiles:unit_tests",
|
||||
"//components/reading_list/core",
|
||||
@@ -8360,11 +8357,6 @@ test("unit_tests") {
|
||||
|
||||
data += [ "//ash/components/arc/test/data/icons/" ]
|
||||
|
||||
- data_deps += [
|
||||
- # enclave_manager_unittest.cc runs this binary as part of its testing
|
||||
- # process.
|
||||
- "//third_party/cloud_authenticator/test/local_service:cloud_authenticator_test_service",
|
||||
- ]
|
||||
|
||||
if (include_js2gtest_tests && is_chromeos_ash) {
|
||||
data += js2gtest_js_libraries
|
||||
|
||||
283
remove-sync.patch
Normal file
283
remove-sync.patch
Normal file
@@ -0,0 +1,283 @@
|
||||
Do not build //components/sync with its massive protos.
|
||||
It's unused in Electron (it's only there to support Google profile login) and dropping it saves about 1~2 MB binary size.
|
||||
|
||||
|
||||
Inspired by:
|
||||
* https://code.qt.io/cgit/qt/qtwebengine-chromium.git/commit?h=122-based&id=8a9d741f4c4cf8170d5c50a336d51fe5d1b16ce8
|
||||
* https://code.qt.io/cgit/qt/qtwebengine-chromium.git/commit?h=122-based&id=6a11e9169f5889883bf63a3522d0c3f8f23552b0
|
||||
|
||||
--- src/components/search_engines/BUILD.gn.orig
|
||||
+++ src/components/search_engines/BUILD.gn
|
||||
@@ -66,7 +66,6 @@ static_library("search_engines") {
|
||||
"//components/google/core/common",
|
||||
"//components/keyed_service/core",
|
||||
"//components/prefs",
|
||||
- "//components/sync",
|
||||
"//components/webdata/common",
|
||||
"//third_party/metrics_proto",
|
||||
]
|
||||
--- src/electron/BUILD.gn.orig
|
||||
+++ src/electron/BUILD.gn
|
||||
@@ -1204,6 +1204,8 @@ if (is_mac) {
|
||||
"//electron/buildflags",
|
||||
"//ui/strings",
|
||||
]
|
||||
+
|
||||
+ assert_no_deps = [ "//components/sync/*" ]
|
||||
|
||||
data = []
|
||||
data_deps = []
|
||||
--- src/electron/chromium_src/BUILD.gn.orig
|
||||
+++ src/electron/chromium_src/BUILD.gn
|
||||
@@ -493,7 +493,6 @@ source_set("chrome_spellchecker") {
|
||||
"//base:base_static",
|
||||
"//components/language/core/browser",
|
||||
"//components/spellcheck:buildflags",
|
||||
- "//components/sync",
|
||||
]
|
||||
|
||||
public_deps += [ "//chrome/common:constants" ]
|
||||
--- src/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc.orig
|
||||
+++ src/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc
|
||||
@@ -27,10 +27,6 @@
|
||||
#include "chrome/common/chrome_constants.h"
|
||||
#include "components/spellcheck/browser/spellcheck_host_metrics.h"
|
||||
#include "components/spellcheck/common/spellcheck_common.h"
|
||||
-#include "components/sync/model/sync_change.h"
|
||||
-#include "components/sync/model/sync_change_processor.h"
|
||||
-#include "components/sync/protocol/dictionary_specifics.pb.h"
|
||||
-#include "components/sync/protocol/entity_specifics.pb.h"
|
||||
#include "content/public/browser/browser_task_traits.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
|
||||
@@ -256,7 +252,6 @@ bool SpellcheckCustomDictionary::AddWord
|
||||
int result = dictionary_change->Sanitize(GetWords());
|
||||
Apply(*dictionary_change);
|
||||
Notify(*dictionary_change);
|
||||
- Sync(*dictionary_change);
|
||||
Save(std::move(dictionary_change));
|
||||
return result == VALID_CHANGE;
|
||||
}
|
||||
@@ -268,7 +263,6 @@ bool SpellcheckCustomDictionary::RemoveW
|
||||
int result = dictionary_change->Sanitize(GetWords());
|
||||
Apply(*dictionary_change);
|
||||
Notify(*dictionary_change);
|
||||
- Sync(*dictionary_change);
|
||||
Save(std::move(dictionary_change));
|
||||
return result == VALID_CHANGE;
|
||||
}
|
||||
@@ -302,10 +296,12 @@ bool SpellcheckCustomDictionary::IsLoade
|
||||
return is_loaded_;
|
||||
}
|
||||
|
||||
+#if 0
|
||||
bool SpellcheckCustomDictionary::IsSyncing() {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
return !!sync_processor_.get();
|
||||
}
|
||||
+#endif
|
||||
|
||||
void SpellcheckCustomDictionary::Load() {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
@@ -317,6 +313,7 @@ void SpellcheckCustomDictionary::Load()
|
||||
weak_ptr_factory_.GetWeakPtr()));
|
||||
}
|
||||
|
||||
+#if 0
|
||||
void SpellcheckCustomDictionary::WaitUntilReadyToSync(base::OnceClosure done) {
|
||||
DCHECK(!wait_until_ready_to_sync_cb_);
|
||||
if (is_loaded_)
|
||||
@@ -414,6 +411,7 @@ SpellcheckCustomDictionary::ProcessSyncC
|
||||
base::WeakPtr<syncer::SyncableService> SpellcheckCustomDictionary::AsWeakPtr() {
|
||||
return weak_ptr_factory_.GetWeakPtr();
|
||||
}
|
||||
+#endif
|
||||
|
||||
SpellcheckCustomDictionary::LoadFileResult::LoadFileResult()
|
||||
: is_valid_file(false) {}
|
||||
@@ -460,7 +458,6 @@ void SpellcheckCustomDictionary::OnLoade
|
||||
dictionary_change.AddWords(result->words);
|
||||
dictionary_change.Sanitize(GetWords());
|
||||
Apply(dictionary_change);
|
||||
- Sync(dictionary_change);
|
||||
is_loaded_ = true;
|
||||
if (wait_until_ready_to_sync_cb_)
|
||||
std::move(wait_until_ready_to_sync_cb_).Run();
|
||||
@@ -507,6 +504,7 @@ void SpellcheckCustomDictionary::Save(
|
||||
std::move(dictionary_change), custom_dictionary_path_));
|
||||
}
|
||||
|
||||
+#if 0
|
||||
std::optional<syncer::ModelError> SpellcheckCustomDictionary::Sync(
|
||||
const Change& dictionary_change) {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
@@ -558,6 +556,7 @@ std::optional<syncer::ModelError> Spellc
|
||||
|
||||
return std::nullopt;
|
||||
}
|
||||
+#endif
|
||||
|
||||
void SpellcheckCustomDictionary::Notify(const Change& dictionary_change) {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
--- src/chrome/browser/spellchecker/spellcheck_custom_dictionary.h.orig
|
||||
+++ src/chrome/browser/spellchecker/spellcheck_custom_dictionary.h
|
||||
@@ -17,9 +17,6 @@
|
||||
#include "base/observer_list.h"
|
||||
#include "base/task/sequenced_task_runner.h"
|
||||
#include "components/spellcheck/browser/spellcheck_dictionary.h"
|
||||
-#include "components/sync/model/model_error.h"
|
||||
-#include "components/sync/model/sync_data.h"
|
||||
-#include "components/sync/model/syncable_service.h"
|
||||
|
||||
namespace base {
|
||||
class Location;
|
||||
@@ -38,8 +35,7 @@ class SyncChangeProcessor;
|
||||
// foo
|
||||
// checksum_v1 = ec3df4034567e59e119fcf87f2d9bad4
|
||||
//
|
||||
-class SpellcheckCustomDictionary final : public SpellcheckDictionary,
|
||||
- public syncer::SyncableService {
|
||||
+class SpellcheckCustomDictionary final : public SpellcheckDictionary {
|
||||
public:
|
||||
// A change to the dictionary.
|
||||
class Change {
|
||||
@@ -162,11 +158,11 @@ class SpellcheckCustomDictionary final :
|
||||
bool IsLoaded();
|
||||
|
||||
// Returns true if the dictionary is being synced. Otherwise returns false.
|
||||
- bool IsSyncing();
|
||||
|
||||
// Overridden from SpellcheckDictionary:
|
||||
void Load() override;
|
||||
|
||||
+#if 0
|
||||
// Overridden from syncer::SyncableService:
|
||||
void WaitUntilReadyToSync(base::OnceClosure done) override;
|
||||
std::optional<syncer::ModelError> MergeDataAndStartSyncing(
|
||||
@@ -179,6 +175,7 @@ class SpellcheckCustomDictionary final :
|
||||
const base::Location& from_here,
|
||||
const syncer::SyncChangeList& change_list) override;
|
||||
base::WeakPtr<SyncableService> AsWeakPtr() override;
|
||||
+#endif
|
||||
|
||||
private:
|
||||
friend class DictionarySyncIntegrationTestHelper;
|
||||
@@ -217,7 +214,6 @@ class SpellcheckCustomDictionary final :
|
||||
// Notifies the sync service of the |dictionary_change|. Syncs up to the
|
||||
// maximum syncable words on the server. Disables syncing of this dictionary
|
||||
// if the server contains the maximum number of syncable words.
|
||||
- std::optional<syncer::ModelError> Sync(const Change& dictionary_change);
|
||||
|
||||
// Notifies observers of the dictionary change if the dictionary has been
|
||||
// changed.
|
||||
@@ -236,7 +232,6 @@ class SpellcheckCustomDictionary final :
|
||||
base::ObserverList<Observer>::Unchecked observers_;
|
||||
|
||||
// Used to send local changes to the sync infrastructure.
|
||||
- std::unique_ptr<syncer::SyncChangeProcessor> sync_processor_;
|
||||
|
||||
// True if the dictionary has been loaded. Otherwise false.
|
||||
bool is_loaded_;
|
||||
--- src/device/fido/BUILD.gn.orig
|
||||
+++ src/device/fido/BUILD.gn
|
||||
@@ -148,20 +148,6 @@ component("fido") {
|
||||
"device_operation.h",
|
||||
"device_response_converter.cc",
|
||||
"device_response_converter.h",
|
||||
- "enclave/constants.cc",
|
||||
- "enclave/constants.h",
|
||||
- "enclave/enclave_authenticator.cc",
|
||||
- "enclave/enclave_authenticator.h",
|
||||
- "enclave/enclave_discovery.cc",
|
||||
- "enclave/enclave_discovery.h",
|
||||
- "enclave/enclave_protocol_utils.cc",
|
||||
- "enclave/enclave_protocol_utils.h",
|
||||
- "enclave/enclave_websocket_client.cc",
|
||||
- "enclave/enclave_websocket_client.h",
|
||||
- "enclave/transact.cc",
|
||||
- "enclave/transact.h",
|
||||
- "enclave/types.cc",
|
||||
- "enclave/types.h",
|
||||
"fido_authenticator.cc",
|
||||
"fido_authenticator.h",
|
||||
"fido_device.cc",
|
||||
@@ -229,7 +215,6 @@ component("fido") {
|
||||
]
|
||||
|
||||
deps += [
|
||||
- "//components/sync/protocol:protocol",
|
||||
"//services/device/public/cpp/hid",
|
||||
"//services/device/public/cpp/usb",
|
||||
"//services/device/public/mojom",
|
||||
--- src/device/fido/fido_discovery_factory.cc.orig
|
||||
+++ src/device/fido/fido_discovery_factory.cc
|
||||
@@ -37,7 +37,7 @@
|
||||
#include "device/fido/cros/discovery.h"
|
||||
#endif // BUILDFLAG(IS_CHROMEOS)
|
||||
|
||||
-#if !BUILDFLAG(IS_CHROMEOS)
|
||||
+#if 0
|
||||
#include "device/fido/enclave/enclave_discovery.h"
|
||||
#endif
|
||||
|
||||
@@ -108,7 +108,7 @@ std::vector<std::unique_ptr<FidoDiscover
|
||||
#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS)
|
||||
discoveries = MaybeCreatePlatformDiscovery();
|
||||
#endif
|
||||
-#if !BUILDFLAG(IS_CHROMEOS)
|
||||
+#if 0
|
||||
MaybeCreateEnclaveDiscovery(discoveries);
|
||||
#endif
|
||||
return discoveries;
|
||||
@@ -183,11 +183,13 @@ void FidoDiscoveryFactory::set_hid_ignor
|
||||
hid_ignore_list_ = std::move(hid_ignore_list);
|
||||
}
|
||||
|
||||
+#if 0
|
||||
void FidoDiscoveryFactory::set_enclave_passkey_creation_callback(
|
||||
base::RepeatingCallback<void(sync_pb::WebauthnCredentialSpecifics)>
|
||||
callback) {
|
||||
enclave_passkey_creation_callback_ = callback;
|
||||
}
|
||||
+#endif
|
||||
|
||||
void FidoDiscoveryFactory::set_enclave_ui_request_stream(
|
||||
std::unique_ptr<FidoDiscoveryBase::EventStream<
|
||||
@@ -266,7 +268,7 @@ void FidoDiscoveryFactory::
|
||||
}
|
||||
#endif
|
||||
|
||||
-#if !BUILDFLAG(IS_CHROMEOS)
|
||||
+#if 0
|
||||
void FidoDiscoveryFactory::MaybeCreateEnclaveDiscovery(
|
||||
std::vector<std::unique_ptr<FidoDiscoveryBase>>& discoveries) {
|
||||
if (!base::FeatureList::IsEnabled(kWebAuthnEnclaveAuthenticator) ||
|
||||
--- src/device/fido/fido_discovery_factory.h.orig
|
||||
+++ src/device/fido/fido_discovery_factory.h
|
||||
@@ -15,7 +15,6 @@
|
||||
#include "base/memory/raw_ptr.h"
|
||||
#include "build/build_config.h"
|
||||
#include "build/chromeos_buildflags.h"
|
||||
-#include "components/sync/protocol/webauthn_credential_specifics.pb.h"
|
||||
#include "device/fido/cable/cable_discovery_data.h"
|
||||
#include "device/fido/cable/v2_constants.h"
|
||||
#include "device/fido/ctap_get_assertion_request.h"
|
||||
@@ -99,9 +98,6 @@ class COMPONENT_EXPORT(DEVICE_FIDO) Fido
|
||||
|
||||
// Provides a callback that will be called when a passkey is created with
|
||||
// the enclave authenticator in order to save the new passkey to sync data.
|
||||
- void set_enclave_passkey_creation_callback(
|
||||
- base::RepeatingCallback<void(sync_pb::WebauthnCredentialSpecifics)>
|
||||
- callback);
|
||||
|
||||
void set_enclave_ui_request_stream(
|
||||
std::unique_ptr<FidoDiscoveryBase::EventStream<
|
||||
@@ -192,8 +188,6 @@ class COMPONENT_EXPORT(DEVICE_FIDO) Fido
|
||||
get_assertion_request_for_legacy_credential_check_;
|
||||
#endif // BUILDFLAG(IS_CHROMEOS)
|
||||
base::flat_set<VidPid> hid_ignore_list_;
|
||||
- base::RepeatingCallback<void(sync_pb::WebauthnCredentialSpecifics)>
|
||||
- enclave_passkey_creation_callback_;
|
||||
std::unique_ptr<FidoDiscoveryBase::EventStream<
|
||||
std::unique_ptr<enclave::CredentialRequest>>>
|
||||
enclave_ui_request_stream_;
|
||||
@@ -1,32 +0,0 @@
|
||||
From 214859e3567ea9def85305e4f021a5d407e1ccfe Mon Sep 17 00:00:00 2001
|
||||
From: Jose Dapena Paz <jdapena@igalia.com>
|
||||
Date: Tue, 23 Jan 2024 10:56:36 +0000
|
||||
Subject: [PATCH] IWYU: missing include for usage of std::bitset in
|
||||
resolution_monitor.cc
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Bug: 957519
|
||||
Change-Id: Ia538bbca63105397963632d2a145886e256efeb6
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5190545
|
||||
Commit-Queue: José Dapena Paz <jdapena@igalia.com>
|
||||
Reviewed-by: Henrik Boström <hbos@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#1250732}
|
||||
---
|
||||
.../renderer/platform/peerconnection/resolution_monitor.cc | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/third_party/blink/renderer/platform/peerconnection/resolution_monitor.cc b/third_party/blink/renderer/platform/peerconnection/resolution_monitor.cc
|
||||
index 5d6a6495045c4..33135a1b22473 100644
|
||||
--- a/third_party/blink/renderer/platform/peerconnection/resolution_monitor.cc
|
||||
+++ b/third_party/blink/renderer/platform/peerconnection/resolution_monitor.cc
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
#include "third_party/blink/renderer/platform/peerconnection/resolution_monitor.h"
|
||||
|
||||
+#include <bitset>
|
||||
+
|
||||
#include "base/containers/span.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
@@ -1,115 +0,0 @@
|
||||
From 8b293359cafbc741e7742de824b98fbf87a51b51 Mon Sep 17 00:00:00 2001
|
||||
From: Jose Dapena Paz <jdapena@igalia.com>
|
||||
Date: Thu, 8 Feb 2024 09:32:57 +0000
|
||||
Subject: [PATCH] Do not use templates for ScriptPromiseResolver::ToV8
|
||||
implementation
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The usage of templates for reusing the internal implementation of ToV8
|
||||
is not making the code simpler. So, inline the implementations.
|
||||
|
||||
This also fixes a GCC build issue because it was implemented with
|
||||
template specializations declared in the class scope, and that is
|
||||
hitting the GCC bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85282
|
||||
|
||||
Bug: 819294
|
||||
Change-Id: I51f5a9e0a6e80ac707b630f270179c29fd84b059
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5223626
|
||||
Commit-Queue: José Dapena Paz <jdapena@igalia.com>
|
||||
Reviewed-by: Yuki Shiino <yukishiino@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#1257835}
|
||||
---
|
||||
.../core/v8/script_promise_resolver.h | 60 +++++--------------
|
||||
1 file changed, 14 insertions(+), 46 deletions(-)
|
||||
|
||||
diff --git a/third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h b/third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h
|
||||
index 93cecd06c2814..ae0081b735a67 100644
|
||||
--- a/third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h
|
||||
+++ b/third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h
|
||||
@@ -316,70 +316,38 @@ class CORE_EXPORT ScriptPromiseResolver
|
||||
return V8String(isolate, value);
|
||||
}
|
||||
|
||||
- template <size_t sizeOfValue>
|
||||
- static v8::Local<v8::Value> ToV8SignedIntegerInternal(int64_t value,
|
||||
- v8::Isolate*);
|
||||
-
|
||||
- template <>
|
||||
- v8::Local<v8::Value> ToV8SignedIntegerInternal<4>(int64_t value,
|
||||
- v8::Isolate* isolate) {
|
||||
- return v8::Integer::New(isolate, static_cast<int32_t>(value));
|
||||
- }
|
||||
-
|
||||
- template <>
|
||||
- v8::Local<v8::Value> ToV8SignedIntegerInternal<8>(int64_t value,
|
||||
- v8::Isolate* isolate) {
|
||||
- int32_t value_in32_bit = static_cast<int32_t>(value);
|
||||
- if (value_in32_bit == value) {
|
||||
- return v8::Integer::New(isolate, value_in32_bit);
|
||||
- }
|
||||
- // V8 doesn't have a 64-bit integer implementation.
|
||||
- return v8::Number::New(isolate, value);
|
||||
- }
|
||||
-
|
||||
- template <size_t sizeOfValue>
|
||||
- static v8::Local<v8::Value> ToV8UnsignedIntegerInternal(uint64_t value,
|
||||
- v8::Isolate*);
|
||||
-
|
||||
- template <>
|
||||
- v8::Local<v8::Value> ToV8UnsignedIntegerInternal<4>(uint64_t value,
|
||||
- v8::Isolate* isolate) {
|
||||
- return v8::Integer::NewFromUnsigned(isolate, static_cast<uint32_t>(value));
|
||||
- }
|
||||
-
|
||||
- template <>
|
||||
- v8::Local<v8::Value> ToV8UnsignedIntegerInternal<8>(uint64_t value,
|
||||
- v8::Isolate* isolate) {
|
||||
- uint32_t value_in32_bit = static_cast<uint32_t>(value);
|
||||
- if (value_in32_bit == value) {
|
||||
- return v8::Integer::NewFromUnsigned(isolate, value_in32_bit);
|
||||
- }
|
||||
- // V8 doesn't have a 64-bit integer implementation.
|
||||
- return v8::Number::New(isolate, value);
|
||||
- }
|
||||
-
|
||||
static v8::Local<v8::Value> ToV8(int32_t value,
|
||||
v8::Local<v8::Object> creation_context,
|
||||
v8::Isolate* isolate) {
|
||||
- return ToV8SignedIntegerInternal<sizeof value>(value, isolate);
|
||||
+ return v8::Integer::New(isolate, value);
|
||||
}
|
||||
|
||||
static v8::Local<v8::Value> ToV8(int64_t value,
|
||||
v8::Local<v8::Object> creation_context,
|
||||
v8::Isolate* isolate) {
|
||||
- return ToV8SignedIntegerInternal<sizeof value>(value, isolate);
|
||||
+ int32_t value_in32_bit = static_cast<int32_t>(value);
|
||||
+ if (value_in32_bit == value) {
|
||||
+ return v8::Integer::New(isolate, value_in32_bit);
|
||||
+ }
|
||||
+ // V8 doesn't have a 64-bit integer implementation.
|
||||
+ return v8::Number::New(isolate, value);
|
||||
}
|
||||
|
||||
static v8::Local<v8::Value> ToV8(uint32_t value,
|
||||
v8::Local<v8::Object> creation_context,
|
||||
v8::Isolate* isolate) {
|
||||
- return ToV8UnsignedIntegerInternal<sizeof value>(value, isolate);
|
||||
+ return v8::Integer::NewFromUnsigned(isolate, value);
|
||||
}
|
||||
|
||||
static v8::Local<v8::Value> ToV8(uint64_t value,
|
||||
v8::Local<v8::Object> creation_context,
|
||||
v8::Isolate* isolate) {
|
||||
- return ToV8UnsignedIntegerInternal<sizeof value>(value, isolate);
|
||||
+ uint32_t value_in32_bit = static_cast<uint32_t>(value);
|
||||
+ if (value_in32_bit == value) {
|
||||
+ return v8::Integer::NewFromUnsigned(isolate, value_in32_bit);
|
||||
+ }
|
||||
+ // V8 doesn't have a 64-bit integer implementation.
|
||||
+ return v8::Number::New(isolate, value);
|
||||
}
|
||||
|
||||
static v8::Local<v8::Value> ToV8(bool value,
|
||||
39
script_streamer-atomic-include.patch
Normal file
39
script_streamer-atomic-include.patch
Normal file
@@ -0,0 +1,39 @@
|
||||
From 8be4d17beb71c29118c3337268f3e7b3930a657f Mon Sep 17 00:00:00 2001
|
||||
From: Jose Dapena Paz <jdapena@igalia.com>
|
||||
Date: Tue, 26 Mar 2024 10:06:31 +0000
|
||||
Subject: [PATCH] IWYU: use regular atomic include instead of hardcoding libc++
|
||||
path
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Bug: 41455655
|
||||
Change-Id: I2f2076d533b9732d1f7ff8aea5dc027547f62347
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5373879
|
||||
Commit-Queue: José Dapena Paz <jdapena@igalia.com>
|
||||
Reviewed-by: Marja Hölttä <marja@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#1278213}
|
||||
---
|
||||
third_party/blink/renderer/bindings/core/v8/script_streamer.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/third_party/blink/renderer/bindings/core/v8/script_streamer.cc b/third_party/blink/renderer/bindings/core/v8/script_streamer.cc
|
||||
index f00f7cef4cc26..90f1ce6db12f3 100644
|
||||
--- a/third_party/blink/renderer/bindings/core/v8/script_streamer.cc
|
||||
+++ b/third_party/blink/renderer/bindings/core/v8/script_streamer.cc
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "third_party/blink/renderer/bindings/core/v8/script_streamer.h"
|
||||
|
||||
+#include <atomic>
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
@@ -60,7 +61,6 @@
|
||||
#include "third_party/blink/renderer/platform/wtf/shared_buffer.h"
|
||||
#include "third_party/blink/renderer/platform/wtf/text/string_builder.h"
|
||||
#include "third_party/blink/renderer/platform/wtf/text/text_encoding_registry.h"
|
||||
-#include "third_party/libc++/src/include/__atomic/atomic.h"
|
||||
|
||||
namespace blink {
|
||||
namespace {
|
||||
@@ -1,32 +0,0 @@
|
||||
From 4b48bc4dd6ce9c56d254e552a33a7b7c2d6fc226 Mon Sep 17 00:00:00 2001
|
||||
From: Jose Dapena Paz <jdapena@igalia.com>
|
||||
Date: Thu, 1 Feb 2024 17:01:51 +0000
|
||||
Subject: [PATCH] IWYU: usage of std::optional in
|
||||
search_engine_choice_service.h requires include
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Bug: 957519
|
||||
Change-Id: If89767ae4cd261081efda97cde6a296209b68782
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5259337
|
||||
Reviewed-by: Colin Blundell <blundell@chromium.org>
|
||||
Commit-Queue: José Dapena Paz <jdapena@igalia.com>
|
||||
Cr-Commit-Position: refs/heads/main@{#1255105}
|
||||
---
|
||||
.../search_engine_choice/search_engine_choice_service.h | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/components/search_engines/search_engine_choice/search_engine_choice_service.h b/components/search_engines/search_engine_choice/search_engine_choice_service.h
|
||||
index b84ea7ec5fc08..c9dcce4b7c833 100644
|
||||
--- a/components/search_engines/search_engine_choice/search_engine_choice_service.h
|
||||
+++ b/components/search_engines/search_engine_choice/search_engine_choice_service.h
|
||||
@@ -5,6 +5,8 @@
|
||||
#ifndef COMPONENTS_SEARCH_ENGINES_SEARCH_ENGINE_CHOICE_SEARCH_ENGINE_CHOICE_SERVICE_H_
|
||||
#define COMPONENTS_SEARCH_ENGINES_SEARCH_ENGINE_CHOICE_SEARCH_ENGINE_CHOICE_SERVICE_H_
|
||||
|
||||
+#include <optional>
|
||||
+
|
||||
#include "base/memory/raw_ref.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "components/country_codes/country_codes.h"
|
||||
@@ -5,7 +5,7 @@ Unbundle only Skia's vulkan headers. ANGLE needs the bleeding-edge ones in vulka
|
||||
@@ -11,7 +11,7 @@
|
||||
// IWYU pragma: begin_exports
|
||||
|
||||
#if SKIA_IMPLEMENTATION || !defined(SK_VULKAN)
|
||||
#if (SKIA_IMPLEMENTATION || !defined(SK_VULKAN)) && !defined(SK_USE_EXTERNAL_VULKAN_HEADERS)
|
||||
-#include "include/third_party/vulkan/vulkan/vulkan_core.h"
|
||||
+#include <vulkan/vulkan_core.h>
|
||||
#else
|
||||
@@ -14,7 +14,7 @@ Unbundle only Skia's vulkan headers. ANGLE needs the bleeding-edge ones in vulka
|
||||
@@ -21,7 +21,7 @@
|
||||
#ifdef SK_BUILD_FOR_ANDROID
|
||||
// This is needed to get android extensions for external memory
|
||||
#if SKIA_IMPLEMENTATION || !defined(SK_VULKAN)
|
||||
#if (SKIA_IMPLEMENTATION || !defined(SK_VULKAN)) && !defined(SK_USE_EXTERNAL_VULKAN_HEADERS)
|
||||
-#include "include/third_party/vulkan/vulkan/vulkan_android.h"
|
||||
+#include <vulkan/vulkan_android.h>
|
||||
#else
|
||||
|
||||
32
span_reader-missing-optional.patch
Normal file
32
span_reader-missing-optional.patch
Normal file
@@ -0,0 +1,32 @@
|
||||
From b3330cb62d7be253a5b99e40b88e2290c329ac08 Mon Sep 17 00:00:00 2001
|
||||
From: Jose Dapena Paz <jdapena@igalia.com>
|
||||
Date: Tue, 19 Mar 2024 19:05:35 +0000
|
||||
Subject: [PATCH] IWYU: missing include for std::optional usage in
|
||||
span_reader.h
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Bug: 41455655
|
||||
Change-Id: I13cc54ea91d4b02b170213e471c01fd5fc28394c
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5374258
|
||||
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
|
||||
Commit-Queue: José Dapena Paz <jdapena@igalia.com>
|
||||
Cr-Commit-Position: refs/heads/main@{#1275094}
|
||||
---
|
||||
base/containers/span_reader.h | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/base/containers/span_reader.h b/base/containers/span_reader.h
|
||||
index 6b67b436bd9c1..3f323fd57a550 100644
|
||||
--- a/base/containers/span_reader.h
|
||||
+++ b/base/containers/span_reader.h
|
||||
@@ -5,6 +5,8 @@
|
||||
#ifndef BASE_CONTAINERS_SPAN_READER_H_
|
||||
#define BASE_CONTAINERS_SPAN_READER_H_
|
||||
|
||||
+#include <optional>
|
||||
+
|
||||
#include "base/containers/span.h"
|
||||
#include "base/numerics/safe_conversions.h"
|
||||
|
||||
@@ -130,7 +130,7 @@ Unbundle assorted lexing/parsing/transpiling tools written in Python.
|
||||
--- a/mojo/public/tools/bindings/mojom.gni
|
||||
+++ b/mojo/public/tools/bindings/mojom.gni
|
||||
@@ -699,7 +699,7 @@
|
||||
allow_remote = true
|
||||
remote_worker = "large"
|
||||
custom_processor = "mojom_parser"
|
||||
script = mojom_parser_script
|
||||
- inputs = mojom_parser_sources + ply_sources + [ build_metadata_filename ]
|
||||
|
||||
32
temporal_scalability_id_extractor-missing-bitset.patch
Normal file
32
temporal_scalability_id_extractor-missing-bitset.patch
Normal file
@@ -0,0 +1,32 @@
|
||||
From 59843523390481e52d3a397687a09a7582c44114 Mon Sep 17 00:00:00 2001
|
||||
From: Jose Dapena Paz <jdapena@igalia.com>
|
||||
Date: Tue, 19 Mar 2024 17:06:46 +0000
|
||||
Subject: [PATCH] IWYU: missing include for std::bitset usage in
|
||||
temporal_scalability_id_extractor.cc
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Bug: 41455655
|
||||
Change-Id: Id0b573b23137011a82fd2a85160eae4099a96467
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5374259
|
||||
Commit-Queue: José Dapena Paz <jdapena@igalia.com>
|
||||
Reviewed-by: Dan Sanders <sandersd@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#1275008}
|
||||
---
|
||||
media/filters/temporal_scalability_id_extractor.cc | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/media/filters/temporal_scalability_id_extractor.cc b/media/filters/temporal_scalability_id_extractor.cc
|
||||
index 8d27b8b3b7a8c..67dc762b6de0c 100644
|
||||
--- a/media/filters/temporal_scalability_id_extractor.cc
|
||||
+++ b/media/filters/temporal_scalability_id_extractor.cc
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
#include "media/filters/temporal_scalability_id_extractor.h"
|
||||
|
||||
+#include <bitset>
|
||||
+
|
||||
namespace media {
|
||||
|
||||
TemporalScalabilityIdExtractor::TemporalScalabilityIdExtractor(VideoCodec codec,
|
||||
@@ -1,148 +0,0 @@
|
||||
From f62990fb134b7e610502b6804945debaa51960a5 Mon Sep 17 00:00:00 2001
|
||||
From: Koji Ishii <kojii@chromium.org>
|
||||
Date: Fri, 9 Feb 2024 18:47:02 +0000
|
||||
Subject: [PATCH] Support ICU 74 in `LazyTextBreakIterator`
|
||||
|
||||
This patch extends the `kBreakAllLineBreakClassTable` table
|
||||
for 5 new LineBreak classes in ICU 74.
|
||||
|
||||
They are for Brahmic scripts, which "line breaks can occur at
|
||||
the boundaries of any orthographic syllable"[1]. The
|
||||
`break-all` has no additional break opportunities that all
|
||||
entries are `0`.
|
||||
|
||||
This patch also adds `0` for 3 classes added in ICU 58[2],
|
||||
instead of doing so in code, to make future additions
|
||||
possible.
|
||||
|
||||
[1] https://unicode.org/reports/tr14/#BreakOpportunities
|
||||
[2] https://chromiumcodereview.appspot.com/2440923002
|
||||
|
||||
Bug: 324419151
|
||||
Change-Id: I8002edb927280f63b5b668b09076cc71feaeac3e
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5279337
|
||||
Auto-Submit: Koji Ishii <kojii@chromium.org>
|
||||
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
|
||||
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#1258643}
|
||||
---
|
||||
.../platform/text/text_break_iterator.cc | 98 ++++++++++---------
|
||||
1 file changed, 53 insertions(+), 45 deletions(-)
|
||||
|
||||
diff --git a/third_party/blink/renderer/platform/text/text_break_iterator.cc b/third_party/blink/renderer/platform/text/text_break_iterator.cc
|
||||
index 703dc2399075469..38ab94a0a460b5c 100644
|
||||
--- a/third_party/blink/renderer/platform/text/text_break_iterator.cc
|
||||
+++ b/third_party/blink/renderer/platform/text/text_break_iterator.cc
|
||||
@@ -161,11 +161,7 @@ static const unsigned char kAsciiLineBreakTable[][(kAsciiLineBreakTableLastChar
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
-#if U_ICU_VERSION_MAJOR_NUM >= 58
|
||||
-#define BA_LB_COUNT (U_LB_COUNT - 3)
|
||||
-#else
|
||||
#define BA_LB_COUNT U_LB_COUNT
|
||||
-#endif
|
||||
// Line breaking table for CSS word-break: break-all. This table differs from
|
||||
// asciiLineBreakTable in:
|
||||
// - Indices are Line Breaking Classes defined in UAX#14 Unicode Line Breaking
|
||||
@@ -174,47 +170,59 @@ static const unsigned char kAsciiLineBreakTable[][(kAsciiLineBreakTableLastChar
|
||||
// normal line break, not "prohibit break."
|
||||
// clang-format off
|
||||
static const unsigned char kBreakAllLineBreakClassTable[][BA_LB_COUNT / 8 + 1] = {
|
||||
- // XX AI AL B2 BA BB BK CB CL CM CR EX GL HY ID IN IS LF NS NU OP PO PR QU SA SG SP SY ZW NL WJ H2 H3 JL JT JV CP CJ HL RI
|
||||
- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // XX
|
||||
- { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 1, 0, 1, 0), B(1, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0) }, // AI
|
||||
- { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 1, 0, 1, 0), B(1, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0) }, // AL
|
||||
- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // B2
|
||||
- { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 1, 0, 1, 0), B(1, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0) }, // BA
|
||||
- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // BB
|
||||
- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // BK
|
||||
- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // CB
|
||||
- { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 0, 0, 1, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0) }, // CL
|
||||
- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // CM
|
||||
- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // CR
|
||||
- { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 0, 1, 1, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0) }, // EX
|
||||
- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // GL
|
||||
- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 1, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // HY
|
||||
- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // ID
|
||||
- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // IN
|
||||
- { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0) }, // IS
|
||||
- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // LF
|
||||
- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // NS
|
||||
- { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 1, 0, 1, 0), B(1, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0) }, // NU
|
||||
- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // OP
|
||||
- { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 0, 1, 1, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0) }, // PO
|
||||
- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // PR
|
||||
- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // QU
|
||||
- { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 1, 0, 1, 0), B(1, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0) }, // SA
|
||||
- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // SG
|
||||
- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // SP
|
||||
- { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 1, 0, 1, 0), B(1, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0) }, // SY
|
||||
- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // ZW
|
||||
- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // NL
|
||||
- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // WJ
|
||||
- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // H2
|
||||
- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // H3
|
||||
- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // JL
|
||||
- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // JT
|
||||
- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // JV
|
||||
- { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 0, 0, 1, 0), B(1, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0) }, // CP
|
||||
- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // CJ
|
||||
- { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 1, 0, 1, 0), B(1, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0) }, // HL
|
||||
- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // RI
|
||||
+ // XX AI AL B2 BA BB BK CB CL CM CR EX GL HY ID IN IS LF NS NU OP PO PR QU SA SG SP SY ZW NL WJ H2 H3 JL JT JV CP CJ HL RI EB EM ZWJ AK AP AS VF VI
|
||||
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // XX
|
||||
+ { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 1, 0, 1, 0), B(1, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // AI
|
||||
+ { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 1, 0, 1, 0), B(1, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // AL
|
||||
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // B2
|
||||
+ { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 1, 0, 1, 0), B(1, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // BA
|
||||
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // BB
|
||||
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // BK
|
||||
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // CB
|
||||
+ { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 0, 0, 1, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // CL
|
||||
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // CM
|
||||
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // CR
|
||||
+ { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 0, 1, 1, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // EX
|
||||
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // GL
|
||||
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 1, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // HY
|
||||
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // ID
|
||||
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // IN
|
||||
+ { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // IS
|
||||
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // LF
|
||||
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // NS
|
||||
+ { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 1, 0, 1, 0), B(1, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // NU
|
||||
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // OP
|
||||
+ { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 0, 1, 1, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // PO
|
||||
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // PR
|
||||
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // QU
|
||||
+ { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 1, 0, 1, 0), B(1, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // SA
|
||||
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // SG
|
||||
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // SP
|
||||
+ { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 1, 0, 1, 0), B(1, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // SY
|
||||
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // ZW
|
||||
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // NL
|
||||
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // WJ
|
||||
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // H2
|
||||
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // H3
|
||||
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // JL
|
||||
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // JT
|
||||
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // JV
|
||||
+ { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 0, 0, 1, 0), B(1, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // CP
|
||||
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // CJ
|
||||
+ { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 1, 0, 1, 0), B(1, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // HL
|
||||
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // RI
|
||||
+ // Added in ICU 58.
|
||||
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // EB
|
||||
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // EM
|
||||
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // ZWJ
|
||||
+#if U_ICU_VERSION_MAJOR_NUM >= 74
|
||||
+ // Added in ICU 74. https://icu.unicode.org/download/74
|
||||
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // AK
|
||||
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // AP
|
||||
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // AS
|
||||
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // VF
|
||||
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // VI
|
||||
+#endif // U_ICU_VERSION_MAJOR_NUM >= 74
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
@@ -1,164 +0,0 @@
|
||||
From d9715adf895e9acfbaf17ae05b18f2b2467ca322 Mon Sep 17 00:00:00 2001
|
||||
From: Frank Tang <ftang@chromium.org>
|
||||
Date: Tue, 20 Jun 2023 15:12:47 -0700
|
||||
Subject: [PATCH] [Intl] rm alt_calendar hack post ICU 73-1
|
||||
|
||||
Also need to bump up the required ICU version.
|
||||
|
||||
Bug: v8:14086
|
||||
Change-Id: I52a53fcd201f3272aa712123fc00c54d0b762d53
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4628805
|
||||
Reviewed-by: Shu-yu Guo <syg@chromium.org>
|
||||
Commit-Queue: Frank Tang <ftang@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#88431}
|
||||
---
|
||||
src/objects/intl-objects.h | 2 +-
|
||||
src/objects/js-date-time-format-inl.h | 2 --
|
||||
src/objects/js-date-time-format.cc | 30 +++++++--------------------
|
||||
src/objects/js-date-time-format.h | 2 --
|
||||
src/objects/js-date-time-format.tq | 8 -------
|
||||
5 files changed, 8 insertions(+), 36 deletions(-)
|
||||
|
||||
diff --git a/src/objects/intl-objects.h b/src/objects/intl-objects.h
|
||||
index 4339673d566..b628cf686f3 100644
|
||||
--- a/v8/src/objects/intl-objects.h
|
||||
+++ b/v8/src/objects/intl-objects.h
|
||||
@@ -21,7 +21,7 @@
|
||||
#include "unicode/locid.h"
|
||||
#include "unicode/uversion.h"
|
||||
|
||||
-#define V8_MINIMUM_ICU_VERSION 71
|
||||
+#define V8_MINIMUM_ICU_VERSION 73
|
||||
|
||||
namespace U_ICU_NAMESPACE {
|
||||
class BreakIterator;
|
||||
diff --git a/src/objects/js-date-time-format-inl.h b/src/objects/js-date-time-format-inl.h
|
||||
index 8c93a8eeb63..fefe081f8f5 100644
|
||||
--- a/v8/src/objects/js-date-time-format-inl.h
|
||||
+++ b/v8/src/objects/js-date-time-format-inl.h
|
||||
@@ -28,8 +28,6 @@ ACCESSORS(JSDateTimeFormat, icu_simple_date_format,
|
||||
Tagged<Managed<icu::DateIntervalFormat>>,
|
||||
kIcuDateIntervalFormatOffset)
|
||||
|
||||
-BOOL_ACCESSORS(JSDateTimeFormat, flags, alt_calendar, AltCalendarBit::kShift)
|
||||
-
|
||||
inline void JSDateTimeFormat::set_hour_cycle(HourCycle hour_cycle) {
|
||||
int hints = flags();
|
||||
hints = HourCycleBits::update(hints, hour_cycle);
|
||||
diff --git a/src/objects/js-date-time-format.cc b/src/objects/js-date-time-format.cc
|
||||
index 62d6fdcb935..6aae75c8de8 100644
|
||||
--- a/v8/src/objects/js-date-time-format.cc
|
||||
+++ b/v8/src/objects/js-date-time-format.cc
|
||||
@@ -530,8 +530,7 @@ Handle<Object> JSDateTimeFormat::TimeZoneId(Isolate* isolate,
|
||||
|
||||
namespace {
|
||||
Handle<String> GetCalendar(Isolate* isolate,
|
||||
- const icu::SimpleDateFormat& simple_date_format,
|
||||
- bool is_alt_calendar = false) {
|
||||
+ const icu::SimpleDateFormat& simple_date_format) {
|
||||
// getType() returns legacy calendar type name instead of LDML/BCP47 calendar
|
||||
// key values. intl.js maps them to BCP47 values for key "ca".
|
||||
// TODO(jshin): Consider doing it here, instead.
|
||||
@@ -542,17 +541,9 @@ Handle<String> GetCalendar(Isolate* isolate,
|
||||
// and
|
||||
// http://www.unicode.org/repos/cldr/tags/latest/common/bcp47/calendar.xml
|
||||
if (calendar_str == "gregorian") {
|
||||
- if (is_alt_calendar) {
|
||||
- calendar_str = "iso8601";
|
||||
- } else {
|
||||
- calendar_str = "gregory";
|
||||
- }
|
||||
+ calendar_str = "gregory";
|
||||
} else if (calendar_str == "ethiopic-amete-alem") {
|
||||
calendar_str = "ethioaa";
|
||||
- } else if (calendar_str == "islamic") {
|
||||
- if (is_alt_calendar) {
|
||||
- calendar_str = "islamic-rgsa";
|
||||
- }
|
||||
}
|
||||
return isolate->factory()->NewStringFromAsciiChecked(calendar_str.c_str());
|
||||
}
|
||||
@@ -567,8 +558,7 @@ Handle<Object> GetTimeZone(Isolate* isolate,
|
||||
Handle<String> JSDateTimeFormat::Calendar(
|
||||
Isolate* isolate, Handle<JSDateTimeFormat> date_time_format) {
|
||||
return GetCalendar(isolate,
|
||||
- *(date_time_format->icu_simple_date_format()->raw()),
|
||||
- date_time_format->alt_calendar());
|
||||
+ *(date_time_format->icu_simple_date_format()->raw()));
|
||||
}
|
||||
|
||||
Handle<Object> JSDateTimeFormat::TimeZone(
|
||||
@@ -2328,9 +2318,6 @@ MaybeHandle<JSDateTimeFormat> JSDateTimeFormat::New(
|
||||
icu_locale.setUnicodeKeywordValue("ca", calendar_str.get(), status);
|
||||
DCHECK(U_SUCCESS(status));
|
||||
}
|
||||
- bool alt_calendar =
|
||||
- strstr(icu_locale.getName(), "calendar=iso8601") != nullptr ||
|
||||
- strstr(icu_locale.getName(), "calendar=islamic-rgsa") != nullptr;
|
||||
|
||||
if (numbering_system_str != nullptr &&
|
||||
Intl::IsValidNumberingSystem(numbering_system_str.get())) {
|
||||
@@ -2640,7 +2627,6 @@ MaybeHandle<JSDateTimeFormat> JSDateTimeFormat::New(
|
||||
date_time_format->set_time_style(time_style);
|
||||
}
|
||||
date_time_format->set_hour_cycle(dateTimeFormatHourCycle);
|
||||
- date_time_format->set_alt_calendar(alt_calendar);
|
||||
date_time_format->set_locale(*locale_str);
|
||||
date_time_format->set_icu_locale(*managed_locale);
|
||||
date_time_format->set_icu_simple_date_format(*managed_format);
|
||||
@@ -2742,10 +2728,8 @@ MaybeHandle<JSArray> FormatToPartsWithTemporalSupport(
|
||||
DateTimeValueRecord x_record;
|
||||
MAYBE_ASSIGN_RETURN_ON_EXCEPTION_VALUE(
|
||||
isolate, x_record,
|
||||
- HandleDateTimeValue(
|
||||
- isolate, *format,
|
||||
- GetCalendar(isolate, *format, date_time_format->alt_calendar()), x,
|
||||
- method_name),
|
||||
+ HandleDateTimeValue(isolate, *format, GetCalendar(isolate, *format), x,
|
||||
+ method_name),
|
||||
Handle<JSArray>());
|
||||
|
||||
return FormatMillisecondsByKindToArray(isolate, *format, x_record.kind,
|
||||
@@ -3070,8 +3054,8 @@ MaybeHandle<T> FormatRangeCommonWithTemporalSupport(
|
||||
// 6. Let x be ? HandleDateTimeValue(dateTimeFormat, x).
|
||||
icu::SimpleDateFormat* icu_simple_date_format =
|
||||
date_time_format->icu_simple_date_format()->raw();
|
||||
- Handle<String> date_time_format_calendar = GetCalendar(
|
||||
- isolate, *icu_simple_date_format, date_time_format->alt_calendar());
|
||||
+ Handle<String> date_time_format_calendar =
|
||||
+ GetCalendar(isolate, *icu_simple_date_format);
|
||||
DateTimeValueRecord x_record;
|
||||
MAYBE_ASSIGN_RETURN_ON_EXCEPTION_VALUE(
|
||||
isolate, x_record,
|
||||
diff --git a/src/objects/js-date-time-format.h b/src/objects/js-date-time-format.h
|
||||
index cdf87c2268a..ceebcc5e8f9 100644
|
||||
--- a/v8/src/objects/js-date-time-format.h
|
||||
+++ b/v8/src/objects/js-date-time-format.h
|
||||
@@ -150,8 +150,6 @@ class JSDateTimeFormat
|
||||
DECL_ACCESSORS(icu_simple_date_format, Managed<icu::SimpleDateFormat>)
|
||||
DECL_ACCESSORS(icu_date_interval_format, Managed<icu::DateIntervalFormat>)
|
||||
|
||||
- DECL_BOOLEAN_ACCESSORS(alt_calendar)
|
||||
-
|
||||
DECL_PRINTER(JSDateTimeFormat)
|
||||
|
||||
TQ_OBJECT_CONSTRUCTORS(JSDateTimeFormat)
|
||||
diff --git a/src/objects/js-date-time-format.tq b/src/objects/js-date-time-format.tq
|
||||
index ef0584e7901..6fab20c71d1 100644
|
||||
--- a/v8/src/objects/js-date-time-format.tq
|
||||
+++ b/v8/src/objects/js-date-time-format.tq
|
||||
@@ -10,14 +10,6 @@ bitfield struct JSDateTimeFormatFlags extends uint31 {
|
||||
hour_cycle: HourCycle: 3 bit;
|
||||
date_style: DateTimeStyle: 3 bit;
|
||||
time_style: DateTimeStyle: 3 bit;
|
||||
- // ICU report the same type "gregorian" for both "gregorian" calendar and
|
||||
- // "iso8601" calendar and the same type "islamic" for both "islamic" and
|
||||
- // "islamic-rgsa" calendar. We use the alt_calendar bit to distinguish between
|
||||
- // them. When the type is "gregorian" and the alt_calendar bit is set, it is
|
||||
- // "iso8601", otherwise the true "gregorian" calendar. While the type is
|
||||
- // "islamic" and the alt_calendar bit is set, it is "islamic-rgsa" calendar,
|
||||
- // otherwise "islamic" calendar.
|
||||
- alt_calendar: bool: 1bit;
|
||||
}
|
||||
|
||||
extern class JSDateTimeFormat extends JSObject {
|
||||
@@ -1,194 +0,0 @@
|
||||
From 572b80f2e906a826a499c4c5561b90b97a687f0e Mon Sep 17 00:00:00 2001
|
||||
From: pthier <pthier@chromium.org>
|
||||
Date: Tue, 18 Jul 2023 16:27:28 +0200
|
||||
Subject: [PATCH] [regexp] Remove special handling for simple case folding
|
||||
|
||||
ICU 73 introduced creating closures using simple case folding.
|
||||
We can directly use this method instead of our own special handling where simple case folding (required by JS spec) differs from full case
|
||||
folding (the previously only supported mode in ICU).
|
||||
|
||||
Bug: v8:13377
|
||||
Change-Id: I42bbcc37fe5c1f33a1d6c36f0d4ceb18a67a9b43
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4694009
|
||||
Commit-Queue: Patrick Thier <pthier@chromium.org>
|
||||
Reviewed-by: Jakob Linke <jgruber@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#89024}
|
||||
---
|
||||
src/regexp/gen-regexp-special-case.cc | 48 ---------------------------
|
||||
src/regexp/regexp-ast.h | 6 ----
|
||||
src/regexp/regexp-compiler-tonode.cc | 24 +-------------
|
||||
src/regexp/regexp-parser.cc | 2 +-
|
||||
src/regexp/special-case.h | 10 ------
|
||||
5 files changed, 2 insertions(+), 88 deletions(-)
|
||||
|
||||
diff --git a/src/regexp/gen-regexp-special-case.cc b/src/regexp/gen-regexp-special-case.cc
|
||||
index 55618f11783..86f6b212c93 100644
|
||||
--- a/v8/src/regexp/gen-regexp-special-case.cc
|
||||
+++ b/v8/src/regexp/gen-regexp-special-case.cc
|
||||
@@ -9,7 +9,6 @@
|
||||
|
||||
#include "src/base/strings.h"
|
||||
#include "src/regexp/special-case.h"
|
||||
-#include "unicode/usetiter.h"
|
||||
|
||||
namespace v8 {
|
||||
namespace internal {
|
||||
@@ -127,52 +126,6 @@ void PrintSpecial(std::ofstream& out) {
|
||||
PrintSet(out, "SpecialAddSet", special_add);
|
||||
}
|
||||
|
||||
-void PrintUnicodeSpecial(std::ofstream& out) {
|
||||
- icu::UnicodeSet non_simple_folding;
|
||||
- icu::UnicodeSet current;
|
||||
- UErrorCode status = U_ZERO_ERROR;
|
||||
- // Look at all characters except white spaces.
|
||||
- icu::UnicodeSet interestingCP(u"[^[:White_Space:]]", status);
|
||||
- CHECK_EQ(status, U_ZERO_ERROR);
|
||||
- icu::UnicodeSetIterator iter(interestingCP);
|
||||
- while (iter.next()) {
|
||||
- UChar32 c = iter.getCodepoint();
|
||||
- current.set(c, c);
|
||||
- current.closeOver(USET_CASE_INSENSITIVE).removeAllStrings();
|
||||
- CHECK(!current.isBogus());
|
||||
- // Remove characters from the closeover that have a simple case folding.
|
||||
- icu::UnicodeSet toRemove;
|
||||
- icu::UnicodeSetIterator closeOverIter(current);
|
||||
- while (closeOverIter.next()) {
|
||||
- UChar32 closeOverChar = closeOverIter.getCodepoint();
|
||||
- UChar32 closeOverSCF = u_foldCase(closeOverChar, U_FOLD_CASE_DEFAULT);
|
||||
- if (closeOverChar != closeOverSCF) {
|
||||
- toRemove.add(closeOverChar);
|
||||
- }
|
||||
- }
|
||||
- CHECK(!toRemove.isBogus());
|
||||
- current.removeAll(toRemove);
|
||||
-
|
||||
- // The current character and its simple case folding are also always OK.
|
||||
- UChar32 scf = u_foldCase(c, U_FOLD_CASE_DEFAULT);
|
||||
- current.remove(c);
|
||||
- current.remove(scf);
|
||||
-
|
||||
- // If there are any characters remaining, they were added due to full case
|
||||
- // foldings and shouldn't match the current charcter according to the spec.
|
||||
- if (!current.isEmpty()) {
|
||||
- // Ensure that the character doesn't have a simple case folding.
|
||||
- // Otherwise the current approach of simply removing the character from
|
||||
- // the set before calling closeOver won't work.
|
||||
- CHECK_EQ(c, scf);
|
||||
- non_simple_folding.add(c);
|
||||
- }
|
||||
- }
|
||||
- CHECK(!non_simple_folding.isBogus());
|
||||
-
|
||||
- PrintSet(out, "UnicodeNonSimpleCloseOverSet", non_simple_folding);
|
||||
-}
|
||||
-
|
||||
void WriteHeader(const char* header_filename) {
|
||||
std::ofstream out(header_filename);
|
||||
out << std::hex << std::setfill('0') << std::setw(4);
|
||||
@@ -193,7 +146,6 @@ void WriteHeader(const char* header_filename) {
|
||||
<< "namespace internal {\n\n";
|
||||
|
||||
PrintSpecial(out);
|
||||
- PrintUnicodeSpecial(out);
|
||||
|
||||
out << "\n"
|
||||
<< "} // namespace internal\n"
|
||||
diff --git a/src/regexp/regexp-ast.h b/src/regexp/regexp-ast.h
|
||||
index e7453ad3f8f..8e3bb12fce2 100644
|
||||
--- a/v8/src/regexp/regexp-ast.h
|
||||
+++ b/v8/src/regexp/regexp-ast.h
|
||||
@@ -134,12 +134,6 @@ class CharacterRange {
|
||||
static void AddUnicodeCaseEquivalents(ZoneList<CharacterRange>* ranges,
|
||||
Zone* zone);
|
||||
|
||||
-#ifdef V8_INTL_SUPPORT
|
||||
- // Creates the closeOver of the given UnicodeSet, removing all
|
||||
- // characters/strings that can't be derived via simple case folding.
|
||||
- static void UnicodeSimpleCloseOver(icu::UnicodeSet& set);
|
||||
-#endif // V8_INTL_SUPPORT
|
||||
-
|
||||
bool Contains(base::uc32 i) const { return from_ <= i && i <= to_; }
|
||||
base::uc32 from() const { return from_; }
|
||||
base::uc32 to() const { return to_; }
|
||||
diff --git a/src/regexp/regexp-compiler-tonode.cc b/src/regexp/regexp-compiler-tonode.cc
|
||||
index 5ff16ee71d2..9c83e2332e8 100644
|
||||
--- a/v8/src/regexp/regexp-compiler-tonode.cc
|
||||
+++ b/v8/src/regexp/regexp-compiler-tonode.cc
|
||||
@@ -423,27 +423,6 @@ RegExpNode* UnanchoredAdvance(RegExpCompiler* compiler,
|
||||
|
||||
} // namespace
|
||||
|
||||
-#ifdef V8_INTL_SUPPORT
|
||||
-// static
|
||||
-void CharacterRange::UnicodeSimpleCloseOver(icu::UnicodeSet& set) {
|
||||
- // Remove characters for which closeOver() adds full-case-folding equivalents
|
||||
- // because we should work only with simple case folding mappings.
|
||||
- icu::UnicodeSet non_simple = icu::UnicodeSet(set);
|
||||
- non_simple.retainAll(RegExpCaseFolding::UnicodeNonSimpleCloseOverSet());
|
||||
- set.removeAll(non_simple);
|
||||
-
|
||||
- set.closeOver(USET_CASE_INSENSITIVE);
|
||||
- // Full case folding maps single characters to multiple characters.
|
||||
- // Those are represented as strings in the set. Remove them so that
|
||||
- // we end up with only simple and common case mappings.
|
||||
- set.removeAllStrings();
|
||||
-
|
||||
- // Add characters that have non-simple case foldings again (they match
|
||||
- // themselves).
|
||||
- set.addAll(non_simple);
|
||||
-}
|
||||
-#endif // V8_INTL_SUPPORT
|
||||
-
|
||||
// static
|
||||
void CharacterRange::AddUnicodeCaseEquivalents(ZoneList<CharacterRange>* ranges,
|
||||
Zone* zone) {
|
||||
@@ -465,8 +444,7 @@ void CharacterRange::AddUnicodeCaseEquivalents(ZoneList<CharacterRange>* ranges,
|
||||
}
|
||||
// Clear the ranges list without freeing the backing store.
|
||||
ranges->Rewind(0);
|
||||
-
|
||||
- UnicodeSimpleCloseOver(set);
|
||||
+ set.closeOver(USET_SIMPLE_CASE_INSENSITIVE);
|
||||
for (int i = 0; i < set.getRangeCount(); i++) {
|
||||
ranges->Add(Range(set.getRangeStart(i), set.getRangeEnd(i)), zone);
|
||||
}
|
||||
diff --git a/src/regexp/regexp-parser.cc b/src/regexp/regexp-parser.cc
|
||||
index 76ca02bf240..730dfb9da86 100644
|
||||
--- a/v8/src/regexp/regexp-parser.cc
|
||||
+++ b/v8/src/regexp/regexp-parser.cc
|
||||
@@ -1897,7 +1897,7 @@ bool LookupPropertyValueName(UProperty property,
|
||||
ExtractStringsFromUnicodeSet(set, result_strings, flags, zone);
|
||||
}
|
||||
const bool needs_case_folding = IsUnicodeSets(flags) && IsIgnoreCase(flags);
|
||||
- if (needs_case_folding) CharacterRange::UnicodeSimpleCloseOver(set);
|
||||
+ if (needs_case_folding) set.closeOver(USET_SIMPLE_CASE_INSENSITIVE);
|
||||
set.removeAllStrings();
|
||||
if (negate) set.complement();
|
||||
for (int i = 0; i < set.getRangeCount(); i++) {
|
||||
diff --git a/src/regexp/special-case.h b/src/regexp/special-case.h
|
||||
index c80b94e976a..753c9231ede 100644
|
||||
--- a/v8/src/regexp/special-case.h
|
||||
+++ b/v8/src/regexp/special-case.h
|
||||
@@ -71,21 +71,11 @@ namespace internal {
|
||||
// another character. Characters that match no other characters in
|
||||
// their equivalence class are added to IgnoreSet. Characters that
|
||||
// match at least one other character are added to SpecialAddSet.
|
||||
-//
|
||||
-// For unicode ignoreCase ("iu" and "iv"),
|
||||
-// UnicodeSet::closeOver(USET_CASE_INSENSITIVE) adds all characters that are in
|
||||
-// the same equivalence class. This includes characaters that are in the same
|
||||
-// equivalence class using full case folding. According to the spec, only
|
||||
-// simple case folding shall be considered. We therefore create
|
||||
-// UnicodeNonSimpleCloseOverSet containing all characters for which
|
||||
-// UnicodeSet::closeOver adds characters that are not simple case folds. This
|
||||
-// set should be used similar to IgnoreSet described above.
|
||||
|
||||
class RegExpCaseFolding final : public AllStatic {
|
||||
public:
|
||||
static const icu::UnicodeSet& IgnoreSet();
|
||||
static const icu::UnicodeSet& SpecialAddSet();
|
||||
- static const icu::UnicodeSet& UnicodeNonSimpleCloseOverSet();
|
||||
|
||||
// This implements ECMAScript 2020 21.2.2.8.2 (Runtime Semantics:
|
||||
// Canonicalize) step 3, which is used to determine whether
|
||||
@@ -1,45 +0,0 @@
|
||||
--- src/v8/src/objects/instance-type-inl.h.orig 2024-02-21 13:34:15.959879700 +0000
|
||||
+++ src/v8/src/objects/instance-type-inl.h 2024-02-25 13:47:34.748156000 +0000
|
||||
@@ -71,7 +71,9 @@ constexpr bool kHasUniqueMapOfInstanceTy
|
||||
|
||||
template <InstanceType type>
|
||||
constexpr RootIndex kUniqueMapOfInstanceType =
|
||||
- UniqueMapOfInstanceType(type).value_or(RootIndex::kRootListLength);
|
||||
+ kHasUniqueMapOfInstanceType<type>?
|
||||
+ *UniqueMapOfInstanceType(type):
|
||||
+ RootIndex::kRootListLength;
|
||||
|
||||
// Manually curated list of instance type ranges which are associated with a
|
||||
// unique range of map addresses on the read only heap. Both ranges are
|
||||
@@ -129,14 +131,17 @@ UniqueMapRangeOfInstanceTypeRange(Instan
|
||||
return {};
|
||||
}
|
||||
|
||||
+constexpr inline TaggedAddressRange NULL_ADDRESS_RANGE{kNullAddress, kNullAddress};
|
||||
+
|
||||
template <InstanceType first, InstanceType last>
|
||||
constexpr bool kHasUniqueMapRangeOfInstanceTypeRange =
|
||||
UniqueMapRangeOfInstanceTypeRange(first, last).has_value();
|
||||
|
||||
template <InstanceType first, InstanceType last>
|
||||
constexpr TaggedAddressRange kUniqueMapRangeOfInstanceTypeRange =
|
||||
- UniqueMapRangeOfInstanceTypeRange(first, last)
|
||||
- .value_or(TaggedAddressRange(kNullAddress, kNullAddress));
|
||||
+ kHasUniqueMapRangeOfInstanceTypeRange<first, last>?
|
||||
+ *UniqueMapRangeOfInstanceTypeRange(first, last):
|
||||
+ NULL_ADDRESS_RANGE;
|
||||
|
||||
inline constexpr base::Optional<TaggedAddressRange>
|
||||
UniqueMapRangeOfInstanceType(InstanceType type) {
|
||||
@@ -149,8 +154,9 @@ constexpr bool kHasUniqueMapRangeOfInsta
|
||||
|
||||
template <InstanceType type>
|
||||
constexpr TaggedAddressRange kUniqueMapRangeOfInstanceType =
|
||||
- UniqueMapRangeOfInstanceType(type).value_or(
|
||||
- TaggedAddressRange(kNullAddress, kNullAddress));
|
||||
+ kHasUniqueMapRangeOfInstanceType<type>?
|
||||
+ *UniqueMapRangeOfInstanceType(type):
|
||||
+ NULL_ADDRESS_RANGE;
|
||||
|
||||
inline bool MayHaveMapCheckFastCase(InstanceType type) {
|
||||
if (UniqueMapOfInstanceType(type)) return true;
|
||||
42
v8-strict-aliasing.patch
Normal file
42
v8-strict-aliasing.patch
Normal file
@@ -0,0 +1,42 @@
|
||||
Work around numerous type confusion bugs in V8 due to GCC14 being much more aggressive about misoptimizing them
|
||||
|
||||
Example crash (relibly happens during building electron inside mksnapshot):
|
||||
|
||||
#0 v8::internal::compiler::CFGBuilder::CollectSuccessorBlocks () at ../../v8/src/compiler/scheduler.cc:435
|
||||
#1 v8::internal::compiler::CFGBuilder::ConnectCall () at ../../v8/src/compiler/scheduler.cc:451
|
||||
#2 v8::internal::compiler::CFGBuilder::ConnectBlocks () at ../../v8/src/compiler/scheduler.cc:402
|
||||
#3 v8::internal::compiler::CFGBuilder::ConnectBlocks (this=0x55b3d1fc26a8, node=0x55b3d1fb6508) at ../../v8/src/compiler/scheduler.cc:365
|
||||
#4 0x000055b3d0b6b05f in v8::internal::compiler::CFGBuilder::Run () at ../../v8/src/compiler/scheduler.cc:268
|
||||
#5 v8::internal::compiler::Scheduler::BuildCFG (this=0x7ffd856fb860) at ../../v8/src/compiler/scheduler.cc:633
|
||||
#6 0x000055b3d0b6f692 in v8::internal::compiler::Scheduler::ComputeSchedule (zone=0x55b3d1fa4100, graph=0x1070, flags=..., tick_counter=0x7ffd856fbfa0, profile_data=0x0) at ../../v8/src/compiler/scheduler.cc:64
|
||||
#7 0x000055b3d0b3f3fb in v8::internal::compiler::ComputeSchedulePhase::Run () at ../../v8/src/compiler/pipeline.cc:1805
|
||||
#8 v8::internal::compiler::PipelineImpl::Run<v8::internal::compiler::ComputeSchedulePhase> () at ../../v8/src/compiler/pipeline.cc:775
|
||||
#9 v8::internal::compiler::PipelineImpl::ComputeScheduledGraph (this=0x7ffd856fc3b0) at ../../v8/src/compiler/pipeline.cc:3869
|
||||
#10 0x000055b3d0b4b8e6 in v8::internal::compiler::Pipeline::GenerateCodeForCodeStub (isolate=0x55b3d1ac7700 <v8::internal::compiler::(anonymous namespace)::GetCommonOperatorGlobalCache()::object+288>, call_descriptor=0x55b3d1fb6b48,
|
||||
graph=0x7ffd856fbd30, jsgraph=0x7ffd856fbc88, source_positions=0x7ffd856fc090, kind=2, debug_name=0x55b3d1752b49 "V8.TFCSAOptimization", builtin=13, options=..., profile_data=0x0) at ../../v8/src/compiler/pipeline.cc:2951
|
||||
#11 0x000055b3d0a003a9 in v8::internal::compiler::CodeAssembler::GenerateCode (state=0x7ffd856fd180, options=..., profile_data=0x0) at ../../v8/src/compiler/code-assembler.cc:175
|
||||
#12 0x000055b3d0d8703d in BuildWithCodeStubAssemblerCS (isolate=0x55b3d1f19000, builtin=13, generator=0x0, interface_descriptor=3, name=0x7ffd856fd120 "\001") at ../../v8/src/builtins/setup-builtins-internal.cc:213
|
||||
#13 0x000055b3d0d87440 in v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal (isolate=0x55b3d1f19000) at ../../v8/src/builtins/setup-builtins-internal.cc:373
|
||||
#14 0x000055b3d1726a05 in v8::internal::SetupIsolateDelegate::SetupBuiltins () at ../../v8/src/init/setup-isolate-full.cc:29
|
||||
#15 v8::internal::Isolate::Init(v8::internal::SnapshotData*, v8::internal::SnapshotData*, v8::internal::SnapshotData*, bool) [clone .isra.0] () at ../../v8/src/execution/isolate.cc:4857
|
||||
#16 0x000055b3d0503632 in v8::internal::Isolate::InitWithoutSnapshot () at ../../v8/src/execution/isolate.cc:4366
|
||||
#17 v8::internal::SnapshotCreatorImpl::InitInternal (this=0x55b3d1f2d660, blob=0x0) at ../../v8/src/snapshot/snapshot.cc:868
|
||||
#18 0x000055b3d009c347 in v8::internal::SnapshotCreatorImpl::SnapshotCreatorImpl () at ../../v8/src/snapshot/snapshot.cc:929
|
||||
#19 v8::SnapshotCreator::SnapshotCreator () at ../../v8/src/api/api.cc:557
|
||||
#20 main (argc=-777226496, argc@entry=14, argv=0x55b3d1fb6b48, argv@entry=0x7ffd85718da8) at ../../v8/src/snapshot/mksnapshot.cc:293
|
||||
#21 0x00007f26f162a340 in __libc_start_call_main (main=main@entry=0x55b3d009b0c0 <main(int, char**)>, argc=argc@entry=14, argv=argv@entry=0x7ffd85718da8) at ../sysdeps/nptl/libc_start_call_main.h:58
|
||||
#22 0x00007f26f162a409 in __libc_start_main_impl (main=0x55b3d009b0c0 <main(int, char**)>, argc=14, argv=0x7ffd85718da8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffd85718d98)
|
||||
at ../csu/libc-start.c:360
|
||||
#23 0x000055b3d009df75 in _start () at ../sysdeps/x86_64/start.S:115
|
||||
|
||||
|
||||
--- src/v8/BUILD.gn.old
|
||||
+++ src/v8/BUILD.gn
|
||||
@@ -775,6 +775,7 @@ config("internal_config") {
|
||||
libs = [ "atomic" ]
|
||||
}
|
||||
}
|
||||
+ cflags = ["-fno-ipa-strict-aliasing"]
|
||||
}
|
||||
|
||||
# Should be applied to all targets that write trace events.
|
||||
@@ -378,265 +378,6 @@ index 31e61aff6010b..419801f0257a3 100644
|
||||
void SetZcrCursorShapes(std::unique_ptr<WaylandZcrCursorShapes> obj) {
|
||||
impl_->zcr_cursor_shapes_ = std::move(obj);
|
||||
}
|
||||
diff --git a/ui/ozone/platform/wayland/host/wayland_cursor_shape.cc b/ui/ozone/platform/wayland/host/wayland_cursor_shape.cc
|
||||
new file mode 100644
|
||||
index 0000000000000..e9b6f0c678c03
|
||||
--- /dev/null
|
||||
+++ b/ui/ozone/platform/wayland/host/wayland_cursor_shape.cc
|
||||
@@ -0,0 +1,194 @@
|
||||
+// Copyright 2024 The Chromium Authors
|
||||
+// Use of this source code is governed by a BSD-style license that can be
|
||||
+// found in the LICENSE file.
|
||||
+
|
||||
+#include "ui/ozone/platform/wayland/host/wayland_cursor_shape.h"
|
||||
+
|
||||
+#include <cursor-shape-v1-client-protocol.h>
|
||||
+
|
||||
+#include "base/check.h"
|
||||
+#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
+#include "ui/base/cursor/mojom/cursor_type.mojom-shared.h"
|
||||
+#include "ui/gfx/native_widget_types.h"
|
||||
+#include "ui/ozone/platform/wayland/host/wayland_connection.h"
|
||||
+#include "ui/ozone/platform/wayland/host/wayland_pointer.h"
|
||||
+#include "ui/ozone/platform/wayland/host/wayland_seat.h"
|
||||
+
|
||||
+namespace ui {
|
||||
+
|
||||
+namespace {
|
||||
+constexpr uint32_t kMinVersion = 1;
|
||||
+}
|
||||
+
|
||||
+using mojom::CursorType;
|
||||
+
|
||||
+// static
|
||||
+constexpr char WaylandCursorShape::kInterfaceName[];
|
||||
+
|
||||
+// static
|
||||
+void WaylandCursorShape::Instantiate(WaylandConnection* connection,
|
||||
+ wl_registry* registry,
|
||||
+ uint32_t name,
|
||||
+ const std::string& interface,
|
||||
+ uint32_t version) {
|
||||
+ CHECK_EQ(interface, kInterfaceName) << "Expected \"" << kInterfaceName
|
||||
+ << "\" but got \"" << interface << "\"";
|
||||
+
|
||||
+ if (connection->cursor_shape_ ||
|
||||
+ !wl::CanBind(interface, version, kMinVersion, kMinVersion)) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ auto cursor_shape_manager =
|
||||
+ wl::Bind<wp_cursor_shape_manager_v1>(registry, name, kMinVersion);
|
||||
+ if (!cursor_shape_manager) {
|
||||
+ LOG(ERROR) << "Failed to bind wp_cursor_shape_manager_v1";
|
||||
+ return;
|
||||
+ }
|
||||
+ connection->cursor_shape_ = std::make_unique<WaylandCursorShape>(
|
||||
+ cursor_shape_manager.release(), connection);
|
||||
+}
|
||||
+
|
||||
+WaylandCursorShape::WaylandCursorShape(wp_cursor_shape_manager_v1* cursor_shape,
|
||||
+ WaylandConnection* connection)
|
||||
+ : wp_cursor_shape_manager_v1_(cursor_shape), connection_(connection) {
|
||||
+ // |wp_cursor_shape_manager_v1_| and |connection_| may be null in tests.
|
||||
+}
|
||||
+
|
||||
+WaylandCursorShape::~WaylandCursorShape() = default;
|
||||
+
|
||||
+wp_cursor_shape_device_v1* WaylandCursorShape::GetShapeDevice() {
|
||||
+ DCHECK(connection_->seat()->pointer());
|
||||
+
|
||||
+ if (!wp_cursor_shape_device_v1_.get()) {
|
||||
+ wl_pointer* pointer = connection_->seat()->pointer()->wl_object();
|
||||
+ wp_cursor_shape_device_v1_.reset(wp_cursor_shape_manager_v1_get_pointer(
|
||||
+ wp_cursor_shape_manager_v1_.get(), pointer));
|
||||
+ }
|
||||
+ DCHECK(wp_cursor_shape_device_v1_);
|
||||
+ return wp_cursor_shape_device_v1_.get();
|
||||
+}
|
||||
+
|
||||
+// static
|
||||
+absl::optional<uint32_t> WaylandCursorShape::ShapeFromType(CursorType type) {
|
||||
+ switch (type) {
|
||||
+ case CursorType::kNull:
|
||||
+ // kNull is an alias for kPointer. Fall through.
|
||||
+ case CursorType::kPointer:
|
||||
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_DEFAULT;
|
||||
+ case CursorType::kCross:
|
||||
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_CROSSHAIR;
|
||||
+ case CursorType::kHand:
|
||||
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_POINTER;
|
||||
+ case CursorType::kIBeam:
|
||||
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_TEXT;
|
||||
+ case CursorType::kWait:
|
||||
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_WAIT;
|
||||
+ case CursorType::kHelp:
|
||||
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_HELP;
|
||||
+ case CursorType::kEastResize:
|
||||
+ case CursorType::kEastPanning:
|
||||
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_E_RESIZE;
|
||||
+ case CursorType::kNorthResize:
|
||||
+ case CursorType::kNorthPanning:
|
||||
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_N_RESIZE;
|
||||
+ case CursorType::kNorthEastResize:
|
||||
+ case CursorType::kNorthEastPanning:
|
||||
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NE_RESIZE;
|
||||
+ case CursorType::kNorthWestResize:
|
||||
+ case CursorType::kNorthWestPanning:
|
||||
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NW_RESIZE;
|
||||
+ case CursorType::kSouthResize:
|
||||
+ case CursorType::kSouthPanning:
|
||||
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_S_RESIZE;
|
||||
+ case CursorType::kSouthEastResize:
|
||||
+ case CursorType::kSouthEastPanning:
|
||||
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_SE_RESIZE;
|
||||
+ case CursorType::kSouthWestResize:
|
||||
+ case CursorType::kSouthWestPanning:
|
||||
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_SW_RESIZE;
|
||||
+ case CursorType::kWestResize:
|
||||
+ case CursorType::kWestPanning:
|
||||
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_W_RESIZE;
|
||||
+ case CursorType::kNorthSouthResize:
|
||||
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NS_RESIZE;
|
||||
+ case CursorType::kEastWestResize:
|
||||
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_EW_RESIZE;
|
||||
+ case CursorType::kNorthEastSouthWestResize:
|
||||
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NESW_RESIZE;
|
||||
+ case CursorType::kNorthWestSouthEastResize:
|
||||
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NWSE_RESIZE;
|
||||
+ case CursorType::kColumnResize:
|
||||
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_COL_RESIZE;
|
||||
+ case CursorType::kRowResize:
|
||||
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ROW_RESIZE;
|
||||
+ case CursorType::kMove:
|
||||
+ // Returning `MOVE` is the correct thing here, but Blink does not make a
|
||||
+ // distinction between move and all-scroll. Other platforms use a cursor
|
||||
+ // more consistent with all-scroll, so use that.
|
||||
+ case CursorType::kMiddlePanning:
|
||||
+ case CursorType::kMiddlePanningVertical:
|
||||
+ case CursorType::kMiddlePanningHorizontal:
|
||||
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ALL_SCROLL;
|
||||
+ case CursorType::kVerticalText:
|
||||
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_VERTICAL_TEXT;
|
||||
+ case CursorType::kCell:
|
||||
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_CELL;
|
||||
+ case CursorType::kContextMenu:
|
||||
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_CONTEXT_MENU;
|
||||
+ case CursorType::kAlias:
|
||||
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ALIAS;
|
||||
+ case CursorType::kProgress:
|
||||
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_PROGRESS;
|
||||
+ case CursorType::kNoDrop:
|
||||
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NO_DROP;
|
||||
+ case CursorType::kCopy:
|
||||
+ case CursorType::kDndCopy:
|
||||
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_COPY;
|
||||
+ case CursorType::kNone:
|
||||
+ // To be cleared through wl_pointer.set_cursor.
|
||||
+ return absl::nullopt;
|
||||
+ case CursorType::kNotAllowed:
|
||||
+ case CursorType::kNorthSouthNoResize:
|
||||
+ case CursorType::kEastWestNoResize:
|
||||
+ case CursorType::kNorthEastSouthWestNoResize:
|
||||
+ case CursorType::kNorthWestSouthEastNoResize:
|
||||
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NOT_ALLOWED;
|
||||
+ case CursorType::kZoomIn:
|
||||
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ZOOM_IN;
|
||||
+ case CursorType::kZoomOut:
|
||||
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ZOOM_OUT;
|
||||
+ case CursorType::kGrab:
|
||||
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_GRAB;
|
||||
+ case CursorType::kGrabbing:
|
||||
+ case CursorType::kDndNone:
|
||||
+ case CursorType::kDndMove:
|
||||
+ case CursorType::kDndLink:
|
||||
+ // For drag-and-drop, the compositor knows the drag type and can use it to
|
||||
+ // additionally decorate the cursor.
|
||||
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_GRABBING;
|
||||
+ case CursorType::kCustom:
|
||||
+ // "Custom" means a bitmap cursor, which cannot use the shape API.
|
||||
+ return absl::nullopt;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void WaylandCursorShape::SetCursorShape(uint32_t shape) {
|
||||
+ DCHECK(connection_->seat());
|
||||
+
|
||||
+ // Nothing to do if there is no pointer (mouse) connected.
|
||||
+ if (!connection_->seat()->pointer()) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ auto pointer_enter_serial =
|
||||
+ connection_->serial_tracker().GetSerial(wl::SerialType::kMouseEnter);
|
||||
+ if (!pointer_enter_serial) {
|
||||
+ VLOG(1) << "Failed to set cursor shape: no mouse enter serial found.";
|
||||
+ return;
|
||||
+ }
|
||||
+ wp_cursor_shape_device_v1_set_shape(GetShapeDevice(),
|
||||
+ pointer_enter_serial->value, shape);
|
||||
+}
|
||||
+
|
||||
+} // namespace ui
|
||||
diff --git a/ui/ozone/platform/wayland/host/wayland_cursor_shape.h b/ui/ozone/platform/wayland/host/wayland_cursor_shape.h
|
||||
new file mode 100644
|
||||
index 0000000000000..9bb2fab21a539
|
||||
--- /dev/null
|
||||
+++ b/ui/ozone/platform/wayland/host/wayland_cursor_shape.h
|
||||
@@ -0,0 +1,53 @@
|
||||
+// Copyright 2024 The Chromium Authors
|
||||
+// Use of this source code is governed by a BSD-style license that can be
|
||||
+// found in the LICENSE file.
|
||||
+
|
||||
+#ifndef UI_OZONE_PLATFORM_WAYLAND_HOST_WAYLAND_CURSOR_SHAPE_H_
|
||||
+#define UI_OZONE_PLATFORM_WAYLAND_HOST_WAYLAND_CURSOR_SHAPE_H_
|
||||
+
|
||||
+#include "base/memory/raw_ptr.h"
|
||||
+#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
+#include "ui/base/cursor/mojom/cursor_type.mojom-forward.h"
|
||||
+#include "ui/ozone/platform/wayland/common/wayland_object.h"
|
||||
+
|
||||
+namespace ui {
|
||||
+
|
||||
+class WaylandConnection;
|
||||
+
|
||||
+// Wraps the cursor_shape interface for Wayland server-side cursor support.
|
||||
+class WaylandCursorShape
|
||||
+ : public wl::GlobalObjectRegistrar<WaylandCursorShape> {
|
||||
+ public:
|
||||
+ static constexpr char kInterfaceName[] = "wp_cursor_shape_manager_v1";
|
||||
+
|
||||
+ static void Instantiate(WaylandConnection* connection,
|
||||
+ wl_registry* registry,
|
||||
+ uint32_t name,
|
||||
+ const std::string& interface,
|
||||
+ uint32_t version);
|
||||
+
|
||||
+ WaylandCursorShape(wp_cursor_shape_manager_v1* cursor_shape,
|
||||
+ WaylandConnection* connection);
|
||||
+ WaylandCursorShape(const WaylandCursorShape&) = delete;
|
||||
+ WaylandCursorShape& operator=(const WaylandCursorShape&) = delete;
|
||||
+ virtual ~WaylandCursorShape();
|
||||
+
|
||||
+ // Returns the cursor shape value for a cursor |type|, or nullopt if the
|
||||
+ // type isn't supported by Wayland's cursor shape API.
|
||||
+ static absl::optional<uint32_t> ShapeFromType(mojom::CursorType type);
|
||||
+
|
||||
+ // Calls wp_cursor_shape_device_v1_set_shape(). See interface description
|
||||
+ // for values for |shape|. Virtual for testing.
|
||||
+ virtual void SetCursorShape(uint32_t shape);
|
||||
+
|
||||
+ private:
|
||||
+ wp_cursor_shape_device_v1* GetShapeDevice();
|
||||
+
|
||||
+ const wl::Object<wp_cursor_shape_manager_v1> wp_cursor_shape_manager_v1_;
|
||||
+ wl::Object<wp_cursor_shape_device_v1> wp_cursor_shape_device_v1_;
|
||||
+ const raw_ptr<WaylandConnection> connection_;
|
||||
+};
|
||||
+
|
||||
+} // namespace ui
|
||||
+
|
||||
+#endif // UI_OZONE_PLATFORM_WAYLAND_HOST_WAYLAND_CURSOR_SHAPE_H_
|
||||
diff --git a/ui/ozone/platform/wayland/host/wayland_window.cc b/ui/ozone/platform/wayland/host/wayland_window.cc
|
||||
index 68f87776ef4f0..f5c36964ad36d 100644
|
||||
--- a/ui/ozone/platform/wayland/host/wayland_window.cc
|
||||
@@ -653,10 +394,10 @@ index 68f87776ef4f0..f5c36964ad36d 100644
|
||||
base::IsValueInRangeForNumericType<int>(
|
||||
cursor->cursor_image_scale_factor()));
|
||||
|
||||
- absl::optional<int32_t> shape =
|
||||
+ absl::optional<uint32_t> shape =
|
||||
- std::optional<int32_t> shape =
|
||||
+ std::optional<uint32_t> shape =
|
||||
+ WaylandCursorShape::ShapeFromType(cursor->type());
|
||||
+ absl::optional<int32_t> zcr_shape =
|
||||
+ std::optional<int32_t> zcr_shape =
|
||||
WaylandZcrCursorShapes::ShapeFromType(cursor->type());
|
||||
|
||||
// Round cursor scale factor to ceil as wl_surface.set_buffer_scale accepts
|
||||
|
||||
Reference in New Issue
Block a user