forked from pool/nodejs-electron
- 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) - Update to 30.1.2 XXXFIXMEXXX * 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 OBS-URL: https://build.opensuse.org/request/show/1187058 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=159
259 lines
10 KiB
Diff
259 lines
10 KiB
Diff
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
|