[arch-commits] Commit in electron/trunk (6 files)
Nicola Squartini
tensor5 at archlinux.org
Thu Mar 11 20:20:07 UTC 2021
Date: Thursday, March 11, 2021 @ 20:20:07
Author: tensor5
Revision: 887575
upgpkg: electron 12.0.1-1
Added:
electron/trunk/x11-ozone-fix-two-edge-cases.patch
Modified:
electron/trunk/PKGBUILD
electron/trunk/electron-launcher.sh
Deleted:
electron/trunk/add-ctime-for-std-time.patch
electron/trunk/dcheck.patch
electron/trunk/don-t-crash-on-reentrant-RunMoveLoop-call.patch
-------------------------------------------------+
PKGBUILD | 29 ++--
add-ctime-for-std-time.patch | 27 ----
dcheck.patch | 13 --
don-t-crash-on-reentrant-RunMoveLoop-call.patch | 33 -----
electron-launcher.sh | 7 -
x11-ozone-fix-two-edge-cases.patch | 135 ++++++++++++++++++++++
6 files changed, 155 insertions(+), 89 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2021-03-11 19:59:09 UTC (rev 887574)
+++ PKGBUILD 2021-03-11 20:20:07 UTC (rev 887575)
@@ -1,10 +1,11 @@
# Maintainer: Nicola Squartini <tensor5 at gmail.com>
pkgname=electron
-pkgver=12.0.0
-_commit=3ae63c9a06a4b5c9074572ee8b7137520fe4ba4e
-_chromiumver=89.0.4389.69
-pkgrel=2
+pkgver=12.0.1
+_commit=05972074e3f1022866ccb31ce259cc82a31dac36
+_chromiumver=89.0.4389.82
+_gcc_patchset=7
+pkgrel=1
pkgdesc='Build cross platform desktop apps with web technologies'
arch=('x86_64')
url='https://electronjs.org/'
@@ -20,27 +21,25 @@
"xdg-utils: open URLs with desktop's default (xdg-email, xdg-open)")
source=('git+https://github.com/electron/electron.git'
'git+https://chromium.googlesource.com/chromium/tools/depot_tools.git'
+ "https://github.com/stha09/chromium-patches/releases/download/chromium-${_chromiumver%%.*}-patchset-${_gcc_patchset}/chromium-${_chromiumver%%.*}-patchset-${_gcc_patchset}.tar.xz"
"${pkgname}-launcher.sh"
"${pkgname}.desktop"
'default_app-icon.patch'
'use-system-libraries-in-node.patch'
- 'add-ctime-for-std-time.patch'
'add-dependency-on-opus-in-webcodecs.patch'
'chromium-glibc-2.33.patch'
- 'dcheck.patch'
- 'don-t-crash-on-reentrant-RunMoveLoop-call.patch'
+ 'x11-ozone-fix-two-edge-cases.patch'
)
sha256sums=('SKIP'
'SKIP'
- 'a62a5c29aac971f14fe76ebaaf6e573391716e231c98a46b95916976b4d17535'
+ 'f8b1558f6c87b33423da854d42f0f69d47885a96d6bf6ce7f26373e93d47442f'
+ '20c50e217fcb20f72fd2b465ad19659abe51feff4814515767a3065a009d58a5'
'5270db01f3f8aaa5137dec275a02caa832b7f2e37942e068cba8d28b3a29df39'
'dd2d248831dd4944d385ebf008426e66efe61d6fdf66f8932c963a12167947b4'
'f16103daf05713dea632b5f01e45db20ff12d1770a6539b4e8d3957a0242dd54'
- '102e0c976c0d7fd1fbe2f2978ec621499a97b62457b3fde4daf84f026d1a53a7'
'b86b11de8db438c47f0a84c7956740f648d21035f4ee46bfbd50c3348d369121'
'2fccecdcd4509d4c36af873988ca9dbcba7fdb95122894a9fdf502c33a1d7a4b'
- '6eb71b2b9a94f45c2dcce8ddd1c2c8a84f7874edd133b8b2d872bac8d3d96c25'
- '615f5fefc94da605957edb34b6c000f32953fb5ff6ffb321f062dab8e0fef9d3'
+ '9e4743bdeaf5b668659ad53400e3977006916aac3a7ba045bbc750b7b4cbf274'
)
_system_libs=('ffmpeg'
@@ -125,11 +124,13 @@
cd ..
echo "Applying local patches..."
- patch -Np1 -i ../add-ctime-for-std-time.patch
+ # Fixes for building with libstdc++ instead of libc++
+ patch -Np1 -i ../patches/chromium-89-quiche-dcheck.patch
+ patch -Np1 -i ../patches/chromium-89-AXTreeSerializer-include.patch
+
patch -Np1 -i ../add-dependency-on-opus-in-webcodecs.patch
patch -Np1 -i ../chromium-glibc-2.33.patch
- patch -Np1 -d net/third_party/quiche/src < ../dcheck.patch
- patch -Np1 -i ../don-t-crash-on-reentrant-RunMoveLoop-call.patch
+ patch -Np1 -i ../x11-ozone-fix-two-edge-cases.patch
patch -Np1 -i ../use-system-libraries-in-node.patch
patch -Np1 -i ../default_app-icon.patch # Icon from .desktop file
Deleted: add-ctime-for-std-time.patch
===================================================================
--- add-ctime-for-std-time.patch 2021-03-11 19:59:09 UTC (rev 887574)
+++ add-ctime-for-std-time.patch 2021-03-11 20:20:07 UTC (rev 887575)
@@ -1,27 +0,0 @@
-From c06ddc4935bf1394812c011ce5d93898ccc8a53a Mon Sep 17 00:00:00 2001
-From: Stephan Hartmann <stha09 at googlemail.com>
-Date: Tue, 9 Feb 2021 19:22:57 +0000
-Subject: [PATCH] IWYU: add ctime for std::time
-
-Bug: None
-Change-Id: I8bdae43209984242b9f5e538d74ece4409b65e3c
-Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2679610
-Reviewed-by: Katie Dektar <katie at chromium.org>
-Commit-Queue: Katie Dektar <katie at chromium.org>
-Cr-Commit-Position: refs/heads/master@{#852287}
----
- ui/accessibility/ax_tree_serializer.h | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/ui/accessibility/ax_tree_serializer.h b/ui/accessibility/ax_tree_serializer.h
-index ddbbdcdc25c53..1790e3b791967 100644
---- a/ui/accessibility/ax_tree_serializer.h
-+++ b/ui/accessibility/ax_tree_serializer.h
-@@ -8,6 +8,7 @@
- #include <stddef.h>
- #include <stdint.h>
-
-+#include <ctime>
- #include <ostream>
- #include <unordered_map>
- #include <unordered_set>
Deleted: dcheck.patch
===================================================================
--- dcheck.patch 2021-03-11 19:59:09 UTC (rev 887574)
+++ dcheck.patch 2021-03-11 20:20:07 UTC (rev 887575)
@@ -1,13 +0,0 @@
-diff --git a/quic/core/quic_path_validator.cc b/quic/core/quic_path_validator.cc
-index ee446cc..0cc387f 100644
---- a/quic/core/quic_path_validator.cc
-+++ b/quic/core/quic_path_validator.cc
-@@ -68,7 +68,7 @@
- void QuicPathValidator::StartPathValidation(
- std::unique_ptr<QuicPathValidationContext> context,
- std::unique_ptr<ResultDelegate> result_delegate) {
-- DCHECK_NE(nullptr, context);
-+ DCHECK(context);
- QUIC_DLOG(INFO) << "Start validating path " << *context
- << " via writer: " << context->WriterToUse();
- if (path_context_ != nullptr) {
Deleted: don-t-crash-on-reentrant-RunMoveLoop-call.patch
===================================================================
--- don-t-crash-on-reentrant-RunMoveLoop-call.patch 2021-03-11 19:59:09 UTC (rev 887574)
+++ don-t-crash-on-reentrant-RunMoveLoop-call.patch 2021-03-11 20:20:07 UTC (rev 887575)
@@ -1,33 +0,0 @@
-From 4b05247f43d592ce748933963df923d9a40705f8 Mon Sep 17 00:00:00 2001
-From: Sigurdur Asgeirsson <siggi at chromium.org>
-Date: Mon, 8 Feb 2021 18:36:10 +0000
-Subject: [PATCH] Don't crash on reentrant RunMoveLoop call.
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Bug: 1173484
-Change-Id: Ia75b200d2826586080c26089751bef1d12c8fbce
-Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2680089
-Reviewed-by: Scott Violet <sky at chromium.org>
-Commit-Queue: Sigurður Ásgeirsson <siggi at chromium.org>
-Cr-Commit-Position: refs/heads/master@{#851799}
----
- chrome/browser/ui/views/tabs/tab_drag_controller.cc | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller.cc b/chrome/browser/ui/views/tabs/tab_drag_controller.cc
-index 16c3c1e9df8c2..d2ccc2b965237 100644
---- a/chrome/browser/ui/views/tabs/tab_drag_controller.cc
-+++ b/chrome/browser/ui/views/tabs/tab_drag_controller.cc
-@@ -1397,6 +1397,10 @@ void TabDragController::RunMoveLoop(const gfx::Vector2d& drag_offset) {
-
- move_loop_widget_ = GetAttachedBrowserWidget();
- DCHECK(move_loop_widget_);
-+
-+ // RunMoveLoop can be called reentrantly from within another RunMoveLoop,
-+ // in which case the observation is already established.
-+ widget_observation_.Reset();
- widget_observation_.Observe(move_loop_widget_);
- current_state_ = DragState::kDraggingWindow;
- base::WeakPtr<TabDragController> ref(weak_factory_.GetWeakPtr());
Modified: electron-launcher.sh
===================================================================
--- electron-launcher.sh 2021-03-11 19:59:09 UTC (rev 887574)
+++ electron-launcher.sh 2021-03-11 20:20:07 UTC (rev 887575)
@@ -1,7 +1,10 @@
#!/usr/bin/bash
-flags_file="${XDG_CONFIG_HOME:-$HOME/.config}/electron-flags.conf"
+set -euo pipefail
+name=electron
+flags_file="${XDG_CONFIG_HOME:-$HOME/.config}/${name}-flags.conf"
+
declare -a flags
if [[ -f "${flags_file}" ]]; then
@@ -14,4 +17,4 @@
fi
done
-exec /usr/lib/electron/electron "${flags[@]}"
+exec /usr/lib/${name}/electron "$@" "${flags[@]}"
Added: x11-ozone-fix-two-edge-cases.patch
===================================================================
--- x11-ozone-fix-two-edge-cases.patch (rev 0)
+++ x11-ozone-fix-two-edge-cases.patch 2021-03-11 20:20:07 UTC (rev 887575)
@@ -0,0 +1,135 @@
+From 5e3a738b1204941aab9f15c0eb3d06e20fefd96e Mon Sep 17 00:00:00 2001
+From: Scott Violet <sky at chromium.org>
+Date: Mon, 8 Mar 2021 21:07:39 +0000
+Subject: [PATCH] x11/ozone: fix two edge cases
+
+WindowTreeHost::OnHostMovedInPixels() may trigger a nested message
+loop (tab dragging), which when the stack unravels means this may
+be deleted. This adds an early out if this happens.
+
+X11WholeScreenMoveLoop has a similar issue, in so far as notifying
+the delegate may delete this.
+
+BUG=1185482
+TEST=WindowTreeHostPlatform.DeleteHostFromOnHostMovedInPixels
+
+Change-Id: Ieca1c90b3e4358da50b332abe2941fdbb50c5c25
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2743555
+Reviewed-by: Thomas Anderson <thomasanderson at chromium.org>
+Commit-Queue: Scott Violet <sky at chromium.org>
+Cr-Commit-Position: refs/heads/master@{#860852}
+---
+ ui/aura/window_tree_host_platform.cc | 10 ++++-
+ ui/aura/window_tree_host_platform_unittest.cc | 40 ++++++++++++++++++-
+ ui/base/x/x11_whole_screen_move_loop.cc | 4 ++
+ 3 files changed, 51 insertions(+), 3 deletions(-)
+
+diff --git a/ui/aura/window_tree_host_platform.cc b/ui/aura/window_tree_host_platform.cc
+index ce8395fe07..7589542026 100644
+--- a/ui/aura/window_tree_host_platform.cc
++++ b/ui/aura/window_tree_host_platform.cc
+@@ -214,13 +214,21 @@ void WindowTreeHostPlatform::OnBoundsChanged(const gfx::Rect& new_bounds) {
+ float current_scale = compositor()->device_scale_factor();
+ float new_scale = ui::GetScaleFactorForNativeView(window());
+ gfx::Rect old_bounds = bounds_in_pixels_;
++ auto weak_ref = GetWeakPtr();
+ bounds_in_pixels_ = new_bounds;
+- if (bounds_in_pixels_.origin() != old_bounds.origin())
++ if (bounds_in_pixels_.origin() != old_bounds.origin()) {
+ OnHostMovedInPixels(bounds_in_pixels_.origin());
++ // Changing the bounds may destroy this.
++ if (!weak_ref)
++ return;
++ }
+ if (bounds_in_pixels_.size() != old_bounds.size() ||
+ current_scale != new_scale) {
+ pending_size_ = gfx::Size();
+ OnHostResizedInPixels(bounds_in_pixels_.size());
++ // Changing the size may destroy this.
++ if (!weak_ref)
++ return;
+ }
+ DCHECK_GT(on_bounds_changed_recursion_depth_, 0);
+ if (--on_bounds_changed_recursion_depth_ == 0) {
+diff --git a/ui/aura/window_tree_host_platform_unittest.cc b/ui/aura/window_tree_host_platform_unittest.cc
+index eda14e2f0c..4de039c88a 100644
+--- a/ui/aura/window_tree_host_platform_unittest.cc
++++ b/ui/aura/window_tree_host_platform_unittest.cc
+@@ -34,7 +34,7 @@ class TestWindowTreeHost : public WindowTreeHostPlatform {
+ // OnHostWill/DidProcessBoundsChange. Additionally, this triggers a bounds
+ // change from within OnHostResized(). Such a scenario happens in production
+ // code.
+-class TestWindowTreeHostObserver : public aura::WindowTreeHostObserver {
++class TestWindowTreeHostObserver : public WindowTreeHostObserver {
+ public:
+ TestWindowTreeHostObserver(WindowTreeHostPlatform* host,
+ ui::PlatformWindow* platform_window)
+@@ -51,7 +51,7 @@ class TestWindowTreeHostObserver : public aura::WindowTreeHostObserver {
+ return on_host_will_process_bounds_change_count_;
+ }
+
+- // aura::WindowTreeHostObserver:
++ // WindowTreeHostObserver:
+ void OnHostResized(WindowTreeHost* host) override {
+ if (!should_change_bounds_in_on_resized_)
+ return;
+@@ -92,5 +92,41 @@ TEST_F(WindowTreeHostPlatformTest, HostWillProcessBoundsChangeRecursion) {
+ EXPECT_EQ(1, observer.on_host_will_process_bounds_change_count());
+ }
+
++// Deletes WindowTreeHostPlatform from OnHostMovedInPixels().
++class DeleteHostWindowTreeHostObserver : public WindowTreeHostObserver {
++ public:
++ explicit DeleteHostWindowTreeHostObserver(
++ std::unique_ptr<TestWindowTreeHost> host)
++ : host_(std::move(host)) {
++ host_->AddObserver(this);
++ }
++ ~DeleteHostWindowTreeHostObserver() override = default;
++
++ TestWindowTreeHost* host() { return host_.get(); }
++
++ // WindowTreeHostObserver:
++ void OnHostMovedInPixels(WindowTreeHost* host,
++ const gfx::Point& new_origin_in_pixels) override {
++ host_->RemoveObserver(this);
++ host_.reset();
++ }
++
++ private:
++ std::unique_ptr<TestWindowTreeHost> host_;
++
++ DISALLOW_COPY_AND_ASSIGN(DeleteHostWindowTreeHostObserver);
++};
++
++// Verifies WindowTreeHostPlatform can be safely deleted when calling
++// OnHostMovedInPixels().
++// Regression test for https://crbug.com/1185482
++TEST_F(WindowTreeHostPlatformTest, DeleteHostFromOnHostMovedInPixels) {
++ std::unique_ptr<TestWindowTreeHost> host =
++ std::make_unique<TestWindowTreeHost>();
++ DeleteHostWindowTreeHostObserver observer(std::move(host));
++ observer.host()->SetBoundsInPixels(gfx::Rect(1, 2, 3, 4));
++ EXPECT_EQ(nullptr, observer.host());
++}
++
+ } // namespace
+ } // namespace aura
+diff --git a/ui/base/x/x11_whole_screen_move_loop.cc b/ui/base/x/x11_whole_screen_move_loop.cc
+index 5ed215db66..db678799db 100644
+--- a/ui/base/x/x11_whole_screen_move_loop.cc
++++ b/ui/base/x/x11_whole_screen_move_loop.cc
+@@ -78,9 +78,13 @@ X11WholeScreenMoveLoop::~X11WholeScreenMoveLoop() {
+ void X11WholeScreenMoveLoop::DispatchMouseMovement() {
+ if (!last_motion_in_screen_)
+ return;
++ auto weak_ref = weak_factory_.GetWeakPtr();
+ delegate_->OnMouseMovement(last_motion_in_screen_->root_location(),
+ last_motion_in_screen_->flags(),
+ last_motion_in_screen_->time_stamp());
++ // The delegate may delete this during dispatch.
++ if (!weak_ref)
++ return;
+ last_motion_in_screen_.reset();
+ }
+
More information about the arch-commits
mailing list