diff options
author | Daniel Playfair Cal | 2020-09-17 01:12:23 +1000 |
---|---|---|
committer | Daniel Playfair Cal | 2020-09-17 01:12:23 +1000 |
commit | ca80346839f67f0140e1f38889ecd13dde91f61c (patch) | |
tree | 763051b15942e13aba35d1aa94a86dad7b90a978 | |
parent | 10c7d4e63ef20eb603495d03bdb6f5ca8c82df27 (diff) | |
download | aur-ca80346839f67f0140e1f38889ecd13dde91f61c.tar.gz |
10.1.2-1
14 files changed, 145 insertions, 279 deletions
@@ -1,7 +1,7 @@ pkgbase = electron-ozone pkgdesc = Electron compiled with wayland support via Ozone - pkgver = 9.3.1 - pkgrel = 2 + pkgver = 10.1.2 + pkgrel = 1 url = https://electronjs.org/ arch = x86_64 license = MIT @@ -31,9 +31,7 @@ pkgbase = electron-ozone depends = gtk3 depends = http-parser depends = libevent - depends = libnghttp2 depends = libxslt - depends = libxss depends = minizip depends = nss depends = snappy @@ -49,7 +47,7 @@ pkgbase = electron-ozone source = default_app-icon.patch source = use-system-libraries-in-node.patch source = chromium-skia-harmony.patch - source = v8-remove-soon-to-be-removed-getAllFieldPositions.patch + source = media-Set-allocation-limit-compatible-with-FFmpeg-4.3.patch source = 0001-fix-use-ozone-version-of-global_shortcut_listener-wh.patch source = 0002-fix-don-t-include-global_menu_bar_x11-sources-in-ozo.patch source = 0003-fix-fix-ifdefs-and-add-NOTIMPLEMENTEDs-to-make-nativ.patch @@ -63,18 +61,18 @@ pkgbase = electron-ozone sha256sums = SKIP sha256sums = 5270db01f3f8aaa5137dec275a02caa832b7f2e37942e068cba8d28b3a29df39 sha256sums = 00b21418b9468064f6f275566d3cf64c6b014e596acc650100a5a46da31efbfa - sha256sums = c7eadac877179e586d0cce7f898aa1462b4c207733e68ecc17de9754b691713a + sha256sums = 50884820e07f7ce5ce55ee1ecdf610367a737e076c5029da0ab0d23154e7661d sha256sums = 771292942c0901092a402cc60ee883877a99fb804cb54d568c8c6c94565a48e1 - sha256sums = e042024423027ad3ef729a7e4709bdf9714aea49d64cfbbf46a645a05703abc2 - sha256sums = 3a9b265ebc978d6b5b165c0c0098e6e26db7ce41ae33daca01e5201bd151e72e - sha256sums = 28e87512ae5f3be5ce5312e6aedd26bffa2d26b3bca89f9e568d6b044ad16753 - sha256sums = 7e78b61a71609a041f2a45f4c20bd9f89fb4ccb6c48b2abb61faf474fcdd10e0 - sha256sums = 0e1e1c1980ac6c8de7918b74ec3949fe54addbf89f12d4b4ecfd537549b572b4 - sha256sums = f554de4c173ec3fb0d128fe72a3677ecbecfb74eea07b8a0fb0057b7e44e540c - sha256sums = d5dc4b7f050640daa015dd28b0aaba8b86681c3bb35288579c7bc10bb24f13c3 - sha256sums = 03d57fe77c7f4ad5f86e6f9e276b6e973b48df194e2bb56d7e24257924e16ec7 - sha256sums = d95a64cef0371910c19447549d53fa7155dcb17b6daa8a15a6964d34694bf5c8 - sha256sums = bf0e01722870f54e773ea674b7eec03c0cc3740b361d45654d4888004b410884 + sha256sums = 0f041d655335cd2a4773ae7ca5e301a0ff12c6c53f57b7cf6651c268e0420a1c + sha256sums = 1f93ae4176cdb6ee6c3517b35a2a34fbebdcfaa387e6a0fb5de701785ec17313 + sha256sums = 960ad1f120ffe5737ffa89eeb7086651b29fe766c085a863ff8effe92e7bac5d + sha256sums = 1a1ae23cabd98c248e75288ef55b517e23c5ca0a262953598179a2d0fbf82e18 + sha256sums = 322f5228f50a53223fba5bdadc7a0032a661336f13c714b921241ae3965e7d36 + sha256sums = 3d035ca6fb14f5e9042bb0b4cff23b5ef3e6ca51b97a0569b45e13740c518942 + sha256sums = b77f1aa5884108dfaf70d0cb321017adc289f805378c84d12d76ec9bea47f6f5 + sha256sums = 2b5d233350e42db67db39bfce712b7465313bef25a751af94f0c6fac79f56059 + sha256sums = 48545645d6d42a7034badf9130752dbd271d0de4cf3a188f2604a89064767978 + sha256sums = b85f7edf92be4678849196208e464028cb73f564b8adea98f191abf0995ed5c6 pkgname = electron-ozone diff --git a/0001-fix-use-ozone-version-of-global_shortcut_listener-wh.patch b/0001-fix-use-ozone-version-of-global_shortcut_listener-wh.patch index ff539577b968..64db2a4f8bcd 100644 --- a/0001-fix-use-ozone-version-of-global_shortcut_listener-wh.patch +++ b/0001-fix-use-ozone-version-of-global_shortcut_listener-wh.patch @@ -1,4 +1,4 @@ -From cbe7b6b0ad3504d50082ae12ea181399e12b8438 Mon Sep 17 00:00:00 2001 +From f99be8d3d819e5137b0d040148b2e28045dbb279 Mon Sep 17 00:00:00 2001 From: Daniel Playfair Cal <daniel.playfair.cal@gmail.com> Date: Mon, 25 Nov 2019 10:14:30 +1100 Subject: [PATCH 1/9] fix: use ozone version of global_shortcut_listener when @@ -9,10 +9,10 @@ Subject: [PATCH 1/9] fix: use ozone version of global_shortcut_listener when 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/chromium_src/BUILD.gn b/chromium_src/BUILD.gn -index ab6b3fc56..08749078d 100644 +index bd9d93afc..5fee10d90 100644 --- a/chromium_src/BUILD.gn +++ b/chromium_src/BUILD.gn -@@ -78,9 +78,19 @@ static_library("chrome") { +@@ -79,9 +79,19 @@ static_library("chrome") { if (is_linux) { sources += [ "//chrome/browser/icon_loader_auralinux.cc" ] diff --git a/0002-fix-don-t-include-global_menu_bar_x11-sources-in-ozo.patch b/0002-fix-don-t-include-global_menu_bar_x11-sources-in-ozo.patch index c7abbc0d9996..155b5f29a621 100644 --- a/0002-fix-don-t-include-global_menu_bar_x11-sources-in-ozo.patch +++ b/0002-fix-don-t-include-global_menu_bar_x11-sources-in-ozo.patch @@ -1,4 +1,4 @@ -From 4afec20c261865fb0cac9e88a2094f6291a1389b Mon Sep 17 00:00:00 2001 +From 5de27db7f4a795d3ab163536478ee60c6e3444e4 Mon Sep 17 00:00:00 2001 From: Daniel Playfair Cal <daniel.playfair.cal@gmail.com> Date: Mon, 25 Nov 2019 10:18:23 +1100 Subject: [PATCH 2/9] fix: don't include global_menu_bar_x11 sources in ozone @@ -9,7 +9,7 @@ Subject: [PATCH 2/9] fix: don't include global_menu_bar_x11 sources in ozone 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/filenames.gni b/filenames.gni -index f5f4c54b9..55306b1e1 100644 +index e5a158ed4..119593b97 100644 --- a/filenames.gni +++ b/filenames.gni @@ -1,3 +1,5 @@ @@ -27,7 +27,7 @@ index f5f4c54b9..55306b1e1 100644 "shell/app/command_line_args.cc", "shell/app/command_line_args.h", "shell/app/electron_content_client.cc", -@@ -376,8 +376,6 @@ filenames = { +@@ -383,8 +383,6 @@ filenames = { "shell/browser/ui/views/electron_views_delegate_win.cc", "shell/browser/ui/views/frameless_view.cc", "shell/browser/ui/views/frameless_view.h", @@ -36,7 +36,7 @@ index f5f4c54b9..55306b1e1 100644 "shell/browser/ui/views/inspectable_web_contents_view_views.cc", "shell/browser/ui/views/inspectable_web_contents_view_views.h", "shell/browser/ui/views/menu_bar.cc", -@@ -602,6 +600,15 @@ filenames = { +@@ -614,6 +612,15 @@ filenames = { "shell/utility/electron_content_utility_client.h", ] diff --git a/0003-fix-fix-ifdefs-and-add-NOTIMPLEMENTEDs-to-make-nativ.patch b/0003-fix-fix-ifdefs-and-add-NOTIMPLEMENTEDs-to-make-nativ.patch index a785352c063b..0cd618507112 100644 --- a/0003-fix-fix-ifdefs-and-add-NOTIMPLEMENTEDs-to-make-nativ.patch +++ b/0003-fix-fix-ifdefs-and-add-NOTIMPLEMENTEDs-to-make-nativ.patch @@ -1,4 +1,4 @@ -From c88738e5d77cb7698a0b06ec5b0ec170004ed61c Mon Sep 17 00:00:00 2001 +From 17275cd0a8a9592eed7ae196b70c1b2269ee4ce5 Mon Sep 17 00:00:00 2001 From: Daniel Playfair Cal <daniel.playfair.cal@gmail.com> Date: Mon, 25 Nov 2019 10:54:34 +1100 Subject: [PATCH 3/9] fix: fix ifdefs and add NOTIMPLEMENTEDs to make @@ -23,7 +23,7 @@ index c6029854e..2378acc0e 100644 #include "ui/gtk/gtk_util.h" #endif diff --git a/shell/browser/native_window_views.cc b/shell/browser/native_window_views.cc -index 81b09b6b2..677370a2d 100644 +index 83219e3fc..d5170dd38 100644 --- a/shell/browser/native_window_views.cc +++ b/shell/browser/native_window_views.cc @@ -43,13 +43,15 @@ @@ -44,7 +44,7 @@ index 81b09b6b2..677370a2d 100644 #include "shell/browser/ui/x/event_disabler.h" #include "shell/browser/ui/x/window_state_watcher.h" #include "shell/browser/ui/x/x_window_utils.h" -@@ -57,6 +59,8 @@ +@@ -58,6 +60,8 @@ #include "ui/gfx/x/x11_types.h" #include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h" #include "ui/views/window/native_frame_view.h" @@ -53,7 +53,7 @@ index 81b09b6b2..677370a2d 100644 #elif defined(OS_WIN) #include "shell/browser/ui/views/win_frame_view.h" #include "shell/browser/ui/win/electron_desktop_native_widget_aura.h" -@@ -433,9 +437,14 @@ bool NativeWindowViews::IsVisible() { +@@ -429,9 +433,14 @@ bool NativeWindowViews::IsVisible() { bool NativeWindowViews::IsEnabled() { #if defined(OS_WIN) return ::IsWindowEnabled(GetAcceleratedWidget()); @@ -69,7 +69,7 @@ index 81b09b6b2..677370a2d 100644 } void NativeWindowViews::IncrementChildModals() { -@@ -484,13 +493,17 @@ void NativeWindowViews::SetEnabledInternal(bool enable) { +@@ -480,13 +489,17 @@ void NativeWindowViews::SetEnabledInternal(bool enable) { #endif } @@ -88,7 +88,7 @@ index 81b09b6b2..677370a2d 100644 } #endif -@@ -800,9 +813,14 @@ bool NativeWindowViews::IsClosable() { +@@ -795,9 +808,14 @@ bool NativeWindowViews::IsClosable() { return false; } return !(info.fState & MFS_DISABLED); @@ -104,7 +104,7 @@ index 81b09b6b2..677370a2d 100644 } void NativeWindowViews::SetAlwaysOnTop(ui::ZOrderLevel z_order, -@@ -1370,9 +1388,14 @@ bool NativeWindowViews::CanMaximize() const { +@@ -1376,9 +1394,14 @@ bool NativeWindowViews::CanMaximize() const { bool NativeWindowViews::CanMinimize() const { #if defined(OS_WIN) return minimizable_; diff --git a/0004-fix-remove-various-x11-sources-from-filenames.gni-in.patch b/0004-fix-remove-various-x11-sources-from-filenames.gni-in.patch index 1d6094f1ebd0..399a9b7ab6c9 100644 --- a/0004-fix-remove-various-x11-sources-from-filenames.gni-in.patch +++ b/0004-fix-remove-various-x11-sources-from-filenames.gni-in.patch @@ -1,4 +1,4 @@ -From 3cc138d5296ef6f1f5f6fba8b5ca806ecba416a6 Mon Sep 17 00:00:00 2001 +From a5d51abeebd77220984c5fa26cd6c51cf7fffef8 Mon Sep 17 00:00:00 2001 From: Daniel Playfair Cal <daniel.playfair.cal@gmail.com> Date: Mon, 25 Nov 2019 10:58:21 +1100 Subject: [PATCH 4/9] fix: remove various x11 sources from filenames.gni in @@ -9,10 +9,10 @@ Subject: [PATCH 4/9] fix: remove various x11 sources from filenames.gni in 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/filenames.gni b/filenames.gni -index 55306b1e1..c4ef51829 100644 +index 119593b97..5e7869612 100644 --- a/filenames.gni +++ b/filenames.gni -@@ -406,12 +406,6 @@ filenames = { +@@ -413,12 +413,6 @@ filenames = { "shell/browser/ui/win/notify_icon_host.h", "shell/browser/ui/win/taskbar_host.cc", "shell/browser/ui/win/taskbar_host.h", @@ -25,7 +25,7 @@ index 55306b1e1..c4ef51829 100644 "shell/browser/unresponsive_suppressor.cc", "shell/browser/unresponsive_suppressor.h", "shell/browser/web_contents_permission_helper.cc", -@@ -606,6 +600,12 @@ filenames = { +@@ -618,6 +612,12 @@ filenames = { "chromium_src/chrome/browser/ui/views/frame/global_menu_bar_registrar_x11.h", "shell/browser/ui/views/global_menu_bar_x11.cc", "shell/browser/ui/views/global_menu_bar_x11.h", diff --git a/0005-fix-atom_browser_main_parts-move-non-X11-specific-th.patch b/0005-fix-atom_browser_main_parts-move-non-X11-specific-th.patch index 185bd8d4efbe..2657baf59cb7 100644 --- a/0005-fix-atom_browser_main_parts-move-non-X11-specific-th.patch +++ b/0005-fix-atom_browser_main_parts-move-non-X11-specific-th.patch @@ -1,15 +1,15 @@ -From 56d9190508d5adab3b762b0f0bba591125cd913b Mon Sep 17 00:00:00 2001 +From 81eb431da33ccde76e831558001e854c6adbe059 Mon Sep 17 00:00:00 2001 From: Daniel Playfair Cal <daniel.playfair.cal@gmail.com> Date: Mon, 25 Nov 2019 12:22:45 +1100 Subject: [PATCH 5/9] fix(atom_browser_main_parts): move non X11 specific things out of ifdefs --- - shell/browser/electron_browser_main_parts.cc | 38 +++++++++++--------- - 1 file changed, 21 insertions(+), 17 deletions(-) + shell/browser/electron_browser_main_parts.cc | 37 +++++++++++--------- + 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/shell/browser/electron_browser_main_parts.cc b/shell/browser/electron_browser_main_parts.cc -index 06f30ebc0..48d497d3f 100644 +index 635d3c070..7e3130ee2 100644 --- a/shell/browser/electron_browser_main_parts.cc +++ b/shell/browser/electron_browser_main_parts.cc @@ -10,6 +10,13 @@ @@ -26,7 +26,7 @@ index 06f30ebc0..48d497d3f 100644 #endif #include "base/base_switches.h" -@@ -61,19 +68,12 @@ +@@ -61,18 +68,12 @@ #endif #if defined(USE_X11) @@ -38,15 +38,14 @@ index 06f30ebc0..48d497d3f 100644 #include "ui/events/devices/x11/touch_factory_x11.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/x/x11_types.h" + #include "ui/gfx/x/xproto_util.h" -#include "ui/gtk/gtk_ui.h" -#include "ui/gtk/gtk_ui_delegate.h" - #include "ui/gtk/gtk_ui_delegate_x11.h" -#include "ui/gtk/gtk_util.h" --#include "ui/views/linux_ui/linux_ui.h" + #include "ui/gtk/x/gtk_ui_delegate_x11.h" + #include "ui/views/linux_ui/linux_ui.h" #endif - - #if defined(OS_WIN) -@@ -147,14 +147,7 @@ base::string16 MediaStringProvider(media::MessageId id) { +@@ -148,14 +149,7 @@ base::string16 MediaStringProvider(media::MessageId id) { } } @@ -62,7 +61,7 @@ index 06f30ebc0..48d497d3f 100644 void OverrideLinuxAppDataPath() { base::FilePath path; if (base::PathService::Get(DIR_APP_DATA, &path)) -@@ -164,6 +157,15 @@ void OverrideLinuxAppDataPath() { +@@ -165,6 +159,15 @@ void OverrideLinuxAppDataPath() { base::nix::kDotConfigDir); base::PathService::Override(DIR_APP_DATA, path); } @@ -78,7 +77,7 @@ index 06f30ebc0..48d497d3f 100644 int BrowserX11ErrorHandler(Display* d, XErrorEvent* error) { if (!g_in_x11_io_error_handler && base::ThreadTaskRunnerHandle::IsSet()) { -@@ -296,14 +298,16 @@ void ElectronBrowserMainParts::RegisterDestructionCallback( +@@ -288,14 +291,16 @@ void ElectronBrowserMainParts::RegisterDestructionCallback( int ElectronBrowserMainParts::PreEarlyInitialization() { field_trial_list_ = std::make_unique<base::FieldTrialList>(nullptr); @@ -96,7 +95,7 @@ index 06f30ebc0..48d497d3f 100644 #if defined(OS_POSIX) HandleSIGCHLD(); -@@ -357,7 +361,7 @@ int ElectronBrowserMainParts::PreCreateThreads() { +@@ -351,7 +356,7 @@ int ElectronBrowserMainParts::PreCreateThreads() { #if defined(USE_AURA) display::Screen* screen = views::CreateDesktopScreen(); display::Screen::SetScreenInstance(screen); diff --git a/0006-fix-add-ifdefs-around-some-X11-specific-code-to-focu.patch b/0006-fix-add-ifdefs-around-some-X11-specific-code-to-focu.patch index dd710a5a22a8..19482b15ded2 100644 --- a/0006-fix-add-ifdefs-around-some-X11-specific-code-to-focu.patch +++ b/0006-fix-add-ifdefs-around-some-X11-specific-code-to-focu.patch @@ -1,4 +1,4 @@ -From 4a796110b4e46957cdbeefa5771f5eb039b64196 Mon Sep 17 00:00:00 2001 +From ba1b3b361085e8d78739dd37b55a042ef3c8e751 Mon Sep 17 00:00:00 2001 From: Daniel Playfair Cal <daniel.playfair.cal@gmail.com> Date: Mon, 25 Nov 2019 13:46:20 +1100 Subject: [PATCH 6/9] fix: add ifdefs around some X11 specific code to focus @@ -10,7 +10,7 @@ Subject: [PATCH 6/9] fix: add ifdefs around some X11 specific code to focus 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/shell/browser/ui/file_dialog_gtk.cc b/shell/browser/ui/file_dialog_gtk.cc -index 146201f66..d9d371ac0 100644 +index a1693ce8a..25b5bf348 100644 --- a/shell/browser/ui/file_dialog_gtk.cc +++ b/shell/browser/ui/file_dialog_gtk.cc @@ -14,8 +14,11 @@ diff --git a/0007-stop-initializing-gtk_ui_delegate_-on-ozone.patch b/0007-stop-initializing-gtk_ui_delegate_-on-ozone.patch index f25865b10add..fea23152cc93 100644 --- a/0007-stop-initializing-gtk_ui_delegate_-on-ozone.patch +++ b/0007-stop-initializing-gtk_ui_delegate_-on-ozone.patch @@ -1,4 +1,4 @@ -From ed5cd85a68e2f13d8ff9d5ca9e2ba8c25c03b678 Mon Sep 17 00:00:00 2001 +From 4c78771d4d4bc5f0ab9116b1e7080f0f14b48a49 Mon Sep 17 00:00:00 2001 From: Daniel Playfair Cal <daniel.playfair.cal@gmail.com> Date: Sun, 14 Jun 2020 01:16:53 +1000 Subject: [PATCH 7/9] stop initializing gtk_ui_delegate_-on ozone @@ -9,10 +9,10 @@ Subject: [PATCH 7/9] stop initializing gtk_ui_delegate_-on ozone 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/shell/browser/electron_browser_main_parts.cc b/shell/browser/electron_browser_main_parts.cc -index 48d497d3f..81e74fc2e 100644 +index 7e3130ee2..06124cf01 100644 --- a/shell/browser/electron_browser_main_parts.cc +++ b/shell/browser/electron_browser_main_parts.cc -@@ -213,7 +213,9 @@ int X11EmptyErrorHandler(Display* d, XErrorEvent* error) { +@@ -215,7 +215,9 @@ int X11EmptyErrorHandler(Display* d, XErrorEvent* error) { int X11EmptyIOErrorHandler(Display* d) { return 0; } @@ -22,7 +22,7 @@ index 48d497d3f..81e74fc2e 100644 // GTK does not provide a way to check if current theme is dark, so we compare // the text and background luminosity to get a result. // This trick comes from FireFox. -@@ -231,7 +233,7 @@ void UpdateDarkThemeSetting() { +@@ -233,7 +235,7 @@ void UpdateDarkThemeSetting() { } // namespace @@ -31,7 +31,7 @@ index 48d497d3f..81e74fc2e 100644 class DarkThemeObserver : public ui::NativeThemeObserver { public: DarkThemeObserver() = default; -@@ -410,11 +412,13 @@ void ElectronBrowserMainParts::PostDestroyThreads() { +@@ -405,11 +407,13 @@ void ElectronBrowserMainParts::PostDestroyThreads() { } void ElectronBrowserMainParts::ToolkitInitialized() { @@ -47,7 +47,7 @@ index 48d497d3f..81e74fc2e 100644 linux_ui->Initialize(); diff --git a/shell/browser/electron_browser_main_parts.h b/shell/browser/electron_browser_main_parts.h -index f63a862ba..8f5101f37 100644 +index 446e3e1c2..dc7217eec 100644 --- a/shell/browser/electron_browser_main_parts.h +++ b/shell/browser/electron_browser_main_parts.h @@ -29,7 +29,7 @@ class WMState; diff --git a/0008-fix-change-some-X11-specific-ifdefs-to-linux.patch b/0008-fix-change-some-X11-specific-ifdefs-to-linux.patch index f6f376058750..c667ca7921cc 100644 --- a/0008-fix-change-some-X11-specific-ifdefs-to-linux.patch +++ b/0008-fix-change-some-X11-specific-ifdefs-to-linux.patch @@ -1,4 +1,4 @@ -From 43798092b1d2a17e8d6acd0199efdd5f4cb60a48 Mon Sep 17 00:00:00 2001 +From 834371edf6e85d5a63bfe2ad8df377d3db9e7390 Mon Sep 17 00:00:00 2001 From: Daniel Playfair Cal <daniel.playfair.cal@gmail.com> Date: Sat, 8 Aug 2020 12:00:35 +1000 Subject: [PATCH 8/9] fix: change some X11 specific ifdefs to linux @@ -13,10 +13,10 @@ Subject: [PATCH 8/9] fix: change some X11 specific ifdefs to linux 6 files changed, 22 insertions(+), 13 deletions(-) diff --git a/shell/browser/common_web_contents_delegate.h b/shell/browser/common_web_contents_delegate.h -index a7c4a8c0c..d923c3680 100644 +index 75ef90ffe..8165ff71c 100644 --- a/shell/browser/common_web_contents_delegate.h +++ b/shell/browser/common_web_contents_delegate.h -@@ -131,7 +131,7 @@ class CommonWebContentsDelegate : public content::WebContentsDelegate, +@@ -130,7 +130,7 @@ class CommonWebContentsDelegate : public content::WebContentsDelegate, #if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX) gfx::ImageSkia GetDevToolsWindowIcon() override; #endif @@ -48,7 +48,7 @@ index 45c785684..ca17e42c0 100644 std::string* name, std::string* class_name) { diff --git a/shell/browser/native_window_views.cc b/shell/browser/native_window_views.cc -index 677370a2d..9e78191ab 100644 +index d5170dd38..d9b650a87 100644 --- a/shell/browser/native_window_views.cc +++ b/shell/browser/native_window_views.cc @@ -46,11 +46,13 @@ @@ -67,15 +67,15 @@ index 677370a2d..9e78191ab 100644 #include "shell/browser/ui/views/global_menu_bar_x11.h" #include "shell/browser/ui/x/event_disabler.h" #include "shell/browser/ui/x/window_state_watcher.h" -@@ -58,7 +60,6 @@ - #include "ui/base/x/x11_util.h" +@@ -59,7 +61,6 @@ + #include "ui/gfx/x/x11_atom_cache.h" #include "ui/gfx/x/x11_types.h" #include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h" -#include "ui/views/window/native_frame_view.h" #endif #elif defined(OS_WIN) -@@ -194,7 +195,7 @@ NativeWindowViews::NativeWindowViews(const gin_helper::Dictionary& options, +@@ -195,7 +196,7 @@ NativeWindowViews::NativeWindowViews(const gin_helper::Dictionary& options, params.parent = parent->GetNativeWindow(); params.native_widget = new ElectronDesktopNativeWidgetAura(this); @@ -84,7 +84,7 @@ index 677370a2d..9e78191ab 100644 std::string name = Browser::Get()->GetName(); // Set WM_WINDOW_ROLE. params.wm_role_name = "browser-window"; -@@ -211,9 +212,11 @@ NativeWindowViews::NativeWindowViews(const gin_helper::Dictionary& options, +@@ -212,9 +213,11 @@ NativeWindowViews::NativeWindowViews(const gin_helper::Dictionary& options, std::string window_type; options.Get(options::kType, &window_type); @@ -96,17 +96,17 @@ index 677370a2d..9e78191ab 100644 // Set _GTK_THEME_VARIANT to dark if we have "dark-theme" option set. bool use_dark_theme = false; -@@ -221,6 +224,7 @@ NativeWindowViews::NativeWindowViews(const gin_helper::Dictionary& options, +@@ -222,6 +225,7 @@ NativeWindowViews::NativeWindowViews(const gin_helper::Dictionary& options, SetGTKDarkThemeEnabled(use_dark_theme); } +#if defined(USE_X11) // Before the window is mapped the SetWMSpecState can not work, so we have // to manually set the _NET_WM_STATE. - std::vector<::Atom> state_atom_list; -@@ -233,16 +237,20 @@ NativeWindowViews::NativeWindowViews(const gin_helper::Dictionary& options, + std::vector<x11::Atom> state_atom_list; +@@ -234,16 +238,20 @@ NativeWindowViews::NativeWindowViews(const gin_helper::Dictionary& options, if (fullscreen) { - state_atom_list.push_back(GetAtom("_NET_WM_STATE_FULLSCREEN")); + state_atom_list.push_back(gfx::GetAtom("_NET_WM_STATE_FULLSCREEN")); } +#endif @@ -117,7 +117,7 @@ index 677370a2d..9e78191ab 100644 +#if defined(USE_X11) // Modal window needs the _NET_WM_STATE_MODAL hint. if (is_modal()) - state_atom_list.push_back(GetAtom("_NET_WM_STATE_MODAL")); + state_atom_list.push_back(gfx::GetAtom("_NET_WM_STATE_MODAL")); +#endif } @@ -125,7 +125,7 @@ index 677370a2d..9e78191ab 100644 if (!state_atom_list.empty()) ui::SetAtomArrayProperty(GetAcceleratedWidget(), "_NET_WM_STATE", "ATOM", state_atom_list); -@@ -251,6 +259,7 @@ NativeWindowViews::NativeWindowViews(const gin_helper::Dictionary& options, +@@ -252,6 +260,7 @@ NativeWindowViews::NativeWindowViews(const gin_helper::Dictionary& options, if (!window_type.empty()) SetWindowType(GetAcceleratedWidget(), window_type); #endif @@ -133,7 +133,7 @@ index 677370a2d..9e78191ab 100644 #if defined(OS_WIN) if (!has_frame()) { -@@ -1145,7 +1154,7 @@ void NativeWindowViews::SetProgressBar(double progress, +@@ -1151,7 +1160,7 @@ void NativeWindowViews::SetProgressBar(double progress, NativeWindow::ProgressState state) { #if defined(OS_WIN) taskbar_host_.SetProgressBar(GetAcceleratedWidget(), progress, state); @@ -142,16 +142,16 @@ index 677370a2d..9e78191ab 100644 if (unity::IsRunning()) { unity::SetProgressFraction(progress); } -@@ -1200,7 +1209,7 @@ content::DesktopMediaID NativeWindowViews::GetDesktopMediaID() const { +@@ -1206,7 +1215,7 @@ content::DesktopMediaID NativeWindowViews::GetDesktopMediaID() const { #if defined(OS_WIN) window_handle = reinterpret_cast<content::DesktopMediaID::Id>(accelerated_widget); -#elif defined(USE_X11) +#elif defined(OS_LINUX) - window_handle = accelerated_widget; + window_handle = static_cast<uint32_t>(accelerated_widget); #endif aura::WindowTreeHost* const host = -@@ -1303,7 +1312,7 @@ void NativeWindowViews::SetIcon(HICON window_icon, HICON app_icon) { +@@ -1309,7 +1318,7 @@ void NativeWindowViews::SetIcon(HICON window_icon, HICON app_icon) { SendMessage(hwnd, WM_SETICON, ICON_BIG, reinterpret_cast<LPARAM>(app_icon_.get())); } @@ -187,10 +187,10 @@ index 73c4214d3..0f2acc3cf 100644 virtual void GetDevToolsWindowWMClass(std::string* name, std::string* class_name) {} diff --git a/shell/browser/ui/views/inspectable_web_contents_view_views.cc b/shell/browser/ui/views/inspectable_web_contents_view_views.cc -index d6321c8ff..6702c7a2c 100644 +index 62770dcbe..c73a3854a 100644 --- a/shell/browser/ui/views/inspectable_web_contents_view_views.cc +++ b/shell/browser/ui/views/inspectable_web_contents_view_views.cc -@@ -188,7 +188,7 @@ void InspectableWebContentsViewViews::SetIsDocked(bool docked, bool activate) { +@@ -186,7 +186,7 @@ void InspectableWebContentsViewViews::SetIsDocked(bool docked, bool activate) { params.delegate = devtools_window_delegate_; params.bounds = inspectable_web_contents()->GetDevToolsBounds(); diff --git a/0009-Remove-unnecessary-ozone-ifdefs-in-native-window-vie.patch b/0009-Remove-unnecessary-ozone-ifdefs-in-native-window-vie.patch index 75ef0be32d85..b7296f54a473 100644 --- a/0009-Remove-unnecessary-ozone-ifdefs-in-native-window-vie.patch +++ b/0009-Remove-unnecessary-ozone-ifdefs-in-native-window-vie.patch @@ -1,4 +1,4 @@ -From f17fa2c86d6ec89e71e0509253d92f244baf9385 Mon Sep 17 00:00:00 2001 +From a209af6d60ec28eda165a9195bd5e7fee40c82eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20H=C4=83loiu?= <valentin.haloiu@gmail.com> Date: Mon, 14 Sep 2020 19:30:50 +0200 Subject: [PATCH 9/9] Remove unnecessary ozone ifdefs in native window views @@ -8,10 +8,10 @@ Subject: [PATCH 9/9] Remove unnecessary ozone ifdefs in native window views 1 file changed, 14 deletions(-) diff --git a/shell/browser/native_window_views.cc b/shell/browser/native_window_views.cc -index 9e78191ab..bd34cc6b4 100644 +index d9b650a87..652be6846 100644 --- a/shell/browser/native_window_views.cc +++ b/shell/browser/native_window_views.cc -@@ -504,15 +504,11 @@ void NativeWindowViews::SetEnabledInternal(bool enable) { +@@ -500,15 +500,11 @@ void NativeWindowViews::SetEnabledInternal(bool enable) { #if defined(OS_LINUX) void NativeWindowViews::Maximize() { @@ -27,7 +27,7 @@ index 9e78191ab..bd34cc6b4 100644 } #endif -@@ -823,13 +819,8 @@ bool NativeWindowViews::IsClosable() { +@@ -818,13 +814,8 @@ bool NativeWindowViews::IsClosable() { } return !(info.fState & MFS_DISABLED); #elif defined(OS_LINUX) @@ -41,7 +41,7 @@ index 9e78191ab..bd34cc6b4 100644 } void NativeWindowViews::SetAlwaysOnTop(ui::ZOrderLevel z_order, -@@ -1398,13 +1389,8 @@ bool NativeWindowViews::CanMinimize() const { +@@ -1404,13 +1395,8 @@ bool NativeWindowViews::CanMinimize() const { #if defined(OS_WIN) return minimizable_; #elif defined(OS_LINUX) @@ -3,18 +3,18 @@ # Contributor: Valentin Hăloiu <vially.ichb@gmail.com> pkgname=electron-ozone -pkgver=9.3.1 +pkgver=10.1.2 provides=('electron') conflicts=('electron') -_commit=fe3378db92b76bd4dd14c11365c229a8be9954a7 -_chromiumver=83.0.4103.122 -pkgrel=2 +_commit=fbd99fbed1e78af18017c31af20a5baa934468b6 +_chromiumver=85.0.4183.98 +pkgrel=1 pkgdesc='Electron compiled with wayland support via Ozone' arch=('x86_64') url='https://electronjs.org/' license=('MIT' 'custom') -depends=('c-ares' 'ffmpeg' 'gtk3' 'http-parser' 'libevent' 'libnghttp2' - 'libxslt' 'libxss' 'minizip' 'nss' 'snappy') +depends=('c-ares' 'ffmpeg' 'gtk3' 'http-parser' 'libevent' 'libxslt' 'minizip' + 'nss' 'snappy') makedepends=('git' 'gn<0.1809' 'gperf' 'harfbuzz-icu' 'java-runtime-headless' 'jsoncpp' 'libnotify' 'lld' 'llvm' 'ninja' 'npm' 'pciutils' 'yarn' 'python2' 'wget' 'yasm' 'python2-setuptools' 'libpipewire02' 'nodejs' @@ -29,7 +29,7 @@ source=('git+https://github.com/electron/electron.git' 'default_app-icon.patch' 'use-system-libraries-in-node.patch' 'chromium-skia-harmony.patch' - 'v8-remove-soon-to-be-removed-getAllFieldPositions.patch' + 'media-Set-allocation-limit-compatible-with-FFmpeg-4.3.patch' '0001-fix-use-ozone-version-of-global_shortcut_listener-wh.patch' '0002-fix-don-t-include-global_menu_bar_x11-sources-in-ozo.patch' '0003-fix-fix-ifdefs-and-add-NOTIMPLEMENTEDs-to-make-nativ.patch' @@ -44,18 +44,18 @@ sha256sums=('SKIP' 'SKIP' '5270db01f3f8aaa5137dec275a02caa832b7f2e37942e068cba8d28b3a29df39' '00b21418b9468064f6f275566d3cf64c6b014e596acc650100a5a46da31efbfa' - 'c7eadac877179e586d0cce7f898aa1462b4c207733e68ecc17de9754b691713a' + '50884820e07f7ce5ce55ee1ecdf610367a737e076c5029da0ab0d23154e7661d' '771292942c0901092a402cc60ee883877a99fb804cb54d568c8c6c94565a48e1' - 'e042024423027ad3ef729a7e4709bdf9714aea49d64cfbbf46a645a05703abc2' - '3a9b265ebc978d6b5b165c0c0098e6e26db7ce41ae33daca01e5201bd151e72e' - '28e87512ae5f3be5ce5312e6aedd26bffa2d26b3bca89f9e568d6b044ad16753' - '7e78b61a71609a041f2a45f4c20bd9f89fb4ccb6c48b2abb61faf474fcdd10e0' - '0e1e1c1980ac6c8de7918b74ec3949fe54addbf89f12d4b4ecfd537549b572b4' - 'f554de4c173ec3fb0d128fe72a3677ecbecfb74eea07b8a0fb0057b7e44e540c' - 'd5dc4b7f050640daa015dd28b0aaba8b86681c3bb35288579c7bc10bb24f13c3' - '03d57fe77c7f4ad5f86e6f9e276b6e973b48df194e2bb56d7e24257924e16ec7' - 'd95a64cef0371910c19447549d53fa7155dcb17b6daa8a15a6964d34694bf5c8' - 'bf0e01722870f54e773ea674b7eec03c0cc3740b361d45654d4888004b410884') + '0f041d655335cd2a4773ae7ca5e301a0ff12c6c53f57b7cf6651c268e0420a1c' + '1f93ae4176cdb6ee6c3517b35a2a34fbebdcfaa387e6a0fb5de701785ec17313' + '960ad1f120ffe5737ffa89eeb7086651b29fe766c085a863ff8effe92e7bac5d' + '1a1ae23cabd98c248e75288ef55b517e23c5ca0a262953598179a2d0fbf82e18' + '322f5228f50a53223fba5bdadc7a0032a661336f13c714b921241ae3965e7d36' + '3d035ca6fb14f5e9042bb0b4cff23b5ef3e6ca51b97a0569b45e13740c518942' + 'b77f1aa5884108dfaf70d0cb321017adc289f805378c84d12d76ec9bea47f6f5' + '2b5d233350e42db67db39bfce712b7465313bef25a751af94f0c6fac79f56059' + '48545645d6d42a7034badf9130752dbd271d0de4cf3a188f2604a89064767978' + 'b85f7edf92be4678849196208e464028cb73f564b8adea98f191abf0995ed5c6') _system_libs=('ffmpeg' 'flac' @@ -67,7 +67,7 @@ _system_libs=('ffmpeg' 'libevent' 'libjpeg' 'libpng' - 'libvpx' + # 'libvpx' 'libwebp' 'libxml' 'libxslt' @@ -75,7 +75,6 @@ _system_libs=('ffmpeg' 'opus' # 're2' Not possible with custom libcxx 'snappy' - 'yasm' 'zlib' ) @@ -136,7 +135,7 @@ prepare() { python2 src/third_party/depot_tools/download_from_google_storage.py \ --no_resume --extract --no_auth --bucket chromium-nodejs \ -s src/third_party/node/node_modules.tar.gz.sha1 - vpython src/tools/download_cros_provided_profile.py \ + vpython src/tools/download_optimization_profile.py \ --newest_state=src/chrome/android/profiles/newest.txt \ --local_state=src/chrome/android/profiles/local.txt \ --output_name=src/chrome/android/profiles/afdo.prof \ @@ -149,7 +148,7 @@ prepare() { echo "Applying local Chromium patches..." patch -Np0 -i ../chromium-skia-harmony.patch - patch -Np1 -d v8 <../v8-remove-soon-to-be-removed-getAllFieldPositions.patch + patch -Np1 -i ../media-Set-allocation-limit-compatible-with-FFmpeg-4.3.patch patch -Np1 -i ../use-system-libraries-in-node.patch patch -Np1 -i ../default_app-icon.patch # Icon from .desktop file @@ -168,7 +167,6 @@ prepare() { \! -path "${third_party_dir}/chromium/*" \ \! -path "${third_party_dir}/google/*" \ \! -path 'third_party/harfbuzz-ng/utils/hb_scoped.h' \ - \! -path 'third_party/yasm/run_yasm.py' \ \! -regex '.*\.\(gn\|gni\|isolate\)' \ -delete done @@ -185,7 +183,6 @@ build() { 'icu_use_data_file = false' 'is_component_ffmpeg = false' 'link_pulseaudio = true' - 'linux_use_bundled_binutils = false' 'treat_warnings_as_errors = false' 'use_gnome_keyring = false' 'use_sysroot = false' diff --git a/media-Set-allocation-limit-compatible-with-FFmpeg-4.3.patch b/media-Set-allocation-limit-compatible-with-FFmpeg-4.3.patch new file mode 100644 index 000000000000..d9319a360386 --- /dev/null +++ b/media-Set-allocation-limit-compatible-with-FFmpeg-4.3.patch @@ -0,0 +1,43 @@ +From 7f4c7ff6b0f0e74338c885b0d5e5ef80fed597c3 Mon Sep 17 00:00:00 2001 +From: Dan Sanders <sandersd@chromium.org> +Date: Tue, 11 Aug 2020 20:38:03 +0000 +Subject: [PATCH] [media] Set allocation limit compatible with FFmpeg 4.3 + +Previously we set the limit to zero, meaning no limit, but FFmpeg 4.3 +will not allocate at all with that setting. + +Changed to std::numeric_limits<size_t>::max(). + +Bug: 1095962 +Change-Id: I96820c21f794f2814e955ee75ff22dfd31804c29 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2349405 +Reviewed-by: Dale Curtis <dalecurtis@chromium.org> +Commit-Queue: Dan Sanders <sandersd@chromium.org> +Cr-Commit-Position: refs/heads/master@{#796966} +--- + media/base/media.cc | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/media/base/media.cc b/media/base/media.cc +index c282ee49a03..11e99c238ba 100644 +--- a/media/base/media.cc ++++ b/media/base/media.cc +@@ -4,6 +4,9 @@ + + #include "media/base/media.h" + ++#include <stdint.h> ++#include <limits> ++ + #include "base/allocator/buildflags.h" + #include "base/command_line.h" + #include "base/macros.h" +@@ -41,7 +44,7 @@ class MediaInitializer { + + #if BUILDFLAG(USE_ALLOCATOR_SHIM) + // Remove allocation limit from ffmpeg, so calls go down to shim layer. +- av_max_alloc(0); ++ av_max_alloc(std::numeric_limits<size_t>::max()); + #endif // BUILDFLAG(USE_ALLOCATOR_SHIM) + + #endif // BUILDFLAG(ENABLE_FFMPEG) diff --git a/use-system-libraries-in-node.patch b/use-system-libraries-in-node.patch index 660c89ea2390..e968ac3fe7fe 100644 --- a/use-system-libraries-in-node.patch +++ b/use-system-libraries-in-node.patch @@ -1,6 +1,6 @@ --- a/third_party/electron_node/BUILD.gn +++ b/third_party/electron_node/BUILD.gn -@@ -42,6 +42,18 @@ +@@ -45,6 +45,18 @@ node_module_version = "" } @@ -19,7 +19,7 @@ assert(!node_use_dtrace, "node_use_dtrace not supported in GN") assert(!node_use_etw, "node_use_etw not supported in GN") -@@ -203,12 +215,8 @@ +@@ -198,13 +210,9 @@ component("node_lib") { deps = [ ":node_js2c", @@ -28,11 +28,12 @@ - "deps/http_parser", "deps/llhttp", - "deps/nghttp2", + "deps/uvwasi", - "deps/zlib", "//third_party/brotli:dec", "//third_party/brotli:enc", "//v8:v8_libplatform", -@@ -222,6 +230,21 @@ +@@ -218,6 +226,21 @@ public_configs = [ ":node_lib_config" ] include_dirs = [ "src" ] libs = [] diff --git a/v8-remove-soon-to-be-removed-getAllFieldPositions.patch b/v8-remove-soon-to-be-removed-getAllFieldPositions.patch deleted file mode 100644 index 41d1aced2607..000000000000 --- a/v8-remove-soon-to-be-removed-getAllFieldPositions.patch +++ /dev/null @@ -1,172 +0,0 @@ -From 3f8dc4b2e5baf77b463334c769af85b79d8c1463 Mon Sep 17 00:00:00 2001 -From: Frank Tang <ftang@chromium.org> -Date: Fri, 3 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 <jkummerow@chromium.org> -Commit-Queue: Frank Tang <ftang@chromium.org> -Cr-Commit-Position: refs/heads/master@{#67027} ---- - src/objects/js-number-format.cc | 77 +++++++++++++++++---------------- - 1 file changed, 39 insertions(+), 38 deletions(-) - -diff --git a/src/objects/js-number-format.cc b/src/objects/js-number-format.cc -index ad831c5c36..bcd44031d5 100644 ---- a/src/objects/js-number-format.cc -+++ b/src/objects/js-number-format.cc -@@ -1241,44 +1241,33 @@ MaybeHandle<JSNumberFormat> JSNumberFormat::New(Isolate* isolate, - } - - 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>()); -- } -- 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>()); -+ THROW_NEW_ERROR_RETURN_VALUE( -+ isolate, NewTypeError(MessageTemplate::kIcuError), Nothing<bool>()); - } -- return Just(result); -+ return Just(true); - } - - } // namespace -@@ -1289,10 +1278,16 @@ MaybeHandle<String> JSNumberFormat::FormatNumeric( - 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 @@ std::vector<NumberFormatSpan> FlattenRegionsToParts( - } - - 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 @@ Maybe<int> ConstructParts(Isolate* isolate, const icu::UnicodeString& formatted, - // 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 @@ Maybe<int> ConstructParts(Isolate* isolate, const icu::UnicodeString& formatted, - 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 @@ MaybeHandle<JSArray> JSNumberFormat::FormatToParts( - 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; |