From 58128e168f2cad680db52f8be0d98a2bbd85b556 Mon Sep 17 00:00:00 2001 From: Tomas Popela Date: Mon, 23 Sep 2019 17:25:20 +0200 Subject: [PATCH] Fix the icon Remove quite a few of downstream patches Fix the crashes by backporting an upstream bug Resolves: rhbz#1754179 --- chromium-77.0.3865.90-linked-hash-set.patch | 130 ++++++++++++++++++++ chromium.spec | 11 +- 2 files changed, 140 insertions(+), 1 deletion(-) create mode 100644 chromium-77.0.3865.90-linked-hash-set.patch diff --git a/chromium-77.0.3865.90-linked-hash-set.patch b/chromium-77.0.3865.90-linked-hash-set.patch new file mode 100644 index 0000000..f921f1a --- /dev/null +++ b/chromium-77.0.3865.90-linked-hash-set.patch @@ -0,0 +1,130 @@ +From 74138b9febd37eac0fc26b8efb110014a83a52c6 Mon Sep 17 00:00:00 2001 +From: Jeremy Roman +Date: Wed, 07 Aug 2019 13:26:48 +0000 +Subject: [PATCH] WTF: Make LinkedHashSet understand values for which memset initialization would be bad. + +Includes a unit test which fails before, and uses this to fix FontCacheKeyTraits. + +Bug: 980025 +Change-Id: If41f97444c7fd37b9b95d6dadaf3da5689079e9e +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1739948 +Reviewed-by: Kentaro Hara +Reviewed-by: Yutaka Hirano +Commit-Queue: Jeremy Roman +Cr-Commit-Position: refs/heads/master@{#684731} +--- + +diff --git a/third_party/blink/renderer/platform/fonts/font_cache_key.h b/third_party/blink/renderer/platform/fonts/font_cache_key.h +index 0efc8fb..90063cb 100644 +--- a/third_party/blink/renderer/platform/fonts/font_cache_key.h ++++ b/third_party/blink/renderer/platform/fonts/font_cache_key.h +@@ -133,6 +133,10 @@ + + struct FontCacheKeyTraits : WTF::SimpleClassHashTraits { + STATIC_ONLY(FontCacheKeyTraits); ++ ++ // std::string's empty state need not be zero in all implementations, ++ // and it is held within FontFaceCreationParams. ++ static const bool kEmptyValueIsZero = false; + }; + + } // namespace blink +diff --git a/third_party/blink/renderer/platform/wtf/linked_hash_set.h b/third_party/blink/renderer/platform/wtf/linked_hash_set.h +index b35b6e9..77e524c 100644 +--- a/third_party/blink/renderer/platform/wtf/linked_hash_set.h ++++ b/third_party/blink/renderer/platform/wtf/linked_hash_set.h +@@ -146,6 +146,11 @@ + LinkedHashSetNodeBase* next) + : LinkedHashSetNodeBase(prev, next), value_(value) {} + ++ LinkedHashSetNode(ValueArg&& value, ++ LinkedHashSetNodeBase* prev, ++ LinkedHashSetNodeBase* next) ++ : LinkedHashSetNodeBase(prev, next), value_(std::move(value)) {} ++ + LinkedHashSetNode(LinkedHashSetNode&& other) + : LinkedHashSetNodeBase(std::move(other)), + value_(std::move(other.value_)) {} +@@ -445,10 +450,13 @@ + + // The slot is empty when the next_ field is zero so it's safe to zero + // the backing. +- static const bool kEmptyValueIsZero = true; ++ static const bool kEmptyValueIsZero = ValueTraits::kEmptyValueIsZero; + + static const bool kHasIsEmptyValueFunction = true; + static bool IsEmptyValue(const Node& node) { return !node.next_; } ++ static Node EmptyValue() { ++ return Node(ValueTraits::EmptyValue(), nullptr, nullptr); ++ } + + static const int kDeletedValue = -1; + +diff --git a/third_party/blink/renderer/platform/wtf/list_hash_set_test.cc b/third_party/blink/renderer/platform/wtf/list_hash_set_test.cc +index 4c3f899..cd1be00 100644 +--- a/third_party/blink/renderer/platform/wtf/list_hash_set_test.cc ++++ b/third_party/blink/renderer/platform/wtf/list_hash_set_test.cc +@@ -487,6 +487,7 @@ + }; + + struct Complicated { ++ Complicated() : Complicated(0) {} + Complicated(int value) : simple_(value) { objects_constructed_++; } + + Complicated(const Complicated& other) : simple_(other.simple_) { +@@ -495,9 +496,6 @@ + + Simple simple_; + static int objects_constructed_; +- +- private: +- Complicated() = delete; + }; + + int Complicated::objects_constructed_ = 0; +@@ -731,4 +729,45 @@ + + } // anonymous namespace + ++// A unit type which objects to its state being initialized wrong. ++struct InvalidZeroValue { ++ InvalidZeroValue() = default; ++ InvalidZeroValue(WTF::HashTableDeletedValueType) : deleted_(true) {} ++ ~InvalidZeroValue() { CHECK(ok_); } ++ bool IsHashTableDeletedValue() const { return deleted_; } ++ ++ bool ok_ = true; ++ bool deleted_ = false; ++}; ++ ++template <> ++struct HashTraits : SimpleClassHashTraits { ++ static const bool kEmptyValueIsZero = false; ++}; ++ ++template <> ++struct DefaultHash { ++ struct Hash { ++ static unsigned GetHash(const InvalidZeroValue&) { return 0; } ++ static bool Equal(const InvalidZeroValue&, const InvalidZeroValue&) { ++ return true; ++ } ++ }; ++}; ++ ++template ++class ListOrLinkedHashSetInvalidZeroTest : public testing::Test {}; ++ ++using InvalidZeroValueSetTypes = ++ testing::Types, ++ ListHashSet, ++ LinkedHashSet>; ++TYPED_TEST_SUITE(ListOrLinkedHashSetInvalidZeroTest, InvalidZeroValueSetTypes); ++ ++TYPED_TEST(ListOrLinkedHashSetInvalidZeroTest, InvalidZeroValue) { ++ using Set = TypeParam; ++ Set set; ++ set.insert(InvalidZeroValue()); ++} ++ + } // namespace WTF diff --git a/chromium.spec b/chromium.spec index 930b750..ff76b24 100644 --- a/chromium.spec +++ b/chromium.spec @@ -158,7 +158,7 @@ Name: chromium%{chromium_channel}%{?freeworld:-freeworld} Name: chromium%{chromium_channel} %endif Version: %{majorversion}.0.3865.90 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A WebKit (Blink) powered web browser Url: http://www.chromium.org/Home License: BSD and LGPLv2+ and ASL 2.0 and IJG and MIT and GPLv2+ and ISC and OpenSSL and (MPLv1.1 or GPLv2 or LGPLv2) @@ -218,6 +218,8 @@ Patch58: chromium-77.0.3865.75-harfbuzz-subset.patch Patch59: chromium-77.0.3865.75-gcc-abstract-class.patch # https://chromium.googlesource.com/chromium/src/+/5baf7df7f4c5971dab552897eeef94b194650ce5 Patch60: chromium-77.0.3865.75-missing-limits.patch +# https://chromium.googlesource.com/chromium/src/+/74138b9febd37eac0fc26b8efb110014a83a52c6 +Patch61: chromium-77.0.3865.90-linked-hash-set.patch # Use lstdc++ on EPEL7 only Patch101: chromium-75.0.3770.100-epel7-stdc++.patch @@ -730,6 +732,7 @@ udev. %patch58 -p1 -b .harfbuzz-subset %patch59 -p1 -b .gcc-abstract-class %patch60 -p1 -b .missing-limits +%patch61 -p1 -b .linked-hash-set # Fedora branded user agent %if 0%{?fedora} @@ -1632,6 +1635,12 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Mon Sep 23 2019 Tomas Popela - 77.0.3865.90-2 +- Fix the icon +- Remove quite a few of downstream patches +- Fix the crashes by backporting an upstream bug +- Resolves: rhbz#1754179 + * Thu Sep 19 2019 Tomas Popela - 77.0.3865.90-1 - Update to 77.0.3865.90