Hello community, here is the log from the commit of package chromium for openSUSE:Factory checked in at 2020-05-26 17:14:37 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/chromium (Old) and /work/SRC/openSUSE:Factory/.chromium.new.2738 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "chromium" Tue May 26 17:14:37 2020 rev:257 rq:808194 version:83.0.4103.61 Changes: -------- --- /work/SRC/openSUSE:Factory/chromium/chromium.changes 2020-05-07 15:06:58.231900483 +0200 +++ /work/SRC/openSUSE:Factory/.chromium.new.2738/chromium.changes 2020-05-26 17:16:46.583645512 +0200 @@ -1,0 +2,69 @@ +Fri May 22 09:44:37 UTC 2020 - Tomáš Chvátal <[email protected]> + +- Add patch to fix building with new re2: + * chromium-81-re2-0.2020.05.01.patch + +------------------------------------------------------------------- +Wed May 20 16:35:28 UTC 2020 - Guillaume GARDET <[email protected]> + +- Update _constraints to avoid very slow builds seen on obs-arm-4 + (probably due to swap) + +------------------------------------------------------------------- +Wed May 20 09:35:32 UTC 2020 - Tomáš Chvátal <[email protected]> + +- Update to 83.0.4103.61 bsc#1171910: + * CVE-2020-6465: Use after free in reader mode. Reported by Woojin Oh(@pwn_expoit) of STEALIEN on 2020-04-21 + * CVE-2020-6466: Use after free in media. Reported by Zhe Jin from cdsrc of Qihoo 360 on 2020-04-26 + * CVE-2020-6467: Use after free in WebRTC. Reported by ZhanJia Song on 2020-04-06 + * CVE-2020-6468: Type Confusion in V8. Reported by Chris Salls and Jake Corina of Seaside Security, Chani Jindal of Shellphish on 2020-04-30 + * CVE-2020-6469: Insufficient policy enforcement in developer tools. Reported by David Erceg on 2020-04-02 + * CVE-2020-6470: Insufficient validation of untrusted input in clipboard. Reported by Michał Bentkowski of Securitum on 2020-03-30 + * CVE-2020-6471: Insufficient policy enforcement in developer tools. Reported by David Erceg on 2020-03-08 + * CVE-2020-6472: Insufficient policy enforcement in developer tools. Reported by David Erceg on 2020-03-25 + * CVE-2020-6473: Insufficient policy enforcement in Blink. Reported by Soroush Karami and Panagiotis Ilia on 2020-02-06 + * CVE-2020-6474: Use after free in Blink. Reported by Zhe Jin from cdsrc of Qihoo 360 on 2020-03-07 + * CVE-2020-6475: Incorrect security UI in full screen. Reported by Khalil Zhani on 2019-10-31 + * CVE-2020-6476: Insufficient policy enforcement in tab strip. Reported by Alexandre Le Borgne on 2019-12-18 + * CVE-2020-6477: Inappropriate implementation in installer. Reported by RACK911 Labs on 2019-03-26 + * CVE-2020-6478: Inappropriate implementation in full screen. Reported by Khalil Zhani on 2019-12-24 + * CVE-2020-6479: Inappropriate implementation in sharing. Reported by Zhong Zhaochen of andsecurity.cn on 2020-01-14 + * CVE-2020-6480: Insufficient policy enforcement in enterprise. Reported by Marvin Witt on 2020-02-21 + * CVE-2020-6481: Insufficient policy enforcement in URL formatting. Reported by Rayyan Bijoora on 2020-04-07 + * CVE-2020-6482: Insufficient policy enforcement in developer tools. Reported by Abdulrahman Alqabandi (@qab) on 2017-12-17 + * CVE-2020-6483: Insufficient policy enforcement in payments. Reported by Jun Kokatsu, Microsoft Browser Vulnerability Research on 2019-05-23 + * CVE-2020-6484: Insufficient data validation in ChromeDriver. Reported by Artem Zinenko on 2020-01-26 + * CVE-2020-6485: Insufficient data validation in media router. Reported by Sergei Glazunov of Google Project Zero on 2020-01-30 + * CVE-2020-6486: Insufficient policy enforcement in navigations. Reported by David Erceg on 2020-02-24 + * CVE-2020-6487: Insufficient policy enforcement in downloads. Reported by Jun Kokatsu (@shhnjk) on 2015-10-06 + * CVE-2020-6488: Insufficient policy enforcement in downloads. Reported by David Erceg on 2020-01-21 + * CVE-2020-6489: Inappropriate implementation in developer tools. Reported by @lovasoa (Ophir LOJKINE) on 2020-02-10 + * CVE-2020-6490: Insufficient data validation in loader. Reported by Twitter on 2019-12-19 + * CVE-2020-6491: Incorrect security UI in site information. Reported by Sultan Haikal M.A on 2020-02-07 +- Rebase patch: + * chromium-vaapi.patch +- Remove merged patches: + * icu-v67.patch + * chromium-80-gcc-blink.patch + * chromium-80.0.3987.106-missing-cstddef-header.patch + * chromium-80.0.3987.87-missing-cstdint-header.patch + * chromium-80.0.3987.87-missing-string-header.patch + * chromium-81-gcc-constexpr.patch + * chromium-81-gcc-noexcept.patch + * chromium-old-glibc-noexcept.patch + * fix-vaapi-with-glx.patch +- Add new patches: + * chromium-82-gcc-constexpr.patch + * chromium-82-gcc-incomplete-type.patch + * chromium-82-gcc-iterator.patch + * chromium-82-gcc-noexcept.patch + * chromium-82-gcc-template.patch + * chromium-83-gcc-10.patch + * chromium-83-gcc-include.patch + * chromium-83-gcc-iterator.patch + * chromium-83-gcc-permissive.patch + * chromium-83-gcc-serviceworker.patch + * chromium-83-gcc-template.patch + * chromium-83-icu67.patch + +------------------------------------------------------------------- @@ -31 +100 @@ -- Update to 81.0.4044.122 (boo#1170107): +- Update to 81.0.4044.122 (boo#1170107 bsc#1171975): @@ -34,0 +104 @@ + * CVE-2020-6463: Use after free in ANGLE Old: ---- chromium-80-gcc-blink.patch chromium-80.0.3987.106-missing-cstddef-header.patch chromium-80.0.3987.87-missing-cstdint-header.patch chromium-80.0.3987.87-missing-string-header.patch chromium-81-gcc-constexpr.patch chromium-81-gcc-noexcept.patch chromium-81.0.4044.138.tar.xz chromium-old-glibc-noexcept.patch fix-vaapi-with-glx.patch icu-v67.patch New: ---- chromium-81-re2-0.2020.05.01.patch chromium-82-gcc-constexpr.patch chromium-82-gcc-incomplete-type.patch chromium-82-gcc-iterator.patch chromium-82-gcc-noexcept.patch chromium-82-gcc-template.patch chromium-83-gcc-10.patch chromium-83-gcc-include.patch chromium-83-gcc-iterator.patch chromium-83-gcc-permissive.patch chromium-83-gcc-serviceworker.patch chromium-83-gcc-template.patch chromium-83-icu67.patch chromium-83.0.4103.61.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ chromium.spec ++++++ --- /var/tmp/diff_new_pack.XaGPum/_old 2020-05-26 17:16:56.575667173 +0200 +++ /var/tmp/diff_new_pack.XaGPum/_new 2020-05-26 17:16:56.579667182 +0200 @@ -19,12 +19,6 @@ %define rname chromium # bsc#1108175 %define __provides_exclude ^lib.*\\.so.*$ -# This is just overall condition to contain everything we can't provide on SLE12 -%if 0%{?suse_version} >= 1320 || 0%{?is_opensuse} -%bcond_with sle_bundles -%else -%bcond_without sle_bundles -%endif %if 0%{?suse_version} >= 1550 %bcond_without system_icu %bcond_without system_harfbuzz @@ -34,11 +28,6 @@ %bcond_with system_harfbuzz %bcond_with pipewire %endif -%if 0%{?suse_version} >= 1500 -%bcond_without system_libxml -%else -%bcond_with system_libxml -%endif %ifarch %{arm} aarch64 %bcond_with swiftshader %else @@ -57,7 +46,7 @@ %bcond_with clang %bcond_with wayland Name: chromium -Version: 81.0.4044.138 +Version: 83.0.4103.61 Release: 0 Summary: Google's open source browser project License: BSD-3-Clause AND LGPL-2.1-or-later @@ -82,20 +71,24 @@ Patch6: chromium-drm.patch Patch9: chromium-system-libusb.patch Patch10: gcc-enable-lto.patch -Patch11: chromium-old-glibc-noexcept.patch Patch12: chromium-79-gcc-alignas.patch -Patch13: chromium-80-gcc-blink.patch -Patch14: chromium-80-gcc-quiche.patch -Patch15: chromium-fix-char_traits.patch -Patch16: gpu-timeout.patch -Patch17: chromium-81-gcc-constexpr.patch -Patch18: chromium-81-gcc-noexcept.patch -Patch19: build-with-pipewire-0.3.patch -Patch20: fix-vaapi-with-glx.patch -Patch21: chromium-80.0.3987.87-missing-string-header.patch -Patch22: chromium-80.0.3987.106-missing-cstddef-header.patch -Patch23: chromium-80.0.3987.87-missing-cstdint-header.patch -Patch24: icu-v67.patch +Patch13: chromium-80-gcc-quiche.patch +Patch14: chromium-fix-char_traits.patch +Patch15: gpu-timeout.patch +Patch16: build-with-pipewire-0.3.patch +Patch17: chromium-82-gcc-constexpr.patch +Patch18: chromium-82-gcc-incomplete-type.patch +Patch19: chromium-82-gcc-iterator.patch +Patch20: chromium-82-gcc-noexcept.patch +Patch21: chromium-82-gcc-template.patch +Patch22: chromium-83-gcc-template.patch +Patch23: chromium-83-icu67.patch +Patch24: chromium-83-gcc-serviceworker.patch +Patch25: chromium-83-gcc-permissive.patch +Patch26: chromium-83-gcc-iterator.patch +Patch27: chromium-83-gcc-include.patch +Patch28: chromium-83-gcc-10.patch +Patch29: chromium-81-re2-0.2020.05.01.patch # Google seem not too keen on merging this but GPU accel is quite important # https://chromium-review.googlesource.com/c/chromium/src/+/532294 # https://github.com/saiarcot895/chromium-ubuntu-build/tree/master/debian/patches @@ -113,7 +106,7 @@ BuildRequires: desktop-file-utils BuildRequires: fdupes BuildRequires: flex -BuildRequires: gn +BuildRequires: gn >= 0.1726 BuildRequires: gperf BuildRequires: hicolor-icon-theme # Java used during build @@ -133,11 +126,13 @@ BuildRequires: pkgconfig BuildRequires: python BuildRequires: python-xml +BuildRequires: python2-setuptools BuildRequires: snappy-devel BuildRequires: update-desktop-files BuildRequires: util-linux BuildRequires: wdiff BuildRequires: yasm +BuildRequires: yasm-devel BuildRequires: perl(Switch) BuildRequires: pkgconfig(alsa) BuildRequires: pkgconfig(bzip2) @@ -174,12 +169,15 @@ BuildRequires: pkgconfig(libssl) BuildRequires: pkgconfig(libudev) BuildRequires: pkgconfig(libusb-1.0) +BuildRequires: pkgconfig(libwebp) >= 0.4.0 +BuildRequires: pkgconfig(libxml-2.0) >= 2.9.5 BuildRequires: pkgconfig(libxslt) BuildRequires: pkgconfig(minizip) BuildRequires: pkgconfig(nspr) >= 4.9.5 BuildRequires: pkgconfig(nss) >= 3.26 BuildRequires: pkgconfig(ogg) BuildRequires: pkgconfig(openssl) +BuildRequires: pkgconfig(opus) >= 1.3.1 BuildRequires: pkgconfig(python) BuildRequires: pkgconfig(re2) BuildRequires: pkgconfig(schroedinger-1.0) @@ -201,6 +199,7 @@ BuildRequires: pkgconfig(xscrnsaver) BuildRequires: pkgconfig(xt) BuildRequires: pkgconfig(xtst) +BuildRequires: pkgconfig(zlib) Requires: hicolor-icon-theme Requires: xdg-utils Requires(pre): permissions @@ -240,15 +239,6 @@ %if %{with system_harfbuzz} BuildRequires: pkgconfig(harfbuzz) > 2.3.0 %endif -%if %{with system_libxml} -BuildRequires: pkgconfig(libxml-2.0) >= 2.9.5 -%endif -%if !%{with sle_bundles} -BuildRequires: yasm-devel -BuildRequires: pkgconfig(libwebp) -BuildRequires: pkgconfig(opus) >= 1.3.1 -BuildRequires: pkgconfig(zlib) -%endif %if %{with system_icu} BuildRequires: pkgconfig(icu-i18n) >= 63.0 %endif @@ -361,6 +351,7 @@ third_party/devscripts third_party/devtools-frontend third_party/devtools-frontend/src/front_end/third_party/fabricjs + third_party/devtools-frontend/src/front_end/third_party/lighthouse third_party/devtools-frontend/src/front_end/third_party/wasmparser third_party/devtools-frontend/src/third_party third_party/dom_distiller_js @@ -372,6 +363,7 @@ third_party/google_input_tools/third_party/closure_library third_party/google_input_tools/third_party/closure_library/third_party/closure third_party/googletest + third_party/harfbuzz-ng/utils third_party/hunspell third_party/iccjpeg third_party/inspector_protocol @@ -397,6 +389,7 @@ third_party/libyuv third_party/lss third_party/lzma_sdk + third_party/mako third_party/markupsafe third_party/mesa third_party/metrics_proto @@ -432,6 +425,7 @@ third_party/qcms third_party/rnnoise third_party/s2cellid + third_party/schema_org third_party/simplejson third_party/skia third_party/skia/third_party/skcms @@ -443,6 +437,7 @@ third_party/SPIRV-Tools third_party/sqlite third_party/swiftshader + third_party/swiftshader/third_party/astc-encoder third_party/swiftshader/third_party/llvm-7.0 third_party/swiftshader/third_party/llvm-subzero third_party/swiftshader/third_party/marl @@ -481,15 +476,6 @@ third_party/wayland-protocols ) %endif -%if %{with sle_bundles} -keeplibs+=( - third_party/libwebp - third_party/opus - third_party/yasm - third_party/simplejson - third_party/zlib -) -%endif %if !%{with system_harfbuzz} keeplibs+=( third_party/freetype @@ -499,9 +485,6 @@ %if !%{with system_icu} keeplibs+=( third_party/icu ) %endif -%if !%{with system_libxml} -keeplibs+=( third_party/libxml ) -%endif %if !%{with system_vpx} keeplibs+=( third_party/libvpx @@ -577,8 +560,13 @@ libpng libxslt libusb + libwebp + libxml + opus re2 snappy + yasm + zlib ) %if %{with system_harfbuzz} gn_system_libraries+=( @@ -586,23 +574,12 @@ freetype ) %endif -%if !%{with sle_bundles} -gn_system_libraries+=( - libwebp - opus - yasm - zlib -) -%endif %if %{with system_icu} gn_system_libraries+=( icu ) %endif %if %{with system_vpx} gn_system_libraries+=( libvpx ) %endif -%if %{with system_libxml} -gn_system_libraries+=( libxml ) -%endif build/linux/unbundle/replace_gn_files.py --system-libraries ${gn_system_libraries[@]} # Create the configuration for GN @@ -653,6 +630,7 @@ %endif myconf_gn+=" enable_hangout_services_extension=true" myconf_gn+=" enable_vulkan=true" +myconf_gn+=" enable_hevc_demuxing=true" %if %{with pipewire} myconf_gn+=" rtc_use_pipewire=true rtc_link_pipewire=true" myconf_gn+=" rtc_use_pipewire_version=\"0.3\"" ++++++ _constraints ++++++ --- /var/tmp/diff_new_pack.XaGPum/_old 2020-05-26 17:16:56.615667260 +0200 +++ /var/tmp/diff_new_pack.XaGPum/_new 2020-05-26 17:16:56.619667268 +0200 @@ -4,9 +4,9 @@ <disk> <size unit="G">16</size> </disk> - <memory> + <physicalmemory> <size unit="G">8</size> - </memory> + </physicalmemory> </hardware> <overwrite> <conditions> ++++++ chromium-81-re2-0.2020.05.01.patch ++++++ https://chromium.googlesource.com/chromium/src/+/ede390a0b18e4565abf8ac1e1ff717e1d43fc320 --- /components/autofill/core/browser/address_rewriter.cc +++ /components/autofill/core/browser/address_rewriter.cc @@ -57,7 +57,7 @@ CompiledRuleVector* compiled_rules) { base::StringPiece data = data_string; re2::RE2::Options options; - options.set_utf8(true); + options.set_encoding(RE2::Options::EncodingUTF8); options.set_word_boundary(true); size_t token_end = 0; ++++++ chromium-81-gcc-constexpr.patch -> chromium-82-gcc-constexpr.patch ++++++ --- /work/SRC/openSUSE:Factory/chromium/chromium-81-gcc-constexpr.patch 2020-04-13 12:50:11.764567361 +0200 +++ /work/SRC/openSUSE:Factory/.chromium.new.2738/chromium-82-gcc-constexpr.patch 2020-05-26 17:16:06.859559396 +0200 @@ -1,19 +1,34 @@ -diff --git a/ui/views/layout/layout_types.h b/ui/views/layout/layout_types.h -index 8f9dbf4..ba118b9 100644 ---- a/ui/views/layout/layout_types.h -+++ b/ui/views/layout/layout_types.h -@@ -45,12 +45,12 @@ class VIEWS_EXPORT SizeBounds { - ~SizeBounds() = default; +From 5812cd9bc2c15a034db24e0d2a43cc923d8a66cc Mon Sep 17 00:00:00 2001 +From: Jose Dapena Paz <[email protected]> +Date: Thu, 20 Feb 2020 13:00:16 +0100 +Subject: [PATCH] GCC: DOMRect constexpr equal operator depends on non constexpr operators + +Make accessors of DOMRectReadOnly constexpr so the equal operator can be +also constexpr. + +../../third_party/blink/renderer/core/geometry/dom_rect.h: In function ‘constexpr bool blink::operator==(const blink::DOMRect&, const blink::DOMRect&)’: +../../third_party/blink/renderer/core/geometry/dom_rect.h:38:15: error: call to non-‘constexpr’ function ‘double blink::DOMRectReadOnly::x() const’ + +Bug: 819294 +Change-Id: Ic1fed89c5480ce4eedaaf7add2779d000b77cc48 +--- + +Index: chromium-83.0.4103.14/third_party/blink/renderer/core/geometry/dom_rect_read_only.h +=================================================================== +--- chromium-83.0.4103.14.orig/third_party/blink/renderer/core/geometry/dom_rect_read_only.h ++++ chromium-83.0.4103.14/third_party/blink/renderer/core/geometry/dom_rect_read_only.h +@@ -31,10 +31,10 @@ class CORE_EXPORT DOMRectReadOnly : publ - constexpr const base::Optional<int>& width() const { return width_; } -- constexpr void set_width(base::Optional<int> width) { -+ inline void set_width(base::Optional<int> width) { - width_ = std::move(width); - } + DOMRectReadOnly(double x, double y, double width, double height); - constexpr const base::Optional<int>& height() const { return height_; } -- constexpr void set_height(base::Optional<int> height) { -+ inline void set_height(base::Optional<int> height) { - height_ = std::move(height); - } +- double x() const { return x_; } +- double y() const { return y_; } +- double width() const { return width_; } +- double height() const { return height_; } ++ constexpr double x() const { return x_; } ++ constexpr double y() const { return y_; } ++ constexpr double width() const { return width_; } ++ constexpr double height() const { return height_; } + double top() const { return geometry_util::NanSafeMin(y_, y_ + height_); } + double right() const { return geometry_util::NanSafeMax(x_, x_ + width_); } ++++++ chromium-82-gcc-incomplete-type.patch ++++++ diff --git a/ui/accessibility/ax_tree.cc b/ui/accessibility/ax_tree.cc index 616d53f..26749e3 100644 --- a/ui/accessibility/ax_tree.cc +++ b/ui/accessibility/ax_tree.cc @@ -565,15 +565,6 @@ struct AXTreeUpdateState { const AXTree& tree; }; -struct AXTree::NodeSetSizePosInSetInfo { - NodeSetSizePosInSetInfo() = default; - ~NodeSetSizePosInSetInfo() = default; - - int32_t pos_in_set = 0; - int32_t set_size = 0; - base::Optional<int> lowest_hierarchical_level; -}; - struct AXTree::OrderedSetContent { explicit OrderedSetContent(const AXNode* ordered_set = nullptr) : ordered_set_(ordered_set) {} diff --git a/ui/accessibility/ax_tree.h b/ui/accessibility/ax_tree.h index 3bbbe0c..e4288f5 100644 --- a/ui/accessibility/ax_tree.h +++ b/ui/accessibility/ax_tree.h @@ -323,7 +323,14 @@ class AX_EXPORT AXTree : public AXNode::OwnerTree { bool enable_extra_mac_nodes_ = false; // Contains pos_in_set and set_size data for an AXNode. - struct NodeSetSizePosInSetInfo; + struct NodeSetSizePosInSetInfo { + NodeSetSizePosInSetInfo() = default; + ~NodeSetSizePosInSetInfo() = default; + + int32_t pos_in_set = 0; + int32_t set_size = 0; + base::Optional<int> lowest_hierarchical_level; + }; // Represents the content of an ordered set which includes the ordered set // items and the ordered set container if it exists. ++++++ chromium-82-gcc-iterator.patch ++++++ diff --git a/third_party/blink/renderer/core/layout/ng/ng_physical_container_fragment.h b/third_party/blink/renderer/core/layout/ng/ng_physical_container_fragment.h index b3c7624..85936aa 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_physical_container_fragment.h +++ b/third_party/blink/renderer/core/layout/ng/ng_physical_container_fragment.h @@ -5,6 +5,8 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_PHYSICAL_CONTAINER_FRAGMENT_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_PHYSICAL_CONTAINER_FRAGMENT_H_ +#include <iterator> + #include "base/containers/span.h" #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/layout/geometry/physical_rect.h" @@ -31,7 +33,8 @@ class CORE_EXPORT NGPhysicalContainerFragment : public NGPhysicalFragment { PostLayoutChildLinkList(wtf_size_t count, const NGLink* buffer) : count_(count), buffer_(buffer) {} - class ConstIterator { + class ConstIterator : public std::iterator<std::input_iterator_tag, + NGLink> { STACK_ALLOCATED(); public: ++++++ chromium-81-gcc-noexcept.patch -> chromium-82-gcc-noexcept.patch ++++++ --- /work/SRC/openSUSE:Factory/chromium/chromium-81-gcc-noexcept.patch 2020-04-13 12:50:11.848567398 +0200 +++ /work/SRC/openSUSE:Factory/.chromium.new.2738/chromium-82-gcc-noexcept.patch 2020-05-26 17:16:08.671563325 +0200 @@ -1,13 +1,35 @@ -diff --git a/components/paint_preview/browser/paint_preview_client.cc b/components/paint_preview/browser/paint_preview_client.cc -index 38ab6be..dccf07f 100644 ---- a/components/paint_preview/browser/paint_preview_client.cc -+++ b/components/paint_preview/browser/paint_preview_client.cc -@@ -78,7 +78,7 @@ PaintPreviewClient::PaintPreviewData::PaintPreviewData() = default; - PaintPreviewClient::PaintPreviewData::~PaintPreviewData() = default; - - PaintPreviewClient::PaintPreviewData& PaintPreviewClient::PaintPreviewData:: --operator=(PaintPreviewData&& rhs) noexcept = default; -+operator=(PaintPreviewData&& rhs) = default; - PaintPreviewClient::PaintPreviewData::PaintPreviewData( - PaintPreviewData&& other) noexcept = default; +diff --git a/ui/color/color_set.cc b/ui/color/color_set.cc +index 56564d7..2798a3c 100644 +--- a/ui/color/color_set.cc ++++ b/ui/color/color_set.cc +@@ -11,7 +11,7 @@ ColorSet::ColorSet(ColorSetId id, ColorMap&& colors) + + ColorSet::ColorSet(ColorSet&&) noexcept = default; + +-ColorSet& ColorSet::operator=(ColorSet&&) noexcept = default; ++ColorSet& ColorSet::operator=(ColorSet&&) = default; + + ColorSet::~ColorSet() = default; + +diff --git a/third_party/blink/public/platform/cross_variant_mojo_util.h b/third_party/blink/public/platform/cross_variant_mojo_util.h +index dee0b95..0c83580 100644 +--- a/third_party/blink/public/platform/cross_variant_mojo_util.h ++++ b/third_party/blink/public/platform/cross_variant_mojo_util.h +@@ -124,7 +124,7 @@ class CrossVariantMojoAssociatedReceiver { + ~CrossVariantMojoAssociatedReceiver() = default; + + CrossVariantMojoAssociatedReceiver( +- CrossVariantMojoAssociatedReceiver&&) noexcept = default; ++ CrossVariantMojoAssociatedReceiver&&) = default; + CrossVariantMojoAssociatedReceiver& operator=( + CrossVariantMojoAssociatedReceiver&&) noexcept = default; + +@@ -155,7 +155,7 @@ class CrossVariantMojoAssociatedRemote { + ~CrossVariantMojoAssociatedRemote() = default; + + CrossVariantMojoAssociatedRemote( +- CrossVariantMojoAssociatedRemote&&) noexcept = default; ++ CrossVariantMojoAssociatedRemote&&) = default; + CrossVariantMojoAssociatedRemote& operator=( + CrossVariantMojoAssociatedRemote&&) noexcept = default; ++++++ chromium-82-gcc-template.patch ++++++ diff --git a/content/public/browser/web_ui.h b/content/public/browser/web_ui.h index 4e6aa0e..fa6f10c 100644 --- a/content/public/browser/web_ui.h +++ b/content/public/browser/web_ui.h @@ -138,22 +138,6 @@ class CONTENT_EXPORT WebUI { template <typename T> static T GetValue(const base::Value& value); - template <> - inline bool GetValue<bool>(const base::Value& value) { - return value.GetBool(); - } - - template <> - inline int GetValue<int>(const base::Value& value) { - return value.GetInt(); - } - - template <> - inline const std::string& GetValue<const std::string&>( - const base::Value& value) { - return value.GetString(); - } - template <typename Is, typename... Args> struct Call; @@ -169,6 +153,22 @@ class CONTENT_EXPORT WebUI { }; }; +template <> +inline bool WebUI::GetValue<bool>(const base::Value& value) { + return value.GetBool(); +} + +template <> +inline int WebUI::GetValue<int>(const base::Value& value) { + return value.GetInt(); +} + +template <> +inline const std::string& WebUI::GetValue<const std::string&>( + const base::Value& value) { + return value.GetString(); +} + } // namespace content #endif // CONTENT_PUBLIC_BROWSER_WEB_UI_H_ ++++++ chromium-80-gcc-blink.patch -> chromium-83-gcc-10.patch ++++++ --- /work/SRC/openSUSE:Factory/chromium/chromium-80-gcc-blink.patch 2020-02-14 16:28:23.419288867 +0100 +++ /work/SRC/openSUSE:Factory/.chromium.new.2738/chromium-83-gcc-10.patch 2020-05-26 17:16:09.719565596 +0200 @@ -1,45 +1,64 @@ -../../third_party/blink/renderer/core/editing/commands/delete_selection_command.cc: In member function 'void blink::DeleteSelectionCommand::InitializePositionData(blink::EditingState*)': -../../third_party/blink/renderer/core/editing/commands/delete_selection_command.cc:256:59: error: no matching function for call to 'EnclosingNodeOfType(blink::Position&, <unresolved overloaded function type>)' - 256 | EnclosingNodeOfType(start, &IsA<HTMLTableRowElement>)); - | ^ -In file included from ../../third_party/blink/renderer/core/editing/commands/delete_selection_command.cc:34: -../../third_party/blink/renderer/core/editing/editing_utilities.h:112:19: note: candidate: 'blink::Node* blink::EnclosingNodeOfType(const Position&, bool (*)(const blink::Node*), blink::EditingBoundaryCrossingRule)' - 112 | CORE_EXPORT Node* EnclosingNodeOfType( - | ^~~~~~~~~~~~~~~~~~~ -../../third_party/blink/renderer/core/editing/editing_utilities.h:114:12: note: no known conversion for argument 2 from '<unresolved overloaded function type>' to 'bool (*)(const blink::Node*)' - 114 | bool (*node_is_of_type)(const Node*), - | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -../../third_party/blink/renderer/core/editing/editing_utilities.h:116:19: note: candidate: 'blink::Node* blink::EnclosingNodeOfType(const PositionInFlatTree&, bool (*)(const blink::Node*), blink::EditingBoundaryCrossingRule)' - 116 | CORE_EXPORT Node* EnclosingNodeOfType( - | ^~~~~~~~~~~~~~~~~~~ -../../third_party/blink/renderer/core/editing/editing_utilities.h:117:5: note: no known conversion for argument 1 from 'blink::Position' {aka 'blink::PositionTemplate<blink::EditingAlgorithm<blink::NodeTraversal> >'} to 'const PositionInFlatTree&' {aka 'const blink::PositionTemplate<blink::EditingAlgorithm<blink::FlatTreeTraversal> >&'} - 117 | const PositionInFlatTree&, - | ^~~~~~~~~~~~~~~~~~~~~~~~~ +From e473f41284ccc8fa4bc4622d087194b18a1ec23a Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann <[email protected]> +Date: Tue, 7 Apr 2020 16:37:10 +0000 +Subject: [PATCH] GCC: fix includes for gcc-10 -diff --git a/third_party/blink/renderer/core/editing/commands/delete_selection_command.cc b/third_party/blink/renderer/core/editing/commands/delete_selection_command.cc -index 6ff6906..dd531ae 100644 ---- a/third_party/blink/renderer/core/editing/commands/delete_selection_command.cc -+++ b/third_party/blink/renderer/core/editing/commands/delete_selection_command.cc -@@ -224,6 +224,10 @@ static Position TrailingWhitespacePosition(const Position& position, - return Position(); - } - -+static bool IsAHTMLTableRowElement(const Node* node) { -+ return IsA<HTMLTableRowElement>(node); -+} +--- + chrome/browser/search/background/ntp_backgrounds.h | 1 + + third_party/webrtc/call/rtx_receive_stream.h | 1 + + .../webrtc/modules/audio_processing/aec3/clockdrift_detector.h | 1 + + ui/gfx/linux/drm_util_linux.h | 2 ++ + 5 files changed, 6 insertions(+) + +diff --git a/chrome/browser/search/background/ntp_backgrounds.h b/chrome/browser/search/background/ntp_backgrounds.h +index 7afc0a2..ea5818e 100644 +--- a/chrome/browser/search/background/ntp_backgrounds.h ++++ b/chrome/browser/search/background/ntp_backgrounds.h +@@ -6,6 +6,7 @@ + #define CHROME_BROWSER_SEARCH_BACKGROUND_NTP_BACKGROUNDS_H_ + + #include <array> ++#include <cstddef> + + class GURL; + +diff --git a/third_party/webrtc/call/rtx_receive_stream.h b/third_party/webrtc/call/rtx_receive_stream.h +index 8ffa440..113a816 100644 +--- a/third_party/webrtc/call/rtx_receive_stream.h ++++ b/third_party/webrtc/call/rtx_receive_stream.h +@@ -12,6 +12,7 @@ + #define CALL_RTX_RECEIVE_STREAM_H_ + + #include <map> ++#include <cstdint> + + #include "call/rtp_packet_sink_interface.h" + +diff --git a/third_party/webrtc/modules/audio_processing/aec3/clockdrift_detector.h b/third_party/webrtc/modules/audio_processing/aec3/clockdrift_detector.h +index 22528c9..69e624e 100644 +--- a/third_party/webrtc/modules/audio_processing/aec3/clockdrift_detector.h ++++ b/third_party/webrtc/modules/audio_processing/aec3/clockdrift_detector.h +@@ -12,6 +12,7 @@ + #define MODULES_AUDIO_PROCESSING_AEC3_CLOCKDRIFT_DETECTOR_H_ + + #include <array> ++#include <cstddef> + + namespace webrtc { + +diff --git a/ui/gfx/linux/drm_util_linux.h b/ui/gfx/linux/drm_util_linux.h +index 86ff2eb..990f12c 100644 +--- a/ui/gfx/linux/drm_util_linux.h ++++ b/ui/gfx/linux/drm_util_linux.h +@@ -7,6 +7,8 @@ + + #include "ui/gfx/buffer_types.h" + ++#include <cstdint> + - void DeleteSelectionCommand::InitializePositionData( - EditingState* editing_state) { - DCHECK(!GetDocument().NeedsLayoutTreeUpdate()); -@@ -253,9 +257,9 @@ void DeleteSelectionCommand::InitializePositionData( - end_root_ = RootEditableElementOf(end); - - start_table_row_ = To<HTMLTableRowElement>( -- EnclosingNodeOfType(start, &IsA<HTMLTableRowElement>)); -+ EnclosingNodeOfType(start, &IsAHTMLTableRowElement)); - end_table_row_ = To<HTMLTableRowElement>( -- EnclosingNodeOfType(end, &IsA<HTMLTableRowElement>)); -+ EnclosingNodeOfType(end, &IsAHTMLTableRowElement)); + namespace ui { - // Don't move content out of a table cell. - // If the cell is non-editable, enclosingNodeOfType won't return it by + int GetFourCCFormatFromBufferFormat(gfx::BufferFormat format); +-- +2.24.1 + ++++++ chromium-83-gcc-include.patch ++++++ >From 3681c96f54b34f60493cbbf5ec830f158e469799 Mon Sep 17 00:00:00 2001 From: Stephan Hartmann <[email protected]> Date: Thu, 2 Apr 2020 14:35:44 +0000 Subject: [PATCH] IWYU: std::find is defined in algorithm --- extensions/browser/install/crx_install_error.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extensions/browser/install/crx_install_error.cc b/extensions/browser/install/crx_install_error.cc index a9765bb..bd0d3e3 100644 --- a/extensions/browser/install/crx_install_error.cc +++ b/extensions/browser/install/crx_install_error.cc @@ -4,6 +4,8 @@ #include "extensions/browser/install/crx_install_error.h" +#include <algorithm> + #include "base/logging.h" #include "extensions/browser/install/sandboxed_unpacker_failure_reason.h" -- 2.24.1 >From 80044e30e0014c4c322178e4b56ddbb10eede304 Mon Sep 17 00:00:00 2001 From: Stephan Hartmann <[email protected]> Date: Thu, 9 Apr 2020 17:58:06 +0000 Subject: [PATCH] IWYU: std::unique_ptr is defined in memory --- .../blink/renderer/core/html/trust_token_attribute_parsing.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/third_party/blink/renderer/core/html/trust_token_attribute_parsing.h b/third_party/blink/renderer/core/html/trust_token_attribute_parsing.h index f5a7ab0..ef19cfa 100644 --- a/third_party/blink/renderer/core/html/trust_token_attribute_parsing.h +++ b/third_party/blink/renderer/core/html/trust_token_attribute_parsing.h @@ -5,6 +5,8 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_HTML_TRUST_TOKEN_ATTRIBUTE_PARSING_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_HTML_TRUST_TOKEN_ATTRIBUTE_PARSING_H_ +#include <memory> + #include "base/optional.h" #include "services/network/public/mojom/trust_tokens.mojom-blink-forward.h" #include "third_party/blink/renderer/core/core_export.h" -- 2.24.1 >From 4f4d0a6d453bc22a6397dadaf6d866b4eb2d6b95 Mon Sep 17 00:00:00 2001 From: Stephan Hartmann <[email protected]> Date: Fri, 10 Apr 2020 08:31:08 +0000 Subject: [PATCH] IWYU: std::numeric_limits is defined in limits --- .../graph/policies/background_tab_loading_policy_helpers.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/chrome/browser/performance_manager/graph/policies/background_tab_loading_policy_helpers.cc b/chrome/browser/performance_manager/graph/policies/background_tab_loading_policy_helpers.cc index 6ab117b..43aa602 100644 --- a/chrome/browser/performance_manager/graph/policies/background_tab_loading_policy_helpers.cc +++ b/chrome/browser/performance_manager/graph/policies/background_tab_loading_policy_helpers.cc @@ -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 <limits> + #include "chrome/browser/performance_manager/graph/policies/background_tab_loading_policy_helpers.h" #include "base/logging.h" -- 2.24.1 ++++++ chromium-83-gcc-iterator.patch ++++++ >From 4abcf0a76a7cb5c343be7d17c60cb908f3673c3d Mon Sep 17 00:00:00 2001 From: Stephan Hartmann <[email protected]> Date: Thu, 9 Apr 2020 17:03:38 +0000 Subject: [PATCH] libstdc++: replace std::any_of in blink::SerializedScriptValue Use of std::any_of requires STL compliant iterator. However, HashTableIterator does not define iterator_tag and therefore is no STL iterator. --- .../core/v8/serialization/serialized_script_value.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/third_party/blink/renderer/bindings/core/v8/serialization/serialized_script_value.h b/third_party/blink/renderer/bindings/core/v8/serialization/serialized_script_value.h index bbf10ef..53d98c9 100644 --- a/third_party/blink/renderer/bindings/core/v8/serialization/serialized_script_value.h +++ b/third_party/blink/renderer/bindings/core/v8/serialization/serialized_script_value.h @@ -268,12 +268,17 @@ class CORE_EXPORT SerializedScriptValue MessagePortChannelArray& GetStreamChannels() { return stream_channels_; } bool IsLockedToAgentCluster() const { + auto AnyOfIsLockedToAgentCluster = [&]() { + for (auto entry = attachments_.begin(); + entry != attachments_.end(); ++entry) { + if (entry->value->IsLockedToAgentCluster()) + return true; + } + return false; + }; return !wasm_modules_.IsEmpty() || !shared_array_buffers_contents_.IsEmpty() || - std::any_of(attachments_.begin(), attachments_.end(), - [](const auto& entry) { - return entry.value->IsLockedToAgentCluster(); - }); + AnyOfIsLockedToAgentCluster(); } // Returns true after serializing script values that remote origins cannot -- 2.24.1 ++++++ chromium-83-gcc-permissive.patch ++++++ >From fdf2767e8dc54727c9536a4d39d230a959e3698c Mon Sep 17 00:00:00 2001 From: Stephan Hartmann <[email protected]> Date: Thu, 2 Apr 2020 16:16:14 +0000 Subject: [PATCH] GCC: add missing apps namespace to BrowserAppLauncher GCC does not get namespace of BrowserAppLauncher right and fails like this: chrome/browser/apps/app_service/app_service_proxy.h:82:23: error: declaration of 'apps::BrowserAppLauncher& apps::AppServiceProxy::BrowserAppLauncher()' changes meaning of 'BrowserAppLauncher' [-fpermissive] --- chrome/browser/apps/app_service/app_service_proxy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome/browser/apps/app_service/app_service_proxy.h b/chrome/browser/apps/app_service/app_service_proxy.h index b7fff63..1ecd49d 100644 --- a/chrome/browser/apps/app_service/app_service_proxy.h +++ b/chrome/browser/apps/app_service/app_service_proxy.h @@ -79,7 +79,7 @@ class AppServiceProxy : public KeyedService, apps::InstanceRegistry& InstanceRegistry(); #endif - BrowserAppLauncher& BrowserAppLauncher(); + apps::BrowserAppLauncher& BrowserAppLauncher(); apps::PreferredAppsList& PreferredApps(); -- 2.24.1 ++++++ chromium-83-gcc-serviceworker.patch ++++++ >From 0914a38252f205fc04fa50e858b24fa5f535ab11 Mon Sep 17 00:00:00 2001 From: Hiroki Nakagawa <[email protected]> Date: Wed, 29 Apr 2020 11:46:54 +0900 Subject: [PATCH] ServiceWorker: Avoid double destruction of ServiceWorkerObjectHost on connection error This CL avoids the case where ServiceWorkerObjectHost is destroyed twice on ServiceWorkerObjectHost::OnConnectionError() when Chromium is built with the GCC build toolchain. > How does the issue happen? ServiceWorkerObjectHost has a cyclic reference like this: ServiceWorkerObjectHost --([1] scoped_refptr)--> ServiceWorkerVersion --([2] std::unique_ptr)--> ServiceWorkerProviderHost --([3] std::unique_ptr)--> ServiceWorkerContainerHost --([4] std::unique_ptr)--> ServiceWorkerObjectHost Note that ServiceWorkerContainerHost manages ServiceWorkerObjectHost in map<int64_t version_id, std::unique_ptr<ServiceWorkerObjectHost>>. When ServiceWorkerObjectHost::OnConnectionError() is called, the function removes the reference [4] from the map, and destroys ServiceWorkerObjectHost. If the object host has the last reference [1] to ServiceWorkerVersion, the destruction also cuts off the references [2] and [3], and destroys ServiceWorkerProviderHost and ServiceWorkerContainerHost. This seems to work well on the Chromium's default toolchain, but not work on the GCC toolchain. According to the report, destruction of ServiceWorkerContainerHost happens while the map owned by the container host is erasing the ServiceWorkerObjectHost, and this results in crash due to double destruction of the object host. I don't know the reason why this happens only on the GCC toolchain, but I suspect the order of object destruction on std::map::erase() could be different depending on the toolchains. > How does this CL fix this? The ideal fix is to redesign the ownership model of ServiceWorkerVersion, but it's not feasible in the short term. Instead, this CL avoids destruction of ServiceWorkerObjectHost on std::map::erase(). The new code takes the ownership of the object host from the map first, and then erases the entry from the map. This separates timings to erase the map entry and to destroy the object host, so the crash should no longer happen. Bug: 1056598 Change-Id: Id30654cb575bc557c42044d6f0c6f1f9bfaed613 --- diff --git a/content/browser/service_worker/service_worker_container_host.cc b/content/browser/service_worker/service_worker_container_host.cc index c631bcd..ff917f8 100644 --- a/content/browser/service_worker/service_worker_container_host.cc +++ b/content/browser/service_worker/service_worker_container_host.cc @@ -717,6 +717,16 @@ int64_t version_id) { DCHECK_CURRENTLY_ON(ServiceWorkerContext::GetCoreThreadId()); DCHECK(base::Contains(service_worker_object_hosts_, version_id)); + + // ServiceWorkerObjectHost to be deleted may have the last reference to + // ServiceWorkerVersion that indirectly owns this ServiceWorkerContainerHost. + // If we erase the object host directly from the map, |this| could be deleted + // during the map operation and may crash. To avoid the case, we take the + // ownership of the object host from the map first, and then erase the entry + // from the map. See https://crbug.com/1056598 for details. + std::unique_ptr<ServiceWorkerObjectHost> to_be_deleted = + std::move(service_worker_object_hosts_[version_id]); + DCHECK(to_be_deleted); service_worker_object_hosts_.erase(version_id); } diff --git a/content/browser/service_worker/service_worker_object_host_unittest.cc b/content/browser/service_worker/service_worker_object_host_unittest.cc index 238cb8b..f60c7a2 100644 --- a/content/browser/service_worker/service_worker_object_host_unittest.cc +++ b/content/browser/service_worker/service_worker_object_host_unittest.cc @@ -200,6 +200,19 @@ return registration_info; } + void CallOnConnectionError(ServiceWorkerContainerHost* container_host, + int64_t version_id) { + // ServiceWorkerObjectHost has the last reference to the version. + ServiceWorkerObjectHost* object_host = + GetServiceWorkerObjectHost(container_host, version_id); + EXPECT_TRUE(object_host->version_->HasOneRef()); + + // Make sure that OnConnectionError induces destruction of the version and + // the object host. + object_host->receivers_.Clear(); + object_host->OnConnectionError(); + } + BrowserTaskEnvironment task_environment_; std::unique_ptr<EmbeddedWorkerTestHelper> helper_; scoped_refptr<ServiceWorkerRegistration> registration_; @@ -409,5 +422,30 @@ events[0]->source_info_for_client->client_type); } +// This is a regression test for https://crbug.com/1056598. +TEST_F(ServiceWorkerObjectHostTest, OnConnectionError) { + const GURL scope("https://www.example.com/"); + const GURL script_url("https://www.example.com/service_worker.js"); + Initialize(std::make_unique<EmbeddedWorkerTestHelper>(base::FilePath())); + SetUpRegistration(scope, script_url); + + // Create the provider host. + ASSERT_EQ(blink::ServiceWorkerStatusCode::kOk, + StartServiceWorker(version_.get())); + + // Set up the case where the last reference to the version is owned by the + // service worker object host. + ServiceWorkerContainerHost* container_host = + version_->provider_host()->container_host(); + ServiceWorkerVersion* version_rawptr = version_.get(); + version_ = nullptr; + ASSERT_TRUE(version_rawptr->HasOneRef()); + + // Simulate the connection error that induces the object host destruction. + // This shouldn't crash. + CallOnConnectionError(container_host, version_rawptr->version_id()); + base::RunLoop().RunUntilIdle(); +} + } // namespace service_worker_object_host_unittest } // namespace content ++++++ chromium-83-gcc-template.patch ++++++ >From 8d115ddda495d0d2e1e1447392db6e9e6a8a1b32 Mon Sep 17 00:00:00 2001 From: Stephan Hartmann <[email protected]> Date: Tue, 07 Apr 2020 00:23:57 +0000 Subject: [PATCH] GCC: fix template specialization in WTF::VectorMover GCC complains that explicit specialization in non-namespace scope is happening for MoveOverlappingImpl. However, secialization is not really necessary here with templates and can be moved into MoveOverlappingImpl method without changing generated code. Bug: 819294 Change-Id: I90b893b9701748302f7b900fbcc2c341685fe0d3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2126290 Reviewed-by: Kent Tamura <[email protected]> Commit-Queue: Kent Tamura <[email protected]> Cr-Commit-Position: refs/heads/master@{#756880} --- diff --git a/third_party/blink/renderer/platform/wtf/vector.h b/third_party/blink/renderer/platform/wtf/vector.h index 632d308..82aaf96 100644 --- a/third_party/blink/renderer/platform/wtf/vector.h +++ b/third_party/blink/renderer/platform/wtf/vector.h @@ -205,30 +205,23 @@ } } - template <bool = Allocator::kIsGarbageCollected> - static void MoveOverlappingImpl(const T* src, const T* src_end, T* dst); - template <> - static void MoveOverlappingImpl<false>(const T* src, - const T* src_end, - T* dst) { - memmove(dst, src, - reinterpret_cast<const char*>(src_end) - - reinterpret_cast<const char*>(src)); - } - template <> - static void MoveOverlappingImpl<true>(const T* src, - const T* src_end, - T* dst) { - if (src == dst) - return; - if (dst < src) { - for (; src < src_end; ++src, ++dst) - AtomicWriteMemcpy<sizeof(T)>(dst, src); + static void MoveOverlappingImpl(const T* src, const T* src_end, T* dst) { + if (Allocator::kIsGarbageCollected) { + if (src == dst) + return; + if (dst < src) { + for (; src < src_end; ++src, ++dst) + AtomicWriteMemcpy<sizeof(T)>(dst, src); + } else { + --src_end; + T* dst_end = dst + (src_end - src); + for (; src_end >= src; --src_end, --dst_end) + AtomicWriteMemcpy<sizeof(T)>(dst_end, src_end); + } } else { - --src_end; - T* dst_end = dst + (src_end - src); - for (; src_end >= src; --src_end, --dst_end) - AtomicWriteMemcpy<sizeof(T)>(dst_end, src_end); + memmove(dst, src, + reinterpret_cast<const char*>(src_end) - + reinterpret_cast<const char*>(src)); } } ++++++ chromium-83-icu67.patch ++++++ >From 3f8dc4b2e5baf77b463334c769af85b79d8c1463 Mon Sep 17 00:00:00 2001 From: Frank Tang <[email protected]> Date: Fri, 03 Apr 2020 23:13:54 -0700 Subject: [PATCH] [intl] Remove soon-to-be removed getAllFieldPositions Needed to land ICU67.1 soon. Bug: v8:10393 Change-Id: I3c7737ca600d6ccfdc46ffaddfb318ce60bc7618 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2136489 Reviewed-by: Jakob Kummerow <[email protected]> Commit-Queue: Frank Tang <[email protected]> Cr-Commit-Position: refs/heads/master@{#67027} --- diff --git a/v8/src/objects/js-number-format.cc b/v8/src/objects/js-number-format.cc index ad831c5..bcd4403 100644 --- a/v8/src/objects/js-number-format.cc +++ b/v8/src/objects/js-number-format.cc @@ -1241,44 +1241,33 @@ } namespace { -Maybe<icu::UnicodeString> IcuFormatNumber( +Maybe<bool> IcuFormatNumber( Isolate* isolate, const icu::number::LocalizedNumberFormatter& number_format, - Handle<Object> numeric_obj, icu::FieldPositionIterator* fp_iter) { + Handle<Object> numeric_obj, icu::number::FormattedNumber* formatted) { // If it is BigInt, handle it differently. UErrorCode status = U_ZERO_ERROR; - icu::number::FormattedNumber formatted; if (numeric_obj->IsBigInt()) { Handle<BigInt> big_int = Handle<BigInt>::cast(numeric_obj); Handle<String> big_int_string; ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, big_int_string, BigInt::ToString(isolate, big_int), - Nothing<icu::UnicodeString>()); - formatted = number_format.formatDecimal( + Nothing<bool>()); + *formatted = number_format.formatDecimal( {big_int_string->ToCString().get(), big_int_string->length()}, status); } else { double number = numeric_obj->IsNaN() ? std::numeric_limits<double>::quiet_NaN() : numeric_obj->Number(); - formatted = number_format.formatDouble(number, status); + *formatted = number_format.formatDouble(number, status); } if (U_FAILURE(status)) { // This happen because of icu data trimming trim out "unit". // See https://bugs.chromium.org/p/v8/issues/detail?id=8641 - THROW_NEW_ERROR_RETURN_VALUE(isolate, - NewTypeError(MessageTemplate::kIcuError), - Nothing<icu::UnicodeString>()); + THROW_NEW_ERROR_RETURN_VALUE( + isolate, NewTypeError(MessageTemplate::kIcuError), Nothing<bool>()); } - if (fp_iter) { - formatted.getAllFieldPositions(*fp_iter, status); - } - icu::UnicodeString result = formatted.toString(status); - if (U_FAILURE(status)) { - THROW_NEW_ERROR_RETURN_VALUE(isolate, - NewTypeError(MessageTemplate::kIcuError), - Nothing<icu::UnicodeString>()); - } - return Just(result); + return Just(true); } } // namespace @@ -1289,10 +1278,16 @@ Handle<Object> numeric_obj) { DCHECK(numeric_obj->IsNumeric()); - Maybe<icu::UnicodeString> maybe_format = - IcuFormatNumber(isolate, number_format, numeric_obj, nullptr); + icu::number::FormattedNumber formatted; + Maybe<bool> maybe_format = + IcuFormatNumber(isolate, number_format, numeric_obj, &formatted); MAYBE_RETURN(maybe_format, Handle<String>()); - return Intl::ToString(isolate, maybe_format.FromJust()); + UErrorCode status = U_ZERO_ERROR; + icu::UnicodeString result = formatted.toString(status); + if (U_FAILURE(status)) { + THROW_NEW_ERROR(isolate, NewTypeError(MessageTemplate::kIcuError), String); + } + return Intl::ToString(isolate, result); } namespace { @@ -1405,12 +1400,18 @@ } namespace { -Maybe<int> ConstructParts(Isolate* isolate, const icu::UnicodeString& formatted, - icu::FieldPositionIterator* fp_iter, +Maybe<int> ConstructParts(Isolate* isolate, + icu::number::FormattedNumber* formatted, Handle<JSArray> result, int start_index, Handle<Object> numeric_obj, bool style_is_unit) { + UErrorCode status = U_ZERO_ERROR; + icu::UnicodeString formatted_text = formatted->toString(status); + if (U_FAILURE(status)) { + THROW_NEW_ERROR_RETURN_VALUE( + isolate, NewTypeError(MessageTemplate::kIcuError), Nothing<int>()); + } DCHECK(numeric_obj->IsNumeric()); - int32_t length = formatted.length(); + int32_t length = formatted_text.length(); int index = start_index; if (length == 0) return Just(index); @@ -1419,13 +1420,14 @@ // other region covers some part of the formatted string. It's possible // there's another field with exactly the same begin and end as this backdrop, // in which case the backdrop's field_id of -1 will give it lower priority. - regions.push_back(NumberFormatSpan(-1, 0, formatted.length())); + regions.push_back(NumberFormatSpan(-1, 0, formatted_text.length())); { - icu::FieldPosition fp; - while (fp_iter->next(fp)) { - regions.push_back(NumberFormatSpan(fp.getField(), fp.getBeginIndex(), - fp.getEndIndex())); + icu::ConstrainedFieldPosition cfp; + cfp.constrainCategory(UFIELD_CATEGORY_NUMBER); + while (formatted->nextPosition(cfp, status)) { + regions.push_back( + NumberFormatSpan(cfp.getField(), cfp.getStart(), cfp.getLimit())); } } @@ -1447,7 +1449,7 @@ Handle<String> substring; ASSIGN_RETURN_ON_EXCEPTION_VALUE( isolate, substring, - Intl::ToString(isolate, formatted, part.begin_pos, part.end_pos), + Intl::ToString(isolate, formatted_text, part.begin_pos, part.end_pos), Nothing<int>()); Intl::AddElement(isolate, result, index, field_type_string, substring); ++index; @@ -1467,20 +1469,19 @@ number_format->icu_number_formatter().raw(); CHECK_NOT_NULL(fmt); - icu::FieldPositionIterator fp_iter; - Maybe<icu::UnicodeString> maybe_format = - IcuFormatNumber(isolate, *fmt, numeric_obj, &fp_iter); + icu::number::FormattedNumber formatted; + Maybe<bool> maybe_format = + IcuFormatNumber(isolate, *fmt, numeric_obj, &formatted); MAYBE_RETURN(maybe_format, Handle<JSArray>()); - UErrorCode status = U_ZERO_ERROR; + bool style_is_unit = Style::UNIT == StyleFromSkeleton(fmt->toSkeleton(status)); CHECK(U_SUCCESS(status)); Handle<JSArray> result = factory->NewJSArray(0); - Maybe<int> maybe_format_to_parts = - ConstructParts(isolate, maybe_format.FromJust(), &fp_iter, result, 0, - numeric_obj, style_is_unit); + Maybe<int> maybe_format_to_parts = ConstructParts( + isolate, &formatted, result, 0, numeric_obj, style_is_unit); MAYBE_RETURN(maybe_format_to_parts, Handle<JSArray>()); return result; ++++++ chromium-81.0.4044.138.tar.xz -> chromium-83.0.4103.61.tar.xz ++++++ /work/SRC/openSUSE:Factory/chromium/chromium-81.0.4044.138.tar.xz /work/SRC/openSUSE:Factory/.chromium.new.2738/chromium-83.0.4103.61.tar.xz differ: char 26, line 1 ++++++ chromium-vaapi.patch ++++++ --- /var/tmp/diff_new_pack.XaGPum/_old 2020-05-26 17:16:56.855667780 +0200 +++ /var/tmp/diff_new_pack.XaGPum/_new 2020-05-26 17:16:56.859667789 +0200 @@ -1,8 +1,8 @@ -Index: chromium-81.0.4040.5/chrome/browser/about_flags.cc +Index: chromium-83.0.4100.3/chrome/browser/about_flags.cc =================================================================== ---- chromium-81.0.4040.5.orig/chrome/browser/about_flags.cc -+++ chromium-81.0.4040.5/chrome/browser/about_flags.cc -@@ -1876,7 +1876,7 @@ const FeatureEntry kFeatureEntries[] = { +--- chromium-83.0.4100.3.orig/chrome/browser/about_flags.cc ++++ chromium-83.0.4100.3/chrome/browser/about_flags.cc +@@ -2128,7 +2128,7 @@ const FeatureEntry kFeatureEntries[] = { "disable-accelerated-video-decode", flag_descriptions::kAcceleratedVideoDecodeName, flag_descriptions::kAcceleratedVideoDecodeDescription, @@ -11,9 +11,9 @@ SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode), }, { -@@ -2311,10 +2311,10 @@ const FeatureEntry kFeatureEntries[] = { - FEATURE_VALUE_TYPE(service_manager::features::kXRSandbox)}, - #endif // !defined(OS_ANDROID) +@@ -2560,10 +2560,10 @@ const FeatureEntry kFeatureEntries[] = { + flag_descriptions::kWebXrForceRuntimeDescription, kOsDesktop, + MULTI_VALUE_TYPE(kWebXrForceRuntimeChoices)}, #endif // ENABLE_VR -#if defined(OS_CHROMEOS) +#if defined(OS_CHROMEOS) || defined(OS_LINUX) @@ -24,11 +24,11 @@ SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedMjpegDecode)}, #endif // OS_CHROMEOS {"system-keyboard-lock", flag_descriptions::kSystemKeyboardLockName, -Index: chromium-81.0.4040.5/chrome/browser/flag_descriptions.cc +Index: chromium-83.0.4100.3/chrome/browser/flag_descriptions.cc =================================================================== ---- chromium-81.0.4040.5.orig/chrome/browser/flag_descriptions.cc -+++ chromium-81.0.4040.5/chrome/browser/flag_descriptions.cc -@@ -3181,15 +3181,20 @@ const char kMetalDescription[] = +--- chromium-83.0.4100.3.orig/chrome/browser/flag_descriptions.cc ++++ chromium-83.0.4100.3/chrome/browser/flag_descriptions.cc +@@ -2967,15 +2967,20 @@ const char kMetalDescription[] = #endif @@ -51,11 +51,11 @@ const char kAggregatedMlAppRankingName[] = "Rank suggested apps with ML."; const char kAggregatedMlAppRankingDescription[] = -Index: chromium-81.0.4040.5/chrome/browser/flag_descriptions.h +Index: chromium-83.0.4100.3/chrome/browser/flag_descriptions.h =================================================================== ---- chromium-81.0.4040.5.orig/chrome/browser/flag_descriptions.h -+++ chromium-81.0.4040.5/chrome/browser/flag_descriptions.h -@@ -1882,11 +1882,15 @@ extern const char kPermissionPromptPersi +--- chromium-83.0.4100.3.orig/chrome/browser/flag_descriptions.h ++++ chromium-83.0.4100.3/chrome/browser/flag_descriptions.h +@@ -1705,11 +1705,15 @@ extern const char kMetalDescription[]; // Chrome OS ------------------------------------------------------------------ @@ -72,10 +72,10 @@ extern const char kAggregatedMlAppRankingName[]; extern const char kAggregatedMlAppRankingDescription[]; -Index: chromium-81.0.4040.5/gpu/config/software_rendering_list.json +Index: chromium-83.0.4100.3/gpu/config/software_rendering_list.json =================================================================== ---- chromium-81.0.4040.5.orig/gpu/config/software_rendering_list.json -+++ chromium-81.0.4040.5/gpu/config/software_rendering_list.json +--- chromium-83.0.4100.3.orig/gpu/config/software_rendering_list.json ++++ chromium-83.0.4100.3/gpu/config/software_rendering_list.json @@ -337,7 +337,7 @@ }, { @@ -93,11 +93,11 @@ "features": [ "accelerated_video_decode" ] -Index: beta/media/gpu/test/BUILD.gn +Index: chromium-83.0.4100.3/media/gpu/test/BUILD.gn =================================================================== ---- beta.orig/media/gpu/test/BUILD.gn -+++ beta/media/gpu/test/BUILD.gn -@@ -150,7 +150,7 @@ if (use_vaapi || use_v4l2_codec) { +--- chromium-83.0.4100.3.orig/media/gpu/test/BUILD.gn ++++ chromium-83.0.4100.3/media/gpu/test/BUILD.gn +@@ -179,7 +179,7 @@ if (use_vaapi || use_v4l2_codec) { } } @@ -106,16 +106,16 @@ static_library("local_gpu_memory_buffer_manager") { testonly = true sources = [ -Index: beta/media/mojo/services/gpu_mojo_media_client.cc +Index: chromium-83.0.4100.3/media/mojo/services/gpu_mojo_media_client.cc =================================================================== ---- beta.orig/media/mojo/services/gpu_mojo_media_client.cc -+++ beta/media/mojo/services/gpu_mojo_media_client.cc -@@ -157,7 +157,7 @@ GpuMojoMediaClient::GetSupportedVideoDec - supported_config_map[VideoDecoderImplementation::kAlternate] = - *d3d11_supported_configs_; +--- chromium-83.0.4100.3.orig/media/mojo/services/gpu_mojo_media_client.cc ++++ chromium-83.0.4100.3/media/mojo/services/gpu_mojo_media_client.cc +@@ -167,7 +167,7 @@ GpuMojoMediaClient::GetSupportedVideoDec + *d3d11_supported_configs_; + } -#elif BUILDFLAG(USE_CHROMEOS_MEDIA_ACCELERATION) +#elif defined(OS_CHROMEOS) && BUILDFLAG(USE_CHROMEOS_MEDIA_ACCELERATION) - if (base::FeatureList::IsEnabled(kChromeosVideoDecoder)) { + if (IsNewAcceleratedVideoDecoderUsed(gpu_preferences_)) { if (!cros_supported_configs_) { cros_supported_configs_ =
