summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Bidar2023-09-20 21:55:32 +0300
committerBjörn Bidar2023-09-20 21:57:35 +0300
commitd81df13d11d918098af0991994472c172817e33e (patch)
tree9a0c027eb0c68f9cbf5076a1b489d033322191a7
parenta4ae66b6b28607dd7bec51cae73300552ec8fafd (diff)
downloadaur-d81df13d11d918098af0991994472c172817e33e.tar.gz
Update to 117.0-1
- New upstream release - Use tarball instead of hg sources (missing in last change) - Patches can be found here: https://github.com/Thaodan/gecko-dev/tree/thaodan/release/117.x - Include GNOME Shell search provider Signed-off-by: Björn Bidar <bjorn.bidar@thaodan.de>
-rw-r--r--.SRCINFO145
-rw-r--r--0001-Bug-1005535-Get-skia-GPU-building-on-big-endian.patch22
-rw-r--r--0001-Bug-1504834-Rough-progress-patch.patch (renamed from 0003-Bug-1504834-Rough-progress-patch.patch)24
-rw-r--r--0002-Allow-to-override-build-date-with-SOURCE_DATE_EPOCH.patch35
-rw-r--r--0002-Bug-1504834-XULText-AA-fix-BE.patch27
-rw-r--r--0003-mozilla-bmo998749.patch.patch (renamed from 0006-mozilla-bmo998749.patch.patch)0
-rw-r--r--0004-Bug-1504834-XULText-AA-fix-BE.patch56
-rw-r--r--0004-mozilla-libavcodec58_91.patch.patch (renamed from 0008-mozilla-libavcodec58_91.patch.patch)6
-rw-r--r--0005-Fix-top-level-asm-issue.patch39
-rw-r--r--0005-mozilla-silence-no-return-type.patch-to-fix-build-er.patch659
-rw-r--r--0006-Bug-531915-mozilla-bmo531915.patch.patch (renamed from 0010-Bug-531915-mozilla-bmo531915.patch.patch)0
-rw-r--r--0007-imported-patch-one_swizzle_to_rule_them_all.patch.patch (renamed from 0011-imported-patch-one_swizzle_to_rule_them_all.patch.patch)4
-rw-r--r--0007-mozilla-s390x-skia-gradient.patch.patch58
-rw-r--r--0008-imported-patch-svg-rendering.patch.patch (renamed from 0012-imported-patch-svg-rendering.patch.patch)2
-rw-r--r--0009-Bug-1792159-Add-missing-includes-to-AtomicOperations.patch (renamed from 0013-Bug-1792159-Add-missing-includes-to-AtomicOperations.patch)0
-rw-r--r--0009-mozilla-silence-no-return-type.patch-to-fix-build-er.patch1600
-rw-r--r--0010-mozilla-s390-context.patch.patch (renamed from 0014-mozilla-s390-context.patch.patch)8
-rw-r--r--0011-bsc-991344-Rpi3-Firefox-crashes-after-a-few-seconds-.patch (renamed from 0015-bsc-991344-Rpi3-Firefox-crashes-after-a-few-seconds-.patch)2
-rw-r--r--0012-mozilla-fix-aarch64-libopus.patch.patch (renamed from 0016-mozilla-fix-aarch64-libopus.patch.patch)0
-rw-r--r--0013-Bug-634334-call-to-the-ntlm_auth-helper-fails.patch (renamed from 0017-Bug-634334-call-to-the-ntlm_auth-helper-fails.patch)0
-rw-r--r--0014-Make-PGO-use-toolchain.patch (renamed from 0018-Make-PGO-use-toolchain.patch)0
-rw-r--r--0015-bmo-1516803-force-one-LTO-partition-for-sandbox-when.patch (renamed from 0019-bmo-1516803-force-one-LTO-partition-for-sandbox-when.patch)4
-rw-r--r--0016-Fix-building-with-PGO-when-using-GCC.patch (renamed from 0020-Fix-building-with-PGO-when-using-GCC.patch)2
-rw-r--r--0017-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch (renamed from 0021-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch)2
-rw-r--r--0018-Bug-1516081-Disable-watchdog-during-FDO-train.patch28
-rw-r--r--0019-Bug-559213-Support-system-av1.patch (renamed from 0023-Bug-559213-Support-system-av1.patch)14
-rw-r--r--0020-Bug-847568-Support-system-harfbuzz.patch (renamed from 0024-Bug-847568-Support-system-harfbuzz.patch)32
-rw-r--r--0021-Bug-847568-Support-system-graphite2.patch (renamed from 0025-Bug-847568-Support-system-graphite2.patch)20
-rw-r--r--0022-Bug-1516081-Disable-watchdog-during-FDO-train.patch51
-rw-r--r--0022-Bug-1611386-Reenable-support-for-enable-system-sqlit.patch (renamed from 0026-Bug-1611386-Reenable-support-for-enable-system-sqlit.patch)77
-rw-r--r--0023-Bug-1419151-Add-Unity-menubar-support.patch (renamed from 0027-Bug-1419151-Add-Unity-menubar-support.patch)100
-rw-r--r--0024-Do-not-use-gconf-for-proxy-settings-if-not-running-w.patch (renamed from 0028-Do-not-use-gconf-for-proxy-settings-if-not-running-w.patch)0
-rw-r--r--0025-Add-KDE-integration-to-Firefox-toolkit-parts.patch1442
-rw-r--r--0026-Add-KDE-integration-to-Firefox.patch (renamed from 0030-Add-KDE-integration-to-Firefox.patch)10
-rw-r--r--0027-Imported-patch-firefox-branded-icons.patch.patch (renamed from 0031-Imported-patch-firefox-branded-icons.patch.patch)4
-rw-r--r--0028-Allow-Eme-for-arm-and-Aarch64.patch (renamed from 0033-Allow-Eme-for-arm-and-Aarch64.patch)8
-rw-r--r--0029-Add-KDE-integration-to-Firefox-toolkit-parts.patch1531
-rw-r--r--0029-Shut-up-warnings-about-future-Rust-version-incompati.patch26
-rw-r--r--0030-Partially-revert-Bug-1768632-Make-EnumSet-compile-fo.patch29
-rw-r--r--0031-Bug-1796523-Workaround-source-locations-for-function.patch29
-rw-r--r--0032-Bug-1807652-Rename-some-methods-to-not-conflict-with.patch160
-rw-r--r--PKGBUILD158
42 files changed, 2550 insertions, 3864 deletions
diff --git a/.SRCINFO b/.SRCINFO
index cc51d048faa9..d924a4f23c93 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = firefox-kde-opensuse
pkgdesc = Standalone web browser from mozilla.org with OpenSUSE patch, integrate better with KDE
- pkgver = 107.0
+ pkgver = 117.0.1
pkgrel = 1
url = https://github.com/openSUSE/firefox-maintenance
arch = i686
@@ -59,84 +59,83 @@ pkgbase = firefox-kde-opensuse
optdepends = pulseaudio: Audio support
optdepends = libnotify: Notification integration
optdepends = xdg-desktop-portal: Screensharing with Wayland
- provides = firefox=107.0
+ provides = firefox=117.0.1
conflicts = firefox
options = !emptydirs
options = !lto
- source = hg+https://hg.mozilla.org/mozilla-unified#tag=FIREFOX_107_0_RELEASE
+ source = https://archive.mozilla.org/pub/firefox/releases/117.0.1/source/firefox-117.0.1.source.tar.xz
+ source = https://archive.mozilla.org/pub/firefox/releases/117.0.1/source/firefox-117.0.1.source.tar.xz.asc
source = mozconfig
source = firefox.desktop
source = vendor.js
- source = 0001-Bug-1005535-Get-skia-GPU-building-on-big-endian.patch
- source = 0002-Allow-to-override-build-date-with-SOURCE_DATE_EPOCH.patch
- source = 0003-Bug-1504834-Rough-progress-patch.patch
- source = 0004-Bug-1504834-XULText-AA-fix-BE.patch
- source = 0005-Fix-top-level-asm-issue.patch
- source = 0006-mozilla-bmo998749.patch.patch
- source = 0007-mozilla-s390x-skia-gradient.patch.patch
- source = 0008-mozilla-libavcodec58_91.patch.patch
- source = 0009-mozilla-silence-no-return-type.patch-to-fix-build-er.patch
- source = 0010-Bug-531915-mozilla-bmo531915.patch.patch
- source = 0011-imported-patch-one_swizzle_to_rule_them_all.patch.patch
- source = 0012-imported-patch-svg-rendering.patch.patch
- source = 0013-Bug-1792159-Add-missing-includes-to-AtomicOperations.patch
- source = 0014-mozilla-s390-context.patch.patch
- source = 0015-bsc-991344-Rpi3-Firefox-crashes-after-a-few-seconds-.patch
- source = 0016-mozilla-fix-aarch64-libopus.patch.patch
- source = 0017-Bug-634334-call-to-the-ntlm_auth-helper-fails.patch
- source = 0018-Make-PGO-use-toolchain.patch
- source = 0019-bmo-1516803-force-one-LTO-partition-for-sandbox-when.patch
- source = 0020-Fix-building-with-PGO-when-using-GCC.patch
- source = 0021-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch
- source = 0022-Bug-1516081-Disable-watchdog-during-FDO-train.patch
- source = 0023-Bug-559213-Support-system-av1.patch
- source = 0024-Bug-847568-Support-system-harfbuzz.patch
- source = 0025-Bug-847568-Support-system-graphite2.patch
- source = 0026-Bug-1611386-Reenable-support-for-enable-system-sqlit.patch
- source = 0027-Bug-1419151-Add-Unity-menubar-support.patch
- source = 0028-Do-not-use-gconf-for-proxy-settings-if-not-running-w.patch
- source = 0029-Add-KDE-integration-to-Firefox-toolkit-parts.patch
- source = 0030-Add-KDE-integration-to-Firefox.patch
- source = 0031-Imported-patch-firefox-branded-icons.patch.patch
- source = 0032-Bug-1807652-Rename-some-methods-to-not-conflict-with.patch
- source = 0033-Allow-Eme-for-arm-and-Aarch64.patch
- md5sums = SKIP
- md5sums = 9530b0395a095c0b47ee42d0996ec163
- md5sums = a26a061efb4def6572d5b319d657f1d6
- md5sums = 4c23d9c0a691d70919beb1dafbbecbd3
- md5sums = e48cd51c49f5b8b1595f9cd8f55ce819
- md5sums = 6945bb71f87e01743a6736fbdb845cfd
- md5sums = 954e7d1ff4452e3c8895a186ff815383
- md5sums = f6e793369b22bd607403d9b9f0565a3c
- md5sums = 8df09195607f90a097f21d35dc4d9c30
- md5sums = a1b878f2e22f096ad907630aa873698f
- md5sums = 3256d35703c9a2857503921eb10c3dd7
- md5sums = efe01b463d50e30de15c03f391e0b366
- md5sums = ab2a8a5aa3aa2b52f7102466aab7eb7e
- md5sums = 63a6be4970c5a999adad40f9e021c366
- md5sums = 1c1ce911bbbe548f130e6fca5e136bdd
- md5sums = 831c2ccaf07c68cf4f9008692475c1d9
- md5sums = cc679a9a9abbb9e8a33800b4cb5f4deb
- md5sums = 8c0af75143b8f8d4b86e0f438bd8ccc8
- md5sums = e13a08af8fa75cfebd2ca5d509784046
- md5sums = 379b26ef4582c6d15ab61c7944540c7f
- md5sums = 7ee193a7b8230b68036f6db5d188f7fc
- md5sums = 9266d9fa0c39e30ae2e9c93b3d7822e7
- md5sums = 101080a6f3639db7c36dcf1218a83d1a
- md5sums = 39a5aa662bd007d0562beaeae4edc175
- md5sums = a067121f85949a76e709d53871f09834
- md5sums = 12f66e9f224381e73aa7e7fb6c535c13
- md5sums = ad886aed59f72e6f1ad470ab4e96ebd8
- md5sums = b69acf75b1649f965ac1637e34356038
- md5sums = d1dfbcdc4951a5d279071323160fe856
- md5sums = 3db73a1168751e27a66d7564a9492312
- md5sums = b30750c85f239ba19b6b0ba308e86990
- md5sums = 401a4da2cadcaf12546cb495d63407e4
- md5sums = 42ce462dcbdaaed8ffb45b1b5d10a49d
- md5sums = f792d0ce1e4f3f260862ec70295f2f81
- md5sums = bc7676460d246f57e8f4e5db1850eaf8
- md5sums = 1bc91fa92a1a7ce337ec9b398290f5e8
- md5sums = 15a701ef094073919c43701ef4b8b85f
+ source = 0001-Bug-1504834-Rough-progress-patch.patch
+ source = 0002-Bug-1504834-XULText-AA-fix-BE.patch
+ source = 0003-mozilla-bmo998749.patch.patch
+ source = 0004-mozilla-libavcodec58_91.patch.patch
+ source = 0005-mozilla-silence-no-return-type.patch-to-fix-build-er.patch
+ source = 0006-Bug-531915-mozilla-bmo531915.patch.patch
+ source = 0007-imported-patch-one_swizzle_to_rule_them_all.patch.patch
+ source = 0008-imported-patch-svg-rendering.patch.patch
+ source = 0009-Bug-1792159-Add-missing-includes-to-AtomicOperations.patch
+ source = 0010-mozilla-s390-context.patch.patch
+ source = 0011-bsc-991344-Rpi3-Firefox-crashes-after-a-few-seconds-.patch
+ source = 0012-mozilla-fix-aarch64-libopus.patch.patch
+ source = 0013-Bug-634334-call-to-the-ntlm_auth-helper-fails.patch
+ source = 0014-Make-PGO-use-toolchain.patch
+ source = 0015-bmo-1516803-force-one-LTO-partition-for-sandbox-when.patch
+ source = 0016-Fix-building-with-PGO-when-using-GCC.patch
+ source = 0017-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch
+ source = 0018-Bug-1516081-Disable-watchdog-during-FDO-train.patch
+ source = 0019-Bug-559213-Support-system-av1.patch
+ source = 0020-Bug-847568-Support-system-harfbuzz.patch
+ source = 0021-Bug-847568-Support-system-graphite2.patch
+ source = 0022-Bug-1611386-Reenable-support-for-enable-system-sqlit.patch
+ source = 0023-Bug-1419151-Add-Unity-menubar-support.patch
+ source = 0024-Do-not-use-gconf-for-proxy-settings-if-not-running-w.patch
+ source = 0025-Add-KDE-integration-to-Firefox-toolkit-parts.patch
+ source = 0026-Add-KDE-integration-to-Firefox.patch
+ source = 0027-Imported-patch-firefox-branded-icons.patch.patch
+ source = 0028-Allow-Eme-for-arm-and-Aarch64.patch
+ source = 0029-Shut-up-warnings-about-future-Rust-version-incompati.patch
+ source = 0030-Partially-revert-Bug-1768632-Make-EnumSet-compile-fo.patch
+ source = 0031-Bug-1796523-Workaround-source-locations-for-function.patch
+ validpgpkeys = 14F26682D0916CDD81E37B6D61B7B526D98F0353
+ sha256sums = 7ea4203b5cf9e59f80043597e2c9020291754fcab784a337586b5f5e1370c416
+ sha256sums = SKIP
+ sha256sums = b440e88515847972a512feb2dd5706a86ad45384cae613c18244bc3c1e0df2a5
+ sha256sums = 4c93b2e1f1675e033ed7910fe5f379626a92903a940697430985bcfdf94afceb
+ sha256sums = eaad0eee76f89e0a1a241742ec5c8ec9315b096f7b3e0ea302b253b926750aae
+ sha256sums = 10593c391762298c8f740d432e51224d031f17cf3689341497d3cc02bfa744f3
+ sha256sums = eb19d9568e8d7705b2a0c4774d4f6a758a910c0e5cf427727feb5884a2a1ee98
+ sha256sums = 4322124dc370ac56063837370a8107e85ca6e0d4037ff71ece5e7b0f55ed8053
+ sha256sums = 691de24752efa64ebe8f1a77c31ee769bb359c49655352399cf345300c0c6cb6
+ sha256sums = ea2339511a6be6d44406dd478623a41aa0de6a748a5267fe675f90abcb30971a
+ sha256sums = 2fdb6066cf348843f57b963571e0211acfb2f671896dfad650723129b62bd1af
+ sha256sums = bba76c5e13952ef45362f8e53a5c030e0f5d722f8f266228787136a5312330ea
+ sha256sums = f2fcd4ca82b833f5e5b7e991882e24f09463cd837242b18cf163bc751f2e21d5
+ sha256sums = 766faefbd4898049e9913589962bf839da6785d50f0631b4eac7316f16bf2ea6
+ sha256sums = 3aa459ef9295cd76d102a767a8910cc42cfc672bdde9ab98453465a37946024d
+ sha256sums = e5e960afe0a2ed519b3a8d20e645b4defd0ff9920797bf9accdd7b235ab8637d
+ sha256sums = 32d40630a010ee91d2c35c814ef2f567ad7faf859f8198735829958cb055f53b
+ sha256sums = 1ffdcff3d4e31c5cceddadfa0111c27a34480594238cdf85866ee1073d922910
+ sha256sums = 26fe6a707517789f512fffd83009d20544987e944ad4b3d10ed30e8b566f96ba
+ sha256sums = 4007869a43897d45ba56b631195ff9ce96616cb160e9a3785f2b4c9313115095
+ sha256sums = 2400173d2c84573194c6af9031663a5b2332ccb4929b246b216c61c97d8b0a54
+ sha256sums = 04cf5528a4e211a2f33d74282013672ac1a585814c0de46419f2dc3c469a71a7
+ sha256sums = 72d30acbe1e8488c6bd3af2e0813223842a63b859d6e7aff66d2f23612b7ad8b
+ sha256sums = 8cd6457b71bf20023f25b66e78cdebb43205f26db03a6d88c64202cc51ba1b39
+ sha256sums = 039a07b1171a9fc1bd71a792c2ee152f774a1bf34a768eae72113b3ff5fd19e7
+ sha256sums = fdab230f8c1c457277d921cf318771852288c665c01fd1b9f570e1b9be6dac25
+ sha256sums = f129686f536941c820022a95b242c83f4de54facdac59b6eb16db46e84de0c7c
+ sha256sums = a41b65c032a21298eed7d70e83dfbe3d28fe268963803d225914d2a21f97b22c
+ sha256sums = dfb11575e7d43071c9046762408b7267507c645020678d57689d55d3f68c0c28
+ sha256sums = b0bc4493dea4241a5a7e83ce705c25a867a22ff9d610cbbe50c031c65d8c83e8
+ sha256sums = b941526ab077d21dc0e833ff2bd375eb06ff53d3898d3142ef917e3a7f3a67c7
+ sha256sums = 8fe583a722a48596c93634136fb2bea621b30311bc935447bf4dc0c472aac117
+ sha256sums = eab658c30b83505825765f6a99aeaff693888e6bfa4e5b436349a79c43b322e0
+ sha256sums = 9b7bf3b170494a2a10b56b2d903902140d50919e1e4a32bcfd16feeb08fa402e
+ sha256sums = 7038651e09bd1f1cf2561ee977e6fcc58f7295ce821f419288da6d0b2bcc8feb
+ sha256sums = 0d7a0f8bd7f0a8f1319d79a433d848a3eb43e81f4a14f29d5c8602be49d93cb9
pkgname = firefox-kde-opensuse
depends = libxt
diff --git a/0001-Bug-1005535-Get-skia-GPU-building-on-big-endian.patch b/0001-Bug-1005535-Get-skia-GPU-building-on-big-endian.patch
deleted file mode 100644
index dfdefbdfd4d4..000000000000
--- a/0001-Bug-1005535-Get-skia-GPU-building-on-big-endian.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Steve Singer <steve@ssinger.info>
-Date: Tue, 21 May 2019 17:12:20 +0200
-Subject: [PATCH] Bug 1005535 - Get skia GPU building on big endian.
-
----
- gfx/skia/skia/src/gpu/GrColor.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/gfx/skia/skia/src/gpu/GrColor.h b/gfx/skia/skia/src/gpu/GrColor.h
-index 39e7bfa7bf19799bfafa5d3f5371d96138f0bd7f..57b405f3b7599689f1c3a7a7b31b0039b2a8c98d 100644
---- a/gfx/skia/skia/src/gpu/GrColor.h
-+++ b/gfx/skia/skia/src/gpu/GrColor.h
-@@ -64,7 +64,7 @@ static inline GrColor GrColorPackRGBA(unsigned r, unsigned g, unsigned b, unsign
- * Since premultiplied means that alpha >= color, we construct a color with
- * each component==255 and alpha == 0 to be "illegal"
- */
--#define GrColor_ILLEGAL (~(0xFF << GrColor_SHIFT_A))
-+#define GrColor_ILLEGAL ((uint32_t)(~(0xFF << GrColor_SHIFT_A)))
-
- /** Normalizes and coverts an uint8_t to a float. [0, 255] -> [0.0, 1.0] */
- static inline float GrNormalizeByteToFloat(uint8_t value) {
diff --git a/0003-Bug-1504834-Rough-progress-patch.patch b/0001-Bug-1504834-Rough-progress-patch.patch
index 11f374d059fe..b7b26e34d8b6 100644
--- a/0003-Bug-1504834-Rough-progress-patch.patch
+++ b/0001-Bug-1504834-Rough-progress-patch.patch
@@ -5,16 +5,16 @@ Subject: [PATCH] Bug 1504834 - Rough progress patch
https://bugzilla.mozilla.org/show_bug.cgi?id=1504834#c5
---
- gfx/2d/DrawTargetSkia.cpp | 3 +--
- gfx/2d/Types.h | 7 -------
- gfx/skia/skia/third_party/skcms/skcms.cc | 18 ++++++++++++++----
+ gfx/2d/DrawTargetSkia.cpp | 3 +--
+ gfx/2d/Types.h | 7 -------
+ gfx/skia/skia/modules/skcms/skcms.cc | 18 ++++++++++++++----
3 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/gfx/2d/DrawTargetSkia.cpp b/gfx/2d/DrawTargetSkia.cpp
-index 04ee0c652db516bc03af19cf5e1b1e28e5a5f85e..e138a4e290af1293cc355b32c636a6073bf9d1dc 100644
+index 2c2452a0cf57c9968070f53c5d87aaba21e9e87b..7aad12a2560c7429f150d7555507021f10bf942c 100644
--- a/gfx/2d/DrawTargetSkia.cpp
+++ b/gfx/2d/DrawTargetSkia.cpp
-@@ -152,8 +152,7 @@ static IntRect CalculateSurfaceBounds(const IntSize& aSize, const Rect* aBounds,
+@@ -155,8 +155,7 @@ static IntRect CalculateSurfaceBounds(const IntSize& aSize, const Rect* aBounds,
return surfaceBounds.Intersect(bounds);
}
@@ -25,7 +25,7 @@ index 04ee0c652db516bc03af19cf5e1b1e28e5a5f85e..e138a4e290af1293cc355b32c636a607
static bool VerifyRGBXFormat(uint8_t* aData, const IntSize& aSize,
const int32_t aStride, SurfaceFormat aFormat) {
diff --git a/gfx/2d/Types.h b/gfx/2d/Types.h
-index fc3a910daa3c4c9ee2dc70375cbbb6dfb80b84ef..2c16a9a01ca2791a610cb498d0539772c817a9a5 100644
+index e6f73eac3af55f46457dcaadec686a41eae2bd1d..c6833ddbcede70912d9ed4d7c341da3658d81f23 100644
--- a/gfx/2d/Types.h
+++ b/gfx/2d/Types.h
@@ -92,15 +92,8 @@ enum class SurfaceFormat : int8_t {
@@ -44,10 +44,10 @@ index fc3a910daa3c4c9ee2dc70375cbbb6dfb80b84ef..2c16a9a01ca2791a610cb498d0539772
// The following values are OS and endian-independent synonyms.
//
-diff --git a/gfx/skia/skia/third_party/skcms/skcms.cc b/gfx/skia/skia/third_party/skcms/skcms.cc
-index 6b4d87b15df9353f5d596f88749507c9b4efef78..7c0559d2679038e8cb79aed993f9656d978e8f6b 100644
---- a/gfx/skia/skia/third_party/skcms/skcms.cc
-+++ b/gfx/skia/skia/third_party/skcms/skcms.cc
+diff --git a/gfx/skia/skia/modules/skcms/skcms.cc b/gfx/skia/skia/modules/skcms/skcms.cc
+index 246c08af943da90d70f334d7a8e4af7b1be6214f..8619e0a8085b27f31b15d252d1f4e680c9f28787 100644
+--- 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>
@@ -56,8 +56,8 @@ index 6b4d87b15df9353f5d596f88749507c9b4efef78..7c0559d2679038e8cb79aed993f9656d
+ #define SKCMS_PORTABLE
#endif
- // sizeof(x) will return size_t, which is 32-bit on some machines and 64-bit on others.
-@@ -280,20 +282,28 @@ enum {
+ 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));
diff --git a/0002-Allow-to-override-build-date-with-SOURCE_DATE_EPOCH.patch b/0002-Allow-to-override-build-date-with-SOURCE_DATE_EPOCH.patch
deleted file mode 100644
index 5e036e0dbb08..000000000000
--- a/0002-Allow-to-override-build-date-with-SOURCE_DATE_EPOCH.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: "Bernhard M. Wiedemann" <bwiedemann@suse.de>
-Date: Mon, 22 Jul 2019 00:00:00 +0200
-Subject: [PATCH] Allow to override build date with SOURCE_DATE_EPOCH
-
-Allow to override build date with SOURCE_DATE_EPOCH
-in order to make builds reproducible.
-See https://reproducible-builds.org/ for why this is good
-and https://reproducible-builds.org/specs/source-date-epoch/
-for the definition of this variable.
----
- python/mozbuild/mozbuild/action/langpack_manifest.py | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/python/mozbuild/mozbuild/action/langpack_manifest.py b/python/mozbuild/mozbuild/action/langpack_manifest.py
-index 4277c25aef3021fd6b19b05f9d5e94c1d928ea2d..aac4ca1a2a0e6f83e7eb7efe9eeb833fa1086dba 100644
---- a/python/mozbuild/mozbuild/action/langpack_manifest.py
-+++ b/python/mozbuild/mozbuild/action/langpack_manifest.py
-@@ -18,6 +18,7 @@ import json
- import logging
- import os
- import sys
-+import time
-
- import fluent.syntax.ast as FTL
- import mozpack.path as mozpath
-@@ -106,7 +107,7 @@ def get_timestamp_for_locale(path):
- dt = get_dt_from_hg(path)
-
- if dt is None:
-- dt = datetime.datetime.utcnow()
-+ dt = datetime.datetime.utcfromtimestamp(int(os.environ.get('SOURCE_DATE_EPOCH', time.time())))
-
- dt = dt.replace(microsecond=0)
- return dt.strftime("%Y%m%d%H%M%S")
diff --git a/0002-Bug-1504834-XULText-AA-fix-BE.patch b/0002-Bug-1504834-XULText-AA-fix-BE.patch
new file mode 100644
index 000000000000..7c2b2014a372
--- /dev/null
+++ b/0002-Bug-1504834-XULText-AA-fix-BE.patch
@@ -0,0 +1,27 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Martin Sirringhaus <msirringhaus@suse.de>
+Date: Mon, 25 Nov 2019 09:31:46 +0200
+Subject: [PATCH] Bug 1504834 - XULText-AA-fix BE
+
+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).
+
+https://bugzilla.mozilla.org/show_bug.cgi?id=1504834#c9
+---
+ gfx/skia/skia/src/opts/SkBlitMask_opts.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/gfx/skia/skia/src/opts/SkBlitMask_opts.h b/gfx/skia/skia/src/opts/SkBlitMask_opts.h
+index 8e673a972869c8e1cac0ed3db4aa34a9b7f4cf6b..3dcde0bb81273ee509322863285dd6d8d7a96648 100644
+--- a/gfx/skia/skia/src/opts/SkBlitMask_opts.h
++++ b/gfx/skia/skia/src/opts/SkBlitMask_opts.h
+@@ -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)
++ // 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());
+ };
diff --git a/0006-mozilla-bmo998749.patch.patch b/0003-mozilla-bmo998749.patch.patch
index 32fad9d9e0ed..32fad9d9e0ed 100644
--- a/0006-mozilla-bmo998749.patch.patch
+++ b/0003-mozilla-bmo998749.patch.patch
diff --git a/0004-Bug-1504834-XULText-AA-fix-BE.patch b/0004-Bug-1504834-XULText-AA-fix-BE.patch
deleted file mode 100644
index e26496ad9930..000000000000
--- a/0004-Bug-1504834-XULText-AA-fix-BE.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Martin Sirringhaus <msirringhaus@suse.de>
-Date: Mon, 25 Nov 2019 09:31:46 +0200
-Subject: [PATCH] Bug 1504834 - XULText-AA-fix BE
-
-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).
-
-https://bugzilla.mozilla.org/show_bug.cgi?id=1504834#c9
----
- gfx/skia/skia/include/private/SkNx.h | 11 +++++++++++
- gfx/skia/skia/src/opts/SkBlitMask_opts.h | 6 ++++++
- 2 files changed, 17 insertions(+)
-
-diff --git a/gfx/skia/skia/include/private/SkNx.h b/gfx/skia/skia/include/private/SkNx.h
-index 06a6df9af2af67c8e9a7442905a5b519e6ee1e37..1b704eacea5e142dbe30f66c260512d7310d6eb5 100644
---- a/gfx/skia/skia/include/private/SkNx.h
-+++ b/gfx/skia/skia/include/private/SkNx.h
-@@ -238,7 +238,18 @@ struct SkNx<1,T> {
- 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)); }
-
-diff --git a/gfx/skia/skia/src/opts/SkBlitMask_opts.h b/gfx/skia/skia/src/opts/SkBlitMask_opts.h
-index 2dfe5ecf960e25bdb399e5bc98999bcf66730554..e86fcef1ee5fa136c5143bd70b382681b6499668 100644
---- a/gfx/skia/skia/src/opts/SkBlitMask_opts.h
-+++ b/gfx/skia/skia/src/opts/SkBlitMask_opts.h
-@@ -203,7 +203,13 @@ 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
- + d.approxMulDiv255(aa.inv());
- };
- while (h --> 0) {
diff --git a/0008-mozilla-libavcodec58_91.patch.patch b/0004-mozilla-libavcodec58_91.patch.patch
index 19decfbbf11a..09f8b939aa9c 100644
--- a/0008-mozilla-libavcodec58_91.patch.patch
+++ b/0004-mozilla-libavcodec58_91.patch.patch
@@ -8,12 +8,12 @@ Subject: [PATCH] mozilla-libavcodec58_91.patch
1 file changed, 2 insertions(+)
diff --git a/dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp b/dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp
-index 91bf38df8354357d4abdb179b92ef3b663caa86a..e79bc068668ac209514f063bb746f6e5efcb158d 100644
+index 51d25c97e7ba425db041a31800df6203ae71bf66..dbf08a48c9b55adc1508a288915cb15d96de74ea 100644
--- a/dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp
-@@ -39,6 +39,8 @@ static const char* sLibs[] = {
- // of ffmpeg and update it regulary on ABI/API changes
+@@ -41,6 +41,8 @@ static const char* sLibs[] = {
#else
+ "libavcodec.so.60",
"libavcodec.so.59",
+ "libavcodec.so.58.134",
+ "libavcodec.so.58.91",
diff --git a/0005-Fix-top-level-asm-issue.patch b/0005-Fix-top-level-asm-issue.patch
deleted file mode 100644
index d24ec1c35cc5..000000000000
--- a/0005-Fix-top-level-asm-issue.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Martin Liska <mliska@suse.cz>
-Date: Fri, 17 May 2019 14:41:35 +0200
-Subject: [PATCH] Fix top-level asm issue.
-
----
- security/sandbox/linux/moz.build | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/security/sandbox/linux/moz.build b/security/sandbox/linux/moz.build
-index 573f667812113b6a62e8c0c0bc04982c28c0e92d..be5120e4aac7b3a5b589a2c88a0218123a4adec7 100644
---- a/security/sandbox/linux/moz.build
-+++ b/security/sandbox/linux/moz.build
-@@ -71,7 +71,6 @@ UNIFIED_SOURCES += [
- "../chromium/sandbox/linux/bpf_dsl/policy_compiler.cc",
- "../chromium/sandbox/linux/bpf_dsl/syscall_set.cc",
- "../chromium/sandbox/linux/seccomp-bpf/die.cc",
-- "../chromium/sandbox/linux/seccomp-bpf/syscall.cc",
- "broker/SandboxBrokerCommon.cpp",
- "Sandbox.cpp",
- "SandboxBrokerClient.cpp",
-@@ -87,6 +86,7 @@ UNIFIED_SOURCES += [
- SOURCES += [
- "../chromium/base/strings/safe_sprintf.cc",
- "../chromium/base/third_party/icu/icu_utf.cc",
-+ "../chromium/sandbox/linux/seccomp-bpf/syscall.cc",
- "../chromium/sandbox/linux/seccomp-bpf/trap.cc",
- "../chromium/sandbox/linux/services/syscall_wrappers.cc",
- ]
-@@ -110,6 +110,9 @@ if CONFIG["CC_TYPE"] in ("clang", "gcc"):
- SOURCES["../chromium/sandbox/linux/services/syscall_wrappers.cc"].flags += [
- "-Wno-empty-body",
- ]
-+ SOURCES['../chromium/sandbox/linux/seccomp-bpf/syscall.cc'].flags += [
-+ '-fno-lto'
-+ ]
-
- # gcc lto likes to put the top level asm in syscall.cc in a different partition
- # from the function using it which breaks the build. Work around that by
diff --git a/0005-mozilla-silence-no-return-type.patch-to-fix-build-er.patch b/0005-mozilla-silence-no-return-type.patch-to-fix-build-er.patch
new file mode 100644
index 000000000000..8cfc0f58ee65
--- /dev/null
+++ b/0005-mozilla-silence-no-return-type.patch-to-fix-build-er.patch
@@ -0,0 +1,659 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Wolfgang Rosenauer <wr@rosenauer.org>
+Date: Sun, 27 Dec 2020 10:48:12 +0100
+Subject: [PATCH] mozilla-silence-no-return-type.patch to fix build errors on
+ some Leap versions
+
+---
+ gfx/skia/skia/include/codec/SkEncodedOrigin.h | 1 +
+ .../include/private/gpu/ganesh/GrTypesPriv.h | 1 +
+ gfx/skia/skia/src/core/SkDescriptor.cpp | 1 +
+ gfx/skia/skia/src/core/SkGeometry.h | 2 ++
+ gfx/skia/skia/src/core/SkTextBlob.cpp | 1 +
+ gfx/skia/skia/src/core/SkTypeface_remote.h | 16 +++++++++++++++-
+ .../effects/imagefilters/SkBlurImageFilter.cpp | 1 +
+ gfx/skia/skia/src/fonts/SkFontMgr_indirect.cpp | 1 +
+ .../src/ports/SkFontMgr_FontConfigInterface.cpp | 4 ++++
+ gfx/skia/skia/src/sksl/SkSLCompiler.cpp | 1 +
+ gfx/skia/skia/src/sksl/SkSLOperator.cpp | 2 +-
+ gfx/skia/skia/src/sksl/ir/SkSLType.h | 1 +
+ gfx/skia/skia/src/utils/SkShadowUtils.cpp | 1 +
+ intl/icu/source/i18n/number_rounding.cpp | 2 ++
+ js/src/irregexp/imported/regexp-parser.cc | 1 +
+ third_party/libwebrtc/api/adaptation/resource.cc | 1 +
+ third_party/libwebrtc/api/rtp_parameters.cc | 1 +
+ .../libwebrtc/api/video/video_frame_buffer.cc | 2 ++
+ .../libwebrtc/api/video_codecs/video_codec.cc | 1 +
+ .../video_encoder_software_fallback_wrapper.cc | 2 ++
+ .../call/adaptation/video_stream_adapter.cc | 5 +++++
+ third_party/libwebrtc/call/rtp_payload_params.cc | 2 +-
+ third_party/libwebrtc/call/video_send_stream.cc | 1 +
+ .../audio_processing/agc2/clipping_predictor.cc | 2 +-
+ .../agc2/input_volume_stats_reporter.cc | 1 +
+ .../audio_processing/agc2/rnn_vad/rnn_fc.cc | 2 ++
+ .../audio_processing/audio_processing_impl.cc | 4 +++-
+ .../audio_processing/include/audio_processing.cc | 2 ++
+ .../transient/transient_suppressor_impl.cc | 1 +
+ .../linux/wayland/screencast_portal.cc | 1 +
+ .../libwebrtc/modules/pacing/bitrate_prober.cc | 1 +
+ .../source/create_video_rtp_depacketizer.cc | 1 +
+ .../modules/rtp_rtcp/source/rtp_sender.cc | 1 +
+ .../modules/rtp_rtcp/source/rtp_sender_audio.cc | 1 +
+ .../codecs/vp8/default_temporal_layers.cc | 1 +
+ .../codecs/vp8/temporal_layers_checker.cc | 1 +
+ .../video_stream_encoder_resource_manager.cc | 1 +
+ 37 files changed, 66 insertions(+), 5 deletions(-)
+
+diff --git a/gfx/skia/skia/include/codec/SkEncodedOrigin.h b/gfx/skia/skia/include/codec/SkEncodedOrigin.h
+index 19d083672f6b974e1df968bf4061b40002b01310..c1103223deaba0df7d97eb5ff71c0e78b3c41d03 100644
+--- a/gfx/skia/skia/include/codec/SkEncodedOrigin.h
++++ b/gfx/skia/skia/include/codec/SkEncodedOrigin.h
+@@ -41,6 +41,7 @@ static inline SkMatrix SkEncodedOriginToMatrix(SkEncodedOrigin origin, int w, in
+ case kLeftBottom_SkEncodedOrigin: return SkMatrix::MakeAll( 0, 1, 0, -1, 0, h, 0, 0, 1);
+ }
+ SK_ABORT("Unexpected origin");
++ SkUNREACHABLE;
+ }
+
+ /**
+diff --git a/gfx/skia/skia/include/private/gpu/ganesh/GrTypesPriv.h b/gfx/skia/skia/include/private/gpu/ganesh/GrTypesPriv.h
+index fb8688de0dd5b0543aa78f1177a2ed0e807a8165..855e7b15b9def734ce017dd4374c88e7c1011918 100644
+--- a/gfx/skia/skia/include/private/gpu/ganesh/GrTypesPriv.h
++++ b/gfx/skia/skia/include/private/gpu/ganesh/GrTypesPriv.h
+@@ -325,6 +325,7 @@ static inline bool GrTextureTypeHasRestrictedSampling(GrTextureType type) {
+ default:
+ SK_ABORT("Unexpected texture type");
+ }
++ SkUNREACHABLE;
+ }
+
+ //////////////////////////////////////////////////////////////////////////////
+diff --git a/gfx/skia/skia/src/core/SkDescriptor.cpp b/gfx/skia/skia/src/core/SkDescriptor.cpp
+index 827a6352419125930b0572865f0569f5a0f6df87..73164566b9f72d08886a9fc8d56d332e47a8447b 100644
+--- a/gfx/skia/skia/src/core/SkDescriptor.cpp
++++ b/gfx/skia/skia/src/core/SkDescriptor.cpp
+@@ -26,6 +26,7 @@ std::unique_ptr<SkDescriptor> SkDescriptor::Alloc(size_t length) {
+ void SkDescriptor::operator delete(void* p) { ::operator delete(p); }
+ void* SkDescriptor::operator new(size_t) {
+ SK_ABORT("Descriptors are created with placement new.");
++ SkUNREACHABLE;
+ }
+
+ void SkDescriptor::flatten(SkWriteBuffer& buffer) const {
+diff --git a/gfx/skia/skia/src/core/SkGeometry.h b/gfx/skia/skia/src/core/SkGeometry.h
+index e8c9a05ad1311cbb81c04026a6ffb58b8ee1c87a..549949b412d7031d22a9cb928e1ce1c2a8b4f35f 100644
+--- a/gfx/skia/skia/src/core/SkGeometry.h
++++ b/gfx/skia/skia/src/core/SkGeometry.h
+@@ -281,6 +281,7 @@ static inline bool SkCubicIsDegenerate(SkCubicType type) {
+ return true;
+ }
+ SK_ABORT("Invalid SkCubicType");
++ SkUNREACHABLE;
+ }
+
+ static inline const char* SkCubicTypeName(SkCubicType type) {
+@@ -293,6 +294,7 @@ static inline const char* SkCubicTypeName(SkCubicType type) {
+ case SkCubicType::kLineOrPoint: return "kLineOrPoint";
+ }
+ SK_ABORT("Invalid SkCubicType");
++ SkUNREACHABLE;
+ }
+
+ /** Returns the cubic classification.
+diff --git a/gfx/skia/skia/src/core/SkTextBlob.cpp b/gfx/skia/skia/src/core/SkTextBlob.cpp
+index b1dadfdf475d2ddadee762dc7a7a5a8fdeee385c..b4e842dd55e0c4ff06c053f74d5801a05a5d41d1 100644
+--- a/gfx/skia/skia/src/core/SkTextBlob.cpp
++++ b/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.");
++ SkUNREACHABLE;
+ }
+
+ void* SkTextBlob::operator new(size_t, void* p) {
+diff --git a/gfx/skia/skia/src/core/SkTypeface_remote.h b/gfx/skia/skia/src/core/SkTypeface_remote.h
+index 0f03d38b9098d9b58d304c304ed5cd9a8cdce529..fa58945e207dca1987143c6c9719f49101f047a1 100644
+--- a/gfx/skia/skia/src/core/SkTypeface_remote.h
++++ b/gfx/skia/skia/src/core/SkTypeface_remote.h
+@@ -95,12 +95,14 @@ public:
+ bool isLogging() const {return fIsLogging;}
+
+ protected:
+- int onGetUPEM() const override { SK_ABORT("Should never be called."); }
++ 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;
+ }
+ sk_sp<SkTypeface> onMakeClone(const SkFontArguments& args) const override {
+ SK_ABORT("Should never be called.");
++ 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;
+ }
+ int onGetVariationDesignParameters(SkFontParameters::Variation::Axis parameters[],
+ int parameterCount) const override {
+ SK_ABORT("Should never be called.");
++ SkUNREACHABLE;
+ }
+ void onGetFamilyName(SkString* familyName) const override {
+ // Used by SkStrikeCache::DumpMemoryStatistics.
+@@ -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;
+ }
+ int onGetTableTags(SkFontTableTag tags[]) const override {
+ SK_ABORT("Should never be called.");
++ SkUNREACHABLE;
+ }
+ size_t onGetTableData(SkFontTableTag, size_t offset, size_t length, void* data) const override {
+ SK_ABORT("Should never be called.");
++ SkUNREACHABLE;
+ }
+ std::unique_ptr<SkScalerContext> onCreateScalerContext(
+ const SkScalerContextEffects& effects, const SkDescriptor* desc) const override
+@@ -141,20 +149,25 @@ protected:
+ }
+ void onGetFontDescriptor(SkFontDescriptor*, bool*) const override {
+ SK_ABORT("Should never be called.");
++ SkUNREACHABLE;
+ }
+ 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;
+ }
+ 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;
+ }
+
+ private:
+diff --git a/gfx/skia/skia/src/effects/imagefilters/SkBlurImageFilter.cpp b/gfx/skia/skia/src/effects/imagefilters/SkBlurImageFilter.cpp
+index d8c94d7e5ddacd33c358216ba6e6af46e3afee81..674b106df0fd5e34800d1c843ec29af1283ee930 100644
+--- a/gfx/skia/skia/src/effects/imagefilters/SkBlurImageFilter.cpp
++++ b/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;
+ };
+
+ PassMaker* makerX = makeMaker(sigma.x());
+diff --git a/gfx/skia/skia/src/fonts/SkFontMgr_indirect.cpp b/gfx/skia/skia/src/fonts/SkFontMgr_indirect.cpp
+index 98c9663684106739a8ef18ad54a8ffbc7b2dbc8c..f638721b0352a877c08f1c073588ec10ce7dc12e 100644
+--- a/gfx/skia/skia/src/fonts/SkFontMgr_indirect.cpp
++++ b/gfx/skia/skia/src/fonts/SkFontMgr_indirect.cpp
+@@ -69,6 +69,7 @@ void SkFontMgr_Indirect::onGetFamilyName(int index, SkString* familyName) const
+
+ SkFontStyleSet* SkFontMgr_Indirect::onCreateStyleSet(int index) const {
+ SK_ABORT("Not implemented");
++ SkUNREACHABLE;
+ }
+
+ SkFontStyleSet* SkFontMgr_Indirect::onMatchFamily(const char familyName[]) const {
+diff --git a/gfx/skia/skia/src/ports/SkFontMgr_FontConfigInterface.cpp b/gfx/skia/skia/src/ports/SkFontMgr_FontConfigInterface.cpp
+index 89685e8aee3aed9c544c67f4f88613b52c4f02ac..11998479adf271a1a08bb98d6338e59b272c3d18 100644
+--- a/gfx/skia/skia/src/ports/SkFontMgr_FontConfigInterface.cpp
++++ b/gfx/skia/skia/src/ports/SkFontMgr_FontConfigInterface.cpp
+@@ -162,18 +162,22 @@ public:
+ protected:
+ int onCountFamilies() const override {
+ SK_ABORT("Not implemented.");
++ SkUNREACHABLE;
+ }
+
+ void onGetFamilyName(int index, SkString* familyName) const override {
+ SK_ABORT("Not implemented.");
++ SkUNREACHABLE;
+ }
+
+ SkFontStyleSet* onCreateStyleSet(int index) const override {
+ SK_ABORT("Not implemented.");
++ SkUNREACHABLE;
+ }
+
+ SkFontStyleSet* onMatchFamily(const char familyName[]) const override {
+ SK_ABORT("Not implemented.");
++ SkUNREACHABLE;
+ }
+
+ SkTypeface* onMatchFamilyStyle(const char requestedFamilyName[],
+diff --git a/gfx/skia/skia/src/sksl/SkSLCompiler.cpp b/gfx/skia/skia/src/sksl/SkSLCompiler.cpp
+index 78498b58af62570073e7926088163756384e13f9..da4d713694e1b6635f379b382cf50a4960daa653 100644
+--- a/gfx/skia/skia/src/sksl/SkSLCompiler.cpp
++++ b/gfx/skia/skia/src/sksl/SkSLCompiler.cpp
+@@ -277,6 +277,7 @@ std::unique_ptr<Expression> Compiler::convertIdentifier(Position pos, std::strin
+ }
+ default:
+ SK_ABORT("unsupported symbol type %d\n", (int) result->kind());
++ SkUNREACHABLE;
+ }
+ }
+
+diff --git a/gfx/skia/skia/src/sksl/SkSLOperator.cpp b/gfx/skia/skia/src/sksl/SkSLOperator.cpp
+index 6c9ddc92b47c9f2d46301873c6688ea18d5a8e04..00aa9617a309d19ceb892db5cd14b7410736b1b1 100644
+--- a/gfx/skia/skia/src/sksl/SkSLOperator.cpp
++++ b/gfx/skia/skia/src/sksl/SkSLOperator.cpp
+@@ -51,7 +51,7 @@ OperatorPrecedence Operator::getBinaryPrecedence() const {
+ 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;
+ }
+ }
+
+diff --git a/gfx/skia/skia/src/sksl/ir/SkSLType.h b/gfx/skia/skia/src/sksl/ir/SkSLType.h
+index 955381f8c91034f5476c9a47a004c15bb32b583d..74b668ddb55a3f7c6f5650117b9ebd19223e84ee 100644
+--- a/gfx/skia/skia/src/sksl/ir/SkSLType.h
++++ b/gfx/skia/skia/src/sksl/ir/SkSLType.h
+@@ -422,6 +422,7 @@ public:
+
+ virtual const std::vector<Field>& fields() const {
+ SK_ABORT("Internal error: not a struct");
++ SkUNREACHABLE;
+ }
+
+ /**
+diff --git a/gfx/skia/skia/src/utils/SkShadowUtils.cpp b/gfx/skia/skia/src/utils/SkShadowUtils.cpp
+index ddd287ad0cc1e3910adeb125a989fe2b0d93ec9e..c7a62205ab89742e8994b8fc067064c0eee8b842 100644
+--- a/gfx/skia/skia/src/utils/SkShadowUtils.cpp
++++ b/gfx/skia/skia/src/utils/SkShadowUtils.cpp
+@@ -140,6 +140,7 @@ struct SpotVerticesFactory {
+ return true;
+ }
+ SK_ABORT("Uninitialized occluder type?");
++ SkUNREACHABLE;
+ }
+
+ sk_sp<SkVertices> makeVertices(const SkPath& path, const SkMatrix& ctm,
+diff --git a/intl/icu/source/i18n/number_rounding.cpp b/intl/icu/source/i18n/number_rounding.cpp
+index e6bb509ffd75a409faa03ea471bb97b84d2f61de..6055a435309c969ff2431cc1d2ad90c2eef33a15 100644
+--- a/intl/icu/source/i18n/number_rounding.cpp
++++ b/intl/icu/source/i18n/number_rounding.cpp
+@@ -283,6 +283,7 @@ FractionPrecision Precision::constructFraction(int32_t minFrac, int32_t maxFrac)
+ settings.fMaxFrac = static_cast<digits_t>(maxFrac);
+ settings.fMinSig = -1;
+ settings.fMaxSig = -1;
++ settings.fPriority = UNUM_ROUNDING_PRIORITY_RELAXED;
+ PrecisionUnion union_;
+ union_.fracSig = settings;
+ return {RND_FRACTION, union_};
+@@ -294,6 +295,7 @@ Precision Precision::constructSignificant(int32_t minSig, int32_t maxSig) {
+ settings.fMaxFrac = -1;
+ settings.fMinSig = static_cast<digits_t>(minSig);
+ settings.fMaxSig = static_cast<digits_t>(maxSig);
++ settings.fPriority = UNUM_ROUNDING_PRIORITY_RELAXED;
+ PrecisionUnion union_;
+ union_.fracSig = settings;
+ return {RND_SIGNIFICANT, union_};
+diff --git a/js/src/irregexp/imported/regexp-parser.cc b/js/src/irregexp/imported/regexp-parser.cc
+index ea2a6c6d7a3c8d9e0f40945dd486f1ede5f5914d..3399076be5288a805218953443f73d5e578a9adc 100644
+--- a/js/src/irregexp/imported/regexp-parser.cc
++++ b/js/src/irregexp/imported/regexp-parser.cc
+@@ -2649,6 +2649,7 @@ bool MayContainStrings(ClassSetOperandType type, RegExpTree* operand) {
+ if (operand->IsClassRanges()) return false;
+ return operand->AsClassSetExpression()->may_contain_strings();
+ }
++ UNREACHABLE();
+ }
+
+ } // namespace
+diff --git a/third_party/libwebrtc/api/adaptation/resource.cc b/third_party/libwebrtc/api/adaptation/resource.cc
+index dac03fe019d89482e91a29242b3027da80f28c8b..e18a04b4c5c95d1449662cfd8f7a7f978f6461c3 100644
+--- a/third_party/libwebrtc/api/adaptation/resource.cc
++++ b/third_party/libwebrtc/api/adaptation/resource.cc
+@@ -22,6 +22,7 @@ const char* ResourceUsageStateToString(ResourceUsageState usage_state) {
+ return "kUnderuse";
+ }
+ RTC_CHECK_NOTREACHED();
++ return nullptr;
+ }
+
+ ResourceListener::~ResourceListener() {}
+diff --git a/third_party/libwebrtc/api/rtp_parameters.cc b/third_party/libwebrtc/api/rtp_parameters.cc
+index c1d12e5d8dc4be47fd751d656c99174b1433de09..e7fdfc2b7fc14a30df1d8770365985f219e7d4b7 100644
+--- a/third_party/libwebrtc/api/rtp_parameters.cc
++++ b/third_party/libwebrtc/api/rtp_parameters.cc
+@@ -32,6 +32,7 @@ const char* DegradationPreferenceToString(
+ return "balanced";
+ }
+ RTC_CHECK_NOTREACHED();
++ return "";
+ }
+
+ const double kDefaultBitratePriority = 1.0;
+diff --git a/third_party/libwebrtc/api/video/video_frame_buffer.cc b/third_party/libwebrtc/api/video/video_frame_buffer.cc
+index 374b438adcbe961ed0b3787ca6d9a362c220e2d1..d2371b273712ef432b85e45ec478bf6d5a7ee3b3 100644
+--- a/third_party/libwebrtc/api/video/video_frame_buffer.cc
++++ b/third_party/libwebrtc/api/video/video_frame_buffer.cc
+@@ -106,6 +106,8 @@ const char* VideoFrameBufferTypeToString(VideoFrameBuffer::Type type) {
+ default:
+ RTC_DCHECK_NOTREACHED();
+ }
++ RTC_DCHECK_NOTREACHED();
++ return nullptr;
+ }
+
+ int I420BufferInterface::ChromaWidth() const {
+diff --git a/third_party/libwebrtc/api/video_codecs/video_codec.cc b/third_party/libwebrtc/api/video_codecs/video_codec.cc
+index f21c1a340171e831c94c505e162a2d8ac5d67d54..3c773d54b13cc9a17e9b3a0c27d968d4ae7ad498 100644
+--- a/third_party/libwebrtc/api/video_codecs/video_codec.cc
++++ b/third_party/libwebrtc/api/video_codecs/video_codec.cc
+@@ -118,6 +118,7 @@ const char* CodecTypeToPayloadString(VideoCodecType type) {
+ return kPayloadNameGeneric;
+ }
+ RTC_CHECK_NOTREACHED();
++ return "";
+ }
+
+ VideoCodecType PayloadStringToCodecType(const std::string& name) {
+diff --git a/third_party/libwebrtc/api/video_codecs/video_encoder_software_fallback_wrapper.cc b/third_party/libwebrtc/api/video_codecs/video_encoder_software_fallback_wrapper.cc
+index 39c52a008181cd2cf5fb2b3589816dfd3f03a6ba..24df68f62d0f27d3f0e2e099f1f694fe2fd4e982 100644
+--- 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
+@@ -163,6 +163,7 @@ class VideoEncoderSoftwareFallbackWrapper final : public VideoEncoder {
+ return fallback_encoder_.get();
+ }
+ RTC_CHECK_NOTREACHED();
++ return nullptr;
+ }
+
+ // Updates encoder with last observed parameters, such as callbacks, rates,
+@@ -343,6 +344,7 @@ int32_t VideoEncoderSoftwareFallbackWrapper::Encode(
+ return fallback_encoder_->Encode(frame, frame_types);
+ }
+ RTC_CHECK_NOTREACHED();
++ return WEBRTC_VIDEO_CODEC_ERROR;
+ }
+
+ int32_t VideoEncoderSoftwareFallbackWrapper::EncodeWithMainEncoder(
+diff --git a/third_party/libwebrtc/call/adaptation/video_stream_adapter.cc b/third_party/libwebrtc/call/adaptation/video_stream_adapter.cc
+index 5a970fb2ef1af8069b7dd0c52a993ea7d7e6e896..0feec89ab185ab214e1f24b05efab02fddcb5bc4 100644
+--- a/third_party/libwebrtc/call/adaptation/video_stream_adapter.cc
++++ b/third_party/libwebrtc/call/adaptation/video_stream_adapter.cc
+@@ -169,6 +169,7 @@ const char* Adaptation::StatusToString(Adaptation::Status status) {
+ return "kRejectedByConstraint";
+ }
+ RTC_CHECK_NOTREACHED();
++ return "";
+ }
+
+ Adaptation::Adaptation(int validation_id,
+@@ -391,6 +392,7 @@ VideoStreamAdapter::RestrictionsOrState VideoStreamAdapter::GetAdaptationUpStep(
+ return Adaptation::Status::kAdaptationDisabled;
+ }
+ RTC_CHECK_NOTREACHED();
++ return Adaptation::Status::kAdaptationDisabled;
+ }
+
+ Adaptation VideoStreamAdapter::GetAdaptationDown() {
+@@ -473,6 +475,7 @@ VideoStreamAdapter::GetAdaptationDownStep(
+ return Adaptation::Status::kAdaptationDisabled;
+ }
+ RTC_CHECK_NOTREACHED();
++ return Adaptation::Status::kAdaptationDisabled;
+ }
+
+ VideoStreamAdapter::RestrictionsOrState VideoStreamAdapter::DecreaseResolution(
+@@ -626,6 +629,8 @@ Adaptation VideoStreamAdapter::GetAdaptDownResolution() {
+ }
+ }
+ RTC_CHECK_NOTREACHED();
++ return RestrictionsOrStateToAdaptation(
++ Adaptation::Status::kAdaptationDisabled, input_state);
+ }
+
+ VideoStreamAdapter::RestrictionsOrState
+diff --git a/third_party/libwebrtc/call/rtp_payload_params.cc b/third_party/libwebrtc/call/rtp_payload_params.cc
+index 18e6d9136bc399f9a22fe66162daba584e14c6c6..e0c9e9184147bfb25228efae4813f37686e0a561 100644
+--- a/third_party/libwebrtc/call/rtp_payload_params.cc
++++ b/third_party/libwebrtc/call/rtp_payload_params.cc
+@@ -405,7 +405,7 @@ absl::optional<FrameDependencyStructure> RtpPayloadParams::GenericStructure(
+ case VideoCodecType::kVideoCodecMultiplex:
+ return absl::nullopt;
+ }
+- RTC_DCHECK_NOTREACHED() << "Unsupported codec.";
++ RTC_CHECK_NOTREACHED();
+ }
+
+ void RtpPayloadParams::GenericToGeneric(int64_t shared_frame_id,
+diff --git a/third_party/libwebrtc/call/video_send_stream.cc b/third_party/libwebrtc/call/video_send_stream.cc
+index 241d44a2303a10c7a13557080665ee677835c4d0..0e4e28a70c76220121bedbc7e670045b63238a9b 100644
+--- a/third_party/libwebrtc/call/video_send_stream.cc
++++ b/third_party/libwebrtc/call/video_send_stream.cc
+@@ -30,6 +30,7 @@ const char* StreamTypeToString(VideoSendStream::StreamStats::StreamType type) {
+ return "flexfec";
+ }
+ RTC_CHECK_NOTREACHED();
++ return "";
+ }
+
+ } // namespace
+diff --git a/third_party/libwebrtc/modules/audio_processing/agc2/clipping_predictor.cc b/third_party/libwebrtc/modules/audio_processing/agc2/clipping_predictor.cc
+index fd759c63e8519fc8655cb873c3d7fc04e209e03d..1a3369ee23bdac60d4f68c9f34be991ce2be47dd 100644
+--- a/third_party/libwebrtc/modules/audio_processing/agc2/clipping_predictor.cc
++++ b/third_party/libwebrtc/modules/audio_processing/agc2/clipping_predictor.cc
+@@ -378,7 +378,7 @@ std::unique_ptr<ClippingPredictor> CreateClippingPredictor(
+ config.reference_window_delay, config.clipping_threshold,
+ /*adaptive_step_estimation=*/false);
+ }
+- RTC_DCHECK_NOTREACHED();
++ RTC_CHECK_NOTREACHED();
+ }
+
+ } // namespace webrtc
+diff --git a/third_party/libwebrtc/modules/audio_processing/agc2/input_volume_stats_reporter.cc b/third_party/libwebrtc/modules/audio_processing/agc2/input_volume_stats_reporter.cc
+index 05624b1f9227a28622a4d97629e782c61617c8a4..4de2e3e67ae08e6788894986fe48d5082a8aa739 100644
+--- a/third_party/libwebrtc/modules/audio_processing/agc2/input_volume_stats_reporter.cc
++++ b/third_party/libwebrtc/modules/audio_processing/agc2/input_volume_stats_reporter.cc
+@@ -48,6 +48,7 @@ constexpr absl::string_view MetricNamePrefix(
+ case InputVolumeType::kRecommended:
+ return "WebRTC.Audio.Apm.RecommendedInputVolume.";
+ }
++ RTC_CHECK_NOTREACHED();
+ }
+
+ metrics::Histogram* CreateVolumeHistogram(InputVolumeType input_volume_type) {
+diff --git a/third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_fc.cc b/third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/rnn_fc.cc
+index 91501fb6e32cb00fa79ce170e95d7e49301717e6..d87d9586e103a8e5edf703a3e516f73e91e3516d 100644
+--- 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
+@@ -59,6 +59,8 @@ rtc::FunctionView<float(float)> GetActivationFunction(
+ case ActivationFunction::kSigmoidApproximated:
+ return ::rnnoise::SigmoidApproximated;
+ }
++ // supposed to be never reached apparently therefore returning bogus
++ return ::rnnoise::TansigApproximated;
+ }
+
+ } // namespace
+diff --git a/third_party/libwebrtc/modules/audio_processing/audio_processing_impl.cc b/third_party/libwebrtc/modules/audio_processing/audio_processing_impl.cc
+index c304453388e2b33826249a0b84d8d79699f4278c..6fca19ff17f1a63b919358616ce1f2787116adef 100644
+--- a/third_party/libwebrtc/modules/audio_processing/audio_processing_impl.cc
++++ b/third_party/libwebrtc/modules/audio_processing/audio_processing_impl.cc
+@@ -99,6 +99,7 @@ GainControl::Mode Agc1ConfigModeToInterfaceMode(
+ return GainControl::kFixedDigital;
+ }
+ RTC_CHECK_NOTREACHED();
++ return GainControl::kAdaptiveAnalog;
+ }
+
+ bool MinimizeProcessingForUnusedOutput() {
+@@ -166,7 +167,7 @@ int AudioFormatValidityToErrorCode(AudioFormatValidity validity) {
+ case AudioFormatValidity::kInvalidChannelCount:
+ return AudioProcessing::kBadNumberChannelsError;
+ }
+- RTC_DCHECK(false);
++ RTC_CHECK_NOTREACHED();
+ }
+
+ // Returns an AudioProcessing::Error together with the best possible option for
+@@ -2421,6 +2422,7 @@ void AudioProcessingImpl::InitializeNoiseSuppressor() {
+ return NsConfig::SuppressionLevel::k21dB;
+ }
+ RTC_CHECK_NOTREACHED();
++ return NsConfig::SuppressionLevel::k6dB;
+ };
+
+ NsConfig cfg;
+diff --git a/third_party/libwebrtc/modules/audio_processing/include/audio_processing.cc b/third_party/libwebrtc/modules/audio_processing/include/audio_processing.cc
+index 13ddcc588ae40569be0ec9a8ae8c0556a3c8ac70..a06df8ce80416cf4e2f0e5eabef7d0699b368b16 100644
+--- a/third_party/libwebrtc/modules/audio_processing/include/audio_processing.cc
++++ b/third_party/libwebrtc/modules/audio_processing/include/audio_processing.cc
+@@ -32,6 +32,7 @@ std::string NoiseSuppressionLevelToString(
+ return "VeryHigh";
+ }
+ RTC_CHECK_NOTREACHED();
++ return "";
+ }
+
+ std::string GainController1ModeToString(const Agc1Config::Mode& mode) {
+@@ -44,6 +45,7 @@ std::string GainController1ModeToString(const Agc1Config::Mode& mode) {
+ return "FixedDigital";
+ }
+ RTC_CHECK_NOTREACHED();
++ return "";
+ }
+
+ } // namespace
+diff --git a/third_party/libwebrtc/modules/audio_processing/transient/transient_suppressor_impl.cc b/third_party/libwebrtc/modules/audio_processing/transient/transient_suppressor_impl.cc
+index 90428464e3bca2e8b0268e977d03d27176aedf86..8f9f8ac3ee6b743cb1d025d0f3b4088b26db3273 100644
+--- a/third_party/libwebrtc/modules/audio_processing/transient/transient_suppressor_impl.cc
++++ b/third_party/libwebrtc/modules/audio_processing/transient/transient_suppressor_impl.cc
+@@ -53,6 +53,7 @@ std::string GetVadModeLabel(TransientSuppressor::VadMode vad_mode) {
+ case TransientSuppressor::VadMode::kNoVad:
+ return "no VAD";
+ }
++ RTC_CHECK_NOTREACHED();
+ }
+
+ } // namespace
+diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_portal.cc b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_portal.cc
+index 8d9e956779e0d9826652c6c97485c8107cb4ad3b..d9089fd36ef322acc2b1e3f9dd6de9b2a34ade49 100644
+--- a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_portal.cc
++++ b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_portal.cc
+@@ -44,6 +44,7 @@ ScreenCastPortal::CaptureSourceType ScreenCastPortal::ToCaptureSourceType(
+ case CaptureType::kAnyScreenContent:
+ return ScreenCastPortal::CaptureSourceType::kAnyScreenContent;
+ }
++ RTC_CHECK_NOTREACHED();
+ }
+
+ ScreenCastPortal::ScreenCastPortal(CaptureType type, PortalNotifier* notifier)
+diff --git a/third_party/libwebrtc/modules/pacing/bitrate_prober.cc b/third_party/libwebrtc/modules/pacing/bitrate_prober.cc
+index 3151a35075e57bad9d344f45841b61b278577a1c..fe36a4f749cf91af662fea3a96474e1ebf7ad8f0 100644
+--- a/third_party/libwebrtc/modules/pacing/bitrate_prober.cc
++++ b/third_party/libwebrtc/modules/pacing/bitrate_prober.cc
+@@ -69,6 +69,7 @@ bool BitrateProber::ReadyToSetActiveState(DataSize packet_size) const {
+ return packet_size >=
+ std::min(RecommendedMinProbeSize(), config_.min_packet_size.Get());
+ }
++ RTC_CHECK_NOTREACHED();
+ }
+
+ void BitrateProber::OnIncomingPacket(DataSize packet_size) {
+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
+index f1e4eddb4b9d8855f6accf24ef980cbc11d0077d..b3fde3cda3c7c636b8f37f3778fb3b735a61d66d 100644
+--- 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
+@@ -38,6 +38,7 @@ std::unique_ptr<VideoRtpDepacketizer> CreateVideoRtpDepacketizer(
+ return std::make_unique<VideoRtpDepacketizerGeneric>();
+ }
+ RTC_CHECK_NOTREACHED();
++ return nullptr;
+ }
+
+ } // 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
+index f97fb167ed8b1e1f5b9e8aa3acf4cca5f067d35f..1b168f3fc6a22c55b4d7e958f9abfc4d3c4765c1 100644
+--- a/third_party/libwebrtc/modules/rtp_rtcp/source/rtp_sender.cc
++++ b/third_party/libwebrtc/modules/rtp_rtcp/source/rtp_sender.cc
+@@ -140,6 +140,7 @@ bool IsNonVolatile(RTPExtensionType type) {
+ #endif
+ }
+ RTC_CHECK_NOTREACHED();
++ return false;
+ }
+
+ bool HasBweExtension(const RtpHeaderExtensionMap& extensions_map) {
+diff --git a/third_party/libwebrtc/modules/rtp_rtcp/source/rtp_sender_audio.cc b/third_party/libwebrtc/modules/rtp_rtcp/source/rtp_sender_audio.cc
+index 244f644bd1a1ee8f61e322270012b2cfbec5afda..c2187e469c1b078223a1fdf0266a3e82d9d9a64f 100644
+--- a/third_party/libwebrtc/modules/rtp_rtcp/source/rtp_sender_audio.cc
++++ b/third_party/libwebrtc/modules/rtp_rtcp/source/rtp_sender_audio.cc
+@@ -45,6 +45,7 @@ namespace {
+ return "audio_cn";
+ }
+ RTC_CHECK_NOTREACHED();
++ return "";
+ }
+
+ constexpr char kIncludeCaptureClockOffset[] =
+diff --git a/third_party/libwebrtc/modules/video_coding/codecs/vp8/default_temporal_layers.cc b/third_party/libwebrtc/modules/video_coding/codecs/vp8/default_temporal_layers.cc
+index 94860da1b6b2ddf44fb45a9c173d080ed85d24f7..ab24c6ff2cae88a58d04e59c07b7b992566792eb 100644
+--- a/third_party/libwebrtc/modules/video_coding/codecs/vp8/default_temporal_layers.cc
++++ b/third_party/libwebrtc/modules/video_coding/codecs/vp8/default_temporal_layers.cc
+@@ -110,6 +110,7 @@ size_t BufferToIndex(Vp8BufferReference buffer) {
+ case Vp8FrameConfig::Vp8BufferReference::kNone:
+ RTC_CHECK_NOTREACHED();
+ }
++ RTC_CHECK_NOTREACHED();
+ }
+
+ } // namespace
+diff --git a/third_party/libwebrtc/modules/video_coding/codecs/vp8/temporal_layers_checker.cc b/third_party/libwebrtc/modules/video_coding/codecs/vp8/temporal_layers_checker.cc
+index 5aebd2c5268e8c58b07be4bc393f83ac5abd1c09..8d18446430ff4b7f6d0d669416e3493de3b41411 100644
+--- 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
+@@ -30,6 +30,7 @@ TemporalLayersChecker::CreateTemporalLayersChecker(Vp8TemporalLayersType type,
+ return std::make_unique<TemporalLayersChecker>(num_temporal_layers);
+ }
+ RTC_CHECK_NOTREACHED();
++ return nullptr;
+ }
+
+ TemporalLayersChecker::TemporalLayersChecker(int num_temporal_layers)
+diff --git a/third_party/libwebrtc/video/adaptation/video_stream_encoder_resource_manager.cc b/third_party/libwebrtc/video/adaptation/video_stream_encoder_resource_manager.cc
+index 2470bc889383a572605021edbaec01ac5ed34ddb..37309e4822f16d3f4a38d4c6719b6773b30b8372 100644
+--- a/third_party/libwebrtc/video/adaptation/video_stream_encoder_resource_manager.cc
++++ b/third_party/libwebrtc/video/adaptation/video_stream_encoder_resource_manager.cc
+@@ -63,6 +63,7 @@ std::string ToString(VideoAdaptationReason reason) {
+ return "cpu";
+ }
+ RTC_CHECK_NOTREACHED();
++ return "";
+ }
+
+ std::vector<bool> GetActiveLayersFlags(const VideoCodec& codec) {
diff --git a/0010-Bug-531915-mozilla-bmo531915.patch.patch b/0006-Bug-531915-mozilla-bmo531915.patch.patch
index b6c43fc72484..b6c43fc72484 100644
--- a/0010-Bug-531915-mozilla-bmo531915.patch.patch
+++ b/0006-Bug-531915-mozilla-bmo531915.patch.patch
diff --git a/0011-imported-patch-one_swizzle_to_rule_them_all.patch.patch b/0007-imported-patch-one_swizzle_to_rule_them_all.patch.patch
index 7cf13ec016fa..fcd04a935ffc 100644
--- a/0011-imported-patch-one_swizzle_to_rule_them_all.patch.patch
+++ b/0007-imported-patch-one_swizzle_to_rule_them_all.patch.patch
@@ -8,7 +8,7 @@ Subject: [PATCH] imported patch one_swizzle_to_rule_them_all.patch
1 file changed, 8 insertions(+)
diff --git a/gfx/webrender_bindings/RenderCompositorSWGL.cpp b/gfx/webrender_bindings/RenderCompositorSWGL.cpp
-index e52b8eba50cd6c243aa671285d2419e84834a898..b6d6cd0de300d2b553a22825380bb9b22a0929e4 100644
+index d767ff83f7718097e95883cbfdee31dea6cb198a..9146005c8b9dafee9ed0ea40ace3e71db9509e6d 100644
--- a/gfx/webrender_bindings/RenderCompositorSWGL.cpp
+++ b/gfx/webrender_bindings/RenderCompositorSWGL.cpp
@@ -7,6 +7,7 @@
@@ -19,7 +19,7 @@ index e52b8eba50cd6c243aa671285d2419e84834a898..b6d6cd0de300d2b553a22825380bb9b2
#include "mozilla/widget/CompositorWidget.h"
#ifdef MOZ_WIDGET_GTK
-@@ -235,6 +236,13 @@ void RenderCompositorSWGL::CommitMappedBuffer(bool aDirty) {
+@@ -242,6 +243,13 @@ void RenderCompositorSWGL::CommitMappedBuffer(bool aDirty) {
}
mDT->Flush();
diff --git a/0007-mozilla-s390x-skia-gradient.patch.patch b/0007-mozilla-s390x-skia-gradient.patch.patch
deleted file mode 100644
index 81f5e79ef575..000000000000
--- a/0007-mozilla-s390x-skia-gradient.patch.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Martin Sirringhaus <msirringhaus@suse.de>
-Date: Fri, 27 Mar 2020 13:42:24 +0100
-Subject: [PATCH] mozilla-s390x-skia-gradient.patch
-
----
- .../shaders/gradients/Sk4fLinearGradient.cpp | 20 ++++++++++++++++---
- 1 file changed, 17 insertions(+), 3 deletions(-)
-
-diff --git a/gfx/skia/skia/src/shaders/gradients/Sk4fLinearGradient.cpp b/gfx/skia/skia/src/shaders/gradients/Sk4fLinearGradient.cpp
-index b4266ced9d26cb6a6a44ae3d9a84de1080a0e6cb..89b478fd1c4a540ee4d275018703bb347b46c3ba 100644
---- a/gfx/skia/skia/src/shaders/gradients/Sk4fLinearGradient.cpp
-+++ b/gfx/skia/skia/src/shaders/gradients/Sk4fLinearGradient.cpp
-@@ -7,7 +7,7 @@
-
- #include "include/core/SkPaint.h"
- #include "src/shaders/gradients/Sk4fLinearGradient.h"
--
-+#include "src/core/SkEndian.h"
- #include <cmath>
- #include <utility>
-
-@@ -28,6 +28,9 @@ void ramp(const Sk4f& c, const Sk4f& dc, SkPMColor dst[], int n,
-
- while (n >= 4) {
- DstTraits<premul>::store4x(c0, c1, c2, c3, dst, bias0, bias1);
-+#ifdef SK_CPU_BENDIAN
-+ SkEndianSwap32s(dst, 4);
-+#endif
- dst += 4;
-
- c0 = c0 + dc4;
-@@ -37,12 +40,23 @@ void ramp(const Sk4f& c, const Sk4f& dc, SkPMColor dst[], int n,
- n -= 4;
- }
- if (n & 2) {
-- DstTraits<premul>::store(c0, dst++, bias0);
-- DstTraits<premul>::store(c1, dst++, bias1);
-+ DstTraits<premul>::store(c0, dst, bias0);
-+#ifdef SK_CPU_BENDIAN
-+ *dst = SkEndianSwap32(*dst);
-+#endif
-+ ++dst;
-+ DstTraits<premul>::store(c1, dst, bias1);
-+#ifdef SK_CPU_BENDIAN
-+ *dst = SkEndianSwap32(*dst);
-+#endif
-+ ++dst;
- c0 = c0 + dc2;
- }
- if (n & 1) {
- DstTraits<premul>::store(c0, dst, bias0);
-+#ifdef SK_CPU_BENDIAN
-+ *dst = SkEndianSwap32(*dst);
-+#endif
- }
- }
-
diff --git a/0012-imported-patch-svg-rendering.patch.patch b/0008-imported-patch-svg-rendering.patch.patch
index 47928eb61478..9af479855e6d 100644
--- a/0012-imported-patch-svg-rendering.patch.patch
+++ b/0008-imported-patch-svg-rendering.patch.patch
@@ -8,7 +8,7 @@ Subject: [PATCH] imported patch svg-rendering.patch
1 file changed, 11 insertions(+)
diff --git a/image/imgFrame.cpp b/image/imgFrame.cpp
-index 4ff6dcec197733d03e50eade0471834473bece7c..ed3e311f7a3e1b4d9e36b5cd39da1099845ce408 100644
+index 0df40fcfa93c6c33ab4440427e6471860ab2f247..42881901004a6106f7402eb08b4af09296540654 100644
--- a/image/imgFrame.cpp
+++ b/image/imgFrame.cpp
@@ -372,6 +372,17 @@ nsresult imgFrame::InitWithDrawable(gfxDrawable* aDrawable,
diff --git a/0013-Bug-1792159-Add-missing-includes-to-AtomicOperations.patch b/0009-Bug-1792159-Add-missing-includes-to-AtomicOperations.patch
index 3be19cd540ff..3be19cd540ff 100644
--- a/0013-Bug-1792159-Add-missing-includes-to-AtomicOperations.patch
+++ b/0009-Bug-1792159-Add-missing-includes-to-AtomicOperations.patch
diff --git a/0009-mozilla-silence-no-return-type.patch-to-fix-build-er.patch b/0009-mozilla-silence-no-return-type.patch-to-fix-build-er.patch
deleted file mode 100644
index 237cd410f930..000000000000
--- a/0009-mozilla-silence-no-return-type.patch-to-fix-build-er.patch
+++ /dev/null
@@ -1,1600 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Wolfgang Rosenauer <wr@rosenauer.org>
-Date: Sun, 27 Dec 2020 10:48:12 +0100
-Subject: [PATCH] mozilla-silence-no-return-type.patch to fix build errors on
- some Leap versions
-
----
- Cargo.lock | 2 --
- Cargo.toml | 1 +
- gfx/skia/skia/include/codec/SkEncodedOrigin.h | 1 +
- gfx/skia/skia/include/private/GrTypesPriv.h | 3 +++
- gfx/skia/skia/src/core/SkGeometry.h | 2 ++
- gfx/skia/skia/src/core/SkTextBlob.cpp | 1 +
- gfx/skia/skia/src/core/SkTypeface_remote.cpp | 1 +
- gfx/skia/skia/src/core/SkTypeface_remote.h | 12 +++++++++++-
- .../src/effects/imagefilters/SkBlurImageFilter.cpp | 1 +
- .../effects/imagefilters/SkLightingImageFilter.cpp | 1 +
- gfx/skia/skia/src/fonts/SkFontMgr_indirect.cpp | 1 +
- gfx/skia/skia/src/gpu/GrDataUtils.cpp | 2 ++
- gfx/skia/skia/src/gpu/GrFragmentProcessor.h | 1 +
- gfx/skia/skia/src/gpu/GrPathRendering.cpp | 1 +
- gfx/skia/skia/src/gpu/GrPathRendering.h | 1 +
- gfx/skia/skia/src/gpu/GrProcessorUnitTest.cpp | 1 +
- gfx/skia/skia/src/gpu/GrReducedClip.cpp | 2 ++
- gfx/skia/skia/src/gpu/GrResourceCache.cpp | 2 ++
- gfx/skia/skia/src/gpu/GrShaderVar.cpp | 2 ++
- gfx/skia/skia/src/gpu/SkGpuDevice.cpp | 1 +
- gfx/skia/skia/src/gpu/SkGr.h | 1 +
- gfx/skia/skia/src/gpu/ccpr/GrCCCoverageProcessor.h | 1 +
- gfx/skia/skia/src/gpu/ccpr/GrCCStrokeGeometry.cpp | 1 +
- gfx/skia/skia/src/gpu/ccpr/GrCCStrokeGeometry.h | 1 +
- .../src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp | 1 +
- gfx/skia/skia/src/gpu/ccpr/GrVSCoverageProcessor.cpp | 1 +
- gfx/skia/skia/src/gpu/dawn/GrDawnOpsRenderPass.cpp | 2 ++
- gfx/skia/skia/src/gpu/dawn/GrDawnUniformHandler.cpp | 2 ++
- gfx/skia/skia/src/gpu/dawn/GrDawnVaryingHandler.cpp | 1 +
- .../skia/src/gpu/effects/GrConstColorProcessor.fp | 1 +
- gfx/skia/skia/src/gpu/effects/GrCoverageSetOpXP.cpp | 1 +
- .../src/gpu/effects/GrPorterDuffXferProcessor.cpp | 1 +
- gfx/skia/skia/src/gpu/effects/GrSkSLFP.cpp | 2 ++
- .../gpu/effects/generated/GrConstColorProcessor.h | 1 +
- gfx/skia/skia/src/gpu/geometry/GrShape.cpp | 2 ++
- gfx/skia/skia/src/gpu/gl/GrGLCaps.cpp | 1 +
- gfx/skia/skia/src/gpu/gl/GrGLGLSL.cpp | 1 +
- gfx/skia/skia/src/gpu/gl/GrGLGpu.cpp | 12 +++++++++---
- gfx/skia/skia/src/gpu/gl/GrGLPath.cpp | 1 +
- gfx/skia/skia/src/gpu/gl/GrGLTexture.cpp | 3 +++
- gfx/skia/skia/src/gpu/gl/GrGLVertexArray.cpp | 1 +
- gfx/skia/skia/src/gpu/glsl/GrGLSL.cpp | 1 +
- gfx/skia/skia/src/gpu/glsl/GrGLSLVarying.cpp | 1 +
- .../skia/src/gpu/glsl/GrGLSLVertexGeoBuilder.cpp | 2 ++
- gfx/skia/skia/src/gpu/mtl/GrMtlCaps.mm | 2 ++
- .../skia/src/gpu/mtl/GrMtlPipelineStateBuilder.mm | 2 ++
- gfx/skia/skia/src/gpu/mtl/GrMtlSampler.mm | 1 +
- gfx/skia/skia/src/gpu/mtl/GrMtlUniformHandler.mm | 2 ++
- gfx/skia/skia/src/gpu/mtl/GrMtlUtil.mm | 1 +
- gfx/skia/skia/src/gpu/ops/GrDrawVerticesOp.cpp | 2 ++
- gfx/skia/skia/src/gpu/ops/GrFillRRectOp.cpp | 1 +
- gfx/skia/skia/src/gpu/ops/GrOvalOpFactory.cpp | 3 +++
- gfx/skia/skia/src/gpu/ops/GrShadowRRectOp.cpp | 3 +++
- gfx/skia/skia/src/gpu/text/GrTextBlob.h | 1 +
- .../src/gpu/text/GrTextBlobVertexRegenerator.cpp | 1 +
- gfx/skia/skia/src/gpu/vk/GrVkCaps.cpp | 2 ++
- gfx/skia/skia/src/gpu/vk/GrVkMemory.cpp | 1 +
- gfx/skia/skia/src/gpu/vk/GrVkPipeline.cpp | 3 +++
- gfx/skia/skia/src/gpu/vk/GrVkSampler.cpp | 1 +
- gfx/skia/skia/src/gpu/vk/GrVkTransferBuffer.h | 1 +
- gfx/skia/skia/src/gpu/vk/GrVkUniformHandler.cpp | 2 ++
- gfx/skia/skia/src/gpu/vk/GrVkVaryingHandler.cpp | 1 +
- gfx/skia/skia/src/pdf/SkPDFTag.cpp | 1 +
- .../skia/src/ports/SkFontMgr_FontConfigInterface.cpp | 6 ++++++
- gfx/skia/skia/src/shaders/SkImageShader.cpp | 1 +
- gfx/skia/skia/src/utils/SkShadowUtils.cpp | 1 +
- intl/icu/source/i18n/number_rounding.cpp | 2 ++
- third_party/libwebrtc/api/adaptation/resource.cc | 1 +
- third_party/libwebrtc/api/rtp_parameters.cc | 1 +
- .../libwebrtc/api/video/video_frame_buffer.cc | 2 ++
- .../libwebrtc/api/video_codecs/video_codec.cc | 1 +
- .../video_encoder_software_fallback_wrapper.cc | 2 ++
- .../call/adaptation/video_stream_adapter.cc | 5 +++++
- third_party/libwebrtc/call/video_send_stream.cc | 1 +
- .../audio_processing/agc/clipping_predictor.cc | 1 +
- .../modules/audio_processing/agc2/rnn_vad/rnn_fc.cc | 2 ++
- .../audio_processing/audio_processing_impl.cc | 2 ++
- .../audio_processing/include/audio_processing.cc | 2 ++
- .../rtp_rtcp/source/create_video_rtp_depacketizer.cc | 1 +
- .../libwebrtc/modules/rtp_rtcp/source/rtp_sender.cc | 1 +
- .../modules/rtp_rtcp/source/rtp_sender_audio.cc | 1 +
- .../codecs/vp8/temporal_layers_checker.cc | 1 +
- .../video_stream_encoder_resource_manager.cc | 1 +
- .../glsl-optimizer/src/compiler/glsl/ast_to_hir.cpp | 1 +
- .../glslopt/glsl-optimizer/src/compiler/glsl/ir.cpp | 1 +
- .../src/compiler/glsl/loop_analysis.cpp | 1 +
- .../src/compiler/glsl/opt_vectorize.cpp | 1 +
- .../glsl-optimizer/src/compiler/glsl_types.cpp | 5 +++++
- .../glslopt/glsl-optimizer/src/mesa/main/shaderobj.h | 4 ++++
- 89 files changed, 154 insertions(+), 6 deletions(-)
-
-diff --git a/Cargo.lock b/Cargo.lock
-index 5dde1f1aeb43728d0784cbd1b256ecdbbf7e5698..dc8f980658c2a247ed4ead378ee726bf6ecb1da3 100644
---- a/Cargo.lock
-+++ b/Cargo.lock
-@@ -2375,8 +2375,6 @@ dependencies = [
- [[package]]
- name = "glslopt"
- version = "0.1.9"
--source = "registry+https://github.com/rust-lang/crates.io-index"
--checksum = "74a3f5c04450dfdadb4b08f6e5ee6f5110f674de1acbd6199bfec68392a8cbaf"
- dependencies = [
- "cc",
- ]
-diff --git a/Cargo.toml b/Cargo.toml
-index 1909f0cebe4d71ab5b3ffa214372c053c99d41e0..ba23ffb01a87ff0a68395d91b7d5efd8450ab3b1 100644
---- a/Cargo.toml
-+++ b/Cargo.toml
-@@ -163,6 +163,7 @@ midir = { git = "https://github.com/mozilla/midir.git", rev = "519e651241e867af3
- minidump-writer = { git = "https://github.com/rust-minidump/minidump-writer.git", rev = "7d76616d27b9dc87fe3a94639b8b4f947d52a6aa" }
- # 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 = "d3670a89bae26ba3a8db4758eb7976616113987d" }
-
-diff --git a/gfx/skia/skia/include/codec/SkEncodedOrigin.h b/gfx/skia/skia/include/codec/SkEncodedOrigin.h
-index 2eed1c6ac6cc1ba8512cbff3c5f255ef33ec1645..49d03090341e6e08525c1a0e34f5b04e6e2cfb73 100644
---- a/gfx/skia/skia/include/codec/SkEncodedOrigin.h
-+++ b/gfx/skia/skia/include/codec/SkEncodedOrigin.h
-@@ -41,6 +41,7 @@ static inline SkMatrix SkEncodedOriginToMatrix(SkEncodedOrigin origin, int w, in
- case kLeftBottom_SkEncodedOrigin: return SkMatrix::MakeAll( 0, 1, 0, -1, 0, w, 0, 0, 1);
- }
- SK_ABORT("Unexpected origin");
-+ SkUNREACHABLE;
- }
-
-
-diff --git a/gfx/skia/skia/include/private/GrTypesPriv.h b/gfx/skia/skia/include/private/GrTypesPriv.h
-index 90718038e037bddf0633f33eaeef26306e8f79f9..4ec7729ab8e0885b3c5d16febd39a469a562c0a9 100644
---- a/gfx/skia/skia/include/private/GrTypesPriv.h
-+++ b/gfx/skia/skia/include/private/GrTypesPriv.h
-@@ -540,6 +540,7 @@ static inline GrSLType GrSLCombinedSamplerTypeForTextureType(GrTextureType type)
- default:
- SK_ABORT("Unexpected texture type");
- }
-+ SkUNREACHABLE;
- }
-
- /** Rectangle and external textures only support the clamp wrap mode and do not support
-@@ -556,6 +557,7 @@ static inline bool GrTextureTypeHasRestrictedSampling(GrTextureType type) {
- default:
- SK_ABORT("Unexpected texture type");
- }
-+ SkUNREACHABLE;
- }
-
- static constexpr bool GrSLTypeIsCombinedSamplerType(GrSLType type) {
-@@ -858,6 +860,7 @@ static inline size_t GrCompressedFormatDataSize(SkImage::CompressionType compres
- }
-
- SK_ABORT("Invalid pixel config");
-+ SkUNREACHABLE;
- }
-
- /**
-diff --git a/gfx/skia/skia/src/core/SkGeometry.h b/gfx/skia/skia/src/core/SkGeometry.h
-index 23bdbc1c42591b45115d9fd025f373365c8c14d6..ea2d23f6e8e5e6cdc0a5e76d1ae265bb0bae4285 100644
---- a/gfx/skia/skia/src/core/SkGeometry.h
-+++ b/gfx/skia/skia/src/core/SkGeometry.h
-@@ -182,6 +182,7 @@ static inline bool SkCubicIsDegenerate(SkCubicType type) {
- return true;
- }
- SK_ABORT("Invalid SkCubicType");
-+ SkUNREACHABLE;
- }
-
- static inline const char* SkCubicTypeName(SkCubicType type) {
-@@ -194,6 +195,7 @@ static inline const char* SkCubicTypeName(SkCubicType type) {
- case SkCubicType::kLineOrPoint: return "kLineOrPoint";
- }
- SK_ABORT("Invalid SkCubicType");
-+ SkUNREACHABLE;
- }
-
- /** Returns the cubic classification.
-diff --git a/gfx/skia/skia/src/core/SkTextBlob.cpp b/gfx/skia/skia/src/core/SkTextBlob.cpp
-index 3c84bda6f8e1119db457468ec257cdf876432647..e2fba375ccd358264ed64caa333abe58b8c125be 100644
---- a/gfx/skia/skia/src/core/SkTextBlob.cpp
-+++ b/gfx/skia/skia/src/core/SkTextBlob.cpp
-@@ -201,6 +201,7 @@ void SkTextBlob::operator delete(void* p) {
-
- void* SkTextBlob::operator new(size_t) {
- SK_ABORT("All blobs are created by placement new.");
-+ SkUNREACHABLE;
- }
-
- void* SkTextBlob::operator new(size_t, void* p) {
-diff --git a/gfx/skia/skia/src/core/SkTypeface_remote.cpp b/gfx/skia/skia/src/core/SkTypeface_remote.cpp
-index 838a78331359ea7f8d5be746af804cb810aba7a5..d878fadc080914b7cc244be30b1a281f0ef89621 100644
---- a/gfx/skia/skia/src/core/SkTypeface_remote.cpp
-+++ b/gfx/skia/skia/src/core/SkTypeface_remote.cpp
-@@ -29,6 +29,7 @@ void SkScalerContextProxy::initCache(SkStrike* cache, SkStrikeCache* strikeCache
-
- unsigned SkScalerContextProxy::generateGlyphCount() {
- SK_ABORT("Should never be called.");
-+ SkUNREACHABLE;
- }
-
- bool SkScalerContextProxy::generateAdvance(SkGlyph* glyph) {
-diff --git a/gfx/skia/skia/src/core/SkTypeface_remote.h b/gfx/skia/skia/src/core/SkTypeface_remote.h
-index 3d454cf760f284f7df56cf17afa50e02c4ee2cfe..554f7c0617cd9a1a71b43abb425b97f3e3a08ffd 100644
---- a/gfx/skia/skia/src/core/SkTypeface_remote.h
-+++ b/gfx/skia/skia/src/core/SkTypeface_remote.h
-@@ -63,23 +63,28 @@ public:
- bool isLogging() const {return fIsLogging;}
-
- protected:
-- int onGetUPEM() const override { SK_ABORT("Should never be called."); }
-+ 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;
- }
- sk_sp<SkTypeface> onMakeClone(const SkFontArguments& args) const override {
- SK_ABORT("Should never be called.");
-+ SkUNREACHABLE;
- }
- int onGetVariationDesignPosition(SkFontArguments::VariationPosition::Coordinate coordinates[],
- int coordinateCount) const override {
- SK_ABORT("Should never be called.");
-+ SkUNREACHABLE;
- }
- int onGetVariationDesignParameters(SkFontParameters::Variation::Axis parameters[],
- int parameterCount) const override {
- SK_ABORT("Should never be called.");
-+ SkUNREACHABLE;
- }
- void onGetFamilyName(SkString* familyName) const override {
- // Used by SkStrikeCache::DumpMemoryStatistics.
-@@ -87,12 +92,15 @@ protected:
- }
- SkTypeface::LocalizedStrings* onCreateFamilyNameIterator() const override {
- SK_ABORT("Should never be called.");
-+ SkUNREACHABLE;
- }
- int onGetTableTags(SkFontTableTag tags[]) const override {
- SK_ABORT("Should never be called.");
-+ SkUNREACHABLE;
- }
- size_t onGetTableData(SkFontTableTag, size_t offset, size_t length, void* data) const override {
- SK_ABORT("Should never be called.");
-+ SkUNREACHABLE;
- }
- SkScalerContext* onCreateScalerContext(const SkScalerContextEffects& effects,
- const SkDescriptor* desc) const override {
-@@ -116,6 +124,7 @@ protected:
-
- std::unique_ptr<SkAdvancedTypefaceMetrics> onGetAdvancedMetrics() const override {
- SK_ABORT("Should never be called.");
-+ SkUNREACHABLE;
- }
- void onCharsToGlyphs(const SkUnichar* chars, int count, SkGlyphID glyphs[]) const override {
- SK_ABORT("Should never be called.");
-@@ -126,6 +135,7 @@ protected:
-
- void* onGetCTFontRef() const override {
- SK_ABORT("Should never be called.");
-+ SkUNREACHABLE;
- }
-
- private:
-diff --git a/gfx/skia/skia/src/effects/imagefilters/SkBlurImageFilter.cpp b/gfx/skia/skia/src/effects/imagefilters/SkBlurImageFilter.cpp
-index 2dde5e2be77afdf4896e01b8ab8e3842e2a68b8c..dd8550dfad56c43244b6afa7c2c5b27aa2ef0068 100644
---- a/gfx/skia/skia/src/effects/imagefilters/SkBlurImageFilter.cpp
-+++ b/gfx/skia/skia/src/effects/imagefilters/SkBlurImageFilter.cpp
-@@ -144,6 +144,7 @@ static GrTextureDomain::Mode to_texture_domain_mode(SkTileMode tileMode) {
- return GrTextureDomain::kRepeat_Mode;
- default:
- SK_ABORT("Unsupported tile mode.");
-+ SkUNREACHABLE;
- }
- }
- #endif
-diff --git a/gfx/skia/skia/src/effects/imagefilters/SkLightingImageFilter.cpp b/gfx/skia/skia/src/effects/imagefilters/SkLightingImageFilter.cpp
-index 43d32dcc915e197158858f2bf4dde206a55a951d..4a8143e2e2120ec603b7f0e0d5eceb2c5920a319 100644
---- a/gfx/skia/skia/src/effects/imagefilters/SkLightingImageFilter.cpp
-+++ b/gfx/skia/skia/src/effects/imagefilters/SkLightingImageFilter.cpp
-@@ -1701,6 +1701,7 @@ static SkImageFilterLight* create_random_light(SkRandom* random) {
- }
- default:
- SK_ABORT("Unexpected value.");
-+ SkUNREACHABLE;
- }
- }
-
-diff --git a/gfx/skia/skia/src/fonts/SkFontMgr_indirect.cpp b/gfx/skia/skia/src/fonts/SkFontMgr_indirect.cpp
-index da7678a725e7ce076705620fe17228272e29c8f4..63330e58c2b39afc20f78acd4caa11a12cd477df 100644
---- a/gfx/skia/skia/src/fonts/SkFontMgr_indirect.cpp
-+++ b/gfx/skia/skia/src/fonts/SkFontMgr_indirect.cpp
-@@ -69,6 +69,7 @@ void SkFontMgr_Indirect::onGetFamilyName(int index, SkString* familyName) const
-
- SkFontStyleSet* SkFontMgr_Indirect::onCreateStyleSet(int index) const {
- SK_ABORT("Not implemented");
-+ SkUNREACHABLE;
- }
-
- SkFontStyleSet* SkFontMgr_Indirect::onMatchFamily(const char familyName[]) const {
-diff --git a/gfx/skia/skia/src/gpu/GrDataUtils.cpp b/gfx/skia/skia/src/gpu/GrDataUtils.cpp
-index 6265aaec2893f1c457218441d37a75595a750b7b..0da5190e4a857028117d05c50c0e1e5b0bd4fa22 100644
---- a/gfx/skia/skia/src/gpu/GrDataUtils.cpp
-+++ b/gfx/skia/skia/src/gpu/GrDataUtils.cpp
-@@ -128,6 +128,7 @@ size_t GrCompressedDataSize(SkImage::CompressionType type, int width, int height
- return numBlocks * sizeof(ETC1Block);
- }
- SK_ABORT("Unexpected compression type");
-+ SkUNREACHABLE;
- }
-
- size_t GrCompressedRowBytes(SkImage::CompressionType type, int width) {
-@@ -137,6 +138,7 @@ size_t GrCompressedRowBytes(SkImage::CompressionType type, int width) {
- return numBlocksWidth * sizeof(ETC1Block);
- }
- SK_ABORT("Unexpected compression type");
-+ SkUNREACHABLE;
- }
-
- // Fill in 'dest' with ETC1 blocks derived from 'colorf'
-diff --git a/gfx/skia/skia/src/gpu/GrFragmentProcessor.h b/gfx/skia/skia/src/gpu/GrFragmentProcessor.h
-index 21e27b868b52d729a67938a67eda960ef36ebc61..5b96868075be7ef2e81ea175c2525a4a50c9ffc4 100644
---- a/gfx/skia/skia/src/gpu/GrFragmentProcessor.h
-+++ b/gfx/skia/skia/src/gpu/GrFragmentProcessor.h
-@@ -375,6 +375,7 @@ protected:
- 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
-diff --git a/gfx/skia/skia/src/gpu/GrPathRendering.cpp b/gfx/skia/skia/src/gpu/GrPathRendering.cpp
-index 5e44531d2e95d496e8472ff97e16d0c6503fc063..a6bd5e4cbcf60a2f7e49e8400beab6c504ff03d5 100644
---- a/gfx/skia/skia/src/gpu/GrPathRendering.cpp
-+++ b/gfx/skia/skia/src/gpu/GrPathRendering.cpp
-@@ -19,6 +19,7 @@ const GrUserStencilSettings& GrPathRendering::GetStencilPassSettings(FillType fi
- switch (fill) {
- default:
- SK_ABORT("Unexpected path fill.");
-+ SkUNREACHABLE;
- case GrPathRendering::kWinding_FillType: {
- constexpr static GrUserStencilSettings kWindingStencilPass(
- GrUserStencilSettings::StaticInit<
-diff --git a/gfx/skia/skia/src/gpu/GrPathRendering.h b/gfx/skia/skia/src/gpu/GrPathRendering.h
-index 3e143e4d0f2e03c33b77302cef56e44c26ae169b..3a672fabc60da04b6d84b39b52503a6fd334a409 100644
---- a/gfx/skia/skia/src/gpu/GrPathRendering.h
-+++ b/gfx/skia/skia/src/gpu/GrPathRendering.h
-@@ -63,6 +63,7 @@ public:
-
- default:
- SK_ABORT("Unknown path transform type");
-+ SkUNREACHABLE;
- }
- }
-
-diff --git a/gfx/skia/skia/src/gpu/GrProcessorUnitTest.cpp b/gfx/skia/skia/src/gpu/GrProcessorUnitTest.cpp
-index 8d8efa7685b0a30f51ab9843977e0e8aa9c963fa..2d56d2cb09fd7d83fcd7073651086458d1f1f02e 100644
---- a/gfx/skia/skia/src/gpu/GrProcessorUnitTest.cpp
-+++ b/gfx/skia/skia/src/gpu/GrProcessorUnitTest.cpp
-@@ -20,6 +20,7 @@ std::unique_ptr<GrFragmentProcessor> GrProcessorUnitTest::MakeChildFP(GrProcesso
- 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
-index 9224e005c6886358c2c6eb037c786bc5281bcdeb..5c1d44b613bc1aa6a1f436acfe4b46ffd35c7c32 100644
---- a/gfx/skia/skia/src/gpu/GrReducedClip.cpp
-+++ b/gfx/skia/skia/src/gpu/GrReducedClip.cpp
-@@ -525,6 +525,7 @@ GrReducedClip::ClipResult GrReducedClip::clipInsideElement(const Element* elemen
- }
-
- SK_ABORT("Unexpected DeviceSpaceType");
-+ SkUNREACHABLE;
- }
-
- GrReducedClip::ClipResult GrReducedClip::clipOutsideElement(const Element* element) {
-@@ -591,6 +592,7 @@ GrReducedClip::ClipResult GrReducedClip::clipOutsideElement(const Element* eleme
- }
-
- SK_ABORT("Unexpected DeviceSpaceType");
-+ SkUNREACHABLE;
- }
-
- inline void GrReducedClip::addWindowRectangle(const SkRect& elementInteriorRect, bool elementIsAA) {
-diff --git a/gfx/skia/skia/src/gpu/GrResourceCache.cpp b/gfx/skia/skia/src/gpu/GrResourceCache.cpp
-index 6d9a961886ffd764dfe80b0c247c562a6d12817c..5f2e68dd7ba9e91d7f649c8185f21c6eafc87667 100644
---- a/gfx/skia/skia/src/gpu/GrResourceCache.cpp
-+++ b/gfx/skia/skia/src/gpu/GrResourceCache.cpp
-@@ -40,6 +40,7 @@ GrScratchKey::ResourceType GrScratchKey::GenerateResourceType() {
- int32_t type = nextType++;
- if (type > SkTo<int32_t>(UINT16_MAX)) {
- SK_ABORT("Too many Resource Types");
-+ SkUNREACHABLE;
- }
-
- return static_cast<ResourceType>(type);
-@@ -51,6 +52,7 @@ GrUniqueKey::Domain GrUniqueKey::GenerateDomain() {
- int32_t domain = nextDomain++;
- if (domain > SkTo<int32_t>(UINT16_MAX)) {
- SK_ABORT("Too many GrUniqueKey Domains");
-+ SkUNREACHABLE;
- }
-
- return static_cast<Domain>(domain);
-diff --git a/gfx/skia/skia/src/gpu/GrShaderVar.cpp b/gfx/skia/skia/src/gpu/GrShaderVar.cpp
-index 6f7ccccd603807f58295e7915420bc24254b8656..67156a74bc6f79956c3256c0a9bac62466848e68 100644
---- a/gfx/skia/skia/src/gpu/GrShaderVar.cpp
-+++ b/gfx/skia/skia/src/gpu/GrShaderVar.cpp
-@@ -18,6 +18,7 @@ static const char* type_modifier_string(GrShaderVar::TypeModifier t) {
- case GrShaderVar::kUniform_TypeModifier: return "uniform";
- }
- SK_ABORT("Unknown shader variable type modifier.");
-+ SkUNREACHABLE;
- }
-
- void GrShaderVar::setIOType(GrIOType ioType) {
-@@ -32,6 +33,7 @@ void GrShaderVar::setIOType(GrIOType ioType) {
- return;
- }
- SK_ABORT("Unknown io type.");
-+ SkUNREACHABLE;
- }
-
- void GrShaderVar::appendDecl(const GrShaderCaps* shaderCaps, SkString* out) const {
-diff --git a/gfx/skia/skia/src/gpu/SkGpuDevice.cpp b/gfx/skia/skia/src/gpu/SkGpuDevice.cpp
-index 77b9963ba5cb9c37bfb0942b5d8b3525aa78335a..f6d7ca05dd018368107ebe6d915e8a19f85b326f 100644
---- a/gfx/skia/skia/src/gpu/SkGpuDevice.cpp
-+++ b/gfx/skia/skia/src/gpu/SkGpuDevice.cpp
-@@ -283,6 +283,7 @@ static inline GrPrimitiveType point_mode_to_primitive_type(SkCanvas::PointMode m
- return GrPrimitiveType::kLineStrip;
- }
- SK_ABORT("Unexpected mode");
-+ SkUNREACHABLE;
- }
-
- void SkGpuDevice::drawPoints(SkCanvas::PointMode mode,
-diff --git a/gfx/skia/skia/src/gpu/SkGr.h b/gfx/skia/skia/src/gpu/SkGr.h
-index 79a68822b91b8846a71ad843e3f268200ca9025c..716f59d7e62401b9a287206fd7ffc47d7e6b0deb 100644
---- a/gfx/skia/skia/src/gpu/SkGr.h
-+++ b/gfx/skia/skia/src/gpu/SkGr.h
-@@ -159,6 +159,7 @@ static inline GrPrimitiveType SkVertexModeToGrPrimitiveType(SkVertices::VertexMo
- break;
- }
- SK_ABORT("Invalid mode");
-+ SkUNREACHABLE;
- }
-
- //////////////////////////////////////////////////////////////////////////////
-diff --git a/gfx/skia/skia/src/gpu/ccpr/GrCCCoverageProcessor.h b/gfx/skia/skia/src/gpu/ccpr/GrCCCoverageProcessor.h
-index 5fdb488ea5a286a953c452d5ad7957df87f47765..eb81f47ba607cb9ae4f3eb916a4896f9e51402f3 100644
---- a/gfx/skia/skia/src/gpu/ccpr/GrCCCoverageProcessor.h
-+++ b/gfx/skia/skia/src/gpu/ccpr/GrCCCoverageProcessor.h
-@@ -240,6 +240,7 @@ inline const char* GrCCCoverageProcessor::PrimitiveTypeName(PrimitiveType type)
- case PrimitiveType::kConics: return "kConics";
- }
- SK_ABORT("Invalid PrimitiveType");
-+ SkUNREACHABLE;
- }
-
- 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
-index 40884d7d8f2906d48d6a3a1d5852cd5d35d9a67c..c920365f50a51727d451db3788d2f385820b753e 100644
---- a/gfx/skia/skia/src/gpu/ccpr/GrCCStrokeGeometry.cpp
-+++ b/gfx/skia/skia/src/gpu/ccpr/GrCCStrokeGeometry.cpp
-@@ -60,6 +60,7 @@ static GrCCStrokeGeometry::Verb join_verb_from_join(SkPaint::Join join) {
- return Verb::kRoundJoin;
- }
- SK_ABORT("Invalid SkPaint::Join.");
-+ SkUNREACHABLE;
- }
-
- void GrCCStrokeGeometry::beginPath(const SkStrokeRec& stroke, float strokeDevWidth,
-diff --git a/gfx/skia/skia/src/gpu/ccpr/GrCCStrokeGeometry.h b/gfx/skia/skia/src/gpu/ccpr/GrCCStrokeGeometry.h
-index 24569accc4e521796f7d2916d3f5e7f8c96088c3..d105836141e4b5f06b1608e2579c5255ed5d7afc 100644
---- a/gfx/skia/skia/src/gpu/ccpr/GrCCStrokeGeometry.h
-+++ b/gfx/skia/skia/src/gpu/ccpr/GrCCStrokeGeometry.h
-@@ -175,5 +175,6 @@ inline bool GrCCStrokeGeometry::IsInternalJoinVerb(Verb verb) {
- 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
-index 4e86d7e07147c78b68583fbd14f41d8f9381644e..0376cf40c3bdd0462c9eaf7d42321cadfd0ba740 100644
---- a/gfx/skia/skia/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp
-+++ b/gfx/skia/skia/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp
-@@ -164,6 +164,7 @@ GrPathRenderer::CanDrawPath GrCoverageCountingPathRenderer::onCanDrawPath(
- }
-
- SK_ABORT("Invalid stroke style.");
-+ SkUNREACHABLE;
- }
-
- bool GrCoverageCountingPathRenderer::onDrawPath(const DrawPathArgs& args) {
-diff --git a/gfx/skia/skia/src/gpu/ccpr/GrVSCoverageProcessor.cpp b/gfx/skia/skia/src/gpu/ccpr/GrVSCoverageProcessor.cpp
-index ae5cfca504c21fbc9ced4e66b2e853a17db8a5d8..89beff076a875913592ca7b41af9200995d33d64 100644
---- a/gfx/skia/skia/src/gpu/ccpr/GrVSCoverageProcessor.cpp
-+++ b/gfx/skia/skia/src/gpu/ccpr/GrVSCoverageProcessor.cpp
-@@ -550,4 +550,5 @@ GrGLSLPrimitiveProcessor* GrVSCoverageProcessor::onCreateGLSLInstance(
- 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
-index 48fc8a7f48a8aa3c0905db0c293f8b4215285e5e..9321f43b7eacd990225eea6241211b57e73635cb 100644
---- a/gfx/skia/skia/src/gpu/dawn/GrDawnOpsRenderPass.cpp
-+++ b/gfx/skia/skia/src/gpu/dawn/GrDawnOpsRenderPass.cpp
-@@ -39,7 +39,9 @@ static dawn::LoadOp to_dawn_load_op(GrLoadOp loadOp) {
- return dawn::LoadOp::Clear;
- default:
- SK_ABORT("Invalid LoadOp");
-+ SkUNREACHABLE;
- }
-+ SkUNREACHABLE;
- }
-
- GrDawnOpsRenderPass::GrDawnOpsRenderPass(GrDawnGpu* gpu, GrRenderTarget* rt, GrSurfaceOrigin origin,
-diff --git a/gfx/skia/skia/src/gpu/dawn/GrDawnUniformHandler.cpp b/gfx/skia/skia/src/gpu/dawn/GrDawnUniformHandler.cpp
-index 74fd1e31a4b602cf9240214b4adce6e224da629c..25461264066172fd62932563b08899a472ea6b19 100644
---- a/gfx/skia/skia/src/gpu/dawn/GrDawnUniformHandler.cpp
-+++ b/gfx/skia/skia/src/gpu/dawn/GrDawnUniformHandler.cpp
-@@ -95,6 +95,7 @@ uint32_t grsltype_to_alignment_mask(GrSLType type) {
- break;
- }
- SK_ABORT("Unexpected type");
-+ SkUNREACHABLE;
- }
-
- static inline uint32_t grsltype_to_size(GrSLType type) {
-@@ -173,6 +174,7 @@ static inline uint32_t grsltype_to_size(GrSLType type) {
- break;
- }
- SK_ABORT("Unexpected type");
-+ SkUNREACHABLE;
- }
-
- uint32_t get_ubo_offset(uint32_t* currentOffset,
-diff --git a/gfx/skia/skia/src/gpu/dawn/GrDawnVaryingHandler.cpp b/gfx/skia/skia/src/gpu/dawn/GrDawnVaryingHandler.cpp
-index b3885d20c903a7eba2742560161190bd2f14defc..0d2bac39def57ab1d7479e8651527815b9f940bc 100644
---- a/gfx/skia/skia/src/gpu/dawn/GrDawnVaryingHandler.cpp
-+++ b/gfx/skia/skia/src/gpu/dawn/GrDawnVaryingHandler.cpp
-@@ -76,6 +76,7 @@ static inline int grsltype_to_location_size(GrSLType type) {
- return 0;
- }
- SK_ABORT("Unexpected type");
-+ SkUNREACHABLE;
- }
-
- static void finalize_helper(GrDawnVaryingHandler::VarArray& vars) {
-diff --git a/gfx/skia/skia/src/gpu/effects/GrConstColorProcessor.fp b/gfx/skia/skia/src/gpu/effects/GrConstColorProcessor.fp
-index 18cc91a4b12d7467f49cda9995b28ab5898a4d67..fd6694bb7648f84b0dc19f494d358a71cb47b14a 100644
---- a/gfx/skia/skia/src/gpu/effects/GrConstColorProcessor.fp
-+++ b/gfx/skia/skia/src/gpu/effects/GrConstColorProcessor.fp
-@@ -58,6 +58,7 @@ void main() {
- return color * input;
- }
- SK_ABORT("Unexpected mode");
-+ SkUNREACHABLE;
- }
- }
-
-diff --git a/gfx/skia/skia/src/gpu/effects/GrCoverageSetOpXP.cpp b/gfx/skia/skia/src/gpu/effects/GrCoverageSetOpXP.cpp
-index b75842c94a04f8c3bea4b4cd0ff4d30b6f668acc..714fc350d5f9211dab3dc57a2c3c489ee5d6118a 100644
---- a/gfx/skia/skia/src/gpu/effects/GrCoverageSetOpXP.cpp
-+++ b/gfx/skia/skia/src/gpu/effects/GrCoverageSetOpXP.cpp
-@@ -204,6 +204,7 @@ const GrXPFactory* GrCoverageSetOpXPFactory::Get(SkRegion::Op regionOp, bool inv
- }
- #undef _CONSTEXPR_
- SK_ABORT("Unknown region op.");
-+ SkUNREACHABLE;
- }
-
- sk_sp<const GrXferProcessor> GrCoverageSetOpXPFactory::makeXferProcessor(
-diff --git a/gfx/skia/skia/src/gpu/effects/GrPorterDuffXferProcessor.cpp b/gfx/skia/skia/src/gpu/effects/GrPorterDuffXferProcessor.cpp
-index 47d92dbde49572daf4fd8e77e7c271f29c02559b..1d44d9ad825945a0aea60403ff2ed7e19dcf4be6 100644
---- a/gfx/skia/skia/src/gpu/effects/GrPorterDuffXferProcessor.cpp
-+++ b/gfx/skia/skia/src/gpu/effects/GrPorterDuffXferProcessor.cpp
-@@ -753,6 +753,7 @@ const GrXPFactory* GrPorterDuffXPFactory::Get(SkBlendMode blendMode) {
- return &gScreenPDXPF;
- default:
- SK_ABORT("Unexpected blend mode.");
-+ SkUNREACHABLE;
- }
- }
-
-diff --git a/gfx/skia/skia/src/gpu/effects/GrSkSLFP.cpp b/gfx/skia/skia/src/gpu/effects/GrSkSLFP.cpp
-index 9269ebf668fff1988ba67f1fcddd17a670bf1c57..3169ab6e3f74d4c2648c40760b7a97e51a57e923 100644
---- a/gfx/skia/skia/src/gpu/effects/GrSkSLFP.cpp
-+++ b/gfx/skia/skia/src/gpu/effects/GrSkSLFP.cpp
-@@ -154,6 +154,7 @@ public:
- }
- printf("%s\n", SkSL::String(type.fName).c_str());
- SK_ABORT("unsupported uniform type");
-+ SkUNREACHABLE;
- }
-
- void emitCode(EmitArgs& args) override {
-@@ -568,6 +569,7 @@ std::unique_ptr<GrFragmentProcessor> GrSkSLFP::TestCreate(GrProcessorTestData* d
- }
- }
- 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
-index df64bce9b79c1014c74645a8eaaaa320e527afaa..bc9024cb07ef75890c00b6e68a507c0ef29821ea 100644
---- a/gfx/skia/skia/src/gpu/effects/generated/GrConstColorProcessor.h
-+++ b/gfx/skia/skia/src/gpu/effects/generated/GrConstColorProcessor.h
-@@ -41,6 +41,7 @@ public:
- 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));
-diff --git a/gfx/skia/skia/src/gpu/geometry/GrShape.cpp b/gfx/skia/skia/src/gpu/geometry/GrShape.cpp
-index 4fc3472ffb31ae7e4ee6035bd230d4e86ec87eb4..f16a2c536e617f8da21f53141b86bea65a1d0cb3 100644
---- a/gfx/skia/skia/src/gpu/geometry/GrShape.cpp
-+++ b/gfx/skia/skia/src/gpu/geometry/GrShape.cpp
-@@ -164,6 +164,7 @@ SkRect GrShape::bounds() const {
- return this->path().getBounds();
- }
- SK_ABORT("Unknown shape type");
-+ SkUNREACHABLE;
- }
-
- SkRect GrShape::styledBounds() const {
-@@ -254,6 +255,7 @@ int GrShape::unstyledKeySize() const {
- }
- }
- SK_ABORT("Should never get here.");
-+ SkUNREACHABLE;
- }
-
- void GrShape::writeUnstyledKey(uint32_t* key) const {
-diff --git a/gfx/skia/skia/src/gpu/gl/GrGLCaps.cpp b/gfx/skia/skia/src/gpu/gl/GrGLCaps.cpp
-index 3142399c583b971fb2cb66ed82c17f7d0bb57249..2dab83639a9a23758d89c930200047c13c66ab57 100644
---- a/gfx/skia/skia/src/gpu/gl/GrGLCaps.cpp
-+++ b/gfx/skia/skia/src/gpu/gl/GrGLCaps.cpp
-@@ -4159,6 +4159,7 @@ GrBackendFormat GrGLCaps::getBackendFormatFromCompressionType(
- 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 {
-diff --git a/gfx/skia/skia/src/gpu/gl/GrGLGLSL.cpp b/gfx/skia/skia/src/gpu/gl/GrGLGLSL.cpp
-index 2ad38bc35ecd413d7d4fb40485c088c2f2d09e74..8dc730f1b784b7df57f7c7da92ab647358759004 100644
---- a/gfx/skia/skia/src/gpu/gl/GrGLGLSL.cpp
-+++ b/gfx/skia/skia/src/gpu/gl/GrGLGLSL.cpp
-@@ -68,4 +68,5 @@ bool GrGLGetGLSLGeneration(const GrGLInterface* gl, GrGLSLGeneration* generation
- 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
-index 937e168db5c988477610ab8668216762d5820fba..da66902895d597988feeebe3a24ee1cbc501e35f 100644
---- a/gfx/skia/skia/src/gpu/gl/GrGLGpu.cpp
-+++ b/gfx/skia/skia/src/gpu/gl/GrGLGpu.cpp
-@@ -196,6 +196,7 @@ static int gl_target_to_binding_index(GrGLenum target) {
- return 2;
- }
- SK_ABORT("Unexpected GL texture target.");
-+ SkUNREACHABLE;
- }
-
- GrGpuResource::UniqueID GrGLGpu::TextureUnitBindings::boundID(GrGLenum target) const {
-@@ -234,6 +235,7 @@ static GrGLenum filter_to_gl_mag_filter(GrSamplerState::Filter filter) {
- case GrSamplerState::Filter::kMipMap: return GR_GL_LINEAR;
- }
- SK_ABORT("Unknown filter");
-+ SkUNREACHABLE;
- }
-
- static GrGLenum filter_to_gl_min_filter(GrSamplerState::Filter filter) {
-@@ -243,6 +245,7 @@ static GrGLenum filter_to_gl_min_filter(GrSamplerState::Filter filter) {
- 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,
-@@ -257,6 +260,7 @@ static inline GrGLenum wrap_mode_to_gl_wrap(GrSamplerState::WrapMode wrapMode,
- return GR_GL_CLAMP_TO_BORDER;
- }
- SK_ABORT("Unknown wrap mode");
-+ SkUNREACHABLE;
- }
-
- ///////////////////////////////////////////////////////////////////////////////
-@@ -1107,7 +1111,7 @@ static bool renderbuffer_storage_msaa(const GrGLContext& ctx,
- 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()));
- }
-@@ -2275,9 +2279,10 @@ static GrGLenum gr_primitive_type_to_gl_mode(GrPrimitiveType primitiveType) {
- 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,
-@@ -4006,7 +4011,8 @@ int GrGLGpu::TextureToCopyProgramIdx(GrTexture* texture) {
- case kTextureExternalSampler_GrSLType:
- return 2;
- default:
-- SK_ABORT("Unexpected samper type");
-+ SK_ABORT("Unexpected sampler type");
-+ SkUNREACHABLE;
- }
- }
-
-diff --git a/gfx/skia/skia/src/gpu/gl/GrGLPath.cpp b/gfx/skia/skia/src/gpu/gl/GrGLPath.cpp
-index e001bf93a1fc1f637e7f30b95605da3a99864ad8..8d51f00e4b0e88d0c2b3f7a6fed06d53915643cd 100644
---- a/gfx/skia/skia/src/gpu/gl/GrGLPath.cpp
-+++ b/gfx/skia/skia/src/gpu/gl/GrGLPath.cpp
-@@ -197,6 +197,7 @@ 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;
-diff --git a/gfx/skia/skia/src/gpu/gl/GrGLTexture.cpp b/gfx/skia/skia/src/gpu/gl/GrGLTexture.cpp
-index a5a1a3708bd6fbcd2a853e39b7e1a120e562f9c2..1a223cf1e2735682f4ef66ff814ca913a86b2dcd 100644
---- a/gfx/skia/skia/src/gpu/gl/GrGLTexture.cpp
-+++ b/gfx/skia/skia/src/gpu/gl/GrGLTexture.cpp
-@@ -25,6 +25,7 @@ GrTextureType GrGLTexture::TextureTypeFromTarget(GrGLenum target) {
- return GrTextureType::kExternal;
- }
- SK_ABORT("Unexpected texture target");
-+ SkUNREACHABLE;
- }
-
- static inline GrGLenum target_from_texture_type(GrTextureType type) {
-@@ -37,8 +38,10 @@ static inline GrGLenum target_from_texture_type(GrTextureType type) {
- 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.
-diff --git a/gfx/skia/skia/src/gpu/gl/GrGLVertexArray.cpp b/gfx/skia/skia/src/gpu/gl/GrGLVertexArray.cpp
-index cfac573241220f12bff64b051aeca6bf8c42b5b8..4d878af131818193f6b04d13bd2e93f32c0d7c9d 100644
---- a/gfx/skia/skia/src/gpu/gl/GrGLVertexArray.cpp
-+++ b/gfx/skia/skia/src/gpu/gl/GrGLVertexArray.cpp
-@@ -80,6 +80,7 @@ static AttribLayout attrib_layout(GrVertexAttribType type) {
- return {true, 4, GR_GL_UNSIGNED_SHORT};
- }
- SK_ABORT("Unknown vertex attrib type");
-+ SkUNREACHABLE;
- };
-
- void GrGLAttribArrayState::set(GrGLGpu* gpu,
-diff --git a/gfx/skia/skia/src/gpu/glsl/GrGLSL.cpp b/gfx/skia/skia/src/gpu/glsl/GrGLSL.cpp
-index afa9159bb0c8360d5960019c52c2ec393e90720b..d073fa6f8bbe4c7d997df4c312415e29947c9eb4 100644
---- a/gfx/skia/skia/src/gpu/glsl/GrGLSL.cpp
-+++ b/gfx/skia/skia/src/gpu/glsl/GrGLSL.cpp
-@@ -98,4 +98,5 @@ const char* GrGLSLTypeString(GrSLType t) {
- 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
-index ce086a9082b1e733e575658732945c076953dee0..16a0171e7dc228bb283881de11630ffdabe06e9d 100644
---- a/gfx/skia/skia/src/gpu/glsl/GrGLSLVarying.cpp
-+++ b/gfx/skia/skia/src/gpu/glsl/GrGLSLVarying.cpp
-@@ -35,6 +35,7 @@ static bool use_flat_interpolation(GrGLSLVaryingHandler::Interpolation interpola
- return true;
- }
- SK_ABORT("Invalid interpolation");
-+ SkUNREACHABLE;
- }
-
- void GrGLSLVaryingHandler::addVarying(const char* name, GrGLSLVarying* varying,
-diff --git a/gfx/skia/skia/src/gpu/glsl/GrGLSLVertexGeoBuilder.cpp b/gfx/skia/skia/src/gpu/glsl/GrGLSLVertexGeoBuilder.cpp
-index ccec08db8b57f97bae484ec378872859f16c5f90..751b40e9fe366d95c94a4eb6b1fab94b28f1d456 100644
---- a/gfx/skia/skia/src/gpu/glsl/GrGLSLVertexGeoBuilder.cpp
-+++ b/gfx/skia/skia/src/gpu/glsl/GrGLSLVertexGeoBuilder.cpp
-@@ -51,6 +51,7 @@ static const char* input_type_name(GrGLSLGeometryBuilder::InputType in) {
- case InputType::kTriangles: return "triangles";
- }
- SK_ABORT("invalid input type");
-+ SkUNREACHABLE;
- }
-
- static const char* output_type_name(GrGLSLGeometryBuilder::OutputType out) {
-@@ -61,6 +62,7 @@ static const char* output_type_name(GrGLSLGeometryBuilder::OutputType out) {
- case OutputType::kTriangleStrip: return "triangle_strip";
- }
- SK_ABORT("invalid output type");
-+ SkUNREACHABLE;
- }
-
- void GrGLSLGeometryBuilder::configure(InputType inputType, OutputType outputType, int maxVertices,
-diff --git a/gfx/skia/skia/src/gpu/mtl/GrMtlCaps.mm b/gfx/skia/skia/src/gpu/mtl/GrMtlCaps.mm
-index 7511f263663bb0f86bea52f5fe862e67c7a12f88..82ff3db7721001b47b68150033873679c103e3fe 100644
---- a/gfx/skia/skia/src/gpu/mtl/GrMtlCaps.mm
-+++ b/gfx/skia/skia/src/gpu/mtl/GrMtlCaps.mm
-@@ -506,6 +506,7 @@ size_t GrMtlCaps::GetFormatIndex(MTLPixelFormat pixelFormat) {
- }
- }
- SK_ABORT("Invalid MTLPixelFormat");
-+ SkUNREACHABLE;
- }
-
- void GrMtlCaps::initFormatTable() {
-@@ -1011,6 +1012,7 @@ GrBackendFormat GrMtlCaps::getBackendFormatFromCompressionType(
- #endif
- }
- SK_ABORT("Invalid compression type");
-+ SkUNREACHABLE;
- }
-
- GrSwizzle GrMtlCaps::getTextureSwizzle(const GrBackendFormat& format, GrColorType colorType) const {
-diff --git a/gfx/skia/skia/src/gpu/mtl/GrMtlPipelineStateBuilder.mm b/gfx/skia/skia/src/gpu/mtl/GrMtlPipelineStateBuilder.mm
-index 090c41b9de6623618f52b141044909369b84cb29..4be37d4c53deeda93f16f247e96e99865a3146c3 100644
---- a/gfx/skia/skia/src/gpu/mtl/GrMtlPipelineStateBuilder.mm
-+++ b/gfx/skia/skia/src/gpu/mtl/GrMtlPipelineStateBuilder.mm
-@@ -155,6 +155,7 @@ static inline MTLVertexFormat attribute_type_to_mtlformat(GrVertexAttribType typ
- return MTLVertexFormatUShort4Normalized;
- }
- SK_ABORT("Unknown vertex attribute type");
-+ SkUNREACHABLE;
- }
-
- static MTLVertexDescriptor* create_vertex_descriptor(const GrPrimitiveProcessor& primProc) {
-@@ -276,6 +277,7 @@ static MTLBlendFactor blend_coeff_to_mtl_blend(GrBlendCoeff coeff) {
- }
-
- SK_ABORT("Unknown blend coefficient");
-+ SkUNREACHABLE;
- }
-
- static MTLBlendOperation blend_equation_to_mtl_blend_op(GrBlendEquation equation) {
-diff --git a/gfx/skia/skia/src/gpu/mtl/GrMtlSampler.mm b/gfx/skia/skia/src/gpu/mtl/GrMtlSampler.mm
-index 2d7344eff7b7a5e900e02a350950b93df4f968c4..2d03c968bfa52e607f0d58967c4f0db8e90be604 100644
---- a/gfx/skia/skia/src/gpu/mtl/GrMtlSampler.mm
-+++ b/gfx/skia/skia/src/gpu/mtl/GrMtlSampler.mm
-@@ -38,6 +38,7 @@ static inline MTLSamplerAddressMode wrap_mode_to_mtl_sampler_address(
- }
- }
- SK_ABORT("Unknown wrap mode.");
-+ SkUNREACHABLE;
- }
-
- GrMtlSampler* GrMtlSampler::Create(const GrMtlGpu* gpu, const GrSamplerState& samplerState) {
-diff --git a/gfx/skia/skia/src/gpu/mtl/GrMtlUniformHandler.mm b/gfx/skia/skia/src/gpu/mtl/GrMtlUniformHandler.mm
-index 89e1263eaf9b33badf0e0ffd9be54b47c32e6de0..7a2d0079184d09b00ca0e6356a40817eee8342ef 100644
---- a/gfx/skia/skia/src/gpu/mtl/GrMtlUniformHandler.mm
-+++ b/gfx/skia/skia/src/gpu/mtl/GrMtlUniformHandler.mm
-@@ -90,6 +90,7 @@ static uint32_t grsltype_to_alignment_mask(GrSLType type) {
- break;
- }
- SK_ABORT("Unexpected type");
-+ SkUNREACHABLE;
- }
-
- /** Returns the size in bytes taken up in Metal buffers for GrSLTypes. */
-@@ -172,6 +173,7 @@ static inline uint32_t grsltype_to_mtl_size(GrSLType type) {
- break;
- }
- SK_ABORT("Unexpected type");
-+ SkUNREACHABLE;
- }
-
- // Given the current offset into the ubo, calculate the offset for the uniform we're trying to add
-diff --git a/gfx/skia/skia/src/gpu/mtl/GrMtlUtil.mm b/gfx/skia/skia/src/gpu/mtl/GrMtlUtil.mm
-index eccf435074c84c2a6580637f371094471a6a21d4..b49a43b7ec758e8a16fd4e766f15423d64d08e7b 100644
---- a/gfx/skia/skia/src/gpu/mtl/GrMtlUtil.mm
-+++ b/gfx/skia/skia/src/gpu/mtl/GrMtlUtil.mm
-@@ -112,6 +112,7 @@ bool GrPixelConfigToMTLFormat(GrPixelConfig config, MTLPixelFormat* format) {
- return true;
- }
- SK_ABORT("Unexpected config");
-+ SkUNREACHABLE;
- }
-
- MTLTextureDescriptor* GrGetMTLTextureDescriptor(id<MTLTexture> mtlTexture) {
-diff --git a/gfx/skia/skia/src/gpu/ops/GrDrawVerticesOp.cpp b/gfx/skia/skia/src/gpu/ops/GrDrawVerticesOp.cpp
-index 4b311b5207082e612a2941d5ec0aeab948ac4a28..8a010a1de1fe3a708851de59b8274ea57e391dd5 100644
---- a/gfx/skia/skia/src/gpu/ops/GrDrawVerticesOp.cpp
-+++ b/gfx/skia/skia/src/gpu/ops/GrDrawVerticesOp.cpp
-@@ -610,6 +610,7 @@ static uint32_t seed_vertices(GrPrimitiveType type) {
- return 0;
- }
- SK_ABORT("Incomplete switch\n");
-+ SkUNREACHABLE;
- }
-
- static uint32_t primitive_vertices(GrPrimitiveType type) {
-@@ -627,6 +628,7 @@ static uint32_t primitive_vertices(GrPrimitiveType type) {
- return 0;
- }
- SK_ABORT("Incomplete switch\n");
-+ SkUNREACHABLE;
- }
-
- static SkPoint random_point(SkRandom* random, SkScalar min, SkScalar max) {
-diff --git a/gfx/skia/skia/src/gpu/ops/GrFillRRectOp.cpp b/gfx/skia/skia/src/gpu/ops/GrFillRRectOp.cpp
-index 6b3c023ff689df22cdd9c74ddc34e9770d50f07d..6b28723bd5c84bff56a17d8983777d8a4775ffd2 100644
---- a/gfx/skia/skia/src/gpu/ops/GrFillRRectOp.cpp
-+++ b/gfx/skia/skia/src/gpu/ops/GrFillRRectOp.cpp
-@@ -823,4 +823,5 @@ static bool can_use_hw_derivatives_with_coverage(
- }
- }
- 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
-index b32758150f42c6fe7a413f8b820e2c0171f9bd77..10f0d968891f894866216e49c23cc8d7f47e1e4c 100644
---- a/gfx/skia/skia/src/gpu/ops/GrOvalOpFactory.cpp
-+++ b/gfx/skia/skia/src/gpu/ops/GrOvalOpFactory.cpp
-@@ -2283,6 +2283,7 @@ static int rrect_type_to_vert_count(RRectType type) {
- return kVertsPerOverstrokeRRect;
- }
- SK_ABORT("Invalid type");
-+ SkUNREACHABLE;
- }
-
- static int rrect_type_to_index_count(RRectType type) {
-@@ -2295,6 +2296,7 @@ static int rrect_type_to_index_count(RRectType type) {
- return kIndicesPerOverstrokeRRect;
- }
- SK_ABORT("Invalid type");
-+ SkUNREACHABLE;
- }
-
- static const uint16_t* rrect_type_to_indices(RRectType type) {
-@@ -2306,6 +2308,7 @@ static const uint16_t* rrect_type_to_indices(RRectType type) {
- return gOverstrokeRRectIndices;
- }
- SK_ABORT("Invalid type");
-+ SkUNREACHABLE;
- }
-
- ///////////////////////////////////////////////////////////////////////////////////////////////////
-diff --git a/gfx/skia/skia/src/gpu/ops/GrShadowRRectOp.cpp b/gfx/skia/skia/src/gpu/ops/GrShadowRRectOp.cpp
-index 546933bb8a46eb79ae456936e4977e68d7459b28..fadf6096c339f1ae48670fad99dd35b6a70d016e 100644
---- a/gfx/skia/skia/src/gpu/ops/GrShadowRRectOp.cpp
-+++ b/gfx/skia/skia/src/gpu/ops/GrShadowRRectOp.cpp
-@@ -155,6 +155,7 @@ static int rrect_type_to_vert_count(RRectType type) {
- return kVertsPerOverstrokeRRect;
- }
- SK_ABORT("Invalid type");
-+ SkUNREACHABLE;
- }
-
- static int rrect_type_to_index_count(RRectType type) {
-@@ -167,6 +168,7 @@ static int rrect_type_to_index_count(RRectType type) {
- return kIndicesPerOverstrokeRRect;
- }
- SK_ABORT("Invalid type");
-+ SkUNREACHABLE;
- }
-
- static const uint16_t* rrect_type_to_indices(RRectType type) {
-@@ -178,6 +180,7 @@ static const uint16_t* rrect_type_to_indices(RRectType type) {
- return gRRectIndices;
- }
- SK_ABORT("Invalid type");
-+ SkUNREACHABLE;
- }
-
- ///////////////////////////////////////////////////////////////////////////////
-diff --git a/gfx/skia/skia/src/gpu/text/GrTextBlob.h b/gfx/skia/skia/src/gpu/text/GrTextBlob.h
-index ddea88d15fe5bbae3661d656768d1058209931e0..d82e84704f9038c22615e4d79c83c5b5fd02014e 100644
---- a/gfx/skia/skia/src/gpu/text/GrTextBlob.h
-+++ b/gfx/skia/skia/src/gpu/text/GrTextBlob.h
-@@ -125,6 +125,7 @@ public:
-
- void* operator new(size_t) {
- SK_ABORT("All blobs are created by placement new.");
-+ SkUNREACHABLE;
- }
-
- void* operator new(size_t, void* p) { return p; }
-diff --git a/gfx/skia/skia/src/gpu/text/GrTextBlobVertexRegenerator.cpp b/gfx/skia/skia/src/gpu/text/GrTextBlobVertexRegenerator.cpp
-index 976beaf3d4e336e6b8b6ae45eb69b76ca8e0814a..f9c01dd217d9f6fc7f202b9e22558b3561699b8b 100644
---- a/gfx/skia/skia/src/gpu/text/GrTextBlobVertexRegenerator.cpp
-+++ b/gfx/skia/skia/src/gpu/text/GrTextBlobVertexRegenerator.cpp
-@@ -284,4 +284,5 @@ bool GrTextBlob::VertexRegenerator::regenerate(GrTextBlob::VertexRegenerator::Re
- 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
-index 36e2436a85483fafc17a517d4e4e3b98baaf8915..a914f5a4d5ec49cd4d935c7f03899dae323878cf 100644
---- a/gfx/skia/skia/src/gpu/vk/GrVkCaps.cpp
-+++ b/gfx/skia/skia/src/gpu/vk/GrVkCaps.cpp
-@@ -108,6 +108,7 @@ static FormatCompatibilityClass format_compatibility_class(VkFormat format) {
-
- default:
- SK_ABORT("Unsupported VkFormat");
-+ SkUNREACHABLE;
- }
- }
-
-@@ -1656,6 +1657,7 @@ GrBackendFormat GrVkCaps::getBackendFormatFromCompressionType(
- return GrBackendFormat::MakeVk(VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK);
- }
- SK_ABORT("Invalid compression type");
-+ SkUNREACHABLE;
- }
-
- GrSwizzle GrVkCaps::getTextureSwizzle(const GrBackendFormat& format, GrColorType colorType) const {
-diff --git a/gfx/skia/skia/src/gpu/vk/GrVkMemory.cpp b/gfx/skia/skia/src/gpu/vk/GrVkMemory.cpp
-index ed14a643ec94ec5b9b7c7d2c02198d328650b238..3675c953d4705bf0f79b83565312ae75cde39594 100644
---- a/gfx/skia/skia/src/gpu/vk/GrVkMemory.cpp
-+++ b/gfx/skia/skia/src/gpu/vk/GrVkMemory.cpp
-@@ -28,6 +28,7 @@ static BufferUsage get_buffer_usage(GrVkBuffer::Type type, bool dynamic) {
- return BufferUsage::kCpuOnly;
- }
- SK_ABORT("Invalid GrVkBuffer::Type");
-+ SkUNREACHABLE;
- }
-
- bool GrVkMemory::AllocAndBindBufferMemory(const GrVkGpu* gpu,
-diff --git a/gfx/skia/skia/src/gpu/vk/GrVkPipeline.cpp b/gfx/skia/skia/src/gpu/vk/GrVkPipeline.cpp
-index 6868ff5babfe4009510b4a49bfc011c8a7d728a0..2c7a20a7dbe396c1c29650f4f59f9109b4c8b020 100644
---- a/gfx/skia/skia/src/gpu/vk/GrVkPipeline.cpp
-+++ b/gfx/skia/skia/src/gpu/vk/GrVkPipeline.cpp
-@@ -80,6 +80,7 @@ static inline VkFormat attrib_type_to_vkformat(GrVertexAttribType type) {
- return VK_FORMAT_R16G16B16A16_UNORM;
- }
- SK_ABORT("Unknown vertex attrib type");
-+ SkUNREACHABLE;
- }
-
- static void setup_vertex_input_state(const GrPrimitiveProcessor& primProc,
-@@ -162,8 +163,10 @@ static VkPrimitiveTopology gr_primitive_type_to_vk_topology(GrPrimitiveType prim
- 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,
-diff --git a/gfx/skia/skia/src/gpu/vk/GrVkSampler.cpp b/gfx/skia/skia/src/gpu/vk/GrVkSampler.cpp
-index 5dc3544f008951b8e5ec530d4a1f00a723e7febc..306bd96816694e7970207789717fccac478a91e7 100644
---- a/gfx/skia/skia/src/gpu/vk/GrVkSampler.cpp
-+++ b/gfx/skia/skia/src/gpu/vk/GrVkSampler.cpp
-@@ -23,6 +23,7 @@ static inline VkSamplerAddressMode wrap_mode_to_vk_sampler_address(
- return VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER;
- }
- SK_ABORT("Unknown wrap mode.");
-+ SkUNREACHABLE;
- }
-
- GrVkSampler* GrVkSampler::Create(GrVkGpu* gpu, const GrSamplerState& samplerState,
-diff --git a/gfx/skia/skia/src/gpu/vk/GrVkTransferBuffer.h b/gfx/skia/skia/src/gpu/vk/GrVkTransferBuffer.h
-index 210cf228d93cae644bc933a903e1b5e8c6400309..6a6fd90d96decd88bba9011ee5c553a42c696a74 100644
---- a/gfx/skia/skia/src/gpu/vk/GrVkTransferBuffer.h
-+++ b/gfx/skia/skia/src/gpu/vk/GrVkTransferBuffer.h
-@@ -34,6 +34,7 @@ private:
-
- bool onUpdateData(const void* src, size_t srcSizeInBytes) override {
- SK_ABORT("Not implemented for transfer buffers.");
-+ SkUNREACHABLE;
- }
-
- GrVkGpu* getVkGpu() const {
-diff --git a/gfx/skia/skia/src/gpu/vk/GrVkUniformHandler.cpp b/gfx/skia/skia/src/gpu/vk/GrVkUniformHandler.cpp
-index 6df62ce6a9016e97b3eb41532b5457c2adbcd77d..4ac68735639857d0be48d759aaf2540411c45064 100644
---- a/gfx/skia/skia/src/gpu/vk/GrVkUniformHandler.cpp
-+++ b/gfx/skia/skia/src/gpu/vk/GrVkUniformHandler.cpp
-@@ -89,6 +89,7 @@ static uint32_t grsltype_to_alignment_mask(GrSLType type) {
- break;
- }
- SK_ABORT("Unexpected type");
-+ SkUNREACHABLE;
- }
-
- /** Returns the size in bytes taken up in vulkanbuffers for GrSLTypes. */
-@@ -172,6 +173,7 @@ static inline uint32_t grsltype_to_vk_size(GrSLType type) {
- break;
- }
- SK_ABORT("Unexpected type");
-+ SkUNREACHABLE;
- }
-
-
-diff --git a/gfx/skia/skia/src/gpu/vk/GrVkVaryingHandler.cpp b/gfx/skia/skia/src/gpu/vk/GrVkVaryingHandler.cpp
-index 5fe2f45373674abfc750720ba43ceef25347e7a1..4b6d61813ddf56078a32c7505cf744070a7ab4ad 100644
---- a/gfx/skia/skia/src/gpu/vk/GrVkVaryingHandler.cpp
-+++ b/gfx/skia/skia/src/gpu/vk/GrVkVaryingHandler.cpp
-@@ -74,6 +74,7 @@ static inline int grsltype_to_location_size(GrSLType type) {
- return 1;
- }
- SK_ABORT("Unexpected type");
-+ SkUNREACHABLE;
- }
-
- static void finalize_helper(GrVkVaryingHandler::VarArray& vars) {
-diff --git a/gfx/skia/skia/src/pdf/SkPDFTag.cpp b/gfx/skia/skia/src/pdf/SkPDFTag.cpp
-index a2248070e89cdc269614fbf19a3402dcffb5b324..15122d50477f98e92afbd48afcc68c7fdbf6fe1a 100644
---- a/gfx/skia/skia/src/pdf/SkPDFTag.cpp
-+++ b/gfx/skia/skia/src/pdf/SkPDFTag.cpp
-@@ -64,6 +64,7 @@ static const char* tag_name_from_type(SkPDF::DocumentStructureType type) {
- #undef M
- }
- SK_ABORT("bad tag");
-+ SkUNREACHABLE;
- }
-
- struct SkPDFTagNode {
-diff --git a/gfx/skia/skia/src/ports/SkFontMgr_FontConfigInterface.cpp b/gfx/skia/skia/src/ports/SkFontMgr_FontConfigInterface.cpp
-index 23986cbaaa9329d7a55fcfb654f2ca786f8f9e17..e78c47b11ad9f7483a41e0271305e4ca2de96509 100644
---- a/gfx/skia/skia/src/ports/SkFontMgr_FontConfigInterface.cpp
-+++ b/gfx/skia/skia/src/ports/SkFontMgr_FontConfigInterface.cpp
-@@ -173,18 +173,22 @@ public:
- protected:
- int onCountFamilies() const override {
- SK_ABORT("Not implemented.");
-+ SkUNREACHABLE;
- }
-
- void onGetFamilyName(int index, SkString* familyName) const override {
- SK_ABORT("Not implemented.");
-+ SkUNREACHABLE;
- }
-
- SkFontStyleSet* onCreateStyleSet(int index) const override {
- SK_ABORT("Not implemented.");
-+ SkUNREACHABLE;
- }
-
- SkFontStyleSet* onMatchFamily(const char familyName[]) const override {
- SK_ABORT("Not implemented.");
-+ SkUNREACHABLE;
- }
-
- SkTypeface* onMatchFamilyStyle(const char requestedFamilyName[],
-@@ -215,10 +219,12 @@ protected:
- const char* bcp47[], int bcp47Count,
- SkUnichar character) const override {
- SK_ABORT("Not implemented.");
-+ SkUNREACHABLE;
- }
-
- SkTypeface* onMatchFaceStyle(const SkTypeface*, const SkFontStyle&) const override {
- SK_ABORT("Not implemented.");
-+ SkUNREACHABLE;
- }
-
- sk_sp<SkTypeface> onMakeFromData(sk_sp<SkData> data, int ttcIndex) const override {
-diff --git a/gfx/skia/skia/src/shaders/SkImageShader.cpp b/gfx/skia/skia/src/shaders/SkImageShader.cpp
-index 5bc13e587c796656e5b9205d295f9e9ea5a88174..968e3cffaedb016659aef8d21dc1b1d16bf296a6 100644
---- a/gfx/skia/skia/src/shaders/SkImageShader.cpp
-+++ b/gfx/skia/skia/src/shaders/SkImageShader.cpp
-@@ -183,6 +183,7 @@ static GrSamplerState::WrapMode tile_mode_to_wrap_mode(const SkTileMode tileMode
- return GrSamplerState::WrapMode::kClampToBorder;
- }
- SK_ABORT("Unknown tile mode.");
-+ SkUNREACHABLE;
- }
-
- std::unique_ptr<GrFragmentProcessor> SkImageShader::asFragmentProcessor(
-diff --git a/gfx/skia/skia/src/utils/SkShadowUtils.cpp b/gfx/skia/skia/src/utils/SkShadowUtils.cpp
-index 1b47af5523749d42226401118704b9d6e19dc036..f0ae0411d0f9642c3bec9417178769d2d0c7936b 100644
---- a/gfx/skia/skia/src/utils/SkShadowUtils.cpp
-+++ b/gfx/skia/skia/src/utils/SkShadowUtils.cpp
-@@ -149,6 +149,7 @@ struct SpotVerticesFactory {
- return false;
- }
- SK_ABORT("Uninitialized occluder type?");
-+ SkUNREACHABLE;
- }
-
- sk_sp<SkVertices> makeVertices(const SkPath& path, const SkMatrix& ctm,
-diff --git a/intl/icu/source/i18n/number_rounding.cpp b/intl/icu/source/i18n/number_rounding.cpp
-index a9b3f16c050d946c9084fe2dd3b5c567726e185f..48b2e9867350c83a7e309163bd88ec5a8ca1335e 100644
---- a/intl/icu/source/i18n/number_rounding.cpp
-+++ b/intl/icu/source/i18n/number_rounding.cpp
-@@ -283,6 +283,7 @@ FractionPrecision Precision::constructFraction(int32_t minFrac, int32_t maxFrac)
- settings.fMaxFrac = static_cast<digits_t>(maxFrac);
- settings.fMinSig = -1;
- settings.fMaxSig = -1;
-+ settings.fPriority = UNUM_ROUNDING_PRIORITY_RELAXED;
- PrecisionUnion union_;
- union_.fracSig = settings;
- return {RND_FRACTION, union_};
-@@ -294,6 +295,7 @@ Precision Precision::constructSignificant(int32_t minSig, int32_t maxSig) {
- settings.fMaxFrac = -1;
- settings.fMinSig = static_cast<digits_t>(minSig);
- settings.fMaxSig = static_cast<digits_t>(maxSig);
-+ settings.fPriority = UNUM_ROUNDING_PRIORITY_RELAXED;
- PrecisionUnion union_;
- union_.fracSig = settings;
- return {RND_SIGNIFICANT, union_};
-diff --git a/third_party/libwebrtc/api/adaptation/resource.cc b/third_party/libwebrtc/api/adaptation/resource.cc
-index dac03fe019d89482e91a29242b3027da80f28c8b..e18a04b4c5c95d1449662cfd8f7a7f978f6461c3 100644
---- a/third_party/libwebrtc/api/adaptation/resource.cc
-+++ b/third_party/libwebrtc/api/adaptation/resource.cc
-@@ -22,6 +22,7 @@ const char* ResourceUsageStateToString(ResourceUsageState usage_state) {
- return "kUnderuse";
- }
- RTC_CHECK_NOTREACHED();
-+ return nullptr;
- }
-
- ResourceListener::~ResourceListener() {}
-diff --git a/third_party/libwebrtc/api/rtp_parameters.cc b/third_party/libwebrtc/api/rtp_parameters.cc
-index c1d12e5d8dc4be47fd751d656c99174b1433de09..e7fdfc2b7fc14a30df1d8770365985f219e7d4b7 100644
---- a/third_party/libwebrtc/api/rtp_parameters.cc
-+++ b/third_party/libwebrtc/api/rtp_parameters.cc
-@@ -32,6 +32,7 @@ const char* DegradationPreferenceToString(
- return "balanced";
- }
- RTC_CHECK_NOTREACHED();
-+ return "";
- }
-
- const double kDefaultBitratePriority = 1.0;
-diff --git a/third_party/libwebrtc/api/video/video_frame_buffer.cc b/third_party/libwebrtc/api/video/video_frame_buffer.cc
-index 398e30b606fe8bc24fe6d89bbdaf4176507ff2d6..598ead31e889f0a67112094b08dac5f0f1248a62 100644
---- a/third_party/libwebrtc/api/video/video_frame_buffer.cc
-+++ b/third_party/libwebrtc/api/video/video_frame_buffer.cc
-@@ -99,6 +99,8 @@ const char* VideoFrameBufferTypeToString(VideoFrameBuffer::Type type) {
- default:
- RTC_DCHECK_NOTREACHED();
- }
-+ RTC_DCHECK_NOTREACHED();
-+ return nullptr;
- }
-
- int I420BufferInterface::ChromaWidth() const {
-diff --git a/third_party/libwebrtc/api/video_codecs/video_codec.cc b/third_party/libwebrtc/api/video_codecs/video_codec.cc
-index c6122d3f6ac3056ebcc654e1c268923f6057a738..1c78e6c0071a4ae36913d47e67d05389270f5095 100644
---- a/third_party/libwebrtc/api/video_codecs/video_codec.cc
-+++ b/third_party/libwebrtc/api/video_codecs/video_codec.cc
-@@ -118,6 +118,7 @@ const char* CodecTypeToPayloadString(VideoCodecType type) {
- return kPayloadNameGeneric;
- }
- RTC_CHECK_NOTREACHED();
-+ return "";
- }
-
- VideoCodecType PayloadStringToCodecType(const std::string& name) {
-diff --git a/third_party/libwebrtc/api/video_codecs/video_encoder_software_fallback_wrapper.cc b/third_party/libwebrtc/api/video_codecs/video_encoder_software_fallback_wrapper.cc
-index 39c52a008181cd2cf5fb2b3589816dfd3f03a6ba..24df68f62d0f27d3f0e2e099f1f694fe2fd4e982 100644
---- 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
-@@ -163,6 +163,7 @@ class VideoEncoderSoftwareFallbackWrapper final : public VideoEncoder {
- return fallback_encoder_.get();
- }
- RTC_CHECK_NOTREACHED();
-+ return nullptr;
- }
-
- // Updates encoder with last observed parameters, such as callbacks, rates,
-@@ -343,6 +344,7 @@ int32_t VideoEncoderSoftwareFallbackWrapper::Encode(
- return fallback_encoder_->Encode(frame, frame_types);
- }
- RTC_CHECK_NOTREACHED();
-+ return WEBRTC_VIDEO_CODEC_ERROR;
- }
-
- int32_t VideoEncoderSoftwareFallbackWrapper::EncodeWithMainEncoder(
-diff --git a/third_party/libwebrtc/call/adaptation/video_stream_adapter.cc b/third_party/libwebrtc/call/adaptation/video_stream_adapter.cc
-index f30a4d7abb37a63eeea637b52d0dc8103c2fefe0..42dbaa0e8c84c6edc2c77f505a78ac47815fae3d 100644
---- a/third_party/libwebrtc/call/adaptation/video_stream_adapter.cc
-+++ b/third_party/libwebrtc/call/adaptation/video_stream_adapter.cc
-@@ -168,6 +168,7 @@ const char* Adaptation::StatusToString(Adaptation::Status status) {
- return "kRejectedByConstraint";
- }
- RTC_CHECK_NOTREACHED();
-+ return "";
- }
-
- Adaptation::Adaptation(int validation_id,
-@@ -390,6 +391,7 @@ VideoStreamAdapter::RestrictionsOrState VideoStreamAdapter::GetAdaptationUpStep(
- return Adaptation::Status::kAdaptationDisabled;
- }
- RTC_CHECK_NOTREACHED();
-+ return Adaptation::Status::kAdaptationDisabled;
- }
-
- Adaptation VideoStreamAdapter::GetAdaptationDown() {
-@@ -472,6 +474,7 @@ VideoStreamAdapter::GetAdaptationDownStep(
- return Adaptation::Status::kAdaptationDisabled;
- }
- RTC_CHECK_NOTREACHED();
-+ return Adaptation::Status::kAdaptationDisabled;
- }
-
- VideoStreamAdapter::RestrictionsOrState VideoStreamAdapter::DecreaseResolution(
-@@ -625,6 +628,8 @@ Adaptation VideoStreamAdapter::GetAdaptDownResolution() {
- }
- }
- RTC_CHECK_NOTREACHED();
-+ return RestrictionsOrStateToAdaptation(
-+ Adaptation::Status::kAdaptationDisabled, input_state);
- }
-
- VideoStreamAdapter::RestrictionsOrState
-diff --git a/third_party/libwebrtc/call/video_send_stream.cc b/third_party/libwebrtc/call/video_send_stream.cc
-index 241d44a2303a10c7a13557080665ee677835c4d0..0e4e28a70c76220121bedbc7e670045b63238a9b 100644
---- a/third_party/libwebrtc/call/video_send_stream.cc
-+++ b/third_party/libwebrtc/call/video_send_stream.cc
-@@ -30,6 +30,7 @@ const char* StreamTypeToString(VideoSendStream::StreamStats::StreamType type) {
- return "flexfec";
- }
- RTC_CHECK_NOTREACHED();
-+ return "";
- }
-
- } // namespace
-diff --git a/third_party/libwebrtc/modules/audio_processing/agc/clipping_predictor.cc b/third_party/libwebrtc/modules/audio_processing/agc/clipping_predictor.cc
-index 58b3a2769cdaa72ff4045c7c23fd006237140198..ce0fa8e417c8e77e7d449ca9d65dabf1e0b160ff 100644
---- a/third_party/libwebrtc/modules/audio_processing/agc/clipping_predictor.cc
-+++ b/third_party/libwebrtc/modules/audio_processing/agc/clipping_predictor.cc
-@@ -378,6 +378,7 @@ std::unique_ptr<ClippingPredictor> CreateClippingPredictor(
- /*adaptive_step_estimation=*/false);
- }
- RTC_DCHECK_NOTREACHED();
-+ return nullptr;
- }
-
- } // namespace webrtc
-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
-index 91501fb6e32cb00fa79ce170e95d7e49301717e6..d87d9586e103a8e5edf703a3e516f73e91e3516d 100644
---- 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
-@@ -59,6 +59,8 @@ rtc::FunctionView<float(float)> GetActivationFunction(
- case ActivationFunction::kSigmoidApproximated:
- return ::rnnoise::SigmoidApproximated;
- }
-+ // supposed to be never reached apparently therefore returning bogus
-+ return ::rnnoise::TansigApproximated;
- }
-
- } // namespace
-diff --git a/third_party/libwebrtc/modules/audio_processing/audio_processing_impl.cc b/third_party/libwebrtc/modules/audio_processing/audio_processing_impl.cc
-index 81d96609a4bc796c4ef7b1fdfed53b63d57037d3..946045e0e85b89fb771a0b8ff69b9154c06f1871 100644
---- a/third_party/libwebrtc/modules/audio_processing/audio_processing_impl.cc
-+++ b/third_party/libwebrtc/modules/audio_processing/audio_processing_impl.cc
-@@ -120,6 +120,7 @@ GainControl::Mode Agc1ConfigModeToInterfaceMode(
- return GainControl::kFixedDigital;
- }
- RTC_CHECK_NOTREACHED();
-+ return GainControl::kAdaptiveAnalog;
- }
-
- bool MinimizeProcessingForUnusedOutput() {
-@@ -1985,6 +1986,7 @@ void AudioProcessingImpl::InitializeNoiseSuppressor() {
- return NsConfig::SuppressionLevel::k21dB;
- }
- RTC_CHECK_NOTREACHED();
-+ return NsConfig::SuppressionLevel::k6dB;
- };
-
- NsConfig cfg;
-diff --git a/third_party/libwebrtc/modules/audio_processing/include/audio_processing.cc b/third_party/libwebrtc/modules/audio_processing/include/audio_processing.cc
-index 86edaee0878d3e51b41b0a9f1679a6ebf825d167..784f7ad2029cb586a55c8cbb8600b09b8f80cce9 100644
---- a/third_party/libwebrtc/modules/audio_processing/include/audio_processing.cc
-+++ b/third_party/libwebrtc/modules/audio_processing/include/audio_processing.cc
-@@ -32,6 +32,7 @@ std::string NoiseSuppressionLevelToString(
- return "VeryHigh";
- }
- RTC_CHECK_NOTREACHED();
-+ return "";
- }
-
- std::string GainController1ModeToString(const Agc1Config::Mode& mode) {
-@@ -44,6 +45,7 @@ std::string GainController1ModeToString(const Agc1Config::Mode& mode) {
- return "FixedDigital";
- }
- RTC_CHECK_NOTREACHED();
-+ return "";
- }
-
- } // namespace
-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
-index f1e4eddb4b9d8855f6accf24ef980cbc11d0077d..b3fde3cda3c7c636b8f37f3778fb3b735a61d66d 100644
---- 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
-@@ -38,6 +38,7 @@ std::unique_ptr<VideoRtpDepacketizer> CreateVideoRtpDepacketizer(
- return std::make_unique<VideoRtpDepacketizerGeneric>();
- }
- RTC_CHECK_NOTREACHED();
-+ return nullptr;
- }
-
- } // 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
-index b45fb12e4893fffb88b7bccff347258acada9202..22b8ef99bc77925ab8bc69f9e489d98a52c37dfa 100644
---- a/third_party/libwebrtc/modules/rtp_rtcp/source/rtp_sender.cc
-+++ b/third_party/libwebrtc/modules/rtp_rtcp/source/rtp_sender.cc
-@@ -142,6 +142,7 @@ bool IsNonVolatile(RTPExtensionType type) {
- #endif
- }
- RTC_CHECK_NOTREACHED();
-+ return false;
- }
-
- bool HasBweExtension(const RtpHeaderExtensionMap& extensions_map) {
-diff --git a/third_party/libwebrtc/modules/rtp_rtcp/source/rtp_sender_audio.cc b/third_party/libwebrtc/modules/rtp_rtcp/source/rtp_sender_audio.cc
-index 244f644bd1a1ee8f61e322270012b2cfbec5afda..c2187e469c1b078223a1fdf0266a3e82d9d9a64f 100644
---- a/third_party/libwebrtc/modules/rtp_rtcp/source/rtp_sender_audio.cc
-+++ b/third_party/libwebrtc/modules/rtp_rtcp/source/rtp_sender_audio.cc
-@@ -45,6 +45,7 @@ namespace {
- return "audio_cn";
- }
- RTC_CHECK_NOTREACHED();
-+ return "";
- }
-
- constexpr char kIncludeCaptureClockOffset[] =
-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
-index 5aebd2c5268e8c58b07be4bc393f83ac5abd1c09..8d18446430ff4b7f6d0d669416e3493de3b41411 100644
---- 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
-@@ -30,6 +30,7 @@ TemporalLayersChecker::CreateTemporalLayersChecker(Vp8TemporalLayersType type,
- return std::make_unique<TemporalLayersChecker>(num_temporal_layers);
- }
- RTC_CHECK_NOTREACHED();
-+ return nullptr;
- }
-
- TemporalLayersChecker::TemporalLayersChecker(int num_temporal_layers)
-diff --git a/third_party/libwebrtc/video/adaptation/video_stream_encoder_resource_manager.cc b/third_party/libwebrtc/video/adaptation/video_stream_encoder_resource_manager.cc
-index 2470bc889383a572605021edbaec01ac5ed34ddb..37309e4822f16d3f4a38d4c6719b6773b30b8372 100644
---- a/third_party/libwebrtc/video/adaptation/video_stream_encoder_resource_manager.cc
-+++ b/third_party/libwebrtc/video/adaptation/video_stream_encoder_resource_manager.cc
-@@ -63,6 +63,7 @@ std::string ToString(VideoAdaptationReason reason) {
- return "cpu";
- }
- RTC_CHECK_NOTREACHED();
-+ return "";
- }
-
- std::vector<bool> GetActiveLayersFlags(const VideoCodec& codec) {
-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
-index c00298a160519c604ab84e089ed4dfdcc92cd28c..74b9d1aef31c0738c89423d3c5377c271dfb1f4f 100644
---- 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
-@@ -2651,6 +2651,7 @@ get_type_name_for_precision_qualifier(const glsl_type *type)
- default:
- unreachable("Unsupported type");
- } /* base type */
-+ return "";
- }
-
- static unsigned
-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
-index 9ea8e00d310a0d14b3a8618c78b0afa377f90da7..2dee2ccdcd16b9e562fc6961c0b7bb497cf868eb 100644
---- a/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/ir.cpp
-+++ b/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/ir.cpp
-@@ -624,6 +624,7 @@ ir_expression::get_num_operands(ir_expression_operation op)
- return 4;
-
- unreachable("Could not calculate number of operands");
-+ return -1;
- }
-
- #include "ir_expression_operation_strings.h"
-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
-index 9429e69c2a7fe4c7176bf60164bcb7e311336425..8d9da42434c5877d6d5e5c91a8ebc38fd8ba2569 100644
---- 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
-@@ -239,6 +239,7 @@ incremented_before_terminator(ir_loop *loop, ir_variable *var,
- }
-
- unreachable("Unable to find induction variable");
-+ return false;
- }
-
- /**
-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
-index 88318cd8a6eb7326d3b6a860918b38dcdf662536..63a535c8021436bf44bee45c571ce3e98c3b90b9 100644
---- 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
-@@ -229,6 +229,7 @@ write_mask_to_swizzle(unsigned write_mask)
- case WRITEMASK_W: return SWIZZLE_W;
- }
- unreachable("not reached");
-+ return 0;
- }
-
- /**
-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
-index 445659599c2230dc21e9122b029eefccd4da3b1e..615ab6215a76ed2bb2d5a354923468765582455a 100644
---- a/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl_types.cpp
-+++ b/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl_types.cpp
-@@ -460,6 +460,7 @@ const glsl_type *glsl_type::get_bare_type() const
- }
-
- unreachable("Invalid base type");
-+ return nullptr;
- }
-
- const glsl_type *glsl_type::get_float16_type() const
-@@ -2016,6 +2017,7 @@ glsl_type::get_explicit_std140_type(bool row_major) const
- return type;
- } else {
- unreachable("Invalid type for UBO or SSBO");
-+ return nullptr;
- }
- }
-
-@@ -2374,6 +2376,7 @@ glsl_type::get_explicit_std430_type(bool row_major) const
- return type;
- } else {
- unreachable("Invalid type for SSBO");
-+ return nullptr;
- }
- }
-
-@@ -2448,6 +2451,7 @@ glsl_type::get_explicit_type_for_size_align(glsl_type_size_align_func type_info,
- this->matrix_columns, stride, false);
- } else {
- unreachable("Unhandled type.");
-+ return nullptr;
- }
- }
-
-@@ -2948,6 +2952,7 @@ glsl_get_sampler_dim_coordinate_components(enum glsl_sampler_dim dim)
- 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
-index 0d512550de470344cb8eb371bd7fa1ed22cad6e0..ef940cabdd6e7c9326c283ae6a90e3e387bc0b51 100644
---- a/third_party/rust/glslopt/glsl-optimizer/src/mesa/main/shaderobj.h
-+++ b/third_party/rust/glslopt/glsl-optimizer/src/mesa/main/shaderobj.h
-@@ -185,6 +185,7 @@ _mesa_shader_stage_from_subroutine_uniform(GLenum subuniform)
- return MESA_SHADER_TESS_EVAL;
- }
- unreachable("not reached");
-+ return MESA_SHADER_NONE;
- }
-
- static inline gl_shader_stage
-@@ -205,6 +206,7 @@ _mesa_shader_stage_from_subroutine(GLenum subroutine)
- return MESA_SHADER_TESS_EVAL;
- }
- unreachable("not reached");
-+ return MESA_SHADER_NONE;
- }
-
- static inline GLenum
-@@ -230,6 +232,7 @@ _mesa_shader_stage_to_subroutine(gl_shader_stage stage)
- break;
- }
- unreachable("not reached");
-+ return GL_VERTEX_PROGRAM_ARB;
- }
-
- static inline GLenum
-@@ -253,6 +256,7 @@ _mesa_shader_stage_to_subroutine_uniform(gl_shader_stage stage)
- break;
- }
- unreachable("not reached");
-+ return GL_VERTEX_PROGRAM_ARB;
- }
-
- extern bool
diff --git a/0014-mozilla-s390-context.patch.patch b/0010-mozilla-s390-context.patch.patch
index 616527dfeb55..bf4c7d9562bd 100644
--- a/0014-mozilla-s390-context.patch.patch
+++ b/0010-mozilla-s390-context.patch.patch
@@ -8,10 +8,10 @@ Subject: [PATCH] mozilla-s390-context.patch
1 file changed, 8 insertions(+)
diff --git a/js/src/wasm/WasmSignalHandlers.cpp b/js/src/wasm/WasmSignalHandlers.cpp
-index cee3127507564f9d100318476a61d0a7f4307ade..b90f84f3b25b38195d9a9c1086748711538a1fe7 100644
+index 33e6c32b061bf7bcfcb25f4297afbe2a53c45566..3ff07c5868c607fc48e822dfac6823bcaf9d058c 100644
--- a/js/src/wasm/WasmSignalHandlers.cpp
+++ b/js/src/wasm/WasmSignalHandlers.cpp
-@@ -168,6 +168,10 @@ using mozilla::DebugOnly;
+@@ -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
@@ -22,9 +22,9 @@ index cee3127507564f9d100318476a61d0a7f4307ade..b90f84f3b25b38195d9a9c1086748711
# elif defined(__NetBSD__)
# define EIP_sig(p) ((p)->uc_mcontext.__gregs[_REG_EIP])
# define EBP_sig(p) ((p)->uc_mcontext.__gregs[_REG_EBP])
-@@ -410,6 +414,10 @@ struct macos_aarch64_context {
+@@ -421,6 +425,10 @@ struct macos_aarch64_context {
# define FP_sig(p) RFP_sig(p)
- # define SP_sig(p) R03_sig(p)
+ # define SP_sig(p) R02_sig(p)
# define LR_sig(p) RRA_sig(p)
+# elif defined(__s390x__)
+# define PC_sig(p) PSWa_sig(p)
diff --git a/0015-bsc-991344-Rpi3-Firefox-crashes-after-a-few-seconds-.patch b/0011-bsc-991344-Rpi3-Firefox-crashes-after-a-few-seconds-.patch
index 022e461af9be..b37f35727a87 100644
--- a/0015-bsc-991344-Rpi3-Firefox-crashes-after-a-few-seconds-.patch
+++ b/0011-bsc-991344-Rpi3-Firefox-crashes-after-a-few-seconds-.patch
@@ -10,7 +10,7 @@ bmo#1302554 - ARM/AARCH64: Firefox crashes on NULL nsIChannel** result pointer i
1 file changed, 6 insertions(+)
diff --git a/netwerk/base/nsIOService.cpp b/netwerk/base/nsIOService.cpp
-index de506f59a1f38b1a90b236518395e60cf46b15f1..70473efabab7ea9fb4fc121e81a5ebdb7c94cf8f 100644
+index 1a0c225018b7f48a648009a2d393fffc5089173f..bb5edd300131028f76b9427a20a82f27eb8e2b91 100644
--- a/netwerk/base/nsIOService.cpp
+++ b/netwerk/base/nsIOService.cpp
@@ -1159,7 +1159,13 @@ nsresult nsIOService::NewChannelFromURIWithProxyFlagsInternal(
diff --git a/0016-mozilla-fix-aarch64-libopus.patch.patch b/0012-mozilla-fix-aarch64-libopus.patch.patch
index 6012dfbf58ba..6012dfbf58ba 100644
--- a/0016-mozilla-fix-aarch64-libopus.patch.patch
+++ b/0012-mozilla-fix-aarch64-libopus.patch.patch
diff --git a/0017-Bug-634334-call-to-the-ntlm_auth-helper-fails.patch b/0013-Bug-634334-call-to-the-ntlm_auth-helper-fails.patch
index fbe65430551a..fbe65430551a 100644
--- a/0017-Bug-634334-call-to-the-ntlm_auth-helper-fails.patch
+++ b/0013-Bug-634334-call-to-the-ntlm_auth-helper-fails.patch
diff --git a/0018-Make-PGO-use-toolchain.patch b/0014-Make-PGO-use-toolchain.patch
index cb291ea8a274..cb291ea8a274 100644
--- a/0018-Make-PGO-use-toolchain.patch
+++ b/0014-Make-PGO-use-toolchain.patch
diff --git a/0019-bmo-1516803-force-one-LTO-partition-for-sandbox-when.patch b/0015-bmo-1516803-force-one-LTO-partition-for-sandbox-when.patch
index 0a23d60a6029..8723ff45b4f4 100644
--- a/0019-bmo-1516803-force-one-LTO-partition-for-sandbox-when.patch
+++ b/0015-bmo-1516803-force-one-LTO-partition-for-sandbox-when.patch
@@ -10,10 +10,10 @@ Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/security/sandbox/linux/moz.build b/security/sandbox/linux/moz.build
-index be5120e4aac7b3a5b589a2c88a0218123a4adec7..908e124f9e00ec28354031d5c2c9b9efb3a7bae4 100644
+index c56daf62a6c30903e567ad49681beba7c06e1357..4ca49d6eac1b098d6039416a09fd665010eec4d9 100644
--- a/security/sandbox/linux/moz.build
+++ b/security/sandbox/linux/moz.build
-@@ -117,9 +117,10 @@ if CONFIG["CC_TYPE"] in ("clang", "gcc"):
+@@ -115,9 +115,10 @@ if CONFIG["CC_TYPE"] in ("clang", "gcc"):
# gcc lto likes to put the top level asm in syscall.cc in a different partition
# from the function using it which breaks the build. Work around that by
# forcing there to be only one partition.
diff --git a/0020-Fix-building-with-PGO-when-using-GCC.patch b/0016-Fix-building-with-PGO-when-using-GCC.patch
index 30440b66e5ca..67f7d704b19d 100644
--- a/0020-Fix-building-with-PGO-when-using-GCC.patch
+++ b/0016-Fix-building-with-PGO-when-using-GCC.patch
@@ -10,7 +10,7 @@ Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
2 files changed, 25 insertions(+), 6 deletions(-)
diff --git a/build/moz.configure/lto-pgo.configure b/build/moz.configure/lto-pgo.configure
-index 274e1b6cb620153d1afc6ca685a18783e2a8ea90..de7e424326c47799b7a81f3812d5402f24b6a9f3 100644
+index 99355877447e48e8c7f8569794e99375ad5b254d..879e08e7c3b1a00f8bf13cf48bfc345fc80abdb0 100644
--- a/build/moz.configure/lto-pgo.configure
+++ b/build/moz.configure/lto-pgo.configure
@@ -83,11 +83,12 @@ set_config("PGO_PROFILE_PATH", pgo_profile_path)
diff --git a/0021-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch b/0017-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch
index 2040689769ab..455e3fdb9baf 100644
--- a/0021-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch
+++ b/0017-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch
@@ -9,7 +9,7 @@ Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
1 file changed, 2 insertions(+)
diff --git a/config/makefiles/rust.mk b/config/makefiles/rust.mk
-index 602ba4538829bf5e082f4c9601cae67541fd3905..f3db8cf699a4bfff443f92e1640d71d6fa5ecebf 100644
+index 5d1d5470b33a4d083a846573751fbbbdbb6c249d..1071608a58130db8d006f260ea345bafdc5f9e86 100644
--- a/config/makefiles/rust.mk
+++ b/config/makefiles/rust.mk
@@ -82,6 +82,7 @@ endif
diff --git a/0018-Bug-1516081-Disable-watchdog-during-FDO-train.patch b/0018-Bug-1516081-Disable-watchdog-during-FDO-train.patch
new file mode 100644
index 000000000000..20bfd277c896
--- /dev/null
+++ b/0018-Bug-1516081-Disable-watchdog-during-FDO-train.patch
@@ -0,0 +1,28 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jan Hubicka <hubicka@ucw.cz>
+Date: Sat, 22 Dec 2018 09:32:00 +0200
+Subject: [PATCH] Bug 1516081 - Disable watchdog during FDO train
+
+Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1516081
+---
+ toolkit/components/terminator/nsTerminator.cpp | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/toolkit/components/terminator/nsTerminator.cpp b/toolkit/components/terminator/nsTerminator.cpp
+index 3a8f9f4ba63e64695083a70ccfe38cc8baeb7654..b96d9ef138b42fb114d755218c2622b40d6a3bee 100644
+--- a/toolkit/components/terminator/nsTerminator.cpp
++++ b/toolkit/components/terminator/nsTerminator.cpp
+@@ -460,6 +460,13 @@ void nsTerminator::StartWatchdog() {
+ }
+ #endif
+
++ // Disable watchdog for PGO train builds - writting profile information at
++ // exit may take time and it is better to make build hang rather than
++ // silently produce poorly performing binary.
++#ifdef MOZ_PROFILE_INSTRUMENTATION
++ crashAfterMS = INT32_MAX;
++#endif
++
+ UniquePtr<Options> options(new Options());
+ // crashAfterTicks is guaranteed to be > 0 as
+ // crashAfterMS >= ADDITIONAL_WAIT_BEFORE_CRASH_MS >> HEARTBEAT_INTERVAL_MS
diff --git a/0023-Bug-559213-Support-system-av1.patch b/0019-Bug-559213-Support-system-av1.patch
index 33e8aa9dab2a..d08b26df2a02 100644
--- a/0023-Bug-559213-Support-system-av1.patch
+++ b/0019-Bug-559213-Support-system-av1.patch
@@ -32,10 +32,10 @@ index a0877c9d717e84489e19ee532d61df43b8a19889..5caa2036e0ece1404b16c52a31235f12
if not CONFIG["MOZ_SYSTEM_PNG"]:
external_dirs += ["media/libpng"]
diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
-index 9c07dba2f456b03cb39e6954369cf94d6b68b333..b2ccfe5a41b1026cde2184b2881754a5a9b455a5 100644
+index d9489c8f15e4f320a2947f2fef4f98d92acb292e..4d2f15e18c1c0755a1e28fd8e20a87f41e2f4eeb 100644
--- a/config/system-headers.mozbuild
+++ b/config/system-headers.mozbuild
-@@ -1293,6 +1293,14 @@ if CONFIG['MOZ_ENABLE_LIBPROXY']:
+@@ -1291,6 +1291,14 @@ if CONFIG['MOZ_ENABLE_LIBPROXY']:
'proxy.h',
]
@@ -67,7 +67,7 @@ index c71f22a22eeead703192edfb710cc6113d42c11c..e91f57de9017e74436b03b769f04668d
if CONFIG["MOZ_OMX"]:
EXPORTS += [
diff --git a/media/ffvpx/libavcodec/moz.build b/media/ffvpx/libavcodec/moz.build
-index 61d9962a712616cd0f90332b466ecd0d9eff77c3..29b6ede31baddaa3ad8a5e0d98c1ea0b00d27c88 100644
+index 5675c28234a14f7cbfb4e719b78b248ac63fcf0a..56344e5e4c98b2efd501875636bb54ed12829663 100644
--- a/media/ffvpx/libavcodec/moz.build
+++ b/media/ffvpx/libavcodec/moz.build
@@ -109,10 +109,14 @@ if not CONFIG['MOZ_FFVPX_AUDIOONLY']:
@@ -86,14 +86,14 @@ index 61d9962a712616cd0f90332b466ecd0d9eff77c3..29b6ede31baddaa3ad8a5e0d98c1ea0b
+ 'dav1d',
+ 'media_libdav1d_asm',
+ ]
- if CONFIG['MOZ_WAYLAND']:
+ if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
LOCAL_INCLUDES += ['/media/mozva']
SOURCES += [
diff --git a/toolkit/moz.configure b/toolkit/moz.configure
-index 78f31128853925cc31d754f8b42c3406ac10079a..daa9bbd9d6bc1df6ae7442e5037ac24379815d86 100644
+index fd90272f650bc3fbfbec0b79d031b00523267e87..5cf3ef5454a6580e14a06db7e448336d58452586 100644
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
-@@ -712,14 +712,29 @@ def av1(value):
+@@ -744,14 +744,29 @@ def av1(value):
if value:
return True
@@ -125,7 +125,7 @@ index 78f31128853925cc31d754f8b42c3406ac10079a..daa9bbd9d6bc1df6ae7442e5037ac243
def dav1d_nasm(target):
if target.cpu in ("x86", "x86_64"):
return namespace(version="2.14", what="AV1")
-@@ -729,6 +744,7 @@ set_config("MOZ_DAV1D_ASM", dav1d_asm)
+@@ -761,6 +776,7 @@ set_config("MOZ_DAV1D_ASM", dav1d_asm)
set_define("MOZ_DAV1D_ASM", dav1d_asm)
set_config("MOZ_AV1", av1)
set_define("MOZ_AV1", av1)
diff --git a/0024-Bug-847568-Support-system-harfbuzz.patch b/0020-Bug-847568-Support-system-harfbuzz.patch
index fbd0a5095206..2315b0a7596e 100644
--- a/0024-Bug-847568-Support-system-harfbuzz.patch
+++ b/0020-Bug-847568-Support-system-harfbuzz.patch
@@ -21,10 +21,10 @@ Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
10 files changed, 40 insertions(+), 1 deletion(-)
diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
-index b2ccfe5a41b1026cde2184b2881754a5a9b455a5..4886a4ef96ef739ee795e0309b7783c3f33856fd 100644
+index 4d2f15e18c1c0755a1e28fd8e20a87f41e2f4eeb..daf1222bdb06aba229ed939212763c79b935366a 100644
--- a/config/system-headers.mozbuild
+++ b/config/system-headers.mozbuild
-@@ -1237,6 +1237,13 @@ if CONFIG['OS_TARGET'] == 'Android':
+@@ -1235,6 +1235,13 @@ if CONFIG['OS_TARGET'] == 'Android':
'vr/gvr/capi/include/gvr.h',
]
@@ -39,10 +39,10 @@ index b2ccfe5a41b1026cde2184b2881754a5a9b455a5..4886a4ef96ef739ee795e0309b7783c3
system_headers += [
'jack/jack.h',
diff --git a/dom/base/moz.build b/dom/base/moz.build
-index d4ed2d914eef0e3b52ae559d494ca298e27dc0ca..4f82e8d6e50dd3b47d0909b7125c830850cc8c02 100644
+index 19990d90ff73533898c9cf017e4c52852114e93d..817344b497cb24398ebce2428313596c63d70c02 100644
--- a/dom/base/moz.build
+++ b/dom/base/moz.build
-@@ -596,6 +596,9 @@ FINAL_LIBRARY = "xul"
+@@ -609,6 +609,9 @@ FINAL_LIBRARY = "xul"
if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
@@ -53,7 +53,7 @@ index d4ed2d914eef0e3b52ae559d494ca298e27dc0ca..4f82e8d6e50dd3b47d0909b7125c8308
"UseCounterList.h",
script="gen-usecounters.py",
diff --git a/gfx/moz.build b/gfx/moz.build
-index c09fcbf3cef805b66a2ecab1f7c9f797897c1b6a..4c88ac6ad8cd53d7fcf89722b44ea17c88dd3242 100644
+index 56ea317bedfc68d504248b5d3b79cd36e8bc388a..6cc19f84709bbe3be4ff830e3a6dd29189048c6f 100644
--- a/gfx/moz.build
+++ b/gfx/moz.build
@@ -10,6 +10,9 @@ with Files("**"):
@@ -75,7 +75,7 @@ index c09fcbf3cef805b66a2ecab1f7c9f797897c1b6a..4c88ac6ad8cd53d7fcf89722b44ea17c
"thebes",
"ipc",
diff --git a/gfx/skia/generate_mozbuild.py b/gfx/skia/generate_mozbuild.py
-index 20e29297331b8a268732a3af8255af1066aa5be8..256e68e29253243accdcda7c0558c6667fa4bb29 100755
+index 39675ea9c2e939580f7e11fe17c10b0b49f4ed4c..6262eec29395c873bd1d10377a54b99ca16e92e5 100755
--- a/gfx/skia/generate_mozbuild.py
+++ b/gfx/skia/generate_mozbuild.py
@@ -91,6 +91,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
@@ -89,10 +89,10 @@ index 20e29297331b8a268732a3af8255af1066aa5be8..256e68e29253243accdcda7c0558c666
LOCAL_INCLUDES += [
"/gfx/cairo/cairo/src",
diff --git a/gfx/skia/moz.build b/gfx/skia/moz.build
-index 52966211bd9639fa29aa6153cc33e855fc803ba6..cdf81adf868d3414447dfb455e151f52c6b6a588 100644
+index 1d92936263a091eac0dc90fdb0038982e711d5c3..afef373e62af4273aa2b21f3fd3103dc5670ea00 100644
--- a/gfx/skia/moz.build
+++ b/gfx/skia/moz.build
-@@ -487,6 +487,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
+@@ -601,6 +601,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
'-Wno-unused-private-field',
]
@@ -103,7 +103,7 @@ index 52966211bd9639fa29aa6153cc33e855fc803ba6..cdf81adf868d3414447dfb455e151f52
LOCAL_INCLUDES += [
"/gfx/cairo/cairo/src",
diff --git a/gfx/thebes/moz.build b/gfx/thebes/moz.build
-index 176cc3c7e5dba33db636159486b54a71f99b2064..34ac0598acb48e21f866eedff83a22b5f7b244f1 100644
+index 71903756ea1949136cdc25e3b7cd83eeb68dc6ea..8af85a4ed663292583310efea06ada8c60eb908d 100644
--- a/gfx/thebes/moz.build
+++ b/gfx/thebes/moz.build
@@ -294,6 +294,9 @@ LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]
@@ -117,7 +117,7 @@ index 176cc3c7e5dba33db636159486b54a71f99b2064..34ac0598acb48e21f866eedff83a22b5
include("/tools/fuzzing/libfuzzer-config.mozbuild")
diff --git a/intl/unicharutil/util/moz.build b/intl/unicharutil/util/moz.build
-index b52920725e4f2937a41cb1f765d88eb2185c4caa..5272100b3e53e7d0d137b6d70442f48d04423cd1 100644
+index 2bbd00415cae9d6a27b66d9eef50add3ada9ba96..f66bd37695d41eea709abea1239dfcd2cbb503d1 100644
--- a/intl/unicharutil/util/moz.build
+++ b/intl/unicharutil/util/moz.build
@@ -24,6 +24,9 @@ UNIFIED_SOURCES += [
@@ -131,10 +131,10 @@ index b52920725e4f2937a41cb1f765d88eb2185c4caa..5272100b3e53e7d0d137b6d70442f48d
GeneratedFile(
diff --git a/netwerk/dns/moz.build b/netwerk/dns/moz.build
-index 66b12fce447547f0cde8d769d9453e441f2b49fa..e61c7237c11a6a55c858eca65b6ca16016f14d4a 100644
+index 17612ff1b396891c8942f53d3f39fbca8bdca6cb..d6d51948da54c7fbca53662050d33019e7e0dea6 100644
--- a/netwerk/dns/moz.build
+++ b/netwerk/dns/moz.build
-@@ -111,4 +111,7 @@ LOCAL_INCLUDES += [
+@@ -109,4 +109,7 @@ LOCAL_INCLUDES += [
"/netwerk/protocol/http",
]
@@ -143,10 +143,10 @@ index 66b12fce447547f0cde8d769d9453e441f2b49fa..e61c7237c11a6a55c858eca65b6ca160
+
USE_LIBS += ["icu"]
diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build
-index 0f9d7e95bf46b678246907efc93ef32fe13adf38..a6c079d252d153041db3ee13d0f1031e4c795d70 100644
+index 939d4f6a4b8da54c064ebbbda541b412979d5bab..1d964af4f1e237ef419b15c954a5a3b663c9ce92 100644
--- a/toolkit/library/moz.build
+++ b/toolkit/library/moz.build
-@@ -291,6 +291,9 @@ if CONFIG["MOZ_ANDROID_GOOGLE_VR"]:
+@@ -285,6 +285,9 @@ if CONFIG["MOZ_ANDROID_GOOGLE_VR"]:
"-lgvr",
]
@@ -157,10 +157,10 @@ index 0f9d7e95bf46b678246907efc93ef32fe13adf38..a6c079d252d153041db3ee13d0f1031e
OS_LIBS += CONFIG["MOZ_JPEG_LIBS"]
diff --git a/toolkit/moz.configure b/toolkit/moz.configure
-index daa9bbd9d6bc1df6ae7442e5037ac24379815d86..98cc8c2fb173ba3b5b70beafce37c11a037ca1a1 100644
+index 5cf3ef5454a6580e14a06db7e448336d58452586..115febb3d533eb69cecbe0931b00be4e910e20de 100644
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
-@@ -629,6 +629,15 @@ def freetype2_combined_info(fontconfig_info, freetype2_info):
+@@ -675,6 +675,15 @@ def freetype2_combined_info(fontconfig_info, freetype2_info):
set_define("MOZ_HAVE_FREETYPE2", depends_if(freetype2_info)(lambda _: True))
diff --git a/0025-Bug-847568-Support-system-graphite2.patch b/0021-Bug-847568-Support-system-graphite2.patch
index 3459e5313a5b..b0118a1f7177 100644
--- a/0025-Bug-847568-Support-system-graphite2.patch
+++ b/0021-Bug-847568-Support-system-graphite2.patch
@@ -20,10 +20,10 @@ Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
create mode 100644 gfx/graphite2/geckoextra/moz.build
diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
-index 4886a4ef96ef739ee795e0309b7783c3f33856fd..004f941135a7d1045a697182b269063f2b38ff70 100644
+index daf1222bdb06aba229ed939212763c79b935366a..4eca67cc9e6baa43e7bcf7ac057c243dbc6ccee5 100644
--- a/config/system-headers.mozbuild
+++ b/config/system-headers.mozbuild
-@@ -1244,6 +1244,12 @@ if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
+@@ -1242,6 +1242,12 @@ if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
'harfbuzz/hb.h',
]
@@ -94,7 +94,7 @@ index b91d9c161cc71e89024dad9fd87e358a147d3593..a97e6eb20322f952bd504b51faf92dc7
echo
echo If gfx/graphite2/src/files.mk has changed, please make corresponding
diff --git a/gfx/moz.build b/gfx/moz.build
-index 4c88ac6ad8cd53d7fcf89722b44ea17c88dd3242..f77097768a99a49c0aba9dbe96e67aca8e2beda5 100644
+index 6cc19f84709bbe3be4ff830e3a6dd29189048c6f..14b08dbac3e3f5d3df421d5dd6840673046d0486 100644
--- a/gfx/moz.build
+++ b/gfx/moz.build
@@ -10,6 +10,11 @@ with Files("**"):
@@ -118,7 +118,7 @@ index 4c88ac6ad8cd53d7fcf89722b44ea17c88dd3242..f77097768a99a49c0aba9dbe96e67aca
"thebes",
"ipc",
diff --git a/gfx/thebes/moz.build b/gfx/thebes/moz.build
-index 34ac0598acb48e21f866eedff83a22b5f7b244f1..a2f8bed555d8c95ad9d3b8d460d65e8f91876510 100644
+index 8af85a4ed663292583310efea06ada8c60eb908d..239579c86e3a0c5ef46c14659117a86d217eff11 100644
--- a/gfx/thebes/moz.build
+++ b/gfx/thebes/moz.build
@@ -292,7 +292,10 @@ if CONFIG["MOZ_WAYLAND"]:
@@ -134,10 +134,10 @@ index 34ac0598acb48e21f866eedff83a22b5f7b244f1..a2f8bed555d8c95ad9d3b8d460d65e8f
if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
diff --git a/old-configure.in b/old-configure.in
-index 4050cd65514b38e561751f7010d45438d2e7d5e4..aceb744de1de9044ee380528c053d958e1b037ca 100644
+index 8ff0fccfc4293ca8e148ad261bed745613c5cf74..fe93c1d49071e7c3edb9ff850c1bc92c4c2def06 100644
--- a/old-configure.in
+++ b/old-configure.in
-@@ -1185,6 +1185,27 @@ fi
+@@ -1154,6 +1154,27 @@ fi
AC_DEFINE_UNQUOTED(MOZ_MACBUNDLE_ID,$MOZ_MACBUNDLE_ID)
AC_SUBST(MOZ_MACBUNDLE_ID)
@@ -166,10 +166,10 @@ index 4050cd65514b38e561751f7010d45438d2e7d5e4..aceb744de1de9044ee380528c053d958
dnl = Child Process Name for IPC
dnl ========================================================
diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build
-index a6c079d252d153041db3ee13d0f1031e4c795d70..32c8208306be5fc2302686e681ef576e30326241 100644
+index 1d964af4f1e237ef419b15c954a5a3b663c9ce92..c139842714a0036c807859ca03b8aed8f876a895 100644
--- a/toolkit/library/moz.build
+++ b/toolkit/library/moz.build
-@@ -291,6 +291,9 @@ if CONFIG["MOZ_ANDROID_GOOGLE_VR"]:
+@@ -285,6 +285,9 @@ if CONFIG["MOZ_ANDROID_GOOGLE_VR"]:
"-lgvr",
]
@@ -180,10 +180,10 @@ index a6c079d252d153041db3ee13d0f1031e4c795d70..32c8208306be5fc2302686e681ef576e
OS_LIBS += CONFIG["MOZ_HARFBUZZ_LIBS"]
diff --git a/toolkit/moz.configure b/toolkit/moz.configure
-index 98cc8c2fb173ba3b5b70beafce37c11a037ca1a1..e2e0bc4063d460fd4a21bde7278bc26845a048ed 100644
+index 115febb3d533eb69cecbe0931b00be4e910e20de..54425af01317562fb3204fe7bc01a494b8f2167d 100644
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
-@@ -629,6 +629,19 @@ def freetype2_combined_info(fontconfig_info, freetype2_info):
+@@ -675,6 +675,19 @@ def freetype2_combined_info(fontconfig_info, freetype2_info):
set_define("MOZ_HAVE_FREETYPE2", depends_if(freetype2_info)(lambda _: True))
diff --git a/0022-Bug-1516081-Disable-watchdog-during-FDO-train.patch b/0022-Bug-1516081-Disable-watchdog-during-FDO-train.patch
deleted file mode 100644
index aa33596d87ad..000000000000
--- a/0022-Bug-1516081-Disable-watchdog-during-FDO-train.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Jan Hubicka <hubicka@ucw.cz>
-Date: Sat, 22 Dec 2018 09:32:00 +0200
-Subject: [PATCH] Bug 1516081 - Disable watchdog during FDO train
-
-Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1516081
----
- build/moz.configure/lto-pgo.configure | 4 ++--
- toolkit/components/terminator/nsTerminator.cpp | 7 +++++++
- 2 files changed, 9 insertions(+), 2 deletions(-)
-
-diff --git a/build/moz.configure/lto-pgo.configure b/build/moz.configure/lto-pgo.configure
-index de7e424326c47799b7a81f3812d5402f24b6a9f3..61310ce33a3897357a7bf75a1317c66744098c13 100644
---- a/build/moz.configure/lto-pgo.configure
-+++ b/build/moz.configure/lto-pgo.configure
-@@ -85,7 +85,7 @@ def pgo_flags(compiler, profdata, target_is_windows):
- if compiler.type == "gcc":
- profile_use = "-fprofile-use"
- return namespace(
-- gen_cflags=["-fprofile-generate"],
-+ gen_cflags=["-fprofile-generate", "-DMOZ_PROFILE_INSTRUMENTATION"],
- gen_ldflags=["-fprofile-generate"],
- use_cflags=[profile_use, "-fprofile-correction", "-Wcoverage-mismatch"],
- use_ldflags=[profile_use],
-@@ -99,7 +99,7 @@ def pgo_flags(compiler, profdata, target_is_windows):
- else:
- gen_ldflags = ["-fprofile-generate"]
-
-- gen_cflags = [prefix + "-fprofile-generate"]
-+ gen_cflags = [prefix + "-fprofile-generate", "-DMOZ_PROFILE_INSTRUMENTATION"]
- if target_is_windows:
- # native llvm-profdata.exe on Windows can't read profile data
- # if name compression is enabled (which cross-compiling enables
-diff --git a/toolkit/components/terminator/nsTerminator.cpp b/toolkit/components/terminator/nsTerminator.cpp
-index 3a8f9f4ba63e64695083a70ccfe38cc8baeb7654..b96d9ef138b42fb114d755218c2622b40d6a3bee 100644
---- a/toolkit/components/terminator/nsTerminator.cpp
-+++ b/toolkit/components/terminator/nsTerminator.cpp
-@@ -460,6 +460,13 @@ void nsTerminator::StartWatchdog() {
- }
- #endif
-
-+ // Disable watchdog for PGO train builds - writting profile information at
-+ // exit may take time and it is better to make build hang rather than
-+ // silently produce poorly performing binary.
-+#ifdef MOZ_PROFILE_INSTRUMENTATION
-+ crashAfterMS = INT32_MAX;
-+#endif
-+
- UniquePtr<Options> options(new Options());
- // crashAfterTicks is guaranteed to be > 0 as
- // crashAfterMS >= ADDITIONAL_WAIT_BEFORE_CRASH_MS >> HEARTBEAT_INTERVAL_MS
diff --git a/0026-Bug-1611386-Reenable-support-for-enable-system-sqlit.patch b/0022-Bug-1611386-Reenable-support-for-enable-system-sqlit.patch
index f1a4f4c63bd9..2e4c66e0c3ef 100644
--- a/0026-Bug-1611386-Reenable-support-for-enable-system-sqlit.patch
+++ b/0022-Bug-1611386-Reenable-support-for-enable-system-sqlit.patch
@@ -13,21 +13,21 @@ This reverts commit b5b6473a6d6d59e1361e529db9b8b6e1f7448f29.
Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
---
browser/installer/package-manifest.in | 2 ++
- config/external/sqlite/moz.build | 22 +++++++++------
- storage/SQLiteMutex.h | 6 ++--
- storage/moz.build | 6 ++++
- storage/mozStorageConnection.cpp | 4 +++
- storage/mozStorageService.cpp | 39 ++++++++++++++++++++++++++
+ config/external/sqlite/moz.build | 22 +++++++++++++---------
+ storage/SQLiteMutex.h | 6 +++---
+ storage/moz.build | 6 ++++++
+ storage/mozStorageConnection.cpp | 4 ++++
+ storage/mozStorageService.cpp | 26 ++++++++++++++++++++++++++
third_party/sqlite3/src/moz.build | 2 ++
- third_party/sqlite3/src/sqlite.symbols | 1 +
- toolkit/moz.configure | 14 +++++++++
- 9 files changed, 84 insertions(+), 12 deletions(-)
+ third_party/sqlite3/src/sqlite.symbols | 2 --
+ toolkit/moz.configure | 14 ++++++++++++++
+ 9 files changed, 70 insertions(+), 14 deletions(-)
diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in
-index 9229a0bd0e041815331aaf2973afda22c007423d..42e26fafdf7e90a5fbda3d798d1e1d807a5b4a69 100644
+index ce036fcdc55dc5b42709364775eeb779d64ee62c..ee420cf6363d598cd20b37bef6199dbe77f605c0 100644
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
-@@ -143,9 +143,11 @@
+@@ -147,9 +147,11 @@
@RESPATH@/update-settings.ini
#endif
@RESPATH@/platform.ini
@@ -104,10 +104,10 @@ index b7198b1912fdc8d1182a445421aec3450474c23d..3ecc0bb997cf376e996bff2d9c184ecf
// treat them as such.
Release(); // Call is protected by us holding the mutex.
diff --git a/storage/moz.build b/storage/moz.build
-index 3d8b15e9c7f3f67bc61ffc72db5f28fe2f44ba06..7cbecf3314b61179db355f80c5cc3d9de75eb4ab 100644
+index 9cefe26ec0c83fc6f9fbce3fee6604c86a10fc98..1c473a5c3adf605eb8ceeeed28923a4b5f38d4a1 100644
--- a/storage/moz.build
+++ b/storage/moz.build
-@@ -100,6 +100,12 @@ if CONFIG["MOZ_THUNDERBIRD"] or CONFIG["MOZ_SUITE"]:
+@@ -101,6 +101,12 @@ if CONFIG["MOZ_THUNDERBIRD"] or CONFIG["MOZ_SUITE"]:
# will need to change it here as well.
DEFINES["SQLITE_MAX_LIKE_PATTERN_LENGTH"] = 50000
@@ -121,10 +121,10 @@ index 3d8b15e9c7f3f67bc61ffc72db5f28fe2f44ba06..7cbecf3314b61179db355f80c5cc3d9d
"/dom/base",
"/third_party/sqlite3/src",
diff --git a/storage/mozStorageConnection.cpp b/storage/mozStorageConnection.cpp
-index 0f0d76839114d22eef341190b982ad4f386909ae..bce31015580acd68ba90ea1d5efef1bb18a40d6b 100644
+index 0398124f6ad233acef7625aac81c4f1162ff7d46..7a98488181763fdac3b3df0116a73592d8df6ea0 100644
--- a/storage/mozStorageConnection.cpp
+++ b/storage/mozStorageConnection.cpp
-@@ -869,6 +869,10 @@ nsresult Connection::initializeInternal() {
+@@ -1041,6 +1041,10 @@ nsresult Connection::initializeInternal() {
return convertResultCode(srv);
}
@@ -136,31 +136,18 @@ index 0f0d76839114d22eef341190b982ad4f386909ae..bce31015580acd68ba90ea1d5efef1bb
srv = registerFunctions(mDBConn);
if (srv != SQLITE_OK) {
diff --git a/storage/mozStorageService.cpp b/storage/mozStorageService.cpp
-index 73cf85ff197d877d42a60f4c7606ac4ca43d3ab5..e1cc43d9c060517c8b385c15ba6dab8ffb61bd9c 100644
+index 6427fef6529fa2959100c3b5b1c7b82ae0f6961e..6081bf0d89a538f8002e2a8f728d6cafff486ee3 100644
--- a/storage/mozStorageService.cpp
+++ b/storage/mozStorageService.cpp
-@@ -35,6 +35,20 @@
-
- using mozilla::intl::Collator;
-
+@@ -18,6 +18,7 @@
+ #include "mozStoragePrivateHelpers.h"
+ #include "nsIObserverService.h"
+ #include "nsIPropertyBag2.h"
+#include "nsIPromptService.h"
-+
-+////////////////////////////////////////////////////////////////////////////////
-+//// Defines
-+
-+#define PREF_TS_SYNCHRONOUS "toolkit.storage.synchronous"
-+#define PREF_TS_SYNCHRONOUS_DEFAULT 1
-+
-+#define PREF_TS_PAGESIZE "toolkit.storage.pageSize"
-+
-+// This value must be kept in sync with the value of SQLITE_DEFAULT_PAGE_SIZE in
-+// third_party/sqlite3/src/Makefile.in.
-+#define PREF_TS_PAGESIZE_DEFAULT 32768
-+
- namespace mozilla {
- namespace storage {
-
-@@ -167,6 +181,31 @@ already_AddRefed<Service> Service::getSingleton() {
+ #include "mozilla/Services.h"
+ #include "mozilla/LateWriteChecks.h"
+ #include "mozIStorageCompletionCallback.h"
+@@ -167,6 +168,31 @@ already_AddRefed<Service> Service::getSingleton() {
return do_AddRef(gService);
}
@@ -193,10 +180,10 @@ index 73cf85ff197d877d42a60f4c7606ac4ca43d3ab5..e1cc43d9c060517c8b385c15ba6dab8f
// main thread.
NS_ENSURE_TRUE(NS_IsMainThread(), nullptr);
diff --git a/third_party/sqlite3/src/moz.build b/third_party/sqlite3/src/moz.build
-index 0742b37700999fac57077eebaae21f1c94ea3990..6c03d19006088448e91b57af42d18e2236ecc208 100644
+index ff363c12935cd42ad40051627c287006f4c6be15..9242bb241e294745c45412c1db5f1cf293b26d0f 100644
--- a/third_party/sqlite3/src/moz.build
+++ b/third_party/sqlite3/src/moz.build
-@@ -79,6 +79,7 @@ DEFINES['SQLITE_OMIT_BUILTIN_TEST'] = True
+@@ -81,6 +81,7 @@ DEFINES['SQLITE_OMIT_BUILTIN_TEST'] = True
# Try to use a MEMORY temp store when possible. That allows for better
# performance and doesn't suffer from a full separate tmp partition.
# Exclude 32bit platforms due to address space fragmentation issues.
@@ -204,7 +191,7 @@ index 0742b37700999fac57077eebaae21f1c94ea3990..6c03d19006088448e91b57af42d18e22
if CONFIG['OS_TARGET'] == 'Android':
# On Android there's no tmp partition, so always use a MEMORY temp store.
DEFINES['SQLITE_TEMP_STORE'] = 3
-@@ -88,6 +89,7 @@ elif CONFIG['HAVE_64BIT_BUILD']:
+@@ -90,6 +91,7 @@ elif CONFIG['HAVE_64BIT_BUILD']:
# Change the default temp files prefix, to easily distinguish files we created
# vs files created by other Sqlite instances in the system.
@@ -213,22 +200,24 @@ index 0742b37700999fac57077eebaae21f1c94ea3990..6c03d19006088448e91b57af42d18e22
# Enabling sqlite math functions
diff --git a/third_party/sqlite3/src/sqlite.symbols b/third_party/sqlite3/src/sqlite.symbols
-index 4ee20bc0d53556e9713f49f9b70ee30b45a138f8..903d6b29f62528b6ecd762ef69fb5f206cc87fde 100644
+index fc576f30bc6a47db5c8bfbaa77bb117f1bd68011..903d6b29f62528b6ecd762ef69fb5f206cc87fde 100644
--- a/third_party/sqlite3/src/sqlite.symbols
+++ b/third_party/sqlite3/src/sqlite.symbols
-@@ -39,6 +39,7 @@ sqlite3_column_text16
+@@ -39,9 +39,7 @@ sqlite3_column_text16
sqlite3_column_type
sqlite3_column_value
sqlite3_commit_hook
-+sqlite3_compileoption_used
+-#ifdef DEBUG
+ sqlite3_compileoption_used
+-#endif
sqlite3_complete
sqlite3_complete16
sqlite3_config
diff --git a/toolkit/moz.configure b/toolkit/moz.configure
-index e2e0bc4063d460fd4a21bde7278bc26845a048ed..be091370a786c902a736a2950c01a0c50bc30748 100644
+index 54425af01317562fb3204fe7bc01a494b8f2167d..dd9583868a0e15e5c3f4c56852531ff6fbe921eb 100644
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
-@@ -378,6 +378,20 @@ sndio = pkg_check_modules("MOZ_SNDIO", "sndio", when="--enable-sndio")
+@@ -377,6 +377,20 @@ sndio = pkg_check_modules("MOZ_SNDIO", "sndio", when="--enable-sndio")
set_config("MOZ_SNDIO", depends_if(sndio)(lambda _: True))
diff --git a/0027-Bug-1419151-Add-Unity-menubar-support.patch b/0023-Bug-1419151-Add-Unity-menubar-support.patch
index eb1ddf06858b..bcb71037c181 100644
--- a/0027-Bug-1419151-Add-Unity-menubar-support.patch
+++ b/0023-Bug-1419151-Add-Unity-menubar-support.patch
@@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Chris Coulson <chrisccoulson@ubuntu.com>
-Date: Wed, 26 Apr 2017 00:48:46 +0300
+From: =?UTF-8?q?Bj=C3=B6rn=20Bidar?= <bjorn.bidar@jolla.com>
+Date: Wed, 3 May 2023 01:17:06 +0300
Subject: [PATCH] Bug 1419151 - Add Unity menubar support
---
@@ -11,7 +11,7 @@ Subject: [PATCH] Bug 1419151 - Add Unity menubar support
dom/xul/moz.build | 5 +
layout/build/moz.build | 4 +
modules/libpref/init/all.js | 3 +
- toolkit/content/xul.css | 7 +
+ toolkit/content/xul.css | 14 +
widget/gtk/NativeMenuSupport.cpp | 11 +-
widget/gtk/NativeMenuSupport.h | 31 +
widget/gtk/components.conf | 8 +
@@ -26,7 +26,7 @@ Subject: [PATCH] Bug 1419151 - Add Unity menubar support
widget/gtk/nsMenuContainer.h | 70 ++
widget/gtk/nsMenuItem.cpp | 766 +++++++++++++++++
widget/gtk/nsMenuItem.h | 80 ++
- widget/gtk/nsMenuObject.cpp | 664 +++++++++++++++
+ widget/gtk/nsMenuObject.cpp | 653 ++++++++++++++
widget/gtk/nsMenuObject.h | 169 ++++
widget/gtk/nsMenuSeparator.cpp | 82 ++
widget/gtk/nsMenuSeparator.h | 37 +
@@ -42,7 +42,7 @@ Subject: [PATCH] Bug 1419151 - Add Unity menubar support
xpcom/ds/NativeMenuAtoms.py | 9 +
xpcom/ds/StaticAtoms.py | 3 +-
xpfe/appshell/AppWindow.cpp | 2 +-
- 38 files changed, 5014 insertions(+), 4 deletions(-)
+ 38 files changed, 5010 insertions(+), 4 deletions(-)
create mode 100644 widget/gtk/NativeMenuSupport.h
create mode 100644 widget/gtk/nsDbusmenu.cpp
create mode 100644 widget/gtk/nsDbusmenu.h
@@ -66,7 +66,7 @@ Subject: [PATCH] Bug 1419151 - Add Unity menubar support
create mode 100644 xpcom/ds/NativeMenuAtoms.py
diff --git a/browser/base/content/browser-menubar.inc b/browser/base/content/browser-menubar.inc
-index 443c9fa5a5420098226a1a6144a44781c4bf92f8..60b8a311912d83bcf23e5e34698c4951023cfc48 100644
+index fca2398bfc97aad365d3b446fab06f2a7863948e..fe057e454e9fcfa04db17d44306357a7f82f1019 100644
--- a/browser/base/content/browser-menubar.inc
+++ b/browser/base/content/browser-menubar.inc
@@ -7,7 +7,12 @@
@@ -84,10 +84,10 @@ index 443c9fa5a5420098226a1a6144a44781c4bf92f8..60b8a311912d83bcf23e5e34698c4951
event.target.parentNode.openedWithKey);"
#endif
diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js
-index 5b846c657b2864c6951d343a62f8ae70d823d1b4..76a8f72df1daa231136e2187269785c2290985b4 100644
+index 81fd02efc6461c052101169415f4015003b77590..eec0cc5b0e402f113052635781c806c290df3acc 100644
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
-@@ -6534,11 +6534,18 @@ function onViewToolbarsPopupShowing(aEvent, aInsertPoint) {
+@@ -6298,11 +6298,18 @@ function onViewToolbarsPopupShowing(aEvent, aInsertPoint) {
MozXULElement.insertFTLIfNeeded("browser/toolbarContextMenu.ftl");
let firstMenuItem = aInsertPoint || popup.firstElementChild;
let toolbarNodes = gNavToolbox.querySelectorAll("toolbar");
@@ -107,10 +107,10 @@ index 5b846c657b2864c6951d343a62f8ae70d823d1b4..76a8f72df1daa231136e2187269785c2
let menu = BookmarkingUI.buildBookmarksToolbarSubmenu(toolbar);
popup.insertBefore(menu, firstMenuItem);
diff --git a/browser/components/places/content/places.xhtml b/browser/components/places/content/places.xhtml
-index 4ab16218d469dfe679a04a6b1f1d12935bf7bc44..3d010c5ca233e6a1fe4d6077bd28537465de0c19 100644
+index 0d5889651ee1f07218be19530754dacaf1311174..4412fe92b588d22d0aebc1af160a0ac7641cdeb2 100644
--- a/browser/components/places/content/places.xhtml
+++ b/browser/components/places/content/places.xhtml
-@@ -169,6 +169,7 @@
+@@ -160,6 +160,7 @@
#else
<menubar id="placesMenu">
<menu class="menu-iconic" data-l10n-id="places-organize-button"
@@ -119,10 +119,10 @@ index 4ab16218d469dfe679a04a6b1f1d12935bf7bc44..3d010c5ca233e6a1fe4d6077bd285374
id="organizeButton">
<menupopup id="organizeButtonPopup">
diff --git a/dom/xul/XULPopupElement.cpp b/dom/xul/XULPopupElement.cpp
-index c329526a3f418092eed614fe5dab5b61713ea142..85fab2f1f056238d6fc75ececcc1f02c47ce693a 100644
+index d60173900ec1e32fe7b60fecab657fb7bb875f0e..ffdf4d53135576a5723c03f0f6be09edafd5afdb 100644
--- a/dom/xul/XULPopupElement.cpp
+++ b/dom/xul/XULPopupElement.cpp
-@@ -241,6 +241,10 @@ void XULPopupElement::GetState(nsString& aState) {
+@@ -238,6 +238,10 @@ void XULPopupElement::GetState(nsString& aState) {
// set this here in case there's no frame for the popup
aState.AssignLiteral("closed");
@@ -133,7 +133,7 @@ index c329526a3f418092eed614fe5dab5b61713ea142..85fab2f1f056238d6fc75ececcc1f02c
if (nsXULPopupManager* pm = nsXULPopupManager::GetInstance()) {
switch (pm->GetPopupState(this)) {
case ePopupShown:
-@@ -263,6 +267,11 @@ void XULPopupElement::GetState(nsString& aState) {
+@@ -260,6 +264,11 @@ void XULPopupElement::GetState(nsString& aState) {
break;
}
}
@@ -160,10 +160,10 @@ index 6057c71aa56d9cc7ceac3e0a6fbe29ef4761e953..a24f53f657a8737b569c0dbb49b348b5
+
FINAL_LIBRARY = "xul"
diff --git a/layout/build/moz.build b/layout/build/moz.build
-index c7869a01a373d2708e7b467f6c287b44712679bd..2cbdb021b3b7ea742e7505ef3ae046cdc33e6144 100644
+index b2059e396efec51ec515540e69adfd18a74a906f..5f00ef562b374aa5d1d5792240395c4a87babef1 100644
--- a/layout/build/moz.build
+++ b/layout/build/moz.build
-@@ -70,6 +70,10 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
+@@ -69,6 +69,10 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
"/dom/system",
"/dom/system/android",
]
@@ -175,10 +175,10 @@ index c7869a01a373d2708e7b467f6c287b44712679bd..2cbdb021b3b7ea742e7505ef3ae046cd
XPCOM_MANIFESTS += [
"components.conf",
diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js
-index 35dc85223333f510b7dd7b96739738b0f8a1629a..c339b67928703b479a2c3b985ee8b0e3975ff499 100644
+index 6a02e703ddf31424b1c566a2e4277ad8be7fddd9..dc8c9ea830cdbbaa01fd1007b642dde08f097bf8 100644
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
-@@ -183,6 +183,9 @@ pref("dom.text-recognition.enabled", true);
+@@ -167,6 +167,9 @@ pref("dom.text-recognition.enabled", true);
// Fastback caching - if this pref is negative, then we calculate the number
// of content viewers to cache based on the amount of available memory.
pref("browser.sessionhistory.max_total_viewers", -1);
@@ -186,13 +186,13 @@ index 35dc85223333f510b7dd7b96739738b0f8a1629a..c339b67928703b479a2c3b985ee8b0e3
+pref("ui.use_unity_menubar", true);
+#endif
- pref("browser.display.force_inline_alttext", false); // true = force ALT text for missing images to be layed out inline
- // 0 = no external leading,
+ // See http://whatwg.org/specs/web-apps/current-work/#ping
+ pref("browser.send_pings", false);
diff --git a/toolkit/content/xul.css b/toolkit/content/xul.css
-index 8fc0ec1d5c3db655b7f43461e37d791744c5f777..54c3f7d0dd23b0d09585b0bf30116b8090d0b466 100644
+index 7a5af54b4e3a2e09f2c2c65cde5bd9c0737ae77a..8fe62da604822da9d21d3e80c46aafd59836143e 100644
--- a/toolkit/content/xul.css
+++ b/toolkit/content/xul.css
-@@ -329,6 +329,13 @@ toolbox {
+@@ -337,6 +337,20 @@ toolbox {
}
}
@@ -203,8 +203,15 @@ index 8fc0ec1d5c3db655b7f43461e37d791744c5f777..54c3f7d0dd23b0d09585b0bf30116b80
+}
+}
+
++@media (-moz-platform: linux) {
++*|*:root[shellshowingmenubar="true"]
++toolbar[type="menubar"]:not([customizing="true"]) {
++ display: none !important;
++}
++}
++
toolbarspring {
- -moz-box-flex: 1000;
+ flex: 1000 1000;
}
diff --git a/widget/gtk/NativeMenuSupport.cpp b/widget/gtk/NativeMenuSupport.cpp
index 4360867fff3f849fa6bdec31f05ddbfe60777180..c3a69f31b1d310340a2546da541dda544a8056d3 100644
@@ -292,10 +299,10 @@ index a2759a3c45cc020f54799ce61151dd45c03210fd..17c040e3ef6c2ddf2d876b3b5954ca8d
if defined('NS_PRINTING'):
diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build
-index ab248309f25071ceeaec108797dcc62f905c84d8..d60d1995b27850009faccbb98351bf6fe9f7b802 100644
+index 90cd17a0982b980dfb313fc34aba69ceddcbe9d7..c6a765df9e5a4c95f77e9ee1b4ebbf9913a81e15 100644
--- a/widget/gtk/moz.build
+++ b/widget/gtk/moz.build
-@@ -78,6 +78,15 @@ UNIFIED_SOURCES += [
+@@ -100,6 +100,15 @@ UNIFIED_SOURCES += [
SOURCES += [
"MediaKeysEventSourceFactory.cpp",
@@ -311,7 +318,7 @@ index ab248309f25071ceeaec108797dcc62f905c84d8..d60d1995b27850009faccbb98351bf6f
"nsNativeThemeGTK.cpp", # conflicts with X11 headers
"nsWindow.cpp", # conflicts with X11 headers
"WaylandVsyncSource.cpp", # conflicts with X11 headers
-@@ -149,6 +158,7 @@ LOCAL_INCLUDES += [
+@@ -148,6 +157,7 @@ LOCAL_INCLUDES += [
"/layout/base",
"/layout/forms",
"/layout/generic",
@@ -1425,7 +1432,7 @@ index 0000000000000000000000000000000000000000..40244d0122901dc77aa4c709e5a66efa
+#endif /* __nsMenu_h__ */
diff --git a/widget/gtk/nsMenuBar.cpp b/widget/gtk/nsMenuBar.cpp
new file mode 100644
-index 0000000000000000000000000000000000000000..0dcae67943292aeb5d70dfbe652fb95191040484
+index 0000000000000000000000000000000000000000..71834e55fad6444caa545e15c3b27915f9b4a77b
--- /dev/null
+++ b/widget/gtk/nsMenuBar.cpp
@@ -0,0 +1,548 @@
@@ -1621,7 +1628,7 @@ index 0000000000000000000000000000000000000000..0dcae67943292aeb5d70dfbe652fb951
+
+ mEventListener = new DocEventListener(this);
+
-+ mDocument = do_QueryInterface(ContentNode()->OwnerDoc());
++ mDocument = ContentNode()->OwnerDoc();
+
+ mAccessKey = Preferences::GetInt("ui.key.menuAccessKey");
+ if (mAccessKey == dom::KeyboardEvent_Binding::DOM_VK_SHIFT) {
@@ -3206,10 +3213,10 @@ index 0000000000000000000000000000000000000000..c621b4e223f1709b2b3e9c1c27affe2c
+#endif /* __nsMenuItem_h__ */
diff --git a/widget/gtk/nsMenuObject.cpp b/widget/gtk/nsMenuObject.cpp
new file mode 100644
-index 0000000000000000000000000000000000000000..60ff3cbe86a76c5bc01af925d6a197e9ffe23517
+index 0000000000000000000000000000000000000000..6e622a80fab852ca67fe9e77ffbc78d805844bc9
--- /dev/null
+++ b/widget/gtk/nsMenuObject.cpp
-@@ -0,0 +1,664 @@
+@@ -0,0 +1,653 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* vim:expandtab:shiftwidth=4:tabstop=4:
+ */
@@ -3294,7 +3301,6 @@ index 0000000000000000000000000000000000000000..60ff3cbe86a76c5bc01af925d6a197e9
+ nsMenuObject *mOwner;
+ RefPtr<imgRequestProxy> mImageRequest;
+ nsCOMPtr<nsIURI> mURI;
-+ nsIntRect mImageRect;
+};
+
+NS_IMPL_ISUPPORTS(nsMenuObjectIconLoader, imgINotificationObserver)
@@ -3348,10 +3354,6 @@ index 0000000000000000000000000000000000000000..60ff3cbe86a76c5bc01af925d6a197e9
+ return;
+ }
+
-+ if (!mImageRect.IsEmpty()) {
-+ img = ImageOps::Clip(img, mImageRect);
-+ }
-+
+ int32_t width, height;
+ img->GetWidth(&width);
+ img->GetHeight(&height);
@@ -3386,7 +3388,6 @@ index 0000000000000000000000000000000000000000..60ff3cbe86a76c5bc01af925d6a197e9
+ dom::Document *doc = mOwner->ContentNode()->OwnerDoc();
+
+ nsCOMPtr<nsIURI> uri;
-+ nsIntRect imageRect;
+ imgRequestProxy *imageRequest = nullptr;
+
+ nsAutoString uriString;
@@ -3409,9 +3410,6 @@ index 0000000000000000000000000000000000000000..60ff3cbe86a76c5bc01af925d6a197e9
+ imageRequest = list->mListStyleImage.GetImageRequest();
+ if (imageRequest) {
+ imageRequest->GetURI(getter_AddRefs(uri));
-+ auto& rect = list->mImageRegion.AsRect();
-+ imageRect = rect.ToLayoutRect().ToNearestPixels(
-+ pc->AppUnitsPerDevPixel());
+ }
+ }
+
@@ -3429,7 +3427,7 @@ index 0000000000000000000000000000000000000000..60ff3cbe86a76c5bc01af925d6a197e9
+
+ bool same;
+ if (mURI && NS_SUCCEEDED(mURI->Equals(uri, &same)) && same &&
-+ (!imageRequest || imageRect == mImageRect)) {
++ !imageRequest) {
+ return;
+ }
+
@@ -3441,10 +3439,8 @@ index 0000000000000000000000000000000000000000..60ff3cbe86a76c5bc01af925d6a197e9
+ mURI = uri;
+
+ if (imageRequest) {
-+ mImageRect = imageRect;
+ imageRequest->Clone(this, nullptr, getter_AddRefs(mImageRequest));
+ } else {
-+ mImageRect.SetEmpty();
+ nsCOMPtr<nsILoadGroup> loadGroup = doc->GetDocumentLoadGroup();
+ RefPtr<imgLoader> loader =
+ nsContentUtils::GetImgLoaderForDocument(doc);
@@ -5267,10 +5263,10 @@ index 0000000000000000000000000000000000000000..2e0d429eddfdfc84620834eced6b9733
+
+#endif /* __nsNativeMenuService_h__ */
diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp
-index b77fadc1faffb5d75a1c7e53efbacfb13050b533..316f2055828cf49108f519f7bb020ec704707a38 100644
+index 9cc6e8a1aebf69b4d720da7745d08b929f46b13e..7c5cade259877d4ea429f4385bb2278776ab1946 100644
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
-@@ -7418,6 +7418,10 @@ void nsWindow::HideWindowChrome(bool aShouldHide) {
+@@ -7481,6 +7481,10 @@ void nsWindow::HideWindowChrome(bool aShouldHide) {
SetWindowDecoration(aShouldHide ? BorderStyle::None : mBorderStyle);
}
@@ -5282,7 +5278,7 @@ index b77fadc1faffb5d75a1c7e53efbacfb13050b533..316f2055828cf49108f519f7bb020ec7
bool aAlwaysRollup) {
LOG("nsWindow::CheckForRollup() aAlwaysRollup %d", aAlwaysRollup);
diff --git a/widget/gtk/nsWindow.h b/widget/gtk/nsWindow.h
-index 1ae9b3f12616b2bf1d6f6fdd1a198f9f06ef3796..03e4c18810672ce620ac1f22a508a132f9fe9840 100644
+index fa90621be4785a84950e7d80333acde7eb676a16..c815ca73b11bc59cfc56544f37e3b04fa0e08145 100644
--- a/widget/gtk/nsWindow.h
+++ b/widget/gtk/nsWindow.h
@@ -27,6 +27,8 @@
@@ -5294,7 +5290,7 @@ index 1ae9b3f12616b2bf1d6f6fdd1a198f9f06ef3796..03e4c18810672ce620ac1f22a508a132
#ifdef ACCESSIBILITY
# include "mozilla/a11y/LocalAccessible.h"
#endif
-@@ -205,6 +207,8 @@ class nsWindow final : public nsBaseWidget {
+@@ -208,6 +210,8 @@ class nsWindow final : public nsBaseWidget {
nsresult MakeFullScreen(bool aFullScreen) override;
void HideWindowChrome(bool aShouldHide) override;
@@ -5303,7 +5299,7 @@ index 1ae9b3f12616b2bf1d6f6fdd1a198f9f06ef3796..03e4c18810672ce620ac1f22a508a132
/**
* GetLastUserInputTime returns a timestamp for the most recent user input
* event. This is intended for pointer grab requests (including drags).
-@@ -924,6 +928,8 @@ class nsWindow final : public nsBaseWidget {
+@@ -927,6 +931,8 @@ class nsWindow final : public nsBaseWidget {
static bool sTransparentMainWindow;
@@ -5313,10 +5309,10 @@ index 1ae9b3f12616b2bf1d6f6fdd1a198f9f06ef3796..03e4c18810672ce620ac1f22a508a132
RefPtr<mozilla::a11y::LocalAccessible> mRootAccessible;
diff --git a/widget/moz.build b/widget/moz.build
-index f83f84297c4a8754aec0b0de0b5489984e628ed7..5f13aef4bffbb8b4c5422d5ee0b5315fc6d40fc5 100644
+index e235869060ddcf5928068b05610d8817ce3a282c..9f02918e65992fb50daca4ca3447bef7e95a6a94 100644
--- a/widget/moz.build
+++ b/widget/moz.build
-@@ -163,6 +163,11 @@ EXPORTS += [
+@@ -164,6 +164,11 @@ EXPORTS += [
"PuppetWidget.h",
]
@@ -5327,7 +5323,7 @@ index f83f84297c4a8754aec0b0de0b5489984e628ed7..5f13aef4bffbb8b4c5422d5ee0b5315f
+
EXPORTS.mozilla += [
"BasicEvents.h",
- "ColorScheme.h",
+ "ClipboardWriteRequestChild.h",
diff --git a/widget/nsINativeMenuService.h b/widget/nsINativeMenuService.h
new file mode 100644
index 0000000000000000000000000000000000000000..e92d7a74a3bc508ee702a1699b9e484a6031c52a
@@ -5408,7 +5404,7 @@ index 0000000000000000000000000000000000000000..488c8f49c0217890d2c5a12f57fdc194
+ Atom("shellshowingmenubar", "shellshowingmenubar"),
+]
diff --git a/xpcom/ds/StaticAtoms.py b/xpcom/ds/StaticAtoms.py
-index f377159185a9b622071e811ec41a7ec30dbd0760..bba8cc8db6e1ed9e8afe0e60c9a6f782f3714894 100644
+index 2fbb11fd7b34fa4011dc991a583b5fa5872589ed..e32fa2cb9a881e75459df5bdcd496bad528ccdf6 100644
--- a/xpcom/ds/StaticAtoms.py
+++ b/xpcom/ds/StaticAtoms.py
@@ -13,6 +13,7 @@ from Atom import (
@@ -5419,7 +5415,7 @@ index f377159185a9b622071e811ec41a7ec30dbd0760..bba8cc8db6e1ed9e8afe0e60c9a6f782
# Static atom definitions, used to generate nsGkAtomList.h.
#
-@@ -2563,7 +2564,7 @@ STATIC_ATOMS = [
+@@ -2550,7 +2551,7 @@ STATIC_ATOMS = [
InheritingAnonBoxAtom("AnonBox_mozSVGForeignContent", ":-moz-svg-foreign-content"),
InheritingAnonBoxAtom("AnonBox_mozSVGText", ":-moz-svg-text"),
# END ATOMS
@@ -5429,7 +5425,7 @@ index f377159185a9b622071e811ec41a7ec30dbd0760..bba8cc8db6e1ed9e8afe0e60c9a6f782
diff --git a/xpfe/appshell/AppWindow.cpp b/xpfe/appshell/AppWindow.cpp
-index 71f790f347e06a2915822455b60a4d09c3bf5d68..3ef80f1727eced1fe1deb3f6a1bdc6ff48ac1c7b 100644
+index 3ecd6d18d7241967cea20862c198d09336a74bf1..e90165545ce5a1f7d6ee11896bd1ab74cb3bdbd9 100644
--- a/xpfe/appshell/AppWindow.cpp
+++ b/xpfe/appshell/AppWindow.cpp
@@ -78,7 +78,7 @@
diff --git a/0028-Do-not-use-gconf-for-proxy-settings-if-not-running-w.patch b/0024-Do-not-use-gconf-for-proxy-settings-if-not-running-w.patch
index c1a6d30860a8..c1a6d30860a8 100644
--- a/0028-Do-not-use-gconf-for-proxy-settings-if-not-running-w.patch
+++ b/0024-Do-not-use-gconf-for-proxy-settings-if-not-running-w.patch
diff --git a/0025-Add-KDE-integration-to-Firefox-toolkit-parts.patch b/0025-Add-KDE-integration-to-Firefox-toolkit-parts.patch
new file mode 100644
index 000000000000..c8cbf2bbf019
--- /dev/null
+++ b/0025-Add-KDE-integration-to-Firefox-toolkit-parts.patch
@@ -0,0 +1,1442 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Wolfgang Rosenauer <wolfgang@rosenauer.org>
+Date: Tue, 8 Aug 2023 16:13:48 +0300
+Subject: [PATCH] Add KDE integration to Firefox (toolkit parts)
+
+Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=140751
+Bug: https://bugzilla.suse.com/show_bug.cgi?id=170055
+
+Co-authored-by: Wolfgang Rosenauer <wolfgang@rosenauer.org>
+Co-authored-by: Lubos Lunak <lunak@suse.com>
+---
+ modules/libpref/Preferences.cpp | 13 +-
+ modules/libpref/moz.build | 4 +
+ python/mozbuild/mozpack/chrome/flags.py | 1 +
+ python/mozbuild/mozpack/chrome/manifest.py | 1 +
+ toolkit/components/downloads/moz.build | 4 +
+ .../mozapps/downloads/HelperAppDlg.sys.mjs | 70 +++--
+ .../unixproxy/nsUnixSystemProxySettings.cpp | 29 ++
+ toolkit/xre/moz.build | 2 +
+ toolkit/xre/nsKDEUtils.cpp | 286 ++++++++++++++++++
+ toolkit/xre/nsKDEUtils.h | 53 ++++
+ uriloader/exthandler/HandlerServiceParent.cpp | 6 +-
+ uriloader/exthandler/moz.build | 3 +
+ .../exthandler/unix/nsCommonRegistry.cpp | 42 +++
+ uriloader/exthandler/unix/nsCommonRegistry.h | 28 ++
+ uriloader/exthandler/unix/nsKDERegistry.cpp | 75 +++++
+ uriloader/exthandler/unix/nsKDERegistry.h | 35 +++
+ uriloader/exthandler/unix/nsMIMEInfoUnix.cpp | 28 +-
+ .../exthandler/unix/nsOSHelperAppService.cpp | 10 +-
+ widget/gtk/moz.build | 1 +
+ widget/gtk/nsFilePicker.cpp | 230 +++++++++++++-
+ widget/gtk/nsFilePicker.h | 6 +
+ xpcom/components/ManifestParser.cpp | 10 +
+ xpcom/components/moz.build | 1 +
+ xpcom/io/nsLocalFileUnix.cpp | 20 +-
+ 24 files changed, 921 insertions(+), 37 deletions(-)
+ create mode 100644 toolkit/xre/nsKDEUtils.cpp
+ create mode 100644 toolkit/xre/nsKDEUtils.h
+ create mode 100644 uriloader/exthandler/unix/nsCommonRegistry.cpp
+ create mode 100644 uriloader/exthandler/unix/nsCommonRegistry.h
+ create mode 100644 uriloader/exthandler/unix/nsKDERegistry.cpp
+ create mode 100644 uriloader/exthandler/unix/nsKDERegistry.h
+
+diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp
+index 9e0853d1a5b7cf9dd05a15db3499dd18fcf73803..1ab9be4e7415ddd19f393b6856c13c462059b111 100644
+--- a/modules/libpref/Preferences.cpp
++++ b/modules/libpref/Preferences.cpp
+@@ -95,6 +95,7 @@
+ #ifdef MOZ_BACKGROUNDTASKS
+ # include "mozilla/BackgroundTasks.h"
+ #endif
++#include "nsKDEUtils.h"
+
+ #ifdef DEBUG
+ # include <map>
+@@ -4906,6 +4907,16 @@ nsresult Preferences::InitInitialObjects(bool aIsStartup) {
+ #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";
++ break;
++ }
++ }
++ }
++
+ rv = pref_LoadPrefsInDir(defaultPrefDir, specialFiles,
+ ArrayLength(specialFiles));
+ if (NS_FAILED(rv)) {
+@@ -4980,7 +4991,7 @@ nsresult Preferences::InitInitialObjects(bool aIsStartup) {
+ }
+
+ // Do we care if a file provided by this process fails to load?
+- pref_LoadPrefsInDir(path, nullptr, 0);
++ pref_LoadPrefsInDir(path, specialFiles, ArrayLength(specialFiles));
+ }
+ }
+
+diff --git a/modules/libpref/moz.build b/modules/libpref/moz.build
+index e8f8b97170d32c1d3ac342dd93da7265bf707c8f..831001cee4b1eb33171d83d524ee9e453a800257 100644
+--- a/modules/libpref/moz.build
++++ b/modules/libpref/moz.build
+@@ -126,6 +126,10 @@ UNIFIED_SOURCES += [
+ "SharedPrefMap.cpp",
+ ]
+
++LOCAL_INCLUDES += [
++ '/toolkit/xre'
++]
++
+ gen_all_tuple = tuple(gen_h + gen_cpp + gen_rs)
+
+ GeneratedFile(
+diff --git a/python/mozbuild/mozpack/chrome/flags.py b/python/mozbuild/mozpack/chrome/flags.py
+index 6b096c862aaac5e02d9d7dacda42d9321d5e89cc..2b46d9294b93fda17117e9c84b240c52f96c9b74 100644
+--- a/python/mozbuild/mozpack/chrome/flags.py
++++ b/python/mozbuild/mozpack/chrome/flags.py
+@@ -234,6 +234,7 @@ class Flags(OrderedDict):
+ "tablet": Flag,
+ "process": StringFlag,
+ "backgroundtask": StringFlag,
++ "desktop": StringFlag,
+ }
+ RE = re.compile(r"([!<>=]+)")
+
+diff --git a/python/mozbuild/mozpack/chrome/manifest.py b/python/mozbuild/mozpack/chrome/manifest.py
+index 14c11d4c1daa8cbb03abf3cd2e1a7b60a981abc8..41b9969e7277fa2400f299863c83145342cd7b43 100644
+--- a/python/mozbuild/mozpack/chrome/manifest.py
++++ b/python/mozbuild/mozpack/chrome/manifest.py
+@@ -43,6 +43,7 @@ class ManifestEntry(object):
+ "process",
+ "contentaccessible",
+ "backgroundtask",
++ "desktop",
+ ]
+
+ def __init__(self, base, *flags):
+diff --git a/toolkit/components/downloads/moz.build b/toolkit/components/downloads/moz.build
+index 3818e8c0db1ed3cfc068d89b18b1fe2f1bf750a9..b70986db811191952919531cfb79e04b801491a2 100644
+--- a/toolkit/components/downloads/moz.build
++++ b/toolkit/components/downloads/moz.build
+@@ -51,5 +51,9 @@ if CONFIG["MOZ_PLACES"]:
+
+ FINAL_LIBRARY = "xul"
+
++LOCAL_INCLUDES += [
++ '/toolkit/xre'
++]
++
+ with Files("**"):
+ BUG_COMPONENT = ("Toolkit", "Downloads API")
+diff --git a/toolkit/mozapps/downloads/HelperAppDlg.sys.mjs b/toolkit/mozapps/downloads/HelperAppDlg.sys.mjs
+index 66f77d38e4ed7b3802303194e8df675a5db81272..f8839c446683620d6df6c6eb2ea0a0ca3549af95 100644
+--- a/toolkit/mozapps/downloads/HelperAppDlg.sys.mjs
++++ b/toolkit/mozapps/downloads/HelperAppDlg.sys.mjs
+@@ -1246,26 +1246,56 @@ nsUnknownContentTypeDialog.prototype = {
+ this.chosenApp = params.handlerApp;
+ }
+ } else if ("@mozilla.org/applicationchooser;1" in Cc) {
+- var nsIApplicationChooser = Ci.nsIApplicationChooser;
+- var appChooser = Cc["@mozilla.org/applicationchooser;1"].createInstance(
+- nsIApplicationChooser
+- );
+- appChooser.init(
+- this.mDialog,
+- this.dialogElement("strings").getString("chooseAppFilePickerTitle")
+- );
+- var contentTypeDialogObj = this;
+- let appChooserCallback = function appChooserCallback_done(aResult) {
+- if (aResult) {
+- contentTypeDialogObj.chosenApp = aResult.QueryInterface(
+- Ci.nsILocalHandlerApp
+- );
+- }
+- contentTypeDialogObj.finishChooseApp();
+- };
+- appChooser.open(this.mLauncher.MIMEInfo.MIMEType, appChooserCallback);
+- // The finishChooseApp is called from appChooserCallback
+- return;
++ // handle the KDE case which is implemented in the filepicker
++ // therefore falling back to Gtk2 like behaviour if KDE is running
++ // FIXME this should be better handled in the nsIApplicationChooser
++ // interface
++ var env = Components.classes["@mozilla.org/process/environment;1"]
++ .getService(Components.interfaces.nsIEnvironment);
++ if (env.get('KDE_FULL_SESSION') == "true")
++ {
++ var nsIFilePicker = Ci.nsIFilePicker;
++ var fp = Cc["@mozilla.org/filepicker;1"]
++ .createInstance(nsIFilePicker);
++ fp.init(this.mDialog,
++ this.dialogElement("strings").getString("chooseAppFilePickerTitle"),
++ nsIFilePicker.modeOpen);
++
++ fp.appendFilters(nsIFilePicker.filterApps);
++
++ fp.open(aResult => {
++ if (aResult == nsIFilePicker.returnOK && fp.file) {
++ // Remember the file they chose to run.
++ var localHandlerApp =
++ Cc["@mozilla.org/uriloader/local-handler-app;1"].
++ createInstance(Ci.nsILocalHandlerApp);
++ localHandlerApp.executable = fp.file;
++ this.chosenApp = localHandlerApp;
++ }
++ this.finishChooseApp();
++ });
++ } else {
++ var nsIApplicationChooser = Ci.nsIApplicationChooser;
++ var appChooser = Cc["@mozilla.org/applicationchooser;1"].createInstance(
++ nsIApplicationChooser
++ );
++ appChooser.init(
++ this.mDialog,
++ this.dialogElement("strings").getString("chooseAppFilePickerTitle")
++ );
++ var contentTypeDialogObj = this;
++ let appChooserCallback = function appChooserCallback_done(aResult) {
++ if (aResult) {
++ contentTypeDialogObj.chosenApp = aResult.QueryInterface(
++ Ci.nsILocalHandlerApp
++ );
++ }
++ contentTypeDialogObj.finishChooseApp();
++ };
++ appChooser.open(this.mLauncher.MIMEInfo.MIMEType, appChooserCallback);
++ // The finishChooseApp is called from appChooserCallback
++ return;
++ }
+ } else {
+ var nsIFilePicker = Ci.nsIFilePicker;
+ var fp = Cc["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
+diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
+index 185dc1e22a903cec95b212d1713dddf764b9b198..bdb4ed6f9f86583d02dd80278f858d064584f82a 100644
+--- a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
++++ b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
+@@ -16,6 +16,8 @@
+ #include "nsISupportsPrimitives.h"
+ #include "nsIGSettingsService.h"
+ #include "nsReadableUtils.h"
++#include "nsPrintfCString.h"
++#include "nsKDEUtils.h"
+
+ using namespace mozilla;
+
+@@ -39,6 +41,8 @@ class nsUnixSystemProxySettings final : public nsISystemProxySettings {
+ nsACString& aResult);
+ nsresult SetProxyResultFromGSettings(const char* aKeyBase, const char* aType,
+ nsACString& aResult);
++ nsresult GetProxyFromKDE(const nsACString& aScheme, const nsACString& aHost,
++ PRInt32 aPort, nsACString& aResult);
+ };
+
+ NS_IMPL_ISUPPORTS(nsUnixSystemProxySettings, nsISystemProxySettings)
+@@ -397,6 +401,9 @@ nsresult nsUnixSystemProxySettings::GetProxyForURI(const nsACString& aSpec,
+ const nsACString& aHost,
+ const int32_t aPort,
+ nsACString& aResult) {
++ if (nsKDEUtils::kdeSupport())
++ return GetProxyFromKDE(aScheme, aHost, aPort, aResult);
++
+ if (mProxySettings) {
+ nsresult rv = GetProxyFromGSettings(aScheme, aHost, aPort, aResult);
+ if (NS_SUCCEEDED(rv)) return rv;
+@@ -405,6 +412,28 @@ nsresult nsUnixSystemProxySettings::GetProxyForURI(const nsACString& aSpec,
+ return GetProxyFromEnvironment(aScheme, aHost, aPort, aResult);
+ }
+
++nsresult nsUnixSystemProxySettings::GetProxyFromKDE(const nsACString& aScheme,
++ const nsACString& aHost,
++ PRInt32 aPort,
++ nsACString& aResult) {
++ nsAutoCString url;
++ url = aScheme;
++ url += "://";
++ url += aHost;
++ if (aPort >= 0) {
++ url += ":";
++ url += nsPrintfCString("%d", aPort);
++ }
++ nsTArray<nsCString> command;
++ command.AppendElement("GETPROXY"_ns);
++ command.AppendElement(url);
++ nsTArray<nsCString> result;
++ 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();
+diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build
+index de05e0cc29752855138b4d189ce6a13c2121d715..c89faad7bfca4ab1d60390766b2e7befd9e3831d 100644
+--- a/toolkit/xre/moz.build
++++ b/toolkit/xre/moz.build
+@@ -96,7 +96,9 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "uikit":
+ "UIKitDirProvider.mm",
+ ]
+ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
++ EXPORTS += ['nsKDEUtils.h']
+ UNIFIED_SOURCES += [
++ "nsKDEUtils.cpp",
+ "nsNativeAppSupportUnix.cpp",
+ ]
+ CXXFLAGS += CONFIG["MOZ_X11_SM_CFLAGS"]
+diff --git a/toolkit/xre/nsKDEUtils.cpp b/toolkit/xre/nsKDEUtils.cpp
+new file mode 100644
+index 0000000000000000000000000000000000000000..e282de40618e0be06a4247891d9ab1a26cba2126
+--- /dev/null
++++ b/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
++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
++
++#include "nsKDEUtils.h"
++#include "nsIWidget.h"
++#include "nsISupportsPrimitives.h"
++#include "nsIMutableArray.h"
++#include "nsComponentManagerUtils.h"
++#include "nsArrayUtils.h"
++
++#include <gtk/gtk.h>
++
++#include <limits.h>
++#include <stdio.h>
++#include <sys/wait.h>
++#include <sys/resource.h>
++#include <unistd.h>
++#include <X11/Xlib.h>
++// 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 */
++#endif
++
++// #define DEBUG_KDE
++#ifdef DEBUG_KDE
++# define KMOZILLAHELPER "kmozillahelper"
++#else
++// not need for lib64, it's a binary
++# define KMOZILLAHELPER "/usr/lib/mozilla/kmozillahelper"
++#endif
++
++#define KMOZILLAHELPER_VERSION 6
++#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 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);
++#endif
++ return kde;
++}
++
++nsKDEUtils::nsKDEUtils() : commandFile(NULL), replyFile(NULL) {}
++
++nsKDEUtils::~nsKDEUtils() {
++ // closeHelper(); not actually useful, exiting will close the fd too
++}
++
++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::kdeSupport() {
++ static bool support = kdeSession() && getKdeSupport();
++ return support && helperRunning;
++}
++
++struct nsKDECommandData {
++ FILE* file;
++ nsTArray<nsCString>* output;
++ GMainLoop* loop;
++ bool success;
++};
++
++static gboolean kdeReadFunc(GIOChannel*, GIOCondition, gpointer data) {
++ nsKDECommandData* p = static_cast<nsKDECommandData*>(data);
++ char buf[8192]; // TODO big enough
++ bool command_done = false;
++ bool command_failed = false;
++ while (!command_done && !command_failed &&
++ fgets(buf, 8192, p->file) !=
++ NULL) { // TODO what if the kernel splits a line into two chunks?
++ // #ifdef DEBUG_KDE
++ // fprintf( stderr, "READ: %s %d\n", buf, feof( p->file ));
++ // #endif
++ if (char* eol = strchr(buf, '\n')) *eol = '\0';
++ command_done = (strcmp(buf, "\\1") == 0);
++ command_failed = (strcmp(buf, "\\0") == 0);
++ nsAutoCString line(buf);
++ line.ReplaceSubstring("\\n", "\n");
++ line.ReplaceSubstring(
++ "\\"
++ "\\",
++ "\\"); // \\ -> \ , i.e. unescape
++ if (p->output && !(command_done || command_failed))
++ p->output->AppendElement(nsCString(buf)); // TODO utf8?
++ }
++ bool quit = false;
++ if (feof(p->file) || command_failed) {
++ quit = true;
++ p->success = false;
++ }
++ if (command_done) { // reading one reply finished
++ quit = true;
++ p->success = true;
++ }
++ if (quit) {
++ if (p->loop) g_main_loop_quit(p->loop);
++ return FALSE;
++ }
++ return TRUE;
++}
++
++bool nsKDEUtils::command(const nsTArray<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);
++ }
++ }
++
++ 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()) return false;
++ feedCommand(command);
++ // do not store the data in 'this' but in extra structure, just in case there
++ // is reentrancy (can there be? the event loop is re-entered)
++ nsKDECommandData data;
++ data.file = replyFile;
++ data.output = output;
++ data.success = false;
++ if (blockUi) {
++ data.loop = g_main_loop_new(NULL, FALSE);
++ GtkWidget* window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
++ if (parent && gtk_window_get_group(parent))
++ gtk_window_group_add_window(gtk_window_get_group(parent),
++ GTK_WINDOW(window));
++ gtk_widget_realize(window);
++ gtk_widget_set_sensitive(window, TRUE);
++ gtk_grab_add(window);
++ GIOChannel* channel = g_io_channel_unix_new(fileno(data.file));
++ g_io_add_watch(channel,
++ static_cast<GIOCondition>(G_IO_IN | G_IO_ERR | G_IO_HUP),
++ kdeReadFunc, &data);
++ g_io_channel_unref(channel);
++ g_main_loop_run(data.loop);
++ g_main_loop_unref(data.loop);
++ gtk_grab_remove(window);
++ gtk_widget_destroy(window);
++ } else {
++ data.loop = NULL;
++ while (kdeReadFunc(NULL, static_cast<GIOCondition>(0), &data))
++ ;
++ }
++ return data.success;
++}
++
++bool nsKDEUtils::startHelper() {
++ if (helperRunning) return true;
++ if (helperFailed) return false;
++ helperFailed = true;
++ int fdcommand[2];
++ int fdreply[2];
++ if (pipe(fdcommand) < 0) return false;
++ if (pipe(fdreply) < 0) {
++ close(fdcommand[0]);
++ close(fdcommand[1]);
++ return false;
++ }
++ char* args[2] = {const_cast<char*>(KMOZILLAHELPER), NULL};
++ switch (fork()) {
++ case -1: {
++ close(fdcommand[0]);
++ close(fdcommand[1]);
++ close(fdreply[0]);
++ close(fdreply[1]);
++ return false;
++ }
++ case 0: // child
++ {
++ if (dup2(fdcommand[0], STDIN_FILENO) < 0) _exit(1);
++ if (dup2(fdreply[1], STDOUT_FILENO) < 0) _exit(1);
++ int maxfd = 1024; // close all other fds
++ struct rlimit rl;
++ if (getrlimit(RLIMIT_NOFILE, &rl) == 0) maxfd = rl.rlim_max;
++ for (int i = 3; i < maxfd; ++i) close(i);
++#ifdef DEBUG_KDE
++ execvp(KMOZILLAHELPER, args);
++#else
++ execv(KMOZILLAHELPER, args);
++#endif
++ _exit(1); // failed
++ }
++ default: // parent
++ {
++ commandFile = fdopen(fdcommand[1], "w");
++ replyFile = fdopen(fdreply[0], "r");
++ close(fdcommand[0]);
++ close(fdreply[1]);
++ if (commandFile == NULL || replyFile == NULL) {
++ closeHelper();
++ return false;
++ }
++ // ok, helper ready, getKdeRunning() will check if it works
++ }
++ }
++ helperFailed = false;
++ helperRunning = true;
++ return true;
++}
++
++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
+index 0000000000000000000000000000000000000000..7fa6eb8e83b32c8e2c62a0035d253e06e135e3d2
+--- /dev/null
++++ b/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
++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
++
++#ifndef nsKDEUtils_h__
++#define nsKDEUtils_h__
++
++#include "nsString.h"
++#include "nsTArray.h"
++#include <stdio.h>
++
++typedef struct _GtkWindow GtkWindow;
++
++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);
++
++ 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
+index ab77657dd5f378af0955c43ef958a8abea620134..18b4d85560699bbc3c69b82ee91dfb5cbe700e7b 100644
+--- a/uriloader/exthandler/HandlerServiceParent.cpp
++++ b/uriloader/exthandler/HandlerServiceParent.cpp
+@@ -18,7 +18,7 @@
+ #include "nsComponentManagerUtils.h"
+ #include "nsServiceManagerUtils.h"
+ #ifdef MOZ_WIDGET_GTK
+-# include "unix/nsGNOMERegistry.h"
++# include "unix/nsCommonRegistry.h"
+ #endif
+
+ using mozilla::dom::ContentHandlerService;
+@@ -310,8 +310,8 @@ mozilla::ipc::IPCResult HandlerServiceParent::RecvExistsForProtocolOS(
+ }
+ #ifdef MOZ_WIDGET_GTK
+ // Check the GNOME registry for a protocol handler
+- *aHandlerExists =
+- nsGNOMERegistry::HandlerExists(PromiseFlatCString(aProtocolScheme).get());
++ *aHandlerExists = nsCommonRegistry::HandlerExists(
++ PromiseFlatCString(aProtocolScheme).get());
+ #else
+ *aHandlerExists = false;
+ #endif
+diff --git a/uriloader/exthandler/moz.build b/uriloader/exthandler/moz.build
+index 0fb126a7f3f7a45d53e6fb81aef74147c711cb77..8cc0006f3045e14e83fd51926ac7856eacbe7357 100644
+--- a/uriloader/exthandler/moz.build
++++ b/uriloader/exthandler/moz.build
+@@ -86,7 +86,9 @@ else:
+
+ if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
+ UNIFIED_SOURCES += [
++ "unix/nsCommonRegistry.cpp",
+ "unix/nsGNOMERegistry.cpp",
++ "unix/nsKDERegistry.cpp",
+ "unix/nsMIMEInfoUnix.cpp",
+ ]
+ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
+@@ -134,6 +136,7 @@ LOCAL_INCLUDES += [
+ "/dom/ipc",
+ "/netwerk/base",
+ "/netwerk/protocol/http",
++ "/toolkit/xre",
+ ]
+
+ if CONFIG["MOZ_ENABLE_DBUS"]:
+diff --git a/uriloader/exthandler/unix/nsCommonRegistry.cpp b/uriloader/exthandler/unix/nsCommonRegistry.cpp
+new file mode 100644
+index 0000000000000000000000000000000000000000..3371a756e2c240bfe5fe31ef0ee9c393368dab60
+--- /dev/null
++++ b/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
++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
++
++#include "nsCommonRegistry.h"
++
++#include "nsGNOMERegistry.h"
++#include "nsKDERegistry.h"
++#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 */ 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::GetFromExtension(const nsACString& aFileExt) {
++ if (nsKDEUtils::kdeSupport())
++ return nsKDERegistry::GetFromExtension(aFileExt);
++ return nsGNOMERegistry::GetFromExtension(aFileExt);
++}
++
++/* static */ already_AddRefed<nsMIMEInfoBase> nsCommonRegistry::GetFromType(
++ const nsACString& aMIMEType) {
++ if (nsKDEUtils::kdeSupport()) return nsKDERegistry::GetFromType(aMIMEType);
++ return nsGNOMERegistry::GetFromType(aMIMEType);
++}
+diff --git a/uriloader/exthandler/unix/nsCommonRegistry.h b/uriloader/exthandler/unix/nsCommonRegistry.h
+new file mode 100644
+index 0000000000000000000000000000000000000000..075413e2fbb165862956c7753a750bfdfb5d389b
+--- /dev/null
++++ b/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
++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
++
++#ifndef nsCommonRegistry_h__
++#define nsCommonRegistry_h__
++
++#include "nsIURI.h"
++#include "nsCOMPtr.h"
++
++class nsMIMEInfoBase;
++
++class nsCommonRegistry {
++ public:
++ static bool HandlerExists(const char* aProtocolScheme);
++
++ static nsresult LoadURL(nsIURI* aURL);
++
++ static void GetAppDescForScheme(const nsACString& aScheme, nsAString& aDesc);
++
++ static already_AddRefed<nsMIMEInfoBase> GetFromExtension(
++ const nsACString& aFileExt);
++
++ 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 0000000000000000000000000000000000000000..082035566f0b82c14f866c2fbed34c0884f27d34
+--- /dev/null
++++ b/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
++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
++
++#include "mozilla/StaticPrefs_browser.h"
++#include "nsKDERegistry.h"
++#include "prlink.h"
++#include "prmem.h"
++#include "nsString.h"
++#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 */ 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;
++}
++
++/* 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::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];
++ 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 0000000000000000000000000000000000000000..c6a41b331b2b5ead6142171f08d8b8a7872ca516
+--- /dev/null
++++ b/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/. */
++
++#ifndef nsKDERegistry_h__
++#define nsKDERegistry_h__
++
++#include "nsIURI.h"
++#include "nsCOMPtr.h"
++#include "nsTArray.h"
++
++class nsMIMEInfoBase;
++// class nsAutoCString;
++// class nsCString;
++
++class nsKDERegistry {
++ public:
++ static bool HandlerExists(const char* aProtocolScheme);
++
++ static nsresult LoadURL(nsIURI* aURL);
++
++ static void GetAppDescForScheme(const nsACString& aScheme, nsAString& aDesc);
++
++ static already_AddRefed<nsMIMEInfoBase> GetFromExtension(
++ const nsACString& aFileExt);
++
++ static already_AddRefed<nsMIMEInfoBase> GetFromType(
++ const nsACString& aMIMEType);
++
++ private:
++ 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
+index 330c4411597f1a19105601e256a2c3bc71c61780..c96c1f3ca5a05c3b6bce321d7a975aa040865fa8 100644
+--- a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
++++ b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
+@@ -5,16 +5,19 @@
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+ #include "nsMIMEInfoUnix.h"
+-#include "nsGNOMERegistry.h"
++#include "nsCommonRegistry.h"
+ #include "nsIGIOService.h"
+ #include "nsNetCID.h"
+ #include "nsIIOService.h"
+ #ifdef MOZ_ENABLE_DBUS
+ # include "nsDBusHandlerApp.h"
+ #endif
++#if defined(XP_UNIX) && !defined(XP_MACOSX)
++# include "nsKDEUtils.h"
++#endif
+
+ nsresult nsMIMEInfoUnix::LoadUriInternal(nsIURI* aURI) {
+- return nsGNOMERegistry::LoadURL(aURI);
++ return nsCommonRegistry::LoadURL(aURI);
+ }
+
+ NS_IMETHODIMP
+@@ -29,15 +32,15 @@ nsMIMEInfoUnix::GetHasDefaultHandler(bool* _retval) {
+ *_retval = false;
+
+ if (mClass == eProtocolInfo) {
+- *_retval = nsGNOMERegistry::HandlerExists(mSchemeOrType.get());
++ *_retval = nsCommonRegistry::HandlerExists(mSchemeOrType.get());
+ } else {
+ RefPtr<nsMIMEInfoBase> mimeInfo =
+- nsGNOMERegistry::GetFromType(mSchemeOrType);
++ nsCommonRegistry::GetFromType(mSchemeOrType);
+ if (!mimeInfo) {
+ nsAutoCString ext;
+ nsresult rv = GetPrimaryExtension(ext);
+ if (NS_SUCCEEDED(rv)) {
+- mimeInfo = nsGNOMERegistry::GetFromExtension(ext);
++ mimeInfo = nsCommonRegistry::GetFromExtension(ext);
+ }
+ }
+ if (mimeInfo) *_retval = true;
+@@ -59,6 +62,21 @@ nsresult nsMIMEInfoUnix::LaunchDefaultWithFile(nsIFile* aFile) {
+ nsAutoCString nativePath;
+ aFile->GetNativePath(nativePath);
+
++ if (nsKDEUtils::kdeSupport()) {
++ bool 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;
++ }
++ if (!GetDefaultApplication()) return NS_ERROR_FILE_NOT_FOUND;
++
++ return LaunchWithIProcess(GetDefaultApplication(), nativePath);
++ }
++
+ nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
+ if (!giovfs) {
+ return NS_ERROR_FAILURE;
+diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exthandler/unix/nsOSHelperAppService.cpp
+index 7f6eaa46f2ee0d5155b83bfb07d8040584935772..f7627e790c47e1ae007b072b4bb47b18de1ae417 100644
+--- a/uriloader/exthandler/unix/nsOSHelperAppService.cpp
++++ b/uriloader/exthandler/unix/nsOSHelperAppService.cpp
+@@ -10,7 +10,7 @@
+ #include "nsOSHelperAppService.h"
+ #include "nsMIMEInfoUnix.h"
+ #ifdef MOZ_WIDGET_GTK
+-# include "nsGNOMERegistry.h"
++# include "nsCommonRegistry.h"
+ # ifdef MOZ_BUILD_APP_IS_BROWSER
+ # include "nsIToolkitShellService.h"
+ # include "nsIGNOMEShellService.h"
+@@ -1106,7 +1106,7 @@ nsresult nsOSHelperAppService::OSProtocolHandlerExists(
+ if (!XRE_IsContentProcess()) {
+ #ifdef MOZ_WIDGET_GTK
+ // Check the GNOME registry for a protocol handler
+- *aHandlerExists = nsGNOMERegistry::HandlerExists(aProtocolScheme);
++ *aHandlerExists = nsCommonRegistry::HandlerExists(aProtocolScheme);
+ #else
+ *aHandlerExists = false;
+ #endif
+@@ -1126,7 +1126,7 @@ nsresult nsOSHelperAppService::OSProtocolHandlerExists(
+ NS_IMETHODIMP nsOSHelperAppService::GetApplicationDescription(
+ const nsACString& aScheme, nsAString& _retval) {
+ #ifdef MOZ_WIDGET_GTK
+- nsGNOMERegistry::GetAppDescForScheme(aScheme, _retval);
++ nsCommonRegistry::GetAppDescForScheme(aScheme, _retval);
+ return _retval.IsEmpty() ? NS_ERROR_NOT_AVAILABLE : NS_OK;
+ #else
+ return NS_ERROR_NOT_AVAILABLE;
+@@ -1231,7 +1231,7 @@ already_AddRefed<nsMIMEInfoBase> nsOSHelperAppService::GetFromExtension(
+ #ifdef MOZ_WIDGET_GTK
+ LOG("Looking in GNOME registry\n");
+ RefPtr<nsMIMEInfoBase> gnomeInfo =
+- nsGNOMERegistry::GetFromExtension(aFileExt);
++ nsCommonRegistry::GetFromExtension(aFileExt);
+ if (gnomeInfo) {
+ LOG("Got MIMEInfo from GNOME registry\n");
+ return gnomeInfo.forget();
+@@ -1344,7 +1344,7 @@ already_AddRefed<nsMIMEInfoBase> nsOSHelperAppService::GetFromType(
+
+ #ifdef MOZ_WIDGET_GTK
+ if (handler.IsEmpty()) {
+- RefPtr<nsMIMEInfoBase> gnomeInfo = nsGNOMERegistry::GetFromType(aMIMEType);
++ RefPtr<nsMIMEInfoBase> gnomeInfo = nsCommonRegistry::GetFromType(aMIMEType);
+ if (gnomeInfo) {
+ LOG("Got MIMEInfo from GNOME registry without extensions; setting them "
+ "to %s\n",
+diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build
+index c6a765df9e5a4c95f77e9ee1b4ebbf9913a81e15..6e9028169ac594a24f90a4f58dc493c8332c6bf8 100644
+--- a/widget/gtk/moz.build
++++ b/widget/gtk/moz.build
+@@ -161,6 +161,7 @@ LOCAL_INCLUDES += [
+ "/layout/xul",
+ "/other-licenses/atk-1.0",
+ "/third_party/cups/include",
++ "/toolkit/xre",
+ "/widget",
+ "/widget/headless",
+ "/widget/x11",
+diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp
+index 22d0f46b9563734c7afb4292417124f3cd171a12..b2a68711eb344d5ac41a7133751b2c19d574f532 100644
+--- a/widget/gtk/nsFilePicker.cpp
++++ b/widget/gtk/nsFilePicker.cpp
+@@ -5,6 +5,7 @@
+
+ #include <dlfcn.h>
+ #include <gtk/gtk.h>
++#include <gdk/gdkx.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <unistd.h>
+@@ -28,6 +29,8 @@
+ #include "WidgetUtilsGtk.h"
+
+ #include "nsFilePicker.h"
++#include "nsKDEUtils.h"
++#include "nsURLHelper.h"
+
+ #undef LOG
+ #ifdef MOZ_LOGGING
+@@ -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;
+ }
+
+ nsAutoCString filter, name;
+@@ -352,6 +356,31 @@ nsFilePicker::Open(nsIFilePickerShownCallback* aCallback) {
+ // 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()) {
++ 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);
++
++ return NS_OK;
++ }
++
+ NS_ConvertUTF16toUTF8 title(mTitle);
+
+ GtkWindow* parent_widget =
+@@ -633,6 +662,205 @@ void nsFilePicker::Done(void* file_chooser, gint response) {
+ 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;
++}
++
++static PRInt32 windowToXid(nsIWidget* widget) {
++ GtkWindow* parent_widget =
++ GTK_WINDOW(widget->GetNativeData(NS_NATIVE_SHELLWIDGET));
++ GdkWindow* gdk_window =
++ gtk_widget_get_window(gtk_widget_get_toplevel(GTK_WIDGET(parent_widget)));
++ return GDK_WINDOW_XID(gdk_window);
++}
++
++NS_IMETHODIMP nsFilePicker::kdeFileDialog(nsIFilePicker::ResultCode* aReturn) {
++ NS_ENSURE_ARG_POINTER(aReturn);
++
++ if (mMode == modeOpen && mFilters.Length() == 1 &&
++ mFilters[0].EqualsLiteral("..apps"))
++ return kdeAppsDialog(aReturn);
++
++ nsCString title;
++ title.Adopt(ToNewUTF8String(mTitle));
++
++ const char* arg = NULL;
++ if (mAllowURLs) {
++ switch (mMode) {
++ case nsIFilePicker::modeOpen:
++ case nsIFilePicker::modeOpenMultiple:
++ arg = "GETOPENURL";
++ break;
++ case nsIFilePicker::modeSave:
++ arg = "GETSAVEURL";
++ break;
++ case nsIFilePicker::modeGetFolder:
++ arg = "GETDIRECTORYURL";
++ break;
++ }
++ } 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) {
++ mDisplayDirectory->GetNativePath(directory);
++ } else if (mPrevDisplayDirectory) {
++ mPrevDisplayDirectory->GetNativePath(directory);
++ }
++
++ nsAutoCString startdir;
++ if (!directory.IsEmpty()) {
++ startdir = directory;
++ }
++ if (mMode == nsIFilePicker::modeSave) {
++ if (!startdir.IsEmpty()) {
++ startdir += "/";
++ startdir += ToNewUTF8String(mDefault);
++ } 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(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;
++}
++
++NS_IMETHODIMP nsFilePicker::kdeAppsDialog(nsIFilePicker::ResultCode* aReturn) {
++ NS_ENSURE_ARG_POINTER(aReturn);
++
++ nsCString title;
++ title.Adopt(ToNewUTF8String(mTitle));
++
++ 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,
+diff --git a/widget/gtk/nsFilePicker.h b/widget/gtk/nsFilePicker.h
+index 496df4937277d96485376176296ee836aa261ec7..a4c1862ec042f4465d53bc95f138afb87260ba07 100644
+--- a/widget/gtk/nsFilePicker.h
++++ b/widget/gtk/nsFilePicker.h
+@@ -74,6 +74,12 @@ class nsFilePicker : public nsBaseFilePicker {
+ private:
+ static nsIFile* mPrevDisplayDirectory;
+
++ bool kdeRunning();
++ bool getKdeRunning();
++ 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);
+diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestParser.cpp
+index 88ee06d78db60a84343fd3d23c16e163aead37c3..834d6a2d353cc1bd11916de8a28f5d05a86d9031 100644
+--- a/xpcom/components/ManifestParser.cpp
++++ b/xpcom/components/ManifestParser.cpp
+@@ -43,6 +43,7 @@
+ #include "nsIScriptError.h"
+ #include "nsIXULAppInfo.h"
+ #include "nsIXULRuntime.h"
++#include "nsKDEUtils.h"
+
+ using namespace mozilla;
+
+@@ -394,6 +395,7 @@ void ParseManifest(NSLocationType aType, FileLocation& aFile, char* aBuf,
+ constexpr auto kOs = u"os"_ns;
+ constexpr auto kOsVersion = u"osversion"_ns;
+ constexpr auto kABI = u"abi"_ns;
++ constexpr auto kDesktop = u"desktop"_ns;
+ constexpr auto kProcess = u"process"_ns;
+ #if defined(MOZ_WIDGET_ANDROID)
+ constexpr auto kTablet = u"tablet"_ns;
+@@ -453,6 +455,7 @@ void ParseManifest(NSLocationType aType, FileLocation& aFile, char* aBuf,
+ }
+
+ nsAutoString osVersion;
++ nsAutoString desktop;
+ #if defined(XP_WIN)
+ # pragma warning(push)
+ # pragma warning(disable : 4996) // VC12+ deprecates GetVersionEx
+@@ -461,14 +464,17 @@ void ParseManifest(NSLocationType aType, FileLocation& aFile, char* aBuf,
+ nsTextFormatter::ssprintf(osVersion, u"%ld.%ld", info.dwMajorVersion,
+ info.dwMinorVersion);
+ }
++ desktop = u"win"_ns;
+ # pragma warning(pop)
+ #elif defined(MOZ_WIDGET_COCOA)
+ SInt32 majorVersion = nsCocoaFeatures::macOSVersionMajor();
+ SInt32 minorVersion = nsCocoaFeatures::macOSVersionMinor();
+ nsTextFormatter::ssprintf(osVersion, u"%ld.%ld", majorVersion, minorVersion);
++ desktop = u"macosx"_ns);
+ #elif defined(MOZ_WIDGET_GTK)
+ nsTextFormatter::ssprintf(osVersion, u"%ld.%ld", gtk_major_version,
+ gtk_minor_version);
++ desktop = nsKDEUtils::kdeSession() ? u"kde"_ns : u"gnome"_ns;
+ #elif defined(MOZ_WIDGET_ANDROID)
+ bool isTablet = false;
+ if (jni::IsAvailable()) {
+@@ -476,6 +482,7 @@ void ParseManifest(NSLocationType aType, FileLocation& aFile, char* aBuf,
+ osVersion.Assign(release->ToString());
+ isTablet = java::GeckoAppShell::IsTablet();
+ }
++ desktop = u"android"_ns;
+ #endif
+
+ if (XRE_IsContentProcess()) {
+@@ -576,6 +583,7 @@ void ParseManifest(NSLocationType aType, FileLocation& aFile, char* aBuf,
+ : eUnspecified;
+ #endif
+ int flags = 0;
++ TriState stDesktop = eUnspecified;
+
+ while ((token = nsCRT::strtok(whitespace, kWhitespace, &whitespace)) &&
+ ok) {
+@@ -585,6 +593,7 @@ void ParseManifest(NSLocationType aType, FileLocation& aFile, char* aBuf,
+ if (CheckStringFlag(kApplication, wtoken, appID, stApp) ||
+ CheckOsFlag(kOs, wtoken, osTarget, stOs) ||
+ CheckStringFlag(kABI, wtoken, abi, stABI) ||
++ CheckStringFlag(kDesktop, wtoken, desktop, stDesktop) ||
+ CheckStringFlag(kProcess, wtoken, process, stProcess) ||
+ CheckVersionFlag(kOsVersion, wtoken, osVersion, stOsVersion) ||
+ CheckVersionFlag(kAppVersion, wtoken, appVersion, stAppVersion) ||
+@@ -644,6 +653,7 @@ void ParseManifest(NSLocationType aType, FileLocation& aFile, char* aBuf,
+
+ if (!ok || stApp == eBad || stAppVersion == eBad ||
+ stGeckoVersion == eBad || stOs == eBad || stOsVersion == eBad ||
++ stDesktop == eBad ||
+ #ifdef MOZ_WIDGET_ANDROID
+ stTablet == eBad ||
+ #endif
+diff --git a/xpcom/components/moz.build b/xpcom/components/moz.build
+index 95ee64e985ac34dd6a3191f1948afa6d05adcb73..9af8f80497b7390b7ca434b6ee3b86b2baf47489 100644
+--- a/xpcom/components/moz.build
++++ b/xpcom/components/moz.build
+@@ -71,6 +71,7 @@ LOCAL_INCLUDES += [
+ "/js/xpconnect/loader",
+ "/layout/build",
+ "/modules/libjar",
++ "/toolkit/xre",
+ ]
+
+ if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
+diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp
+index 08c77360de6fdbf3dc579ea49243dbdc18f37ebc..eedd5bcf86bde3ecd795bbbcbf94799f19135323 100644
+--- a/xpcom/io/nsLocalFileUnix.cpp
++++ b/xpcom/io/nsLocalFileUnix.cpp
+@@ -51,6 +51,7 @@
+
+ #ifdef MOZ_WIDGET_GTK
+ # include "nsIGIOService.h"
++# include "nsKDEUtils.h"
+ #endif
+
+ #ifdef MOZ_WIDGET_COCOA
+@@ -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()) {
++ nsTArray<nsCString> command;
++ command.AppendElement("REVEAL"_ns);
++ command.AppendElement(mPath);
++ return nsKDEUtils::command(command) ? NS_OK : NS_ERROR_FAILURE;
+ }
++
++ if (!giovfs) return NS_ERROR_FAILURE;
++
+ return giovfs->RevealFile(this);
+ #elif defined(MOZ_WIDGET_COCOA)
+ CFURLRef url;
+@@ -2197,6 +2206,13 @@ nsLocalFile::Launch() {
+ }
+
+ #ifdef MOZ_WIDGET_GTK
++ if (nsKDEUtils::kdeSupport()) {
++ nsTArray<nsCString> command;
++ 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;
diff --git a/0030-Add-KDE-integration-to-Firefox.patch b/0026-Add-KDE-integration-to-Firefox.patch
index 2948e7b519a4..1e2e93858ec3 100644
--- a/0030-Add-KDE-integration-to-Firefox.patch
+++ b/0026-Add-KDE-integration-to-Firefox.patch
@@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martin Sirringhaus <msirringhaus@suse.de>
-Date: Fri, 31 May 2019 13:55:51 +0300
+Date: Tue, 8 Aug 2023 16:18:24 +0300
Subject: [PATCH] Add KDE integration to Firefox
Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=140751
@@ -27,10 +27,10 @@ How to apply this patch:
create mode 100644 browser/components/shell/nsUnixShellService.h
diff --git a/browser/components/preferences/main.js b/browser/components/preferences/main.js
-index 66b7b066636aabb3004925733990d2a37bc1dc01..6414380cac14d5e297fcdc559c0a6f6c872ad638 100644
+index 820e46fb006567bfdf93e2a46da5e3c07d42bf10..57d1c21bdecc2d55d0bed30246e684d3b97ad7fa 100644
--- a/browser/components/preferences/main.js
+++ b/browser/components/preferences/main.js
-@@ -301,6 +301,13 @@ var gMainPane = {
+@@ -294,6 +294,13 @@ var gMainPane = {
}, backoffTimes[this._backoffIndex]);
}
@@ -44,7 +44,7 @@ index 66b7b066636aabb3004925733990d2a37bc1dc01..6414380cac14d5e297fcdc559c0a6f6c
this.initBrowserContainers();
this.buildContentProcessCountMenuList();
-@@ -1303,6 +1310,17 @@ var gMainPane = {
+@@ -1727,6 +1734,17 @@ var gMainPane = {
}
try {
shellSvc.setDefaultBrowser(true, false);
@@ -63,7 +63,7 @@ index 66b7b066636aabb3004925733990d2a37bc1dc01..6414380cac14d5e297fcdc559c0a6f6c
console.error(ex);
return;
diff --git a/browser/components/shell/moz.build b/browser/components/shell/moz.build
-index eedbb0d938fe9f8ee64a1fb780fb1e9e4d40b069..9b364941b85080192f6af8f1530ec034d83bb6f2 100644
+index eb88cb287dc3f04022b74b978666118bbd5fa6b2..95277533781a7224d108e3c45731a6d9a89ba1a0 100644
--- a/browser/components/shell/moz.build
+++ b/browser/components/shell/moz.build
@@ -36,6 +36,8 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
diff --git a/0031-Imported-patch-firefox-branded-icons.patch.patch b/0027-Imported-patch-firefox-branded-icons.patch.patch
index 24900511f37c..acbf44c3027b 100644
--- a/0031-Imported-patch-firefox-branded-icons.patch.patch
+++ b/0027-Imported-patch-firefox-branded-icons.patch.patch
@@ -23,10 +23,10 @@ index 4e737310b37bc0bdbe4367e51c0f245eefbdbb50..0faf21fb931a0ed72495197d2152fd74
'default48.png',
'default64.png',
diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in
-index 42e26fafdf7e90a5fbda3d798d1e1d807a5b4a69..efa69113d9365b83ff55b549018b749e2f76d0c2 100644
+index ee420cf6363d598cd20b37bef6199dbe77f605c0..0f7d804e47a8c97dbd28081320c7ee271fd23725 100644
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
-@@ -228,10 +228,13 @@
+@@ -224,10 +224,13 @@
@RESPATH@/chrome/toolkit.manifest
#ifdef MOZ_GTK
@RESPATH@/browser/chrome/icons/default/default16.png
diff --git a/0033-Allow-Eme-for-arm-and-Aarch64.patch b/0028-Allow-Eme-for-arm-and-Aarch64.patch
index 1b8561198ab2..a371a3a1e5a2 100644
--- a/0033-Allow-Eme-for-arm-and-Aarch64.patch
+++ b/0028-Allow-Eme-for-arm-and-Aarch64.patch
@@ -12,15 +12,15 @@ Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/toolkit/moz.configure b/toolkit/moz.configure
-index be091370a786c902a736a2950c01a0c50bc30748..1c61f8fbb8807221449d95c9edaa4b3d5dd907e4 100644
+index dd9583868a0e15e5c3f4c56852531ff6fbe921eb..e3dca0c5e58b7a118fb820e148efb55d41d8eb8d 100644
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
-@@ -875,7 +875,7 @@ def eme_choices(target):
+@@ -906,7 +906,7 @@ def eme_choices(target, wmf):
if (
target.kernel in ("WINNT", "Linux")
and target.os != "Android"
- and target.cpu in ("x86", "x86_64")
+ and target.cpu in ("x86", "x86_64", "arm", "aarch64")
):
- return ("widevine",)
- if target.kernel == "WINNT" and target.cpu == "aarch64":
+ if wmf:
+ return ("widevine", "wmfcdm")
diff --git a/0029-Add-KDE-integration-to-Firefox-toolkit-parts.patch b/0029-Add-KDE-integration-to-Firefox-toolkit-parts.patch
deleted file mode 100644
index fe925ccda47d..000000000000
--- a/0029-Add-KDE-integration-to-Firefox-toolkit-parts.patch
+++ /dev/null
@@ -1,1531 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Wolfgang Rosenauer <wolfgang@rosenauer.org>
-Date: Fri, 31 May 2019 12:28:11 +0300
-Subject: [PATCH] Add KDE integration to Firefox (toolkit parts)
-
-Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=140751
-Bug: https://bugzilla.suse.com/show_bug.cgi?id=170055
-
-Co-authored-by: Wolfgang Rosenauer <wolfgang@rosenauer.org>
-Co-authored-by: Lubos Lunak <lunak@suse.com>
----
- modules/libpref/Preferences.cpp | 14 +-
- modules/libpref/moz.build | 4 +
- python/mozbuild/mozpack/chrome/flags.py | 1 +
- python/mozbuild/mozpack/chrome/manifest.py | 1 +
- toolkit/components/downloads/moz.build | 4 +
- toolkit/mozapps/downloads/HelperAppDlg.jsm | 70 ++--
- .../unixproxy/nsUnixSystemProxySettings.cpp | 33 ++
- toolkit/xre/moz.build | 2 +
- toolkit/xre/nsKDEUtils.cpp | 321 ++++++++++++++++++
- toolkit/xre/nsKDEUtils.h | 48 +++
- uriloader/exthandler/HandlerServiceParent.cpp | 4 +-
- uriloader/exthandler/moz.build | 3 +
- .../exthandler/unix/nsCommonRegistry.cpp | 53 +++
- uriloader/exthandler/unix/nsCommonRegistry.h | 28 ++
- uriloader/exthandler/unix/nsKDERegistry.cpp | 89 +++++
- uriloader/exthandler/unix/nsKDERegistry.h | 34 ++
- uriloader/exthandler/unix/nsMIMEInfoUnix.cpp | 30 +-
- .../exthandler/unix/nsOSHelperAppService.cpp | 10 +-
- widget/gtk/moz.build | 1 +
- widget/gtk/nsFilePicker.cpp | 258 +++++++++++++-
- widget/gtk/nsFilePicker.h | 6 +
- xpcom/components/ManifestParser.cpp | 11 +-
- xpcom/components/moz.build | 1 +
- xpcom/io/nsLocalFileUnix.cpp | 21 +-
- 24 files changed, 1010 insertions(+), 37 deletions(-)
- create mode 100644 toolkit/xre/nsKDEUtils.cpp
- create mode 100644 toolkit/xre/nsKDEUtils.h
- create mode 100644 uriloader/exthandler/unix/nsCommonRegistry.cpp
- create mode 100644 uriloader/exthandler/unix/nsCommonRegistry.h
- create mode 100644 uriloader/exthandler/unix/nsKDERegistry.cpp
- create mode 100644 uriloader/exthandler/unix/nsKDERegistry.h
-
-diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp
-index 0331e151c6db01631a9420d6315e76c319010864..0a3611409ccea7045582297ccf51e8828c51487c 100644
---- a/modules/libpref/Preferences.cpp
-+++ b/modules/libpref/Preferences.cpp
-@@ -95,6 +95,7 @@
- #ifdef MOZ_BACKGROUNDTASKS
- # include "mozilla/BackgroundTasks.h"
- #endif
-+#include "nsKDEUtils.h"
-
- #ifdef DEBUG
- # include <map>
-@@ -4915,6 +4916,17 @@ nsresult Preferences::InitInitialObjects(bool aIsStartup) {
- #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";
-+ break;
-+ }
-+ }
-+ }
-+
- rv = pref_LoadPrefsInDir(defaultPrefDir, specialFiles,
- ArrayLength(specialFiles));
- if (NS_FAILED(rv)) {
-@@ -5006,7 +5018,7 @@ nsresult Preferences::InitInitialObjects(bool aIsStartup) {
- }
-
- // Do we care if a file provided by this process fails to load?
-- pref_LoadPrefsInDir(path, nullptr, 0);
-+ pref_LoadPrefsInDir(path, specialFiles, ArrayLength(specialFiles));
- }
- }
-
-diff --git a/modules/libpref/moz.build b/modules/libpref/moz.build
-index b6d750fcf0763c161a591673e069a5b62a2ebd5f..5580825a907b06f739f771ea7130e688eba9fdfc 100644
---- a/modules/libpref/moz.build
-+++ b/modules/libpref/moz.build
-@@ -127,6 +127,10 @@ UNIFIED_SOURCES += [
- "SharedPrefMap.cpp",
- ]
-
-+LOCAL_INCLUDES += [
-+ '/toolkit/xre'
-+]
-+
- gen_all_tuple = tuple(gen_h + gen_cpp + gen_rs)
-
- GeneratedFile(
-diff --git a/python/mozbuild/mozpack/chrome/flags.py b/python/mozbuild/mozpack/chrome/flags.py
-index 08e975dbe1d1ae21848607ca80e0e74a791752cd..4e661c243bbfd209b405469ece8c6664a34f774a 100644
---- a/python/mozbuild/mozpack/chrome/flags.py
-+++ b/python/mozbuild/mozpack/chrome/flags.py
-@@ -233,6 +233,7 @@ class Flags(OrderedDict):
- "tablet": Flag,
- "process": StringFlag,
- "backgroundtask": StringFlag,
-+ "desktop": StringFlag,
- }
- RE = re.compile(r"([!<>=]+)")
-
-diff --git a/python/mozbuild/mozpack/chrome/manifest.py b/python/mozbuild/mozpack/chrome/manifest.py
-index badbd2fd9cebe7a9888b112fb2f580a6b2963573..e869ac4fe02bfd91f11d59a8b16f0e6aca8075f1 100644
---- a/python/mozbuild/mozpack/chrome/manifest.py
-+++ b/python/mozbuild/mozpack/chrome/manifest.py
-@@ -42,6 +42,7 @@ class ManifestEntry(object):
- "process",
- "contentaccessible",
- "backgroundtask",
-+ "desktop",
- ]
-
- def __init__(self, base, *flags):
-diff --git a/toolkit/components/downloads/moz.build b/toolkit/components/downloads/moz.build
-index 3818e8c0db1ed3cfc068d89b18b1fe2f1bf750a9..b70986db811191952919531cfb79e04b801491a2 100644
---- a/toolkit/components/downloads/moz.build
-+++ b/toolkit/components/downloads/moz.build
-@@ -51,5 +51,9 @@ if CONFIG["MOZ_PLACES"]:
-
- FINAL_LIBRARY = "xul"
-
-+LOCAL_INCLUDES += [
-+ '/toolkit/xre'
-+]
-+
- with Files("**"):
- BUG_COMPONENT = ("Toolkit", "Downloads API")
-diff --git a/toolkit/mozapps/downloads/HelperAppDlg.jsm b/toolkit/mozapps/downloads/HelperAppDlg.jsm
-index 5ec97a8771f56765f53b92157ab006ab13e7bfdc..677d80a656e21aaf54a66a852bf9a87689c9731d 100644
---- a/toolkit/mozapps/downloads/HelperAppDlg.jsm
-+++ b/toolkit/mozapps/downloads/HelperAppDlg.jsm
-@@ -1243,26 +1243,56 @@ nsUnknownContentTypeDialog.prototype = {
- this.chosenApp = params.handlerApp;
- }
- } else if ("@mozilla.org/applicationchooser;1" in Cc) {
-- var nsIApplicationChooser = Ci.nsIApplicationChooser;
-- var appChooser = Cc["@mozilla.org/applicationchooser;1"].createInstance(
-- nsIApplicationChooser
-- );
-- appChooser.init(
-- this.mDialog,
-- this.dialogElement("strings").getString("chooseAppFilePickerTitle")
-- );
-- var contentTypeDialogObj = this;
-- let appChooserCallback = function appChooserCallback_done(aResult) {
-- if (aResult) {
-- contentTypeDialogObj.chosenApp = aResult.QueryInterface(
-- Ci.nsILocalHandlerApp
-- );
-- }
-- contentTypeDialogObj.finishChooseApp();
-- };
-- appChooser.open(this.mLauncher.MIMEInfo.MIMEType, appChooserCallback);
-- // The finishChooseApp is called from appChooserCallback
-- return;
-+ // handle the KDE case which is implemented in the filepicker
-+ // therefore falling back to Gtk2 like behaviour if KDE is running
-+ // FIXME this should be better handled in the nsIApplicationChooser
-+ // interface
-+ var env = Components.classes["@mozilla.org/process/environment;1"]
-+ .getService(Components.interfaces.nsIEnvironment);
-+ if (env.get('KDE_FULL_SESSION') == "true")
-+ {
-+ var nsIFilePicker = Ci.nsIFilePicker;
-+ var fp = Cc["@mozilla.org/filepicker;1"]
-+ .createInstance(nsIFilePicker);
-+ fp.init(this.mDialog,
-+ this.dialogElement("strings").getString("chooseAppFilePickerTitle"),
-+ nsIFilePicker.modeOpen);
-+
-+ fp.appendFilters(nsIFilePicker.filterApps);
-+
-+ fp.open(aResult => {
-+ if (aResult == nsIFilePicker.returnOK && fp.file) {
-+ // Remember the file they chose to run.
-+ var localHandlerApp =
-+ Cc["@mozilla.org/uriloader/local-handler-app;1"].
-+ createInstance(Ci.nsILocalHandlerApp);
-+ localHandlerApp.executable = fp.file;
-+ this.chosenApp = localHandlerApp;
-+ }
-+ this.finishChooseApp();
-+ });
-+ } else {
-+ var nsIApplicationChooser = Ci.nsIApplicationChooser;
-+ var appChooser = Cc["@mozilla.org/applicationchooser;1"].createInstance(
-+ nsIApplicationChooser
-+ );
-+ appChooser.init(
-+ this.mDialog,
-+ this.dialogElement("strings").getString("chooseAppFilePickerTitle")
-+ );
-+ var contentTypeDialogObj = this;
-+ let appChooserCallback = function appChooserCallback_done(aResult) {
-+ if (aResult) {
-+ contentTypeDialogObj.chosenApp = aResult.QueryInterface(
-+ Ci.nsILocalHandlerApp
-+ );
-+ }
-+ contentTypeDialogObj.finishChooseApp();
-+ };
-+ appChooser.open(this.mLauncher.MIMEInfo.MIMEType, appChooserCallback);
-+ // The finishChooseApp is called from appChooserCallback
-+ return;
-+ }
- } else {
- var nsIFilePicker = Ci.nsIFilePicker;
- var fp = Cc["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
-diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
-index 185dc1e22a903cec95b212d1713dddf764b9b198..c843e0d3d100aef4e2e1d2ffcd19258306229658 100644
---- a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
-+++ b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
-@@ -16,6 +16,8 @@
- #include "nsISupportsPrimitives.h"
- #include "nsIGSettingsService.h"
- #include "nsReadableUtils.h"
-+#include "nsPrintfCString.h"
-+#include "nsKDEUtils.h"
-
- using namespace mozilla;
-
-@@ -39,6 +41,8 @@ class nsUnixSystemProxySettings final : public nsISystemProxySettings {
- nsACString& aResult);
- nsresult SetProxyResultFromGSettings(const char* aKeyBase, const char* aType,
- nsACString& aResult);
-+ nsresult GetProxyFromKDE(const nsACString& aScheme, const nsACString& aHost,
-+ PRInt32 aPort, nsACString& aResult);
- };
-
- NS_IMPL_ISUPPORTS(nsUnixSystemProxySettings, nsISystemProxySettings)
-@@ -397,6 +401,9 @@ nsresult nsUnixSystemProxySettings::GetProxyForURI(const nsACString& aSpec,
- const nsACString& aHost,
- const int32_t aPort,
- nsACString& aResult) {
-+ if (nsKDEUtils::kdeSupport())
-+ return GetProxyFromKDE(aScheme, aHost, aPort, aResult);
-+
- if (mProxySettings) {
- nsresult rv = GetProxyFromGSettings(aScheme, aHost, aPort, aResult);
- if (NS_SUCCEEDED(rv)) return rv;
-@@ -405,6 +412,32 @@ nsresult nsUnixSystemProxySettings::GetProxyForURI(const nsACString& aSpec,
- return GetProxyFromEnvironment(aScheme, aHost, aPort, aResult);
- }
-
-+nsresult
-+nsUnixSystemProxySettings::GetProxyFromKDE(const nsACString& aScheme,
-+ const nsACString& aHost,
-+ PRInt32 aPort,
-+ nsACString& aResult)
-+{
-+ nsAutoCString url;
-+ url = aScheme;
-+ url += "://";
-+ url += aHost;
-+ if( aPort >= 0 )
-+ {
-+ url += ":";
-+ url += nsPrintfCString("%d", aPort);
-+ }
-+ nsTArray<nsCString> command;
-+ command.AppendElement( "GETPROXY"_ns );
-+ command.AppendElement( url );
-+ nsTArray<nsCString> result;
-+ 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();
-diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build
-index 3ab8a14d13190edc962bfbadd5d1f928dac651dd..159b2c07e851466176c10b67e4b9ae69f34e9340 100644
---- a/toolkit/xre/moz.build
-+++ b/toolkit/xre/moz.build
-@@ -96,7 +96,9 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "uikit":
- "UIKitDirProvider.mm",
- ]
- elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
-+ EXPORTS += ['nsKDEUtils.h']
- UNIFIED_SOURCES += [
-+ "nsKDEUtils.cpp",
- "nsNativeAppSupportUnix.cpp",
- ]
- CXXFLAGS += CONFIG["MOZ_X11_SM_CFLAGS"]
-diff --git a/toolkit/xre/nsKDEUtils.cpp b/toolkit/xre/nsKDEUtils.cpp
-new file mode 100644
-index 0000000000000000000000000000000000000000..7a6edf07703a494c779ef8c639358eacfecb92b6
---- /dev/null
-+++ b/toolkit/xre/nsKDEUtils.cpp
-@@ -0,0 +1,321 @@
-+/* -*- 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
-+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-+
-+#include "nsKDEUtils.h"
-+#include "nsIWidget.h"
-+#include "nsISupportsPrimitives.h"
-+#include "nsIMutableArray.h"
-+#include "nsComponentManagerUtils.h"
-+#include "nsArrayUtils.h"
-+
-+#include <gtk/gtk.h>
-+
-+#include <limits.h>
-+#include <stdio.h>
-+#include <sys/wait.h>
-+#include <sys/resource.h>
-+#include <unistd.h>
-+#include <X11/Xlib.h>
-+// 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 */
-+#endif
-+
-+//#define DEBUG_KDE
-+#ifdef DEBUG_KDE
-+#define KMOZILLAHELPER "kmozillahelper"
-+#else
-+// not need for lib64, it's a binary
-+#define KMOZILLAHELPER "/usr/lib/mozilla/kmozillahelper"
-+#endif
-+
-+#define KMOZILLAHELPER_VERSION 6
-+#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 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 );
-+#endif
-+ return kde;
-+ }
-+
-+nsKDEUtils::nsKDEUtils()
-+ : commandFile( NULL )
-+ , replyFile( NULL )
-+ {
-+ }
-+
-+nsKDEUtils::~nsKDEUtils()
-+ {
-+// closeHelper(); not actually useful, exiting will close the fd too
-+ }
-+
-+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::kdeSupport()
-+ {
-+ static bool support = kdeSession() && getKdeSupport();
-+ return support && helperRunning;
-+ }
-+
-+struct nsKDECommandData
-+ {
-+ FILE* file;
-+ nsTArray<nsCString>* output;
-+ GMainLoop* loop;
-+ bool success;
-+ };
-+
-+static gboolean kdeReadFunc( GIOChannel*, GIOCondition, gpointer data )
-+ {
-+ nsKDECommandData* p = static_cast< nsKDECommandData* >( data );
-+ char buf[ 8192 ]; // TODO big enough
-+ bool command_done = false;
-+ bool command_failed = false;
-+ while( !command_done && !command_failed && fgets( buf, 8192, p->file ) != NULL )
-+ { // TODO what if the kernel splits a line into two chunks?
-+//#ifdef DEBUG_KDE
-+// fprintf( stderr, "READ: %s %d\n", buf, feof( p->file ));
-+//#endif
-+ if( char* eol = strchr( buf, '\n' ))
-+ *eol = '\0';
-+ command_done = ( strcmp( buf, "\\1" ) == 0 );
-+ command_failed = ( strcmp( buf, "\\0" ) == 0 );
-+ nsAutoCString line( buf );
-+ line.ReplaceSubstring( "\\n", "\n" );
-+ line.ReplaceSubstring( "\\" "\\", "\\" ); // \\ -> \ , i.e. unescape
-+ if( p->output && !( command_done || command_failed ))
-+ p->output->AppendElement( nsCString( buf )); // TODO utf8?
-+ }
-+ bool quit = false;
-+ if( feof( p->file ) || command_failed )
-+ {
-+ quit = true;
-+ p->success = false;
-+ }
-+ if( command_done )
-+ { // reading one reply finished
-+ quit = true;
-+ p->success = true;
-+ }
-+ if( quit )
-+ {
-+ if( p->loop )
-+ g_main_loop_quit( p->loop );
-+ return FALSE;
-+ }
-+ return TRUE;
-+ }
-+
-+bool nsKDEUtils::command( const nsTArray<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 );
-+ }
-+ }
-+
-+ 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())
-+ return false;
-+ feedCommand( command );
-+ // do not store the data in 'this' but in extra structure, just in case there
-+ // is reentrancy (can there be? the event loop is re-entered)
-+ nsKDECommandData data;
-+ data.file = replyFile;
-+ data.output = output;
-+ data.success = false;
-+ if( blockUi )
-+ {
-+ data.loop = g_main_loop_new( NULL, FALSE );
-+ GtkWidget* window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
-+ if( parent && gtk_window_get_group(parent) )
-+ gtk_window_group_add_window( gtk_window_get_group(parent), GTK_WINDOW( window ));
-+ gtk_widget_realize( window );
-+ gtk_widget_set_sensitive( window, TRUE );
-+ gtk_grab_add( window );
-+ GIOChannel* channel = g_io_channel_unix_new( fileno( data.file ));
-+ g_io_add_watch( channel, static_cast< GIOCondition >( G_IO_IN | G_IO_ERR | G_IO_HUP ), kdeReadFunc, &data );
-+ g_io_channel_unref( channel );
-+ g_main_loop_run( data.loop );
-+ g_main_loop_unref( data.loop );
-+ gtk_grab_remove( window );
-+ gtk_widget_destroy( window );
-+ }
-+ else
-+ {
-+ data.loop = NULL;
-+ while( kdeReadFunc( NULL, static_cast< GIOCondition >( 0 ), &data ))
-+ ;
-+ }
-+ return data.success;
-+ }
-+
-+bool nsKDEUtils::startHelper()
-+ {
-+ if( helperRunning )
-+ return true;
-+ if( helperFailed )
-+ return false;
-+ helperFailed = true;
-+ int fdcommand[ 2 ];
-+ int fdreply[ 2 ];
-+ if( pipe( fdcommand ) < 0 )
-+ return false;
-+ if( pipe( fdreply ) < 0 )
-+ {
-+ close( fdcommand[ 0 ] );
-+ close( fdcommand[ 1 ] );
-+ return false;
-+ }
-+ char* args[ 2 ] = { const_cast< char* >( KMOZILLAHELPER ), NULL };
-+ switch( fork())
-+ {
-+ case -1:
-+ {
-+ close( fdcommand[ 0 ] );
-+ close( fdcommand[ 1 ] );
-+ close( fdreply[ 0 ] );
-+ close( fdreply[ 1 ] );
-+ return false;
-+ }
-+ case 0: // child
-+ {
-+ if( dup2( fdcommand[ 0 ], STDIN_FILENO ) < 0 )
-+ _exit( 1 );
-+ if( dup2( fdreply[ 1 ], STDOUT_FILENO ) < 0 )
-+ _exit( 1 );
-+ int maxfd = 1024; // close all other fds
-+ struct rlimit rl;
-+ if( getrlimit( RLIMIT_NOFILE, &rl ) == 0 )
-+ maxfd = rl.rlim_max;
-+ for( int i = 3;
-+ i < maxfd;
-+ ++i )
-+ close( i );
-+#ifdef DEBUG_KDE
-+ execvp( KMOZILLAHELPER, args );
-+#else
-+ execv( KMOZILLAHELPER, args );
-+#endif
-+ _exit( 1 ); // failed
-+ }
-+ default: // parent
-+ {
-+ commandFile = fdopen( fdcommand[ 1 ], "w" );
-+ replyFile = fdopen( fdreply[ 0 ], "r" );
-+ close( fdcommand[ 0 ] );
-+ close( fdreply[ 1 ] );
-+ if( commandFile == NULL || replyFile == NULL )
-+ {
-+ closeHelper();
-+ return false;
-+ }
-+ // ok, helper ready, getKdeRunning() will check if it works
-+ }
-+ }
-+ helperFailed = false;
-+ helperRunning = true;
-+ return true;
-+ }
-+
-+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
-index 0000000000000000000000000000000000000000..c9c1284e294aca6b435f67ff8222a7398cdd761c
---- /dev/null
-+++ b/toolkit/xre/nsKDEUtils.h
-@@ -0,0 +1,48 @@
-+/* -*- 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/. */
-+
-+#ifndef nsKDEUtils_h__
-+#define nsKDEUtils_h__
-+
-+#include "nsString.h"
-+#include "nsTArray.h"
-+#include <stdio.h>
-+
-+typedef struct _GtkWindow GtkWindow;
-+
-+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 );
-+
-+ 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
-index 6eefb48f13161b2756a1aad4417be096d2f944cf..08dfb1e0c7c7b63acbd51d6ef1d7ba1345884287 100644
---- a/uriloader/exthandler/HandlerServiceParent.cpp
-+++ b/uriloader/exthandler/HandlerServiceParent.cpp
-@@ -12,7 +12,7 @@
- #include "ContentHandlerService.h"
- #include "nsStringEnumerator.h"
- #ifdef MOZ_WIDGET_GTK
--# include "unix/nsGNOMERegistry.h"
-+# include "unix/nsCommonRegistry.h"
- #endif
-
- using mozilla::dom::ContentHandlerService;
-@@ -305,7 +305,7 @@ mozilla::ipc::IPCResult HandlerServiceParent::RecvExistsForProtocolOS(
- #ifdef MOZ_WIDGET_GTK
- // Check the GNOME registry for a protocol handler
- *aHandlerExists =
-- nsGNOMERegistry::HandlerExists(PromiseFlatCString(aProtocolScheme).get());
-+ nsCommonRegistry::HandlerExists(PromiseFlatCString(aProtocolScheme).get());
- #else
- *aHandlerExists = false;
- #endif
-diff --git a/uriloader/exthandler/moz.build b/uriloader/exthandler/moz.build
-index 0575fd95a5b5cf79e171ab56297b768a0958d4ef..ae0aca14fe30f4e3a4b963bbda48eb7de55e1043 100644
---- a/uriloader/exthandler/moz.build
-+++ b/uriloader/exthandler/moz.build
-@@ -86,7 +86,9 @@ else:
-
- if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
- UNIFIED_SOURCES += [
-+ "unix/nsCommonRegistry.cpp",
- "unix/nsGNOMERegistry.cpp",
-+ "unix/nsKDERegistry.cpp",
- "unix/nsMIMEInfoUnix.cpp",
- ]
- elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
-@@ -134,6 +136,7 @@ LOCAL_INCLUDES += [
- "/dom/ipc",
- "/netwerk/base",
- "/netwerk/protocol/http",
-+ "/toolkit/xre",
- ]
-
- if CONFIG["MOZ_ENABLE_DBUS"]:
-diff --git a/uriloader/exthandler/unix/nsCommonRegistry.cpp b/uriloader/exthandler/unix/nsCommonRegistry.cpp
-new file mode 100644
-index 0000000000000000000000000000000000000000..630ab6147db31a6a48b4e119d860cb895af7ef39
---- /dev/null
-+++ b/uriloader/exthandler/unix/nsCommonRegistry.cpp
-@@ -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
-+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-+
-+#include "nsCommonRegistry.h"
-+
-+#include "nsGNOMERegistry.h"
-+#include "nsKDERegistry.h"
-+#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 */ 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::GetFromExtension(const nsACString& aFileExt)
-+{
-+ if( nsKDEUtils::kdeSupport())
-+ return nsKDERegistry::GetFromExtension( aFileExt );
-+ return nsGNOMERegistry::GetFromExtension( aFileExt );
-+}
-+
-+/* static */ already_AddRefed<nsMIMEInfoBase>
-+nsCommonRegistry::GetFromType(const nsACString& aMIMEType)
-+{
-+ if( nsKDEUtils::kdeSupport())
-+ return nsKDERegistry::GetFromType( aMIMEType );
-+ return nsGNOMERegistry::GetFromType( aMIMEType );
-+}
-diff --git a/uriloader/exthandler/unix/nsCommonRegistry.h b/uriloader/exthandler/unix/nsCommonRegistry.h
-new file mode 100644
-index 0000000000000000000000000000000000000000..85b3d9cee25ebf9dbb4fb7b6029209834f554468
---- /dev/null
-+++ b/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
-+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-+
-+#ifndef nsCommonRegistry_h__
-+#define nsCommonRegistry_h__
-+
-+#include "nsIURI.h"
-+#include "nsCOMPtr.h"
-+
-+class nsMIMEInfoBase;
-+
-+class nsCommonRegistry
-+{
-+ public:
-+ static bool HandlerExists(const char *aProtocolScheme);
-+
-+ static nsresult LoadURL(nsIURI *aURL);
-+
-+ static void GetAppDescForScheme(const nsACString& aScheme,
-+ nsAString& aDesc);
-+
-+ static already_AddRefed<nsMIMEInfoBase> GetFromExtension(const nsACString& aFileExt);
-+
-+ 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 0000000000000000000000000000000000000000..f78e64c7e9a3263e4a57e667ccbc6cffb7be76c1
---- /dev/null
-+++ b/uriloader/exthandler/unix/nsKDERegistry.cpp
-@@ -0,0 +1,89 @@
-+/* -*- 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/. */
-+
-+#include "mozilla/StaticPrefs_browser.h"
-+#include "nsKDERegistry.h"
-+#include "prlink.h"
-+#include "prmem.h"
-+#include "nsString.h"
-+#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 */ 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;
-+}
-+
-+/* 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::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;
-+}
-diff --git a/uriloader/exthandler/unix/nsKDERegistry.h b/uriloader/exthandler/unix/nsKDERegistry.h
-new file mode 100644
-index 0000000000000000000000000000000000000000..5b07eebc6d622d6dad2ddbdaf76f971972af79ce
---- /dev/null
-+++ b/uriloader/exthandler/unix/nsKDERegistry.h
-@@ -0,0 +1,34 @@
-+/* 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/. */
-+
-+#ifndef nsKDERegistry_h__
-+#define nsKDERegistry_h__
-+
-+#include "nsIURI.h"
-+#include "nsCOMPtr.h"
-+#include "nsTArray.h"
-+
-+class nsMIMEInfoBase;
-+//class nsAutoCString;
-+//class nsCString;
-+
-+class nsKDERegistry
-+{
-+ public:
-+ static bool HandlerExists(const char *aProtocolScheme);
-+
-+ static nsresult LoadURL(nsIURI *aURL);
-+
-+ static void GetAppDescForScheme(const nsACString& aScheme,
-+ nsAString& aDesc);
-+
-+ static already_AddRefed<nsMIMEInfoBase> GetFromExtension(const nsACString& aFileExt);
-+
-+ static already_AddRefed<nsMIMEInfoBase> GetFromType(const nsACString& aMIMEType);
-+ private:
-+ 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
-index 7cbefcce3e94202739f55fed93d7efcaeda946fd..84083348c8f1799f0df917ec9d01f4cd4ee45956 100644
---- a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
-+++ b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
-@@ -5,16 +5,19 @@
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
- #include "nsMIMEInfoUnix.h"
--#include "nsGNOMERegistry.h"
-+#include "nsCommonRegistry.h"
- #include "nsIGIOService.h"
- #include "nsNetCID.h"
- #include "nsIIOService.h"
- #ifdef MOZ_ENABLE_DBUS
- # include "nsDBusHandlerApp.h"
- #endif
-+#if defined(XP_UNIX) && !defined(XP_MACOSX)
-+#include "nsKDEUtils.h"
-+#endif
-
- nsresult nsMIMEInfoUnix::LoadUriInternal(nsIURI* aURI) {
-- return nsGNOMERegistry::LoadURL(aURI);
-+ return nsCommonRegistry::LoadURL(aURI);
- }
-
- NS_IMETHODIMP
-@@ -27,15 +30,15 @@ nsMIMEInfoUnix::GetHasDefaultHandler(bool* _retval) {
- *_retval = false;
-
- if (mClass == eProtocolInfo) {
-- *_retval = nsGNOMERegistry::HandlerExists(mSchemeOrType.get());
-+ *_retval = nsCommonRegistry::HandlerExists(mSchemeOrType.get());
- } else {
- RefPtr<nsMIMEInfoBase> mimeInfo =
-- nsGNOMERegistry::GetFromType(mSchemeOrType);
-+ nsCommonRegistry::GetFromType(mSchemeOrType);
- if (!mimeInfo) {
- nsAutoCString ext;
- nsresult rv = GetPrimaryExtension(ext);
- if (NS_SUCCEEDED(rv)) {
-- mimeInfo = nsGNOMERegistry::GetFromExtension(ext);
-+ mimeInfo = nsCommonRegistry::GetFromExtension(ext);
- }
- }
- if (mimeInfo) *_retval = true;
-@@ -55,6 +58,23 @@ nsresult nsMIMEInfoUnix::LaunchDefaultWithFile(nsIFile* aFile) {
- nsAutoCString nativePath;
- aFile->GetNativePath(nativePath);
-
-+ if( nsKDEUtils::kdeSupport()) {
-+ bool 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;
-+ }
-+ if (!mDefaultApplication)
-+ return NS_ERROR_FILE_NOT_FOUND;
-+
-+ return LaunchWithIProcess(mDefaultApplication, nativePath);
-+ }
-+
- nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
- if (!giovfs) {
- return NS_ERROR_FAILURE;
-diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exthandler/unix/nsOSHelperAppService.cpp
-index 8b5820b9fd7175661fe070ddd7c8243f4f94610b..256f94703a924e66230a9929f6cbf81b3c6bffae 100644
---- a/uriloader/exthandler/unix/nsOSHelperAppService.cpp
-+++ b/uriloader/exthandler/unix/nsOSHelperAppService.cpp
-@@ -10,7 +10,7 @@
- #include "nsOSHelperAppService.h"
- #include "nsMIMEInfoUnix.h"
- #ifdef MOZ_WIDGET_GTK
--# include "nsGNOMERegistry.h"
-+# include "nsCommonRegistry.h"
- # ifdef MOZ_BUILD_APP_IS_BROWSER
- # include "nsIToolkitShellService.h"
- # include "nsIGNOMEShellService.h"
-@@ -1107,7 +1107,7 @@ nsresult nsOSHelperAppService::OSProtocolHandlerExists(
- if (!XRE_IsContentProcess()) {
- #ifdef MOZ_WIDGET_GTK
- // Check the GNOME registry for a protocol handler
-- *aHandlerExists = nsGNOMERegistry::HandlerExists(aProtocolScheme);
-+ *aHandlerExists = nsCommonRegistry::HandlerExists(aProtocolScheme);
- #else
- *aHandlerExists = false;
- #endif
-@@ -1127,7 +1127,7 @@ nsresult nsOSHelperAppService::OSProtocolHandlerExists(
- NS_IMETHODIMP nsOSHelperAppService::GetApplicationDescription(
- const nsACString& aScheme, nsAString& _retval) {
- #ifdef MOZ_WIDGET_GTK
-- nsGNOMERegistry::GetAppDescForScheme(aScheme, _retval);
-+ nsCommonRegistry::GetAppDescForScheme(aScheme, _retval);
- return _retval.IsEmpty() ? NS_ERROR_NOT_AVAILABLE : NS_OK;
- #else
- return NS_ERROR_NOT_AVAILABLE;
-@@ -1232,7 +1232,7 @@ already_AddRefed<nsMIMEInfoBase> nsOSHelperAppService::GetFromExtension(
- #ifdef MOZ_WIDGET_GTK
- LOG("Looking in GNOME registry\n");
- RefPtr<nsMIMEInfoBase> gnomeInfo =
-- nsGNOMERegistry::GetFromExtension(aFileExt);
-+ nsCommonRegistry::GetFromExtension(aFileExt);
- if (gnomeInfo) {
- LOG("Got MIMEInfo from GNOME registry\n");
- return gnomeInfo.forget();
-@@ -1347,7 +1347,7 @@ already_AddRefed<nsMIMEInfoBase> nsOSHelperAppService::GetFromType(
-
- #ifdef MOZ_WIDGET_GTK
- if (handler.IsEmpty()) {
-- RefPtr<nsMIMEInfoBase> gnomeInfo = nsGNOMERegistry::GetFromType(aMIMEType);
-+ RefPtr<nsMIMEInfoBase> gnomeInfo = nsCommonRegistry::GetFromType(aMIMEType);
- if (gnomeInfo) {
- LOG("Got MIMEInfo from GNOME registry without extensions; setting them "
- "to %s\n",
-diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build
-index d60d1995b27850009faccbb98351bf6fe9f7b802..693a5a251400bdd66865d294f87a663c90cd4554 100644
---- a/widget/gtk/moz.build
-+++ b/widget/gtk/moz.build
-@@ -162,6 +162,7 @@ LOCAL_INCLUDES += [
- "/layout/xul",
- "/other-licenses/atk-1.0",
- "/third_party/cups/include",
-+ "/toolkit/xre",
- "/widget",
- "/widget/headless",
- ]
-diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp
-index 8e910464c60f7a0eb3ce7940306ef102f5506ec4..a7e93492103eb810d51477c830762f844f7abfc5 100644
---- a/widget/gtk/nsFilePicker.cpp
-+++ b/widget/gtk/nsFilePicker.cpp
-@@ -5,6 +5,7 @@
-
- #include <dlfcn.h>
- #include <gtk/gtk.h>
-+#include <gdk/gdkx.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <unistd.h>
-@@ -28,6 +29,8 @@
- #include "WidgetUtilsGtk.h"
-
- #include "nsFilePicker.h"
-+#include "nsKDEUtils.h"
-+#include "nsURLHelper.h"
-
- #undef LOG
- #ifdef MOZ_LOGGING
-@@ -242,7 +245,9 @@ 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;
- }
-
- nsAutoCString filter, name;
-@@ -352,6 +357,29 @@ nsFilePicker::Open(nsIFilePickerShownCallback* aCallback) {
- // 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()) {
-+ mCallback = aCallback;
-+ mRunning = true;
-+ NS_ADDREF_THIS();
-+ g_idle_add([](gpointer data) -> gboolean {
-+ nsFilePicker* queuedPicker = (nsFilePicker*) data;
-+ int16_t 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;
-+ }
-+
- NS_ConvertUTF16toUTF8 title(mTitle);
-
- GtkWindow* parent_widget =
-@@ -629,6 +657,234 @@ void nsFilePicker::Done(void* file_chooser, gint response) {
- 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;
-+ }
-+
-+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(PRInt16 *aReturn)
-+ {
-+ NS_ENSURE_ARG_POINTER(aReturn);
-+
-+ if( mMode == modeOpen && mFilters.Length() == 1 && mFilters[ 0 ].EqualsLiteral( "..apps" ))
-+ return kdeAppsDialog( aReturn );
-+
-+ nsCString title;
-+ title.Adopt(ToNewUTF8String(mTitle));
-+
-+ const char* arg = NULL;
-+ if( mAllowURLs )
-+ {
-+ switch( mMode )
-+ {
-+ case nsIFilePicker::modeOpen:
-+ case nsIFilePicker::modeOpenMultiple:
-+ arg = "GETOPENURL";
-+ break;
-+ case nsIFilePicker::modeSave:
-+ arg = "GETSAVEURL";
-+ break;
-+ case nsIFilePicker::modeGetFolder:
-+ arg = "GETDIRECTORYURL";
-+ break;
-+ }
-+ }
-+ else
-+ {
-+ switch( mMode )
-+ {
-+ case nsIFilePicker::modeOpen:
-+ case nsIFilePicker::modeOpenMultiple:
-+ arg = "GETOPENFILENAME";
-+ break;
-+ case nsIFilePicker::modeSave:
-+ arg = "GETSAVEFILENAME";
-+ break;
-+ case nsIFilePicker::modeGetFolder:
-+ arg = "GETDIRECTORYFILENAME";
-+ break;
-+ }
-+ }
-+
-+ nsAutoCString directory;
-+ if (mDisplayDirectory) {
-+ mDisplayDirectory->GetNativePath(directory);
-+ } else if (mPrevDisplayDirectory) {
-+ mPrevDisplayDirectory->GetNativePath(directory);
-+ }
-+
-+ nsAutoCString startdir;
-+ if (!directory.IsEmpty()) {
-+ startdir = directory;
-+ }
-+ if (mMode == nsIFilePicker::modeSave) {
-+ if( !startdir.IsEmpty())
-+ {
-+ startdir += "/";
-+ startdir += ToNewUTF8String(mDefault);
-+ }
-+ 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);
-+ }
-+ }
-+ 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(PRInt16 *aReturn)
-+ {
-+ NS_ENSURE_ARG_POINTER(aReturn);
-+
-+ nsCString title;
-+ title.Adopt(ToNewUTF8String(mTitle));
-+
-+ 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,
-diff --git a/widget/gtk/nsFilePicker.h b/widget/gtk/nsFilePicker.h
-index cdfbe64bd35cae10ffc20e07ceff8c830a8b8f91..ec21c7346278e655f2e33044c0291b474b2ddf30 100644
---- a/widget/gtk/nsFilePicker.h
-+++ b/widget/gtk/nsFilePicker.h
-@@ -74,6 +74,12 @@ class nsFilePicker : public nsBaseFilePicker {
- private:
- static nsIFile* mPrevDisplayDirectory;
-
-+ bool kdeRunning();
-+ bool getKdeRunning();
-+ NS_IMETHODIMP kdeFileDialog(PRInt16 *aReturn);
-+ NS_IMETHODIMP kdeAppsDialog(PRInt16 *aReturn);
-+ nsCString kdeMakeFilter( int index );
-+
- void* GtkFileChooserNew(const gchar* title, GtkWindow* parent,
- GtkFileChooserAction action,
- const gchar* accept_label);
-diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestParser.cpp
-index 88ee06d78db60a84343fd3d23c16e163aead37c3..6ac182a1df36f090e2189a52107a7f94822baf6f 100644
---- a/xpcom/components/ManifestParser.cpp
-+++ b/xpcom/components/ManifestParser.cpp
-@@ -43,6 +43,7 @@
- #include "nsIScriptError.h"
- #include "nsIXULAppInfo.h"
- #include "nsIXULRuntime.h"
-+#include "nsKDEUtils.h"
-
- using namespace mozilla;
-
-@@ -394,6 +395,7 @@ void ParseManifest(NSLocationType aType, FileLocation& aFile, char* aBuf,
- constexpr auto kOs = u"os"_ns;
- constexpr auto kOsVersion = u"osversion"_ns;
- constexpr auto kABI = u"abi"_ns;
-+ constexpr auto kDesktop = u"desktop"_ns;
- constexpr auto kProcess = u"process"_ns;
- #if defined(MOZ_WIDGET_ANDROID)
- constexpr auto kTablet = u"tablet"_ns;
-@@ -453,6 +455,7 @@ void ParseManifest(NSLocationType aType, FileLocation& aFile, char* aBuf,
- }
-
- nsAutoString osVersion;
-+ nsAutoString desktop;
- #if defined(XP_WIN)
- # pragma warning(push)
- # pragma warning(disable : 4996) // VC12+ deprecates GetVersionEx
-@@ -461,14 +464,17 @@ void ParseManifest(NSLocationType aType, FileLocation& aFile, char* aBuf,
- nsTextFormatter::ssprintf(osVersion, u"%ld.%ld", info.dwMajorVersion,
- info.dwMinorVersion);
- }
-+ desktop = u"win"_ns;
- # pragma warning(pop)
- #elif defined(MOZ_WIDGET_COCOA)
- SInt32 majorVersion = nsCocoaFeatures::macOSVersionMajor();
- SInt32 minorVersion = nsCocoaFeatures::macOSVersionMinor();
- nsTextFormatter::ssprintf(osVersion, u"%ld.%ld", majorVersion, minorVersion);
-+ desktop = u"macosx"_ns);
- #elif defined(MOZ_WIDGET_GTK)
- nsTextFormatter::ssprintf(osVersion, u"%ld.%ld", gtk_major_version,
- gtk_minor_version);
-+ desktop = nsKDEUtils::kdeSession() ? u"kde"_ns : u"gnome"_ns;
- #elif defined(MOZ_WIDGET_ANDROID)
- bool isTablet = false;
- if (jni::IsAvailable()) {
-@@ -476,6 +482,7 @@ void ParseManifest(NSLocationType aType, FileLocation& aFile, char* aBuf,
- osVersion.Assign(release->ToString());
- isTablet = java::GeckoAppShell::IsTablet();
- }
-+ desktop = u"android"_ns;
- #endif
-
- if (XRE_IsContentProcess()) {
-@@ -576,6 +583,7 @@ void ParseManifest(NSLocationType aType, FileLocation& aFile, char* aBuf,
- : eUnspecified;
- #endif
- int flags = 0;
-+ TriState stDesktop = eUnspecified;
-
- while ((token = nsCRT::strtok(whitespace, kWhitespace, &whitespace)) &&
- ok) {
-@@ -585,6 +593,7 @@ void ParseManifest(NSLocationType aType, FileLocation& aFile, char* aBuf,
- if (CheckStringFlag(kApplication, wtoken, appID, stApp) ||
- CheckOsFlag(kOs, wtoken, osTarget, stOs) ||
- CheckStringFlag(kABI, wtoken, abi, stABI) ||
-+ CheckStringFlag(kDesktop, wtoken, desktop, stDesktop) ||
- CheckStringFlag(kProcess, wtoken, process, stProcess) ||
- CheckVersionFlag(kOsVersion, wtoken, osVersion, stOsVersion) ||
- CheckVersionFlag(kAppVersion, wtoken, appVersion, stAppVersion) ||
-@@ -643,7 +652,7 @@ void ParseManifest(NSLocationType aType, FileLocation& aFile, char* aBuf,
- }
-
- if (!ok || stApp == eBad || stAppVersion == eBad ||
-- stGeckoVersion == eBad || stOs == eBad || stOsVersion == eBad ||
-+ stGeckoVersion == eBad || stOs == eBad || stOsVersion == eBad || stDesktop == eBad ||
- #ifdef MOZ_WIDGET_ANDROID
- stTablet == eBad ||
- #endif
-diff --git a/xpcom/components/moz.build b/xpcom/components/moz.build
-index 95ee64e985ac34dd6a3191f1948afa6d05adcb73..9af8f80497b7390b7ca434b6ee3b86b2baf47489 100644
---- a/xpcom/components/moz.build
-+++ b/xpcom/components/moz.build
-@@ -71,6 +71,7 @@ LOCAL_INCLUDES += [
- "/js/xpconnect/loader",
- "/layout/build",
- "/modules/libjar",
-+ "/toolkit/xre",
- ]
-
- if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
-diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp
-index 08c77360de6fdbf3dc579ea49243dbdc18f37ebc..846342d77d65edf7446e0520f3be5ab0da7ebd60 100644
---- a/xpcom/io/nsLocalFileUnix.cpp
-+++ b/xpcom/io/nsLocalFileUnix.cpp
-@@ -51,6 +51,7 @@
-
- #ifdef MOZ_WIDGET_GTK
- # include "nsIGIOService.h"
-+# include "nsKDEUtils.h"
- #endif
-
- #ifdef MOZ_WIDGET_COCOA
-@@ -2172,10 +2173,19 @@ 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()) {
-+ nsTArray<nsCString> command;
-+ command.AppendElement( "REVEAL"_ns );
-+ command.AppendElement( mPath );
-+ return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE;
- }
-+
-+ if (!giovfs)
-+ return NS_ERROR_FAILURE;
-+
- return giovfs->RevealFile(this);
- #elif defined(MOZ_WIDGET_COCOA)
- CFURLRef url;
-@@ -2197,6 +2207,13 @@ nsLocalFile::Launch() {
- }
-
- #ifdef MOZ_WIDGET_GTK
-+ if( nsKDEUtils::kdeSupport()) {
-+ nsTArray<nsCString> command;
-+ 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;
diff --git a/0029-Shut-up-warnings-about-future-Rust-version-incompati.patch b/0029-Shut-up-warnings-about-future-Rust-version-incompati.patch
new file mode 100644
index 000000000000..e70db022d136
--- /dev/null
+++ b/0029-Shut-up-warnings-about-future-Rust-version-incompati.patch
@@ -0,0 +1,26 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Bj=C3=B6rn=20Bidar?= <bjorn.bidar@jolla.com>
+Date: Sat, 22 Jul 2023 18:08:57 +0300
+Subject: [PATCH] Shut up warnings about future Rust version incompatibilities
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
+---
+ Cargo.toml | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/Cargo.toml b/Cargo.toml
+index fa9390e192f4ddd6e8b897faf0fc0dff69728242..a8c97ba3fe594898302b5df57962132138c7f850 100644
+--- a/Cargo.toml
++++ b/Cargo.toml
+@@ -211,3 +211,8 @@ uniffi_bindgen = "=0.24.3"
+ uniffi_build = "=0.24.3"
+ uniffi_macros = "=0.24.3"
+ weedle2 = "=4.0.0"
++
++# Package code v0.1.4 uses code "that will be rejected by a future version of Rust"
++# Shut up such messages for now to make the build succeed
++[future-incompat-report]
++frequency = "never"
diff --git a/0030-Partially-revert-Bug-1768632-Make-EnumSet-compile-fo.patch b/0030-Partially-revert-Bug-1768632-Make-EnumSet-compile-fo.patch
new file mode 100644
index 000000000000..9322a4f81c12
--- /dev/null
+++ b/0030-Partially-revert-Bug-1768632-Make-EnumSet-compile-fo.patch
@@ -0,0 +1,29 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Bj=C3=B6rn=20Bidar?= <bjorn.bidar@jolla.com>
+Date: Sat, 22 Jul 2023 18:15:36 +0300
+Subject: [PATCH] Partially revert "Bug 1768632: Make EnumSet compile for MSVC.
+ r=glandium"
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This reverts commit e9319e5454fc765c035e3b458f0f952cf35311ca partially.
+
+Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
+---
+ mfbt/EnumSet.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/mfbt/EnumSet.h b/mfbt/EnumSet.h
+index f7765c6f5c954f133f846ff27018c888a68f2284..7721d1d1facdebb2e78b63f58a56ac94357a6395 100644
+--- a/mfbt/EnumSet.h
++++ b/mfbt/EnumSet.h
+@@ -326,7 +326,7 @@ class EnumSet {
+ }
+ }
+
+- static constexpr size_t kMaxBits = MaxBits();
++ static constexpr size_t kMaxBits = EnumSet().MaxBits();
+
+ Serialized mBitField;
+
diff --git a/0031-Bug-1796523-Workaround-source-locations-for-function.patch b/0031-Bug-1796523-Workaround-source-locations-for-function.patch
new file mode 100644
index 000000000000..b5bb0fe1b4e2
--- /dev/null
+++ b/0031-Bug-1796523-Workaround-source-locations-for-function.patch
@@ -0,0 +1,29 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Bj=C3=B6rn=20Bidar?= <bjorn.bidar@jolla.com>
+Date: Mon, 7 Aug 2023 10:20:06 +0300
+Subject: [PATCH] Bug 1796523 Workaround source locations for function have
+ changed with GCC
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+https://bugzilla.mozilla.org/show_bug.cgi?id=1796523
+
+Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
+---
+ build/moz.configure/lto-pgo.configure | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/build/moz.configure/lto-pgo.configure b/build/moz.configure/lto-pgo.configure
+index 879e08e7c3b1a00f8bf13cf48bfc345fc80abdb0..922610c3de0e91ff97efc3e9588e323b22440089 100644
+--- a/build/moz.configure/lto-pgo.configure
++++ b/build/moz.configure/lto-pgo.configure
+@@ -87,7 +87,7 @@ def pgo_flags(compiler, profdata, target_is_windows):
+ return namespace(
+ gen_cflags=["-fprofile-generate"],
+ gen_ldflags=["-fprofile-generate"],
+- use_cflags=[profile_use, "-fprofile-correction", "-Wcoverage-mismatch"],
++ use_cflags=[profile_use, "-fprofile-correction", "-Wno-coverage-mismatch"],
+ use_ldflags=[profile_use],
+ )
+
diff --git a/0032-Bug-1807652-Rename-some-methods-to-not-conflict-with.patch b/0032-Bug-1807652-Rename-some-methods-to-not-conflict-with.patch
deleted file mode 100644
index 5d2227f4d0da..000000000000
--- a/0032-Bug-1807652-Rename-some-methods-to-not-conflict-with.patch
+++ /dev/null
@@ -1,160 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Naz=C4=B1m=20Can=20Alt=C4=B1nova?= <canaltinova@gmail.com>
-Date: Mon, 13 Feb 2023 13:52:46 +0000
-Subject: [PATCH] Bug 1807652 - Rename some methods to not conflict with
- aliases r=mstange
-
-We have some aliases with the names of LockedRWFromAnyThread and
-LockedRWOnThread. We also had some methods with the same name. clang and gcc
-that were before version 12 weren't complaining about that. But apparently
-starting from gcc 13, it became an error. This patch renames the methods so we
-don't conflict with these aliases anymore.
-
-Differential Revision: https://phabricator.services.mozilla.com/D169507
----
- tools/profiler/core/platform.cpp | 14 +++++++-------
- tools/profiler/public/ProfilerThreadRegistration.h | 4 ++--
- tools/profiler/public/ProfilerThreadRegistry.h | 4 ++--
- tools/profiler/tests/gtest/GeckoProfiler.cpp | 6 +++---
- 4 files changed, 14 insertions(+), 14 deletions(-)
-
-diff --git a/tools/profiler/core/platform.cpp b/tools/profiler/core/platform.cpp
-index 3a6e5df144d45f3fc530e373cbc6e58332aecf0a..1f116ad26095f6a34b533bec8d8872c1d2770556 100644
---- a/tools/profiler/core/platform.cpp
-+++ b/tools/profiler/core/platform.cpp
-@@ -1178,7 +1178,7 @@ class ActivePS {
- continue;
- }
- ThreadRegistry::OffThreadRef::RWFromAnyThreadWithLock lockedThreadData =
-- offThreadRef.LockedRWFromAnyThread();
-+ offThreadRef.GetLockedRWFromAnyThread();
- MOZ_RELEASE_ASSERT(array.append(ProfiledThreadListElement{
- profiledThreadData->Info().RegisterTime(),
- lockedThreadData->GetJSContext(), profiledThreadData}));
-@@ -4210,7 +4210,7 @@ void SamplerThread::Run() {
-
- if (threadStackSampling) {
- ThreadRegistry::OffThreadRef::RWFromAnyThreadWithLock
-- lockedThreadData = offThreadRef.LockedRWFromAnyThread();
-+ lockedThreadData = offThreadRef.GetLockedRWFromAnyThread();
- // Suspend the thread and collect its stack data in the local
- // buffer.
- mSampler.SuspendAndSampleAndResumeThread(
-@@ -4924,7 +4924,7 @@ static ProfilingStack* locked_register_thread(
- aLock, aOffThreadRef.UnlockedConstReaderCRef().Info());
- if (threadProfilingFeatures != ThreadProfilingFeatures::NotProfiled) {
- ThreadRegistry::OffThreadRef::RWFromAnyThreadWithLock
-- lockedRWFromAnyThread = aOffThreadRef.LockedRWFromAnyThread();
-+ lockedRWFromAnyThread = aOffThreadRef.GetLockedRWFromAnyThread();
-
- ProfiledThreadData* profiledThreadData = ActivePS::AddLiveProfiledThread(
- aLock, MakeUnique<ProfiledThreadData>(
-@@ -5790,7 +5790,7 @@ static void locked_profiler_start(PSLockRef aLock, PowerOfTwo32 aCapacity,
- ActivePS::ProfilingFeaturesForThread(aLock, info);
- if (threadProfilingFeatures != ThreadProfilingFeatures::NotProfiled) {
- ThreadRegistry::OffThreadRef::RWFromAnyThreadWithLock lockedThreadData =
-- offThreadRef.LockedRWFromAnyThread();
-+ offThreadRef.GetLockedRWFromAnyThread();
- ProfiledThreadData* profiledThreadData = ActivePS::AddLiveProfiledThread(
- aLock, MakeUnique<ProfiledThreadData>(info));
- lockedThreadData->SetProfilingFeaturesAndData(threadProfilingFeatures,
-@@ -6014,7 +6014,7 @@ void profiler_ensure_started(PowerOfTwo32 aCapacity, double aInterval,
- }
-
- ThreadRegistry::OffThreadRef::RWFromAnyThreadWithLock lockedThreadData =
-- offThreadRef.LockedRWFromAnyThread();
-+ offThreadRef.GetLockedRWFromAnyThread();
-
- lockedThreadData->ClearProfilingFeaturesAndData(aLock);
-
-@@ -6357,7 +6357,7 @@ static void locked_unregister_thread(
- // thread that is in the process of disappearing.
-
- ThreadRegistration::OnThreadRef::RWOnThreadWithLock lockedThreadData =
-- aOnThreadRef.LockedRWOnThread();
-+ aOnThreadRef.GetLockedRWOnThread();
-
- ProfiledThreadData* profiledThreadData =
- lockedThreadData->GetProfiledThreadData(lock);
-@@ -6878,7 +6878,7 @@ void profiler_clear_js_context() {
- // The profiler mutex must be locked before the ThreadRegistration's.
- PSAutoLock lock;
- ThreadRegistration::OnThreadRef::RWOnThreadWithLock lockedThreadData =
-- aOnThreadRef.LockedRWOnThread();
-+ aOnThreadRef.GetLockedRWOnThread();
-
- if (ProfiledThreadData* profiledThreadData =
- lockedThreadData->GetProfiledThreadData(lock);
-diff --git a/tools/profiler/public/ProfilerThreadRegistration.h b/tools/profiler/public/ProfilerThreadRegistration.h
-index fafe06e446d6392ce93b5804e753a1434d7151ec..3fb931987dc840e6690a1258cdbf5edc734f94a0 100644
---- a/tools/profiler/public/ProfilerThreadRegistration.h
-+++ b/tools/profiler/public/ProfilerThreadRegistration.h
-@@ -214,14 +214,14 @@ class ThreadRegistration {
- DataLock mDataLock;
- };
-
-- [[nodiscard]] RWOnThreadWithLock LockedRWOnThread() {
-+ [[nodiscard]] RWOnThreadWithLock GetLockedRWOnThread() {
- return RWOnThreadWithLock{mThreadRegistration->mData,
- mThreadRegistration->mDataMutex};
- }
-
- template <typename F>
- auto WithLockedRWOnThread(F&& aF) {
-- RWOnThreadWithLock lockedData = LockedRWOnThread();
-+ RWOnThreadWithLock lockedData = GetLockedRWOnThread();
- return std::forward<F>(aF)(lockedData.DataRef());
- }
-
-diff --git a/tools/profiler/public/ProfilerThreadRegistry.h b/tools/profiler/public/ProfilerThreadRegistry.h
-index 76e0c0a78a7cc95b6977055b8f36729dd327a623..4d0fd3ef68049133f3fdf8a7e84e3eec1448ba3e 100644
---- a/tools/profiler/public/ProfilerThreadRegistry.h
-+++ b/tools/profiler/public/ProfilerThreadRegistry.h
-@@ -177,14 +177,14 @@ class ThreadRegistry {
- ThreadRegistration::DataLock mDataLock;
- };
-
-- [[nodiscard]] RWFromAnyThreadWithLock LockedRWFromAnyThread() {
-+ [[nodiscard]] RWFromAnyThreadWithLock GetLockedRWFromAnyThread() {
- return RWFromAnyThreadWithLock{mThreadRegistration->mData,
- mThreadRegistration->mDataMutex};
- }
-
- template <typename F>
- auto WithLockedRWFromAnyThread(F&& aF) {
-- RWFromAnyThreadWithLock lockedData = LockedRWFromAnyThread();
-+ RWFromAnyThreadWithLock lockedData = GetLockedRWFromAnyThread();
- return std::forward<F>(aF)(lockedData.DataRef());
- }
-
-diff --git a/tools/profiler/tests/gtest/GeckoProfiler.cpp b/tools/profiler/tests/gtest/GeckoProfiler.cpp
-index 223aed970d95d0c90de3a91d2c5444ee010d701f..20623ea50ea5314b7e054c5cb78235f7bd96b0f1 100644
---- a/tools/profiler/tests/gtest/GeckoProfiler.cpp
-+++ b/tools/profiler/tests/gtest/GeckoProfiler.cpp
-@@ -622,7 +622,7 @@ TEST(GeckoProfiler, ThreadRegistration_DataAccess)
- EXPECT_FALSE(TR::IsDataMutexLockedOnCurrentThread());
- {
- TR::OnThreadRef::RWOnThreadWithLock rwOnThreadWithLock =
-- aOnThreadRef.LockedRWOnThread();
-+ aOnThreadRef.GetLockedRWOnThread();
- EXPECT_TRUE(TR::IsDataMutexLockedOnCurrentThread());
- TestConstLockedRWOnThread(rwOnThreadWithLock.DataCRef(),
- beforeRegistration, afterRegistration,
-@@ -1021,7 +1021,7 @@ TEST(GeckoProfiler, ThreadRegistry_DataAccess)
- EXPECT_FALSE(TR::IsDataMutexLockedOnCurrentThread());
- {
- TRy::OffThreadRef::RWFromAnyThreadWithLock rwFromAnyThreadWithLock =
-- aOffThreadRef.LockedRWFromAnyThread();
-+ aOffThreadRef.GetLockedRWFromAnyThread();
- if (profiler_current_thread_id() == testThreadId) {
- EXPECT_TRUE(TR::IsDataMutexLockedOnCurrentThread());
- }
-@@ -1158,7 +1158,7 @@ TEST(GeckoProfiler, ThreadRegistration_RegistrationEdgeCases)
- PR_Sleep(PR_MillisecondsToInterval(1));
- }
- TRy::OffThreadRef::RWFromAnyThreadWithLock rwFromAnyThreadWithLock =
-- aOffThreadRef.LockedRWFromAnyThread();
-+ aOffThreadRef.GetLockedRWFromAnyThread();
- ++otherThreadReads;
- if (otherThreadReads % 1000 == 0) {
- PR_Sleep(PR_MillisecondsToInterval(1));
diff --git a/PKGBUILD b/PKGBUILD
index 3c3c1b5d623b..c8893fcf784f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -13,7 +13,7 @@ _pgo=true
_pkgname=firefox
pkgname=$_pkgname-kde-opensuse
-pkgver=107.0
+pkgver=117.0.1
pkgrel=1
pkgdesc="Standalone web browser from mozilla.org with OpenSUSE patch, integrate better with KDE"
arch=('i686' 'x86_64')
@@ -67,45 +67,50 @@ _patchrev=22b224bf3e8c1431d2d9d961ca351cf3c50fdc15
options=('!emptydirs' !lto)
_patchurl=https://raw.githubusercontent.com/openSUSE/firefox-maintenance/$_patchrev
_repo=https://hg.mozilla.org/mozilla-unified
-source=("hg+$_repo#tag=FIREFOX_${pkgver//./_}_RELEASE"
+source=(https://archive.mozilla.org/pub/firefox/releases/$pkgver/source/firefox-$pkgver.source.tar.xz{,.asc}
mozconfig
firefox.desktop
vendor.js
- 0001-Bug-1005535-Get-skia-GPU-building-on-big-endian.patch
- 0002-Allow-to-override-build-date-with-SOURCE_DATE_EPOCH.patch
- 0003-Bug-1504834-Rough-progress-patch.patch
- 0004-Bug-1504834-XULText-AA-fix-BE.patch
- 0005-Fix-top-level-asm-issue.patch
- 0006-mozilla-bmo998749.patch.patch
- 0007-mozilla-s390x-skia-gradient.patch.patch
- 0008-mozilla-libavcodec58_91.patch.patch
- 0009-mozilla-silence-no-return-type.patch-to-fix-build-er.patch
- 0010-Bug-531915-mozilla-bmo531915.patch.patch
- 0011-imported-patch-one_swizzle_to_rule_them_all.patch.patch
- 0012-imported-patch-svg-rendering.patch.patch
- 0013-Bug-1792159-Add-missing-includes-to-AtomicOperations.patch
- 0014-mozilla-s390-context.patch.patch
- 0015-bsc-991344-Rpi3-Firefox-crashes-after-a-few-seconds-.patch
- 0016-mozilla-fix-aarch64-libopus.patch.patch
- 0017-Bug-634334-call-to-the-ntlm_auth-helper-fails.patch
- 0018-Make-PGO-use-toolchain.patch
- 0019-bmo-1516803-force-one-LTO-partition-for-sandbox-when.patch
- 0020-Fix-building-with-PGO-when-using-GCC.patch
- 0021-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch
- 0022-Bug-1516081-Disable-watchdog-during-FDO-train.patch
- 0023-Bug-559213-Support-system-av1.patch
- 0024-Bug-847568-Support-system-harfbuzz.patch
- 0025-Bug-847568-Support-system-graphite2.patch
- 0026-Bug-1611386-Reenable-support-for-enable-system-sqlit.patch
- 0027-Bug-1419151-Add-Unity-menubar-support.patch
- 0028-Do-not-use-gconf-for-proxy-settings-if-not-running-w.patch
- 0029-Add-KDE-integration-to-Firefox-toolkit-parts.patch
- 0030-Add-KDE-integration-to-Firefox.patch
- 0031-Imported-patch-firefox-branded-icons.patch.patch
- 0032-Bug-1807652-Rename-some-methods-to-not-conflict-with.patch
- 0033-Allow-Eme-for-arm-and-Aarch64.patch
+ 0001-Bug-1504834-Rough-progress-patch.patch
+ 0002-Bug-1504834-XULText-AA-fix-BE.patch
+ 0003-mozilla-bmo998749.patch.patch
+ 0004-mozilla-libavcodec58_91.patch.patch
+ 0005-mozilla-silence-no-return-type.patch-to-fix-build-er.patch
+ 0006-Bug-531915-mozilla-bmo531915.patch.patch
+ 0007-imported-patch-one_swizzle_to_rule_them_all.patch.patch
+ 0008-imported-patch-svg-rendering.patch.patch
+ 0009-Bug-1792159-Add-missing-includes-to-AtomicOperations.patch
+ 0010-mozilla-s390-context.patch.patch
+ 0011-bsc-991344-Rpi3-Firefox-crashes-after-a-few-seconds-.patch
+ 0012-mozilla-fix-aarch64-libopus.patch.patch
+ 0013-Bug-634334-call-to-the-ntlm_auth-helper-fails.patch
+ 0014-Make-PGO-use-toolchain.patch
+ 0015-bmo-1516803-force-one-LTO-partition-for-sandbox-when.patch
+ 0016-Fix-building-with-PGO-when-using-GCC.patch
+ 0017-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch
+ 0018-Bug-1516081-Disable-watchdog-during-FDO-train.patch
+ 0019-Bug-559213-Support-system-av1.patch
+ 0020-Bug-847568-Support-system-harfbuzz.patch
+ 0021-Bug-847568-Support-system-graphite2.patch
+ 0022-Bug-1611386-Reenable-support-for-enable-system-sqlit.patch
+ 0023-Bug-1419151-Add-Unity-menubar-support.patch
+ 0024-Do-not-use-gconf-for-proxy-settings-if-not-running-w.patch
+ 0025-Add-KDE-integration-to-Firefox-toolkit-parts.patch
+ 0026-Add-KDE-integration-to-Firefox.patch
+ 0027-Imported-patch-firefox-branded-icons.patch.patch
+ 0028-Allow-Eme-for-arm-and-Aarch64.patch
+ 0029-Shut-up-warnings-about-future-Rust-version-incompati.patch
+ 0030-Partially-revert-Bug-1768632-Make-EnumSet-compile-fo.patch
+ 0031-Bug-1796523-Workaround-source-locations-for-function.patch
)
+validpgpkeys=(
+ # Mozilla Software Releases <release@mozilla.com>
+ # https://blog.mozilla.org/security/2023/05/11/updated-gpg-key-for-signing-firefox-releases/
+ 14F26682D0916CDD81E37B6D61B7B526D98F0353
+)
+
+
# Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
# Note: These are for Arch Linux use ONLY. For your own distribution, please
# get your own set of keys. Feel free to contact foutrelis@archlinux.org for
@@ -247,41 +252,50 @@ END
#workaround for now
#https://bugzilla.mozilla.org/show_bug.cgi?id=658850
ln -sf firefox "$pkgdir/usr/lib/firefox/firefox-bin"
+
+ local sprovider="$pkgdir/usr/share/gnome-shell/search-providers/$pkgname.search-provider.ini"
+ install -Dvm644 /dev/stdin "$sprovider" <<END
+[Shell Search Provider]
+DesktopId=$pkgname.desktop
+BusName=org.mozilla.${pkgname//-/}.SearchProvider
+ObjectPath=/org/mozilla/${pkgname//-/}/SearchProvider
+Version=2
+END
+
}
-md5sums=('SKIP'
- '9530b0395a095c0b47ee42d0996ec163'
- 'a26a061efb4def6572d5b319d657f1d6'
- '4c23d9c0a691d70919beb1dafbbecbd3'
- 'e48cd51c49f5b8b1595f9cd8f55ce819'
- '6945bb71f87e01743a6736fbdb845cfd'
- '954e7d1ff4452e3c8895a186ff815383'
- 'f6e793369b22bd607403d9b9f0565a3c'
- '8df09195607f90a097f21d35dc4d9c30'
- 'a1b878f2e22f096ad907630aa873698f'
- '3256d35703c9a2857503921eb10c3dd7'
- 'efe01b463d50e30de15c03f391e0b366'
- 'ab2a8a5aa3aa2b52f7102466aab7eb7e'
- '63a6be4970c5a999adad40f9e021c366'
- '1c1ce911bbbe548f130e6fca5e136bdd'
- '831c2ccaf07c68cf4f9008692475c1d9'
- 'cc679a9a9abbb9e8a33800b4cb5f4deb'
- '8c0af75143b8f8d4b86e0f438bd8ccc8'
- 'e13a08af8fa75cfebd2ca5d509784046'
- '379b26ef4582c6d15ab61c7944540c7f'
- '7ee193a7b8230b68036f6db5d188f7fc'
- '9266d9fa0c39e30ae2e9c93b3d7822e7'
- '101080a6f3639db7c36dcf1218a83d1a'
- '39a5aa662bd007d0562beaeae4edc175'
- 'a067121f85949a76e709d53871f09834'
- '12f66e9f224381e73aa7e7fb6c535c13'
- 'ad886aed59f72e6f1ad470ab4e96ebd8'
- 'b69acf75b1649f965ac1637e34356038'
- 'd1dfbcdc4951a5d279071323160fe856'
- '3db73a1168751e27a66d7564a9492312'
- 'b30750c85f239ba19b6b0ba308e86990'
- '401a4da2cadcaf12546cb495d63407e4'
- '42ce462dcbdaaed8ffb45b1b5d10a49d'
- 'f792d0ce1e4f3f260862ec70295f2f81'
- 'bc7676460d246f57e8f4e5db1850eaf8'
- '1bc91fa92a1a7ce337ec9b398290f5e8'
- '15a701ef094073919c43701ef4b8b85f')
+sha256sums=('7ea4203b5cf9e59f80043597e2c9020291754fcab784a337586b5f5e1370c416'
+ 'SKIP'
+ 'b440e88515847972a512feb2dd5706a86ad45384cae613c18244bc3c1e0df2a5'
+ '4c93b2e1f1675e033ed7910fe5f379626a92903a940697430985bcfdf94afceb'
+ 'eaad0eee76f89e0a1a241742ec5c8ec9315b096f7b3e0ea302b253b926750aae'
+ '10593c391762298c8f740d432e51224d031f17cf3689341497d3cc02bfa744f3'
+ 'eb19d9568e8d7705b2a0c4774d4f6a758a910c0e5cf427727feb5884a2a1ee98'
+ '4322124dc370ac56063837370a8107e85ca6e0d4037ff71ece5e7b0f55ed8053'
+ '691de24752efa64ebe8f1a77c31ee769bb359c49655352399cf345300c0c6cb6'
+ 'ea2339511a6be6d44406dd478623a41aa0de6a748a5267fe675f90abcb30971a'
+ '2fdb6066cf348843f57b963571e0211acfb2f671896dfad650723129b62bd1af'
+ 'bba76c5e13952ef45362f8e53a5c030e0f5d722f8f266228787136a5312330ea'
+ 'f2fcd4ca82b833f5e5b7e991882e24f09463cd837242b18cf163bc751f2e21d5'
+ '766faefbd4898049e9913589962bf839da6785d50f0631b4eac7316f16bf2ea6'
+ '3aa459ef9295cd76d102a767a8910cc42cfc672bdde9ab98453465a37946024d'
+ 'e5e960afe0a2ed519b3a8d20e645b4defd0ff9920797bf9accdd7b235ab8637d'
+ '32d40630a010ee91d2c35c814ef2f567ad7faf859f8198735829958cb055f53b'
+ '1ffdcff3d4e31c5cceddadfa0111c27a34480594238cdf85866ee1073d922910'
+ '26fe6a707517789f512fffd83009d20544987e944ad4b3d10ed30e8b566f96ba'
+ '4007869a43897d45ba56b631195ff9ce96616cb160e9a3785f2b4c9313115095'
+ '2400173d2c84573194c6af9031663a5b2332ccb4929b246b216c61c97d8b0a54'
+ '04cf5528a4e211a2f33d74282013672ac1a585814c0de46419f2dc3c469a71a7'
+ '72d30acbe1e8488c6bd3af2e0813223842a63b859d6e7aff66d2f23612b7ad8b'
+ '8cd6457b71bf20023f25b66e78cdebb43205f26db03a6d88c64202cc51ba1b39'
+ '039a07b1171a9fc1bd71a792c2ee152f774a1bf34a768eae72113b3ff5fd19e7'
+ 'fdab230f8c1c457277d921cf318771852288c665c01fd1b9f570e1b9be6dac25'
+ 'f129686f536941c820022a95b242c83f4de54facdac59b6eb16db46e84de0c7c'
+ 'a41b65c032a21298eed7d70e83dfbe3d28fe268963803d225914d2a21f97b22c'
+ 'dfb11575e7d43071c9046762408b7267507c645020678d57689d55d3f68c0c28'
+ 'b0bc4493dea4241a5a7e83ce705c25a867a22ff9d610cbbe50c031c65d8c83e8'
+ 'b941526ab077d21dc0e833ff2bd375eb06ff53d3898d3142ef917e3a7f3a67c7'
+ '8fe583a722a48596c93634136fb2bea621b30311bc935447bf4dc0c472aac117'
+ 'eab658c30b83505825765f6a99aeaff693888e6bfa4e5b436349a79c43b322e0'
+ '9b7bf3b170494a2a10b56b2d903902140d50919e1e4a32bcfd16feeb08fa402e'
+ '7038651e09bd1f1cf2561ee977e6fcc58f7295ce821f419288da6d0b2bcc8feb'
+ '0d7a0f8bd7f0a8f1319d79a433d848a3eb43e81f4a14f29d5c8602be49d93cb9')