--- a/MozillaFirefox/MozillaFirefox.changes Mon Jun 05 21:17:55 2023 +0200
+++ b/MozillaFirefox/MozillaFirefox.changes Sat Jul 29 14:34:45 2023 +0200
@@ -1,4 +1,239 @@
-------------------------------------------------------------------
+Fri Jul 28 20:56:00 UTC 2023 - Andreas Stieger <andreas.stieger@gmx.de>
+
+- Mozilla Firefox 115.0.3
+ * fixes for other platforms
+- remove bashisms from firefox startup script (boo#1213657)
+
+-------------------------------------------------------------------
+Thu Jul 13 13:30:20 UTC 2023 - Wolfgang Rosenauer <wr@rosenauer.org>
+
+- Mozilla Firefox 115.0.2
+ * Fixed a bug with displaying a caret in the text editor on some websites
+ (bmo#1840804)
+ * Fixed a bug with broken audio rendering on some websites (bmo#1841982)
+ * Fixed a bug with patternTransform translate using the wrong units
+ (bmo#1840746)
+ MFSA 2023-26 (bsc#1213230)
+ * CVE-2023-3600 (bmo#1839703)
+ Use-after-free in workers
+
+-------------------------------------------------------------------
+Fri Jul 7 19:39:30 UTC 2023 - Andreas Stieger <Andreas.Stieger@gmx.de>
+
+- Mozilla Firefox 115.0.1
+ * fixes for other platforms
+
+-------------------------------------------------------------------
+Sun Jul 2 16:00:53 UTC 2023 - Wolfgang Rosenauer <wr@rosenauer.org>
+
+- 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 <Andreas.Stieger@gmx.de>
+
+- Mozilla Firefox 114.0.2:
+ * Several crash fixes
+ * Web Extensions: Fixes for 114 regressions in Native Messaging
+ support
+
+-------------------------------------------------------------------
+Tue Jun 20 06:30:02 UTC 2023 - Wolfgang Rosenauer <wr@rosenauer.org>
+
+- do not enable LTO as it caused crashes now (boo#1212101)
+
+-------------------------------------------------------------------
+Sat Jun 10 14:48:07 UTC 2023 - Andreas Stieger <Andreas.Stieger@gmx.de>
+
+- Mozilla Firefox 114.0.1
+ * Fix a startup crash (bmo#1837201, boo#1212101)
+
+-------------------------------------------------------------------
+Fri Jun 9 11:05:47 UTC 2023 - Martin Sirringhaus <martin.sirringhaus@suse.com>
+
+- Only install vaapitest for wayland-enabled builds, where it gets built
+- Rebase mozilla-silence-no-return-type.patch
+- Rebase s390x-patches, and remove obsolete patches:
+ mozilla-bmo1005535.patch mozilla-s390x-skia-gradient.patch
+
+-------------------------------------------------------------------
+Mon Jun 5 21:22:19 UTC 2023 - Wolfgang Rosenauer <wr@rosenauer.org>
+
+- Mozilla Firefox 114.0
+ MFSA 2023-20 (bsc#1211922)
+ * CVE-2023-34414 (bmo#1695986)
+ Click-jacking certificate exceptions through rendering lag
+ * CVE-2023-34415 (bmo#1811999)
+ Site-isolation bypass on sites that allow open redirects to
+ data: urls
+ * CVE-2023-34416 (bmo#1752703, bmo#1818394, bmo#1826875,
+ bmo#1827340, bmo#1827655, bmo#1828065, bmo#1830190,
+ bmo#1830206, bmo#1830795, bmo#1833339)
+ Memory safety bugs fixed in Firefox 114 and Firefox ESR
+ 102.12
+ * CVE-2023-34417 (bmo#1746447, bmo#1820903, bmo#1832832)
+ Memory safety bugs fixed in Firefox 114
+ * New: Added UI to manage the DNS over HTTPS exception list.
+ (bmo#1596847)
+ * New: Bookmarks can now be searched from the Bookmarks menu.
+ The Bookmarks menu is accessible by adding the *Bookmarks
+ menu* button to the toolbar. (bmo#1736937)
+ * New: Restrict searches to your local browsing history by
+ selecting *Search history* from the History, Library or
+ Application menu buttons. (bmo#1736939)
+ * New: Mac users can now capture video from their cameras in
+ all supported native resolutions. This enables resolutions
+ higher than 1280x720. (bmo#1806604)
+ * New: It is now possible to reorder the extensions listed in
+ the extensions panel. (bmo#1805924)
+ * New: Users on macOS, Linux, and Windows 7 can now use FIDO2 /
+ WebAuthn authenticators over USB. Some advanced features,
+ such as fully passwordless logins, require a PIN to be set on
+ the authenticator. (bmo#1814487)
+ * New: Pocket Recommended content can now be seen in France,
+ Italy, and Spain. (bmo#None)
+ * Changed: DNS over HTTPS settings are now part of the
+ *Privacy & Security* section of the *Settings* page and allow
+ the user to choose from all the supported modes.
+ (bmo#1610741)
+ * HTML5: DOM: Added support for ES Modules on DedicatedWorker
+ and SharedWorker
+ * HTML5: WebTransport is now enabled by default and will be
+ going to release with 114. As the original Explainer notes,
+ it enables multiple use-cases that are hard or impossible to
+ handle without it, especially for Gaming and live streaming.
+ It covers cases that are problematic for alternative
+ mechanisms, such as WebSockets.
+ Built on top of HTTP3 (HTTP2 support will be coming later).
+ The current implementation in Firefox is passing 505 out of
+ 565 Web-Platform Tests.
+ * HTML5: CSS: The `infinity` and `NaN` constants are now
+ supported inside the `calc()` function. (bmo#1830759)
+ * Developer: The *Copy as cURL* feature, available in the
+ Network panel, has been enhanced. It now supports the
+ -`-compressed` argument. (bmo#1776120)
+ * Developer: The Accessibility Inspector has been improved to
+ accurately recognize all the ARIA roles like `banner`,
+ `main`, `navigation`, and `contentinfo`, etc. This
+ enhancement is particularly beneficial for web developers
+ working with ARIA roles to improve web accessibility.
+ (bmo#1572512)
+ * Developer: Firefox now provides support for the CSS Cascading
+ Level 4 `supports()` syntax for `@import` rules. This allows
+ for the importation of other stylesheets based on support-
+ dependency. In addition, the Inspector panel now accurately
+ displays the conditions at the top of the imported rule.
+- requires NSS 3.89.1
+
+-------------------------------------------------------------------
Wed May 24 19:26:35 UTC 2023 - Andreas Stieger <Andreas.Stieger@gmx.de>
- Mozilla Firefox 113.0.2 (boo#1211696)
--- a/MozillaFirefox/MozillaFirefox.spec Mon Jun 05 21:17:55 2023 +0200
+++ b/MozillaFirefox/MozillaFirefox.spec Sat Jul 29 14:34:45 2023 +0200
@@ -28,9 +28,9 @@
# orig_suffix b3
# major 69
# mainver %%major.99
-%define major 113
-%define mainver %major.0.2
-%define orig_version 113.0.2
+%define major 115
+%define mainver %major.0.3
+%define orig_version 115.0.3
%define orig_suffix %{nil}
%define update_channel release
%define branding 1
@@ -50,13 +50,17 @@
# SLE-12 doesn't have this macro
%{!?_rpmmacrodir: %global _rpmmacrodir %{_rpmconfigdir}/macros.d}
+# No i586 on SLE-12, as the rpmlints are broken and can't handle the big rpms resulting from this build.
+%if 0%{?sle_version} >= 120000 && 0%{?sle_version} < 150000
+ExclusiveArch: aarch64 ppc64le x86_64 s390x
+%else
# Firefox only supports i686
%ifarch %ix86
ExclusiveArch: i586 i686
BuildArch: i686
%{expand:%%global optflags %(echo "%optflags"|sed -e s/i586/i686/) -march=i686 -mtune=generic -msse2}
%endif
-%{expand:%%global optflags %(echo "%optflags"|sed -e s/-Werror=return-type//) }
+%endif
%{expand:%%global optflags %(echo "%optflags"|sed -e s/-flto=auto//) }
# general build definitions
@@ -94,23 +98,13 @@
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
-%if 0%{?suse_version} < 1550 && 0%{?sle_version} < 150300
-BuildRequires: cargo >= 1.65
-BuildRequires: rust >= 1.65
-%else
-# Newer sle/leap/tw use parallel versioned rust releases which have
-# a different method for provides that we can use to request a
-# specific version
-# minimal requirement:
-BuildRequires: rust+cargo >= 1.65
-# actually used upstream:
-BuildRequires: cargo1.67
-BuildRequires: rust1.67
-%endif
+BuildRequires: cargo1.69
+BuildRequires: rust1.69
%if 0%{useccache} != 0
BuildRequires: ccache
%endif
@@ -120,12 +114,15 @@
BuildRequires: libproxy-devel
BuildRequires: makeinfo
BuildRequires: mozilla-nspr-devel >= 4.35
-BuildRequires: mozilla-nss-devel >= 3.89
+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
-BuildRequires: python36
+BuildRequires: python39
+BuildRequires: python39-curses
+BuildRequires: python39-devel
%else
%if 0%{?sle_version} >= 150000 && 0%{?sle_version} <= 150500
BuildRequires: python39
@@ -219,20 +216,20 @@
Patch6: mozilla-s390-context.patch
Patch7: mozilla-pgo.patch
Patch8: mozilla-reduce-rust-debuginfo.patch
-Patch9: mozilla-bmo1005535.patch
Patch10: mozilla-bmo1504834-part1.patch
Patch11: mozilla-bmo1504834-part3.patch
Patch12: mozilla-bmo1512162.patch
Patch13: mozilla-fix-top-level-asm.patch
Patch14: mozilla-bmo849632.patch
Patch15: mozilla-bmo998749.patch
-Patch16: mozilla-s390x-skia-gradient.patch
Patch17: mozilla-libavcodec58_91.patch
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
@@ -345,19 +342,20 @@
TIME="\"$(date -d "${modified}" "+%%R")\""
find . -regex ".*\.c\|.*\.cpp\|.*\.h" -exec sed -i "s/__DATE__/${DATE}/g;s/__TIME__/${TIME}/g" {} +
-# SLE-12 provides python36, but that package does not provide a python3 binary
+# SLE-12 provides python39, but that package does not provide a python3 binary
%if 0%{?sle_version} >= 120000 && 0%{?sle_version} < 150000
-sed -i "s/python3/python36/g" configure.in
-sed -i "s/python3/python36/g" mach
-export PYTHON3=/usr/bin/python36
+#sed -i "s/python3/python3.9/g" configure.in
+sed -i "s|/usr/bin/env python3|/usr/bin/env python3.9|" mach
+sed -i "s|potential_python_binary = f\"python3.{i}\"|potential_python_binary = f\"python3.9.{i}\"|" mach
+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
@@ -378,7 +376,8 @@
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 CC=gcc-12
+export CXX=g++-12
%else
%if 0%{?clang_build} == 0
export CC=gcc
@@ -397,7 +396,7 @@
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
@@ -494,7 +493,7 @@
%ifarch x86_64
# LTO needs newer toolchain stack only (at least GCC 8.2.1 (r268506)
%if 0%{?suse_version} > 1500
-ac_add_options --enable-lto
+#ac_add_options --enable-lto
%if 0%{?do_profiling}
ac_add_options MOZ_PGO=1
%endif
@@ -726,6 +725,10 @@
%{progdir}/application.ini
%{progdir}/dependentlibs.list
%{progdir}/*.so
+%{progdir}/glxtest
+%if 0%{wayland_supported}
+%{progdir}/vaapitest
+%endif
%{progdir}/omni.ja
%{progdir}/fonts/
%{progdir}/pingsender
--- a/MozillaFirefox/firefox-appdata.xml Mon Jun 05 21:17:55 2023 +0200
+++ b/MozillaFirefox/firefox-appdata.xml Sat Jul 29 14:34:45 2023 +0200
@@ -10,7 +10,7 @@
<name>Firefox Web Browser</name>
<project_license>MPL-2.0</project_license>
<summary>Mozilla Firefox Web Browser</summary>
- <url type="homepage">http://www.mozilla.org/</url>
+ <url type="homepage">https://www.mozilla.org/</url>
<description>
<p>Mozilla Firefox is a standalone web browser, designed for privacy, security, standards
compliance and performance. Its functionality can be enhanced via a plethora of extensions.</p>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/MozillaFirefox/mozilla-bmo1775202.patch Sat Jul 29 14:34:45 2023 +0200
@@ -0,0 +1,1 @@
+../mozilla-bmo1775202.patch
\ No newline at end of file
--- a/MozillaFirefox/mozilla-buildfixes.patch Mon Jun 05 21:17:55 2023 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-../mozilla-buildfixes.patch
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/MozillaFirefox/mozilla-partial-revert-1768632.patch Sat Jul 29 14:34:45 2023 +0200
@@ -0,0 +1,1 @@
+../mozilla-partial-revert-1768632.patch
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/MozillaFirefox/mozilla-rust-disable-future-incompat.patch Sat Jul 29 14:34:45 2023 +0200
@@ -0,0 +1,1 @@
+../mozilla-rust-disable-future-incompat.patch
\ No newline at end of file
--- a/MozillaFirefox/tar_stamps Mon Jun 05 21:17:55 2023 +0200
+++ b/MozillaFirefox/tar_stamps Sat Jul 29 14:34:45 2023 +0200
@@ -1,10 +1,10 @@
PRODUCT="firefox"
CHANNEL="release"
-VERSION="113.0.2"
+VERSION="115.0.3"
VERSION_SUFFIX=""
-PREV_VERSION="113.0.1"
+PREV_VERSION="115.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="f33c60c4ff99d5beed15c73b80250287090e2861"
-RELEASE_TIMESTAMP="20230522134052"
+RELEASE_TAG="326212e7271a9c9f0776153095cf48d7153260aa"
+RELEASE_TIMESTAMP="20230726201356"
--- a/firefox-branded-icons.patch Mon Jun 05 21:17:55 2023 +0200
+++ b/firefox-branded-icons.patch Sat Jul 29 14:34:45 2023 +0200
@@ -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 @@
'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 @@
#endif
@RESPATH@/browser/features/*
- ; [DevTools Startup Files]
- @RESPATH@/browser/chrome/devtools-startup@JAREXT@
- @RESPATH@/browser/chrome/devtools-startup.manifest
-
- ; DevTools
--- a/firefox-kde.patch Mon Jun 05 21:17:55 2023 +0200
+++ b/firefox-kde.patch Sat Jul 29 14:34:45 2023 +0200
@@ -11,15 +11,11 @@
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 @@
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 @@
} 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 @@
]
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 @@
+ 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 @@
+};
+
+#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 @@
+ 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
--- a/mozilla-aarch64-startup-crash.patch Mon Jun 05 21:17:55 2023 +0200
+++ b/mozilla-aarch64-startup-crash.patch Sat Jul 29 14:34:45 2023 +0200
@@ -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 @@
return NS_OK;
}
- NS_IMETHODIMP
- nsIOService::NewChannelFromURIWithProxyFlags(
- nsIURI* aURI, nsIURI* aProxyURI, uint32_t aProxyFlags,
- nsINode* aLoadingNode, nsIPrincipal* aLoadingPrincipal,
- nsIPrincipal* aTriggeringPrincipal, uint32_t aSecurityFlags,
--- a/mozilla-bmo1504834-part1.patch Mon Jun 05 21:17:55 2023 +0200
+++ b/mozilla-bmo1504834-part1.patch Sat Jul 29 14:34:45 2023 +0200
@@ -1,43 +1,34 @@
# HG changeset patch
-# Parent 37d8d8fc1d9e42887a736102ff9cdab24d7a9aa8
+# Parent 9fcbd287056a40084b1e679f787bf683b291f323
Taken from https://bugzilla.mozilla.org/show_bug.cgi?id=1504834
diff --git a/gfx/2d/DrawTargetSkia.cpp b/gfx/2d/DrawTargetSkia.cpp
--- a/gfx/2d/DrawTargetSkia.cpp
+++ b/gfx/2d/DrawTargetSkia.cpp
-@@ -147,18 +147,17 @@ static IntRect CalculateSurfaceBounds(co
- Rect sampledBounds = inverse.TransformBounds(*aBounds);
- if (!sampledBounds.ToIntRect(&bounds)) {
- return surfaceBounds;
- }
-
- return surfaceBounds.Intersect(bounds);
+@@ -156,7 +156,8 @@ static IntRect CalculateSurfaceBounds(co
}
--static const int kARGBAlphaOffset =
+ static const int kARGBAlphaOffset =
- SurfaceFormat::A8R8G8B8_UINT32 == SurfaceFormat::B8G8R8A8 ? 3 : 0;
-+static const int kARGBAlphaOffset = 0; // Skia is always BGRA SurfaceFormat::A8R8G8B8_UINT32 == SurfaceFormat::B8G8R8A8 ? 3 : 0;
++ 0; // Skia is always BGRA SurfaceFormat::A8R8G8B8_UINT32 ==
++ // SurfaceFormat::B8G8R8A8 ? 3 : 0;
static bool VerifyRGBXFormat(uint8_t* aData, const IntSize& aSize,
const int32_t aStride, SurfaceFormat aFormat) {
- if (aFormat != SurfaceFormat::B8G8R8X8 || aSize.IsEmpty()) {
- return true;
- }
- // We should've initialized the data to be opaque already
- // On debug builds, verify that this is actually true.
diff --git a/gfx/2d/Types.h b/gfx/2d/Types.h
--- a/gfx/2d/Types.h
+++ b/gfx/2d/Types.h
-@@ -87,25 +87,18 @@ enum class SurfaceFormat : int8_t {
- Depth,
-
+@@ -89,18 +89,11 @@ enum class SurfaceFormat : int8_t {
// This represents the unknown format.
UNKNOWN, // TODO: Replace uses with Maybe<SurfaceFormat>.
- // The following values are endian-independent synonyms. The _UINT32 suffix
- // indicates that the name reflects the layout when viewed as a uint32_t
- // value.
+-// The following values are endian-independent synonyms. The _UINT32 suffix
+-// indicates that the name reflects the layout when viewed as a uint32_t
+-// value.
-#if MOZ_LITTLE_ENDIAN()
++ // The following values are endian-independent synonyms. The _UINT32 suffix
++ // indicates that the name reflects the layout when viewed as a uint32_t
++ // value.
A8R8G8B8_UINT32 = B8G8R8A8, // 0xAARRGGBB
X8R8G8B8_UINT32 = B8G8R8X8, // 0x00RRGGBB
-#elif MOZ_BIG_ENDIAN()
@@ -49,20 +40,10 @@
// The following values are OS and endian-independent synonyms.
//
- // TODO(aosmond): When everything blocking bug 1581828 has been resolved, we
- // can make this use R8B8G8A8 and R8B8G8X8 for non-Windows platforms.
- OS_RGBA = A8R8G8B8_UINT32,
- OS_RGBX = X8R8G8B8_UINT32
- };
-diff --git a/gfx/skia/skia/third_party/skcms/skcms.cc b/gfx/skia/skia/third_party/skcms/skcms.cc
---- a/gfx/skia/skia/third_party/skcms/skcms.cc
-+++ b/gfx/skia/skia/third_party/skcms/skcms.cc
-@@ -25,16 +25,18 @@
- // it'd be a lot slower. But we want all those headers included so we
- // can use their features after runtime checks later.
- #include <smmintrin.h>
- #include <avxintrin.h>
- #include <avx2intrin.h>
+diff --git a/gfx/skia/skia/modules/skcms/skcms.cc b/gfx/skia/skia/modules/skcms/skcms.cc
+--- a/gfx/skia/skia/modules/skcms/skcms.cc
++++ b/gfx/skia/skia/modules/skcms/skcms.cc
+@@ -30,6 +30,8 @@
#include <avx512fintrin.h>
#include <avx512dqintrin.h>
#endif
@@ -70,30 +51,21 @@
+ #define SKCMS_PORTABLE
#endif
- // sizeof(x) will return size_t, which is 32-bit on some machines and 64-bit on others.
- // We have better testing on 64-bit machines, so force 32-bit machines to behave like 64-bit.
- //
- // Please do not use sizeof() directly, and size_t only when required.
- // (We have no way of enforcing these requests...)
- #define SAFE_SIZEOF(x) ((uint64_t)sizeof(x))
-@@ -275,30 +277,38 @@ enum {
- skcms_Signature_sf32 = 0x73663332,
- // XYZ is also a PCS signature, so it's defined in skcms.h
- // skcms_Signature_XYZ = 0x58595A20,
- };
-
+ static bool runtime_cpu_detection = true;
+@@ -324,20 +326,28 @@ enum {
static uint16_t read_big_u16(const uint8_t* ptr) {
uint16_t be;
memcpy(&be, ptr, sizeof(be));
-#if defined(_MSC_VER)
+- return _byteswap_ushort(be);
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+ return be;
-+#else
+ #else
+- return __builtin_bswap16(be);
+ #if defined(_MSC_VER)
- return _byteswap_ushort(be);
--#else
++ return _byteswap_ushort(be);
+ #else
- return __builtin_bswap16(be);
++ return __builtin_bswap16(be);
+ #endif
#endif
}
@@ -102,20 +74,16 @@
uint32_t be;
memcpy(&be, ptr, sizeof(be));
-#if defined(_MSC_VER)
+- return _byteswap_ulong(be);
+#if __BYTE_ORDER == __ORDER_BIG_ENDIAN__
+ return be;
-+#else
+ #else
+- return __builtin_bswap32(be);
+ #if defined(_MSC_VER)
- return _byteswap_ulong(be);
--#else
++ return _byteswap_ulong(be);
+ #else
- return __builtin_bswap32(be);
++ return __builtin_bswap32(be);
+ #endif
#endif
}
- static int32_t read_big_i32(const uint8_t* ptr) {
- return (int32_t)read_big_u32(ptr);
- }
-
- static float read_big_fixed(const uint8_t* ptr) {
--- a/mozilla-bmo1504834-part3.patch Mon Jun 05 21:17:55 2023 +0200
+++ b/mozilla-bmo1504834-part3.patch Sat Jul 29 14:34:45 2023 +0200
@@ -1,64 +1,17 @@
# HG changeset patch
-# Parent d1d66f7e4d0e7fd45e91e4fcee07555e72046d48
+# Parent 09cd4ac2cc607e85aa572425b824fbab386af607
For FF68, AntiAliasing of XULTexts seem to be broken on big endian (s390x). Text and icons of the sandwich-menu to the
right of the address bar, as well as plugin-windows appears transparant, which usually means unreadable (white on white).
-diff --git a/gfx/skia/skia/include/private/SkNx.h b/gfx/skia/skia/include/private/SkNx.h
---- a/gfx/skia/skia/include/private/SkNx.h
-+++ b/gfx/skia/skia/include/private/SkNx.h
-@@ -233,17 +233,28 @@ struct SkNx<1,T> {
- AI SkNx operator<<(int bits) const { return fVal << bits; }
- AI SkNx operator>>(int bits) const { return fVal >> bits; }
-
- AI SkNx operator+(const SkNx& y) const { return fVal + y.fVal; }
- AI SkNx operator-(const SkNx& y) const { return fVal - y.fVal; }
- AI SkNx operator*(const SkNx& y) const { return fVal * y.fVal; }
- AI SkNx operator/(const SkNx& y) const { return fVal / y.fVal; }
-
-+ // On Big endian the commented out variant doesn't work,
-+ // and honestly, I have no idea why it exists in the first place.
-+ // The reason its broken is, I think, that it defaults to the double-variant of ToBits()
-+ // which gets a 64-bit integer, and FromBits returns 32-bit,
-+ // cutting off the wrong half again.
-+ // Overall, I see no reason to have ToBits and FromBits at all (even for floats/doubles).
-+ // Still we are only "fixing" this for big endian and leave little endian alone (never touch a running system)
-+#ifdef SK_CPU_BENDIAN
-+ AI SkNx operator&(const SkNx& y) const { return fVal & y.fVal; }
-+#else
- AI SkNx operator&(const SkNx& y) const { return FromBits(ToBits(fVal) & ToBits(y.fVal)); }
-+#endif
- AI SkNx operator|(const SkNx& y) const { return FromBits(ToBits(fVal) | ToBits(y.fVal)); }
- AI SkNx operator^(const SkNx& y) const { return FromBits(ToBits(fVal) ^ ToBits(y.fVal)); }
-
- AI SkNx operator==(const SkNx& y) const { return FromBits(fVal == y.fVal ? ~0 : 0); }
- AI SkNx operator!=(const SkNx& y) const { return FromBits(fVal != y.fVal ? ~0 : 0); }
- AI SkNx operator<=(const SkNx& y) const { return FromBits(fVal <= y.fVal ? ~0 : 0); }
- AI SkNx operator>=(const SkNx& y) const { return FromBits(fVal >= y.fVal ? ~0 : 0); }
- AI SkNx operator< (const SkNx& y) const { return FromBits(fVal < y.fVal ? ~0 : 0); }
diff --git a/gfx/skia/skia/src/opts/SkBlitMask_opts.h b/gfx/skia/skia/src/opts/SkBlitMask_opts.h
--- a/gfx/skia/skia/src/opts/SkBlitMask_opts.h
+++ b/gfx/skia/skia/src/opts/SkBlitMask_opts.h
-@@ -198,17 +198,23 @@ namespace SK_OPTS_NS {
- const SkAlpha* mask, size_t maskRB,
- int w, int h) {
- auto fn = [](const Sk4px& d, const Sk4px& aa) {
- // = (s + d(1-sa))aa + d(1-aa)
- // = s*aa + d(1-sa*aa)
+@@ -210,6 +210,8 @@ namespace SK_OPTS_NS {
// ~~~>
// a = 1*aa + d(1-1*aa) = aa + d(1-aa)
// c = 0*aa + d(1-1*aa) = d(1-aa)
-+
-+ // For big endian we have to swap the alpha-mask from 0,0,0,255 to 255,0,0,0
-+#ifdef SK_CPU_BENDIAN
-+ return Sk4px(Sk16b(aa) & Sk16b(255,0,0,0, 255,0,0,0, 255,0,0,0, 255,0,0,0))
-+#else
- return Sk4px(Sk16b(aa) & Sk16b(0,0,0,255, 0,0,0,255, 0,0,0,255, 0,0,0,255))
-+#endif
++ // TODO: Check this for endian-issues!
++ // Do we need to switch 255 to the front for all of those tuples?
+ return (aa & Sk4px(skvx::byte16{0,0,0,255, 0,0,0,255, 0,0,0,255, 0,0,0,255}))
+ d.approxMulDiv255(aa.inv());
};
- while (h --> 0) {
- Sk4px::MapDstAlpha(w, dst, mask, fn);
- dst += dstRB / sizeof(*dst);
- mask += maskRB / sizeof(*mask);
- }
- }
--- a/mozilla-bmo1512162.patch Mon Jun 05 21:17:55 2023 +0200
+++ b/mozilla-bmo1512162.patch Sat Jul 29 14:34:45 2023 +0200
@@ -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 @@
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 @@
// Trace implementation so we can put our CallMethodHelper in a Rooted<T>.
void trace(JSTracer* aTrc);
- };
-
- // static
- bool XPCWrappedNative::CallMethod(XPCCallContext& ccx,
- CallMode mode /*= CALL_METHOD */) {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mozilla-bmo1775202.patch Sat Jul 29 14:34:45 2023 +0200
@@ -0,0 +1,26 @@
+From: Mike Hommey <mh@glandium.org>
+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 += [
--- a/mozilla-bmo849632.patch Mon Jun 05 21:17:55 2023 +0200
+++ b/mozilla-bmo849632.patch Sat Jul 29 14:34:45 2023 +0200
@@ -6,15 +6,11 @@
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 @@
AFTER_GL_CALL;
mHeavyGLCallsSinceLastFlush = true;
}
-
- void fReadPixels(GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type, GLvoid* pixels);
-
- public:
--- a/mozilla-buildfixes.patch Mon Jun 05 21:17:55 2023 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-# HG changeset patch
-# User Wolfgang Rosenauer <wr@rosenauer.org>
-# 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 <typename TValue>
- }
- 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<const void*>(ptr), sizeof(tmp));
- return _mm_cvtsi64_si128(tmp);
--- a/mozilla-fix-aarch64-libopus.patch Mon Jun 05 21:17:55 2023 +0200
+++ b/mozilla-fix-aarch64-libopus.patch Sat Jul 29 14:34:45 2023 +0200
@@ -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 @@
#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))
-
--- a/mozilla-kde.patch Mon Jun 05 21:17:55 2023 +0200
+++ b/mozilla-kde.patch Sat Jul 29 14:34:45 2023 +0200
@@ -3,22 +3,18 @@
# Date 1559294891 -7200
# Fri May 31 11:28:11 2019 +0200
# Node ID c2aa7198fb925e7fde96abf65b6f68b9b755f112
-# Parent 4f8492f0f4bfa17f5b4523a1cdda15a45e3d74d3
+# Parent 0086fcc0d5c86a31cbac0a261ed7b526dd2df2e8
Description: Add KDE integration to Firefox (toolkit parts)
Author: Wolfgang Rosenauer <wolfgang@rosenauer.org>
Author: Lubos Lunak <lunak@suse.com>
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 @@
#ifdef DEBUG
# include <map>
- #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 @@
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<nsIFile> 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 @@
}
}
- #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 @@
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 @@
}
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 @@
]
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 @@
+
with Files("**"):
BUG_COMPONENT = ("Toolkit", "Downloads API")
-diff --git a/toolkit/mozapps/downloads/HelperAppDlg.jsm b/toolkit/mozapps/downloads/HelperAppDlg.jsm
---- a/toolkit/mozapps/downloads/HelperAppDlg.jsm
-+++ b/toolkit/mozapps/downloads/HelperAppDlg.jsm
-@@ -1250,36 +1250,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 @@
} 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 @@
using namespace mozilla;
- class nsUnixSystemProxySettings final : public nsISystemProxySettings {
- public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSISYSTEMPROXYSETTINGS
-
-@@ -34,16 +36,18 @@ class nsUnixSystemProxySettings final :
- nsCOMPtr<nsIGSettingsCollection> mProxySettings;
- nsInterfaceHashtable<nsCStringHashKey, nsIGSettingsCollection>
- 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 @@
};
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 @@
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<nsCString> command;
-+ command.AppendElement( "GETPROXY"_ns );
-+ command.AppendElement( url );
++ command.AppendElement("GETPROXY"_ns);
++ command.AppendElement(url);
+ nsTArray<nsCString> 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<nsUnixSystemProxySettings>();
result->Init();
- return result.forget().downcast<nsISupports>();
- }
-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 @@
"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 @@
+// 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<nsCString> command;
-+ command.AppendElement( "CHECK"_ns );
-+ command.AppendElement( "KMOZILLAHELPER_VERSION"_ns );
-+ bool kde = nsKDEUtils::command( command );
++static bool getKdeSupport() {
++ nsTArray<nsCString> 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<nsCString>* output;
++ GMainLoop* loop;
++ bool success;
++};
+
-+bool nsKDEUtils::kdeSupport()
-+ {
-+ static bool support = kdeSession() && getKdeSupport();
-+ return support && helperRunning;
++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<nsCString>& command,
++ nsTArray<nsCString>* output) {
++ return self()->internalCommand(command, NULL, false, output);
++}
++
++bool nsKDEUtils::command(nsIArray* command, nsIArray** output) {
++ nsTArray<nsCString> in;
++ PRUint32 length;
++ command->GetLength(&length);
++ for (PRUint32 i = 0; i < length; i++) {
++ nsCOMPtr<nsISupportsCString> str = do_QueryElementAt(command, i);
++ if (str) {
++ nsAutoCString s;
++ str->GetData(s);
++ in.AppendElement(s);
+ }
++ }
+
-+struct nsKDECommandData
-+ {
-+ FILE* file;
-+ nsTArray<nsCString>* output;
-+ GMainLoop* loop;
-+ bool success;
-+ };
++ nsTArray<nsCString> out;
++ bool ret = self()->internalCommand(in, NULL, false, &out);
++
++ if (!output) return ret;
++
++ nsCOMPtr<nsIMutableArray> result = do_CreateInstance(NS_ARRAY_CONTRACTID);
++ if (!result) return false;
++
++ for (PRUint32 i = 0; i < out.Length(); i++) {
++ nsCOMPtr<nsISupportsCString> 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<nsCString>& command,
++ GtkWindow* parent,
++ nsTArray<nsCString>* output) {
++ return self()->internalCommand(command, parent, true, output);
++}
+
-+static gboolean kdeReadFunc( GIOChannel*, GIOCondition, gpointer data )
++bool nsKDEUtils::internalCommand(const nsTArray<nsCString>& command,
++ GtkWindow* parent, bool blockUi,
++ nsTArray<nsCString>* 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
+ {
-+ 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;
++ 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);
++#else
++ execv(KMOZILLAHELPER, args);
++#endif
++ _exit(1); // failed
+ }
-+
-+bool nsKDEUtils::command( const nsTArray<nsCString>& command, nsTArray<nsCString>* output )
-+ {
-+ return self()->internalCommand( command, NULL, false, output );
-+ }
-+
-+bool nsKDEUtils::command( nsIArray* command, nsIArray** output)
++ default: // parent
+ {
-+ nsTArray<nsCString> in;
-+ PRUint32 length;
-+ command->GetLength( &length );
-+ for ( PRUint32 i = 0; i < length; i++ )
-+ {
-+ nsCOMPtr<nsISupportsCString> str = do_QueryElementAt( command, i );
-+ if( str )
-+ {
-+ nsAutoCString s;
-+ str->GetData( s );
-+ in.AppendElement( s );
-+ }
-+ }
-+
-+ nsTArray<nsCString> out;
-+ bool ret = self()->internalCommand( in, NULL, false, &out );
-+
-+ if ( !output ) return ret;
-+
-+ nsCOMPtr<nsIMutableArray> result = do_CreateInstance( NS_ARRAY_CONTRACTID );
-+ if ( !result ) return false;
-+
-+ for ( PRUint32 i = 0; i < out.Length(); i++ )
-+ {
-+ nsCOMPtr<nsISupportsCString> 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<nsCString>& command, GtkWindow* parent, nsTArray<nsCString>* output )
-+ {
-+ return self()->internalCommand( command, parent, true, output );
-+ }
-+
-+bool nsKDEUtils::internalCommand( const nsTArray<nsCString>& command, GtkWindow* parent, bool blockUi,
-+ nsTArray<nsCString>* output )
-+ {
-+ if( !startHelper())
++ commandFile = fdopen(fdcommand[1], "w");
++ replyFile = fdopen(fdreply[0], "r");
++ close(fdcommand[0]);
++ close(fdreply[1]);
++ if (commandFile == NULL || replyFile == NULL) {
++ closeHelper();
+ 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;
++ }
++ // ok, helper ready, getKdeRunning() will check if it works
+ }
++ }
++ helperFailed = false;
++ helperRunning = true;
++ return true;
++}
++
++void nsKDEUtils::closeHelper() {
++ if (commandFile != NULL)
++ fclose(commandFile); // this will also make the helper quit
++ if (replyFile != NULL) fclose(replyFile);
++ helperRunning = false;
++}
+
-+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 );
++void nsKDEUtils::feedCommand(const nsTArray<nsCString>& 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
-+ execvp( KMOZILLAHELPER, args );
-+#else
-+ execv( KMOZILLAHELPER, args );
++ fprintf(stderr, "COMM: %s\n", line.get());
+#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;
-+ }
-+
-+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<nsCString>& 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());
-+#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 @@
+
+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<nsCString>& command, nsTArray<nsCString>* 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<nsCString>& command, GtkWindow* parent, nsTArray<nsCString>* 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<nsCString>& command,
++ nsTArray<nsCString>* 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<nsCString>& command,
++ GtkWindow* parent,
++ nsTArray<nsCString>* output = NULL);
+
-+ private:
-+ nsKDEUtils();
-+ ~nsKDEUtils();
-+ static nsKDEUtils* self();
-+ bool startHelper();
-+ void closeHelper();
-+ void feedCommand( const nsTArray<nsCString>& command );
-+ bool internalCommand( const nsTArray<nsCString>& command, GtkWindow* parent, bool isParent,
-+ nsTArray<nsCString>* output );
-+ FILE* commandFile;
-+ FILE* replyFile;
-+ };
++ private:
++ nsKDEUtils();
++ ~nsKDEUtils();
++ static nsKDEUtils* self();
++ bool startHelper();
++ void closeHelper();
++ void feedCommand(const nsTArray<nsCString>& command);
++ bool internalCommand(const nsTArray<nsCString>& command, GtkWindow* parent,
++ bool isParent, nsTArray<nsCString>* 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 @@
#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 @@
"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 @@
]
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 @@
+#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 */ nsresult
-+nsCommonRegistry::LoadURL(nsIURI *aURL)
-+{
-+ if( nsKDEUtils::kdeSupport())
-+ return nsKDERegistry::LoadURL( aURL );
-+ return nsGNOMERegistry::LoadURL( aURL );
++/* static */ bool nsCommonRegistry::HandlerExists(const char* aProtocolScheme) {
++ if (nsKDEUtils::kdeSupport())
++ return nsKDERegistry::HandlerExists(aProtocolScheme);
++ return nsGNOMERegistry::HandlerExists(aProtocolScheme);
+}
+
-+/* static */ void
-+nsCommonRegistry::GetAppDescForScheme(const nsACString& aScheme,
-+ nsAString& aDesc)
-+{
-+ if( nsKDEUtils::kdeSupport())
-+ return nsKDERegistry::GetAppDescForScheme( aScheme, aDesc );
-+ return nsGNOMERegistry::GetAppDescForScheme( aScheme, aDesc );
++/* static */ nsresult nsCommonRegistry::LoadURL(nsIURI* aURL) {
++ if (nsKDEUtils::kdeSupport()) return nsKDERegistry::LoadURL(aURL);
++ return nsGNOMERegistry::LoadURL(aURL);
+}
+
-+
-+/* static */ already_AddRefed<nsMIMEInfoBase>
-+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<nsMIMEInfoBase>
-+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<nsMIMEInfoBase> 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 @@
+
+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<nsMIMEInfoBase> GetFromExtension(const nsACString& aFileExt);
++ static already_AddRefed<nsMIMEInfoBase> GetFromExtension(
++ const nsACString& aFileExt);
+
-+ static already_AddRefed<nsMIMEInfoBase> GetFromType(const nsACString& aMIMEType);
++ static already_AddRefed<nsMIMEInfoBase> 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 @@
+#include "nsMIMEInfoUnix.h"
+#include "nsKDEUtils.h"
+
-+/* static */ bool
-+nsKDERegistry::HandlerExists(const char *aProtocolScheme)
-+{
-+ nsTArray<nsCString> command;
-+ command.AppendElement( "HANDLEREXISTS"_ns );
-+ command.AppendElement( nsAutoCString( aProtocolScheme ));
-+ return nsKDEUtils::command( command );
++/* static */ bool nsKDERegistry::HandlerExists(const char* aProtocolScheme) {
++ nsTArray<nsCString> command;
++ command.AppendElement("HANDLEREXISTS"_ns);
++ command.AppendElement(nsAutoCString(aProtocolScheme));
++ return nsKDEUtils::command(command);
+}
+
-+/* static */ nsresult
-+nsKDERegistry::LoadURL(nsIURI *aURL)
-+{
-+ nsTArray<nsCString> 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<nsCString> 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<nsCString> command;
-+ command.AppendElement( "GETAPPDESCFORSCHEME"_ns );
-+ command.AppendElement( aScheme );
-+ nsTArray<nsCString> output;
-+ if( nsKDEUtils::command( command, &output ) && output.Length() == 1 )
-+ CopyUTF8toUTF16( output[ 0 ], aDesc );
++/* static */ void nsKDERegistry::GetAppDescForScheme(const nsACString& aScheme,
++ nsAString& aDesc) {
++ nsTArray<nsCString> command;
++ command.AppendElement("GETAPPDESCFORSCHEME"_ns);
++ command.AppendElement(aScheme);
++ nsTArray<nsCString> output;
++ if (nsKDEUtils::command(command, &output) && output.Length() == 1)
++ CopyUTF8toUTF16(output[0], aDesc);
+}
+
-+
-+/* static */ already_AddRefed<nsMIMEInfoBase>
-+nsKDERegistry::GetFromExtension(const nsACString& aFileExt)
-+{
-+ NS_ASSERTION(aFileExt[0] != '.', "aFileExt shouldn't start with a dot");
-+ nsTArray<nsCString> command;
-+ command.AppendElement( "GETFROMEXTENSION"_ns );
-+ command.AppendElement( aFileExt );
-+ return GetFromHelper( command );
++/* static */ already_AddRefed<nsMIMEInfoBase> nsKDERegistry::GetFromExtension(
++ const nsACString& aFileExt) {
++ NS_ASSERTION(aFileExt[0] != '.', "aFileExt shouldn't start with a dot");
++ nsTArray<nsCString> command;
++ command.AppendElement("GETFROMEXTENSION"_ns);
++ command.AppendElement(aFileExt);
++ return GetFromHelper(command);
+}
+
-+/* static */ already_AddRefed<nsMIMEInfoBase>
-+nsKDERegistry::GetFromType(const nsACString& aMIMEType)
-+{
-+ nsTArray<nsCString> command;
-+ command.AppendElement( "GETFROMTYPE"_ns );
-+ command.AppendElement( aMIMEType );
-+ return GetFromHelper( command );
++/* static */ already_AddRefed<nsMIMEInfoBase> nsKDERegistry::GetFromType(
++ const nsACString& aMIMEType) {
++ nsTArray<nsCString> command;
++ command.AppendElement("GETFROMTYPE"_ns);
++ command.AppendElement(aMIMEType);
++ return GetFromHelper(command);
+}
+
-+/* static */ already_AddRefed<nsMIMEInfoBase>
-+nsKDERegistry::GetFromHelper(const nsTArray<nsCString>& command)
-+{
-+ nsTArray<nsCString> output;
-+ if( nsKDEUtils::command( command, &output ) && output.Length() == 3 )
-+ {
-+ nsCString mimetype = output[ 0 ];
-+ RefPtr<nsMIMEInfoUnix> 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<nsMIMEInfoBase> nsKDERegistry::GetFromHelper(
++ const nsTArray<nsCString>& command) {
++ nsTArray<nsCString> output;
++ if (nsKDEUtils::command(command, &output) && output.Length() == 3) {
++ nsCString mimetype = output[0];
++ RefPtr<nsMIMEInfoUnix> 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 @@
+#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<nsMIMEInfoBase> GetFromExtension(const nsACString& aFileExt);
++ static already_AddRefed<nsMIMEInfoBase> GetFromExtension(
++ const nsACString& aFileExt);
+
-+ static already_AddRefed<nsMIMEInfoBase> GetFromType(const nsACString& aMIMEType);
++ static already_AddRefed<nsMIMEInfoBase> GetFromType(
++ const nsACString& aMIMEType);
++
+ private:
-+ static already_AddRefed<nsMIMEInfoBase> GetFromHelper(const nsTArray<nsCString>& command);
-+
++ static already_AddRefed<nsMIMEInfoBase> GetFromHelper(
++ const nsTArray<nsCString>& 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 @@
# 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 @@
}
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 @@
}
}
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<nsCString> 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 @@
nsCOMPtr<nsIGIOService> 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<nsIIOService> 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 <sys/types.h>
- #include <sys/stat.h>
-
+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 @@
# 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 @@
#else
*aHandlerExists = false;
#endif
- } else {
- *aHandlerExists = false;
- nsCOMPtr<nsIHandlerService> 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 @@
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<nsMIMEInfoBase> 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<nsMIMEInfoBase> nsOSHel
#ifdef MOZ_WIDGET_GTK
LOG("Looking in GNOME registry\n");
RefPtr<nsMIMEInfoBase> gnomeInfo =
@@ -1220,17 +959,7 @@
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<nsMIMEInfoBase> nsOSHel
-
- // Now look up our extensions
- nsAutoString extensions, mime_types_description;
- LookUpExtensionsAndDescription(majorType, minorType, extensions,
- mime_types_description);
+@@ -1344,7 +1344,7 @@ already_AddRefed<nsMIMEInfoBase> nsOSHel
#ifdef MOZ_WIDGET_GTK
if (handler.IsEmpty()) {
@@ -1239,20 +968,11 @@
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
-@@ -142,16 +142,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 @@
"/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 <dlfcn.h>
#include <gtk/gtk.h>
@@ -1280,17 +992,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
-
- #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 @@
#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 @@
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 );
-+ }
++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);
++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));
++ if (mMode == modeOpen && mFilters.Length() == 1 &&
++ mFilters[0].EqualsLiteral("..apps"))
++ return kdeAppsDialog(aReturn);
+
-+ 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;
-+ }
-+ }
++ 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 @@
+ 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<nsCString> 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<nsCString> 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<nsIFile> 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<nsIFile> 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<nsIFile> file;
-+ GetFile(getter_AddRefs(file));
-+ if (file) {
-+ nsCOMPtr<nsIFile> dir;
-+ file->GetParent(getter_AddRefs(dir));
-+ nsCOMPtr<nsIFile> 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<nsIFile> 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);
++ nsTArray<nsCString> 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);
++ }
+
-+ nsCString title;
-+ title.Adopt(ToNewUTF8String(mTitle));
++ nsTArray<nsCString> 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<nsIFile> 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<nsIFile> 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<nsIFile> file;
++ GetFile(getter_AddRefs(file));
++ if (file) {
++ nsCOMPtr<nsIFile> dir;
++ file->GetParent(getter_AddRefs(dir));
++ nsCOMPtr<nsIFile> localDir(dir);
++ if (localDir) {
++ localDir.swap(mPrevDisplayDirectory);
++ }
++ }
++ if (mMode == nsIFilePicker::modeSave) {
++ nsCOMPtr<nsIFile> 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<nsCString> 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 );
-+ }
++NS_IMETHODIMP nsFilePicker::kdeAppsDialog(nsIFilePicker::ResultCode* aReturn) {
++ NS_ENSURE_ARG_POINTER(aReturn);
++
++ nsCString title;
++ title.Adopt(ToNewUTF8String(mTitle));
+
-+ nsTArray<nsCString> 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;
-+ }
++ nsTArray<nsCString> 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<nsCString> 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<nsCString> mFilters;
- nsTArray<nsCString> 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 @@
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 @@
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 @@
#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 @@
#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 @@
#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 @@
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 @@
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 @@
]
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 @@
#endif
#ifdef MOZ_WIDGET_COCOA
- # include <Carbon/Carbon.h>
- # 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<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
- if (!giovfs) {
+- return NS_ERROR_FAILURE;
+ url = mPath;
-+ if(nsKDEUtils::kdeSupport()) {
++ if (nsKDEUtils::kdeSupport()) {
+ nsTArray<nsCString> 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<nsCString> 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<nsIGIOService> 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
--- a/mozilla-nongnome-proxies.patch Mon Jun 05 21:17:55 2023 +0200
+++ b/mozilla-nongnome-proxies.patch Sat Jul 29 14:34:45 2023 +0200
@@ -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 @@
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 @@
+ 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);
--- a/mozilla-ntlm-full-path.patch Mon Jun 05 21:17:55 2023 +0200
+++ b/mozilla-ntlm-full-path.patch Sat Jul 29 14:34:45 2023 +0200
@@ -1,18 +1,13 @@
# HG changeset patch
# User Petr Cerny <pcerny@novell.com>
# 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<uint8_t*>(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 @@
"--helper-protocol",
"ntlmssp-client-1",
"--use-cached-creds",
- "--username",
- username,
- nullptr};
-
- bool isOK = SpawnIOChild(const_cast<char* const*>(args), &mChildPID,
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mozilla-partial-revert-1768632.patch Sat Jul 29 14:34:45 2023 +0200
@@ -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;
+
--- a/mozilla-pgo.patch Mon Jun 05 21:17:55 2023 +0200
+++ b/mozilla-pgo.patch Sat Jul 29 14:34:45 2023 +0200
@@ -1,16 +1,12 @@
# HG changeset patch
# User Wolfgang Rosenauer <wr@rosenauer.org>
-# 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 @@
+ 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 @@
# 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 @@
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 @@
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 @@
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 @@
# 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 @@
UniquePtr<Options> 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<PRThread*> watchdogThread =
- CreateSystemThread(RunWatchdog, options.release());
- MOZ_ASSERT(watchdogThread);
--- a/mozilla-reduce-rust-debuginfo.patch Mon Jun 05 21:17:55 2023 +0200
+++ b/mozilla-reduce-rust-debuginfo.patch Sat Jul 29 14:34:45 2023 +0200
@@ -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:
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mozilla-rust-disable-future-incompat.patch Sat Jul 29 14:34:45 2023 +0200
@@ -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"
--- a/mozilla-s390-context.patch Mon Jun 05 21:17:55 2023 +0200
+++ b/mozilla-s390-context.patch Sat Jul 29 14:34:45 2023 +0200
@@ -3,39 +3,24 @@
# Date 1558452408 -7200
# Tue May 21 17:26:48 2019 +0200
# Node ID 602e92722e765a3c238d3b96b26c0c8063b5eeb4
-# Parent 6d6ebdace8a9877fe17c1bd14b80307c258c864f
+# Parent 783ceb006fcdabe5ad23bd561362e721c7ed5f8c
[mq]: mozilla-s390-context.patch
diff --git a/js/src/wasm/WasmSignalHandlers.cpp b/js/src/wasm/WasmSignalHandlers.cpp
--- a/js/src/wasm/WasmSignalHandlers.cpp
+++ b/js/src/wasm/WasmSignalHandlers.cpp
-@@ -163,16 +163,20 @@ using mozilla::DebugOnly;
- # define R03_sig(p) ((p)->uc_mcontext.__gregs[3])
- # define RFP_sig(p) ((p)->uc_mcontext.__gregs[22])
- # endif
- # if defined(__sun__) && defined(__sparc__)
- # define PC_sig(p) ((p)->uc_mcontext.gregs[REG_PC])
+@@ -174,6 +174,10 @@ using mozilla::DebugOnly;
# define FP_sig(p) ((p)->uc_mcontext.gregs[REG_FPRS])
# define SP_sig(p) ((p)->uc_mcontext.gregs[REG_SP])
# endif
-+# if defined(__linux__) && defined(__s390x__)
-+# define GR_sig(p,x) ((p)->uc_mcontext.gregs[x])
-+# define PSWa_sig(p) ((p)->uc_mcontext.psw.addr)
-+# endif
++# if defined(__linux__) && defined(__s390x__)
++# define GR_sig(p, x) ((p)->uc_mcontext.gregs[x])
++# define PSWa_sig(p) ((p)->uc_mcontext.psw.addr)
++# endif
# elif defined(__NetBSD__)
# define EIP_sig(p) ((p)->uc_mcontext.__gregs[_REG_EIP])
# define EBP_sig(p) ((p)->uc_mcontext.__gregs[_REG_EBP])
- # define ESP_sig(p) ((p)->uc_mcontext.__gregs[_REG_ESP])
- # define RIP_sig(p) ((p)->uc_mcontext.__gregs[_REG_RIP])
- # define RSP_sig(p) ((p)->uc_mcontext.__gregs[_REG_RSP])
- # define RBP_sig(p) ((p)->uc_mcontext.__gregs[_REG_RBP])
- # define R11_sig(p) ((p)->uc_mcontext.__gregs[_REG_R11])
-@@ -405,16 +409,20 @@ struct macos_aarch64_context {
- # define PC_sig(p) R32_sig(p)
- # define SP_sig(p) R01_sig(p)
- # define FP_sig(p) R01_sig(p)
- # elif defined(__loongarch__)
- # define PC_sig(p) EPC_sig(p)
+@@ -416,6 +420,10 @@ struct macos_aarch64_context {
# define FP_sig(p) RFP_sig(p)
# define SP_sig(p) R03_sig(p)
# define LR_sig(p) RRA_sig(p)
@@ -43,11 +28,6 @@
+# define PC_sig(p) PSWa_sig(p)
+# define SP_sig(p) GR_sig(p, 15)
+# define FP_sig(p) GR_sig(p, 11)
- # endif
-
- static void SetContextPC(CONTEXT* context, uint8_t* pc) {
- # ifdef PC_sig
- *reinterpret_cast<uint8_t**>(&PC_sig(context)) = pc;
- # else
- MOZ_CRASH();
- # endif
+ # elif defined(__riscv)
+ # define PC_sig(p) RPC_sig(p)
+ # define FP_sig(p) RFP_sig(p)
--- a/mozilla-silence-no-return-type.patch Mon Jun 05 21:17:55 2023 +0200
+++ b/mozilla-silence-no-return-type.patch Sat Jul 29 14:34:45 2023 +0200
@@ -1,131 +1,47 @@
# HG changeset patch
-# Parent 2f49ea20acb4b0e890ae49f4833ac9d69b7e800c
+# Parent 5df550d4b5fc674268055e504f60392389eb9ea7
-diff --git a/Cargo.lock b/Cargo.lock
---- a/Cargo.lock
-+++ b/Cargo.lock
-@@ -2254,18 +2254,16 @@ name = "glsl-to-cxx"
- version = "0.1.0"
- dependencies = [
- "glsl",
- ]
-
- [[package]]
- name = "glslopt"
- version = "0.1.9"
--source = "registry+https://github.com/rust-lang/crates.io-index"
--checksum = "74a3f5c04450dfdadb4b08f6e5ee6f5110f674de1acbd6199bfec68392a8cbaf"
- dependencies = [
- "cc",
- ]
-
- [[package]]
- name = "gluesmith"
- version = "0.1.0"
- dependencies = [
-diff --git a/Cargo.toml b/Cargo.toml
---- a/Cargo.toml
-+++ b/Cargo.toml
-@@ -157,16 +157,17 @@ chardetng = { git = "https://github.com/
- chardetng_c = { git = "https://github.com/hsivonen/chardetng_c", rev="ed8a4c6f900a90d4dbc1d64b856e61490a1c3570" }
- coremidi = { git = "https://github.com/chris-zen/coremidi.git", rev="fc68464b5445caf111e41f643a2e69ccce0b4f83" }
- firefox-on-glean = { path = "toolkit/components/glean/api" }
- libudev-sys = { path = "dom/webauthn/libudev-sys" }
- packed_simd = { package = "packed_simd_2", git = "https://github.com/hsivonen/packed_simd", rev="412f9a0aa556611de021bde89dee8fefe6e0fbbd" }
- midir = { git = "https://github.com/mozilla/midir.git", rev = "519e651241e867af3391db08f9ae6400bc023e18" }
- # warp 0.3.3 + https://github.com/seanmonstar/warp/pull/1007
- warp = { git = "https://github.com/glandium/warp", rev = "4af45fae95bc98b0eba1ef0db17e1dac471bb23d" }
-+glslopt = { path = "third_party/rust/glslopt/" }
-
- cssparser = { git = "https://github.com/servo/rust-cssparser", rev = "45bc47e2bcb846f1efb5aea156be5fe7d18624bf" }
-
- # application-services overrides to make updating them all simpler.
- interrupt-support = { git = "https://github.com/mozilla/application-services", rev = "86c84c217036c12283d19368867323a66bf35883" }
- sql-support = { git = "https://github.com/mozilla/application-services", rev = "86c84c217036c12283d19368867323a66bf35883" }
- sync15 = { git = "https://github.com/mozilla/application-services", rev = "86c84c217036c12283d19368867323a66bf35883" }
- tabs = { git = "https://github.com/mozilla/application-services", rev = "86c84c217036c12283d19368867323a66bf35883" }
-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
-@@ -36,12 +36,13 @@ static inline SkMatrix SkEncodedOriginTo
- case kBottomRight_SkEncodedOrigin: return SkMatrix::MakeAll(-1, 0, w, 0, -1, h, 0, 0, 1);
- case kBottomLeft_SkEncodedOrigin: return SkMatrix::MakeAll( 1, 0, 0, 0, -1, h, 0, 0, 1);
- case kLeftTop_SkEncodedOrigin: return SkMatrix::MakeAll( 0, 1, 0, 1, 0, 0, 0, 0, 1);
- case kRightTop_SkEncodedOrigin: return SkMatrix::MakeAll( 0, -1, h, 1, 0, 0, 0, 0, 1);
- case kRightBottom_SkEncodedOrigin: return SkMatrix::MakeAll( 0, -1, h, -1, 0, w, 0, 0, 1);
- case kLeftBottom_SkEncodedOrigin: return SkMatrix::MakeAll( 0, 1, 0, -1, 0, w, 0, 0, 1);
+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);
}
SK_ABORT("Unexpected origin");
+ SkUNREACHABLE;
}
-
- #endif // SkEncodedOrigin_DEFINED
-diff --git a/gfx/skia/skia/include/private/GrTypesPriv.h b/gfx/skia/skia/include/private/GrTypesPriv.h
---- a/gfx/skia/skia/include/private/GrTypesPriv.h
-+++ b/gfx/skia/skia/include/private/GrTypesPriv.h
-@@ -535,32 +535,34 @@ static inline GrSLType GrSLCombinedSampl
- return kTexture2DSampler_GrSLType;
- case GrTextureType::kRectangle:
- return kTexture2DRectSampler_GrSLType;
- case GrTextureType::kExternal:
- return kTextureExternalSampler_GrSLType;
+ /**
+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");
}
+ SkUNREACHABLE;
}
- /** Rectangle and external textures only support the clamp wrap mode and do not support
- * MIP maps.
- */
- static inline bool GrTextureTypeHasRestrictedSampling(GrTextureType type) {
- switch (type) {
- case GrTextureType::k2D:
- return false;
- case GrTextureType::kRectangle:
- return true;
- case GrTextureType::kExternal:
- return true;
- default:
- SK_ABORT("Unexpected texture type");
- }
+ //////////////////////////////////////////////////////////////////////////////
+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<SkDescriptor> SkDescript
+ void SkDescriptor::operator delete(void* p) { ::operator delete(p); }
+ void* SkDescriptor::operator new(size_t) {
+ SK_ABORT("Descriptors are created with placement new.");
+ SkUNREACHABLE;
}
- static constexpr bool GrSLTypeIsCombinedSamplerType(GrSLType type) {
- switch (type) {
- case kTexture2DSampler_GrSLType:
- case kTextureExternalSampler_GrSLType:
- case kTexture2DRectSampler_GrSLType:
- return true;
-@@ -853,16 +855,17 @@ static inline size_t GrCompressedFormatD
- switch (compressionType) {
- case SkImage::kETC1_CompressionType:
- SkASSERT((width & 3) == 0);
- SkASSERT((height & 3) == 0);
- return (width >> 2) * (height >> 2) * 8;
- }
-
- SK_ABORT("Invalid pixel config");
-+ SkUNREACHABLE;
- }
-
- /**
- * Like SkColorType this describes a layout of pixel data in CPU memory. It specifies the channels,
- * their type, and width. This exists so that the GPU backend can have private types that have no
- * analog in the public facing SkColorType enum and omit types not implemented in the GPU backend.
- * It does not refer to a texture format and the mapping to texture formats may be many-to-many.
- * It does not specify the sRGB encoding of the stored values. The components are listed in order of
-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
-@@ -177,28 +177,30 @@ static inline bool SkCubicIsDegenerate(S
- case SkCubicType::kLocalCusp:
- case SkCubicType::kCuspAtInfinity:
- return false;
- case SkCubicType::kQuadratic:
- case SkCubicType::kLineOrPoint:
+ void SkDescriptor::flatten(SkWriteBuffer& buffer) const {
+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;
}
SK_ABORT("Invalid SkCubicType");
@@ -133,12 +49,7 @@
}
static inline const char* SkCubicTypeName(SkCubicType type) {
- switch (type) {
- case SkCubicType::kSerpentine: return "kSerpentine";
- case SkCubicType::kLoop: return "kLoop";
- case SkCubicType::kLocalCusp: return "kLocalCusp";
- case SkCubicType::kCuspAtInfinity: return "kCuspAtInfinity";
- case SkCubicType::kQuadratic: return "kQuadratic";
+@@ -293,6 +294,7 @@ static inline const char* SkCubicTypeNam
case SkCubicType::kLineOrPoint: return "kLineOrPoint";
}
SK_ABORT("Invalid SkCubicType");
@@ -146,20 +57,11 @@
}
/** Returns the cubic classification.
-
- t[],s[] are set to the two homogeneous parameter values at which points the lines L & M
- intersect with K, sorted from smallest to largest and oriented so positive values of the
- implicit are on the "left" side. For a serpentine curve they are the inflection points. For a
- loop they are the double point. For a local cusp, they are both equal and denote the cusp point.
-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
-@@ -196,16 +196,17 @@ unsigned SkTextBlob::ScalarsPerGlyph(Gly
- }
-
- void SkTextBlob::operator delete(void* p) {
- sk_free(p);
- }
+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) {
SK_ABORT("All blobs are created by placement new.");
@@ -167,41 +69,11 @@
}
void* SkTextBlob::operator new(size_t, void* p) {
- return p;
- }
-
- SkTextBlobRunIterator::SkTextBlobRunIterator(const SkTextBlob* blob)
- : fCurrentRun(SkTextBlob::RunRecord::First(blob)) {
-diff --git a/gfx/skia/skia/src/core/SkTypeface_remote.cpp b/gfx/skia/skia/src/core/SkTypeface_remote.cpp
---- a/gfx/skia/skia/src/core/SkTypeface_remote.cpp
-+++ b/gfx/skia/skia/src/core/SkTypeface_remote.cpp
-@@ -24,16 +24,17 @@ void SkScalerContextProxy::initCache(SkS
- SkASSERT(cache != nullptr);
-
- fCache = cache;
- fStrikeCache = strikeCache;
- }
-
- unsigned SkScalerContextProxy::generateGlyphCount() {
- SK_ABORT("Should never be called.");
-+ SkUNREACHABLE;
- }
-
- bool SkScalerContextProxy::generateAdvance(SkGlyph* glyph) {
- return false;
- }
-
- void SkScalerContextProxy::generateMetrics(SkGlyph* glyph) {
- TRACE_EVENT1("skia", "generateMetrics", "rec", TRACE_STR_COPY(this->getRec().dump().c_str()));
-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
-@@ -58,46 +58,54 @@ public:
- , fGlyphCount{glyphCount}
- , fIsLogging{isLogging}
- , fDiscardableManager{std::move(manager)} {}
- SkFontID remoteTypefaceID() const {return fFontId;}
- int glyphCount() const {return fGlyphCount;}
+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;}
protected:
@@ -209,129 +81,98 @@
+ int onGetUPEM() const override { SK_ABORT("Should never be called."); SkUNREACHABLE; }
std::unique_ptr<SkStreamAsset> onOpenStream(int* ttcIndex) const override {
SK_ABORT("Should never be called.");
-+ SkUNREACHABLE;
- }
- std::unique_ptr<SkFontData> onMakeFontData() const override {
- SK_ABORT("Should never be called.");
-+ SkUNREACHABLE;
++ SkUNREACHABLE;
}
sk_sp<SkTypeface> onMakeClone(const SkFontArguments& args) const override {
SK_ABORT("Should never be called.");
-+ SkUNREACHABLE;
++ SkUNREACHABLE;
}
+ bool onGlyphMaskNeedsCurrentColor() const override {
+ return fGlyphMaskNeedsCurrentColor;
+@@ -108,10 +110,12 @@ protected:
int onGetVariationDesignPosition(SkFontArguments::VariationPosition::Coordinate coordinates[],
int coordinateCount) const override {
SK_ABORT("Should never be called.");
-+ SkUNREACHABLE;
++ SkUNREACHABLE;
}
int onGetVariationDesignParameters(SkFontParameters::Variation::Axis parameters[],
int parameterCount) const override {
SK_ABORT("Should never be called.");
-+ SkUNREACHABLE;
++ SkUNREACHABLE;
}
void onGetFamilyName(SkString* familyName) const override {
// Used by SkStrikeCache::DumpMemoryStatistics.
- *familyName = "";
+@@ -119,15 +123,19 @@ protected:
+ }
+ bool onGetPostScriptName(SkString*) const override {
+ SK_ABORT("Should never be called.");
++ SkUNREACHABLE;
}
SkTypeface::LocalizedStrings* onCreateFamilyNameIterator() const override {
SK_ABORT("Should never be called.");
-+ SkUNREACHABLE;
++ SkUNREACHABLE;
}
int onGetTableTags(SkFontTableTag tags[]) const override {
SK_ABORT("Should never be called.");
-+ SkUNREACHABLE;
++ SkUNREACHABLE;
}
size_t onGetTableData(SkFontTableTag, size_t offset, size_t length, void* data) const override {
SK_ABORT("Should never be called.");
-+ SkUNREACHABLE;
++ SkUNREACHABLE;
+ }
+ std::unique_ptr<SkScalerContext> onCreateScalerContext(
+ const SkScalerContextEffects& effects, const SkDescriptor* desc) const override
+@@ -141,20 +149,25 @@ protected:
}
- SkScalerContext* onCreateScalerContext(const SkScalerContextEffects& effects,
- const SkDescriptor* desc) const override {
- return new SkScalerContextProxy(sk_ref_sp(const_cast<SkTypefaceProxy*>(this)), effects,
- desc, fDiscardableManager);
+ void onGetFontDescriptor(SkFontDescriptor*, bool*) const override {
+ SK_ABORT("Should never be called.");
++ SkUNREACHABLE;
}
- void onFilterRec(SkScalerContextRec* rec) const override {
- // The rec filtering is already applied by the server when generating
-@@ -111,26 +119,28 @@ protected:
+ void getGlyphToUnicodeMap(SkUnichar*) const override {
+ SK_ABORT("Should never be called.");
++ SkUNREACHABLE;
}
void getPostScriptGlyphNames(SkString*) const override {
SK_ABORT("Should never be called.");
++ SkUNREACHABLE;
}
std::unique_ptr<SkAdvancedTypefaceMetrics> onGetAdvancedMetrics() const override {
SK_ABORT("Should never be called.");
-+ SkUNREACHABLE;
++ SkUNREACHABLE;
}
void onCharsToGlyphs(const SkUnichar* chars, int count, SkGlyphID glyphs[]) const override {
SK_ABORT("Should never be called.");
++ SkUNREACHABLE;
}
int onCountGlyphs() const override {
return this->glyphCount();
- }
+@@ -162,6 +175,7 @@ protected:
void* onGetCTFontRef() const override {
SK_ABORT("Should never be called.");
-+ SkUNREACHABLE;
++ SkUNREACHABLE;
}
private:
- const SkFontID fFontId;
- const int fGlyphCount;
- const bool fIsLogging;
- sk_sp<SkStrikeClient::DiscardableHandleManager> fDiscardableManager;
-
-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
-@@ -139,16 +139,17 @@ static GrTextureDomain::Mode to_texture_
- case SkTileMode::kDecal:
- return GrTextureDomain::kDecal_Mode;
- case SkTileMode::kMirror:
- // TODO (michaelludwig) - Support mirror mode, treat as repeat for now
- case SkTileMode::kRepeat:
- return GrTextureDomain::kRepeat_Mode;
- default:
- SK_ABORT("Unsupported tile mode.");
-+ SkUNREACHABLE;
- }
- }
- #endif
+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<SkSpecialImage> cpu_blur(
+ return maker;
+ }
+ SK_ABORT("Sigma is out of range.");
++ SkUNREACHABLE;
+ };
- // This is defined by the SVG spec:
- // https://drafts.fxtf.org/filter-effects/#feGaussianBlurElement
- static int calculate_window(double sigma) {
- // NB 136 is the largest sigma that will not cause a buffer full of 255 mask values to overflow
-diff --git a/gfx/skia/skia/src/effects/imagefilters/SkLightingImageFilter.cpp b/gfx/skia/skia/src/effects/imagefilters/SkLightingImageFilter.cpp
---- a/gfx/skia/skia/src/effects/imagefilters/SkLightingImageFilter.cpp
-+++ b/gfx/skia/skia/src/effects/imagefilters/SkLightingImageFilter.cpp
-@@ -1696,16 +1696,17 @@ static SkImageFilterLight* create_random
- return new SkPointLight(random_point3(random), random->nextU());
- }
- case 2: {
- return new SkSpotLight(random_point3(random), random_point3(random),
- random->nextUScalar1(), random->nextUScalar1(), random->nextU());
- }
- default:
- SK_ABORT("Unexpected value.");
-+ SkUNREACHABLE;
- }
- }
-
- std::unique_ptr<GrFragmentProcessor> GrDiffuseLightingEffect::TestCreate(GrProcessorTestData* d) {
- int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx
- : GrProcessorUnitTest::kAlphaTextureIdx;
- sk_sp<GrTextureProxy> proxy = d->textureProxy(texIdx);
- SkScalar surfaceScale = d->fRandom->nextSScalar1();
-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
-@@ -64,16 +64,17 @@ int SkFontMgr_Indirect::onCountFamilies(
- }
-
- void SkFontMgr_Indirect::onGetFamilyName(int index, SkString* familyName) const {
- SK_ABORT("Not implemented");
- }
+ PassMaker* makerX = makeMaker(sigma.x());
+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 {
SK_ABORT("Not implemented");
@@ -339,1482 +180,11 @@
}
SkFontStyleSet* SkFontMgr_Indirect::onMatchFamily(const char familyName[]) const {
- return new SkStyleSet_Indirect(this, -1, fProxy->matchName(familyName));
- }
-
- SkTypeface* SkFontMgr_Indirect::createTypefaceFromFontId(const SkFontIdentity& id) const {
- if (id.fDataId == SkFontIdentity::kInvalidDataId) {
-diff --git a/gfx/skia/skia/src/gpu/GrDataUtils.cpp b/gfx/skia/skia/src/gpu/GrDataUtils.cpp
---- a/gfx/skia/skia/src/gpu/GrDataUtils.cpp
-+++ b/gfx/skia/skia/src/gpu/GrDataUtils.cpp
-@@ -123,25 +123,27 @@ static int num_ETC1_blocks(int w, int h)
-
- size_t GrCompressedDataSize(SkImage::CompressionType type, int width, int height) {
- switch (type) {
- case SkImage::kETC1_CompressionType:
- int numBlocks = num_ETC1_blocks(width, height);
- return numBlocks * sizeof(ETC1Block);
- }
- SK_ABORT("Unexpected compression type");
-+ SkUNREACHABLE;
- }
-
- size_t GrCompressedRowBytes(SkImage::CompressionType type, int width) {
- switch (type) {
- case SkImage::kETC1_CompressionType:
- int numBlocksWidth = num_ETC1_blocks_w(width);
- return numBlocksWidth * sizeof(ETC1Block);
- }
- SK_ABORT("Unexpected compression type");
-+ SkUNREACHABLE;
- }
-
- // Fill in 'dest' with ETC1 blocks derived from 'colorf'
- static void fillin_ETC1_with_color(int width, int height, const SkColor4f& colorf, void* dest) {
- SkColor color = colorf.toSkColor();
-
- ETC1Block block;
- create_etc1_block(color, &block);
-diff --git a/gfx/skia/skia/src/gpu/GrFragmentProcessor.h b/gfx/skia/skia/src/gpu/GrFragmentProcessor.h
---- a/gfx/skia/skia/src/gpu/GrFragmentProcessor.h
-+++ b/gfx/skia/skia/src/gpu/GrFragmentProcessor.h
-@@ -370,16 +370,17 @@ protected:
- const Args&... samps) {
- return (0 == i) ? samp0 : IthTextureSampler(i - 1, samps...);
- }
- inline static const TextureSampler& IthTextureSampler(int i);
-
- private:
- virtual SkPMColor4f constantOutputForConstantInput(const SkPMColor4f& /* inputColor */) const {
- SK_ABORT("Subclass must override this if advertising this optimization.");
-+ SkUNREACHABLE;
- }
-
- /** Returns a new instance of the appropriate *GL* implementation class
- for the given GrFragmentProcessor; caller is responsible for deleting
- the object. */
- virtual GrGLSLFragmentProcessor* onCreateGLSLInstance() const = 0;
-
- /** Implemented using GLFragmentProcessor::GenKey as described in this class's comment. */
-diff --git a/gfx/skia/skia/src/gpu/GrPathRendering.cpp b/gfx/skia/skia/src/gpu/GrPathRendering.cpp
---- a/gfx/skia/skia/src/gpu/GrPathRendering.cpp
-+++ b/gfx/skia/skia/src/gpu/GrPathRendering.cpp
-@@ -14,16 +14,17 @@
- #include "src/gpu/GrPathRendering.h"
- #include "src/gpu/GrProgramInfo.h"
- #include "src/gpu/GrRenderTarget.h"
-
- const GrUserStencilSettings& GrPathRendering::GetStencilPassSettings(FillType fill) {
- switch (fill) {
- default:
- SK_ABORT("Unexpected path fill.");
-+ SkUNREACHABLE;
- case GrPathRendering::kWinding_FillType: {
- constexpr static GrUserStencilSettings kWindingStencilPass(
- GrUserStencilSettings::StaticInit<
- 0xffff,
- GrUserStencilTest::kAlwaysIfInClip,
- 0xffff,
- GrUserStencilOp::kIncWrap,
- GrUserStencilOp::kIncWrap,
-diff --git a/gfx/skia/skia/src/gpu/GrPathRendering.h b/gfx/skia/skia/src/gpu/GrPathRendering.h
---- a/gfx/skia/skia/src/gpu/GrPathRendering.h
-+++ b/gfx/skia/skia/src/gpu/GrPathRendering.h
-@@ -58,16 +58,17 @@ public:
- return 1;
- case kTranslate_PathTransformType:
- return 2;
- case kAffine_PathTransformType:
- return 6;
-
- default:
- SK_ABORT("Unknown path transform type");
-+ SkUNREACHABLE;
- }
- }
-
- // No native support for inverse at this time
- enum FillType {
- /** Specifies that "inside" is computed by a non-zero sum of signed
- edge crossings
- */
-diff --git a/gfx/skia/skia/src/gpu/GrProcessorUnitTest.cpp b/gfx/skia/skia/src/gpu/GrProcessorUnitTest.cpp
---- a/gfx/skia/skia/src/gpu/GrProcessorUnitTest.cpp
-+++ b/gfx/skia/skia/src/gpu/GrProcessorUnitTest.cpp
-@@ -15,11 +15,12 @@ std::unique_ptr<GrFragmentProcessor> GrP
- std::unique_ptr<GrFragmentProcessor> fp;
- do {
- fp = GrFragmentProcessorTestFactory::Make(data);
- SkASSERT(fp);
- } while (fp->numChildProcessors() != 0);
- return fp;
- #else
- SK_ABORT("Should not be called if !SK_ALLOW_STATIC_GLOBAL_INITIALIZERS");
-+ SkUNREACHABLE;
- #endif
- }
- #endif
-diff --git a/gfx/skia/skia/src/gpu/GrReducedClip.cpp b/gfx/skia/skia/src/gpu/GrReducedClip.cpp
---- a/gfx/skia/skia/src/gpu/GrReducedClip.cpp
-+++ b/gfx/skia/skia/src/gpu/GrReducedClip.cpp
-@@ -520,16 +520,17 @@ GrReducedClip::ClipResult GrReducedClip:
- GrAA(element->isAA()));
-
- case Element::DeviceSpaceType::kPath:
- return this->addAnalyticFP(element->getDeviceSpacePath(),
- Invert(element->isInverseFilled()), GrAA(element->isAA()));
- }
-
- SK_ABORT("Unexpected DeviceSpaceType");
-+ SkUNREACHABLE;
- }
-
- GrReducedClip::ClipResult GrReducedClip::clipOutsideElement(const Element* element) {
- switch (element->getDeviceSpaceType()) {
- case Element::DeviceSpaceType::kEmpty:
- return ClipResult::kMadeEmpty;
-
- case Element::DeviceSpaceType::kRect:
-@@ -586,16 +587,17 @@ GrReducedClip::ClipResult GrReducedClip:
- }
-
- case Element::DeviceSpaceType::kPath:
- return this->addAnalyticFP(element->getDeviceSpacePath(),
- Invert(!element->isInverseFilled()), GrAA(element->isAA()));
- }
-
- SK_ABORT("Unexpected DeviceSpaceType");
-+ SkUNREACHABLE;
- }
-
- inline void GrReducedClip::addWindowRectangle(const SkRect& elementInteriorRect, bool elementIsAA) {
- SkIRect window;
- if (!elementIsAA) {
- elementInteriorRect.round(&window);
- } else {
- elementInteriorRect.roundIn(&window);
-diff --git a/gfx/skia/skia/src/gpu/GrResourceCache.cpp b/gfx/skia/skia/src/gpu/GrResourceCache.cpp
---- a/gfx/skia/skia/src/gpu/GrResourceCache.cpp
-+++ b/gfx/skia/skia/src/gpu/GrResourceCache.cpp
-@@ -35,27 +35,29 @@ DECLARE_SKMESSAGEBUS_MESSAGE(GrTextureFr
- //////////////////////////////////////////////////////////////////////////////
-
- GrScratchKey::ResourceType GrScratchKey::GenerateResourceType() {
- static std::atomic<int32_t> nextType{INHERITED::kInvalidDomain + 1};
-
- int32_t type = nextType++;
- if (type > SkTo<int32_t>(UINT16_MAX)) {
- SK_ABORT("Too many Resource Types");
-+ SkUNREACHABLE;
- }
-
- return static_cast<ResourceType>(type);
- }
-
- GrUniqueKey::Domain GrUniqueKey::GenerateDomain() {
- static std::atomic<int32_t> nextDomain{INHERITED::kInvalidDomain + 1};
-
- int32_t domain = nextDomain++;
- if (domain > SkTo<int32_t>(UINT16_MAX)) {
- SK_ABORT("Too many GrUniqueKey Domains");
-+ SkUNREACHABLE;
- }
-
- return static_cast<Domain>(domain);
- }
-
- uint32_t GrResourceKeyHash(const uint32_t* data, size_t size) {
- return SkOpts::hash(data, size);
- }
-diff --git a/gfx/skia/skia/src/gpu/GrShaderVar.cpp b/gfx/skia/skia/src/gpu/GrShaderVar.cpp
---- a/gfx/skia/skia/src/gpu/GrShaderVar.cpp
-+++ b/gfx/skia/skia/src/gpu/GrShaderVar.cpp
-@@ -13,30 +13,32 @@ static const char* type_modifier_string(
- switch (t) {
- case GrShaderVar::kNone_TypeModifier: return "";
- case GrShaderVar::kIn_TypeModifier: return "in";
- case GrShaderVar::kInOut_TypeModifier: return "inout";
- case GrShaderVar::kOut_TypeModifier: return "out";
- case GrShaderVar::kUniform_TypeModifier: return "uniform";
- }
- SK_ABORT("Unknown shader variable type modifier.");
-+ SkUNREACHABLE;
- }
-
- void GrShaderVar::setIOType(GrIOType ioType) {
- switch (ioType) {
- case kRW_GrIOType:
- return;
- case kRead_GrIOType:
- this->addModifier("readonly");
- return;
- case kWrite_GrIOType:
- this->addModifier("writeonly");
- return;
- }
- SK_ABORT("Unknown io type.");
-+ SkUNREACHABLE;
- }
-
- void GrShaderVar::appendDecl(const GrShaderCaps* shaderCaps, SkString* out) const {
- SkString layout = fLayoutQualifier;
- if (!fLayoutQualifier.isEmpty()) {
- out->appendf("layout(%s) ", fLayoutQualifier.c_str());
- }
- out->append(fExtraModifiers);
-diff --git a/gfx/skia/skia/src/gpu/SkGpuDevice.cpp b/gfx/skia/skia/src/gpu/SkGpuDevice.cpp
---- a/gfx/skia/skia/src/gpu/SkGpuDevice.cpp
-+++ b/gfx/skia/skia/src/gpu/SkGpuDevice.cpp
-@@ -278,16 +278,17 @@ static inline GrPrimitiveType point_mode
- case SkCanvas::kPoints_PointMode:
- return GrPrimitiveType::kPoints;
- case SkCanvas::kLines_PointMode:
- return GrPrimitiveType::kLines;
- case SkCanvas::kPolygon_PointMode:
- return GrPrimitiveType::kLineStrip;
- }
- SK_ABORT("Unexpected mode");
-+ SkUNREACHABLE;
- }
-
- void SkGpuDevice::drawPoints(SkCanvas::PointMode mode,
- size_t count, const SkPoint pts[], const SkPaint& paint) {
- ASSERT_SINGLE_OWNER
- GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawPoints", fContext.get());
- SkScalar width = paint.getStrokeWidth();
- if (width < 0) {
-diff --git a/gfx/skia/skia/src/gpu/SkGr.h b/gfx/skia/skia/src/gpu/SkGr.h
---- a/gfx/skia/skia/src/gpu/SkGr.h
-+++ b/gfx/skia/skia/src/gpu/SkGr.h
-@@ -154,16 +154,17 @@ static inline GrPrimitiveType SkVertexMo
- case SkVertices::kTriangles_VertexMode:
- return GrPrimitiveType::kTriangles;
- case SkVertices::kTriangleStrip_VertexMode:
- return GrPrimitiveType::kTriangleStrip;
- case SkVertices::kTriangleFan_VertexMode:
- break;
- }
- SK_ABORT("Invalid mode");
-+ SkUNREACHABLE;
- }
-
- //////////////////////////////////////////////////////////////////////////////
-
- GR_STATIC_ASSERT((int)kZero_GrBlendCoeff == (int)SkBlendModeCoeff::kZero);
- GR_STATIC_ASSERT((int)kOne_GrBlendCoeff == (int)SkBlendModeCoeff::kOne);
- GR_STATIC_ASSERT((int)kSC_GrBlendCoeff == (int)SkBlendModeCoeff::kSC);
- GR_STATIC_ASSERT((int)kISC_GrBlendCoeff == (int)SkBlendModeCoeff::kISC);
-diff --git a/gfx/skia/skia/src/gpu/ccpr/GrCCCoverageProcessor.h b/gfx/skia/skia/src/gpu/ccpr/GrCCCoverageProcessor.h
---- a/gfx/skia/skia/src/gpu/ccpr/GrCCCoverageProcessor.h
-+++ b/gfx/skia/skia/src/gpu/ccpr/GrCCCoverageProcessor.h
-@@ -235,16 +235,17 @@ inline const char* GrCCCoverageProcessor
- switch (type) {
- case PrimitiveType::kTriangles: return "kTriangles";
- case PrimitiveType::kWeightedTriangles: return "kWeightedTriangles";
- case PrimitiveType::kQuadratics: return "kQuadratics";
- case PrimitiveType::kCubics: return "kCubics";
- case PrimitiveType::kConics: return "kConics";
- }
- SK_ABORT("Invalid PrimitiveType");
-+ SkUNREACHABLE;
- }
-
- inline void GrCCCoverageProcessor::TriPointInstance::set(
- const SkPoint p[3], const Sk2f& translate, Ordering ordering) {
- this->set(p[0], p[1], p[2], translate, ordering);
- }
-
- inline void GrCCCoverageProcessor::TriPointInstance::set(
-diff --git a/gfx/skia/skia/src/gpu/ccpr/GrCCStrokeGeometry.cpp b/gfx/skia/skia/src/gpu/ccpr/GrCCStrokeGeometry.cpp
---- a/gfx/skia/skia/src/gpu/ccpr/GrCCStrokeGeometry.cpp
-+++ b/gfx/skia/skia/src/gpu/ccpr/GrCCStrokeGeometry.cpp
-@@ -55,16 +55,17 @@ static GrCCStrokeGeometry::Verb join_ver
- case SkPaint::kBevel_Join:
- return Verb::kBevelJoin;
- case SkPaint::kMiter_Join:
- return Verb::kMiterJoin;
- case SkPaint::kRound_Join:
- return Verb::kRoundJoin;
- }
- SK_ABORT("Invalid SkPaint::Join.");
-+ SkUNREACHABLE;
- }
-
- void GrCCStrokeGeometry::beginPath(const SkStrokeRec& stroke, float strokeDevWidth,
- InstanceTallies* tallies) {
- SkASSERT(!fInsideContour);
- // Client should have already converted the stroke to device space (i.e. width=1 for hairline).
- SkASSERT(strokeDevWidth > 0);
-
-diff --git a/gfx/skia/skia/src/gpu/ccpr/GrCCStrokeGeometry.h b/gfx/skia/skia/src/gpu/ccpr/GrCCStrokeGeometry.h
---- a/gfx/skia/skia/src/gpu/ccpr/GrCCStrokeGeometry.h
-+++ b/gfx/skia/skia/src/gpu/ccpr/GrCCStrokeGeometry.h
-@@ -170,10 +170,11 @@ inline bool GrCCStrokeGeometry::IsIntern
- case Verb::kMiterJoin:
- case Verb::kRoundJoin:
- case Verb::kSquareCap:
- case Verb::kRoundCap:
- case Verb::kEndContour:
- return false;
- }
- SK_ABORT("Invalid GrCCStrokeGeometry::Verb.");
-+ SkUNREACHABLE;
- }
- #endif
-diff --git a/gfx/skia/skia/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp b/gfx/skia/skia/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp
---- a/gfx/skia/skia/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp
-+++ b/gfx/skia/skia/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp
-@@ -159,16 +159,17 @@ GrPathRenderer::CanDrawPath GrCoverageCo
- return CanDrawPath::kYes;
- }
-
- case SkStrokeRec::kStrokeAndFill_Style:
- return CanDrawPath::kNo;
- }
-
- SK_ABORT("Invalid stroke style.");
-+ SkUNREACHABLE;
- }
-
- bool GrCoverageCountingPathRenderer::onDrawPath(const DrawPathArgs& args) {
- SkASSERT(!fFlushing);
-
- SkIRect clipIBounds;
- GrRenderTargetContext* rtc = args.fRenderTargetContext;
- args.fClip->getConservativeBounds(rtc->width(), rtc->height(), &clipIBounds, nullptr);
-diff --git a/gfx/skia/skia/src/gpu/ccpr/GrVSCoverageProcessor.cpp b/gfx/skia/skia/src/gpu/ccpr/GrVSCoverageProcessor.cpp
---- a/gfx/skia/skia/src/gpu/ccpr/GrVSCoverageProcessor.cpp
-+++ b/gfx/skia/skia/src/gpu/ccpr/GrVSCoverageProcessor.cpp
-@@ -545,9 +545,10 @@ GrGLSLPrimitiveProcessor* GrVSCoveragePr
- case PrimitiveType::kWeightedTriangles:
- return new Impl(std::move(shader), 3);
- case PrimitiveType::kQuadratics:
- case PrimitiveType::kCubics:
- case PrimitiveType::kConics:
- return new Impl(std::move(shader), 4);
- }
- SK_ABORT("Invalid PrimitiveType");
-+ SkUNREACHABLE;
- }
-diff --git a/gfx/skia/skia/src/gpu/dawn/GrDawnOpsRenderPass.cpp b/gfx/skia/skia/src/gpu/dawn/GrDawnOpsRenderPass.cpp
---- a/gfx/skia/skia/src/gpu/dawn/GrDawnOpsRenderPass.cpp
-+++ b/gfx/skia/skia/src/gpu/dawn/GrDawnOpsRenderPass.cpp
-@@ -34,17 +34,19 @@ static dawn::LoadOp to_dawn_load_op(GrLo
- // Load should be equivalent to DontCare for desktop; Clear would
- // probably be better for tilers. If Dawn does add DontCare
- // as an extension, use it here.
- return dawn::LoadOp::Load;
- case GrLoadOp::kClear:
- return dawn::LoadOp::Clear;
- default:
- SK_ABORT("Invalid LoadOp");
-+ SkUNREACHABLE;
- }
-+ SkUNREACHABLE;
- }
-
- GrDawnOpsRenderPass::GrDawnOpsRenderPass(GrDawnGpu* gpu, GrRenderTarget* rt, GrSurfaceOrigin origin,
- const LoadAndStoreInfo& colorInfo,
- const StencilLoadAndStoreInfo& stencilInfo)
- : INHERITED(rt, origin)
- , fGpu(gpu)
- , fColorInfo(colorInfo) {
-diff --git a/gfx/skia/skia/src/gpu/dawn/GrDawnUniformHandler.cpp b/gfx/skia/skia/src/gpu/dawn/GrDawnUniformHandler.cpp
---- a/gfx/skia/skia/src/gpu/dawn/GrDawnUniformHandler.cpp
-+++ b/gfx/skia/skia/src/gpu/dawn/GrDawnUniformHandler.cpp
-@@ -90,16 +90,17 @@ uint32_t grsltype_to_alignment_mask(GrSL
- case kTexture2DSampler_GrSLType:
- case kTextureExternalSampler_GrSLType:
- case kTexture2DRectSampler_GrSLType:
- case kTexture2D_GrSLType:
- case kSampler_GrSLType:
- break;
- }
- SK_ABORT("Unexpected type");
-+ SkUNREACHABLE;
- }
-
- static inline uint32_t grsltype_to_size(GrSLType type) {
- switch(type) {
- case kByte_GrSLType:
- case kUByte_GrSLType:
- return 1;
- case kByte2_GrSLType:
-@@ -168,16 +169,17 @@ static inline uint32_t grsltype_to_size(
- case kTexture2DSampler_GrSLType:
- case kTextureExternalSampler_GrSLType:
- case kTexture2DRectSampler_GrSLType:
- case kTexture2D_GrSLType:
- case kSampler_GrSLType:
- break;
- }
- SK_ABORT("Unexpected type");
-+ SkUNREACHABLE;
- }
-
- uint32_t get_ubo_offset(uint32_t* currentOffset,
- GrSLType type,
- int arrayCount) {
- uint32_t alignmentMask = grsltype_to_alignment_mask(type);
- // We want to use the std140 layout here, so we must make arrays align to 16 bytes.
- if (arrayCount || type == kFloat2x2_GrSLType) {
-diff --git a/gfx/skia/skia/src/gpu/dawn/GrDawnVaryingHandler.cpp b/gfx/skia/skia/src/gpu/dawn/GrDawnVaryingHandler.cpp
---- a/gfx/skia/skia/src/gpu/dawn/GrDawnVaryingHandler.cpp
-+++ b/gfx/skia/skia/src/gpu/dawn/GrDawnVaryingHandler.cpp
-@@ -71,16 +71,17 @@ static inline int grsltype_to_location_s
- case kUByte_GrSLType:
- return 1;
- case kTexture2D_GrSLType:
- return 0;
- case kSampler_GrSLType:
- return 0;
- }
- SK_ABORT("Unexpected type");
-+ SkUNREACHABLE;
- }
-
- static void finalize_helper(GrDawnVaryingHandler::VarArray& vars) {
- int locationIndex = 0;
- for (int i = 0; i < vars.count(); ++i) {
- GrShaderVar& var = vars[i];
- SkString location;
- location.appendf("location = %d", locationIndex);
-diff --git a/gfx/skia/skia/src/gpu/effects/GrConstColorProcessor.fp b/gfx/skia/skia/src/gpu/effects/GrConstColorProcessor.fp
---- a/gfx/skia/skia/src/gpu/effects/GrConstColorProcessor.fp
-+++ b/gfx/skia/skia/src/gpu/effects/GrConstColorProcessor.fp
-@@ -53,16 +53,17 @@ void main() {
- case InputMode::kIgnore:
- return color;
- case InputMode::kModulateA:
- return color * input.fA;
- case InputMode::kModulateRGBA:
- return color * input;
- }
- SK_ABORT("Unexpected mode");
-+ SkUNREACHABLE;
- }
- }
-
- @test(d) {
- SkPMColor4f color;
- int colorPicker = d->fRandom->nextULessThan(3);
- switch (colorPicker) {
- case 0: {
-diff --git a/gfx/skia/skia/src/gpu/effects/GrCoverageSetOpXP.cpp b/gfx/skia/skia/src/gpu/effects/GrCoverageSetOpXP.cpp
---- a/gfx/skia/skia/src/gpu/effects/GrCoverageSetOpXP.cpp
-+++ b/gfx/skia/skia/src/gpu/effects/GrCoverageSetOpXP.cpp
-@@ -199,16 +199,17 @@ const GrXPFactory* GrCoverageSetOpXPFact
- static _CONSTEXPR_ const GrCoverageSetOpXPFactory gRevDiffCDXPF(
- SkRegion::kReverseDifference_Op, false);
- return &gRevDiffCDXPF;
- }
- }
- }
- #undef _CONSTEXPR_
- SK_ABORT("Unknown region op.");
-+ SkUNREACHABLE;
- }
-
- sk_sp<const GrXferProcessor> GrCoverageSetOpXPFactory::makeXferProcessor(
- const GrProcessorAnalysisColor&,
- GrProcessorAnalysisCoverage,
- bool hasMixedSamples,
- const GrCaps& caps,
- GrClampType) const {
-diff --git a/gfx/skia/skia/src/gpu/effects/GrPorterDuffXferProcessor.cpp b/gfx/skia/skia/src/gpu/effects/GrPorterDuffXferProcessor.cpp
---- a/gfx/skia/skia/src/gpu/effects/GrPorterDuffXferProcessor.cpp
-+++ b/gfx/skia/skia/src/gpu/effects/GrPorterDuffXferProcessor.cpp
-@@ -748,16 +748,17 @@ const GrXPFactory* GrPorterDuffXPFactory
- case SkBlendMode::kPlus:
- return &gPlusPDXPF;
- case SkBlendMode::kModulate:
- return &gModulatePDXPF;
- case SkBlendMode::kScreen:
- return &gScreenPDXPF;
- default:
- SK_ABORT("Unexpected blend mode.");
-+ SkUNREACHABLE;
- }
- }
-
- sk_sp<const GrXferProcessor> GrPorterDuffXPFactory::makeXferProcessor(
- const GrProcessorAnalysisColor& color, GrProcessorAnalysisCoverage coverage,
- bool hasMixedSamples, const GrCaps& caps, GrClampType clampType) const {
- BlendFormula blendFormula;
- bool isLCD = coverage == GrProcessorAnalysisCoverage::kLCD;
-diff --git a/gfx/skia/skia/src/gpu/effects/GrSkSLFP.cpp b/gfx/skia/skia/src/gpu/effects/GrSkSLFP.cpp
---- a/gfx/skia/skia/src/gpu/effects/GrSkSLFP.cpp
-+++ b/gfx/skia/skia/src/gpu/effects/GrSkSLFP.cpp
-@@ -149,16 +149,17 @@ public:
- return kHalf4x4_GrSLType;
- } else if (type == *fContext.fBool_Type) {
- return kBool_GrSLType;
- } else if (type == *fContext.fInt_Type) {
- return kInt_GrSLType;
- }
- printf("%s\n", SkSL::String(type.fName).c_str());
- SK_ABORT("unsupported uniform type");
-+ SkUNREACHABLE;
- }
-
- void emitCode(EmitArgs& args) override {
- for (const auto& v : fInAndUniformVars) {
- if (v->fModifiers.fFlags & SkSL::Modifiers::kUniform_Flag && v->fType !=
- *fContext.fFragmentProcessor_Type) {
- fUniformHandles.push_back(args.fUniformHandler->addUniform(
- kFragment_GrShaderFlag,
-@@ -563,11 +564,12 @@ std::unique_ptr<GrFragmentProcessor> GrS
- }
- std::unique_ptr<GrSkSLFP> result = GrSkSLFP::Make(d->context(), overdrawIndex,
- "Overdraw", SKSL_OVERDRAW_SRC,
- &inputs, sizeof(inputs));
- return std::unique_ptr<GrFragmentProcessor>(result.release());
- }
- }
- SK_ABORT("unreachable");
-+ SkUNREACHABLE;
- }
-
- #endif
-diff --git a/gfx/skia/skia/src/gpu/effects/generated/GrConstColorProcessor.h b/gfx/skia/skia/src/gpu/effects/generated/GrConstColorProcessor.h
---- a/gfx/skia/skia/src/gpu/effects/generated/GrConstColorProcessor.h
-+++ b/gfx/skia/skia/src/gpu/effects/generated/GrConstColorProcessor.h
-@@ -36,16 +36,17 @@ public:
- case InputMode::kIgnore:
- return color;
- case InputMode::kModulateA:
- return color * input.fA;
- case InputMode::kModulateRGBA:
- return color * input;
- }
- SK_ABORT("Unexpected mode");
-+ SkUNREACHABLE;
- }
- static std::unique_ptr<GrFragmentProcessor> Make(SkPMColor4f color, InputMode mode) {
- return std::unique_ptr<GrFragmentProcessor>(new GrConstColorProcessor(color, mode));
- }
- GrConstColorProcessor(const GrConstColorProcessor& src);
- std::unique_ptr<GrFragmentProcessor> clone() const override;
- const char* name() const override { return "ConstColorProcessor"; }
- SkPMColor4f color;
-diff --git a/gfx/skia/skia/src/gpu/geometry/GrShape.cpp b/gfx/skia/skia/src/gpu/geometry/GrShape.cpp
---- a/gfx/skia/skia/src/gpu/geometry/GrShape.cpp
-+++ b/gfx/skia/skia/src/gpu/geometry/GrShape.cpp
-@@ -159,16 +159,17 @@ SkRect GrShape::bounds() const {
- return fRRectData.fRRect.getBounds();
- case Type::kArc:
- // Could make this less conservative by looking at angles.
- return fArcData.fOval;
- case Type::kPath:
- return this->path().getBounds();
- }
- SK_ABORT("Unknown shape type");
-+ SkUNREACHABLE;
- }
-
- SkRect GrShape::styledBounds() const {
- if (this->isEmpty() && !fStyle.hasNonDashPathEffect()) {
- return SkRect::MakeEmpty();
- }
-
- SkRect bounds;
-@@ -249,16 +250,17 @@ int GrShape::unstyledKeySize() const {
- if (dataKeySize >= 0) {
- return dataKeySize;
- }
- // The key is the path ID and fill type.
- return 2;
- }
- }
- SK_ABORT("Should never get here.");
-+ SkUNREACHABLE;
- }
-
- void GrShape::writeUnstyledKey(uint32_t* key) const {
- SkASSERT(this->unstyledKeySize());
- SkDEBUGCODE(uint32_t* origKey = key;)
- if (fInheritedKey.count()) {
- memcpy(key, fInheritedKey.get(), sizeof(uint32_t) * fInheritedKey.count());
- SkDEBUGCODE(key += fInheritedKey.count();)
-diff --git a/gfx/skia/skia/src/gpu/gl/GrGLCaps.cpp b/gfx/skia/skia/src/gpu/gl/GrGLCaps.cpp
---- a/gfx/skia/skia/src/gpu/gl/GrGLCaps.cpp
-+++ b/gfx/skia/skia/src/gpu/gl/GrGLCaps.cpp
-@@ -4154,16 +4154,17 @@ GrBackendFormat GrGLCaps::getBackendForm
- case SkImage::kETC1_CompressionType:
- // if ETC2 is available default to that format
- if (this->isFormatTexturable(GrGLFormat::kCOMPRESSED_RGB8_ETC2)) {
- return GrBackendFormat::MakeGL(GR_GL_COMPRESSED_RGB8_ETC2, GR_GL_TEXTURE_2D);
- }
- return GrBackendFormat::MakeGL(GR_GL_COMPRESSED_ETC1_RGB8, GR_GL_TEXTURE_2D);
- }
- SK_ABORT("Invalid compression type");
-+ SkUNREACHABLE;
- }
-
- GrSwizzle GrGLCaps::getTextureSwizzle(const GrBackendFormat& format, GrColorType colorType) const {
- const auto& info = this->getFormatInfo(format.asGLFormat());
- for (int i = 0; i < info.fColorTypeInfoCount; ++i) {
- const auto& ctInfo = info.fColorTypeInfos[i];
- if (ctInfo.fColorType == colorType) {
- return ctInfo.fTextureSwizzle;
-diff --git a/gfx/skia/skia/src/gpu/gl/GrGLGLSL.cpp b/gfx/skia/skia/src/gpu/gl/GrGLGLSL.cpp
---- a/gfx/skia/skia/src/gpu/gl/GrGLGLSL.cpp
-+++ b/gfx/skia/skia/src/gpu/gl/GrGLGLSL.cpp
-@@ -63,9 +63,10 @@ bool GrGLGetGLSLGeneration(const GrGLInt
- if (ver >= GR_GLSL_VER(2,0)) {
- *generation = k330_GrGLSLGeneration; // ES 3.0
- } else {
- *generation = k110_GrGLSLGeneration;
- }
- return true;
- }
- SK_ABORT("Unknown GL Standard");
-+ SkUNREACHABLE;
- }
-diff --git a/gfx/skia/skia/src/gpu/gl/GrGLGpu.cpp b/gfx/skia/skia/src/gpu/gl/GrGLGpu.cpp
---- a/gfx/skia/skia/src/gpu/gl/GrGLGpu.cpp
-+++ b/gfx/skia/skia/src/gpu/gl/GrGLGpu.cpp
-@@ -191,16 +191,17 @@ static int gl_target_to_binding_index(Gr
- case GR_GL_TEXTURE_2D:
- return 0;
- case GR_GL_TEXTURE_RECTANGLE:
- return 1;
- case GR_GL_TEXTURE_EXTERNAL:
- return 2;
- }
- SK_ABORT("Unexpected GL texture target.");
-+ SkUNREACHABLE;
- }
-
- GrGpuResource::UniqueID GrGLGpu::TextureUnitBindings::boundID(GrGLenum target) const {
- return fTargetBindings[gl_target_to_binding_index(target)].fBoundResourceID;
- }
-
- bool GrGLGpu::TextureUnitBindings::hasBeenModified(GrGLenum target) const {
- return fTargetBindings[gl_target_to_binding_index(target)].fHasBeenModified;
-@@ -229,39 +230,42 @@ void GrGLGpu::TextureUnitBindings::inval
-
- static GrGLenum filter_to_gl_mag_filter(GrSamplerState::Filter filter) {
- switch (filter) {
- case GrSamplerState::Filter::kNearest: return GR_GL_NEAREST;
- case GrSamplerState::Filter::kBilerp: return GR_GL_LINEAR;
- case GrSamplerState::Filter::kMipMap: return GR_GL_LINEAR;
- }
- SK_ABORT("Unknown filter");
-+ SkUNREACHABLE;
- }
-
- static GrGLenum filter_to_gl_min_filter(GrSamplerState::Filter filter) {
- switch (filter) {
- case GrSamplerState::Filter::kNearest: return GR_GL_NEAREST;
- case GrSamplerState::Filter::kBilerp: return GR_GL_LINEAR;
- case GrSamplerState::Filter::kMipMap: return GR_GL_LINEAR_MIPMAP_LINEAR;
- }
- SK_ABORT("Unknown filter");
-+ SkUNREACHABLE;
- }
-
- static inline GrGLenum wrap_mode_to_gl_wrap(GrSamplerState::WrapMode wrapMode,
- const GrCaps& caps) {
- switch (wrapMode) {
- case GrSamplerState::WrapMode::kClamp: return GR_GL_CLAMP_TO_EDGE;
- case GrSamplerState::WrapMode::kRepeat: return GR_GL_REPEAT;
- case GrSamplerState::WrapMode::kMirrorRepeat: return GR_GL_MIRRORED_REPEAT;
- case GrSamplerState::WrapMode::kClampToBorder:
- // May not be supported but should have been caught earlier
- SkASSERT(caps.clampToBorderSupport());
- return GR_GL_CLAMP_TO_BORDER;
- }
- SK_ABORT("Unknown wrap mode");
-+ SkUNREACHABLE;
- }
-
- ///////////////////////////////////////////////////////////////////////////////
-
- class GrGLGpu::SamplerObjectCache {
- public:
- SamplerObjectCache(GrGLGpu* gpu) : fGpu(gpu) {
- fNumTextureUnits = fGpu->glCaps().shaderCaps()->maxFragmentSamplers();
-@@ -1102,17 +1106,17 @@ static bool renderbuffer_storage_msaa(co
- GL_ALLOC_CALL(ctx.interface(),
- RenderbufferStorageMultisampleES2EXT(GR_GL_RENDERBUFFER,
- sampleCount,
- format,
- width, height));
- break;
- case GrGLCaps::kNone_MSFBOType:
- SK_ABORT("Shouldn't be here if we don't support multisampled renderbuffers.");
-- break;
-+ SkUNREACHABLE;
- }
- return (GR_GL_NO_ERROR == CHECK_ALLOC_ERROR(ctx.interface()));
- }
-
- bool GrGLGpu::createRenderTargetObjects(const GrGLTexture::Desc& desc,
- int sampleCount,
- GrGLRenderTarget::IDs* rtIDs) {
- rtIDs->fMSColorRenderbufferID = 0;
-@@ -2270,19 +2274,20 @@ static GrGLenum gr_primitive_type_to_gl_
- case GrPrimitiveType::kPoints:
- return GR_GL_POINTS;
- case GrPrimitiveType::kLines:
- return GR_GL_LINES;
- case GrPrimitiveType::kLineStrip:
- return GR_GL_LINE_STRIP;
- case GrPrimitiveType::kPath:
- SK_ABORT("non-mesh-based GrPrimitiveType");
-- return 0;
-+ SkUNREACHABLE;
- }
- SK_ABORT("invalid GrPrimitiveType");
-+ SkUNREACHABLE;
- }
-
- void GrGLGpu::sendMeshToGpu(GrPrimitiveType primitiveType, const GrBuffer* vertexBuffer,
- int vertexCount, int baseVertex) {
- const GrGLenum glPrimType = gr_primitive_type_to_gl_mode(primitiveType);
- if (this->glCaps().drawArraysBaseVertexIsBroken()) {
- this->setupGeometry(nullptr, vertexBuffer, baseVertex, nullptr, 0, GrPrimitiveRestart::kNo);
- GL_CALL(DrawArrays(glPrimType, 0, vertexCount));
-@@ -4001,17 +4006,18 @@ int GrGLGpu::TextureToCopyProgramIdx(GrT
- switch (GrSLCombinedSamplerTypeForTextureType(texture->texturePriv().textureType())) {
- case kTexture2DSampler_GrSLType:
- return 0;
- case kTexture2DRectSampler_GrSLType:
- return 1;
- case kTextureExternalSampler_GrSLType:
- return 2;
- default:
-- SK_ABORT("Unexpected samper type");
-+ SK_ABORT("Unexpected sampler type");
-+ SkUNREACHABLE;
- }
- }
-
- #ifdef SK_ENABLE_DUMP_GPU
- #include "src/utils/SkJSONWriter.h"
- void GrGLGpu::onDumpJSON(SkJSONWriter* writer) const {
- // We are called by the base class, which has already called beginObject(). We choose to nest
- // all of our caps information in a named sub-object.
-diff --git a/gfx/skia/skia/src/gpu/gl/GrGLPath.cpp b/gfx/skia/skia/src/gpu/gl/GrGLPath.cpp
---- a/gfx/skia/skia/src/gpu/gl/GrGLPath.cpp
-+++ b/gfx/skia/skia/src/gpu/gl/GrGLPath.cpp
-@@ -192,16 +192,17 @@ inline bool init_path_object_for_general
-
- /*
- * For now paths only natively support winding and even odd fill types
- */
- static GrPathRendering::FillType convert_skpath_filltype(SkPath::FillType fill) {
- switch (fill) {
- default:
- SK_ABORT("Incomplete Switch\n");
-+ SkUNREACHABLE;
- case SkPath::kWinding_FillType:
- case SkPath::kInverseWinding_FillType:
- return GrPathRendering::kWinding_FillType;
- case SkPath::kEvenOdd_FillType:
- case SkPath::kInverseEvenOdd_FillType:
- return GrPathRendering::kEvenOdd_FillType;
- }
- }
-diff --git a/gfx/skia/skia/src/gpu/gl/GrGLTexture.cpp b/gfx/skia/skia/src/gpu/gl/GrGLTexture.cpp
---- a/gfx/skia/skia/src/gpu/gl/GrGLTexture.cpp
-+++ b/gfx/skia/skia/src/gpu/gl/GrGLTexture.cpp
-@@ -20,30 +20,33 @@ GrTextureType GrGLTexture::TextureTypeFr
- case GR_GL_TEXTURE_2D:
- return GrTextureType::k2D;
- case GR_GL_TEXTURE_RECTANGLE:
- return GrTextureType::kRectangle;
- case GR_GL_TEXTURE_EXTERNAL:
- return GrTextureType::kExternal;
- }
- SK_ABORT("Unexpected texture target");
-+ SkUNREACHABLE;
- }
-
- static inline GrGLenum target_from_texture_type(GrTextureType type) {
- switch (type) {
- case GrTextureType::k2D:
- return GR_GL_TEXTURE_2D;
- case GrTextureType::kRectangle:
- return GR_GL_TEXTURE_RECTANGLE;
- case GrTextureType::kExternal:
- return GR_GL_TEXTURE_EXTERNAL;
- default:
- SK_ABORT("Unexpected texture target");
-+ SkUNREACHABLE;
- }
- SK_ABORT("Unexpected texture type");
-+ SkUNREACHABLE;
- }
-
- // Because this class is virtually derived from GrSurface we must explicitly call its constructor.
- GrGLTexture::GrGLTexture(GrGLGpu* gpu, SkBudgeted budgeted, const Desc& desc,
- GrMipMapsStatus mipMapsStatus)
- : GrSurface(gpu, desc.fSize, desc.fConfig, GrProtected::kNo)
- , INHERITED(gpu, desc.fSize, desc.fConfig, GrProtected::kNo,
- TextureTypeFromTarget(desc.fTarget), mipMapsStatus)
-diff --git a/gfx/skia/skia/src/gpu/gl/GrGLVertexArray.cpp b/gfx/skia/skia/src/gpu/gl/GrGLVertexArray.cpp
---- a/gfx/skia/skia/src/gpu/gl/GrGLVertexArray.cpp
-+++ b/gfx/skia/skia/src/gpu/gl/GrGLVertexArray.cpp
-@@ -75,16 +75,17 @@ static AttribLayout attrib_layout(GrVert
- case kUint_GrVertexAttribType:
- return {false, 1, GR_GL_UNSIGNED_INT};
- case kUShort_norm_GrVertexAttribType:
- return {true, 1, GR_GL_UNSIGNED_SHORT};
- case kUShort4_norm_GrVertexAttribType:
- return {true, 4, GR_GL_UNSIGNED_SHORT};
- }
- SK_ABORT("Unknown vertex attrib type");
-+ SkUNREACHABLE;
- };
-
- void GrGLAttribArrayState::set(GrGLGpu* gpu,
- int index,
- const GrBuffer* vertexBuffer,
- GrVertexAttribType cpuType,
- GrSLType gpuType,
- GrGLsizei stride,
-diff --git a/gfx/skia/skia/src/gpu/glsl/GrGLSL.cpp b/gfx/skia/skia/src/gpu/glsl/GrGLSL.cpp
---- a/gfx/skia/skia/src/gpu/glsl/GrGLSL.cpp
-+++ b/gfx/skia/skia/src/gpu/glsl/GrGLSL.cpp
-@@ -93,9 +93,10 @@ const char* GrGLSLTypeString(GrSLType t)
- case kUByte4_GrSLType:
- return "ubyte4";
- case kTexture2D_GrSLType:
- return "texture2D";
- case kSampler_GrSLType:
- return "sampler";
- }
- SK_ABORT("Unknown shader var type.");
-+ SkUNREACHABLE;
- }
-diff --git a/gfx/skia/skia/src/gpu/glsl/GrGLSLVarying.cpp b/gfx/skia/skia/src/gpu/glsl/GrGLSLVarying.cpp
---- a/gfx/skia/skia/src/gpu/glsl/GrGLSLVarying.cpp
-+++ b/gfx/skia/skia/src/gpu/glsl/GrGLSLVarying.cpp
-@@ -30,16 +30,17 @@ static bool use_flat_interpolation(GrGLS
- SkASSERT(!shaderCaps.preferFlatInterpolation() ||
- shaderCaps.flatInterpolationSupport());
- return shaderCaps.preferFlatInterpolation();
- case Interpolation::kMustBeFlat:
- SkASSERT(shaderCaps.flatInterpolationSupport());
- return true;
- }
- SK_ABORT("Invalid interpolation");
-+ SkUNREACHABLE;
- }
-
- void GrGLSLVaryingHandler::addVarying(const char* name, GrGLSLVarying* varying,
- Interpolation interpolation) {
- SkASSERT(GrSLTypeIsFloatType(varying->type()) || Interpolation::kMustBeFlat == interpolation);
- bool willUseGeoShader = fProgramBuilder->primitiveProcessor().willUseGeoShader();
- VaryingInfo& v = fVaryings.push_back();
-
-diff --git a/gfx/skia/skia/src/gpu/glsl/GrGLSLVertexGeoBuilder.cpp b/gfx/skia/skia/src/gpu/glsl/GrGLSLVertexGeoBuilder.cpp
---- a/gfx/skia/skia/src/gpu/glsl/GrGLSLVertexGeoBuilder.cpp
-+++ b/gfx/skia/skia/src/gpu/glsl/GrGLSLVertexGeoBuilder.cpp
-@@ -46,26 +46,28 @@ void GrGLSLVertexBuilder::onFinalize() {
- static const char* input_type_name(GrGLSLGeometryBuilder::InputType in) {
- using InputType = GrGLSLGeometryBuilder::InputType;
- switch (in) {
- case InputType::kPoints: return "points";
- case InputType::kLines: return "lines";
- case InputType::kTriangles: return "triangles";
- }
- SK_ABORT("invalid input type");
-+ SkUNREACHABLE;
- }
-
- static const char* output_type_name(GrGLSLGeometryBuilder::OutputType out) {
- using OutputType = GrGLSLGeometryBuilder::OutputType;
- switch (out) {
- case OutputType::kPoints: return "points";
- case OutputType::kLineStrip: return "line_strip";
- case OutputType::kTriangleStrip: return "triangle_strip";
- }
- SK_ABORT("invalid output type");
-+ SkUNREACHABLE;
- }
-
- void GrGLSLGeometryBuilder::configure(InputType inputType, OutputType outputType, int maxVertices,
- int numInvocations) {
- SkASSERT(!this->isConfigured());
- fNumInvocations = numInvocations;
- this->addLayoutQualifier(input_type_name(inputType), kIn_InterfaceQualifier);
- this->addLayoutQualifier(SkStringPrintf("invocations = %i", numInvocations).c_str(),
-diff --git a/gfx/skia/skia/src/gpu/mtl/GrMtlCaps.mm b/gfx/skia/skia/src/gpu/mtl/GrMtlCaps.mm
---- a/gfx/skia/skia/src/gpu/mtl/GrMtlCaps.mm
-+++ b/gfx/skia/skia/src/gpu/mtl/GrMtlCaps.mm
-@@ -501,16 +501,17 @@ size_t GrMtlCaps::GetFormatIndex(MTLPixe
- static_assert(SK_ARRAY_COUNT(kMtlFormats) == GrMtlCaps::kNumMtlFormats,
- "Size of kMtlFormats array must match static value in header");
- for (size_t i = 0; i < GrMtlCaps::kNumMtlFormats; ++i) {
- if (kMtlFormats[i] == pixelFormat) {
- return i;
- }
- }
- SK_ABORT("Invalid MTLPixelFormat");
-+ SkUNREACHABLE;
- }
-
- void GrMtlCaps::initFormatTable() {
- FormatInfo* info;
-
- // Format: R8Unorm
- {
- info = &fFormatTable[GetFormatIndex(MTLPixelFormatR8Unorm)];
-@@ -1006,16 +1007,17 @@ GrBackendFormat GrMtlCaps::getBackendFor
- case SkImage::kETC1_CompressionType:
- #ifdef SK_BUILD_FOR_MAC
- return {};
- #else
- return GrBackendFormat::MakeMtl(MTLPixelFormatETC2_RGB8);
- #endif
- }
- SK_ABORT("Invalid compression type");
-+ SkUNREACHABLE;
- }
-
- GrSwizzle GrMtlCaps::getTextureSwizzle(const GrBackendFormat& format, GrColorType colorType) const {
- MTLPixelFormat mtlFormat = GrBackendFormatAsMTLPixelFormat(format);
- SkASSERT(mtlFormat != MTLPixelFormatInvalid);
- const auto& info = this->getFormatInfo(mtlFormat);
- for (int i = 0; i < info.fColorTypeInfoCount; ++i) {
- const auto& ctInfo = info.fColorTypeInfos[i];
-diff --git a/gfx/skia/skia/src/gpu/mtl/GrMtlPipelineStateBuilder.mm b/gfx/skia/skia/src/gpu/mtl/GrMtlPipelineStateBuilder.mm
---- a/gfx/skia/skia/src/gpu/mtl/GrMtlPipelineStateBuilder.mm
-+++ b/gfx/skia/skia/src/gpu/mtl/GrMtlPipelineStateBuilder.mm
-@@ -150,16 +150,17 @@ static inline MTLVertexFormat attribute_
- return MTLVertexFormatUShortNormalized;
- } else {
- return MTLVertexFormatInvalid;
- }
- case kUShort4_norm_GrVertexAttribType:
- return MTLVertexFormatUShort4Normalized;
- }
- SK_ABORT("Unknown vertex attribute type");
-+ SkUNREACHABLE;
- }
-
- static MTLVertexDescriptor* create_vertex_descriptor(const GrPrimitiveProcessor& primProc) {
- uint32_t vertexBinding = 0, instanceBinding = 0;
-
- int nextBinding = GrMtlUniformHandler::kLastUniformBinding + 1;
- if (primProc.hasVertexAttributes()) {
- vertexBinding = nextBinding++;
-@@ -271,16 +272,17 @@ static MTLBlendFactor blend_coeff_to_mtl
- } else {
- return MTLBlendFactorZero;
- }
- case kIllegal_GrBlendCoeff:
- return MTLBlendFactorZero;
- }
-
- SK_ABORT("Unknown blend coefficient");
-+ SkUNREACHABLE;
- }
-
- static MTLBlendOperation blend_equation_to_mtl_blend_op(GrBlendEquation equation) {
- static const MTLBlendOperation gTable[] = {
- MTLBlendOperationAdd, // kAdd_GrBlendEquation
- MTLBlendOperationSubtract, // kSubtract_GrBlendEquation
- MTLBlendOperationReverseSubtract, // kReverseSubtract_GrBlendEquation
- };
-diff --git a/gfx/skia/skia/src/gpu/mtl/GrMtlSampler.mm b/gfx/skia/skia/src/gpu/mtl/GrMtlSampler.mm
---- a/gfx/skia/skia/src/gpu/mtl/GrMtlSampler.mm
-+++ b/gfx/skia/skia/src/gpu/mtl/GrMtlSampler.mm
-@@ -33,16 +33,17 @@ static inline MTLSamplerAddressMode wrap
- } else
- #endif
- {
- SkASSERT(false);
- return MTLSamplerAddressModeClampToEdge;
- }
- }
- SK_ABORT("Unknown wrap mode.");
-+ SkUNREACHABLE;
- }
-
- GrMtlSampler* GrMtlSampler::Create(const GrMtlGpu* gpu, const GrSamplerState& samplerState) {
- static MTLSamplerMinMagFilter mtlMinMagFilterModes[] = {
- MTLSamplerMinMagFilterNearest,
- MTLSamplerMinMagFilterLinear,
- MTLSamplerMinMagFilterLinear
- };
-diff --git a/gfx/skia/skia/src/gpu/mtl/GrMtlUniformHandler.mm b/gfx/skia/skia/src/gpu/mtl/GrMtlUniformHandler.mm
---- a/gfx/skia/skia/src/gpu/mtl/GrMtlUniformHandler.mm
-+++ b/gfx/skia/skia/src/gpu/mtl/GrMtlUniformHandler.mm
-@@ -85,16 +85,17 @@ static uint32_t grsltype_to_alignment_ma
- case kTexture2DSampler_GrSLType:
- case kTextureExternalSampler_GrSLType:
- case kTexture2DRectSampler_GrSLType:
- case kSampler_GrSLType:
- case kTexture2D_GrSLType:
- break;
- }
- SK_ABORT("Unexpected type");
-+ SkUNREACHABLE;
- }
-
- /** Returns the size in bytes taken up in Metal buffers for GrSLTypes. */
- static inline uint32_t grsltype_to_mtl_size(GrSLType type) {
- switch(type) {
- case kByte_GrSLType:
- return sizeof(int8_t);
- case kByte2_GrSLType:
-@@ -167,16 +168,17 @@ static inline uint32_t grsltype_to_mtl_s
- case kTexture2DSampler_GrSLType:
- case kTextureExternalSampler_GrSLType:
- case kTexture2DRectSampler_GrSLType:
- case kSampler_GrSLType:
- case kTexture2D_GrSLType:
- break;
- }
- SK_ABORT("Unexpected type");
-+ SkUNREACHABLE;
- }
-
- // Given the current offset into the ubo, calculate the offset for the uniform we're trying to add
- // taking into consideration all alignment requirements. The uniformOffset is set to the offset for
- // the new uniform, and currentOffset is updated to be the offset to the end of the new uniform.
- static void get_ubo_aligned_offset(uint32_t* uniformOffset,
- uint32_t* currentOffset,
- uint32_t* maxAlignment,
-diff --git a/gfx/skia/skia/src/gpu/mtl/GrMtlUtil.mm b/gfx/skia/skia/src/gpu/mtl/GrMtlUtil.mm
---- a/gfx/skia/skia/src/gpu/mtl/GrMtlUtil.mm
-+++ b/gfx/skia/skia/src/gpu/mtl/GrMtlUtil.mm
-@@ -107,16 +107,17 @@ bool GrPixelConfigToMTLFormat(GrPixelCon
- case kRGBA_16161616_GrPixelConfig:
- *format = MTLPixelFormatRGBA16Unorm;
- return true;
- case kRG_half_GrPixelConfig:
- *format = MTLPixelFormatRG16Float;
- return true;
- }
- SK_ABORT("Unexpected config");
-+ SkUNREACHABLE;
- }
-
- MTLTextureDescriptor* GrGetMTLTextureDescriptor(id<MTLTexture> mtlTexture) {
- MTLTextureDescriptor* texDesc = [[MTLTextureDescriptor alloc] init];
- texDesc.textureType = mtlTexture.textureType;
- texDesc.pixelFormat = mtlTexture.pixelFormat;
- texDesc.width = mtlTexture.width;
- texDesc.height = mtlTexture.height;
-diff --git a/gfx/skia/skia/src/gpu/ops/GrDrawVerticesOp.cpp b/gfx/skia/skia/src/gpu/ops/GrDrawVerticesOp.cpp
---- a/gfx/skia/skia/src/gpu/ops/GrDrawVerticesOp.cpp
-+++ b/gfx/skia/skia/src/gpu/ops/GrDrawVerticesOp.cpp
-@@ -605,16 +605,17 @@ static uint32_t seed_vertices(GrPrimitiv
- case GrPrimitiveType::kLines:
- case GrPrimitiveType::kLineStrip:
- return 2;
- case GrPrimitiveType::kPath:
- SkASSERT(0);
- return 0;
- }
- SK_ABORT("Incomplete switch\n");
-+ SkUNREACHABLE;
- }
-
- static uint32_t primitive_vertices(GrPrimitiveType type) {
- switch (type) {
- case GrPrimitiveType::kTriangles:
- return 3;
- case GrPrimitiveType::kLines:
- return 2;
-@@ -622,16 +623,17 @@ static uint32_t primitive_vertices(GrPri
- case GrPrimitiveType::kPoints:
- case GrPrimitiveType::kLineStrip:
- return 1;
- case GrPrimitiveType::kPath:
- SkASSERT(0);
- return 0;
- }
- SK_ABORT("Incomplete switch\n");
-+ SkUNREACHABLE;
- }
-
- static SkPoint random_point(SkRandom* random, SkScalar min, SkScalar max) {
- SkPoint p;
- p.fX = random->nextRangeScalar(min, max);
- p.fY = random->nextRangeScalar(min, max);
- return p;
- }
-diff --git a/gfx/skia/skia/src/gpu/ops/GrFillRRectOp.cpp b/gfx/skia/skia/src/gpu/ops/GrFillRRectOp.cpp
---- a/gfx/skia/skia/src/gpu/ops/GrFillRRectOp.cpp
-+++ b/gfx/skia/skia/src/gpu/ops/GrFillRRectOp.cpp
-@@ -818,9 +818,10 @@ static bool can_use_hw_derivatives_with_
- if (!can_use_hw_derivatives_with_coverage(devScale, rrect.radii(corner))) {
- return false;
- }
- }
- return true;
- }
- }
- SK_ABORT("Invalid round rect type.");
-+ SkUNREACHABLE;
- }
-diff --git a/gfx/skia/skia/src/gpu/ops/GrOvalOpFactory.cpp b/gfx/skia/skia/src/gpu/ops/GrOvalOpFactory.cpp
---- a/gfx/skia/skia/src/gpu/ops/GrOvalOpFactory.cpp
-+++ b/gfx/skia/skia/src/gpu/ops/GrOvalOpFactory.cpp
-@@ -2278,39 +2278,42 @@ static int rrect_type_to_vert_count(RRec
- switch (type) {
- case kFill_RRectType:
- case kStroke_RRectType:
- return kVertsPerStandardRRect;
- case kOverstroke_RRectType:
- return kVertsPerOverstrokeRRect;
- }
- SK_ABORT("Invalid type");
-+ SkUNREACHABLE;
- }
-
- static int rrect_type_to_index_count(RRectType type) {
- switch (type) {
- case kFill_RRectType:
- return kIndicesPerFillRRect;
- case kStroke_RRectType:
- return kIndicesPerStrokeRRect;
- case kOverstroke_RRectType:
- return kIndicesPerOverstrokeRRect;
- }
- SK_ABORT("Invalid type");
-+ SkUNREACHABLE;
- }
-
- static const uint16_t* rrect_type_to_indices(RRectType type) {
- switch (type) {
- case kFill_RRectType:
- case kStroke_RRectType:
- return gStandardRRectIndices;
- case kOverstroke_RRectType:
- return gOverstrokeRRectIndices;
- }
- SK_ABORT("Invalid type");
-+ SkUNREACHABLE;
- }
-
- ///////////////////////////////////////////////////////////////////////////////////////////////////
-
- // For distance computations in the interior of filled rrects we:
- //
- // add a interior degenerate (point or line) rect
- // each vertex of that rect gets -outerRad as its radius
-diff --git a/gfx/skia/skia/src/gpu/ops/GrShadowRRectOp.cpp b/gfx/skia/skia/src/gpu/ops/GrShadowRRectOp.cpp
---- a/gfx/skia/skia/src/gpu/ops/GrShadowRRectOp.cpp
-+++ b/gfx/skia/skia/src/gpu/ops/GrShadowRRectOp.cpp
-@@ -150,39 +150,42 @@ static int rrect_type_to_vert_count(RRec
- case kFill_RRectType:
- return kVertsPerFillRRect;
- case kStroke_RRectType:
- return kVertsPerStrokeRRect;
- case kOverstroke_RRectType:
- return kVertsPerOverstrokeRRect;
- }
- SK_ABORT("Invalid type");
-+ SkUNREACHABLE;
- }
-
- static int rrect_type_to_index_count(RRectType type) {
- switch (type) {
- case kFill_RRectType:
- return kIndicesPerFillRRect;
- case kStroke_RRectType:
- return kIndicesPerStrokeRRect;
- case kOverstroke_RRectType:
- return kIndicesPerOverstrokeRRect;
- }
- SK_ABORT("Invalid type");
-+ SkUNREACHABLE;
- }
-
- static const uint16_t* rrect_type_to_indices(RRectType type) {
- switch (type) {
- case kFill_RRectType:
- case kStroke_RRectType:
- return gRRectIndices + 6*4;
- case kOverstroke_RRectType:
- return gRRectIndices;
- }
- SK_ABORT("Invalid type");
-+ SkUNREACHABLE;
- }
-
- ///////////////////////////////////////////////////////////////////////////////
- namespace {
-
- class ShadowCircularRRectOp final : public GrMeshDrawOp {
- public:
- DEFINE_OP_CLASS_ID
-diff --git a/gfx/skia/skia/src/gpu/text/GrTextBlob.h b/gfx/skia/skia/src/gpu/text/GrTextBlob.h
---- a/gfx/skia/skia/src/gpu/text/GrTextBlob.h
-+++ b/gfx/skia/skia/src/gpu/text/GrTextBlob.h
-@@ -120,16 +120,17 @@ public:
- }
-
- void operator delete(void* p) {
- ::operator delete(p);
- }
-
- void* operator new(size_t) {
- SK_ABORT("All blobs are created by placement new.");
-+ SkUNREACHABLE;
- }
-
- void* operator new(size_t, void* p) { return p; }
-
- bool hasDistanceField() const { return SkToBool(fTextType & kHasDistanceField_TextType); }
- bool hasBitmap() const { return SkToBool(fTextType & kHasBitmap_TextType); }
- void setHasDistanceField() { fTextType |= kHasDistanceField_TextType; }
- void setHasBitmap() { fTextType |= kHasBitmap_TextType; }
-diff --git a/gfx/skia/skia/src/gpu/text/GrTextBlobVertexRegenerator.cpp b/gfx/skia/skia/src/gpu/text/GrTextBlobVertexRegenerator.cpp
---- a/gfx/skia/skia/src/gpu/text/GrTextBlobVertexRegenerator.cpp
-+++ b/gfx/skia/skia/src/gpu/text/GrTextBlobVertexRegenerator.cpp
-@@ -279,9 +279,10 @@ bool GrTextBlob::VertexRegenerator::rege
- // set use tokens for all of the glyphs in our subrun. This is only valid if we
- // have a valid atlas generation
- fFullAtlasManager->setUseTokenBulk(*fSubRun->bulkUseToken(),
- fUploadTarget->tokenTracker()->nextDrawToken(),
- fSubRun->maskFormat());
- return true;
- }
- SK_ABORT("Should not get here");
-+ SkUNREACHABLE;
- }
-diff --git a/gfx/skia/skia/src/gpu/vk/GrVkCaps.cpp b/gfx/skia/skia/src/gpu/vk/GrVkCaps.cpp
---- a/gfx/skia/skia/src/gpu/vk/GrVkCaps.cpp
-+++ b/gfx/skia/skia/src/gpu/vk/GrVkCaps.cpp
-@@ -103,16 +103,17 @@ static FormatCompatibilityClass format_c
- case VK_FORMAT_R8G8B8_UNORM:
- return FormatCompatibilityClass::k24_3_1;
-
- case VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:
- return FormatCompatibilityClass::kETC2_RGB_8_16;
-
- default:
- SK_ABORT("Unsupported VkFormat");
-+ SkUNREACHABLE;
- }
- }
-
- bool GrVkCaps::canCopyImage(VkFormat dstFormat, int dstSampleCnt, bool dstHasYcbcr,
- VkFormat srcFormat, int srcSampleCnt, bool srcHasYcbcr) const {
- if ((dstSampleCnt > 1 || srcSampleCnt > 1) && dstSampleCnt != srcSampleCnt) {
- return false;
- }
-@@ -1651,16 +1652,17 @@ GrBackendFormat GrVkCaps::onGetDefaultBa
-
- GrBackendFormat GrVkCaps::getBackendFormatFromCompressionType(
- SkImage::CompressionType compressionType) const {
- switch (compressionType) {
- case SkImage::kETC1_CompressionType:
- return GrBackendFormat::MakeVk(VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK);
- }
- SK_ABORT("Invalid compression type");
-+ SkUNREACHABLE;
- }
-
- GrSwizzle GrVkCaps::getTextureSwizzle(const GrBackendFormat& format, GrColorType colorType) const {
- VkFormat vkFormat;
- SkAssertResult(format.asVkFormat(&vkFormat));
- const auto& info = this->getFormatInfo(vkFormat);
- for (int i = 0; i < info.fColorTypeInfoCount; ++i) {
- const auto& ctInfo = info.fColorTypeInfos[i];
-diff --git a/gfx/skia/skia/src/gpu/vk/GrVkMemory.cpp b/gfx/skia/skia/src/gpu/vk/GrVkMemory.cpp
---- a/gfx/skia/skia/src/gpu/vk/GrVkMemory.cpp
-+++ b/gfx/skia/skia/src/gpu/vk/GrVkMemory.cpp
-@@ -23,16 +23,17 @@ static BufferUsage get_buffer_usage(GrVk
- case GrVkBuffer::kUniform_Type:
- SkASSERT(dynamic);
- return BufferUsage::kCpuWritesGpuReads;
- case GrVkBuffer::kCopyRead_Type: // fall through
- case GrVkBuffer::kCopyWrite_Type:
- return BufferUsage::kCpuOnly;
- }
- SK_ABORT("Invalid GrVkBuffer::Type");
-+ SkUNREACHABLE;
- }
-
- bool GrVkMemory::AllocAndBindBufferMemory(const GrVkGpu* gpu,
- VkBuffer buffer,
- GrVkBuffer::Type type,
- bool dynamic,
- GrVkAlloc* alloc) {
- GrVkMemoryAllocator* allocator = gpu->memoryAllocator();
-diff --git a/gfx/skia/skia/src/gpu/vk/GrVkPipeline.cpp b/gfx/skia/skia/src/gpu/vk/GrVkPipeline.cpp
---- a/gfx/skia/skia/src/gpu/vk/GrVkPipeline.cpp
-+++ b/gfx/skia/skia/src/gpu/vk/GrVkPipeline.cpp
-@@ -75,16 +75,17 @@ static inline VkFormat attrib_type_to_vk
- case kUint_GrVertexAttribType:
- return VK_FORMAT_R32_UINT;
- case kUShort_norm_GrVertexAttribType:
- return VK_FORMAT_R16_UNORM;
- case kUShort4_norm_GrVertexAttribType:
- return VK_FORMAT_R16G16B16A16_UNORM;
- }
- SK_ABORT("Unknown vertex attrib type");
-+ SkUNREACHABLE;
- }
-
- static void setup_vertex_input_state(const GrPrimitiveProcessor& primProc,
- VkPipelineVertexInputStateCreateInfo* vertexInputInfo,
- SkSTArray<2, VkVertexInputBindingDescription, true>* bindingDescs,
- VkVertexInputAttributeDescription* attributeDesc) {
- uint32_t vertexBinding = 0, instanceBinding = 0;
-
-@@ -157,18 +158,20 @@ static VkPrimitiveTopology gr_primitive_
- case GrPrimitiveType::kPoints:
- return VK_PRIMITIVE_TOPOLOGY_POINT_LIST;
- case GrPrimitiveType::kLines:
- return VK_PRIMITIVE_TOPOLOGY_LINE_LIST;
- case GrPrimitiveType::kLineStrip:
- return VK_PRIMITIVE_TOPOLOGY_LINE_STRIP;
- case GrPrimitiveType::kPath:
- SK_ABORT("Unsupported primitive type");
-+ SkUNREACHABLE;
- }
- SK_ABORT("invalid GrPrimitiveType");
-+ SkUNREACHABLE;
- }
-
- static void setup_input_assembly_state(GrPrimitiveType primitiveType,
- VkPipelineInputAssemblyStateCreateInfo* inputAssemblyInfo) {
- memset(inputAssemblyInfo, 0, sizeof(VkPipelineInputAssemblyStateCreateInfo));
- inputAssemblyInfo->sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO;
- inputAssemblyInfo->pNext = nullptr;
- inputAssemblyInfo->flags = 0;
-diff --git a/gfx/skia/skia/src/gpu/vk/GrVkSampler.cpp b/gfx/skia/skia/src/gpu/vk/GrVkSampler.cpp
---- a/gfx/skia/skia/src/gpu/vk/GrVkSampler.cpp
-+++ b/gfx/skia/skia/src/gpu/vk/GrVkSampler.cpp
-@@ -18,16 +18,17 @@ static inline VkSamplerAddressMode wrap_
- case GrSamplerState::WrapMode::kRepeat:
- return VK_SAMPLER_ADDRESS_MODE_REPEAT;
- case GrSamplerState::WrapMode::kMirrorRepeat:
- return VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT;
- case GrSamplerState::WrapMode::kClampToBorder:
- return VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER;
- }
- SK_ABORT("Unknown wrap mode.");
-+ SkUNREACHABLE;
- }
-
- GrVkSampler* GrVkSampler::Create(GrVkGpu* gpu, const GrSamplerState& samplerState,
- const GrVkYcbcrConversionInfo& ycbcrInfo) {
- static VkFilter vkMinFilterModes[] = {
- VK_FILTER_NEAREST,
- VK_FILTER_LINEAR,
- VK_FILTER_LINEAR
-diff --git a/gfx/skia/skia/src/gpu/vk/GrVkTransferBuffer.h b/gfx/skia/skia/src/gpu/vk/GrVkTransferBuffer.h
---- a/gfx/skia/skia/src/gpu/vk/GrVkTransferBuffer.h
-+++ b/gfx/skia/skia/src/gpu/vk/GrVkTransferBuffer.h
-@@ -29,16 +29,17 @@ private:
- const SkString& dumpName) const override;
-
- void onMap() override { this->GrGpuBuffer::fMapPtr = this->vkMap(this->getVkGpu()); }
-
- void onUnmap() override { this->vkUnmap(this->getVkGpu()); }
-
- bool onUpdateData(const void* src, size_t srcSizeInBytes) override {
- SK_ABORT("Not implemented for transfer buffers.");
-+ SkUNREACHABLE;
- }
-
- GrVkGpu* getVkGpu() const {
- SkASSERT(!this->wasDestroyed());
- return reinterpret_cast<GrVkGpu*>(this->getGpu());
- }
-
- typedef GrGpuBuffer INHERITED;
-diff --git a/gfx/skia/skia/src/gpu/vk/GrVkUniformHandler.cpp b/gfx/skia/skia/src/gpu/vk/GrVkUniformHandler.cpp
---- a/gfx/skia/skia/src/gpu/vk/GrVkUniformHandler.cpp
-+++ b/gfx/skia/skia/src/gpu/vk/GrVkUniformHandler.cpp
-@@ -84,16 +84,17 @@ static uint32_t grsltype_to_alignment_ma
- case kTexture2DSampler_GrSLType:
- case kTextureExternalSampler_GrSLType:
- case kTexture2DRectSampler_GrSLType:
- case kSampler_GrSLType:
- case kTexture2D_GrSLType:
- break;
- }
- SK_ABORT("Unexpected type");
-+ SkUNREACHABLE;
- }
-
- /** Returns the size in bytes taken up in vulkanbuffers for GrSLTypes. */
- static inline uint32_t grsltype_to_vk_size(GrSLType type) {
- switch(type) {
- case kByte_GrSLType:
- return sizeof(int8_t);
- case kByte2_GrSLType:
-@@ -167,16 +168,17 @@ static inline uint32_t grsltype_to_vk_si
- case kTexture2DSampler_GrSLType:
- case kTextureExternalSampler_GrSLType:
- case kTexture2DRectSampler_GrSLType:
- case kSampler_GrSLType:
- case kTexture2D_GrSLType:
- break;
- }
- SK_ABORT("Unexpected type");
-+ SkUNREACHABLE;
- }
-
-
- // Given the current offset into the ubo, calculate the offset for the uniform we're trying to add
- // taking into consideration all alignment requirements. The uniformOffset is set to the offset for
- // the new uniform, and currentOffset is updated to be the offset to the end of the new uniform.
- static void get_ubo_aligned_offset(uint32_t* uniformOffset,
- uint32_t* currentOffset,
-diff --git a/gfx/skia/skia/src/gpu/vk/GrVkVaryingHandler.cpp b/gfx/skia/skia/src/gpu/vk/GrVkVaryingHandler.cpp
---- a/gfx/skia/skia/src/gpu/vk/GrVkVaryingHandler.cpp
-+++ b/gfx/skia/skia/src/gpu/vk/GrVkVaryingHandler.cpp
-@@ -69,16 +69,17 @@ static inline int grsltype_to_location_s
- case kByte_GrSLType:
- return 1;
- case kUint_GrSLType: // fall through
- case kUShort_GrSLType:
- case kUByte_GrSLType:
- return 1;
- }
- SK_ABORT("Unexpected type");
-+ SkUNREACHABLE;
- }
-
- static void finalize_helper(GrVkVaryingHandler::VarArray& vars) {
- int locationIndex = 0;
- for (int i = 0; i < vars.count(); ++i) {
- GrShaderVar& var = vars[i];
- SkString location;
- location.appendf("location = %d", locationIndex);
-diff --git a/gfx/skia/skia/src/pdf/SkPDFTag.cpp b/gfx/skia/skia/src/pdf/SkPDFTag.cpp
---- a/gfx/skia/skia/src/pdf/SkPDFTag.cpp
-+++ b/gfx/skia/skia/src/pdf/SkPDFTag.cpp
-@@ -59,16 +59,17 @@ static const char* tag_name_from_type(Sk
- M(WT);
- M(WP);
- M(Figure);
- M(Formula);
- M(Form);
- #undef M
- }
- SK_ABORT("bad tag");
-+ SkUNREACHABLE;
- }
-
- struct SkPDFTagNode {
- SkPDFTagNode* fChildren = nullptr;
- size_t fChildCount = 0;
- struct MarkedContentInfo {
- unsigned fPageIndex;
- int fMarkId;
-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
-@@ -168,28 +168,32 @@ public:
- SkFontMgr_FCI(sk_sp<SkFontConfigInterface> fci)
- : fFCI(std::move(fci))
- , fCache(kMaxSize)
- {}
-
+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 {
SK_ABORT("Not implemented.");
@@ -1837,85 +207,60 @@
}
SkTypeface* onMatchFamilyStyle(const char requestedFamilyName[],
- const SkFontStyle& requestedStyle) const override
- {
- SkAutoMutexExclusive ama(fMutex);
-
- SkFontConfigInterface::FontIdentity identity;
-@@ -210,20 +214,22 @@ protected:
+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<Expression> Compiler::co
}
- return face.release();
+ default:
+ SK_ABORT("unsupported symbol type %d\n", (int) result->kind());
++ SkUNREACHABLE;
}
+ }
- SkTypeface* onMatchFamilyStyleCharacter(const char familyName[], const SkFontStyle&,
- const char* bcp47[], int bcp47Count,
- SkUnichar character) const override {
- SK_ABORT("Not implemented.");
-+ SkUNREACHABLE;
+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;
+ case Kind::COMMA: return OperatorPrecedence::kSequence;
+- default: SK_ABORT("unsupported binary operator");
++ default: SkUNREACHABLE;
}
+ }
- SkTypeface* onMatchFaceStyle(const SkTypeface*, const SkFontStyle&) const override {
- SK_ABORT("Not implemented.");
-+ SkUNREACHABLE;
- }
+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:
- sk_sp<SkTypeface> onMakeFromData(sk_sp<SkData> data, int ttcIndex) const override {
- return this->onMakeFromStreamIndex(SkMemoryStream::Make(std::move(data)), ttcIndex);
+ virtual const std::vector<Field>& fields() const {
+ SK_ABORT("Internal error: not a struct");
++ SkUNREACHABLE;
}
- sk_sp<SkTypeface> onMakeFromStreamIndex(std::unique_ptr<SkStreamAsset> stream,
- int ttcIndex) const override {
-diff --git a/gfx/skia/skia/src/shaders/SkImageShader.cpp b/gfx/skia/skia/src/shaders/SkImageShader.cpp
---- a/gfx/skia/skia/src/shaders/SkImageShader.cpp
-+++ b/gfx/skia/skia/src/shaders/SkImageShader.cpp
-@@ -178,16 +178,17 @@ static GrSamplerState::WrapMode tile_mod
- case SkTileMode::kRepeat:
- return GrSamplerState::WrapMode::kRepeat;
- case SkTileMode::kMirror:
- return GrSamplerState::WrapMode::kMirrorRepeat;
- case SkTileMode::kDecal:
- return GrSamplerState::WrapMode::kClampToBorder;
- }
- SK_ABORT("Unknown tile mode.");
-+ SkUNREACHABLE;
- }
-
- std::unique_ptr<GrFragmentProcessor> SkImageShader::asFragmentProcessor(
- const GrFPArgs& args) const {
- const auto lm = this->totalLocalMatrix(args.fPreLocalMatrix, args.fPostLocalMatrix);
- SkMatrix lmInverse;
- if (!lm->invert(&lmInverse)) {
- return nullptr;
-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
-@@ -144,16 +144,17 @@ struct SpotVerticesFactory {
- // if the offsets don't match.
- if (fOffset == that.fOffset) {
- translate->set(0, 0);
- return true;
- }
- return false;
+ /**
+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;
}
SK_ABORT("Uninitialized occluder type?");
-+ SkUNREACHABLE;
++ SkUNREACHABLE;
}
sk_sp<SkVertices> makeVertices(const SkPath& path, const SkMatrix& ctm,
- SkVector* translate) const {
- bool transparent = OccluderType::kTransparent == fOccluderType;
- SkPoint3 zParams = SkPoint3::Make(0, 0, fOccluderHeight);
- if (ctm.hasPerspective() || OccluderType::kOpaquePartialUmbra == fOccluderType) {
- translate->set(0, 0);
-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
-@@ -278,27 +278,29 @@ Precision IncrementPrecision::withMinFra
- }
-
- FractionPrecision Precision::constructFraction(int32_t minFrac, int32_t maxFrac) {
- FractionSignificantSettings settings;
- settings.fMinFrac = static_cast<digits_t>(minFrac);
+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<digits_t>(maxFrac);
settings.fMinSig = -1;
settings.fMaxSig = -1;
@@ -1923,11 +268,7 @@
PrecisionUnion union_;
union_.fracSig = settings;
return {RND_FRACTION, union_};
- }
-
- Precision Precision::constructSignificant(int32_t minSig, int32_t maxSig) {
- FractionSignificantSettings settings;
- settings.fMinFrac = -1;
+@@ -294,6 +295,7 @@ Precision Precision::constructSignifican
settings.fMaxFrac = -1;
settings.fMinSig = static_cast<digits_t>(minSig);
settings.fMaxSig = static_cast<digits_t>(maxSig);
@@ -1935,20 +276,23 @@
PrecisionUnion union_;
union_.fracSig = settings;
return {RND_SIGNIFICANT, union_};
+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();
+ }
++ UNREACHABLE();
}
- Precision
- Precision::constructFractionSignificant(
- const FractionPrecision &base,
-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
-@@ -17,16 +17,17 @@ namespace webrtc {
- const char* ResourceUsageStateToString(ResourceUsageState usage_state) {
- switch (usage_state) {
- case ResourceUsageState::kOveruse:
- return "kOveruse";
- case ResourceUsageState::kUnderuse:
+ } // namespace
+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";
}
RTC_CHECK_NOTREACHED();
@@ -1956,20 +300,11 @@
}
ResourceListener::~ResourceListener() {}
-
- Resource::Resource() {}
-
- Resource::~Resource() {}
-
-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
-@@ -27,16 +27,17 @@ const char* DegradationPreferenceToStrin
- case DegradationPreference::MAINTAIN_FRAMERATE:
- return "maintain-framerate";
- case DegradationPreference::MAINTAIN_RESOLUTION:
- return "maintain-resolution";
- case DegradationPreference::BALANCED:
+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";
}
RTC_CHECK_NOTREACHED();
@@ -1977,20 +312,11 @@
}
const double kDefaultBitratePriority = 1.0;
-
- RtcpFeedback::RtcpFeedback() = default;
- RtcpFeedback::RtcpFeedback(RtcpFeedbackType type) : type(type) {}
- RtcpFeedback::RtcpFeedback(RtcpFeedbackType type,
- RtcpFeedbackMessageType message_type)
-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
-@@ -94,16 +94,18 @@ const char* VideoFrameBufferTypeToString
- return "kI010";
- case VideoFrameBuffer::Type::kI210:
- return "kI210";
- case VideoFrameBuffer::Type::kNV12:
- return "kNV12";
+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();
}
@@ -1999,20 +325,11 @@
}
int I420BufferInterface::ChromaWidth() const {
- return (width() + 1) / 2;
- }
-
- int I420BufferInterface::ChromaHeight() const {
- return (height() + 1) / 2;
-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
-@@ -113,16 +113,17 @@ const char* CodecTypeToPayloadString(Vid
- case kVideoCodecH264:
- return kPayloadNameH264;
- case kVideoCodecMultiplex:
- return kPayloadNameMultiplex;
- case kVideoCodecGeneric:
+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;
}
RTC_CHECK_NOTREACHED();
@@ -2020,20 +337,11 @@
}
VideoCodecType PayloadStringToCodecType(const std::string& name) {
- if (absl::EqualsIgnoreCase(name, kPayloadNameVp8))
- return kVideoCodecVP8;
- if (absl::EqualsIgnoreCase(name, kPayloadNameVp9))
- return kVideoCodecVP9;
- if (absl::EqualsIgnoreCase(name, kPayloadNameAv1) ||
-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
-@@ -158,16 +158,17 @@ class VideoEncoderSoftwareFallbackWrappe
- [[fallthrough]];
- case EncoderState::kMainEncoderUsed:
- return encoder_.get();
- case EncoderState::kFallbackDueToFailure:
- case EncoderState::kForcedFallback:
+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();
}
RTC_CHECK_NOTREACHED();
@@ -2041,17 +349,7 @@
}
// Updates encoder with last observed parameters, such as callbacks, rates,
- // etc.
- void PrimeEncoder(VideoEncoder* encoder) const;
-
- // Settings used in the last InitEncode call and used if a dynamic fallback to
- // software is required.
-@@ -338,16 +339,17 @@ int32_t VideoEncoderSoftwareFallbackWrap
- case EncoderState::kMainEncoderUsed: {
- return EncodeWithMainEncoder(frame, frame_types);
- }
- case EncoderState::kFallbackDueToFailure:
- case EncoderState::kForcedFallback:
+@@ -343,6 +344,7 @@ int32_t VideoEncoderSoftwareFallbackWrap
return fallback_encoder_->Encode(frame, frame_types);
}
RTC_CHECK_NOTREACHED();
@@ -2059,20 +357,11 @@
}
int32_t VideoEncoderSoftwareFallbackWrapper::EncodeWithMainEncoder(
- const VideoFrame& frame,
- const std::vector<VideoFrameType>* frame_types) {
- int32_t ret = encoder_->Encode(frame, frame_types);
- // If requested, try a software fallback.
- bool fallback_requested = (ret == WEBRTC_VIDEO_CODEC_FALLBACK_SOFTWARE);
-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
-@@ -163,16 +163,17 @@ const char* Adaptation::StatusToString(A
- case Status::kInsufficientInput:
- return "kInsufficientInput";
- case Status::kAdaptationDisabled:
- return "kAdaptationDisabled";
- case Status::kRejectedByConstraint:
+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";
}
RTC_CHECK_NOTREACHED();
@@ -2080,17 +369,7 @@
}
Adaptation::Adaptation(int validation_id,
- VideoSourceRestrictions restrictions,
- VideoAdaptationCounters counters,
- VideoStreamInputState input_state)
- : validation_id_(validation_id),
- status_(Status::kValid),
-@@ -385,16 +386,17 @@ VideoStreamAdapter::RestrictionsOrState
- case DegradationPreference::MAINTAIN_RESOLUTION: {
- // Scale up framerate.
- return IncreaseFramerate(input_state, current_restrictions_);
- }
- case DegradationPreference::DISABLED:
+@@ -390,6 +391,7 @@ VideoStreamAdapter::RestrictionsOrState
return Adaptation::Status::kAdaptationDisabled;
}
RTC_CHECK_NOTREACHED();
@@ -2098,17 +377,7 @@
}
Adaptation VideoStreamAdapter::GetAdaptationDown() {
- RTC_DCHECK_RUN_ON(&sequence_checker_);
- VideoStreamInputState input_state = input_state_provider_->InputState();
- ++adaptation_validation_id_;
- RestrictionsOrState restrictions_or_state =
- GetAdaptationDownStep(input_state, current_restrictions_);
-@@ -467,16 +469,17 @@ VideoStreamAdapter::GetAdaptationDownSte
- }
- case DegradationPreference::MAINTAIN_RESOLUTION: {
- return DecreaseFramerate(input_state, current_restrictions);
- }
- case DegradationPreference::DISABLED:
+@@ -472,6 +474,7 @@ VideoStreamAdapter::GetAdaptationDownSte
return Adaptation::Status::kAdaptationDisabled;
}
RTC_CHECK_NOTREACHED();
@@ -2116,17 +385,7 @@
}
VideoStreamAdapter::RestrictionsOrState VideoStreamAdapter::DecreaseResolution(
- const VideoStreamInputState& input_state,
- const RestrictionsWithCounters& current_restrictions) {
- int target_pixels =
- GetLowerResolutionThan(input_state.frame_size_pixels().value());
- // Use single active stream if set, this stream could be lower than the input.
-@@ -620,16 +623,18 @@ Adaptation VideoStreamAdapter::GetAdaptD
- case DegradationPreference::MAINTAIN_FRAMERATE:
- return GetAdaptationDown();
- case DegradationPreference::BALANCED: {
- return RestrictionsOrStateToAdaptation(
- GetAdaptDownResolutionStepForBalanced(input_state), input_state);
+@@ -625,6 +628,8 @@ Adaptation VideoStreamAdapter::GetAdaptD
}
}
RTC_CHECK_NOTREACHED();
@@ -2135,20 +394,24 @@
}
VideoStreamAdapter::RestrictionsOrState
- VideoStreamAdapter::GetAdaptDownResolutionStepForBalanced(
- const VideoStreamInputState& input_state) const {
- // Adapt twice if the first adaptation did not decrease resolution.
- auto first_step = GetAdaptationDownStep(input_state, current_restrictions_);
- if (!absl::holds_alternative<RestrictionsWithCounters>(first_step)) {
-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
-@@ -25,16 +25,17 @@ const char* StreamTypeToString(VideoSend
- case VideoSendStream::StreamStats::StreamType::kMedia:
- return "media";
- case VideoSendStream::StreamStats::StreamType::kRtx:
- return "rtx";
- case VideoSendStream::StreamStats::StreamType::kFlexfec:
+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<FrameDependencyStructure>
+ case VideoCodecType::kVideoCodecMultiplex:
+ return absl::nullopt;
+ }
+- RTC_DCHECK_NOTREACHED() << "Unsupported codec.";
++ RTC_CHECK_NOTREACHED();
+ }
+
+ void RtpPayloadParams::GenericToGeneric(int64_t shared_frame_id,
+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";
}
RTC_CHECK_NOTREACHED();
@@ -2156,20 +419,36 @@
}
} // namespace
-
- VideoSendStream::StreamStats::StreamStats() = default;
- VideoSendStream::StreamStats::~StreamStats() = default;
+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<ClippingPredictor> Creat
+ config.reference_window_delay, config.clipping_threshold,
+ /*adaptive_step_estimation=*/false);
+ }
+- RTC_DCHECK_NOTREACHED();
++ RTC_CHECK_NOTREACHED();
+ }
- std::string VideoSendStream::StreamStats::ToString() const {
-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
-@@ -54,16 +54,18 @@ std::vector<float> PreprocessWeights(rtc
- rtc::FunctionView<float(float)> GetActivationFunction(
- ActivationFunction activation_function) {
- switch (activation_function) {
- case ActivationFunction::kTansigApproximated:
- return ::rnnoise::TansigApproximated;
+ } // namespace webrtc
+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.";
+ }
++ RTC_CHECK_NOTREACHED();
+ }
+
+ metrics::Histogram* CreateVolumeHistogram(InputVolumeType input_volume_type) {
+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<float(float)> GetActiv
case ActivationFunction::kSigmoidApproximated:
return ::rnnoise::SigmoidApproximated;
}
@@ -2178,20 +457,11 @@
}
} // namespace
-
- FullyConnectedLayer::FullyConnectedLayer(
- const int input_size,
- const int output_size,
- const rtc::ArrayView<const int8_t> bias,
-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
-@@ -115,16 +115,17 @@ GainControl::Mode Agc1ConfigModeToInterf
- case Agc1Config::kAdaptiveAnalog:
- return GainControl::kAdaptiveAnalog;
- case Agc1Config::kAdaptiveDigital:
- return GainControl::kAdaptiveDigital;
- case Agc1Config::kFixedDigital:
+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;
}
RTC_CHECK_NOTREACHED();
@@ -2199,17 +469,16 @@
}
bool MinimizeProcessingForUnusedOutput() {
- return !field_trial::IsEnabled("WebRTC-MutedStateKillSwitch");
+@@ -166,7 +167,7 @@ int AudioFormatValidityToErrorCode(Audio
+ case AudioFormatValidity::kInvalidChannelCount:
+ return AudioProcessing::kBadNumberChannelsError;
+ }
+- RTC_DCHECK(false);
++ RTC_CHECK_NOTREACHED();
}
- // Maximum lengths that frame of samples being passed from the render side to
- // the capture side can have (does not apply to AEC3).
-@@ -1989,16 +1990,17 @@ void AudioProcessingImpl::InitializeNois
- case NoiseSuppresionConfig::kModerate:
- return NsConfig::SuppressionLevel::k12dB;
- case NoiseSuppresionConfig::kHigh:
- return NsConfig::SuppressionLevel::k18dB;
- case NoiseSuppresionConfig::kVeryHigh:
+ // Returns an AudioProcessing::Error together with the best possible option for
+@@ -2421,6 +2422,7 @@ void AudioProcessingImpl::InitializeNois
return NsConfig::SuppressionLevel::k21dB;
}
RTC_CHECK_NOTREACHED();
@@ -2217,20 +486,11 @@
};
NsConfig cfg;
- cfg.target_level = map_level(config_.noise_suppression.level);
- submodules_.noise_suppressor = std::make_unique<NoiseSuppressor>(
- cfg, proc_sample_rate_hz(), num_proc_channels());
- }
- }
-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
-@@ -27,28 +27,30 @@ std::string NoiseSuppressionLevelToStrin
- case AudioProcessing::Config::NoiseSuppression::Level::kModerate:
- return "Moderate";
- case AudioProcessing::Config::NoiseSuppression::Level::kHigh:
- return "High";
- case AudioProcessing::Config::NoiseSuppression::Level::kVeryHigh:
+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";
}
RTC_CHECK_NOTREACHED();
@@ -2238,12 +498,7 @@
}
std::string GainController1ModeToString(const Agc1Config::Mode& mode) {
- switch (mode) {
- case Agc1Config::Mode::kAdaptiveAnalog:
- return "AdaptiveAnalog";
- case Agc1Config::Mode::kAdaptiveDigital:
- return "AdaptiveDigital";
- case Agc1Config::Mode::kFixedDigital:
+@@ -44,6 +45,7 @@ std::string GainController1ModeToString(
return "FixedDigital";
}
RTC_CHECK_NOTREACHED();
@@ -2251,20 +506,35 @@
}
} // namespace
-
- constexpr int AudioProcessing::kNativeSampleRatesHz[];
+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";
+ }
++ RTC_CHECK_NOTREACHED();
+ }
- void CustomProcessing::SetRuntimeSetting(
- AudioProcessing::RuntimeSetting setting) {}
-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
-@@ -33,11 +33,12 @@ std::unique_ptr<VideoRtpDepacketizer> Cr
- return std::make_unique<VideoRtpDepacketizerVp9>();
- case kVideoCodecAV1:
- return std::make_unique<VideoRtpDepacketizerAv1>();
- case kVideoCodecGeneric:
- case kVideoCodecMultiplex:
+ } // namespace
+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;
+ }
++ RTC_CHECK_NOTREACHED();
+ }
+
+ ScreenCastPortal::ScreenCastPortal(CaptureType type, PortalNotifier* notifier)
+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<VideoRtpDepacketizer> Cr
return std::make_unique<VideoRtpDepacketizerGeneric>();
}
RTC_CHECK_NOTREACHED();
@@ -2272,15 +542,11 @@
}
} // 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
-@@ -137,16 +137,17 @@ bool IsNonVolatile(RTPExtensionType type
- #if defined(WEBRTC_MOZILLA_BUILD)
- case kRtpExtensionCsrcAudioLevel:
- // TODO: Mozilla implement for CsrcAudioLevel
- RTC_CHECK(false);
- return false;
+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
}
RTC_CHECK_NOTREACHED();
@@ -2288,20 +554,11 @@
}
bool HasBweExtension(const RtpHeaderExtensionMap& extensions_map) {
- return extensions_map.IsRegistered(kRtpExtensionTransportSequenceNumber) ||
- extensions_map.IsRegistered(kRtpExtensionTransportSequenceNumber02) ||
- extensions_map.IsRegistered(kRtpExtensionAbsoluteSendTime) ||
- extensions_map.IsRegistered(kRtpExtensionTransmissionTimeOffset);
- }
-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
-@@ -40,16 +40,17 @@ namespace {
- case AudioFrameType::kEmptyFrame:
- return "empty";
- case AudioFrameType::kAudioFrameSpeech:
- return "audio_speech";
- case AudioFrameType::kAudioFrameCN:
+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";
}
RTC_CHECK_NOTREACHED();
@@ -2309,20 +566,23 @@
}
constexpr char kIncludeCaptureClockOffset[] =
- "WebRTC-IncludeCaptureClockOffset";
+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();
+ }
++ RTC_CHECK_NOTREACHED();
+ }
} // namespace
-
- RTPSenderAudio::RTPSenderAudio(Clock* clock, RTPSender* rtp_sender)
-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
-@@ -25,16 +25,17 @@ TemporalLayersChecker::CreateTemporalLay
- case Vp8TemporalLayersType::kFixedPattern:
- return std::make_unique<DefaultTemporalLayersChecker>(
- num_temporal_layers);
- case Vp8TemporalLayersType::kBitrateDynamic:
- // Conference mode temporal layering for screen content in base stream.
+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<TemporalLayersChecker>(num_temporal_layers);
}
RTC_CHECK_NOTREACHED();
@@ -2330,20 +590,11 @@
}
TemporalLayersChecker::TemporalLayersChecker(int num_temporal_layers)
- : num_temporal_layers_(num_temporal_layers),
- sequence_number_(0),
- last_sync_sequence_number_(0),
- last_tl0_sequence_number_(0) {}
-
-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
-@@ -58,16 +58,17 @@ bool IsFramerateScalingEnabled(Degradati
- std::string ToString(VideoAdaptationReason reason) {
- switch (reason) {
- case VideoAdaptationReason::kQuality:
- return "quality";
- case VideoAdaptationReason::kCpu:
+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";
}
RTC_CHECK_NOTREACHED();
@@ -2351,256 +602,3 @@
}
std::vector<bool> GetActiveLayersFlags(const VideoCodec& codec) {
- std::vector<bool> flags;
- if (codec.codecType == VideoCodecType::kVideoCodecVP9) {
- flags.resize(codec.VP9().numberOfSpatialLayers);
- for (size_t i = 0; i < flags.size(); ++i) {
- flags[i] = codec.spatialLayers[i].active;
-diff --git a/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/ast_to_hir.cpp b/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/ast_to_hir.cpp
---- a/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/ast_to_hir.cpp
-+++ b/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/ast_to_hir.cpp
-@@ -2646,16 +2646,17 @@ get_type_name_for_precision_qualifier(co
- unreachable("Unsupported sampler/image type");
- } /* sampler/image type */
- break;
- } /* GLSL_TYPE_SAMPLER/GLSL_TYPE_IMAGE */
- break;
- default:
- unreachable("Unsupported type");
- } /* base type */
-+ return "";
- }
-
- static unsigned
- select_gles_precision(unsigned qual_precision,
- const glsl_type *type,
- struct _mesa_glsl_parse_state *state, YYLTYPE *loc)
- {
- /* Precision qualifiers do not have any meaning in Desktop GLSL.
-diff --git a/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/ir.cpp b/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/ir.cpp
---- a/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/ir.cpp
-+++ b/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/ir.cpp
-@@ -619,16 +619,17 @@ ir_expression::get_num_operands(ir_expre
-
- if (op <= ir_last_triop)
- return 3;
-
- if (op <= ir_last_quadop)
- return 4;
-
- unreachable("Could not calculate number of operands");
-+ return -1;
- }
-
- #include "ir_expression_operation_strings.h"
-
- const char*
- depth_layout_string(ir_depth_layout layout)
- {
- switch(layout) {
-diff --git a/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/loop_analysis.cpp b/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/loop_analysis.cpp
---- a/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/loop_analysis.cpp
-+++ b/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/loop_analysis.cpp
-@@ -234,16 +234,17 @@ incremented_before_terminator(ir_loop *l
- }
-
- default:
- break;
- }
- }
-
- unreachable("Unable to find induction variable");
-+ return false;
- }
-
- /**
- * Record the fact that the given loop variable was referenced inside the loop.
- *
- * \arg in_assignee is true if the reference was on the LHS of an assignment.
- *
- * \arg in_conditional_code_or_nested_loop is true if the reference occurred
-diff --git a/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/opt_vectorize.cpp b/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/opt_vectorize.cpp
---- a/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/opt_vectorize.cpp
-+++ b/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/opt_vectorize.cpp
-@@ -224,16 +224,17 @@ write_mask_to_swizzle(unsigned write_mas
- {
- switch (write_mask) {
- case WRITEMASK_X: return SWIZZLE_X;
- case WRITEMASK_Y: return SWIZZLE_Y;
- case WRITEMASK_Z: return SWIZZLE_Z;
- case WRITEMASK_W: return SWIZZLE_W;
- }
- unreachable("not reached");
-+ return 0;
- }
-
- /**
- * Returns whether a single-channeled write mask matches a swizzle.
- */
- static bool
- write_mask_matches_swizzle(unsigned write_mask,
- const ir_swizzle *swz)
-diff --git a/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl_types.cpp b/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl_types.cpp
---- a/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl_types.cpp
-+++ b/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl_types.cpp
-@@ -455,16 +455,17 @@ const glsl_type *glsl_type::get_bare_typ
- case GLSL_TYPE_VOID:
- case GLSL_TYPE_SUBROUTINE:
- case GLSL_TYPE_FUNCTION:
- case GLSL_TYPE_ERROR:
- return this;
- }
-
- unreachable("Invalid base type");
-+ return nullptr;
- }
-
- const glsl_type *glsl_type::get_float16_type() const
- {
- assert(this->base_type == GLSL_TYPE_FLOAT);
-
- return get_instance(GLSL_TYPE_FLOAT16,
- this->vector_elements,
-@@ -2011,16 +2012,17 @@ glsl_type::get_explicit_std140_type(bool
- (enum glsl_interface_packing)this->interface_packing,
- this->interface_row_major,
- this->name);
-
- delete[] fields;
- return type;
- } else {
- unreachable("Invalid type for UBO or SSBO");
-+ return nullptr;
- }
- }
-
- unsigned
- glsl_type::std430_base_alignment(bool row_major) const
- {
-
- unsigned N = is_64bit() ? 8 : 4;
-@@ -2369,16 +2371,17 @@ glsl_type::get_explicit_std430_type(bool
- (enum glsl_interface_packing)this->interface_packing,
- this->interface_row_major,
- this->name);
-
- delete[] fields;
- return type;
- } else {
- unreachable("Invalid type for SSBO");
-+ return nullptr;
- }
- }
-
- const glsl_type *
- glsl_type::get_explicit_interface_type(bool supports_std430) const
- {
- enum glsl_interface_packing packing =
- this->get_internal_ifc_packing(supports_std430);
-@@ -2443,16 +2446,17 @@ glsl_type::get_explicit_type_for_size_al
- unsigned stride = align(col_size, col_align);
-
- *size = this->matrix_columns * stride;
- *alignment = col_align;
- return glsl_type::get_instance(this->base_type, this->vector_elements,
- this->matrix_columns, stride, false);
- } else {
- unreachable("Unhandled type.");
-+ return nullptr;
- }
- }
-
- unsigned
- glsl_type::count_vec4_slots(bool is_gl_vertex_input, bool is_bindless) const
- {
- /* From page 31 (page 37 of the PDF) of the GLSL 1.50 spec:
- *
-@@ -2943,12 +2947,13 @@ glsl_get_sampler_dim_coordinate_componen
- case GLSL_SAMPLER_DIM_SUBPASS:
- case GLSL_SAMPLER_DIM_SUBPASS_MS:
- return 2;
- case GLSL_SAMPLER_DIM_3D:
- case GLSL_SAMPLER_DIM_CUBE:
- return 3;
- default:
- unreachable("Unknown sampler dim");
-+ return -1;
- }
- }
-
- }
-diff --git a/third_party/rust/glslopt/glsl-optimizer/src/mesa/main/shaderobj.h b/third_party/rust/glslopt/glsl-optimizer/src/mesa/main/shaderobj.h
---- a/third_party/rust/glslopt/glsl-optimizer/src/mesa/main/shaderobj.h
-+++ b/third_party/rust/glslopt/glsl-optimizer/src/mesa/main/shaderobj.h
-@@ -180,16 +180,17 @@ static inline gl_shader_stage
- case GL_COMPUTE_SUBROUTINE_UNIFORM:
- return MESA_SHADER_COMPUTE;
- case GL_TESS_CONTROL_SUBROUTINE_UNIFORM:
- return MESA_SHADER_TESS_CTRL;
- case GL_TESS_EVALUATION_SUBROUTINE_UNIFORM:
- return MESA_SHADER_TESS_EVAL;
- }
- unreachable("not reached");
-+ return MESA_SHADER_NONE;
- }
-
- static inline gl_shader_stage
- _mesa_shader_stage_from_subroutine(GLenum subroutine)
- {
- switch (subroutine) {
- case GL_VERTEX_SUBROUTINE:
- return MESA_SHADER_VERTEX;
-@@ -200,16 +201,17 @@ static inline gl_shader_stage
- case GL_COMPUTE_SUBROUTINE:
- return MESA_SHADER_COMPUTE;
- case GL_TESS_CONTROL_SUBROUTINE:
- return MESA_SHADER_TESS_CTRL;
- case GL_TESS_EVALUATION_SUBROUTINE:
- return MESA_SHADER_TESS_EVAL;
- }
- unreachable("not reached");
-+ return MESA_SHADER_NONE;
- }
-
- static inline GLenum
- _mesa_shader_stage_to_subroutine(gl_shader_stage stage)
- {
- switch (stage) {
- case MESA_SHADER_VERTEX:
- return GL_VERTEX_SUBROUTINE;
-@@ -225,16 +227,17 @@ static inline GLenum
- return GL_TESS_EVALUATION_SUBROUTINE;
- case MESA_SHADER_NONE:
- break;
- case MESA_SHADER_KERNEL:
- unreachable("not reached");
- break;
- }
- unreachable("not reached");
-+ return GL_VERTEX_PROGRAM_ARB;
- }
-
- static inline GLenum
- _mesa_shader_stage_to_subroutine_uniform(gl_shader_stage stage)
- {
- switch (stage) {
- case MESA_SHADER_VERTEX:
- return GL_VERTEX_SUBROUTINE_UNIFORM;
-@@ -248,16 +251,17 @@ static inline GLenum
- return GL_TESS_CONTROL_SUBROUTINE_UNIFORM;
- case MESA_SHADER_TESS_EVAL:
- return GL_TESS_EVALUATION_SUBROUTINE_UNIFORM;
- case MESA_SHADER_NONE:
- case MESA_SHADER_KERNEL:
- break;
- }
- unreachable("not reached");
-+ return GL_VERTEX_PROGRAM_ARB;
- }
-
- extern bool
- _mesa_validate_pipeline_io(struct gl_pipeline_object *);
-
- #ifdef __cplusplus
- }
- #endif
--- a/one_swizzle_to_rule_them_all.patch Mon Jun 05 21:17:55 2023 +0200
+++ b/one_swizzle_to_rule_them_all.patch Sat Jul 29 14:34:45 2023 +0200
@@ -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 @@
#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();
--- a/series Mon Jun 05 21:17:55 2023 +0200
+++ b/series Sat Jul 29 14:34:45 2023 +0200
@@ -7,20 +7,20 @@
mozilla-s390-context.patch
mozilla-pgo.patch
mozilla-reduce-rust-debuginfo.patch
-mozilla-bmo1005535.patch
mozilla-bmo1504834-part1.patch
mozilla-bmo1504834-part3.patch
mozilla-bmo1512162.patch
mozilla-fix-top-level-asm.patch
mozilla-bmo849632.patch
mozilla-bmo998749.patch
-mozilla-s390x-skia-gradient.patch
mozilla-libavcodec58_91.patch
mozilla-silence-no-return-type.patch
mozilla-bmo531915.patch
one_swizzle_to_rule_them_all.patch
svg-rendering.patch
-mozilla-buildfixes.patch
+mozilla-partial-revert-1768632.patch
+mozilla-bmo1775202.patch
+mozilla-rust-disable-future-incompat.patch
# Firefox patches
firefox-kde.patch