From 2bccc014aff16e3a2d40798ee4b329cf5cb892215a2f7db346b55951308eb26c Mon Sep 17 00:00:00 2001 From: Wolfgang Rosenauer Date: Wed, 5 Jul 2023 21:06:07 +0000 Subject: [PATCH] - Mozilla Firefox 115.0 * Support for importing payment methods saved in Chrome-based browser * Hardware video decoding is now enabled for Intel GPUs on Linux * The Tab Manager dropdown now features close buttons, so tabs can be closed more quickly * Streamlined the user interface for importing data in from other browsers * Users without platform support for H264 video decoding can now fallback to Cisco's OpenH264 plugin for playback. * Undo and redo are now available in Password fields * Changed: On Linux, middle clicks on the new tab button will now open the xclipboard contents in the new tab. If the xclipboard content is a URL then that URL is opened, any other text is opened with your default search provider. * Changed: For users with a Firefox Colorways built-in theme, the theme will be automatically migrated to the same theme hosted on addons.mozilla.org for Firefox profiles that have disabled add-ons auto-updates. This will allow users to keep their Colorways theme when they are later removed from Firefox installer files. * Changed: Certain Firefox users may come across a message in the extensions panel indicating that their add-ons are not allowed on the site currently open. We have introduced a new back-end feature to only allow some extensions monitored by Mozilla to run on specific websites for various reasons, including security concerns. * HTML5: The builtin editor now behaves similarly to other browsers with `contenteditable` and `designMode` when splitting a node, e.g. typing Enter to split a paragraph, and also when joining two nodes, e.g. typing Backspace at the start of a paragraph to join the paragraph and the previous OBS-URL: https://build.opensuse.org/package/show/mozilla:Factory/MozillaFirefox?expand=0&rev=1071 --- MozillaFirefox.changes | 113 ++ MozillaFirefox.spec | 25 +- firefox-114.0.2.source.tar.xz | 3 - firefox-114.0.2.source.tar.xz.asc | 16 - firefox-115.0.source.tar.xz | 3 + firefox-115.0.source.tar.xz.asc | 16 + firefox-branded-icons.patch | 34 +- firefox-kde.patch | 74 +- l10n-114.0.2.tar.xz | 3 - l10n-115.0.tar.xz | 3 + mozilla-aarch64-startup-crash.patch | 14 +- mozilla-bmo1512162.patch | 31 +- mozilla-bmo1775202.patch | 26 + mozilla-bmo849632.patch | 19 +- mozilla-buildfixes.patch | 27 - mozilla-fix-aarch64-libopus.patch | 14 +- mozilla-kde.patch | 1928 ++++++++------------ mozilla-nongnome-proxies.patch | 19 +- mozilla-ntlm-full-path.patch | 14 +- mozilla-partial-revert-1768632.patch | 13 + mozilla-pgo.patch | 128 +- mozilla-reduce-rust-debuginfo.patch | 10 +- mozilla-rust-disable-future-incompat.patch | 12 + mozilla-silence-no-return-type.patch | 262 +-- mozilla.keyring | 4 +- mozilla.sh.in | 4 +- one_swizzle_to_rule_them_all.patch | 8 +- tar_stamps | 8 +- 28 files changed, 1186 insertions(+), 1645 deletions(-) delete mode 100644 firefox-114.0.2.source.tar.xz delete mode 100644 firefox-114.0.2.source.tar.xz.asc create mode 100644 firefox-115.0.source.tar.xz create mode 100644 firefox-115.0.source.tar.xz.asc delete mode 100644 l10n-114.0.2.tar.xz create mode 100644 l10n-115.0.tar.xz create mode 100644 mozilla-bmo1775202.patch delete mode 100644 mozilla-buildfixes.patch create mode 100644 mozilla-partial-revert-1768632.patch create mode 100644 mozilla-rust-disable-future-incompat.patch diff --git a/MozillaFirefox.changes b/MozillaFirefox.changes index c782acc2..c1169bd1 100644 --- a/MozillaFirefox.changes +++ b/MozillaFirefox.changes @@ -1,3 +1,116 @@ +------------------------------------------------------------------- +Sun Jul 2 16:00:53 UTC 2023 - Wolfgang Rosenauer + +- Mozilla Firefox 115.0 + * Support for importing payment methods saved in Chrome-based browser + * Hardware video decoding is now enabled for Intel GPUs on Linux + * The Tab Manager dropdown now features close buttons, so tabs + can be closed more quickly + * Streamlined the user interface for importing data in from other browsers + * Users without platform support for H264 video decoding can now + fallback to Cisco's OpenH264 plugin for playback. + * Undo and redo are now available in Password fields + * Changed: On Linux, middle clicks on the new tab button will + now open the xclipboard contents in the new tab. If the + xclipboard content is a URL then that URL is opened, any + other text is opened with your default search provider. + * Changed: For users with a Firefox Colorways built-in theme, + the theme will be automatically migrated to the same theme + hosted on addons.mozilla.org for Firefox profiles that have + disabled add-ons auto-updates. This will allow users to keep + their Colorways theme when they are later removed from + Firefox installer files. + * Changed: Certain Firefox users may come across a message in + the extensions panel indicating that their add-ons are not + allowed on the site currently open. We have introduced a new + back-end feature to only allow some extensions monitored by + Mozilla to run on specific websites for various reasons, + including security concerns. + * HTML5: The builtin editor now behaves similarly to other + browsers with `contenteditable` and `designMode` when + splitting a node, e.g. typing Enter to split a paragraph, and + also when joining two nodes, e.g. typing Backspace at the + start of a paragraph to join the paragraph and the previous + one. + When a node is split, the builtin editor creates a new node + after the original one instead of before, i.e. creates the + right node instead of the left node. + Similarly, when two nodes are joined, the builtin editor + deletes the latter node and moves its children to the end of + the preceding node instead of deleting the former node and + moving its child to the start of the following node. + * HTML5: WebRTC application developers can now specify a target + in milliseconds of media for the jitter buffer to hold. + Altering the target value allows applications to control the + tradeoff between playout delay and the risk of running out of + audio or video frames due to network jitter. + * HTML5: Change array by copy provides additional methods on + `Array.prototype` and `TypedArray.prototype` to enable + changes on the array by returning a new copy of it with the + change. + * HTML5: The animation-composition property is now supported, + allowing a declarative way to define the composite operation + used when multiple animations affect the same property + simultaneously. + * HTML5: Added the URL.canParse() function to allow easy and + fast checking if URLs are valid and parseable. + * HTML5: IndexedDB is now also supported in private browsing + without memory limits thanks to encrypted storage on disk. + The temporary keys to decrypt the information are hold in RAM + only and all stored information is purged at the normal end + of a private browsing session from disk. + * HTML5: Supports conditions are now supported in CSS import + rules @import supports(...) + * Developer: In web development, we rely on third-party + libraries which you may not be interested in while debugging. + These can be ignored. Ignoring them means that breakpoints + will not get hit and they are skipped during stepping. + You can now choose to **Hide ignore-listed sources** in the + Developer Tools source tree + * Developer: We have introduced a new option, + `devtools.f12_enabled`, that can be utilized to prevent the + accidental use of the F12 key, which opens the DevTools + toolbox (bug). + * Enterprise: You can find information about policy updates and + enterprise specific bug fixes in the Firefox for Enterprise + 115 Release Notes. + MFSA 2023-22 (bsc#1212438) + * CVE-2023-3482 (bmo#1839464) + Block all cookies bypass for localstorage + * CVE-2023-37201 (bmo#1826002) + Use-after-free in WebRTC certificate generation + * CVE-2023-37202 (bmo#1834711) + Potential use-after-free from compartment mismatch in SpiderMonkey + * CVE-2023-37203 (bmo#291640) + Drag and Drop API may provide access to local system files + * CVE-2023-37204 (bmo#1832195) + Fullscreen notification obscured via option element + * CVE-2023-37205 (bmo#1704420) + URL spoofing in address bar using RTL characters + * CVE-2023-37206 (bmo#1813299) + Insufficient validation of symlinks in the FileSystem API + * CVE-2023-37207 (bmo#1816287) + Fullscreen notification obscured + * CVE-2023-37208 (bmo#1837675) + Lack of warning when opening Diagcab files + * CVE-2023-37209 (bmo#1837993) + Use-after-free in `NotifyOnHistoryReload` + * CVE-2023-37210 (bmo#1821886) + Full-screen mode exit prevention + * CVE-2023-37211 (bmo#1832306, bmo#1834862, bmo#1835886, + bmo#1836550, bmo#1837450) + Memory safety bugs fixed in Firefox 115, Firefox ESR 102.13, + and Thunderbird 102.13 + * CVE-2023-37212 (bmo#1750870, bmo#1825552, bmo#1826206, bmo#1827076, + bmo#1828690, bmo#1833503, bmo#1835710, bmo#1838587) + Memory safety bugs fixed in Firefox 115 +- Requires NSS 3.90 +- Add patches: + mozilla-rust-disable-future-incompat.patch + mozilla-bmo1775202.patch + mozilla-partial-revert-1768632.patch +- removed obsolete mozilla-buildfixes.patch + ------------------------------------------------------------------- Tue Jun 20 19:49:51 UTC 2023 - Andreas Stieger diff --git a/MozillaFirefox.spec b/MozillaFirefox.spec index 91a96c0b..a9808234 100644 --- a/MozillaFirefox.spec +++ b/MozillaFirefox.spec @@ -28,9 +28,9 @@ # orig_suffix b3 # major 69 # mainver %%major.99 -%define major 114 -%define mainver %major.0.2 -%define orig_version 114.0.2 +%define major 115 +%define mainver %major.0 +%define orig_version 115.0 %define orig_suffix %{nil} %define update_channel release %define branding 1 @@ -98,7 +98,8 @@ BuildRequires: dejavu-fonts BuildRequires: fdupes BuildRequires: memory-constraints %if 0%{?suse_version} < 1550 && 0%{?sle_version} <= 150500 -BuildRequires: gcc11-c++ +BuildRequires: gcc12 +BuildRequires: gcc12-c++ %else BuildRequires: gcc-c++ %endif @@ -113,9 +114,9 @@ BuildRequires: libiw-devel BuildRequires: libproxy-devel BuildRequires: makeinfo BuildRequires: mozilla-nspr-devel >= 4.35 -BuildRequires: mozilla-nss-devel >= 3.89.1 +BuildRequires: mozilla-nss-devel >= 3.90 BuildRequires: nasm >= 2.14 -BuildRequires: nodejs >= 10.22.1 +BuildRequires: nodejs >= 12.22.12 %if 0%{?sle_version} >= 120000 && 0%{?sle_version} < 150000 BuildRequires: libXtst-devel BuildRequires: python-libxml2 @@ -226,7 +227,9 @@ Patch18: mozilla-silence-no-return-type.patch Patch19: mozilla-bmo531915.patch Patch20: one_swizzle_to_rule_them_all.patch Patch21: svg-rendering.patch -Patch22: mozilla-buildfixes.patch +Patch22: mozilla-partial-revert-1768632.patch +Patch23: mozilla-bmo1775202.patch +Patch24: mozilla-rust-disable-future-incompat.patch # Firefox/browser Patch101: firefox-kde.patch Patch102: firefox-branded-icons.patch @@ -347,12 +350,12 @@ sed -i "s|potential_python_binary = f\"python3.{i}\"|potential_python_binary = f export PYTHON3=/usr/bin/python3.9 %endif -# kdehelperversion=$(cat toolkit/xre/nsKDEUtils.cpp | grep '#define KMOZILLAHELPER_VERSION' | cut -d ' ' -f 3) if test "$kdehelperversion" != %{kde_helper_version}; then echo fix kde helper version in the .spec file exit 1 fi + # When doing only_print_mozconfig, this file isn't necessarily available, so skip it cp %{SOURCE4} .obsenv.sh %else @@ -373,8 +376,8 @@ export MOZ_TELEMETRY_REPORTING=1 export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system export CFLAGS="%{optflags}" %if 0%{?suse_version} < 1550 && 0%{?sle_version} <= 150500 -export CC=gcc-11 -export CXX=g++-11 +export CC=gcc-12 +export CXX=g++-12 %else %if 0%{?clang_build} == 0 export CC=gcc @@ -393,7 +396,7 @@ export GC_SECTIONS_BREAKS_DEBUG_RANGES=yes export LDFLAGS="\$LDFLAGS -fPIC -Wl,-z,relro,-z,now" %ifarch ppc64 ppc64le %if 0%{?clang_build} == 0 -export CFLAGS="\$CFLAGS -mminimal-toc" +#export CFLAGS="\$CFLAGS -mminimal-toc" %endif %endif %ifarch %ix86 diff --git a/firefox-114.0.2.source.tar.xz b/firefox-114.0.2.source.tar.xz deleted file mode 100644 index 32dc135e..00000000 --- a/firefox-114.0.2.source.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:aa602032f0b7065b743ba7fabf96714398aba538bcc017a4b0fff556dc69f8fe -size 505974216 diff --git a/firefox-114.0.2.source.tar.xz.asc b/firefox-114.0.2.source.tar.xz.asc deleted file mode 100644 index 1a7e6af7..00000000 --- a/firefox-114.0.2.source.tar.xz.asc +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iQIzBAABCgAdFiEErdcHlHlwDcrf3VM34207E/PZMnQFAmSQN54ACgkQ4207E/PZ -MnTMGBAAlwust6D3sNlWTUsKLQYMn7QwkjdRl+dRzK12TRDDZbFm0kZw/Elp74i2 -4qT6FUuGc1fwEJ4kOOg+5aDm+r95NmNZw2XrVDwb8uyDEZvyUxC10fbgIfFTu0JK -bhE2AZnB8TJBKTP0QxYRuvPOe6nizk72G3McdF3e7Dywky1bP0pVlflPuKsVi/wI -6MYBTmgnYoDBIGqMTF41afEqfeNchH02h7nM/IQj155TDjMH0I5pxENjM8lFQE3M -cO7tZr5OhzxWcc0seHG4hDOWxVUofyjzfVIDLOmVgrfIt5PJ0EaQGdcKRKXqi1vL -IZW6uBr3rteyEP7X0BTMf8G90/iwtxO1a52E0w25P/pxXQNjWtp7aTe4M9RZDdsQ -j6eLDDyGw7uJDoW7vqqy5Mw49Ac5u7UB33ObkfVB7LY+1qW4z9qG6I5ABaOledkV -MSsMoaEHqAwI5zkVv+BwMVcbHIi22XIZpL2e956loBvV1IRPv6T0aHPlKN+i02Qa -D6shduU3jpU+Lwtlk4Qn+HOYKd9rlvk/gfMFFrR/bgpOqbezMU4RVqhZCC1m70RG -AdqGRKTae9quB6JAGQUQE4jJtyktuHnG5u4mPwW6s9GlvkLDVedILfG0fdXebqAX -eoGKm6n8SwyyJrvqmmZGWc6+7u9LUWfgBiReI1fpB6QHeVL5ygg= -=WW8r ------END PGP SIGNATURE----- diff --git a/firefox-115.0.source.tar.xz b/firefox-115.0.source.tar.xz new file mode 100644 index 00000000..fe41e852 --- /dev/null +++ b/firefox-115.0.source.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7cdb23fe5ccb54334c8fe14c1e5dd89d5788f8e7b79a2bd9cc4eabdc7e54e898 +size 505151516 diff --git a/firefox-115.0.source.tar.xz.asc b/firefox-115.0.source.tar.xz.asc new file mode 100644 index 00000000..9fbd88c6 --- /dev/null +++ b/firefox-115.0.source.tar.xz.asc @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEErdcHlHlwDcrf3VM34207E/PZMnQFAmSdwi8ACgkQ4207E/PZ +MnR2gQ//fQE+SAST2KBdo/k8qvUHdfvA5LRi3oLSOUTyxgZb4epM8MllIrTjaSeK +KQzaf4duPCa5Hp4tlI/37Pn2fais9e0baBN5MXtIv5UzivRKO9BUj4hzhX4wSkb9 +C2HvFQTUhJG3xRrizdgHm1Y2Cqj4UWra7Z1kxslNR8gbWTFBtuiHYx/m1tgqNrqq +pLRFxgjbRx6qD64UGl1p9405WSRb1TzTNcFFSRkUUF7/2T6btxpiTpi00L4jZWNQ +WuheyqNkQDb/Hj7Cqx4oIrmdhSaL5THbBFI3Dt/17MyanoNf0xDGck4R7gW1De+f +TyD9GY06w9kkGPNLHiKhXp7G0gMvBJPXzyP06GU2WSDvAE1d1sdF9iIDSWFz3GlZ +nkZ7Z/aMBF3PxT5OuEwCsM7ZthiuGtGlYQ7FkYphz0jkJZF1jFGxjAud5F+O+eii +3qNrV+k9USA+YHrX9Sj8ECrj3TWgSlCK7A2b1m5M6JSczon/NQ8hygoEGLXcDAq1 +tBoHFvK9ZHkbZU9O0cMBwAPZHonqx71UBBn6FaGhh4bWkAPK2VBHCEQJtDR289Nx +r0vc32LfiLgFRUTi063HpggNR1mCALQN175gTUkozr1+fnhuizHoEy6oCPT11CeJ +MUnmXM+KBAWGgaqAzdKECB9weFozMB6/WkCcYuiR5MRl0EhnYCo= +=7h8/ +-----END PGP SIGNATURE----- diff --git a/firefox-branded-icons.patch b/firefox-branded-icons.patch index bc9ab374..4a4d0c61 100644 --- a/firefox-branded-icons.patch +++ b/firefox-branded-icons.patch @@ -2,15 +2,11 @@ # Parent e0751ad74e835e80041a61ea00c2a63bf6fbe2de # Parent fe7e6fdd75484993420740244f21b5b41d6e0fa1 -diff --git a/browser/branding/branding-common.mozbuild b/browser/branding/branding-common.mozbuild ---- a/browser/branding/branding-common.mozbuild -+++ b/browser/branding/branding-common.mozbuild -@@ -25,12 +25,15 @@ def FirefoxBranding(): - 'PrivateBrowsing_70.png', - 'VisualElements_150.png', - 'VisualElements_70.png', - ] - elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk': +Index: firefox-115.0/browser/branding/branding-common.mozbuild +=================================================================== +--- firefox-115.0.orig/browser/branding/branding-common.mozbuild ++++ firefox-115.0/browser/branding/branding-common.mozbuild +@@ -30,6 +30,9 @@ def FirefoxBranding(): FINAL_TARGET_FILES.chrome.icons.default += [ 'default128.png', 'default16.png', @@ -20,16 +16,11 @@ diff --git a/browser/branding/branding-common.mozbuild b/browser/branding/brandi 'default32.png', 'default48.png', 'default64.png', - ] -diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in ---- a/browser/installer/package-manifest.in -+++ b/browser/installer/package-manifest.in -@@ -221,20 +221,23 @@ - @RESPATH@/browser/chrome/browser@JAREXT@ - @RESPATH@/browser/chrome/browser.manifest - @RESPATH@/chrome/pdfjs.manifest - @RESPATH@/chrome/pdfjs/* - @RESPATH@/chrome/toolkit@JAREXT@ +Index: firefox-115.0/browser/installer/package-manifest.in +=================================================================== +--- firefox-115.0.orig/browser/installer/package-manifest.in ++++ firefox-115.0/browser/installer/package-manifest.in +@@ -227,10 +227,13 @@ @RESPATH@/chrome/toolkit.manifest #ifdef MOZ_GTK @RESPATH@/browser/chrome/icons/default/default16.png @@ -43,8 +34,3 @@ diff --git a/browser/installer/package-manifest.in b/browser/installer/package-m #endif @RESPATH@/browser/features/* - ; [DevTools Startup Files] - @RESPATH@/browser/chrome/devtools-startup@JAREXT@ - @RESPATH@/browser/chrome/devtools-startup.manifest - - ; DevTools diff --git a/firefox-kde.patch b/firefox-kde.patch index 7ecfa20b..6dc82ff3 100644 --- a/firefox-kde.patch +++ b/firefox-kde.patch @@ -11,15 +11,11 @@ How to apply this patch: 4. Replace #ifndef with #ifdef in the line above (this hanges the button order from Gnome-style to KDE-style) 5. hg qrefresh -diff --git a/browser/components/preferences/main.js b/browser/components/preferences/main.js ---- a/browser/components/preferences/main.js -+++ b/browser/components/preferences/main.js -@@ -296,16 +296,23 @@ var gMainPane = { - }, backoffTimes[this._backoffIndex + 1 < backoffTimes.length ? this._backoffIndex++ : backoffTimes.length - 1]); - }; - - window.setTimeout(() => { - window.requestIdleCallback(pollForDefaultBrowser); +Index: firefox-115.0/browser/components/preferences/main.js +=================================================================== +--- firefox-115.0.orig/browser/components/preferences/main.js ++++ firefox-115.0/browser/components/preferences/main.js +@@ -293,6 +293,13 @@ var gMainPane = { }, backoffTimes[this._backoffIndex]); } @@ -33,17 +29,7 @@ diff --git a/browser/components/preferences/main.js b/browser/components/prefere this.initBrowserContainers(); this.buildContentProcessCountMenuList(); - this.updateDefaultPerformanceSettingsPref(); - - let defaultPerformancePref = Preferences.get( - "browser.preferences.defaultPerformanceSettings.enabled" - ); -@@ -1298,16 +1305,27 @@ var gMainPane = { - this._backoffIndex = 0; - - let shellSvc = getShellService(); - if (!shellSvc) { - return; +@@ -1762,6 +1769,17 @@ var gMainPane = { } try { shellSvc.setDefaultBrowser(true, false); @@ -61,20 +47,11 @@ diff --git a/browser/components/preferences/main.js b/browser/components/prefere } catch (ex) { console.error(ex); return; - } - - let isDefault = shellSvc.isDefaultBrowser(false, true); - let setDefaultPane = document.getElementById("setDefaultPane"); - setDefaultPane.classList.toggle("is-default", isDefault); -diff --git a/browser/components/shell/moz.build b/browser/components/shell/moz.build ---- a/browser/components/shell/moz.build -+++ b/browser/components/shell/moz.build -@@ -31,16 +31,18 @@ if CONFIG["MOZ_WIDGET_TOOLKIT"] == "coco - ] - elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": - XPIDL_SOURCES += [ - "nsIGNOMEShellService.idl", - ] +Index: firefox-115.0/browser/components/shell/moz.build +=================================================================== +--- firefox-115.0.orig/browser/components/shell/moz.build ++++ firefox-115.0/browser/components/shell/moz.build +@@ -36,6 +36,8 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "gt SOURCES += [ "nsGNOMEShellService.cpp", @@ -83,15 +60,10 @@ diff --git a/browser/components/shell/moz.build b/browser/components/shell/moz.b ] if CONFIG["MOZ_ENABLE_DBUS"]: SOURCES += [ - "nsGNOMEShellDBusHelper.cpp", - "nsGNOMEShellSearchProvider.cpp", - ] - include("/ipc/chromium/chromium-config.mozbuild") - -diff --git a/browser/components/shell/nsKDEShellService.cpp b/browser/components/shell/nsKDEShellService.cpp -new file mode 100644 +Index: firefox-115.0/browser/components/shell/nsKDEShellService.cpp +=================================================================== --- /dev/null -+++ b/browser/components/shell/nsKDEShellService.cpp ++++ firefox-115.0/browser/components/shell/nsKDEShellService.cpp @@ -0,0 +1,109 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public @@ -202,10 +174,10 @@ new file mode 100644 + return NS_ERROR_NOT_IMPLEMENTED; +} + -diff --git a/browser/components/shell/nsKDEShellService.h b/browser/components/shell/nsKDEShellService.h -new file mode 100644 +Index: firefox-115.0/browser/components/shell/nsKDEShellService.h +=================================================================== --- /dev/null -+++ b/browser/components/shell/nsKDEShellService.h ++++ firefox-115.0/browser/components/shell/nsKDEShellService.h @@ -0,0 +1,32 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public @@ -239,10 +211,10 @@ new file mode 100644 +}; + +#endif // nskdeshellservice_h____ -diff --git a/browser/components/shell/nsUnixShellService.cpp b/browser/components/shell/nsUnixShellService.cpp -new file mode 100644 +Index: firefox-115.0/browser/components/shell/nsUnixShellService.cpp +=================================================================== --- /dev/null -+++ b/browser/components/shell/nsUnixShellService.cpp ++++ firefox-115.0/browser/components/shell/nsUnixShellService.cpp @@ -0,0 +1,22 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public @@ -266,10 +238,10 @@ new file mode 100644 + return nsKDEShellServiceConstructor( aIID, aResult ); + return nsGNOMEShellServiceConstructor( aIID, aResult ); +} -diff --git a/browser/components/shell/nsUnixShellService.h b/browser/components/shell/nsUnixShellService.h -new file mode 100644 +Index: firefox-115.0/browser/components/shell/nsUnixShellService.h +=================================================================== --- /dev/null -+++ b/browser/components/shell/nsUnixShellService.h ++++ firefox-115.0/browser/components/shell/nsUnixShellService.h @@ -0,0 +1,15 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public diff --git a/l10n-114.0.2.tar.xz b/l10n-114.0.2.tar.xz deleted file mode 100644 index 144a85c7..00000000 --- a/l10n-114.0.2.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c91243c41b340ae5f18265a7b38ed6e5a83f8e89581a14d586a7c8b29a4729c2 -size 31072368 diff --git a/l10n-115.0.tar.xz b/l10n-115.0.tar.xz new file mode 100644 index 00000000..98b815ed --- /dev/null +++ b/l10n-115.0.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9ce34098d2c6fa150ca2504e00b6d4229a7dbea22d57be54815f7050fcd2b93b +size 31190600 diff --git a/mozilla-aarch64-startup-crash.patch b/mozilla-aarch64-startup-crash.patch index 79fd320c..5d9f98d9 100644 --- a/mozilla-aarch64-startup-crash.patch +++ b/mozilla-aarch64-startup-crash.patch @@ -3,19 +3,14 @@ # Date 1558442998 -7200 # Tue May 21 14:49:58 2019 +0200 # Node ID 386083b58d8558141901d796ec6919a4aba7ad3a -# Parent a30a9b9aae5740f096a16118ed9e4bc45d3d1c35 +# Parent 76b747f7d113bddbb8593184d81e1bfe5fd51af0 bsc#991344 - Rpi3: Firefox crashes after a few seconds of usage bmo#1302554 - ARM/AARCH64: Firefox crashes on NULL nsIChannel** result pointer in nsIOService::NewChannelFromURIWithProxyFlagsInternal() diff --git a/netwerk/base/nsIOService.cpp b/netwerk/base/nsIOService.cpp --- a/netwerk/base/nsIOService.cpp +++ b/netwerk/base/nsIOService.cpp -@@ -1032,17 +1032,23 @@ nsresult nsIOService::NewChannelFromURIW - "doesn't support nsIUploadChannel2. An extension has " - "supplied a non-functional http protocol handler. This will " - "break behavior and in future releases not work at all."); - } - gHasWarnedUploadChannel2 = true; +@@ -1159,7 +1159,13 @@ nsresult nsIOService::NewChannelFromURIW } } @@ -29,8 +24,3 @@ diff --git a/netwerk/base/nsIOService.cpp b/netwerk/base/nsIOService.cpp return NS_OK; } - NS_IMETHODIMP - nsIOService::NewChannelFromURIWithProxyFlags( - nsIURI* aURI, nsIURI* aProxyURI, uint32_t aProxyFlags, - nsINode* aLoadingNode, nsIPrincipal* aLoadingPrincipal, - nsIPrincipal* aTriggeringPrincipal, uint32_t aSecurityFlags, diff --git a/mozilla-bmo1512162.patch b/mozilla-bmo1512162.patch index 39901ea5..3ca46d46 100644 --- a/mozilla-bmo1512162.patch +++ b/mozilla-bmo1512162.patch @@ -3,15 +3,11 @@ This fixes a broken build for gcc < 9 on ppc64le. This patch can be removed for newer gcc-versions. -diff --git a/js/xpconnect/src/XPCWrappedNative.cpp b/js/xpconnect/src/XPCWrappedNative.cpp ---- a/js/xpconnect/src/XPCWrappedNative.cpp -+++ b/js/xpconnect/src/XPCWrappedNative.cpp -@@ -1072,17 +1072,21 @@ class MOZ_STACK_CLASS CallMethodHelper f - uint32_t* result); - - MOZ_ALWAYS_INLINE bool GetInterfaceTypeFromParam(const nsXPTType& type, - nsID* result) const; - +Index: firefox-115.0/js/xpconnect/src/XPCWrappedNative.cpp +=================================================================== +--- firefox-115.0.orig/js/xpconnect/src/XPCWrappedNative.cpp ++++ firefox-115.0/js/xpconnect/src/XPCWrappedNative.cpp +@@ -1061,7 +1061,11 @@ class MOZ_STACK_CLASS CallMethodHelper f MOZ_ALWAYS_INLINE bool GetOutParamSource(uint8_t paramIndex, MutableHandleValue srcp) const; @@ -24,17 +20,7 @@ diff --git a/js/xpconnect/src/XPCWrappedNative.cpp b/js/xpconnect/src/XPCWrapped MOZ_ALWAYS_INLINE bool QueryInterfaceFastPath(); - nsXPTCVariant* GetDispatchParam(uint8_t paramIndex) { - if (paramIndex >= mJSContextIndex) { - paramIndex += 1; - } - if (paramIndex >= mOptArgcIndex) { -@@ -1119,17 +1123,21 @@ class MOZ_STACK_CLASS CallMethodHelper f - - { - // Success checked later. - mIFaceInfo->GetMethodInfo(mVTableIndex, &mMethodInfo); - } +@@ -1108,7 +1112,11 @@ class MOZ_STACK_CLASS CallMethodHelper f ~CallMethodHelper(); @@ -47,8 +33,3 @@ diff --git a/js/xpconnect/src/XPCWrappedNative.cpp b/js/xpconnect/src/XPCWrapped // Trace implementation so we can put our CallMethodHelper in a Rooted. void trace(JSTracer* aTrc); - }; - - // static - bool XPCWrappedNative::CallMethod(XPCCallContext& ccx, - CallMode mode /*= CALL_METHOD */) { diff --git a/mozilla-bmo1775202.patch b/mozilla-bmo1775202.patch new file mode 100644 index 00000000..1b1f5b12 --- /dev/null +++ b/mozilla-bmo1775202.patch @@ -0,0 +1,26 @@ +From: Mike Hommey +Date: Sun, 14 Aug 2022 07:01:33 +0900 +Subject: Work around bz#1775202 to fix FTBFS on ppc64el + +--- + third_party/libwebrtc/moz.build | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/third_party/libwebrtc/moz.build b/third_party/libwebrtc/moz.build +index 976cf373..311519c 100644 +--- a/third_party/libwebrtc/moz.build ++++ b/third_party/libwebrtc/moz.build +@@ -566,6 +566,13 @@ if CONFIG["CPU_ARCH"] == "arm" and CONFIG["OS_TARGET"] == "Linux": + "/third_party/libwebrtc/third_party/pipewire/pipewire_gn" + ] + ++if CONFIG["CPU_ARCH"] == "ppc64" and CONFIG["OS_TARGET"] == "Linux": ++ ++ DIRS += [ ++ "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn", ++ "/third_party/libwebrtc/modules/desktop_capture/primitives_gn", ++ ] ++ + if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Linux": + + DIRS += [ diff --git a/mozilla-bmo849632.patch b/mozilla-bmo849632.patch index 49d23a61..ec1ee03c 100644 --- a/mozilla-bmo849632.patch +++ b/mozilla-bmo849632.patch @@ -6,15 +6,11 @@ Solution: Problem is with skia once again. Output of webgl seems endian-correct, So we swizzle the output of webgl after reading it from readpixels() Note: This does not fix all webGL sites, but is a step in the right direction -diff --git a/gfx/gl/GLContext.h b/gfx/gl/GLContext.h ---- a/gfx/gl/GLContext.h -+++ b/gfx/gl/GLContext.h -@@ -1548,16 +1548,23 @@ class GLContext : public GenericAtomicRe - AFTER_GL_CALL; - } - - void raw_fReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, - GLenum format, GLenum type, GLvoid* pixels) { +Index: firefox-115.0/gfx/gl/GLContext.h +=================================================================== +--- firefox-115.0.orig/gfx/gl/GLContext.h ++++ firefox-115.0/gfx/gl/GLContext.h +@@ -1560,6 +1560,13 @@ class GLContext : public GenericAtomicRe BEFORE_GL_CALL; mSymbols.fReadPixels(x, y, width, height, format, type, pixels); OnSyncCall(); @@ -28,8 +24,3 @@ diff --git a/gfx/gl/GLContext.h b/gfx/gl/GLContext.h AFTER_GL_CALL; mHeavyGLCallsSinceLastFlush = true; } - - void fReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, - GLenum format, GLenum type, GLvoid* pixels); - - public: diff --git a/mozilla-buildfixes.patch b/mozilla-buildfixes.patch deleted file mode 100644 index f9a6f40e..00000000 --- a/mozilla-buildfixes.patch +++ /dev/null @@ -1,27 +0,0 @@ -# HG changeset patch -# User Wolfgang Rosenauer -# Parent e583ac9b86ba82dd1c60d307115b4cb96296a6af -# References: bmo#1792159 - Add missing includes to AtomicOperationsGenerated.h - -diff --git a/mozglue/misc/SIMD_avx2.cpp b/mozglue/misc/SIMD_avx2.cpp ---- a/mozglue/misc/SIMD_avx2.cpp -+++ b/mozglue/misc/SIMD_avx2.cpp -@@ -53,17 +53,17 @@ template - } - if (sizeof(TValue) == 2) { - return _mm256_cmpeq_epi16(a, b); - } - - return _mm256_cmpeq_epi64(a, b); - } - --# if defined(__GNUC__) && !defined(__clang__) -+# if 0 - - // See the comment in SIMD.cpp over Load32BitsIntoXMM. This is just adapted - // from that workaround. Testing this, it also yields the correct instructions - // across all tested compilers. - __m128i Load64BitsIntoXMM(uintptr_t ptr) { - int64_t tmp; - memcpy(&tmp, reinterpret_cast(ptr), sizeof(tmp)); - return _mm_cvtsi64_si128(tmp); diff --git a/mozilla-fix-aarch64-libopus.patch b/mozilla-fix-aarch64-libopus.patch index f6f8da79..ded3d2cf 100644 --- a/mozilla-fix-aarch64-libopus.patch +++ b/mozilla-fix-aarch64-libopus.patch @@ -1,15 +1,10 @@ # HG changeset patch -# Parent 2640f2f68373b7bec776bb11d3b3fb75c72a8adb +# Parent af2c24874d79cbebb444727ae96f2fefa3f22b47 diff --git a/media/libopus/silk/arm/arm_silk_map.c b/media/libopus/silk/arm/arm_silk_map.c --- a/media/libopus/silk/arm/arm_silk_map.c +++ b/media/libopus/silk/arm/arm_silk_map.c -@@ -23,17 +23,17 @@ INTERRUPTION) HOWEVER CAUSED AND ON ANY - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ***********************************************************************/ - #ifdef HAVE_CONFIG_H +@@ -28,7 +28,7 @@ POSSIBILITY OF SUCH DAMAGE. # include "config.h" #endif @@ -18,8 +13,3 @@ diff --git a/media/libopus/silk/arm/arm_silk_map.c b/media/libopus/silk/arm/arm_ #include "NSQ.h" #include "SigProc_FIX.h" - #if defined(OPUS_HAVE_RTCD) - - # if (defined(OPUS_ARM_MAY_HAVE_NEON_INTR) && \ - !defined(OPUS_ARM_PRESUME_NEON_INTR)) - diff --git a/mozilla-kde.patch b/mozilla-kde.patch index ee7f9883..989c4a21 100644 --- a/mozilla-kde.patch +++ b/mozilla-kde.patch @@ -3,22 +3,18 @@ # Date 1559294891 -7200 # Fri May 31 11:28:11 2019 +0200 # Node ID c2aa7198fb925e7fde96abf65b6f68b9b755f112 -# Parent 7618e13ce3f8b52d13ec5d54acc3a986793ec8ef +# Parent 0086fcc0d5c86a31cbac0a261ed7b526dd2df2e8 Description: Add KDE integration to Firefox (toolkit parts) Author: Wolfgang Rosenauer Author: Lubos Lunak Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=140751 https://bugzilla.novell.com/show_bug.cgi?id=170055 -diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp ---- a/modules/libpref/Preferences.cpp -+++ b/modules/libpref/Preferences.cpp -@@ -91,16 +91,17 @@ - #include "plstr.h" - #include "prdtoa.h" - #include "prlink.h" - #include "xpcpublic.h" - #include "js/RootingAPI.h" +Index: firefox-115.0/modules/libpref/Preferences.cpp +=================================================================== +--- firefox-115.0.orig/modules/libpref/Preferences.cpp ++++ firefox-115.0/modules/libpref/Preferences.cpp +@@ -95,6 +95,7 @@ #ifdef MOZ_BACKGROUNDTASKS # include "mozilla/BackgroundTasks.h" #endif @@ -26,26 +22,15 @@ diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp #ifdef DEBUG # include - #endif - - #ifdef MOZ_MEMORY - # include "mozmemory.h" - #endif -@@ -4907,16 +4908,27 @@ nsresult Preferences::InitInitialObjects - "unix.js" - # if defined(_AIX) - , - "aix.js" - # endif +@@ -4911,6 +4912,16 @@ nsresult Preferences::InitInitialObjects #endif }; -+ if(nsKDEUtils::kdeSession()) { // TODO what if some setup actually requires the helper? -+ for(int i = 0; -+ i < MOZ_ARRAY_LENGTH(specialFiles); -+ ++i ) { -+ if( *specialFiles[ i ] == '\0' ) { -+ specialFiles[ i ] = "kde.js"; ++ if (nsKDEUtils::kdeSession()) { // TODO what if some setup actually requires ++ // the helper? ++ for (int i = 0; i < MOZ_ARRAY_LENGTH(specialFiles); ++i) { ++ if (*specialFiles[i] == '\0') { ++ specialFiles[i] = "kde.js"; + break; + } + } @@ -54,17 +39,7 @@ diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp rv = pref_LoadPrefsInDir(defaultPrefDir, specialFiles, ArrayLength(specialFiles)); if (NS_FAILED(rv)) { - NS_WARNING("Error parsing application default preferences."); - } - - // Load jar:$app/omni.jar!/defaults/preferences/*.js - // or jar:$gre/omni.jar!/defaults/preferences/*.js. -@@ -4981,17 +4993,17 @@ nsresult Preferences::InitInitialObjects - } - - nsCOMPtr path = do_QueryInterface(elem); - if (!path) { - continue; +@@ -4985,7 +4996,7 @@ nsresult Preferences::InitInitialObjects } // Do we care if a file provided by this process fails to load? @@ -73,20 +48,11 @@ diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp } } - #if defined(MOZ_WIDGET_GTK) - // To ensure the system-wide preferences are not overwritten by - // firefox/browser/defauts/preferences/*.js we need to load - // the /etc/firefox/defaults/pref/*.js settings as last. - // Under Flatpak, the NS_OS_SYSTEM_CONFIG_DIR points to /app/etc/firefox -diff --git a/modules/libpref/moz.build b/modules/libpref/moz.build ---- a/modules/libpref/moz.build -+++ b/modules/libpref/moz.build -@@ -122,16 +122,20 @@ EXPORTS.mozilla += [ - ] - EXPORTS.mozilla += sorted(["!" + g for g in gen_h]) - - UNIFIED_SOURCES += [ - "Preferences.cpp", +Index: firefox-115.0/modules/libpref/moz.build +=================================================================== +--- firefox-115.0.orig/modules/libpref/moz.build ++++ firefox-115.0/modules/libpref/moz.build +@@ -126,6 +126,10 @@ UNIFIED_SOURCES += [ "SharedPrefMap.cpp", ] @@ -97,20 +63,11 @@ diff --git a/modules/libpref/moz.build b/modules/libpref/moz.build gen_all_tuple = tuple(gen_h + gen_cpp + gen_rs) GeneratedFile( - *gen_all_tuple, - script="init/generate_static_pref_list.py", - entry_point="emit_code", - inputs=["init/StaticPrefList.yaml"] - ) -diff --git a/python/mozbuild/mozpack/chrome/flags.py b/python/mozbuild/mozpack/chrome/flags.py ---- a/python/mozbuild/mozpack/chrome/flags.py -+++ b/python/mozbuild/mozpack/chrome/flags.py -@@ -229,16 +229,17 @@ class Flags(OrderedDict): - "os": StringFlag, - "osversion": VersionFlag, - "abi": StringFlag, - "platform": Flag, - "xpcnativewrappers": Flag, +Index: firefox-115.0/python/mozbuild/mozpack/chrome/flags.py +=================================================================== +--- firefox-115.0.orig/python/mozbuild/mozpack/chrome/flags.py ++++ firefox-115.0/python/mozbuild/mozpack/chrome/flags.py +@@ -234,6 +234,7 @@ class Flags(OrderedDict): "tablet": Flag, "process": StringFlag, "backgroundtask": StringFlag, @@ -118,20 +75,11 @@ diff --git a/python/mozbuild/mozpack/chrome/flags.py b/python/mozbuild/mozpack/c } RE = re.compile(r"([!<>=]+)") - def __init__(self, *flags): - """ - Initialize a set of flags given in string form. - flags = Flags('contentaccessible=yes', 'appversion>=3.5') - """ -diff --git a/python/mozbuild/mozpack/chrome/manifest.py b/python/mozbuild/mozpack/chrome/manifest.py ---- a/python/mozbuild/mozpack/chrome/manifest.py -+++ b/python/mozbuild/mozpack/chrome/manifest.py -@@ -38,16 +38,17 @@ class ManifestEntry(object): - "os", - "osversion", - "abi", - "xpcnativewrappers", - "tablet", +Index: firefox-115.0/python/mozbuild/mozpack/chrome/manifest.py +=================================================================== +--- firefox-115.0.orig/python/mozbuild/mozpack/chrome/manifest.py ++++ firefox-115.0/python/mozbuild/mozpack/chrome/manifest.py +@@ -43,6 +43,7 @@ class ManifestEntry(object): "process", "contentaccessible", "backgroundtask", @@ -139,20 +87,11 @@ diff --git a/python/mozbuild/mozpack/chrome/manifest.py b/python/mozbuild/mozpac ] def __init__(self, base, *flags): - """ - Initialize a manifest entry with the given base path and flags. - """ - self.base = base - self.flags = Flags(*flags) -diff --git a/toolkit/components/downloads/moz.build b/toolkit/components/downloads/moz.build ---- a/toolkit/components/downloads/moz.build -+++ b/toolkit/components/downloads/moz.build -@@ -46,10 +46,14 @@ XPCOM_MANIFESTS += [ - - if CONFIG["MOZ_PLACES"]: - EXTRA_JS_MODULES += [ - "DownloadHistory.sys.mjs", - ] +Index: firefox-115.0/toolkit/components/downloads/moz.build +=================================================================== +--- firefox-115.0.orig/toolkit/components/downloads/moz.build ++++ firefox-115.0/toolkit/components/downloads/moz.build +@@ -51,5 +51,9 @@ if CONFIG["MOZ_PLACES"]: FINAL_LIBRARY = "xul" @@ -162,15 +101,11 @@ diff --git a/toolkit/components/downloads/moz.build b/toolkit/components/downloa + with Files("**"): BUG_COMPONENT = ("Toolkit", "Downloads API") -diff --git a/toolkit/mozapps/downloads/HelperAppDlg.sys.mjs b/toolkit/mozapps/downloads/HelperAppDlg.sys.mjs ---- a/toolkit/mozapps/downloads/HelperAppDlg.sys.mjs -+++ b/toolkit/mozapps/downloads/HelperAppDlg.sys.mjs -@@ -1235,36 +1235,66 @@ nsUnknownContentTypeDialog.prototype = { - params.handlerApp && - params.handlerApp.executable && - params.handlerApp.executable.isFile() - ) { - // Remember the file they chose to run. +Index: firefox-115.0/toolkit/mozapps/downloads/HelperAppDlg.sys.mjs +=================================================================== +--- firefox-115.0.orig/toolkit/mozapps/downloads/HelperAppDlg.sys.mjs ++++ firefox-115.0/toolkit/mozapps/downloads/HelperAppDlg.sys.mjs +@@ -1246,26 +1246,56 @@ nsUnknownContentTypeDialog.prototype = { this.chosenApp = params.handlerApp; } } else if ("@mozilla.org/applicationchooser;1" in Cc) { @@ -247,20 +182,11 @@ diff --git a/toolkit/mozapps/downloads/HelperAppDlg.sys.mjs b/toolkit/mozapps/do } else { var nsIFilePicker = Ci.nsIFilePicker; var fp = Cc["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker); - fp.init( - this.mDialog, - this.dialogElement("strings").getString("chooseAppFilePickerTitle"), - nsIFilePicker.modeOpen - ); -diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp ---- a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp -+++ b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp -@@ -11,16 +11,18 @@ - #include "prenv.h" - #include "nsInterfaceHashtable.h" - #include "nsHashtablesFwd.h" - #include "nsHashKeys.h" - #include "nsNetUtil.h" +Index: firefox-115.0/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp +=================================================================== +--- firefox-115.0.orig/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp ++++ firefox-115.0/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp +@@ -16,6 +16,8 @@ #include "nsISupportsPrimitives.h" #include "nsIGSettingsService.h" #include "nsReadableUtils.h" @@ -269,17 +195,7 @@ diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/sy using namespace mozilla; - class nsUnixSystemProxySettings final : public nsISystemProxySettings { - public: - NS_DECL_ISUPPORTS - NS_DECL_NSISYSTEMPROXYSETTINGS - -@@ -34,16 +36,18 @@ class nsUnixSystemProxySettings final : - nsCOMPtr mProxySettings; - nsInterfaceHashtable - mSchemeProxySettings; - nsresult GetProxyFromGSettings(const nsACString& aScheme, - const nsACString& aHost, int32_t aPort, +@@ -39,6 +41,8 @@ class nsUnixSystemProxySettings final : nsACString& aResult); nsresult SetProxyResultFromGSettings(const char* aKeyBase, const char* aType, nsACString& aResult); @@ -288,17 +204,7 @@ diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/sy }; NS_IMPL_ISUPPORTS(nsUnixSystemProxySettings, nsISystemProxySettings) - - NS_IMETHODIMP - nsUnixSystemProxySettings::GetMainThreadOnly(bool* aMainThreadOnly) { - // dbus prevents us from being threadsafe, but this routine should not block - // anyhow -@@ -392,21 +396,50 @@ nsresult nsUnixSystemProxySettings::GetP - return NS_OK; - } - - nsresult nsUnixSystemProxySettings::GetProxyForURI(const nsACString& aSpec, - const nsACString& aScheme, +@@ -396,6 +400,9 @@ nsresult nsUnixSystemProxySettings::GetP const nsACString& aHost, const int32_t aPort, nsACString& aResult) { @@ -308,51 +214,40 @@ diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/sy if (mProxySettings) { nsresult rv = GetProxyFromGSettings(aScheme, aHost, aPort, aResult); if (NS_SUCCEEDED(rv)) return rv; - } - +@@ -404,6 +411,28 @@ nsresult nsUnixSystemProxySettings::GetP return GetProxyFromEnvironment(aScheme, aHost, aPort, aResult); } -+nsresult -+nsUnixSystemProxySettings::GetProxyFromKDE(const nsACString& aScheme, -+ const nsACString& aHost, -+ PRInt32 aPort, -+ nsACString& aResult) -+{ ++nsresult nsUnixSystemProxySettings::GetProxyFromKDE(const nsACString& aScheme, ++ const nsACString& aHost, ++ PRInt32 aPort, ++ nsACString& aResult) { + nsAutoCString url; + url = aScheme; + url += "://"; + url += aHost; -+ if( aPort >= 0 ) -+ { ++ if (aPort >= 0) { + url += ":"; + url += nsPrintfCString("%d", aPort); + } + nsTArray command; -+ command.AppendElement( "GETPROXY"_ns ); -+ command.AppendElement( url ); ++ command.AppendElement("GETPROXY"_ns); ++ command.AppendElement(url); + nsTArray result; -+ if( !nsKDEUtils::command( command, &result ) || result.Length() != 1 ) ++ if (!nsKDEUtils::command(command, &result) || result.Length() != 1) + return NS_ERROR_FAILURE; + aResult = result[0]; + return NS_OK; +} -+ + NS_IMPL_COMPONENT_FACTORY(nsUnixSystemProxySettings) { auto result = MakeRefPtr(); result->Init(); - return result.forget().downcast(); - } -diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build ---- a/toolkit/xre/moz.build -+++ b/toolkit/xre/moz.build -@@ -91,17 +91,19 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "co - "../components/printingui", - ] - elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "uikit": - UNIFIED_SOURCES += [ - "nsNativeAppSupportDefault.cpp", +Index: firefox-115.0/toolkit/xre/moz.build +=================================================================== +--- firefox-115.0.orig/toolkit/xre/moz.build ++++ firefox-115.0/toolkit/xre/moz.build +@@ -96,7 +96,9 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "ui "UIKitDirProvider.mm", ] elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": @@ -362,16 +257,11 @@ diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build "nsNativeAppSupportUnix.cpp", ] CXXFLAGS += CONFIG["MOZ_X11_SM_CFLAGS"] - else: - UNIFIED_SOURCES += [ - "nsNativeAppSupportDefault.cpp", - ] - -diff --git a/toolkit/xre/nsKDEUtils.cpp b/toolkit/xre/nsKDEUtils.cpp -new file mode 100644 +Index: firefox-115.0/toolkit/xre/nsKDEUtils.cpp +=================================================================== --- /dev/null -+++ b/toolkit/xre/nsKDEUtils.cpp -@@ -0,0 +1,321 @@ ++++ firefox-115.0/toolkit/xre/nsKDEUtils.cpp +@@ -0,0 +1,286 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -395,309 +285,274 @@ new file mode 100644 +// copied from X11/X.h as a hack since for an unknown +// reason it's not picked up from X11/X.h +#ifndef None -+#define None 0L /* universal null resource or null atom */ ++# define None 0L /* universal null resource or null atom */ +#endif + -+//#define DEBUG_KDE ++// #define DEBUG_KDE +#ifdef DEBUG_KDE -+#define KMOZILLAHELPER "kmozillahelper" ++# define KMOZILLAHELPER "kmozillahelper" +#else +// not need for lib64, it's a binary -+#define KMOZILLAHELPER "/usr/lib/mozilla/kmozillahelper" ++# define KMOZILLAHELPER "/usr/lib/mozilla/kmozillahelper" +#endif + +#define KMOZILLAHELPER_VERSION 6 -+#define MAKE_STR2( n ) #n -+#define MAKE_STR( n ) MAKE_STR2( n ) ++#define MAKE_STR2(n) #n ++#define MAKE_STR(n) MAKE_STR2(n) + -+static bool getKdeSession() -+{ -+ if (PR_GetEnv("KDE_FULL_SESSION")) -+ { -+ return true; -+ } -+ return false; ++static bool getKdeSession() { ++ if (PR_GetEnv("KDE_FULL_SESSION")) { ++ return true; ++ } ++ return false; +} + -+static bool getKdeSupport() -+ { -+ nsTArray command; -+ command.AppendElement( "CHECK"_ns ); -+ command.AppendElement( "KMOZILLAHELPER_VERSION"_ns ); -+ bool kde = nsKDEUtils::command( command ); ++static bool getKdeSupport() { ++ nsTArray command; ++ command.AppendElement("CHECK"_ns); ++ command.AppendElement("KMOZILLAHELPER_VERSION"_ns); ++ bool kde = nsKDEUtils::command(command); +#ifdef DEBUG_KDE -+ fprintf( stderr, "KDE RUNNING %d\n", kde ); ++ fprintf(stderr, "KDE RUNNING %d\n", kde); +#endif -+ return kde; -+ } ++ return kde; ++} + -+nsKDEUtils::nsKDEUtils() -+ : commandFile( NULL ) -+ , replyFile( NULL ) -+ { -+ } ++nsKDEUtils::nsKDEUtils() : commandFile(NULL), replyFile(NULL) {} + -+nsKDEUtils::~nsKDEUtils() -+ { -+// closeHelper(); not actually useful, exiting will close the fd too -+ } ++nsKDEUtils::~nsKDEUtils() { ++ // closeHelper(); not actually useful, exiting will close the fd too ++} + -+nsKDEUtils* nsKDEUtils::self() -+ { -+ static nsKDEUtils s; -+ return &s; -+ } ++nsKDEUtils* nsKDEUtils::self() { ++ static nsKDEUtils s; ++ return &s; ++} + +static bool helperRunning = false; +static bool helperFailed = false; + -+bool nsKDEUtils::kdeSession() -+ { -+ static bool session = getKdeSession(); -+ return session; ++bool nsKDEUtils::kdeSession() { ++ static bool session = getKdeSession(); ++ return session; ++} ++ ++bool nsKDEUtils::kdeSupport() { ++ static bool support = kdeSession() && getKdeSupport(); ++ return support && helperRunning; ++} ++ ++struct nsKDECommandData { ++ FILE* file; ++ nsTArray* output; ++ GMainLoop* loop; ++ bool success; ++}; ++ ++static gboolean kdeReadFunc(GIOChannel*, GIOCondition, gpointer data) { ++ nsKDECommandData* p = static_cast(data); ++ char buf[8192]; // TODO big enough ++ bool command_done = false; ++ bool command_failed = false; ++ while (!command_done && !command_failed && ++ fgets(buf, 8192, p->file) != ++ NULL) { // TODO what if the kernel splits a line into two chunks? ++ // #ifdef DEBUG_KDE ++ // fprintf( stderr, "READ: %s %d\n", buf, feof( p->file )); ++ // #endif ++ if (char* eol = strchr(buf, '\n')) *eol = '\0'; ++ command_done = (strcmp(buf, "\\1") == 0); ++ command_failed = (strcmp(buf, "\\0") == 0); ++ nsAutoCString line(buf); ++ line.ReplaceSubstring("\\n", "\n"); ++ line.ReplaceSubstring( ++ "\\" ++ "\\", ++ "\\"); // \\ -> \ , i.e. unescape ++ if (p->output && !(command_done || command_failed)) ++ p->output->AppendElement(nsCString(buf)); // TODO utf8? ++ } ++ bool quit = false; ++ if (feof(p->file) || command_failed) { ++ quit = true; ++ p->success = false; ++ } ++ if (command_done) { // reading one reply finished ++ quit = true; ++ p->success = true; ++ } ++ if (quit) { ++ if (p->loop) g_main_loop_quit(p->loop); ++ return FALSE; ++ } ++ return TRUE; ++} ++ ++bool nsKDEUtils::command(const nsTArray& command, ++ nsTArray* output) { ++ return self()->internalCommand(command, NULL, false, output); ++} ++ ++bool nsKDEUtils::command(nsIArray* command, nsIArray** output) { ++ nsTArray in; ++ PRUint32 length; ++ command->GetLength(&length); ++ for (PRUint32 i = 0; i < length; i++) { ++ nsCOMPtr str = do_QueryElementAt(command, i); ++ if (str) { ++ nsAutoCString s; ++ str->GetData(s); ++ in.AppendElement(s); + } ++ } + -+bool nsKDEUtils::kdeSupport() -+ { -+ static bool support = kdeSession() && getKdeSupport(); -+ return support && helperRunning; ++ nsTArray out; ++ bool ret = self()->internalCommand(in, NULL, false, &out); ++ ++ if (!output) return ret; ++ ++ nsCOMPtr result = do_CreateInstance(NS_ARRAY_CONTRACTID); ++ if (!result) return false; ++ ++ for (PRUint32 i = 0; i < out.Length(); i++) { ++ nsCOMPtr rstr = ++ do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID); ++ if (!rstr) return false; ++ ++ rstr->SetData(out[i]); ++ result->AppendElement(rstr); ++ } ++ ++ NS_ADDREF(*output = result); ++ return ret; ++} ++ ++bool nsKDEUtils::commandBlockUi(const nsTArray& command, ++ GtkWindow* parent, ++ nsTArray* output) { ++ return self()->internalCommand(command, parent, true, output); ++} ++ ++bool nsKDEUtils::internalCommand(const nsTArray& command, ++ GtkWindow* parent, bool blockUi, ++ nsTArray* output) { ++ if (!startHelper()) return false; ++ feedCommand(command); ++ // do not store the data in 'this' but in extra structure, just in case there ++ // is reentrancy (can there be? the event loop is re-entered) ++ nsKDECommandData data; ++ data.file = replyFile; ++ data.output = output; ++ data.success = false; ++ if (blockUi) { ++ data.loop = g_main_loop_new(NULL, FALSE); ++ GtkWidget* window = gtk_window_new(GTK_WINDOW_TOPLEVEL); ++ if (parent && gtk_window_get_group(parent)) ++ gtk_window_group_add_window(gtk_window_get_group(parent), ++ GTK_WINDOW(window)); ++ gtk_widget_realize(window); ++ gtk_widget_set_sensitive(window, TRUE); ++ gtk_grab_add(window); ++ GIOChannel* channel = g_io_channel_unix_new(fileno(data.file)); ++ g_io_add_watch(channel, ++ static_cast(G_IO_IN | G_IO_ERR | G_IO_HUP), ++ kdeReadFunc, &data); ++ g_io_channel_unref(channel); ++ g_main_loop_run(data.loop); ++ g_main_loop_unref(data.loop); ++ gtk_grab_remove(window); ++ gtk_widget_destroy(window); ++ } else { ++ data.loop = NULL; ++ while (kdeReadFunc(NULL, static_cast(0), &data)) ++ ; ++ } ++ return data.success; ++} ++ ++bool nsKDEUtils::startHelper() { ++ if (helperRunning) return true; ++ if (helperFailed) return false; ++ helperFailed = true; ++ int fdcommand[2]; ++ int fdreply[2]; ++ if (pipe(fdcommand) < 0) return false; ++ if (pipe(fdreply) < 0) { ++ close(fdcommand[0]); ++ close(fdcommand[1]); ++ return false; ++ } ++ char* args[2] = {const_cast(KMOZILLAHELPER), NULL}; ++ switch (fork()) { ++ case -1: { ++ close(fdcommand[0]); ++ close(fdcommand[1]); ++ close(fdreply[0]); ++ close(fdreply[1]); ++ return false; + } -+ -+struct nsKDECommandData ++ case 0: // child + { -+ FILE* file; -+ nsTArray* output; -+ GMainLoop* loop; -+ bool success; -+ }; -+ -+static gboolean kdeReadFunc( GIOChannel*, GIOCondition, gpointer data ) -+ { -+ nsKDECommandData* p = static_cast< nsKDECommandData* >( data ); -+ char buf[ 8192 ]; // TODO big enough -+ bool command_done = false; -+ bool command_failed = false; -+ while( !command_done && !command_failed && fgets( buf, 8192, p->file ) != NULL ) -+ { // TODO what if the kernel splits a line into two chunks? -+//#ifdef DEBUG_KDE -+// fprintf( stderr, "READ: %s %d\n", buf, feof( p->file )); -+//#endif -+ if( char* eol = strchr( buf, '\n' )) -+ *eol = '\0'; -+ command_done = ( strcmp( buf, "\\1" ) == 0 ); -+ command_failed = ( strcmp( buf, "\\0" ) == 0 ); -+ nsAutoCString line( buf ); -+ line.ReplaceSubstring( "\\n", "\n" ); -+ line.ReplaceSubstring( "\\" "\\", "\\" ); // \\ -> \ , i.e. unescape -+ if( p->output && !( command_done || command_failed )) -+ p->output->AppendElement( nsCString( buf )); // TODO utf8? -+ } -+ bool quit = false; -+ if( feof( p->file ) || command_failed ) -+ { -+ quit = true; -+ p->success = false; -+ } -+ if( command_done ) -+ { // reading one reply finished -+ quit = true; -+ p->success = true; -+ } -+ if( quit ) -+ { -+ if( p->loop ) -+ g_main_loop_quit( p->loop ); -+ return FALSE; -+ } -+ return TRUE; -+ } -+ -+bool nsKDEUtils::command( const nsTArray& command, nsTArray* output ) -+ { -+ return self()->internalCommand( command, NULL, false, output ); -+ } -+ -+bool nsKDEUtils::command( nsIArray* command, nsIArray** output) -+ { -+ nsTArray in; -+ PRUint32 length; -+ command->GetLength( &length ); -+ for ( PRUint32 i = 0; i < length; i++ ) -+ { -+ nsCOMPtr str = do_QueryElementAt( command, i ); -+ if( str ) -+ { -+ nsAutoCString s; -+ str->GetData( s ); -+ in.AppendElement( s ); -+ } -+ } -+ -+ nsTArray out; -+ bool ret = self()->internalCommand( in, NULL, false, &out ); -+ -+ if ( !output ) return ret; -+ -+ nsCOMPtr result = do_CreateInstance( NS_ARRAY_CONTRACTID ); -+ if ( !result ) return false; -+ -+ for ( PRUint32 i = 0; i < out.Length(); i++ ) -+ { -+ nsCOMPtr rstr = do_CreateInstance( NS_SUPPORTS_CSTRING_CONTRACTID ); -+ if ( !rstr ) return false; -+ -+ rstr->SetData( out[i] ); -+ result->AppendElement( rstr ); -+ } -+ -+ NS_ADDREF( *output = result); -+ return ret; -+ } -+ -+ -+bool nsKDEUtils::commandBlockUi( const nsTArray& command, GtkWindow* parent, nsTArray* output ) -+ { -+ return self()->internalCommand( command, parent, true, output ); -+ } -+ -+bool nsKDEUtils::internalCommand( const nsTArray& command, GtkWindow* parent, bool blockUi, -+ nsTArray* output ) -+ { -+ if( !startHelper()) -+ return false; -+ feedCommand( command ); -+ // do not store the data in 'this' but in extra structure, just in case there -+ // is reentrancy (can there be? the event loop is re-entered) -+ nsKDECommandData data; -+ data.file = replyFile; -+ data.output = output; -+ data.success = false; -+ if( blockUi ) -+ { -+ data.loop = g_main_loop_new( NULL, FALSE ); -+ GtkWidget* window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); -+ if( parent && gtk_window_get_group(parent) ) -+ gtk_window_group_add_window( gtk_window_get_group(parent), GTK_WINDOW( window )); -+ gtk_widget_realize( window ); -+ gtk_widget_set_sensitive( window, TRUE ); -+ gtk_grab_add( window ); -+ GIOChannel* channel = g_io_channel_unix_new( fileno( data.file )); -+ g_io_add_watch( channel, static_cast< GIOCondition >( G_IO_IN | G_IO_ERR | G_IO_HUP ), kdeReadFunc, &data ); -+ g_io_channel_unref( channel ); -+ g_main_loop_run( data.loop ); -+ g_main_loop_unref( data.loop ); -+ gtk_grab_remove( window ); -+ gtk_widget_destroy( window ); -+ } -+ else -+ { -+ data.loop = NULL; -+ while( kdeReadFunc( NULL, static_cast< GIOCondition >( 0 ), &data )) -+ ; -+ } -+ return data.success; -+ } -+ -+bool nsKDEUtils::startHelper() -+ { -+ if( helperRunning ) -+ return true; -+ if( helperFailed ) -+ return false; -+ helperFailed = true; -+ int fdcommand[ 2 ]; -+ int fdreply[ 2 ]; -+ if( pipe( fdcommand ) < 0 ) -+ return false; -+ if( pipe( fdreply ) < 0 ) -+ { -+ close( fdcommand[ 0 ] ); -+ close( fdcommand[ 1 ] ); -+ return false; -+ } -+ char* args[ 2 ] = { const_cast< char* >( KMOZILLAHELPER ), NULL }; -+ switch( fork()) -+ { -+ case -1: -+ { -+ close( fdcommand[ 0 ] ); -+ close( fdcommand[ 1 ] ); -+ close( fdreply[ 0 ] ); -+ close( fdreply[ 1 ] ); -+ return false; -+ } -+ case 0: // child -+ { -+ if( dup2( fdcommand[ 0 ], STDIN_FILENO ) < 0 ) -+ _exit( 1 ); -+ if( dup2( fdreply[ 1 ], STDOUT_FILENO ) < 0 ) -+ _exit( 1 ); -+ int maxfd = 1024; // close all other fds -+ struct rlimit rl; -+ if( getrlimit( RLIMIT_NOFILE, &rl ) == 0 ) -+ maxfd = rl.rlim_max; -+ for( int i = 3; -+ i < maxfd; -+ ++i ) -+ close( i ); ++ if (dup2(fdcommand[0], STDIN_FILENO) < 0) _exit(1); ++ if (dup2(fdreply[1], STDOUT_FILENO) < 0) _exit(1); ++ int maxfd = 1024; // close all other fds ++ struct rlimit rl; ++ if (getrlimit(RLIMIT_NOFILE, &rl) == 0) maxfd = rl.rlim_max; ++ for (int i = 3; i < maxfd; ++i) close(i); +#ifdef DEBUG_KDE -+ execvp( KMOZILLAHELPER, args ); ++ execvp(KMOZILLAHELPER, args); +#else -+ execv( KMOZILLAHELPER, args ); ++ execv(KMOZILLAHELPER, args); +#endif -+ _exit( 1 ); // failed -+ } -+ default: // parent -+ { -+ commandFile = fdopen( fdcommand[ 1 ], "w" ); -+ replyFile = fdopen( fdreply[ 0 ], "r" ); -+ close( fdcommand[ 0 ] ); -+ close( fdreply[ 1 ] ); -+ if( commandFile == NULL || replyFile == NULL ) -+ { -+ closeHelper(); -+ return false; -+ } -+ // ok, helper ready, getKdeRunning() will check if it works -+ } -+ } -+ helperFailed = false; -+ helperRunning = true; -+ return true; ++ _exit(1); // failed + } -+ -+void nsKDEUtils::closeHelper() ++ default: // parent + { -+ if( commandFile != NULL ) -+ fclose( commandFile ); // this will also make the helper quit -+ if( replyFile != NULL ) -+ fclose( replyFile ); -+ helperRunning = false; ++ commandFile = fdopen(fdcommand[1], "w"); ++ replyFile = fdopen(fdreply[0], "r"); ++ close(fdcommand[0]); ++ close(fdreply[1]); ++ if (commandFile == NULL || replyFile == NULL) { ++ closeHelper(); ++ return false; ++ } ++ // ok, helper ready, getKdeRunning() will check if it works + } ++ } ++ helperFailed = false; ++ helperRunning = true; ++ return true; ++} + -+void nsKDEUtils::feedCommand( const nsTArray& command ) -+ { -+ for( int i = 0; -+ i < command.Length(); -+ ++i ) -+ { -+ nsCString line = command[ i ]; -+ line.ReplaceSubstring( "\\", "\\" "\\" ); // \ -> \\ , i.e. escape -+ line.ReplaceSubstring( "\n", "\\n" ); ++void nsKDEUtils::closeHelper() { ++ if (commandFile != NULL) ++ fclose(commandFile); // this will also make the helper quit ++ if (replyFile != NULL) fclose(replyFile); ++ helperRunning = false; ++} ++ ++void nsKDEUtils::feedCommand(const nsTArray& command) { ++ for (int i = 0; i < command.Length(); ++i) { ++ nsCString line = command[i]; ++ line.ReplaceSubstring("\\", ++ "\\" ++ "\\"); // \ -> \\ , i.e. escape ++ line.ReplaceSubstring("\n", "\\n"); +#ifdef DEBUG_KDE -+ fprintf( stderr, "COMM: %s\n", line.get()); ++ fprintf(stderr, "COMM: %s\n", line.get()); +#endif -+ fputs( line.get(), commandFile ); -+ fputs( "\n", commandFile ); -+ } -+ fputs( "\\E\n", commandFile ); // done as \E, so it cannot happen in normal data -+ fflush( commandFile ); -+ } -diff --git a/toolkit/xre/nsKDEUtils.h b/toolkit/xre/nsKDEUtils.h -new file mode 100644 ++ fputs(line.get(), commandFile); ++ fputs("\n", commandFile); ++ } ++ fputs("\\E\n", ++ commandFile); // done as \E, so it cannot happen in normal data ++ fflush(commandFile); ++} +Index: firefox-115.0/toolkit/xre/nsKDEUtils.h +=================================================================== --- /dev/null -+++ b/toolkit/xre/nsKDEUtils.h -@@ -0,0 +1,48 @@ ++++ firefox-115.0/toolkit/xre/nsKDEUtils.h +@@ -0,0 +1,53 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -714,47 +569,48 @@ new file mode 100644 + +class nsIArray; + -+class NS_EXPORT nsKDEUtils -+ { -+ public: -+ /* Returns true if running inside a KDE session (regardless of whether there is KDE -+ support available for Firefox). This should be used e.g. when determining -+ dialog button order but not for code that requires the KDE support. */ -+ static bool kdeSession(); -+ /* Returns true if running inside a KDE session and KDE support is available -+ for Firefox. This should be used everywhere where the external helper is needed. */ -+ static bool kdeSupport(); -+ /* Executes the given helper command, returns true if helper returned success. */ -+ static bool command( const nsTArray& command, nsTArray* output = NULL ); -+ static bool command( nsIArray* command, nsIArray** output = NULL ); -+ /* Like command(), but additionally blocks the parent widget like if there was -+ a modal dialog shown and enters the event loop (i.e. there are still paint updates, -+ this is for commands that take long). */ -+ static bool commandBlockUi( const nsTArray& command, GtkWindow* parent, nsTArray* output = NULL ); ++class NS_EXPORT nsKDEUtils { ++ public: ++ /* Returns true if running inside a KDE session (regardless of whether there ++ is KDE support available for Firefox). This should be used e.g. when ++ determining dialog button order but not for code that requires the KDE ++ support. */ ++ static bool kdeSession(); ++ /* Returns true if running inside a KDE session and KDE support is available ++ for Firefox. This should be used everywhere where the external helper is ++ needed. */ ++ static bool kdeSupport(); ++ /* Executes the given helper command, returns true if helper returned success. ++ */ ++ static bool command(const nsTArray& command, ++ nsTArray* output = NULL); ++ static bool command(nsIArray* command, nsIArray** output = NULL); ++ /* Like command(), but additionally blocks the parent widget like if there was ++ a modal dialog shown and enters the event loop (i.e. there are still paint ++ updates, this is for commands that take long). */ ++ static bool commandBlockUi(const nsTArray& command, ++ GtkWindow* parent, ++ nsTArray* output = NULL); + -+ private: -+ nsKDEUtils(); -+ ~nsKDEUtils(); -+ static nsKDEUtils* self(); -+ bool startHelper(); -+ void closeHelper(); -+ void feedCommand( const nsTArray& command ); -+ bool internalCommand( const nsTArray& command, GtkWindow* parent, bool isParent, -+ nsTArray* output ); -+ FILE* commandFile; -+ FILE* replyFile; -+ }; ++ private: ++ nsKDEUtils(); ++ ~nsKDEUtils(); ++ static nsKDEUtils* self(); ++ bool startHelper(); ++ void closeHelper(); ++ void feedCommand(const nsTArray& command); ++ bool internalCommand(const nsTArray& command, GtkWindow* parent, ++ bool isParent, nsTArray* output); ++ FILE* commandFile; ++ FILE* replyFile; ++}; + -+#endif // nsKDEUtils -diff --git a/uriloader/exthandler/HandlerServiceParent.cpp b/uriloader/exthandler/HandlerServiceParent.cpp ---- a/uriloader/exthandler/HandlerServiceParent.cpp -+++ b/uriloader/exthandler/HandlerServiceParent.cpp -@@ -13,17 +13,17 @@ - #include "ContentHandlerService.h" - #include "nsIExternalProtocolService.h" - #include "nsStringEnumerator.h" - #include "nsIMutableArray.h" - #include "nsCExternalHandlerService.h" ++#endif // nsKDEUtils +Index: firefox-115.0/uriloader/exthandler/HandlerServiceParent.cpp +=================================================================== +--- firefox-115.0.orig/uriloader/exthandler/HandlerServiceParent.cpp ++++ firefox-115.0/uriloader/exthandler/HandlerServiceParent.cpp +@@ -18,7 +18,7 @@ #include "nsComponentManagerUtils.h" #include "nsServiceManagerUtils.h" #ifdef MOZ_WIDGET_GTK @@ -763,39 +619,22 @@ diff --git a/uriloader/exthandler/HandlerServiceParent.cpp b/uriloader/exthandle #endif using mozilla::dom::ContentHandlerService; - using mozilla::dom::HandlerApp; - using mozilla::dom::HandlerInfo; - using mozilla::dom::RemoteHandlerApp; - - namespace { -@@ -306,17 +306,17 @@ mozilla::ipc::IPCResult HandlerServicePa - const nsACString& aProtocolScheme, bool* aHandlerExists) { - if (aProtocolScheme.Length() > MAX_SCHEME_LENGTH) { - *aHandlerExists = false; - return IPC_OK(); +@@ -310,8 +310,8 @@ mozilla::ipc::IPCResult HandlerServicePa } #ifdef MOZ_WIDGET_GTK // Check the GNOME registry for a protocol handler - *aHandlerExists = +- *aHandlerExists = - nsGNOMERegistry::HandlerExists(PromiseFlatCString(aProtocolScheme).get()); -+ nsCommonRegistry::HandlerExists(PromiseFlatCString(aProtocolScheme).get()); ++ *aHandlerExists = nsCommonRegistry::HandlerExists( ++ PromiseFlatCString(aProtocolScheme).get()); #else *aHandlerExists = false; #endif - return IPC_OK(); - } - - /* - * Check if a handler exists for the provided protocol. Check the datastore -diff --git a/uriloader/exthandler/moz.build b/uriloader/exthandler/moz.build ---- a/uriloader/exthandler/moz.build -+++ b/uriloader/exthandler/moz.build -@@ -81,17 +81,19 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "ui - else: - # These files can't be built in unified mode because they redefine LOG. - SOURCES += [ - osdir + "/nsOSHelperAppService.cpp", - ] +Index: firefox-115.0/uriloader/exthandler/moz.build +=================================================================== +--- firefox-115.0.orig/uriloader/exthandler/moz.build ++++ firefox-115.0/uriloader/exthandler/moz.build +@@ -86,7 +86,9 @@ else: if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": UNIFIED_SOURCES += [ @@ -805,17 +644,7 @@ diff --git a/uriloader/exthandler/moz.build b/uriloader/exthandler/moz.build "unix/nsMIMEInfoUnix.cpp", ] elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "android": - UNIFIED_SOURCES += [ - "android/nsMIMEInfoAndroid.cpp", - ] - elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows": - UNIFIED_SOURCES += [ -@@ -129,16 +131,17 @@ include("/ipc/chromium/chromium-config.m - FINAL_LIBRARY = "xul" - - LOCAL_INCLUDES += [ - "/docshell/base", - "/dom/base", +@@ -134,6 +136,7 @@ LOCAL_INCLUDES += [ "/dom/ipc", "/netwerk/base", "/netwerk/protocol/http", @@ -823,16 +652,11 @@ diff --git a/uriloader/exthandler/moz.build b/uriloader/exthandler/moz.build ] if CONFIG["MOZ_ENABLE_DBUS"]: - CXXFLAGS += CONFIG["MOZ_DBUS_CFLAGS"] - - if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": - CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"] - CXXFLAGS += CONFIG["MOZ_DBUS_GLIB_CFLAGS"] -diff --git a/uriloader/exthandler/unix/nsCommonRegistry.cpp b/uriloader/exthandler/unix/nsCommonRegistry.cpp -new file mode 100644 +Index: firefox-115.0/uriloader/exthandler/unix/nsCommonRegistry.cpp +=================================================================== --- /dev/null -+++ b/uriloader/exthandler/unix/nsCommonRegistry.cpp -@@ -0,0 +1,53 @@ ++++ firefox-115.0/uriloader/exthandler/unix/nsCommonRegistry.cpp +@@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -845,51 +669,40 @@ new file mode 100644 +#include "nsString.h" +#include "nsKDEUtils.h" + -+/* static */ bool -+nsCommonRegistry::HandlerExists(const char *aProtocolScheme) -+{ -+ if( nsKDEUtils::kdeSupport()) -+ return nsKDERegistry::HandlerExists( aProtocolScheme ); -+ return nsGNOMERegistry::HandlerExists( aProtocolScheme ); ++/* static */ bool nsCommonRegistry::HandlerExists(const char* aProtocolScheme) { ++ if (nsKDEUtils::kdeSupport()) ++ return nsKDERegistry::HandlerExists(aProtocolScheme); ++ return nsGNOMERegistry::HandlerExists(aProtocolScheme); +} + -+/* static */ nsresult -+nsCommonRegistry::LoadURL(nsIURI *aURL) -+{ -+ if( nsKDEUtils::kdeSupport()) -+ return nsKDERegistry::LoadURL( aURL ); -+ return nsGNOMERegistry::LoadURL( aURL ); ++/* static */ nsresult nsCommonRegistry::LoadURL(nsIURI* aURL) { ++ if (nsKDEUtils::kdeSupport()) return nsKDERegistry::LoadURL(aURL); ++ return nsGNOMERegistry::LoadURL(aURL); +} + -+/* static */ void -+nsCommonRegistry::GetAppDescForScheme(const nsACString& aScheme, -+ nsAString& aDesc) -+{ -+ if( nsKDEUtils::kdeSupport()) -+ return nsKDERegistry::GetAppDescForScheme( aScheme, aDesc ); -+ return nsGNOMERegistry::GetAppDescForScheme( aScheme, aDesc ); -+} -+ -+ -+/* static */ already_AddRefed -+nsCommonRegistry::GetFromExtension(const nsACString& aFileExt) -+{ -+ if( nsKDEUtils::kdeSupport()) -+ return nsKDERegistry::GetFromExtension( aFileExt ); -+ return nsGNOMERegistry::GetFromExtension( aFileExt ); ++/* static */ void nsCommonRegistry::GetAppDescForScheme( ++ const nsACString& aScheme, nsAString& aDesc) { ++ if (nsKDEUtils::kdeSupport()) ++ return nsKDERegistry::GetAppDescForScheme(aScheme, aDesc); ++ return nsGNOMERegistry::GetAppDescForScheme(aScheme, aDesc); +} + +/* static */ already_AddRefed -+nsCommonRegistry::GetFromType(const nsACString& aMIMEType) -+{ -+ if( nsKDEUtils::kdeSupport()) -+ return nsKDERegistry::GetFromType( aMIMEType ); -+ return nsGNOMERegistry::GetFromType( aMIMEType ); ++nsCommonRegistry::GetFromExtension(const nsACString& aFileExt) { ++ if (nsKDEUtils::kdeSupport()) ++ return nsKDERegistry::GetFromExtension(aFileExt); ++ return nsGNOMERegistry::GetFromExtension(aFileExt); +} -diff --git a/uriloader/exthandler/unix/nsCommonRegistry.h b/uriloader/exthandler/unix/nsCommonRegistry.h -new file mode 100644 ++ ++/* static */ already_AddRefed nsCommonRegistry::GetFromType( ++ const nsACString& aMIMEType) { ++ if (nsKDEUtils::kdeSupport()) return nsKDERegistry::GetFromType(aMIMEType); ++ return nsGNOMERegistry::GetFromType(aMIMEType); ++} +Index: firefox-115.0/uriloader/exthandler/unix/nsCommonRegistry.h +=================================================================== --- /dev/null -+++ b/uriloader/exthandler/unix/nsCommonRegistry.h ++++ firefox-115.0/uriloader/exthandler/unix/nsCommonRegistry.h @@ -0,0 +1,28 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -903,27 +716,27 @@ new file mode 100644 + +class nsMIMEInfoBase; + -+class nsCommonRegistry -+{ ++class nsCommonRegistry { + public: -+ static bool HandlerExists(const char *aProtocolScheme); ++ static bool HandlerExists(const char* aProtocolScheme); + -+ static nsresult LoadURL(nsIURI *aURL); ++ static nsresult LoadURL(nsIURI* aURL); + -+ static void GetAppDescForScheme(const nsACString& aScheme, -+ nsAString& aDesc); ++ static void GetAppDescForScheme(const nsACString& aScheme, nsAString& aDesc); + -+ static already_AddRefed GetFromExtension(const nsACString& aFileExt); ++ static already_AddRefed GetFromExtension( ++ const nsACString& aFileExt); + -+ static already_AddRefed GetFromType(const nsACString& aMIMEType); ++ static already_AddRefed GetFromType( ++ const nsACString& aMIMEType); +}; + +#endif -diff --git a/uriloader/exthandler/unix/nsKDERegistry.cpp b/uriloader/exthandler/unix/nsKDERegistry.cpp -new file mode 100644 +Index: firefox-115.0/uriloader/exthandler/unix/nsKDERegistry.cpp +=================================================================== --- /dev/null -+++ b/uriloader/exthandler/unix/nsKDERegistry.cpp -@@ -0,0 +1,89 @@ ++++ firefox-115.0/uriloader/exthandler/unix/nsKDERegistry.cpp +@@ -0,0 +1,75 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -937,87 +750,73 @@ new file mode 100644 +#include "nsMIMEInfoUnix.h" +#include "nsKDEUtils.h" + -+/* static */ bool -+nsKDERegistry::HandlerExists(const char *aProtocolScheme) -+{ -+ nsTArray command; -+ command.AppendElement( "HANDLEREXISTS"_ns ); -+ command.AppendElement( nsAutoCString( aProtocolScheme )); -+ return nsKDEUtils::command( command ); ++/* static */ bool nsKDERegistry::HandlerExists(const char* aProtocolScheme) { ++ nsTArray command; ++ command.AppendElement("HANDLEREXISTS"_ns); ++ command.AppendElement(nsAutoCString(aProtocolScheme)); ++ return nsKDEUtils::command(command); +} + -+/* static */ nsresult -+nsKDERegistry::LoadURL(nsIURI *aURL) -+{ -+ nsTArray command; -+ command.AppendElement( "OPEN"_ns ); -+ nsCString url; -+ aURL->GetSpec( url ); -+ command.AppendElement( url ); -+ bool rv = nsKDEUtils::command( command ); -+ if (!rv) -+ return NS_ERROR_FAILURE; ++/* static */ nsresult nsKDERegistry::LoadURL(nsIURI* aURL) { ++ nsTArray command; ++ command.AppendElement("OPEN"_ns); ++ nsCString url; ++ aURL->GetSpec(url); ++ command.AppendElement(url); ++ bool rv = nsKDEUtils::command(command); ++ if (!rv) return NS_ERROR_FAILURE; + -+ return NS_OK; ++ return NS_OK; +} + -+/* static */ void -+nsKDERegistry::GetAppDescForScheme(const nsACString& aScheme, -+ nsAString& aDesc) -+{ -+ nsTArray command; -+ command.AppendElement( "GETAPPDESCFORSCHEME"_ns ); -+ command.AppendElement( aScheme ); -+ nsTArray output; -+ if( nsKDEUtils::command( command, &output ) && output.Length() == 1 ) -+ CopyUTF8toUTF16( output[ 0 ], aDesc ); ++/* static */ void nsKDERegistry::GetAppDescForScheme(const nsACString& aScheme, ++ nsAString& aDesc) { ++ nsTArray command; ++ command.AppendElement("GETAPPDESCFORSCHEME"_ns); ++ command.AppendElement(aScheme); ++ nsTArray output; ++ if (nsKDEUtils::command(command, &output) && output.Length() == 1) ++ CopyUTF8toUTF16(output[0], aDesc); +} + -+ -+/* static */ already_AddRefed -+nsKDERegistry::GetFromExtension(const nsACString& aFileExt) -+{ -+ NS_ASSERTION(aFileExt[0] != '.', "aFileExt shouldn't start with a dot"); -+ nsTArray command; -+ command.AppendElement( "GETFROMEXTENSION"_ns ); -+ command.AppendElement( aFileExt ); -+ return GetFromHelper( command ); ++/* static */ already_AddRefed nsKDERegistry::GetFromExtension( ++ const nsACString& aFileExt) { ++ NS_ASSERTION(aFileExt[0] != '.', "aFileExt shouldn't start with a dot"); ++ nsTArray command; ++ command.AppendElement("GETFROMEXTENSION"_ns); ++ command.AppendElement(aFileExt); ++ return GetFromHelper(command); +} + -+/* static */ already_AddRefed -+nsKDERegistry::GetFromType(const nsACString& aMIMEType) -+{ -+ nsTArray command; -+ command.AppendElement( "GETFROMTYPE"_ns ); -+ command.AppendElement( aMIMEType ); -+ return GetFromHelper( command ); ++/* static */ already_AddRefed nsKDERegistry::GetFromType( ++ const nsACString& aMIMEType) { ++ nsTArray command; ++ command.AppendElement("GETFROMTYPE"_ns); ++ command.AppendElement(aMIMEType); ++ return GetFromHelper(command); +} + -+/* static */ already_AddRefed -+nsKDERegistry::GetFromHelper(const nsTArray& command) -+{ -+ nsTArray output; -+ if( nsKDEUtils::command( command, &output ) && output.Length() == 3 ) -+ { -+ nsCString mimetype = output[ 0 ]; -+ RefPtr mimeInfo = new nsMIMEInfoUnix( mimetype ); -+ NS_ENSURE_TRUE(mimeInfo, nullptr); -+ nsCString description = output[ 1 ]; -+ mimeInfo->SetDescription(NS_ConvertUTF8toUTF16(description)); -+ nsCString handlerAppName = output[ 2 ]; -+ mozilla::StaticPrefs::browser_download_improvements_to_download_panel() -+ ? mimeInfo->SetPreferredAction(nsIMIMEInfo::saveToDisk) -+ : mimeInfo->SetPreferredAction(nsIMIMEInfo::useSystemDefault); -+ mimeInfo->SetDefaultDescription(NS_ConvertUTF8toUTF16(handlerAppName)); -+ return mimeInfo.forget(); -+ } -+ return nullptr; ++/* static */ already_AddRefed nsKDERegistry::GetFromHelper( ++ const nsTArray& command) { ++ nsTArray output; ++ if (nsKDEUtils::command(command, &output) && output.Length() == 3) { ++ nsCString mimetype = output[0]; ++ RefPtr mimeInfo = new nsMIMEInfoUnix(mimetype); ++ NS_ENSURE_TRUE(mimeInfo, nullptr); ++ nsCString description = output[1]; ++ mimeInfo->SetDescription(NS_ConvertUTF8toUTF16(description)); ++ nsCString handlerAppName = output[2]; ++ mimeInfo->SetPreferredAction(nsIMIMEInfo::saveToDisk); ++ mimeInfo->SetDefaultDescription(NS_ConvertUTF8toUTF16(handlerAppName)); ++ return mimeInfo.forget(); ++ } ++ return nullptr; +} -diff --git a/uriloader/exthandler/unix/nsKDERegistry.h b/uriloader/exthandler/unix/nsKDERegistry.h -new file mode 100644 +Index: firefox-115.0/uriloader/exthandler/unix/nsKDERegistry.h +=================================================================== --- /dev/null -+++ b/uriloader/exthandler/unix/nsKDERegistry.h -@@ -0,0 +1,34 @@ ++++ firefox-115.0/uriloader/exthandler/unix/nsKDERegistry.h +@@ -0,0 +1,35 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ @@ -1030,36 +829,34 @@ new file mode 100644 +#include "nsTArray.h" + +class nsMIMEInfoBase; -+//class nsAutoCString; -+//class nsCString; ++// class nsAutoCString; ++// class nsCString; + -+class nsKDERegistry -+{ ++class nsKDERegistry { + public: -+ static bool HandlerExists(const char *aProtocolScheme); ++ static bool HandlerExists(const char* aProtocolScheme); + -+ static nsresult LoadURL(nsIURI *aURL); ++ static nsresult LoadURL(nsIURI* aURL); + -+ static void GetAppDescForScheme(const nsACString& aScheme, -+ nsAString& aDesc); ++ static void GetAppDescForScheme(const nsACString& aScheme, nsAString& aDesc); + -+ static already_AddRefed GetFromExtension(const nsACString& aFileExt); ++ static already_AddRefed GetFromExtension( ++ const nsACString& aFileExt); ++ ++ static already_AddRefed GetFromType( ++ const nsACString& aMIMEType); + -+ static already_AddRefed GetFromType(const nsACString& aMIMEType); + private: -+ static already_AddRefed GetFromHelper(const nsTArray& command); -+ ++ static already_AddRefed GetFromHelper( ++ const nsTArray& command); +}; + -+#endif //nsKDERegistry_h__ -diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp ---- a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp -+++ b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp -@@ -1,48 +1,51 @@ - /* -*- Mode: C++; tab-width: 3; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this ++#endif // nsKDERegistry_h__ +Index: firefox-115.0/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp +=================================================================== +--- firefox-115.0.orig/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp ++++ firefox-115.0/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp +@@ -5,16 +5,19 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "nsMIMEInfoUnix.h" @@ -1072,7 +869,7 @@ diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler # include "nsDBusHandlerApp.h" #endif +#if defined(XP_UNIX) && !defined(XP_MACOSX) -+#include "nsKDEUtils.h" ++# include "nsKDEUtils.h" +#endif nsresult nsMIMEInfoUnix::LoadUriInternal(nsIURI* aURI) { @@ -1081,14 +878,7 @@ diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler } NS_IMETHODIMP - nsMIMEInfoUnix::GetHasDefaultHandler(bool* _retval) { - // if a default app is set, it means the application has been set from - // either /etc/mailcap or ${HOME}/.mailcap, in which case we don't want to - // give the GNOME answer. - if (GetDefaultApplication()) { - return nsMIMEInfoImpl::GetHasDefaultHandler(_retval); - } - +@@ -29,15 +32,15 @@ nsMIMEInfoUnix::GetHasDefaultHandler(boo *_retval = false; if (mClass == eProtocolInfo) { @@ -1107,33 +897,21 @@ diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler } } if (mimeInfo) *_retval = true; - } - - if (*_retval) return NS_OK; - - return NS_OK; -@@ -54,16 +57,33 @@ nsresult nsMIMEInfoUnix::LaunchDefaultWi - // give the GNOME answer. - if (GetDefaultApplication()) { - return nsMIMEInfoImpl::LaunchDefaultWithFile(aFile); - } - +@@ -59,6 +62,21 @@ nsresult nsMIMEInfoUnix::LaunchDefaultWi nsAutoCString nativePath; aFile->GetNativePath(nativePath); -+ if( nsKDEUtils::kdeSupport()) { ++ if (nsKDEUtils::kdeSupport()) { + bool supports; -+ if( NS_SUCCEEDED( GetHasDefaultHandler( &supports )) && supports ) { ++ if (NS_SUCCEEDED(GetHasDefaultHandler(&supports)) && supports) { + nsTArray command; -+ command.AppendElement( "OPEN"_ns ); -+ command.AppendElement( nativePath ); -+ command.AppendElement( "MIMETYPE"_ns ); -+ command.AppendElement( mSchemeOrType ); -+ if( nsKDEUtils::command( command )) -+ return NS_OK; ++ command.AppendElement("OPEN"_ns); ++ command.AppendElement(nativePath); ++ command.AppendElement("MIMETYPE"_ns); ++ command.AppendElement(mSchemeOrType); ++ if (nsKDEUtils::command(command)) return NS_OK; + } -+ if (!GetDefaultApplication()) -+ return NS_ERROR_FILE_NOT_FOUND; ++ if (!GetDefaultApplication()) return NS_ERROR_FILE_NOT_FOUND; + + return LaunchWithIProcess(GetDefaultApplication(), nativePath); + } @@ -1141,20 +919,11 @@ diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler nsCOMPtr giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); if (!giovfs) { return NS_ERROR_FAILURE; - } - - // nsGIOMimeApp->Launch wants a URI string instead of local file - nsresult rv; - nsCOMPtr ioservice = -diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exthandler/unix/nsOSHelperAppService.cpp ---- a/uriloader/exthandler/unix/nsOSHelperAppService.cpp -+++ b/uriloader/exthandler/unix/nsOSHelperAppService.cpp -@@ -5,17 +5,17 @@ - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - - #include - #include - +Index: firefox-115.0/uriloader/exthandler/unix/nsOSHelperAppService.cpp +=================================================================== +--- firefox-115.0.orig/uriloader/exthandler/unix/nsOSHelperAppService.cpp ++++ firefox-115.0/uriloader/exthandler/unix/nsOSHelperAppService.cpp +@@ -10,7 +10,7 @@ #include "nsOSHelperAppService.h" #include "nsMIMEInfoUnix.h" #ifdef MOZ_WIDGET_GTK @@ -1163,17 +932,7 @@ diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exth # ifdef MOZ_BUILD_APP_IS_BROWSER # include "nsIToolkitShellService.h" # include "nsIGNOMEShellService.h" - # endif - #endif - #include "nsISupports.h" - #include "nsString.h" - #include "nsReadableUtils.h" -@@ -1102,17 +1102,17 @@ nsresult nsOSHelperAppService::GetHandle - - nsresult nsOSHelperAppService::OSProtocolHandlerExists( - const char* aProtocolScheme, bool* aHandlerExists) { - nsresult rv = NS_OK; - +@@ -1106,7 +1106,7 @@ nsresult nsOSHelperAppService::OSProtoco if (!XRE_IsContentProcess()) { #ifdef MOZ_WIDGET_GTK // Check the GNOME registry for a protocol handler @@ -1182,17 +941,7 @@ diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exth #else *aHandlerExists = false; #endif - } else { - *aHandlerExists = false; - nsCOMPtr handlerSvc = - do_GetService(NS_HANDLERSERVICE_CONTRACTID, &rv); - if (NS_SUCCEEDED(rv) && handlerSvc) { -@@ -1122,17 +1122,17 @@ nsresult nsOSHelperAppService::OSProtoco - } - - return rv; - } - +@@ -1126,7 +1126,7 @@ nsresult nsOSHelperAppService::OSProtoco NS_IMETHODIMP nsOSHelperAppService::GetApplicationDescription( const nsACString& aScheme, nsAString& _retval) { #ifdef MOZ_WIDGET_GTK @@ -1201,17 +950,7 @@ diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exth return _retval.IsEmpty() ? NS_ERROR_NOT_AVAILABLE : NS_OK; #else return NS_ERROR_NOT_AVAILABLE; - #endif - } - - NS_IMETHODIMP nsOSHelperAppService::IsCurrentAppOSDefaultForProtocol( - const nsACString& aScheme, bool* _retval) { -@@ -1227,17 +1227,17 @@ already_AddRefed nsOSHel - nsresult rv = - LookUpTypeAndDescription(NS_ConvertUTF8toUTF16(aFileExt), majorType, - minorType, mime_types_description, true); - - if (NS_FAILED(rv) || majorType.IsEmpty()) { +@@ -1231,7 +1231,7 @@ already_AddRefed nsOSHel #ifdef MOZ_WIDGET_GTK LOG("Looking in GNOME registry\n"); RefPtr gnomeInfo = @@ -1220,17 +959,7 @@ diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exth if (gnomeInfo) { LOG("Got MIMEInfo from GNOME registry\n"); return gnomeInfo.forget(); - } - #endif - - rv = LookUpTypeAndDescription(NS_ConvertUTF8toUTF16(aFileExt), majorType, - minorType, mime_types_description, false); -@@ -1342,17 +1342,17 @@ already_AddRefed nsOSHel - - // Now look up our extensions - nsAutoString extensions, mime_types_description; - LookUpExtensionsAndDescription(majorType, minorType, extensions, - mime_types_description); +@@ -1344,7 +1344,7 @@ already_AddRefed nsOSHel #ifdef MOZ_WIDGET_GTK if (handler.IsEmpty()) { @@ -1239,20 +968,11 @@ diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exth if (gnomeInfo) { LOG("Got MIMEInfo from GNOME registry without extensions; setting them " "to %s\n", - NS_LossyConvertUTF16toASCII(extensions).get()); - - NS_ASSERTION(!gnomeInfo->HasExtensions(), "How'd that happen?"); - gnomeInfo->SetFileExtensions(NS_ConvertUTF16toUTF8(extensions)); - return gnomeInfo.forget(); -diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build ---- a/widget/gtk/moz.build -+++ b/widget/gtk/moz.build -@@ -144,16 +144,17 @@ FINAL_LIBRARY = "xul" - - LOCAL_INCLUDES += [ - "/layout/base", - "/layout/forms", - "/layout/generic", +Index: firefox-115.0/widget/gtk/moz.build +=================================================================== +--- firefox-115.0.orig/widget/gtk/moz.build ++++ firefox-115.0/widget/gtk/moz.build +@@ -149,6 +149,7 @@ LOCAL_INCLUDES += [ "/layout/xul", "/other-licenses/atk-1.0", "/third_party/cups/include", @@ -1260,19 +980,11 @@ diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build "/widget", "/widget/headless", ] - - if CONFIG["MOZ_X11"] or CONFIG["MOZ_WAYLAND"]: - LOCAL_INCLUDES += [ - "/widget/x11", - ] -diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp ---- a/widget/gtk/nsFilePicker.cpp -+++ b/widget/gtk/nsFilePicker.cpp -@@ -1,15 +1,16 @@ - /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ - /* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +Index: firefox-115.0/widget/gtk/nsFilePicker.cpp +=================================================================== +--- firefox-115.0.orig/widget/gtk/nsFilePicker.cpp ++++ firefox-115.0/widget/gtk/nsFilePicker.cpp +@@ -5,6 +5,7 @@ #include #include @@ -1280,17 +992,7 @@ diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp #include #include #include - - #include "mozilla/Types.h" - #include "nsGtkUtils.h" - #include "nsIFileURL.h" - #include "nsIGIOService.h" -@@ -23,16 +24,18 @@ - #include "nsArrayEnumerator.h" - #include "nsEnumeratorUtils.h" - #include "nsNetUtil.h" - #include "nsReadableUtils.h" - #include "MozContainer.h" +@@ -28,6 +29,8 @@ #include "WidgetUtilsGtk.h" #include "nsFilePicker.h" @@ -1299,60 +1001,41 @@ diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp #undef LOG #ifdef MOZ_LOGGING - # include "mozilla/Logging.h" - # include "nsTArray.h" - # include "Units.h" - extern mozilla::LazyLogModule gWidgetLog; - # define LOG(args) MOZ_LOG(gWidgetLog, mozilla::LogLevel::Debug, args) -@@ -237,17 +240,19 @@ nsFilePicker::AppendFilters(int32_t aFil - mAllowURLs = !!(aFilterMask & filterAllowURLs); - return nsBaseFilePicker::AppendFilters(aFilterMask); - } - - NS_IMETHODIMP +@@ -242,7 +245,8 @@ NS_IMETHODIMP nsFilePicker::AppendFilter(const nsAString& aTitle, const nsAString& aFilter) { if (aFilter.EqualsLiteral("..apps")) { // No platform specific thing we can do here, really.... - return NS_OK; + // Unless it's KDE. -+ if( mMode != modeOpen || !nsKDEUtils::kdeSupport()) -+ return NS_OK; ++ if (mMode != modeOpen || !nsKDEUtils::kdeSupport()) return NS_OK; } nsAutoCString filter, name; - CopyUTF16toUTF8(aFilter, filter); - CopyUTF16toUTF8(aTitle, name); - - mFilters.AppendElement(filter); - mFilterNames.AppendElement(name); -@@ -347,16 +352,39 @@ nsresult nsFilePicker::Show(nsIFilePicke - return NS_OK; - } - - NS_IMETHODIMP - nsFilePicker::Open(nsIFilePickerShownCallback* aCallback) { +@@ -352,6 +356,31 @@ nsFilePicker::Open(nsIFilePickerShownCal // Can't show two dialogs concurrently with the same filepicker if (mRunning) return NS_ERROR_NOT_AVAILABLE; + // KDE file picker is not handled via callback -+ if( nsKDEUtils::kdeSupport()) { ++ if (nsKDEUtils::kdeSupport()) { + mCallback = aCallback; + mRunning = true; + NS_ADDREF_THIS(); -+ g_idle_add([](gpointer data) -> gboolean { -+ nsFilePicker* queuedPicker = (nsFilePicker*) data; -+ nsIFilePicker::ResultCode result; -+ queuedPicker->kdeFileDialog(&result); -+ if (queuedPicker->mCallback) { -+ queuedPicker->mCallback->Done(result); -+ queuedPicker->mCallback = nullptr; -+ } else { -+ queuedPicker->mResult = result; -+ } -+ queuedPicker->mRunning = false; -+ NS_RELEASE(queuedPicker); -+ return G_SOURCE_REMOVE; -+ }, this); ++ g_idle_add( ++ [](gpointer data) -> gboolean { ++ nsFilePicker* queuedPicker = (nsFilePicker*)data; ++ nsIFilePicker::ResultCode result; ++ queuedPicker->kdeFileDialog(&result); ++ if (queuedPicker->mCallback) { ++ queuedPicker->mCallback->Done(result); ++ queuedPicker->mCallback = nullptr; ++ } else { ++ queuedPicker->mResult = result; ++ } ++ queuedPicker->mRunning = false; ++ NS_RELEASE(queuedPicker); ++ return G_SOURCE_REMOVE; ++ }, ++ this); + + return NS_OK; + } @@ -1360,86 +1043,68 @@ diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp NS_ConvertUTF16toUTF8 title(mTitle); GtkWindow* parent_widget = - GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET)); - - GtkFileChooserAction action = GetGtkFileChooserAction(mMode); - - const gchar* accept_button; -@@ -628,16 +656,244 @@ void nsFilePicker::Done(void* file_choos - mCallback->Done(result); - mCallback = nullptr; - } else { - mResult = result; - } +@@ -633,6 +662,205 @@ void nsFilePicker::Done(void* file_choos NS_RELEASE_THIS(); } -+nsCString nsFilePicker::kdeMakeFilter( int index ) -+ { -+ nsCString buf = mFilters[ index ]; -+ for( PRUint32 i = 0; -+ i < buf.Length(); -+ ++i ) -+ if( buf[ i ] == ';' ) // KDE separates just using spaces -+ buf.SetCharAt( ' ', i ); -+ if (!mFilterNames[index].IsEmpty()) -+ { -+ buf += "|"; -+ buf += mFilterNames[index].get(); -+ } -+ return buf; ++nsCString nsFilePicker::kdeMakeFilter(int index) { ++ nsCString buf = mFilters[index]; ++ for (PRUint32 i = 0; i < buf.Length(); ++i) ++ if (buf[i] == ';') // KDE separates just using spaces ++ buf.SetCharAt(' ', i); ++ if (!mFilterNames[index].IsEmpty()) { ++ buf += "|"; ++ buf += mFilterNames[index].get(); ++ } ++ return buf; ++} ++ ++static PRInt32 windowToXid(nsIWidget* widget) { ++ GtkWindow* parent_widget = ++ GTK_WINDOW(widget->GetNativeData(NS_NATIVE_SHELLWIDGET)); ++ GdkWindow* gdk_window = ++ gtk_widget_get_window(gtk_widget_get_toplevel(GTK_WIDGET(parent_widget))); ++ return GDK_WINDOW_XID(gdk_window); ++} ++ ++NS_IMETHODIMP nsFilePicker::kdeFileDialog(nsIFilePicker::ResultCode* aReturn) { ++ NS_ENSURE_ARG_POINTER(aReturn); ++ ++ if (mMode == modeOpen && mFilters.Length() == 1 && ++ mFilters[0].EqualsLiteral("..apps")) ++ return kdeAppsDialog(aReturn); ++ ++ nsCString title; ++ title.Adopt(ToNewUTF8String(mTitle)); ++ ++ const char* arg = NULL; ++ if (mAllowURLs) { ++ switch (mMode) { ++ case nsIFilePicker::modeOpen: ++ case nsIFilePicker::modeOpenMultiple: ++ arg = "GETOPENURL"; ++ break; ++ case nsIFilePicker::modeSave: ++ arg = "GETSAVEURL"; ++ break; ++ case nsIFilePicker::modeGetFolder: ++ arg = "GETDIRECTORYURL"; ++ break; + } -+ -+static PRInt32 windowToXid( nsIWidget* widget ) -+ { -+ GtkWindow *parent_widget = GTK_WINDOW(widget->GetNativeData(NS_NATIVE_SHELLWIDGET)); -+ GdkWindow* gdk_window = gtk_widget_get_window( gtk_widget_get_toplevel( GTK_WIDGET( parent_widget ))); -+ return GDK_WINDOW_XID( gdk_window ); ++ } else { ++ switch (mMode) { ++ case nsIFilePicker::modeOpen: ++ case nsIFilePicker::modeOpenMultiple: ++ arg = "GETOPENFILENAME"; ++ break; ++ case nsIFilePicker::modeSave: ++ arg = "GETSAVEFILENAME"; ++ break; ++ case nsIFilePicker::modeGetFolder: ++ arg = "GETDIRECTORYFILENAME"; ++ break; + } -+ -+NS_IMETHODIMP nsFilePicker::kdeFileDialog(nsIFilePicker::ResultCode *aReturn) -+ { -+ NS_ENSURE_ARG_POINTER(aReturn); -+ -+ if( mMode == modeOpen && mFilters.Length() == 1 && mFilters[ 0 ].EqualsLiteral( "..apps" )) -+ return kdeAppsDialog( aReturn ); -+ -+ nsCString title; -+ title.Adopt(ToNewUTF8String(mTitle)); -+ -+ const char* arg = NULL; -+ if( mAllowURLs ) -+ { -+ switch( mMode ) -+ { -+ case nsIFilePicker::modeOpen: -+ case nsIFilePicker::modeOpenMultiple: -+ arg = "GETOPENURL"; -+ break; -+ case nsIFilePicker::modeSave: -+ arg = "GETSAVEURL"; -+ break; -+ case nsIFilePicker::modeGetFolder: -+ arg = "GETDIRECTORYURL"; -+ break; -+ } -+ } -+ else -+ { -+ switch( mMode ) -+ { -+ case nsIFilePicker::modeOpen: -+ case nsIFilePicker::modeOpenMultiple: -+ arg = "GETOPENFILENAME"; -+ break; -+ case nsIFilePicker::modeSave: -+ arg = "GETSAVEFILENAME"; -+ break; -+ case nsIFilePicker::modeGetFolder: -+ arg = "GETDIRECTORYFILENAME"; -+ break; -+ } -+ } ++ } + + nsAutoCString directory; + if (mDisplayDirectory) { @@ -1448,203 +1113,164 @@ diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp + mPrevDisplayDirectory->GetNativePath(directory); + } + -+ nsAutoCString startdir; ++ nsAutoCString startdir; + if (!directory.IsEmpty()) { + startdir = directory; + } + if (mMode == nsIFilePicker::modeSave) { -+ if( !startdir.IsEmpty()) -+ { ++ if (!startdir.IsEmpty()) { + startdir += "/"; + startdir += ToNewUTF8String(mDefault); -+ } -+ else ++ } else + startdir = ToNewUTF8String(mDefault); + } + -+ nsAutoCString filters; -+ PRInt32 count = mFilters.Length(); -+ if( count == 0 ) //just in case -+ filters = "*"; -+ else -+ { -+ filters = kdeMakeFilter( 0 ); -+ for (PRInt32 i = 1; i < count; ++i) -+ { -+ filters += "\n"; -+ filters += kdeMakeFilter( i ); -+ } -+ } -+ -+ nsTArray command; -+ command.AppendElement( nsAutoCString( arg )); -+ command.AppendElement( startdir ); -+ if( mMode != nsIFilePicker::modeGetFolder ) -+ { -+ command.AppendElement( filters ); -+ nsAutoCString selected; -+ selected.AppendInt( mSelectedType ); -+ command.AppendElement( selected ); -+ } -+ command.AppendElement( title ); -+ if( mMode == nsIFilePicker::modeOpenMultiple ) -+ command.AppendElement( "MULTIPLE"_ns ); -+ if( PRInt32 xid = windowToXid( mParentWidget )) -+ { -+ command.AppendElement( "PARENT"_ns ); -+ nsAutoCString parent; -+ parent.AppendInt( xid ); -+ command.AppendElement( parent ); -+ } -+ -+ nsTArray output; -+ if( nsKDEUtils::commandBlockUi( command, GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET)), &output )) -+ { -+ *aReturn = nsIFilePicker::returnOK; -+ mFiles.Clear(); -+ if( mMode != nsIFilePicker::modeGetFolder ) -+ { -+ mSelectedType = atoi( output[ 0 ].get()); -+ output.RemoveElementAt( 0 ); -+ } -+ if (mMode == nsIFilePicker::modeOpenMultiple) -+ { -+ mFileURL.Truncate(); -+ PRUint32 count = output.Length(); -+ for( PRUint32 i = 0; -+ i < count; -+ ++i ) -+ { -+ nsCOMPtr localfile; -+ nsresult rv = NS_NewNativeLocalFile( output[ i ], -+ PR_FALSE, -+ getter_AddRefs(localfile)); -+ if (NS_SUCCEEDED(rv)) -+ mFiles.AppendObject(localfile); -+ } -+ } -+ else -+ { -+ if( output.Length() == 0 ) -+ mFileURL = nsCString(); -+ else if( mAllowURLs ) -+ mFileURL = output[ 0 ]; -+ else // GetFile() actually requires it to be url even for local files :-/ -+ { -+ nsCOMPtr localfile; -+ nsresult rv = NS_NewNativeLocalFile( output[ 0 ], -+ PR_FALSE, -+ getter_AddRefs(localfile)); -+ if (NS_SUCCEEDED(rv)) -+ rv = net_GetURLSpecFromActualFile(localfile, mFileURL); -+ } -+ } -+ // Remember last used directory. -+ nsCOMPtr file; -+ GetFile(getter_AddRefs(file)); -+ if (file) { -+ nsCOMPtr dir; -+ file->GetParent(getter_AddRefs(dir)); -+ nsCOMPtr localDir(do_QueryInterface(dir)); -+ if (localDir) { -+ localDir.swap(mPrevDisplayDirectory); ++ nsAutoCString filters; ++ PRInt32 count = mFilters.Length(); ++ if (count == 0) // just in case ++ filters = "*"; ++ else { ++ filters = kdeMakeFilter(0); ++ for (PRInt32 i = 1; i < count; ++i) { ++ filters += "\n"; ++ filters += kdeMakeFilter(i); + } + } -+ if (mMode == nsIFilePicker::modeSave) -+ { -+ nsCOMPtr file; -+ GetFile(getter_AddRefs(file)); -+ if (file) -+ { -+ bool exists = false; -+ file->Exists(&exists); -+ if (exists) // TODO do overwrite check in the helper app -+ *aReturn = nsIFilePicker::returnReplace; -+ } -+ } -+ } -+ else -+ { -+ *aReturn = nsIFilePicker::returnCancel; -+ } -+ return NS_OK; ++ ++ nsTArray command; ++ command.AppendElement(nsAutoCString(arg)); ++ command.AppendElement(startdir); ++ if (mMode != nsIFilePicker::modeGetFolder) { ++ command.AppendElement(filters); ++ nsAutoCString selected; ++ selected.AppendInt(mSelectedType); ++ command.AppendElement(selected); ++ } ++ command.AppendElement(title); ++ if (mMode == nsIFilePicker::modeOpenMultiple) ++ command.AppendElement("MULTIPLE"_ns); ++ if (PRInt32 xid = windowToXid(mParentWidget)) { ++ command.AppendElement("PARENT"_ns); ++ nsAutoCString parent; ++ parent.AppendInt(xid); ++ command.AppendElement(parent); ++ } ++ ++ nsTArray output; ++ if (nsKDEUtils::commandBlockUi( ++ command, ++ GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET)), ++ &output)) { ++ *aReturn = nsIFilePicker::returnOK; ++ mFiles.Clear(); ++ if (mMode != nsIFilePicker::modeGetFolder) { ++ mSelectedType = atoi(output[0].get()); ++ output.RemoveElementAt(0); + } -+ -+ -+NS_IMETHODIMP nsFilePicker::kdeAppsDialog(nsIFilePicker::ResultCode *aReturn) -+ { -+ NS_ENSURE_ARG_POINTER(aReturn); -+ -+ nsCString title; -+ title.Adopt(ToNewUTF8String(mTitle)); -+ -+ nsTArray command; -+ command.AppendElement( "APPSDIALOG"_ns ); -+ command.AppendElement( title ); -+ if( PRInt32 xid = windowToXid( mParentWidget )) -+ { -+ command.AppendElement( "PARENT"_ns ); -+ nsAutoCString parent; -+ parent.AppendInt( xid ); -+ command.AppendElement( parent ); -+ } -+ -+ nsTArray output; -+ if( nsKDEUtils::commandBlockUi( command, GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET)), &output )) -+ { -+ *aReturn = nsIFilePicker::returnOK; -+ mFileURL = output.Length() > 0 ? output[ 0 ] : nsCString(); -+ } -+ else -+ { -+ *aReturn = nsIFilePicker::returnCancel; -+ } -+ return NS_OK; ++ if (mMode == nsIFilePicker::modeOpenMultiple) { ++ mFileURL.Truncate(); ++ PRUint32 count = output.Length(); ++ for (PRUint32 i = 0; i < count; ++i) { ++ nsCOMPtr localfile; ++ nsresult rv = NS_NewNativeLocalFile(output[i], PR_FALSE, ++ getter_AddRefs(localfile)); ++ if (NS_SUCCEEDED(rv)) mFiles.AppendObject(localfile); ++ } ++ } else { ++ if (output.Length() == 0) ++ mFileURL = nsCString(); ++ else if (mAllowURLs) ++ mFileURL = output[0]; ++ else // GetFile() actually requires it to be url even for local files :-/ ++ { ++ nsCOMPtr localfile; ++ nsresult rv = NS_NewNativeLocalFile(output[0], PR_FALSE, ++ getter_AddRefs(localfile)); ++ if (NS_SUCCEEDED(rv)) ++ rv = net_GetURLSpecFromActualFile(localfile, mFileURL); ++ } + } ++ // Remember last used directory. ++ nsCOMPtr file; ++ GetFile(getter_AddRefs(file)); ++ if (file) { ++ nsCOMPtr dir; ++ file->GetParent(getter_AddRefs(dir)); ++ nsCOMPtr localDir(dir); ++ if (localDir) { ++ localDir.swap(mPrevDisplayDirectory); ++ } ++ } ++ if (mMode == nsIFilePicker::modeSave) { ++ nsCOMPtr file; ++ GetFile(getter_AddRefs(file)); ++ if (file) { ++ bool exists = false; ++ file->Exists(&exists); ++ if (exists) // TODO do overwrite check in the helper app ++ *aReturn = nsIFilePicker::returnReplace; ++ } ++ } ++ } else { ++ *aReturn = nsIFilePicker::returnCancel; ++ } ++ return NS_OK; ++} ++ ++NS_IMETHODIMP nsFilePicker::kdeAppsDialog(nsIFilePicker::ResultCode* aReturn) { ++ NS_ENSURE_ARG_POINTER(aReturn); ++ ++ nsCString title; ++ title.Adopt(ToNewUTF8String(mTitle)); ++ ++ nsTArray command; ++ command.AppendElement("APPSDIALOG"_ns); ++ command.AppendElement(title); ++ if (PRInt32 xid = windowToXid(mParentWidget)) { ++ command.AppendElement("PARENT"_ns); ++ nsAutoCString parent; ++ parent.AppendInt(xid); ++ command.AppendElement(parent); ++ } ++ ++ nsTArray output; ++ if (nsKDEUtils::commandBlockUi( ++ command, ++ GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET)), ++ &output)) { ++ *aReturn = nsIFilePicker::returnOK; ++ mFileURL = output.Length() > 0 ? output[0] : nsCString(); ++ } else { ++ *aReturn = nsIFilePicker::returnCancel; ++ } ++ return NS_OK; ++} + // All below functions available as of GTK 3.20+ void* nsFilePicker::GtkFileChooserNew(const gchar* title, GtkWindow* parent, GtkFileChooserAction action, - const gchar* accept_label) { - static auto sGtkFileChooserNativeNewPtr = - (void* (*)(const gchar*, GtkWindow*, GtkFileChooserAction, const gchar*, - const gchar*))dlsym(RTLD_DEFAULT, - "gtk_file_chooser_native_new"); -diff --git a/widget/gtk/nsFilePicker.h b/widget/gtk/nsFilePicker.h ---- a/widget/gtk/nsFilePicker.h -+++ b/widget/gtk/nsFilePicker.h -@@ -69,16 +69,22 @@ class nsFilePicker : public nsBaseFilePi - nsString mDefaultExtension; - - nsTArray mFilters; - nsTArray mFilterNames; - +Index: firefox-115.0/widget/gtk/nsFilePicker.h +=================================================================== +--- firefox-115.0.orig/widget/gtk/nsFilePicker.h ++++ firefox-115.0/widget/gtk/nsFilePicker.h +@@ -74,6 +74,12 @@ class nsFilePicker : public nsBaseFilePi private: static nsIFile* mPrevDisplayDirectory; + bool kdeRunning(); + bool getKdeRunning(); -+ NS_IMETHODIMP kdeFileDialog(nsIFilePicker::ResultCode *aReturn); -+ NS_IMETHODIMP kdeAppsDialog(nsIFilePicker::ResultCode *aReturn); -+ nsCString kdeMakeFilter( int index ); ++ NS_IMETHODIMP kdeFileDialog(nsIFilePicker::ResultCode* aReturn); ++ NS_IMETHODIMP kdeAppsDialog(nsIFilePicker::ResultCode* aReturn); ++ nsCString kdeMakeFilter(int index); + void* GtkFileChooserNew(const gchar* title, GtkWindow* parent, GtkFileChooserAction action, const gchar* accept_label); - void GtkFileChooserShow(void* file_chooser); - void GtkFileChooserDestroy(void* file_chooser); - void GtkFileChooserSetModal(void* file_chooser, GtkWindow* parent_widget, - gboolean modal); - -diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestParser.cpp ---- a/xpcom/components/ManifestParser.cpp -+++ b/xpcom/components/ManifestParser.cpp -@@ -38,16 +38,17 @@ - #include "nsTextFormatter.h" - #include "nsVersionComparator.h" - #include "nsXPCOMCIDInternal.h" - - #include "nsIConsoleService.h" +Index: firefox-115.0/xpcom/components/ManifestParser.cpp +=================================================================== +--- firefox-115.0.orig/xpcom/components/ManifestParser.cpp ++++ firefox-115.0/xpcom/components/ManifestParser.cpp +@@ -43,6 +43,7 @@ #include "nsIScriptError.h" #include "nsIXULAppInfo.h" #include "nsIXULRuntime.h" @@ -1652,17 +1278,7 @@ diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestPars using namespace mozilla; - struct ManifestDirective { - const char* directive; - int argc; - - bool ischrome; -@@ -389,16 +390,17 @@ void ParseManifest(NSLocationType aType, - constexpr auto kRemoteEnabled = u"remoteenabled"_ns; - constexpr auto kRemoteRequired = u"remoterequired"_ns; - constexpr auto kApplication = u"application"_ns; - constexpr auto kAppVersion = u"appversion"_ns; - constexpr auto kGeckoVersion = u"platformversion"_ns; +@@ -394,6 +395,7 @@ void ParseManifest(NSLocationType aType, constexpr auto kOs = u"os"_ns; constexpr auto kOsVersion = u"osversion"_ns; constexpr auto kABI = u"abi"_ns; @@ -1670,17 +1286,7 @@ diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestPars constexpr auto kProcess = u"process"_ns; #if defined(MOZ_WIDGET_ANDROID) constexpr auto kTablet = u"tablet"_ns; - #endif - // You might expect this to be guarded by MOZ_BACKGROUNDTASKS, but it's not - // possible to have conditional manifest contents, so we need to recognize and - // discard these tokens even when MOZ_BACKGROUNDTASKS is not set. - constexpr auto kBackgroundTask = u"backgroundtask"_ns; -@@ -448,39 +450,44 @@ void ParseManifest(NSLocationType aType, - CopyUTF8toUTF16(s, abi); - abi.Insert(char16_t('_'), 0); - abi.Insert(osTarget, 0); - } - } +@@ -453,6 +455,7 @@ void ParseManifest(NSLocationType aType, } nsAutoString osVersion; @@ -1688,8 +1294,7 @@ diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestPars #if defined(XP_WIN) # pragma warning(push) # pragma warning(disable : 4996) // VC12+ deprecates GetVersionEx - OSVERSIONINFO info = {sizeof(OSVERSIONINFO)}; - if (GetVersionEx(&info)) { +@@ -461,14 +464,17 @@ void ParseManifest(NSLocationType aType, nsTextFormatter::ssprintf(osVersion, u"%ld.%ld", info.dwMajorVersion, info.dwMinorVersion); } @@ -1707,7 +1312,7 @@ diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestPars #elif defined(MOZ_WIDGET_ANDROID) bool isTablet = false; if (jni::IsAvailable()) { - jni::String::LocalRef release = java::sdk::Build::VERSION::RELEASE(); +@@ -476,6 +482,7 @@ void ParseManifest(NSLocationType aType, osVersion.Assign(release->ToString()); isTablet = java::GeckoAppShell::IsTablet(); } @@ -1715,17 +1320,7 @@ diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestPars #endif if (XRE_IsContentProcess()) { - process = kContent; - } else { - process = kMain; - } - -@@ -571,25 +578,27 @@ void ParseManifest(NSLocationType aType, - // When in background task mode, default to not registering - // category directivies unless backgroundtask=1 is specified. - TriState stBackgroundTask = (BackgroundTasks::IsBackgroundTaskMode() && - strcmp("category", directive->directive) == 0) - ? eBad +@@ -576,6 +583,7 @@ void ParseManifest(NSLocationType aType, : eUnspecified; #endif int flags = 0; @@ -1733,9 +1328,7 @@ diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestPars while ((token = nsCRT::strtok(whitespace, kWhitespace, &whitespace)) && ok) { - ToLowerCase(token); - NS_ConvertASCIItoUTF16 wtoken(token); - +@@ -585,6 +593,7 @@ void ParseManifest(NSLocationType aType, if (CheckStringFlag(kApplication, wtoken, appID, stApp) || CheckOsFlag(kOs, wtoken, osTarget, stOs) || CheckStringFlag(kABI, wtoken, abi, stABI) || @@ -1743,39 +1336,19 @@ diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestPars CheckStringFlag(kProcess, wtoken, process, stProcess) || CheckVersionFlag(kOsVersion, wtoken, osVersion, stOsVersion) || CheckVersionFlag(kAppVersion, wtoken, appVersion, stAppVersion) || - CheckVersionFlag(kGeckoVersion, wtoken, geckoVersion, - stGeckoVersion)) { - continue; - } - -@@ -638,17 +647,17 @@ void ParseManifest(NSLocationType aType, - } - - LogMessageWithContext( - aFile, line, "Unrecognized chrome manifest modifier '%s'.", token); - ok = false; - } +@@ -644,6 +653,7 @@ void ParseManifest(NSLocationType aType, if (!ok || stApp == eBad || stAppVersion == eBad || -- stGeckoVersion == eBad || stOs == eBad || stOsVersion == eBad || -+ stGeckoVersion == eBad || stOs == eBad || stOsVersion == eBad || stDesktop == eBad || + stGeckoVersion == eBad || stOs == eBad || stOsVersion == eBad || ++ stDesktop == eBad || #ifdef MOZ_WIDGET_ANDROID stTablet == eBad || #endif - #ifdef MOZ_BACKGROUNDTASKS - stBackgroundTask == eBad || - #endif - stABI == eBad || stProcess == eBad) { - continue; -diff --git a/xpcom/components/moz.build b/xpcom/components/moz.build ---- a/xpcom/components/moz.build -+++ b/xpcom/components/moz.build -@@ -66,16 +66,17 @@ LOCAL_INCLUDES += [ - "!..", - "../base", - "../build", - "../ds", - "/chrome", +Index: firefox-115.0/xpcom/components/moz.build +=================================================================== +--- firefox-115.0.orig/xpcom/components/moz.build ++++ firefox-115.0/xpcom/components/moz.build +@@ -71,6 +71,7 @@ LOCAL_INCLUDES += [ "/js/xpconnect/loader", "/layout/build", "/modules/libjar", @@ -1783,20 +1356,11 @@ diff --git a/xpcom/components/moz.build b/xpcom/components/moz.build ] if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": - CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"] - if CONFIG["MOZ_ENABLE_DBUS"]: - CXXFLAGS += CONFIG["MOZ_DBUS_GLIB_CFLAGS"] - - include("/ipc/chromium/chromium-config.mozbuild") -diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp ---- a/xpcom/io/nsLocalFileUnix.cpp -+++ b/xpcom/io/nsLocalFileUnix.cpp -@@ -46,16 +46,17 @@ - #include "nsString.h" - #include "nsIDirectoryEnumerator.h" - #include "nsSimpleEnumerator.h" - #include "private/pprio.h" - #include "prlink.h" +Index: firefox-115.0/xpcom/io/nsLocalFileUnix.cpp +=================================================================== +--- firefox-115.0.orig/xpcom/io/nsLocalFileUnix.cpp ++++ firefox-115.0/xpcom/io/nsLocalFileUnix.cpp +@@ -51,6 +51,7 @@ #ifdef MOZ_WIDGET_GTK # include "nsIGIOService.h" @@ -1804,64 +1368,38 @@ diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp #endif #ifdef MOZ_WIDGET_COCOA - # include - # include "CocoaFileUtils.h" - # include "prmem.h" - # include "plbase64.h" - -@@ -2167,20 +2168,29 @@ nsLocalFile::SetPersistentDescriptor(con - - NS_IMETHODIMP - nsLocalFile::Reveal() { - if (!FilePreferences::IsAllowedPath(mPath)) { - return NS_ERROR_FILE_ACCESS_DENIED; +@@ -2172,10 +2173,18 @@ nsLocalFile::Reveal() { } #ifdef MOZ_WIDGET_GTK + nsAutoCString url; nsCOMPtr giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); - if (!giovfs) { +- return NS_ERROR_FAILURE; + url = mPath; -+ if(nsKDEUtils::kdeSupport()) { ++ if (nsKDEUtils::kdeSupport()) { + nsTArray command; -+ command.AppendElement( "REVEAL"_ns ); -+ command.AppendElement( mPath ); -+ return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE; -+ } ++ command.AppendElement("REVEAL"_ns); ++ command.AppendElement(mPath); ++ return nsKDEUtils::command(command) ? NS_OK : NS_ERROR_FAILURE; + } + -+ if (!giovfs) - return NS_ERROR_FAILURE; -- } ++ if (!giovfs) return NS_ERROR_FAILURE; + return giovfs->RevealFile(this); #elif defined(MOZ_WIDGET_COCOA) CFURLRef url; - if (NS_SUCCEEDED(GetCFURL(&url))) { - nsresult rv = CocoaFileUtils::RevealFileInFinder(url); - ::CFRelease(url); - return rv; - } -@@ -2192,16 +2202,23 @@ nsLocalFile::Reveal() { - - NS_IMETHODIMP - nsLocalFile::Launch() { - if (!FilePreferences::IsAllowedPath(mPath)) { - return NS_ERROR_FILE_ACCESS_DENIED; +@@ -2197,6 +2206,13 @@ nsLocalFile::Launch() { } #ifdef MOZ_WIDGET_GTK -+ if( nsKDEUtils::kdeSupport()) { ++ if (nsKDEUtils::kdeSupport()) { + nsTArray command; -+ command.AppendElement( "OPEN"_ns ); -+ command.AppendElement( mPath ); -+ return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE; ++ command.AppendElement("OPEN"_ns); ++ command.AppendElement(mPath); ++ return nsKDEUtils::command(command) ? NS_OK : NS_ERROR_FAILURE; + } + nsCOMPtr giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); if (!giovfs) { return NS_ERROR_FAILURE; - } - - return giovfs->LaunchFile(mPath); - #elif defined(MOZ_WIDGET_ANDROID) - // Not supported on GeckoView diff --git a/mozilla-nongnome-proxies.patch b/mozilla-nongnome-proxies.patch index 4b3f01c7..44a4990d 100644 --- a/mozilla-nongnome-proxies.patch +++ b/mozilla-nongnome-proxies.patch @@ -3,7 +3,7 @@ # Date 1558442915 -7200 # Tue May 21 14:48:35 2019 +0200 # Node ID 6bcf2dfebc1ea2aa34e5cc61152709fc8e409dc5 -# Parent bd5d1f49975deb730064a16b3079edb53c4a5f84 +# Parent 715f01d61df8627117e6aefca540f0c1bba45011 Do not use gconf for proxy settings if not running within Gnome Index: toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp =================================================================== @@ -13,12 +13,7 @@ retrieving revision 1.1 diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp --- a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp +++ b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp -@@ -49,20 +49,24 @@ NS_IMETHODIMP - nsUnixSystemProxySettings::GetMainThreadOnly(bool* aMainThreadOnly) { - // dbus prevents us from being threadsafe, but this routine should not block - // anyhow - *aMainThreadOnly = true; - return NS_OK; +@@ -52,10 +52,13 @@ nsUnixSystemProxySettings::GetMainThread } void nsUnixSystemProxySettings::Init() { @@ -30,15 +25,9 @@ diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/sy + if (sessionType && !strcmp(sessionType, "gnome")) { + mGSettings = do_GetService(NS_GSETTINGSSERVICE_CONTRACTID); + if (mGSettings) { -+ mGSettings->GetCollectionForSchema( -+ "org.gnome.system.proxy"_ns, -+ getter_AddRefs(mProxySettings)); ++ mGSettings->GetCollectionForSchema("org.gnome.system.proxy"_ns, ++ getter_AddRefs(mProxySettings)); + } } } - nsresult nsUnixSystemProxySettings::GetPACURI(nsACString& aResult) { - if (mProxySettings) { - nsCString proxyMode; - // Check if mode is auto - nsresult rv = mProxySettings->GetString("mode"_ns, proxyMode); diff --git a/mozilla-ntlm-full-path.patch b/mozilla-ntlm-full-path.patch index cd5dc7d5..dc8bb4ed 100644 --- a/mozilla-ntlm-full-path.patch +++ b/mozilla-ntlm-full-path.patch @@ -1,18 +1,13 @@ # HG changeset patch # User Petr Cerny # Parent 7308e4a7c1f769f4bbbc90870b849cadd99495a6 -# Parent 2361c5db1e70e358b2158325e07fa15bb4569c2c +# Parent 1c6a565013e4c5f3494f964269783939cd5ed0b8 Bug 634334 - call to the ntlm_auth helper fails diff --git a/extensions/auth/nsAuthSambaNTLM.cpp b/extensions/auth/nsAuthSambaNTLM.cpp --- a/extensions/auth/nsAuthSambaNTLM.cpp +++ b/extensions/auth/nsAuthSambaNTLM.cpp -@@ -156,17 +156,17 @@ static uint8_t* ExtractMessage(const nsA - *aLen = (length / 4) * 3 - numEquals; - return reinterpret_cast(PL_Base64Decode(s, length, nullptr)); - } - - nsresult nsAuthSambaNTLM::SpawnNTLMAuthHelper() { +@@ -160,7 +160,7 @@ nsresult nsAuthSambaNTLM::SpawnNTLMAuthH const char* username = PR_GetEnv("USER"); if (!username) return NS_ERROR_FAILURE; @@ -21,8 +16,3 @@ diff --git a/extensions/auth/nsAuthSambaNTLM.cpp b/extensions/auth/nsAuthSambaNT "--helper-protocol", "ntlmssp-client-1", "--use-cached-creds", - "--username", - username, - nullptr}; - - bool isOK = SpawnIOChild(const_cast(args), &mChildPID, diff --git a/mozilla-partial-revert-1768632.patch b/mozilla-partial-revert-1768632.patch new file mode 100644 index 00000000..c4e63d5a --- /dev/null +++ b/mozilla-partial-revert-1768632.patch @@ -0,0 +1,13 @@ +Index: firefox-102.4.0/mfbt/EnumSet.h +=================================================================== +--- firefox-102.4.0.orig/mfbt/EnumSet.h ++++ firefox-102.4.0/mfbt/EnumSet.h +@@ -326,7 +326,7 @@ class EnumSet { + } + } + +- static constexpr size_t kMaxBits = MaxBits(); ++ static constexpr size_t kMaxBits = EnumSet().MaxBits(); + + Serialized mBitField; + diff --git a/mozilla-pgo.patch b/mozilla-pgo.patch index c34ac0df..4b65e21a 100644 --- a/mozilla-pgo.patch +++ b/mozilla-pgo.patch @@ -1,16 +1,12 @@ # HG changeset patch # User Wolfgang Rosenauer -# Parent d6f551c7b3dc20bb47526e06c44646fd159f3dd1 +# Parent 9959fe2a13a39cbeb98ca1bef2e21caba16717bd -diff --git a/build/moz.configure/lto-pgo.configure b/build/moz.configure/lto-pgo.configure ---- a/build/moz.configure/lto-pgo.configure -+++ b/build/moz.configure/lto-pgo.configure -@@ -242,34 +242,34 @@ def lto( - "configure." - ) - - if c_compiler.type == "clang": - if value == "full": +Index: firefox-115.0/build/moz.configure/lto-pgo.configure +=================================================================== +--- firefox-115.0.orig/build/moz.configure/lto-pgo.configure ++++ firefox-115.0/build/moz.configure/lto-pgo.configure +@@ -251,8 +251,8 @@ def lto( cflags.append("-flto") ldflags.append("-flto") else: @@ -19,18 +15,10 @@ diff --git a/build/moz.configure/lto-pgo.configure b/build/moz.configure/lto-pgo + cflags.append("-flto") + ldflags.append("-flto") - if target.os == "Android" and value == "cross": + if target.os == "Android" and "cross" in values: # Work around https://github.com/rust-lang/rust/issues/90088 - # by enabling the highest level of SSE the rust targets default - # to. - # https://github.com/rust-lang/rust/blob/bdfcb88e8b6203ccb46a2fb6649979b773efc8ac/compiler/rustc_target/src/spec/i686_linux_android.rs#L13 - # https://github.com/rust-lang/rust/blob/8d1083e319841624f64400e1524805a40d725439/compiler/rustc_target/src/spec/x86_64_linux_android.rs#L7 - if target.cpu == "x86": - ldflags.append("-Wl,-plugin-opt=-mattr=+ssse3") - elif target.cpu == "x86_64": - ldflags.append("-Wl,-plugin-opt=-mattr=+sse4.2") - elif c_compiler.type == "clang-cl": - if value == "full": +@@ -268,7 +268,7 @@ def lto( + if "full" in values: cflags.append("-flto") else: - cflags.append("-flto=thin") @@ -38,20 +26,11 @@ diff --git a/build/moz.configure/lto-pgo.configure b/build/moz.configure/lto-pgo # With clang-cl, -flto can only be used with -c or -fuse-ld=lld. # AC_TRY_LINKs during configure don't have -c, so pass -fuse-ld=lld. cflags.append("-fuse-ld=lld") - - # Explicitly set the CPU to optimize for so the linker doesn't - # choose a poor default. Rust compilation by default uses the - # pentium4 CPU on x86: - # -diff --git a/build/pgo/profileserver.py b/build/pgo/profileserver.py ---- a/build/pgo/profileserver.py -+++ b/build/pgo/profileserver.py -@@ -6,17 +6,17 @@ - - import glob - import json - import os - import subprocess +Index: firefox-115.0/build/pgo/profileserver.py +=================================================================== +--- firefox-115.0.orig/build/pgo/profileserver.py ++++ firefox-115.0/build/pgo/profileserver.py +@@ -11,7 +11,7 @@ import subprocess import sys import mozcrash @@ -60,17 +39,7 @@ diff --git a/build/pgo/profileserver.py b/build/pgo/profileserver.py from mozfile import TemporaryDirectory from mozhttpd import MozHttpd from mozprofile import FirefoxProfile, Preferences - from mozprofile.permissions import ServerLocations - from mozrunner import CLI, FirefoxRunner - from six import string_types - - PORT = 8888 -@@ -82,19 +82,32 @@ if __name__ == "__main__": - docroot=os.path.join(build.topsrcdir, "build", "pgo"), - path_mappings=path_mappings, - ) - httpd.start(block=False) - +@@ -87,9 +87,22 @@ if __name__ == "__main__": locations = ServerLocations() locations.add_host(host="127.0.0.1", port=PORT, options="primary,privileged") @@ -96,17 +65,7 @@ diff --git a/build/pgo/profileserver.py b/build/pgo/profileserver.py with TemporaryDirectory() as profilePath: # TODO: refactor this into mozprofile - profile_data_dir = os.path.join(build.topsrcdir, "testing", "profiles") - with open(os.path.join(profile_data_dir, "profiles.json"), "r") as fh: - base_profiles = json.load(fh)["profileserver"] - - prefpaths = [ -@@ -208,16 +221,20 @@ if __name__ == "__main__": - - # Try to move the crash reports to the artifacts even if Firefox appears - # to exit successfully, in case there's a crash that doesn't set the - # return code to non-zero for some reason. - if get_crashreports(profilePath, name="Firefox exited successfully?") != 0: +@@ -213,6 +226,10 @@ if __name__ == "__main__": print("Firefox exited successfully, but produced a crashreport") sys.exit(1) @@ -117,18 +76,11 @@ diff --git a/build/pgo/profileserver.py b/build/pgo/profileserver.py llvm_profdata = env.get("LLVM_PROFDATA") if llvm_profdata: profraw_files = glob.glob("*.profraw") - if not profraw_files: - print( - "Could not find profraw files in the current directory: %s" - % os.getcwd() - ) -diff --git a/build/unix/mozconfig.unix b/build/unix/mozconfig.unix ---- a/build/unix/mozconfig.unix -+++ b/build/unix/mozconfig.unix -@@ -1,14 +1,23 @@ - . "$topsrcdir/build/mozconfig.common" - - if [ -n "$FORCE_GCC" ]; then +Index: firefox-115.0/build/unix/mozconfig.unix +=================================================================== +--- firefox-115.0.orig/build/unix/mozconfig.unix ++++ firefox-115.0/build/unix/mozconfig.unix +@@ -4,6 +4,15 @@ if [ -n "$FORCE_GCC" ]; then CC="$MOZ_FETCHES_DIR/gcc/bin/gcc" CXX="$MOZ_FETCHES_DIR/gcc/bin/g++" @@ -144,34 +96,21 @@ diff --git a/build/unix/mozconfig.unix b/build/unix/mozconfig.unix # We want to make sure we use binutils and other binaries in the tooltool # package. mk_add_options "export PATH=$MOZ_FETCHES_DIR/gcc/bin:$MOZ_FETCHES_DIR/binutils/bin:$PATH" - else - # For some builds we don't want to have Clang based static-analysis activated - if [ -z "$DISABLE_CLANG_PLUGIN" ]; then - export ENABLE_CLANG_PLUGIN=1 - fi -diff --git a/extensions/spellcheck/src/moz.build b/extensions/spellcheck/src/moz.build ---- a/extensions/spellcheck/src/moz.build -+++ b/extensions/spellcheck/src/moz.build -@@ -23,8 +23,10 @@ LOCAL_INCLUDES += [ - "../hunspell/glue", - "../hunspell/src", - "/dom/base", - ] - EXPORTS.mozilla += [ +Index: firefox-115.0/extensions/spellcheck/src/moz.build +=================================================================== +--- firefox-115.0.orig/extensions/spellcheck/src/moz.build ++++ firefox-115.0/extensions/spellcheck/src/moz.build +@@ -28,3 +28,5 @@ EXPORTS.mozilla += [ "mozInlineSpellChecker.h", "mozSpellChecker.h", ] + +CXXFLAGS += ['-fno-devirtualize'] -diff --git a/toolkit/components/terminator/nsTerminator.cpp b/toolkit/components/terminator/nsTerminator.cpp ---- a/toolkit/components/terminator/nsTerminator.cpp -+++ b/toolkit/components/terminator/nsTerminator.cpp -@@ -455,16 +455,21 @@ void nsTerminator::StartWatchdog() { - // Defend against overflow - crashAfterMS = INT32_MAX; - } else { - crashAfterMS *= scaleUp; - } +Index: firefox-115.0/toolkit/components/terminator/nsTerminator.cpp +=================================================================== +--- firefox-115.0.orig/toolkit/components/terminator/nsTerminator.cpp ++++ firefox-115.0/toolkit/components/terminator/nsTerminator.cpp +@@ -460,6 +460,11 @@ void nsTerminator::StartWatchdog() { } #endif @@ -183,8 +122,3 @@ diff --git a/toolkit/components/terminator/nsTerminator.cpp b/toolkit/components UniquePtr options(new Options()); // crashAfterTicks is guaranteed to be > 0 as // crashAfterMS >= ADDITIONAL_WAIT_BEFORE_CRASH_MS >> HEARTBEAT_INTERVAL_MS - options->crashAfterTicks = crashAfterMS / HEARTBEAT_INTERVAL_MS; - - DebugOnly watchdogThread = - CreateSystemThread(RunWatchdog, options.release()); - MOZ_ASSERT(watchdogThread); diff --git a/mozilla-reduce-rust-debuginfo.patch b/mozilla-reduce-rust-debuginfo.patch index 620f178e..06543a0e 100644 --- a/mozilla-reduce-rust-debuginfo.patch +++ b/mozilla-reduce-rust-debuginfo.patch @@ -1,6 +1,10 @@ ---- firefox-96.0.3.orig/build/moz.configure/rust.configure -+++ firefox-96.0.3/build/moz.configure/rust.configure -@@ -641,7 +643,7 @@ def rust_compile_flags( +# HG changeset patch +# Parent 135d931b3e674a670473f69f8c079e741ac63643 + +diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure +--- a/build/moz.configure/rust.configure ++++ b/build/moz.configure/rust.configure +@@ -668,7 +668,7 @@ def rust_compile_flags( debug_assertions = False if debug_symbols: diff --git a/mozilla-rust-disable-future-incompat.patch b/mozilla-rust-disable-future-incompat.patch new file mode 100644 index 00000000..88ec5530 --- /dev/null +++ b/mozilla-rust-disable-future-incompat.patch @@ -0,0 +1,12 @@ +diff -rup a/Cargo.toml b/Cargo.toml +--- a/Cargo.toml 2023-07-04 15:15:01.089470619 +0200 ++++ b/Cargo.toml 2023-07-04 15:24:31.626226962 +0200 +@@ -188,3 +188,8 @@ uniffi_bindgen = "=0.23.0" + uniffi_build = "=0.23.0" + uniffi_macros = "=0.23.0" + weedle2 = "=4.0.0" ++ ++# Package code v0.1.4 uses code "that will be rejected by a future version of Rust" ++# Shut up such messages for now to make the build succeed ++[future-incompat-report] ++frequency = "never" diff --git a/mozilla-silence-no-return-type.patch b/mozilla-silence-no-return-type.patch index 38119eb9..217a1768 100644 --- a/mozilla-silence-no-return-type.patch +++ b/mozilla-silence-no-return-type.patch @@ -1,9 +1,10 @@ # HG changeset patch # Parent 5df550d4b5fc674268055e504f60392389eb9ea7 -diff --git a/gfx/skia/skia/include/codec/SkEncodedOrigin.h b/gfx/skia/skia/include/codec/SkEncodedOrigin.h ---- a/gfx/skia/skia/include/codec/SkEncodedOrigin.h -+++ b/gfx/skia/skia/include/codec/SkEncodedOrigin.h +Index: firefox-115.0/gfx/skia/skia/include/codec/SkEncodedOrigin.h +=================================================================== +--- firefox-115.0.orig/gfx/skia/skia/include/codec/SkEncodedOrigin.h ++++ firefox-115.0/gfx/skia/skia/include/codec/SkEncodedOrigin.h @@ -41,6 +41,7 @@ static inline SkMatrix SkEncodedOriginTo case kLeftBottom_SkEncodedOrigin: return SkMatrix::MakeAll( 0, 1, 0, -1, 0, h, 0, 0, 1); } @@ -12,9 +13,10 @@ diff --git a/gfx/skia/skia/include/codec/SkEncodedOrigin.h b/gfx/skia/skia/inclu } /** -diff --git a/gfx/skia/skia/include/private/gpu/ganesh/GrTypesPriv.h b/gfx/skia/skia/include/private/gpu/ganesh/GrTypesPriv.h ---- a/gfx/skia/skia/include/private/gpu/ganesh/GrTypesPriv.h -+++ b/gfx/skia/skia/include/private/gpu/ganesh/GrTypesPriv.h +Index: firefox-115.0/gfx/skia/skia/include/private/gpu/ganesh/GrTypesPriv.h +=================================================================== +--- firefox-115.0.orig/gfx/skia/skia/include/private/gpu/ganesh/GrTypesPriv.h ++++ firefox-115.0/gfx/skia/skia/include/private/gpu/ganesh/GrTypesPriv.h @@ -325,6 +325,7 @@ static inline bool GrTextureTypeHasRestr default: SK_ABORT("Unexpected texture type"); @@ -23,9 +25,10 @@ diff --git a/gfx/skia/skia/include/private/gpu/ganesh/GrTypesPriv.h b/gfx/skia/s } ////////////////////////////////////////////////////////////////////////////// -diff --git a/gfx/skia/skia/src/core/SkDescriptor.cpp b/gfx/skia/skia/src/core/SkDescriptor.cpp ---- a/gfx/skia/skia/src/core/SkDescriptor.cpp -+++ b/gfx/skia/skia/src/core/SkDescriptor.cpp +Index: firefox-115.0/gfx/skia/skia/src/core/SkDescriptor.cpp +=================================================================== +--- firefox-115.0.orig/gfx/skia/skia/src/core/SkDescriptor.cpp ++++ firefox-115.0/gfx/skia/skia/src/core/SkDescriptor.cpp @@ -26,6 +26,7 @@ std::unique_ptr SkDescript void SkDescriptor::operator delete(void* p) { ::operator delete(p); } void* SkDescriptor::operator new(size_t) { @@ -34,9 +37,10 @@ diff --git a/gfx/skia/skia/src/core/SkDescriptor.cpp b/gfx/skia/skia/src/core/Sk } void SkDescriptor::flatten(SkWriteBuffer& buffer) const { -diff --git a/gfx/skia/skia/src/core/SkGeometry.h b/gfx/skia/skia/src/core/SkGeometry.h ---- a/gfx/skia/skia/src/core/SkGeometry.h -+++ b/gfx/skia/skia/src/core/SkGeometry.h +Index: firefox-115.0/gfx/skia/skia/src/core/SkGeometry.h +=================================================================== +--- firefox-115.0.orig/gfx/skia/skia/src/core/SkGeometry.h ++++ firefox-115.0/gfx/skia/skia/src/core/SkGeometry.h @@ -281,6 +281,7 @@ static inline bool SkCubicIsDegenerate(S return true; } @@ -53,9 +57,10 @@ diff --git a/gfx/skia/skia/src/core/SkGeometry.h b/gfx/skia/skia/src/core/SkGeom } /** Returns the cubic classification. -diff --git a/gfx/skia/skia/src/core/SkTextBlob.cpp b/gfx/skia/skia/src/core/SkTextBlob.cpp ---- a/gfx/skia/skia/src/core/SkTextBlob.cpp -+++ b/gfx/skia/skia/src/core/SkTextBlob.cpp +Index: firefox-115.0/gfx/skia/skia/src/core/SkTextBlob.cpp +=================================================================== +--- firefox-115.0.orig/gfx/skia/skia/src/core/SkTextBlob.cpp ++++ firefox-115.0/gfx/skia/skia/src/core/SkTextBlob.cpp @@ -204,6 +204,7 @@ void SkTextBlob::operator delete(void* p void* SkTextBlob::operator new(size_t) { @@ -64,9 +69,10 @@ diff --git a/gfx/skia/skia/src/core/SkTextBlob.cpp b/gfx/skia/skia/src/core/SkTe } void* SkTextBlob::operator new(size_t, void* p) { -diff --git a/gfx/skia/skia/src/core/SkTypeface_remote.h b/gfx/skia/skia/src/core/SkTypeface_remote.h ---- a/gfx/skia/skia/src/core/SkTypeface_remote.h -+++ b/gfx/skia/skia/src/core/SkTypeface_remote.h +Index: firefox-115.0/gfx/skia/skia/src/core/SkTypeface_remote.h +=================================================================== +--- firefox-115.0.orig/gfx/skia/skia/src/core/SkTypeface_remote.h ++++ firefox-115.0/gfx/skia/skia/src/core/SkTypeface_remote.h @@ -95,12 +95,14 @@ public: bool isLogging() const {return fIsLogging;} @@ -150,9 +156,10 @@ diff --git a/gfx/skia/skia/src/core/SkTypeface_remote.h b/gfx/skia/skia/src/core } private: -diff --git a/gfx/skia/skia/src/effects/imagefilters/SkBlurImageFilter.cpp b/gfx/skia/skia/src/effects/imagefilters/SkBlurImageFilter.cpp ---- a/gfx/skia/skia/src/effects/imagefilters/SkBlurImageFilter.cpp -+++ b/gfx/skia/skia/src/effects/imagefilters/SkBlurImageFilter.cpp +Index: firefox-115.0/gfx/skia/skia/src/effects/imagefilters/SkBlurImageFilter.cpp +=================================================================== +--- firefox-115.0.orig/gfx/skia/skia/src/effects/imagefilters/SkBlurImageFilter.cpp ++++ firefox-115.0/gfx/skia/skia/src/effects/imagefilters/SkBlurImageFilter.cpp @@ -815,6 +815,7 @@ sk_sp cpu_blur( return maker; } @@ -161,9 +168,10 @@ diff --git a/gfx/skia/skia/src/effects/imagefilters/SkBlurImageFilter.cpp b/gfx/ }; PassMaker* makerX = makeMaker(sigma.x()); -diff --git a/gfx/skia/skia/src/fonts/SkFontMgr_indirect.cpp b/gfx/skia/skia/src/fonts/SkFontMgr_indirect.cpp ---- a/gfx/skia/skia/src/fonts/SkFontMgr_indirect.cpp -+++ b/gfx/skia/skia/src/fonts/SkFontMgr_indirect.cpp +Index: firefox-115.0/gfx/skia/skia/src/fonts/SkFontMgr_indirect.cpp +=================================================================== +--- firefox-115.0.orig/gfx/skia/skia/src/fonts/SkFontMgr_indirect.cpp ++++ firefox-115.0/gfx/skia/skia/src/fonts/SkFontMgr_indirect.cpp @@ -69,6 +69,7 @@ void SkFontMgr_Indirect::onGetFamilyName SkFontStyleSet* SkFontMgr_Indirect::onCreateStyleSet(int index) const { @@ -172,9 +180,10 @@ diff --git a/gfx/skia/skia/src/fonts/SkFontMgr_indirect.cpp b/gfx/skia/skia/src/ } SkFontStyleSet* SkFontMgr_Indirect::onMatchFamily(const char familyName[]) const { -diff --git a/gfx/skia/skia/src/ports/SkFontMgr_FontConfigInterface.cpp b/gfx/skia/skia/src/ports/SkFontMgr_FontConfigInterface.cpp ---- a/gfx/skia/skia/src/ports/SkFontMgr_FontConfigInterface.cpp -+++ b/gfx/skia/skia/src/ports/SkFontMgr_FontConfigInterface.cpp +Index: firefox-115.0/gfx/skia/skia/src/ports/SkFontMgr_FontConfigInterface.cpp +=================================================================== +--- firefox-115.0.orig/gfx/skia/skia/src/ports/SkFontMgr_FontConfigInterface.cpp ++++ firefox-115.0/gfx/skia/skia/src/ports/SkFontMgr_FontConfigInterface.cpp @@ -162,18 +162,22 @@ public: protected: int onCountFamilies() const override { @@ -198,9 +207,10 @@ diff --git a/gfx/skia/skia/src/ports/SkFontMgr_FontConfigInterface.cpp b/gfx/ski } SkTypeface* onMatchFamilyStyle(const char requestedFamilyName[], -diff --git a/gfx/skia/skia/src/sksl/SkSLCompiler.cpp b/gfx/skia/skia/src/sksl/SkSLCompiler.cpp ---- a/gfx/skia/skia/src/sksl/SkSLCompiler.cpp -+++ b/gfx/skia/skia/src/sksl/SkSLCompiler.cpp +Index: firefox-115.0/gfx/skia/skia/src/sksl/SkSLCompiler.cpp +=================================================================== +--- firefox-115.0.orig/gfx/skia/skia/src/sksl/SkSLCompiler.cpp ++++ firefox-115.0/gfx/skia/skia/src/sksl/SkSLCompiler.cpp @@ -277,6 +277,7 @@ std::unique_ptr Compiler::co } default: @@ -209,9 +219,10 @@ diff --git a/gfx/skia/skia/src/sksl/SkSLCompiler.cpp b/gfx/skia/skia/src/sksl/Sk } } -diff --git a/gfx/skia/skia/src/sksl/SkSLOperator.cpp b/gfx/skia/skia/src/sksl/SkSLOperator.cpp ---- a/gfx/skia/skia/src/sksl/SkSLOperator.cpp -+++ b/gfx/skia/skia/src/sksl/SkSLOperator.cpp +Index: firefox-115.0/gfx/skia/skia/src/sksl/SkSLOperator.cpp +=================================================================== +--- firefox-115.0.orig/gfx/skia/skia/src/sksl/SkSLOperator.cpp ++++ firefox-115.0/gfx/skia/skia/src/sksl/SkSLOperator.cpp @@ -51,7 +51,7 @@ OperatorPrecedence Operator::getBinaryPr case Kind::BITWISEXOREQ: // fall through case Kind::BITWISEOREQ: return OperatorPrecedence::kAssignment; @@ -221,9 +232,10 @@ diff --git a/gfx/skia/skia/src/sksl/SkSLOperator.cpp b/gfx/skia/skia/src/sksl/Sk } } -diff --git a/gfx/skia/skia/src/sksl/ir/SkSLType.h b/gfx/skia/skia/src/sksl/ir/SkSLType.h ---- a/gfx/skia/skia/src/sksl/ir/SkSLType.h -+++ b/gfx/skia/skia/src/sksl/ir/SkSLType.h +Index: firefox-115.0/gfx/skia/skia/src/sksl/ir/SkSLType.h +=================================================================== +--- firefox-115.0.orig/gfx/skia/skia/src/sksl/ir/SkSLType.h ++++ firefox-115.0/gfx/skia/skia/src/sksl/ir/SkSLType.h @@ -422,6 +422,7 @@ public: virtual const std::vector& fields() const { @@ -232,9 +244,10 @@ diff --git a/gfx/skia/skia/src/sksl/ir/SkSLType.h b/gfx/skia/skia/src/sksl/ir/Sk } /** -diff --git a/gfx/skia/skia/src/utils/SkShadowUtils.cpp b/gfx/skia/skia/src/utils/SkShadowUtils.cpp ---- a/gfx/skia/skia/src/utils/SkShadowUtils.cpp -+++ b/gfx/skia/skia/src/utils/SkShadowUtils.cpp +Index: firefox-115.0/gfx/skia/skia/src/utils/SkShadowUtils.cpp +=================================================================== +--- firefox-115.0.orig/gfx/skia/skia/src/utils/SkShadowUtils.cpp ++++ firefox-115.0/gfx/skia/skia/src/utils/SkShadowUtils.cpp @@ -140,6 +140,7 @@ struct SpotVerticesFactory { return true; } @@ -243,9 +256,10 @@ diff --git a/gfx/skia/skia/src/utils/SkShadowUtils.cpp b/gfx/skia/skia/src/utils } sk_sp makeVertices(const SkPath& path, const SkMatrix& ctm, -diff --git a/intl/icu/source/i18n/number_rounding.cpp b/intl/icu/source/i18n/number_rounding.cpp ---- a/intl/icu/source/i18n/number_rounding.cpp -+++ b/intl/icu/source/i18n/number_rounding.cpp +Index: firefox-115.0/intl/icu/source/i18n/number_rounding.cpp +=================================================================== +--- firefox-115.0.orig/intl/icu/source/i18n/number_rounding.cpp ++++ firefox-115.0/intl/icu/source/i18n/number_rounding.cpp @@ -283,6 +283,7 @@ FractionPrecision Precision::constructFr settings.fMaxFrac = static_cast(maxFrac); settings.fMinSig = -1; @@ -262,10 +276,11 @@ diff --git a/intl/icu/source/i18n/number_rounding.cpp b/intl/icu/source/i18n/num PrecisionUnion union_; union_.fracSig = settings; return {RND_SIGNIFICANT, union_}; -diff --git a/js/src/irregexp/imported/regexp-parser.cc b/js/src/irregexp/imported/regexp-parser.cc ---- a/js/src/irregexp/imported/regexp-parser.cc -+++ b/js/src/irregexp/imported/regexp-parser.cc -@@ -2655,6 +2655,7 @@ bool MayContainStrings(ClassSetOperandTy +Index: firefox-115.0/js/src/irregexp/imported/regexp-parser.cc +=================================================================== +--- firefox-115.0.orig/js/src/irregexp/imported/regexp-parser.cc ++++ firefox-115.0/js/src/irregexp/imported/regexp-parser.cc +@@ -2656,6 +2656,7 @@ bool MayContainStrings(ClassSetOperandTy if (operand->IsClassRanges()) return false; return operand->AsClassSetExpression()->may_contain_strings(); } @@ -273,9 +288,10 @@ diff --git a/js/src/irregexp/imported/regexp-parser.cc b/js/src/irregexp/importe } } // namespace -diff --git a/third_party/libwebrtc/api/adaptation/resource.cc b/third_party/libwebrtc/api/adaptation/resource.cc ---- a/third_party/libwebrtc/api/adaptation/resource.cc -+++ b/third_party/libwebrtc/api/adaptation/resource.cc +Index: firefox-115.0/third_party/libwebrtc/api/adaptation/resource.cc +=================================================================== +--- firefox-115.0.orig/third_party/libwebrtc/api/adaptation/resource.cc ++++ firefox-115.0/third_party/libwebrtc/api/adaptation/resource.cc @@ -22,6 +22,7 @@ const char* ResourceUsageStateToString(R return "kUnderuse"; } @@ -284,9 +300,10 @@ diff --git a/third_party/libwebrtc/api/adaptation/resource.cc b/third_party/libw } ResourceListener::~ResourceListener() {} -diff --git a/third_party/libwebrtc/api/rtp_parameters.cc b/third_party/libwebrtc/api/rtp_parameters.cc ---- a/third_party/libwebrtc/api/rtp_parameters.cc -+++ b/third_party/libwebrtc/api/rtp_parameters.cc +Index: firefox-115.0/third_party/libwebrtc/api/rtp_parameters.cc +=================================================================== +--- firefox-115.0.orig/third_party/libwebrtc/api/rtp_parameters.cc ++++ firefox-115.0/third_party/libwebrtc/api/rtp_parameters.cc @@ -32,6 +32,7 @@ const char* DegradationPreferenceToStrin return "balanced"; } @@ -295,10 +312,11 @@ diff --git a/third_party/libwebrtc/api/rtp_parameters.cc b/third_party/libwebrtc } const double kDefaultBitratePriority = 1.0; -diff --git a/third_party/libwebrtc/api/video/video_frame_buffer.cc b/third_party/libwebrtc/api/video/video_frame_buffer.cc ---- a/third_party/libwebrtc/api/video/video_frame_buffer.cc -+++ b/third_party/libwebrtc/api/video/video_frame_buffer.cc -@@ -99,6 +99,8 @@ const char* VideoFrameBufferTypeToString +Index: firefox-115.0/third_party/libwebrtc/api/video/video_frame_buffer.cc +=================================================================== +--- firefox-115.0.orig/third_party/libwebrtc/api/video/video_frame_buffer.cc ++++ firefox-115.0/third_party/libwebrtc/api/video/video_frame_buffer.cc +@@ -106,6 +106,8 @@ const char* VideoFrameBufferTypeToString default: RTC_DCHECK_NOTREACHED(); } @@ -307,9 +325,10 @@ diff --git a/third_party/libwebrtc/api/video/video_frame_buffer.cc b/third_party } int I420BufferInterface::ChromaWidth() const { -diff --git a/third_party/libwebrtc/api/video_codecs/video_codec.cc b/third_party/libwebrtc/api/video_codecs/video_codec.cc ---- a/third_party/libwebrtc/api/video_codecs/video_codec.cc -+++ b/third_party/libwebrtc/api/video_codecs/video_codec.cc +Index: firefox-115.0/third_party/libwebrtc/api/video_codecs/video_codec.cc +=================================================================== +--- firefox-115.0.orig/third_party/libwebrtc/api/video_codecs/video_codec.cc ++++ firefox-115.0/third_party/libwebrtc/api/video_codecs/video_codec.cc @@ -118,6 +118,7 @@ const char* CodecTypeToPayloadString(Vid return kPayloadNameGeneric; } @@ -318,9 +337,10 @@ diff --git a/third_party/libwebrtc/api/video_codecs/video_codec.cc b/third_party } VideoCodecType PayloadStringToCodecType(const std::string& name) { -diff --git a/third_party/libwebrtc/api/video_codecs/video_encoder_software_fallback_wrapper.cc b/third_party/libwebrtc/api/video_codecs/video_encoder_software_fallback_wrapper.cc ---- a/third_party/libwebrtc/api/video_codecs/video_encoder_software_fallback_wrapper.cc -+++ b/third_party/libwebrtc/api/video_codecs/video_encoder_software_fallback_wrapper.cc +Index: firefox-115.0/third_party/libwebrtc/api/video_codecs/video_encoder_software_fallback_wrapper.cc +=================================================================== +--- firefox-115.0.orig/third_party/libwebrtc/api/video_codecs/video_encoder_software_fallback_wrapper.cc ++++ firefox-115.0/third_party/libwebrtc/api/video_codecs/video_encoder_software_fallback_wrapper.cc @@ -163,6 +163,7 @@ class VideoEncoderSoftwareFallbackWrappe return fallback_encoder_.get(); } @@ -337,9 +357,10 @@ diff --git a/third_party/libwebrtc/api/video_codecs/video_encoder_software_fallb } int32_t VideoEncoderSoftwareFallbackWrapper::EncodeWithMainEncoder( -diff --git a/third_party/libwebrtc/call/adaptation/video_stream_adapter.cc b/third_party/libwebrtc/call/adaptation/video_stream_adapter.cc ---- a/third_party/libwebrtc/call/adaptation/video_stream_adapter.cc -+++ b/third_party/libwebrtc/call/adaptation/video_stream_adapter.cc +Index: firefox-115.0/third_party/libwebrtc/call/adaptation/video_stream_adapter.cc +=================================================================== +--- firefox-115.0.orig/third_party/libwebrtc/call/adaptation/video_stream_adapter.cc ++++ firefox-115.0/third_party/libwebrtc/call/adaptation/video_stream_adapter.cc @@ -168,6 +168,7 @@ const char* Adaptation::StatusToString(A return "kRejectedByConstraint"; } @@ -348,7 +369,7 @@ diff --git a/third_party/libwebrtc/call/adaptation/video_stream_adapter.cc b/thi } Adaptation::Adaptation(int validation_id, -@@ -390,6 +391,7 @@ VideoStreamAdapter::RestrictionsOrState +@@ -390,6 +391,7 @@ VideoStreamAdapter::RestrictionsOrState return Adaptation::Status::kAdaptationDisabled; } RTC_CHECK_NOTREACHED(); @@ -373,9 +394,10 @@ diff --git a/third_party/libwebrtc/call/adaptation/video_stream_adapter.cc b/thi } VideoStreamAdapter::RestrictionsOrState -diff --git a/third_party/libwebrtc/call/rtp_payload_params.cc b/third_party/libwebrtc/call/rtp_payload_params.cc ---- a/third_party/libwebrtc/call/rtp_payload_params.cc -+++ b/third_party/libwebrtc/call/rtp_payload_params.cc +Index: firefox-115.0/third_party/libwebrtc/call/rtp_payload_params.cc +=================================================================== +--- firefox-115.0.orig/third_party/libwebrtc/call/rtp_payload_params.cc ++++ firefox-115.0/third_party/libwebrtc/call/rtp_payload_params.cc @@ -407,7 +407,7 @@ absl::optional case VideoCodecType::kVideoCodecMultiplex: return absl::nullopt; @@ -385,9 +407,10 @@ diff --git a/third_party/libwebrtc/call/rtp_payload_params.cc b/third_party/libw } void RtpPayloadParams::GenericToGeneric(int64_t shared_frame_id, -diff --git a/third_party/libwebrtc/call/video_send_stream.cc b/third_party/libwebrtc/call/video_send_stream.cc ---- a/third_party/libwebrtc/call/video_send_stream.cc -+++ b/third_party/libwebrtc/call/video_send_stream.cc +Index: firefox-115.0/third_party/libwebrtc/call/video_send_stream.cc +=================================================================== +--- firefox-115.0.orig/third_party/libwebrtc/call/video_send_stream.cc ++++ firefox-115.0/third_party/libwebrtc/call/video_send_stream.cc @@ -30,6 +30,7 @@ const char* StreamTypeToString(VideoSend return "flexfec"; } @@ -396,9 +419,10 @@ diff --git a/third_party/libwebrtc/call/video_send_stream.cc b/third_party/libwe } } // namespace -diff --git a/third_party/libwebrtc/modules/audio_processing/agc2/clipping_predictor.cc b/third_party/libwebrtc/modules/audio_processing/agc2/clipping_predictor.cc ---- a/third_party/libwebrtc/modules/audio_processing/agc2/clipping_predictor.cc -+++ b/third_party/libwebrtc/modules/audio_processing/agc2/clipping_predictor.cc +Index: firefox-115.0/third_party/libwebrtc/modules/audio_processing/agc2/clipping_predictor.cc +=================================================================== +--- firefox-115.0.orig/third_party/libwebrtc/modules/audio_processing/agc2/clipping_predictor.cc ++++ firefox-115.0/third_party/libwebrtc/modules/audio_processing/agc2/clipping_predictor.cc @@ -378,7 +378,7 @@ std::unique_ptr Creat config.reference_window_delay, config.clipping_threshold, /*adaptive_step_estimation=*/false); @@ -408,9 +432,10 @@ diff --git a/third_party/libwebrtc/modules/audio_processing/agc2/clipping_predic } } // namespace webrtc -diff --git a/third_party/libwebrtc/modules/audio_processing/agc2/input_volume_stats_reporter.cc b/third_party/libwebrtc/modules/audio_processing/agc2/input_volume_stats_reporter.cc ---- a/third_party/libwebrtc/modules/audio_processing/agc2/input_volume_stats_reporter.cc -+++ b/third_party/libwebrtc/modules/audio_processing/agc2/input_volume_stats_reporter.cc +Index: firefox-115.0/third_party/libwebrtc/modules/audio_processing/agc2/input_volume_stats_reporter.cc +=================================================================== +--- firefox-115.0.orig/third_party/libwebrtc/modules/audio_processing/agc2/input_volume_stats_reporter.cc ++++ firefox-115.0/third_party/libwebrtc/modules/audio_processing/agc2/input_volume_stats_reporter.cc @@ -48,6 +48,7 @@ constexpr absl::string_view MetricNamePr case InputVolumeType::kRecommended: return "WebRTC.Audio.Apm.RecommendedInputVolume."; @@ -419,9 +444,10 @@ diff --git a/third_party/libwebrtc/modules/audio_processing/agc2/input_volume_st } metrics::Histogram* CreateVolumeHistogram(InputVolumeType input_volume_type) { -diff --git a/third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_fc.cc b/third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_fc.cc ---- a/third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_fc.cc -+++ b/third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_fc.cc +Index: firefox-115.0/third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_fc.cc +=================================================================== +--- firefox-115.0.orig/third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_fc.cc ++++ firefox-115.0/third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_fc.cc @@ -59,6 +59,8 @@ rtc::FunctionView GetActiv case ActivationFunction::kSigmoidApproximated: return ::rnnoise::SigmoidApproximated; @@ -431,9 +457,10 @@ diff --git a/third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_fc. } } // namespace -diff --git a/third_party/libwebrtc/modules/audio_processing/audio_processing_impl.cc b/third_party/libwebrtc/modules/audio_processing/audio_processing_impl.cc ---- a/third_party/libwebrtc/modules/audio_processing/audio_processing_impl.cc -+++ b/third_party/libwebrtc/modules/audio_processing/audio_processing_impl.cc +Index: firefox-115.0/third_party/libwebrtc/modules/audio_processing/audio_processing_impl.cc +=================================================================== +--- firefox-115.0.orig/third_party/libwebrtc/modules/audio_processing/audio_processing_impl.cc ++++ firefox-115.0/third_party/libwebrtc/modules/audio_processing/audio_processing_impl.cc @@ -99,6 +99,7 @@ GainControl::Mode Agc1ConfigModeToInterf return GainControl::kFixedDigital; } @@ -451,7 +478,7 @@ diff --git a/third_party/libwebrtc/modules/audio_processing/audio_processing_imp } // Returns an AudioProcessing::Error together with the best possible option for -@@ -2414,6 +2415,7 @@ void AudioProcessingImpl::InitializeNois +@@ -2421,6 +2422,7 @@ void AudioProcessingImpl::InitializeNois return NsConfig::SuppressionLevel::k21dB; } RTC_CHECK_NOTREACHED(); @@ -459,9 +486,10 @@ diff --git a/third_party/libwebrtc/modules/audio_processing/audio_processing_imp }; NsConfig cfg; -diff --git a/third_party/libwebrtc/modules/audio_processing/include/audio_processing.cc b/third_party/libwebrtc/modules/audio_processing/include/audio_processing.cc ---- a/third_party/libwebrtc/modules/audio_processing/include/audio_processing.cc -+++ b/third_party/libwebrtc/modules/audio_processing/include/audio_processing.cc +Index: firefox-115.0/third_party/libwebrtc/modules/audio_processing/include/audio_processing.cc +=================================================================== +--- firefox-115.0.orig/third_party/libwebrtc/modules/audio_processing/include/audio_processing.cc ++++ firefox-115.0/third_party/libwebrtc/modules/audio_processing/include/audio_processing.cc @@ -32,6 +32,7 @@ std::string NoiseSuppressionLevelToStrin return "VeryHigh"; } @@ -478,9 +506,10 @@ diff --git a/third_party/libwebrtc/modules/audio_processing/include/audio_proces } } // namespace -diff --git a/third_party/libwebrtc/modules/audio_processing/transient/transient_suppressor_impl.cc b/third_party/libwebrtc/modules/audio_processing/transient/transient_suppressor_impl.cc ---- a/third_party/libwebrtc/modules/audio_processing/transient/transient_suppressor_impl.cc -+++ b/third_party/libwebrtc/modules/audio_processing/transient/transient_suppressor_impl.cc +Index: firefox-115.0/third_party/libwebrtc/modules/audio_processing/transient/transient_suppressor_impl.cc +=================================================================== +--- firefox-115.0.orig/third_party/libwebrtc/modules/audio_processing/transient/transient_suppressor_impl.cc ++++ firefox-115.0/third_party/libwebrtc/modules/audio_processing/transient/transient_suppressor_impl.cc @@ -53,6 +53,7 @@ std::string GetVadModeLabel(TransientSup case TransientSuppressor::VadMode::kNoVad: return "no VAD"; @@ -489,9 +518,10 @@ diff --git a/third_party/libwebrtc/modules/audio_processing/transient/transient_ } } // namespace -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_portal.cc b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_portal.cc ---- a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_portal.cc -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_portal.cc +Index: firefox-115.0/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_portal.cc +=================================================================== +--- firefox-115.0.orig/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_portal.cc ++++ firefox-115.0/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_portal.cc @@ -44,6 +44,7 @@ ScreenCastPortal::CaptureSourceType Scre case CaptureType::kAnyScreenContent: return ScreenCastPortal::CaptureSourceType::kAnyScreenContent; @@ -500,9 +530,10 @@ diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screenc } ScreenCastPortal::ScreenCastPortal(CaptureType type, PortalNotifier* notifier) -diff --git a/third_party/libwebrtc/modules/rtp_rtcp/source/create_video_rtp_depacketizer.cc b/third_party/libwebrtc/modules/rtp_rtcp/source/create_video_rtp_depacketizer.cc ---- a/third_party/libwebrtc/modules/rtp_rtcp/source/create_video_rtp_depacketizer.cc -+++ b/third_party/libwebrtc/modules/rtp_rtcp/source/create_video_rtp_depacketizer.cc +Index: firefox-115.0/third_party/libwebrtc/modules/rtp_rtcp/source/create_video_rtp_depacketizer.cc +=================================================================== +--- firefox-115.0.orig/third_party/libwebrtc/modules/rtp_rtcp/source/create_video_rtp_depacketizer.cc ++++ firefox-115.0/third_party/libwebrtc/modules/rtp_rtcp/source/create_video_rtp_depacketizer.cc @@ -38,6 +38,7 @@ std::unique_ptr Cr return std::make_unique(); } @@ -511,9 +542,10 @@ diff --git a/third_party/libwebrtc/modules/rtp_rtcp/source/create_video_rtp_depa } } // namespace webrtc -diff --git a/third_party/libwebrtc/modules/rtp_rtcp/source/rtp_sender.cc b/third_party/libwebrtc/modules/rtp_rtcp/source/rtp_sender.cc ---- a/third_party/libwebrtc/modules/rtp_rtcp/source/rtp_sender.cc -+++ b/third_party/libwebrtc/modules/rtp_rtcp/source/rtp_sender.cc +Index: firefox-115.0/third_party/libwebrtc/modules/rtp_rtcp/source/rtp_sender.cc +=================================================================== +--- firefox-115.0.orig/third_party/libwebrtc/modules/rtp_rtcp/source/rtp_sender.cc ++++ firefox-115.0/third_party/libwebrtc/modules/rtp_rtcp/source/rtp_sender.cc @@ -142,6 +142,7 @@ bool IsNonVolatile(RTPExtensionType type #endif } @@ -522,9 +554,10 @@ diff --git a/third_party/libwebrtc/modules/rtp_rtcp/source/rtp_sender.cc b/third } bool HasBweExtension(const RtpHeaderExtensionMap& extensions_map) { -diff --git a/third_party/libwebrtc/modules/rtp_rtcp/source/rtp_sender_audio.cc b/third_party/libwebrtc/modules/rtp_rtcp/source/rtp_sender_audio.cc ---- a/third_party/libwebrtc/modules/rtp_rtcp/source/rtp_sender_audio.cc -+++ b/third_party/libwebrtc/modules/rtp_rtcp/source/rtp_sender_audio.cc +Index: firefox-115.0/third_party/libwebrtc/modules/rtp_rtcp/source/rtp_sender_audio.cc +=================================================================== +--- firefox-115.0.orig/third_party/libwebrtc/modules/rtp_rtcp/source/rtp_sender_audio.cc ++++ firefox-115.0/third_party/libwebrtc/modules/rtp_rtcp/source/rtp_sender_audio.cc @@ -45,6 +45,7 @@ namespace { return "audio_cn"; } @@ -533,10 +566,11 @@ diff --git a/third_party/libwebrtc/modules/rtp_rtcp/source/rtp_sender_audio.cc b } constexpr char kIncludeCaptureClockOffset[] = -diff --git a/third_party/libwebrtc/modules/video_coding/codecs/vp8/default_temporal_layers.cc b/third_party/libwebrtc/modules/video_coding/codecs/vp8/default_temporal_layers.cc ---- a/third_party/libwebrtc/modules/video_coding/codecs/vp8/default_temporal_layers.cc -+++ b/third_party/libwebrtc/modules/video_coding/codecs/vp8/default_temporal_layers.cc -@@ -110,6 +110,7 @@ size_t BufferToIndex(Vp8BufferReference +Index: firefox-115.0/third_party/libwebrtc/modules/video_coding/codecs/vp8/default_temporal_layers.cc +=================================================================== +--- firefox-115.0.orig/third_party/libwebrtc/modules/video_coding/codecs/vp8/default_temporal_layers.cc ++++ firefox-115.0/third_party/libwebrtc/modules/video_coding/codecs/vp8/default_temporal_layers.cc +@@ -110,6 +110,7 @@ size_t BufferToIndex(Vp8BufferReference case Vp8FrameConfig::Vp8BufferReference::kNone: RTC_CHECK_NOTREACHED(); } @@ -544,9 +578,10 @@ diff --git a/third_party/libwebrtc/modules/video_coding/codecs/vp8/default_tempo } } // namespace -diff --git a/third_party/libwebrtc/modules/video_coding/codecs/vp8/temporal_layers_checker.cc b/third_party/libwebrtc/modules/video_coding/codecs/vp8/temporal_layers_checker.cc ---- a/third_party/libwebrtc/modules/video_coding/codecs/vp8/temporal_layers_checker.cc -+++ b/third_party/libwebrtc/modules/video_coding/codecs/vp8/temporal_layers_checker.cc +Index: firefox-115.0/third_party/libwebrtc/modules/video_coding/codecs/vp8/temporal_layers_checker.cc +=================================================================== +--- firefox-115.0.orig/third_party/libwebrtc/modules/video_coding/codecs/vp8/temporal_layers_checker.cc ++++ firefox-115.0/third_party/libwebrtc/modules/video_coding/codecs/vp8/temporal_layers_checker.cc @@ -30,6 +30,7 @@ TemporalLayersChecker::CreateTemporalLay return std::make_unique(num_temporal_layers); } @@ -555,9 +590,10 @@ diff --git a/third_party/libwebrtc/modules/video_coding/codecs/vp8/temporal_laye } TemporalLayersChecker::TemporalLayersChecker(int num_temporal_layers) -diff --git a/third_party/libwebrtc/video/adaptation/video_stream_encoder_resource_manager.cc b/third_party/libwebrtc/video/adaptation/video_stream_encoder_resource_manager.cc ---- a/third_party/libwebrtc/video/adaptation/video_stream_encoder_resource_manager.cc -+++ b/third_party/libwebrtc/video/adaptation/video_stream_encoder_resource_manager.cc +Index: firefox-115.0/third_party/libwebrtc/video/adaptation/video_stream_encoder_resource_manager.cc +=================================================================== +--- firefox-115.0.orig/third_party/libwebrtc/video/adaptation/video_stream_encoder_resource_manager.cc ++++ firefox-115.0/third_party/libwebrtc/video/adaptation/video_stream_encoder_resource_manager.cc @@ -63,6 +63,7 @@ std::string ToString(VideoAdaptationReas return "cpu"; } diff --git a/mozilla.keyring b/mozilla.keyring index 75884929..683eab9f 100644 --- a/mozilla.keyring +++ b/mozilla.keyring @@ -12,8 +12,8 @@ pub rsa4096 2015-07-17 [SC] uid [ full ] Mozilla Software Releases sub rsa4096 2015-07-17 [S] [expired: 2017-07-16] sub rsa4096 2017-06-22 [S] [expired: 2019-06-22] -sub rsa4096 2019-05-30 [S] [expired: 2021-05-29] -sub rsa4096 2021-05-17 [S] [expired: 2023-05-17] +sub rsa4096 2019-05-30 [S] [expires: 2021-05-29] +sub rsa4096 2021-05-17 [S] [expires: 2023-05-17] sub rsa4096 2023-05-05 [S] [expires: 2025-05-04] -----BEGIN PGP PUBLIC KEY BLOCK----- diff --git a/mozilla.sh.in b/mozilla.sh.in index e90f5eb5..9950473c 100644 --- a/mozilla.sh.in +++ b/mozilla.sh.in @@ -100,7 +100,7 @@ if [ "$WAYLAND_DISPLAY" ]; then fi # xinput2 (boo#1173320) -. /etc/os-release +source /etc/os-release if [ "$ID" = "opensuse-tumbleweed" ]; then export MOZ_USE_XINPUT2=1 fi @@ -151,7 +151,7 @@ if [ $MOZILLA_DOWN -ne 0 ]; then # Try with a local variant first, then without a local variant SHORTMOZLOCALE=`echo $CURRENT_LOCALE | sed "s|_\([^.]*\).*||g" | sed "s|\..*||g"` MOZLOCALE=`echo $CURRENT_LOCALE | sed "s|_\([^.]*\).*|-\1|g" | sed "s|\..*||g"` - create_langpack_link() { + function create_langpack_link() { local language=$* local langpack=langpack-${language}@firefox.mozilla.org.xpi if [ -f $MOZ_LANGPACKS_DIR/$langpack ]; then diff --git a/one_swizzle_to_rule_them_all.patch b/one_swizzle_to_rule_them_all.patch index 7ccbec77..23e4c18f 100644 --- a/one_swizzle_to_rule_them_all.patch +++ b/one_swizzle_to_rule_them_all.patch @@ -6,10 +6,10 @@ # Parent 81832d035e101471dcf52dd91de287268add7a91 imported patch one_swizzle_to_rule_them_all.patch -Index: firefox-102.0/gfx/webrender_bindings/RenderCompositorSWGL.cpp +Index: firefox-115.0/gfx/webrender_bindings/RenderCompositorSWGL.cpp =================================================================== ---- firefox-102.0.orig/gfx/webrender_bindings/RenderCompositorSWGL.cpp -+++ firefox-102.0/gfx/webrender_bindings/RenderCompositorSWGL.cpp +--- firefox-115.0.orig/gfx/webrender_bindings/RenderCompositorSWGL.cpp ++++ firefox-115.0/gfx/webrender_bindings/RenderCompositorSWGL.cpp @@ -7,6 +7,7 @@ #include "RenderCompositorSWGL.h" @@ -18,7 +18,7 @@ Index: firefox-102.0/gfx/webrender_bindings/RenderCompositorSWGL.cpp #include "mozilla/widget/CompositorWidget.h" #ifdef MOZ_WIDGET_GTK -@@ -235,6 +237,13 @@ void RenderCompositorSWGL::CommitMappedB +@@ -242,6 +243,13 @@ void RenderCompositorSWGL::CommitMappedB } mDT->Flush(); diff --git a/tar_stamps b/tar_stamps index 3457b159..d2ffe082 100644 --- a/tar_stamps +++ b/tar_stamps @@ -1,10 +1,10 @@ PRODUCT="firefox" CHANNEL="release" -VERSION="114.0.2" +VERSION="115.0" VERSION_SUFFIX="" -PREV_VERSION="114.0.1" +PREV_VERSION="114.0.2" PREV_VERSION_SUFFIX="" #SKIP_LOCALES="" # Uncomment to skip l10n and compare-locales-generation RELEASE_REPO="https://hg.mozilla.org/releases/mozilla-release" -RELEASE_TAG="1378542b9001e9aeb6a5ac6f5a020886dcfdaa29" -RELEASE_TIMESTAMP="20230619081400" +RELEASE_TAG="1c2603279ac3bf5c442bf416ee7bf6d7d2c20d31" +RELEASE_TIMESTAMP="20230629134642"