diff --git a/.gitignore b/.gitignore index a2974b4..083df08 100644 --- a/.gitignore +++ b/.gitignore @@ -389,3 +389,7 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-74.0-20200303.tar.xz /firefox-langpacks-74.0-20200309.tar.xz /firefox-langpacks-74.0-20200310.tar.xz +/firefox-75.0b1.source.tar.xz +/firefox-langpacks-75.0b1-20200310.tar.xz +/firefox-langpacks-75.0b2-20200311.tar.xz +/firefox-75.0b2.source.tar.xz diff --git a/Bug-1610814-Fix-NEON-compile-error-with-gcc-and-RGB-.patch b/Bug-1610814-Fix-NEON-compile-error-with-gcc-and-RGB-.patch deleted file mode 100644 index fc35ae4..0000000 --- a/Bug-1610814-Fix-NEON-compile-error-with-gcc-and-RGB-.patch +++ /dev/null @@ -1,36 +0,0 @@ -From: Andrew Osmond -Date: Wed, 22 Jan 2020 15:19:20 +0000 -Subject: Bug 1610814 - Fix NEON compile error with gcc and RGB unpacking. - r=lsalzman - -This patch makes us use the correct intrinsic for loading a uint8x16 -register. It is not entirely clear why clang accepts this without -complaint but beyond the types, it should be equivalent. - -Differential Revision: https://phabricator.services.mozilla.com/D60667 ---- - gfx/2d/SwizzleNEON.cpp | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/gfx/2d/SwizzleNEON.cpp b/gfx/2d/SwizzleNEON.cpp -index 6b34f76cab1..63f211ff294 100644 ---- a/gfx/2d/SwizzleNEON.cpp -+++ b/gfx/2d/SwizzleNEON.cpp -@@ -412,7 +412,7 @@ void UnpackRowRGB24_NEON(const uint8_t* aSrc, uint8_t* aDst, int32_t aLength) { - src -= 4 * 3; - dst -= 4 * 4; - while (src >= aSrc) { -- uint8x16_t px = vld1q_u16(reinterpret_cast(src)); -+ uint8x16_t px = vld1q_u8(src); - // G2R2B1G1 R1B0G0R0 -> X1R1G1B1 X0R0G0B0 - uint8x8_t pxlo = vtbl1_u8(vget_low_u8(px), masklo); - // B3G3R3B2 G2R2B1G1 -> X3R3G3B3 X2R2G2B2 -@@ -420,7 +420,7 @@ void UnpackRowRGB24_NEON(const uint8_t* aSrc, uint8_t* aDst, int32_t aLength) { - vtbl1_u8(vext_u8(vget_low_u8(px), vget_high_u8(px), 4), maskhi); - px = vcombine_u8(pxlo, pxhi); - px = vorrq_u8(px, alpha); -- vst1q_u16(reinterpret_cast(dst), px); -+ vst1q_u8(dst, px); - src -= 4 * 3; - dst -= 4 * 4; - } diff --git a/cargo-build.patch b/cargo-build.patch new file mode 100644 index 0000000..da79a3f --- /dev/null +++ b/cargo-build.patch @@ -0,0 +1,10 @@ +diff -up firefox-75.0/media/libyuv/libyuv/tools_libyuv/autoroller/unittests/testdata/DEPS.chromium.old firefox-75.0/media/libyuv/libyuv/tools_libyuv/autoroller/unittests/testdata/DEPS.chromium +diff -up firefox-75.0/media/webrtc/trunk/Makefile.old firefox-75.0/media/webrtc/trunk/Makefile +diff -up firefox-75.0/third_party/rust/failure/.cargo-checksum.json.old firefox-75.0/third_party/rust/failure/.cargo-checksum.json +--- firefox-75.0/third_party/rust/failure/.cargo-checksum.json.old 2020-03-09 20:07:11.000000000 +0100 ++++ firefox-75.0/third_party/rust/failure/.cargo-checksum.json 2020-03-10 15:10:13.455161960 +0100 +@@ -1 +1 @@ +-{"files":{".gitlab-ci.yml":"dfbe8fcda3a10c658667ea934358eae2189f7c711e3cff710fba47615b80c75f",".travis.yml":"24291b8baddafc05dafc2a51077985e634154b2fde7d410af6aa748287b3688f","CODE_OF_CONDUCT.md":"9a7bc3fdffac1288f51485e70a910a4e9de1260a64fbe894f60ad73b3386dda9","Cargo.lock.ci":"3c1120d0dc287aa2966eb168521ec84016b09f7f335c6d320f1bee1d367a618e","Cargo.toml":"e0b663963f60c1c368a3821344c00ee8d66142b2aec8a204676d306fb4a20357","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","Makefile":"61a649ecb55115ba0f357215eb322fa6676ce163ca20bff59d7c5e275aa37035","README.md":"bce9d1eae485cda6c5f9ed94fef92c30d60de117a1e3a23563b9308be1bf5d55","RELEASES.md":"3314fd66e694c74ee389796c0307c1ac94e93c62bf9cb7cc3b029d5396244feb","book/src/SUMMARY.md":"32f211f5aeb51a05b3c6a41a128bdb9e410ae84008a93e6b13442e45cd1c91d4","book/src/bail-and-ensure.md":"08fb463570143ec6568189468f1f54a7210b0a1ad66a57f7f7c36619831b4d72","book/src/custom-fail.md":"d4b1501201f9c54637bc40a2413e333f6f7d4fcfc8e3de74bf40d48eca0d4e41","book/src/derive-fail.md":"69916338286f970ae6709fb309bd4d80c321fea10b927f14efe402e3c0a5fdc9","book/src/error-errorkind.md":"5aae25fce531e9740aa70343bcda3de0f2718949922c2e4a91ceb09062c45892","book/src/error-msg.md":"32e17b280379d2bc83e7cb7a6c664a2e9225802f31638beda508056da53ba6af","book/src/error.md":"c978778e7986e5febfb37e635525053ef73c534e4b6e9fc25deb576fdbdc111d","book/src/fail.md":"2865d1fef1d94de5fc086306ba5a734b26dd1d60effa718906919557bf4d779c","book/src/guidance.md":"614cb85ae32c2b59119cd1db7eea008e50b051563c15ba1305f312fa2eeb3ac0","book/src/howto.md":"e18744011f5cc5779f5bb981ebd10f0af440c98398b2eb5af0ee27b9662ee410","book/src/intro.md":"2a6eed661e059016d067d2891e9e27b673425dbc87f077849a302619a182d112","book/src/string-custom-error.md":"55e3ef77748c1dcdfe984fe3c510e7001267ac2b3ece230b90844655dd2da957","book/src/use-error.md":"a7f91e06eb676318da04a56e4b31c73dd7db888d43c215e1534a5bc415e98258","build-docs.sh":"27b611219773192b9f972b2054522481fd5c2c9419c155535f58d05bfc31fffe","examples/bail_ensure.rs":"fffc71e41f9fbbc2a7db453ef20779716007ed6bbb01e45fbcefb1e073745ecc","examples/error_as_cause.rs":"e0a6472455db5e484febc196667bc46c939d9f890bfe550ab7435d52b1ac6b2b","examples/simple.rs":"39b2263d4b92f22c9e1ceefb78b67e1299fc46eba5621d1c47afd937fd7d5318","examples/string_custom_error_pattern.rs":"23b5bf79a7219aa8a80484c0df70cd43d882b7dccd91de9ceb1aac05b0b1b4f2","src/as_fail.rs":"6d4f549f8c9d8abcfbb0a70fe5c0853c82f1c127f87f94fc14c06e2fdaf09db1","src/backtrace/internal.rs":"ff809782e9f9f17928595e00d1bc2f3ff8ccf9b48482126049a318d34957ceb6","src/backtrace/mod.rs":"33c7988b61db9995260fd4470821ea4bce5316052d4c41b4326f99dcc9858b0e","src/box_std.rs":"0455cd53c4a7e5150574ea7c30d5d2692e7e0ff98a83a2fd9656f62600077112","src/compat.rs":"8825b752a92cf1f902424be83b139fa76c85bd016e27565e2ec2fe5dfb4759aa","src/context.rs":"0ee2a96a5c84761bdba37c65babdfd8c556747778a8cac649cdc18747f7d15ba","src/error/error_impl.rs":"74b3337d9dc16de0bdd1cd355841f7035972cded053d7a213590c11c3463d595","src/error/error_impl_small.rs":"e6cbbd4d12e8eec1bd0f15713d33a0e525599268c9316dd40240eb7cd9e19a9d","src/error/mod.rs":"a4f7c1db02d3d16034993b78f5e93d36f70a23ef9218375f952034effd5d58bc","src/error_message.rs":"9c45597e8237c601c4c49aa07adeab41126d38f0886789acf3f8874bb149c6be","src/lib.rs":"11ff9348d697afbf44f73eb82d1cd22509ce4064bd41929fd5fbc677e4d04a42","src/macros.rs":"351758673f77384f82ff3373d96f378706b07ff7ef9c98788a21ae8b1cc70359","src/result_ext.rs":"8088c3cb1481e81891014c99cc0f1b75f25a2f212b52ae856583e4c1f1901d09","src/small_error.rs":"652bf6ff2016d8e31b6ee709ad3efaff9f4e96d5aec8120ea3986a0bb8f57c54","src/sync_failure.rs":"a92a2e8b416196322718a4e7e1262f5b1b0a6be47b849d9a7e1050c1d33490db","tests/basic_fail.rs":"d24b8a90a5a122287eedc91c7322a162f2e0c124494a1084c8dc13c711db278b","tests/fail_compat.rs":"ffc1db79138168a618889d8eb1917d3963e6367a3fc5b2541d3120c480a73310","tests/macro_trailing_comma.rs":"e98caf539fa5e34bb11cd0f7c2a315190cdb8b2aeadeb12c706c19f1f5e8cf3e","travis.sh":"836024f7a56fdbe24a99ab9ce9350713831f4375a60f02593aad6637b766a330"},"package":null} +\ No newline at end of file ++{"files":{".travis.yml":"24291b8baddafc05dafc2a51077985e634154b2fde7d410af6aa748287b3688f","CODE_OF_CONDUCT.md":"9a7bc3fdffac1288f51485e70a910a4e9de1260a64fbe894f60ad73b3386dda9","Cargo.lock.ci":"3c1120d0dc287aa2966eb168521ec84016b09f7f335c6d320f1bee1d367a618e","Cargo.toml":"e0b663963f60c1c368a3821344c00ee8d66142b2aec8a204676d306fb4a20357","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","Makefile":"61a649ecb55115ba0f357215eb322fa6676ce163ca20bff59d7c5e275aa37035","README.md":"bce9d1eae485cda6c5f9ed94fef92c30d60de117a1e3a23563b9308be1bf5d55","RELEASES.md":"3314fd66e694c74ee389796c0307c1ac94e93c62bf9cb7cc3b029d5396244feb","book/src/SUMMARY.md":"32f211f5aeb51a05b3c6a41a128bdb9e410ae84008a93e6b13442e45cd1c91d4","book/src/bail-and-ensure.md":"08fb463570143ec6568189468f1f54a7210b0a1ad66a57f7f7c36619831b4d72","book/src/custom-fail.md":"d4b1501201f9c54637bc40a2413e333f6f7d4fcfc8e3de74bf40d48eca0d4e41","book/src/derive-fail.md":"69916338286f970ae6709fb309bd4d80c321fea10b927f14efe402e3c0a5fdc9","book/src/error-errorkind.md":"5aae25fce531e9740aa70343bcda3de0f2718949922c2e4a91ceb09062c45892","book/src/error-msg.md":"32e17b280379d2bc83e7cb7a6c664a2e9225802f31638beda508056da53ba6af","book/src/error.md":"c978778e7986e5febfb37e635525053ef73c534e4b6e9fc25deb576fdbdc111d","book/src/fail.md":"2865d1fef1d94de5fc086306ba5a734b26dd1d60effa718906919557bf4d779c","book/src/guidance.md":"614cb85ae32c2b59119cd1db7eea008e50b051563c15ba1305f312fa2eeb3ac0","book/src/howto.md":"e18744011f5cc5779f5bb981ebd10f0af440c98398b2eb5af0ee27b9662ee410","book/src/intro.md":"2a6eed661e059016d067d2891e9e27b673425dbc87f077849a302619a182d112","book/src/string-custom-error.md":"55e3ef77748c1dcdfe984fe3c510e7001267ac2b3ece230b90844655dd2da957","book/src/use-error.md":"a7f91e06eb676318da04a56e4b31c73dd7db888d43c215e1534a5bc415e98258","build-docs.sh":"27b611219773192b9f972b2054522481fd5c2c9419c155535f58d05bfc31fffe","examples/bail_ensure.rs":"fffc71e41f9fbbc2a7db453ef20779716007ed6bbb01e45fbcefb1e073745ecc","examples/error_as_cause.rs":"e0a6472455db5e484febc196667bc46c939d9f890bfe550ab7435d52b1ac6b2b","examples/simple.rs":"39b2263d4b92f22c9e1ceefb78b67e1299fc46eba5621d1c47afd937fd7d5318","examples/string_custom_error_pattern.rs":"23b5bf79a7219aa8a80484c0df70cd43d882b7dccd91de9ceb1aac05b0b1b4f2","src/as_fail.rs":"6d4f549f8c9d8abcfbb0a70fe5c0853c82f1c127f87f94fc14c06e2fdaf09db1","src/backtrace/internal.rs":"ff809782e9f9f17928595e00d1bc2f3ff8ccf9b48482126049a318d34957ceb6","src/backtrace/mod.rs":"33c7988b61db9995260fd4470821ea4bce5316052d4c41b4326f99dcc9858b0e","src/box_std.rs":"0455cd53c4a7e5150574ea7c30d5d2692e7e0ff98a83a2fd9656f62600077112","src/compat.rs":"8825b752a92cf1f902424be83b139fa76c85bd016e27565e2ec2fe5dfb4759aa","src/context.rs":"0ee2a96a5c84761bdba37c65babdfd8c556747778a8cac649cdc18747f7d15ba","src/error/error_impl.rs":"74b3337d9dc16de0bdd1cd355841f7035972cded053d7a213590c11c3463d595","src/error/error_impl_small.rs":"e6cbbd4d12e8eec1bd0f15713d33a0e525599268c9316dd40240eb7cd9e19a9d","src/error/mod.rs":"a4f7c1db02d3d16034993b78f5e93d36f70a23ef9218375f952034effd5d58bc","src/error_message.rs":"9c45597e8237c601c4c49aa07adeab41126d38f0886789acf3f8874bb149c6be","src/lib.rs":"11ff9348d697afbf44f73eb82d1cd22509ce4064bd41929fd5fbc677e4d04a42","src/macros.rs":"351758673f77384f82ff3373d96f378706b07ff7ef9c98788a21ae8b1cc70359","src/result_ext.rs":"8088c3cb1481e81891014c99cc0f1b75f25a2f212b52ae856583e4c1f1901d09","src/small_error.rs":"652bf6ff2016d8e31b6ee709ad3efaff9f4e96d5aec8120ea3986a0bb8f57c54","src/sync_failure.rs":"a92a2e8b416196322718a4e7e1262f5b1b0a6be47b849d9a7e1050c1d33490db","tests/basic_fail.rs":"d24b8a90a5a122287eedc91c7322a162f2e0c124494a1084c8dc13c711db278b","tests/fail_compat.rs":"ffc1db79138168a618889d8eb1917d3963e6367a3fc5b2541d3120c480a73310","tests/macro_trailing_comma.rs":"e98caf539fa5e34bb11cd0f7c2a315190cdb8b2aeadeb12c706c19f1f5e8cf3e","travis.sh":"836024f7a56fdbe24a99ab9ce9350713831f4375a60f02593aad6637b766a330"},"package":null} +\ No newline at end of file diff --git a/firefox-locale-debug.patch b/firefox-locale-debug.patch index 0a481cb..95f3e4d 100644 --- a/firefox-locale-debug.patch +++ b/firefox-locale-debug.patch @@ -1,11 +1,14 @@ -diff -up firefox-63.0.1/intl/locale/LocaleService.cpp.old firefox-63.0.1/intl/locale/LocaleService.cpp ---- firefox-63.0.1/intl/locale/LocaleService.cpp.old 2018-11-14 13:34:16.338285161 +0100 -+++ firefox-63.0.1/intl/locale/LocaleService.cpp 2018-11-14 13:34:21.438270308 +0100 -@@ -708,7 +708,6 @@ LocaleService::GetDefaultLocale(nsACStri +diff -up firefox-75.0/intl/locale/LocaleService.cpp.locale-debug firefox-75.0/intl/locale/LocaleService.cpp +--- firefox-75.0/intl/locale/LocaleService.cpp.locale-debug 2020-03-10 11:09:25.839894237 +0100 ++++ firefox-75.0/intl/locale/LocaleService.cpp 2020-03-10 11:09:59.824675890 +0100 +@@ -371,9 +371,7 @@ LocaleService::GetDefaultLocale(nsACStri + // update.locale file is not found, item.len will remain 0 and we'll + // just use our hard-coded default below. GetGREFileContents("update.locale", &locale); - locale.Trim(" \t\n\r"); - // This should never be empty. +- locale.Trim(" \t\n\r"); +- // This should never be empty. - MOZ_ASSERT(!locale.IsEmpty()); - if (SanitizeForBCP47(locale, true)) { ++ locale.Trim(" \t\n\r"); + if (CanonicalizeLanguageId(locale)) { mDefaultLocale.Assign(locale); } diff --git a/firefox-mozconfig b/firefox-mozconfig index 4232142..cc515a2 100644 --- a/firefox-mozconfig +++ b/firefox-mozconfig @@ -12,7 +12,6 @@ ac_add_options --enable-pulseaudio ac_add_options --without-system-icu ac_add_options --enable-release ac_add_options --update-channel=release -ac_add_options --disable-system-sqlite # Workaround for mozbz#1341234 ac_add_options BINDGEN_CFLAGS="$(pkg-config nspr pixman-1 --cflags)" ac_add_options --enable-av1 diff --git a/firefox.spec b/firefox.spec index 83f9f7d..8f82c27 100644 --- a/firefox.spec +++ b/firefox.spec @@ -22,7 +22,7 @@ ExcludeArch: s390x %global enable_mozilla_crashreporter 0 %endif -%global system_nss 1 +%global system_nss 0 %global system_ffi 1 %ifarch armv7hl %global system_libvpx 1 @@ -95,6 +95,7 @@ ExcludeArch: s390x %global tarballdir firefox-%{version} %global official_branding 1 +%global pre_version b2 %bcond_without langpacks @@ -115,13 +116,13 @@ ExcludeArch: s390x Summary: Mozilla Firefox Web browser Name: firefox -Version: 74.0 -Release: 3%{?nss_tag}%{?dist} +Version: 75.0 +Release: 0.1%{?nss_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20200310.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20200311.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -160,7 +161,7 @@ Patch46: firefox-nss-version.patch Patch47: fedora-shebang-build.patch Patch48: build-arm-wasm.patch Patch49: build-arm-libaom.patch -#Patch50: Bug-1610814-Fix-NEON-compile-error-with-gcc-and-RGB-.patch +Patch50: cargo-build.patch # Fedora specific patches Patch215: firefox-enable-addons.patch @@ -171,7 +172,6 @@ Patch224: mozilla-1170092.patch Patch226: rhbz-1354671.patch Patch227: firefox-locale-debug.patch Patch239: mozilla-gnome-shell-search-provider.patch -Patch240: mozilla-gnome-shell-search-provider-icons.patch Patch241: kiosk-workaround.patch # Upstream patches @@ -180,10 +180,10 @@ Patch412: mozilla-1337988.patch Patch415: Bug-1238661---fix-mozillaSignalTrampoline-to-work-.patch Patch417: bug1375074-save-restore-x28.patch Patch422: mozilla-1580174-webrtc-popup.patch +Patch423: mozilla-1619258.patch # Wayland specific upstream patches Patch574: firefox-pipewire.patch -Patch575: mozilla-1609538.patch # PGO/LTO patches Patch600: pgo.patch @@ -363,7 +363,7 @@ This package contains results of tests executed during build. %patch47 -p1 -b .fedora-shebang %patch48 -p1 -b .build-arm-wasm %patch49 -p1 -b .build-arm-libaom -#%patch50 -p1 -b .build-arm-SwizzleNEON +%patch50 -p1 -b .cargo-build # Fedora patches %patch215 -p1 -b .addons @@ -376,10 +376,10 @@ This package contains results of tests executed during build. %endif %patch227 -p1 -b .locale-debug %patch239 -p1 -b .gnome-shell-search-provider -%patch240 -p1 -b .gnome-shell-search-provider-icons # Workaround for kiosk mode # https://bugzilla.mozilla.org/show_bug.cgi?id=1594738 #%patch241 -p1 -b .kiosk-workaround +%patch423 -p1 -b .1619258 %patch402 -p1 -b .1196777 %ifarch %{arm} @@ -388,7 +388,6 @@ This package contains results of tests executed during build. # Wayland specific upstream patches %patch574 -p1 -b .firefox-pipewire -%patch575 -p1 -b .mozilla-1609538 # PGO patches %patch600 -p1 -b .pgo @@ -944,8 +943,8 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %{mozappdir}/gmp-clearkey %{mozappdir}/fonts/TwemojiMozilla.ttf %if !%{?system_nss} -%{mozappdir}/libfreeblpriv3.chk -%{mozappdir}/libsoftokn3.chk +#%{mozappdir}/libfreeblpriv3.chk +#%{mozappdir}/libsoftokn3.chk %exclude %{mozappdir}/libnssckbi.so %endif %if %{build_with_asan} diff --git a/mozilla-1170092.patch b/mozilla-1170092.patch index 65f833f..eadd5f0 100644 --- a/mozilla-1170092.patch +++ b/mozilla-1170092.patch @@ -1,7 +1,7 @@ -diff -up firefox-71.0/extensions/pref/autoconfig/src/nsReadConfig.cpp.1170092 firefox-71.0/extensions/pref/autoconfig/src/nsReadConfig.cpp ---- firefox-71.0/extensions/pref/autoconfig/src/nsReadConfig.cpp.1170092 2019-11-26 01:02:21.000000000 +0100 -+++ firefox-71.0/extensions/pref/autoconfig/src/nsReadConfig.cpp 2019-11-26 10:47:04.316154398 +0100 -@@ -246,8 +246,20 @@ nsresult nsReadConfig::openAndEvaluateJS +diff -up firefox-75.0/extensions/pref/autoconfig/src/nsReadConfig.cpp.1170092 firefox-75.0/extensions/pref/autoconfig/src/nsReadConfig.cpp +--- firefox-75.0/extensions/pref/autoconfig/src/nsReadConfig.cpp.1170092 2020-03-09 20:05:38.000000000 +0100 ++++ firefox-75.0/extensions/pref/autoconfig/src/nsReadConfig.cpp 2020-03-10 10:57:46.543462809 +0100 +@@ -244,8 +244,20 @@ nsresult nsReadConfig::openAndEvaluateJS if (NS_FAILED(rv)) return rv; rv = NS_NewLocalFileInputStream(getter_AddRefs(inStr), jsFile); @@ -23,23 +23,22 @@ diff -up firefox-71.0/extensions/pref/autoconfig/src/nsReadConfig.cpp.1170092 fi } else { nsAutoCString location("resource://gre/defaults/autoconfig/"); location += aFileName; -diff -up firefox-71.0/modules/libpref/Preferences.cpp.1170092 firefox-71.0/modules/libpref/Preferences.cpp ---- firefox-71.0/modules/libpref/Preferences.cpp.1170092 2019-11-26 01:02:25.000000000 +0100 -+++ firefox-71.0/modules/libpref/Preferences.cpp 2019-11-26 10:47:04.316154398 +0100 -@@ -4472,6 +4472,9 @@ nsresult Preferences::InitInitialObjects +diff -up firefox-75.0/modules/libpref/Preferences.cpp.1170092 firefox-75.0/modules/libpref/Preferences.cpp +--- firefox-75.0/modules/libpref/Preferences.cpp.1170092 2020-03-10 10:57:46.543462809 +0100 ++++ firefox-75.0/modules/libpref/Preferences.cpp 2020-03-10 11:07:09.331772495 +0100 +@@ -4468,6 +4468,8 @@ nsresult Preferences::InitInitialObjects // // Thus, in the omni.jar case, we always load app-specific default // preferences from omni.jar, whether or not `$app == $gre`. -+ // + // At very end load configuration from system config location: + // - /etc/firefox/pref/*.js nsresult rv = NS_ERROR_FAILURE; - nsZipFind* findPtr; -diff -up firefox-71.0/toolkit/xre/nsXREDirProvider.cpp.1170092 firefox-71.0/toolkit/xre/nsXREDirProvider.cpp ---- firefox-71.0/toolkit/xre/nsXREDirProvider.cpp.1170092 2019-11-26 01:02:29.000000000 +0100 -+++ firefox-71.0/toolkit/xre/nsXREDirProvider.cpp 2019-11-26 10:49:40.076095714 +0100 -@@ -61,6 +61,7 @@ + UniquePtr find; +diff -up firefox-75.0/toolkit/xre/nsXREDirProvider.cpp.1170092 firefox-75.0/toolkit/xre/nsXREDirProvider.cpp +--- firefox-75.0/toolkit/xre/nsXREDirProvider.cpp.1170092 2020-03-09 20:07:23.000000000 +0100 ++++ firefox-75.0/toolkit/xre/nsXREDirProvider.cpp 2020-03-10 10:57:46.544462803 +0100 +@@ -60,6 +60,7 @@ #endif #ifdef XP_UNIX # include @@ -47,7 +46,7 @@ diff -up firefox-71.0/toolkit/xre/nsXREDirProvider.cpp.1170092 firefox-71.0/tool #endif #ifdef XP_IOS # include "UIKitDirProvider.h" -@@ -526,6 +527,21 @@ nsXREDirProvider::GetFile(const char* aP +@@ -533,6 +534,21 @@ nsXREDirProvider::GetFile(const char* aP } } } @@ -69,7 +68,7 @@ diff -up firefox-71.0/toolkit/xre/nsXREDirProvider.cpp.1170092 firefox-71.0/tool if (NS_FAILED(rv) || !file) return NS_ERROR_FAILURE; if (ensureFilePermissions) { -@@ -842,6 +858,16 @@ nsresult nsXREDirProvider::GetFilesInter +@@ -845,6 +861,16 @@ nsresult nsXREDirProvider::GetFilesInter LoadDirIntoArray(mXULAppDir, kAppendPrefDir, directories); @@ -86,9 +85,9 @@ diff -up firefox-71.0/toolkit/xre/nsXREDirProvider.cpp.1170092 firefox-71.0/tool rv = NS_NewArrayEnumerator(aResult, directories, NS_GET_IID(nsIFile)); } else if (!strcmp(aProperty, NS_APP_CHROME_DIR_LIST)) { // NS_APP_CHROME_DIR_LIST is only used to get default (native) icons -diff -up firefox-71.0/xpcom/io/nsAppDirectoryServiceDefs.h.1170092 firefox-71.0/xpcom/io/nsAppDirectoryServiceDefs.h ---- firefox-71.0/xpcom/io/nsAppDirectoryServiceDefs.h.1170092 2019-11-26 01:02:30.000000000 +0100 -+++ firefox-71.0/xpcom/io/nsAppDirectoryServiceDefs.h 2019-11-26 10:47:04.317154398 +0100 +diff -up firefox-75.0/xpcom/io/nsAppDirectoryServiceDefs.h.1170092 firefox-75.0/xpcom/io/nsAppDirectoryServiceDefs.h +--- firefox-75.0/xpcom/io/nsAppDirectoryServiceDefs.h.1170092 2020-03-09 20:07:32.000000000 +0100 ++++ firefox-75.0/xpcom/io/nsAppDirectoryServiceDefs.h 2020-03-10 10:57:46.544462803 +0100 @@ -60,6 +60,7 @@ #define NS_APP_PREFS_DEFAULTS_DIR_LIST "PrefDL" #define NS_APP_PREFS_OVERRIDE_DIR \ diff --git a/mozilla-1609538.patch b/mozilla-1609538.patch deleted file mode 100644 index eb108db..0000000 --- a/mozilla-1609538.patch +++ /dev/null @@ -1,69 +0,0 @@ -diff -up firefox-74.0/widget/gtk/mozcontainer.cpp.mozilla-1609538 firefox-74.0/widget/gtk/mozcontainer.cpp ---- firefox-74.0/widget/gtk/mozcontainer.cpp.mozilla-1609538 2020-03-02 23:04:56.000000000 +0100 -+++ firefox-74.0/widget/gtk/mozcontainer.cpp 2020-03-04 12:26:05.561668537 +0100 -@@ -164,13 +164,15 @@ void moz_container_move(MozContainer* co - - // wl_subsurface_set_position is actually property of parent surface - // which is effective when parent surface is commited. -- wl_surface* parent_surface = -- moz_gtk_widget_get_wl_surface(GTK_WIDGET(container)); -- if (parent_surface) { -- wl_subsurface_set_position(container->subsurface, container->subsurface_dx, -- container->subsurface_dy); -- wl_surface_commit(parent_surface); -- container->surface_position_needs_update = false; -+ wl_subsurface_set_position(container->subsurface, container->subsurface_dx, -+ container->subsurface_dy); -+ container->surface_position_needs_update = false; -+ -+ GdkWindow* window = gtk_widget_get_window(GTK_WIDGET(container)); -+ if (window) { -+ GdkRectangle rect = (GdkRectangle){.width = gdk_window_get_width(window), -+ .height = gdk_window_get_height(window)}; -+ gdk_window_invalidate_rect(window, &rect, false); - } - } - -@@ -575,11 +577,15 @@ static void moz_container_set_opaque_reg - gtk_widget_get_allocation(GTK_WIDGET(container), &allocation); - - // Set region to mozcontainer which does not have any offset -- wl_region* region = -- CreateOpaqueRegionWayland(0, 0, allocation.width, allocation.height, -- container->opaque_region_subtract_corners); -- wl_surface_set_opaque_region(container->surface, region); -- wl_region_destroy(region); -+ if (container->opaque_region_subtract_corners) { -+ wl_region* region = -+ CreateOpaqueRegionWayland(0, 0, allocation.width, allocation.height, -+ container->opaque_region_subtract_corners); -+ wl_surface_set_opaque_region(container->surface, region); -+ wl_region_destroy(region); -+ } else { -+ wl_surface_set_opaque_region(container->surface, nullptr); -+ } - } - - struct wl_surface* moz_container_get_wl_surface(MozContainer* container) { -diff -up firefox-74.0/widget/gtk/nsWindow.cpp.mozilla-1609538 firefox-74.0/widget/gtk/nsWindow.cpp ---- firefox-74.0/widget/gtk/nsWindow.cpp.mozilla-1609538 2020-03-04 12:23:34.365414768 +0100 -+++ firefox-74.0/widget/gtk/nsWindow.cpp 2020-03-04 12:23:34.368414793 +0100 -@@ -4866,10 +4866,14 @@ void nsWindow::UpdateTopLevelOpaqueRegio - return; - } - -- wl_region* region = -- CreateOpaqueRegionWayland(x, y, width, height, aSubtractCorners); -- wl_surface_set_opaque_region(surface, region); -- wl_region_destroy(region); -+ if (!aSubtractCorners) { -+ wl_region* region = -+ CreateOpaqueRegionWayland(x, y, width, height, aSubtractCorners); -+ wl_surface_set_opaque_region(surface, region); -+ wl_region_destroy(region); -+ } else { -+ wl_surface_set_opaque_region(surface, nullptr); -+ } - - GdkWindow* window = gtk_widget_get_window(mShell); - if (window) { diff --git a/mozilla-1619258.patch b/mozilla-1619258.patch new file mode 100644 index 0000000..6ec11f1 --- /dev/null +++ b/mozilla-1619258.patch @@ -0,0 +1,117 @@ +changeset: 519528:3c63c1d6df70 +parent: 519514:7ac664c14598 +user: Martin Stransky +date: Wed Mar 04 12:46:41 2020 +0100 +files: dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h +description: +Bug 1619258 [Wayland] Enable VA-API for all formats, r?jya + +Differential Revision: https://phabricator.services.mozilla.com/D65536 + + +diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp +--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp ++++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp +@@ -130,20 +130,16 @@ VAAPIFrameHolder::VAAPIFrameHolder(FFmpe + + VAAPIFrameHolder::~VAAPIFrameHolder() { + mLib->av_buffer_unref(&mHWFrame); + mLib->av_buffer_unref(&mAVHWFramesContext); + mLib->av_buffer_unref(&mVAAPIDeviceContext); + } + + AVCodec* FFmpegVideoDecoder::FindVAAPICodec() { +- if (mCodecID != AV_CODEC_ID_H264) { +- return nullptr; +- } +- + AVCodec* decoder = mLib->avcodec_find_decoder(mCodecID); + for (int i = 0;; i++) { + const AVCodecHWConfig* config = mLib->avcodec_get_hw_config(decoder, i); + if (!config) { + break; + } + if (config->methods & AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX && + config->device_type == AV_HWDEVICE_TYPE_VAAPI) { +@@ -167,17 +163,16 @@ bool FFmpegVideoDecoder::Crea + } + + mCodecContext->hw_device_ctx = mLib->av_buffer_ref(mVAAPIDeviceContext); + return true; + } + + MediaResult FFmpegVideoDecoder::InitVAAPIDecoder() { + FFMPEG_LOG("Initialising VA-API FFmpeg decoder"); +- MOZ_ASSERT(mCodecID == AV_CODEC_ID_H264); + + if (!mLib->IsVAAPIAvailable()) { + FFMPEG_LOG("libva library is missing"); + return NS_ERROR_NOT_AVAILABLE; + } + + if (!gfxPlatformGtk::GetPlatform()->UseWaylandHardwareVideoDecoding()) { + FFMPEG_LOG("VA-API FFmpeg is disabled by platform"); +@@ -277,21 +272,19 @@ FFmpegVideoDecoder::FFmpegVid + mExtraData = new MediaByteBuffer; + mExtraData->AppendElements(*aConfig.mExtraData); + } + + RefPtr FFmpegVideoDecoder::Init() { + MediaResult rv; + + #ifdef MOZ_WAYLAND_USE_VAAPI +- if (mCodecID == AV_CODEC_ID_H264) { +- rv = InitVAAPIDecoder(); +- if (NS_SUCCEEDED(rv)) { +- return InitPromise::CreateAndResolve(TrackInfo::kVideoTrack, __func__); +- } ++ rv = InitVAAPIDecoder(); ++ if (NS_SUCCEEDED(rv)) { ++ return InitPromise::CreateAndResolve(TrackInfo::kVideoTrack, __func__); + } + #endif + + rv = InitDecoder(); + if (NS_SUCCEEDED(rv)) { + return InitPromise::CreateAndResolve(TrackInfo::kVideoTrack, __func__); + } + +@@ -692,9 +685,16 @@ void FFmpegVideoDecoder::Proc + #ifdef MOZ_WAYLAND_USE_VAAPI + if (mVAAPIDeviceContext) { + mLib->av_buffer_unref(&mVAAPIDeviceContext); + } + #endif + FFmpegDataDecoder::ProcessShutdown(); + } + ++#ifdef MOZ_WAYLAND_USE_VAAPI ++bool FFmpegVideoDecoder::IsHardwareAccelerated( ++ nsACString& aFailureReason) const { ++ return mVAAPIDeviceContext != nullptr; ++} ++#endif ++ + } // namespace mozilla +diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h +--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h ++++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h +@@ -87,16 +87,17 @@ class FFmpegVideoDecoder + MediaResult CreateImage(int64_t aOffset, int64_t aPts, int64_t aDuration, + MediaDataDecoder::DecodedData& aResults); + + #ifdef MOZ_WAYLAND_USE_VAAPI + MediaResult InitVAAPIDecoder(); + bool CreateVAAPIDeviceContext(); + void InitVAAPICodecContext(); + AVCodec* FindVAAPICodec(); ++ bool IsHardwareAccelerated(nsACString& aFailureReason) const override; + + MediaResult CreateImageVAAPI(int64_t aOffset, int64_t aPts, int64_t aDuration, + MediaDataDecoder::DecodedData& aResults); + #endif + + /** + * This method allocates a buffer for FFmpeg's decoder, wrapped in an Image. + * Currently it only supports Planar YUV420, which appears to be the only + diff --git a/mozilla-gnome-shell-search-provider-icons.patch b/mozilla-gnome-shell-search-provider-icons.patch deleted file mode 100644 index fd9dbe8..0000000 --- a/mozilla-gnome-shell-search-provider-icons.patch +++ /dev/null @@ -1,453 +0,0 @@ -changeset: 504680:441b26f2d4f4 -parent: 504674:5a55ac856fc4 -user: Martin Stransky -date: Mon Dec 02 12:21:08 2019 +0100 -files: browser/components/shell/nsGNOMEShellSearchProvider.cpp browser/components/shell/nsGNOMEShellSearchProvider.h -description: -Bug 1239694 Use history icons with Gnome shell search provider, r?jhorak - -Differential Revision: https://phabricator.services.mozilla.com/D55434 - - -diff --git a/browser/components/shell/nsGNOMEShellSearchProvider.cpp b/browser/components/shell/nsGNOMEShellSearchProvider.cpp ---- a/browser/components/shell/nsGNOMEShellSearchProvider.cpp -+++ b/browser/components/shell/nsGNOMEShellSearchProvider.cpp -@@ -19,21 +19,27 @@ - #include "nsPrintfCString.h" - #include "nsCOMPtr.h" - #include "nsGTKToolkit.h" - #include "nsINavHistoryService.h" - #include "nsToolkitCompsCID.h" - #include "nsIFaviconService.h" - #include "RemoteUtils.h" - #include "nsIStringBundle.h" -+#include "imgIContainer.h" -+#include "imgITools.h" -+ -+#include "mozilla/gfx/DataSurfaceHelpers.h" - - #include - #include - --#define MAX_SEARCH_RESULTS_NUM 9 -+using namespace mozilla; -+using namespace mozilla::gfx; -+ - #define KEYWORD_SEARCH_STRING "special:search" - #define KEYWORD_SEARCH_STRING_LEN 14 - - #define DBUS_BUS_NAME "org.mozilla.Firefox.SearchProvider" - #define DBUS_OBJECT_PATH "/org/mozilla/Firefox/SearchProvider" - - static const char* introspect_template = - " aData, -+ int aWidth, int aHeight, -+ int aIconIndex) { -+ MOZ_ASSERT(mSearchSerial == aSearchSerial); -+ MOZ_ASSERT(aIconIndex < MAX_SEARCH_RESULTS_NUM); -+ mHistoryIcons[aIconIndex].Set(aSearchSerial, std::move(aData), aWidth, -+ aHeight); -+} -+ -+nsresult nsGNOMEShellSearchProvider::NewHistorySearch(const char* aSearchTerm) { -+ // Initialize new search which invalidates all preview ones -+ mSearchSerial++; -+ - nsresult rv; - nsCOMPtr histQuery; - rv = mHistoryService->GetNewQuery(getter_AddRefs(histQuery)); - NS_ENSURE_SUCCESS(rv, rv); - - nsAutoCString searchTerm(aSearchTerm); - rv = histQuery->SetSearchTerms(NS_ConvertUTF8toUTF16(searchTerm)); - NS_ENSURE_SUCCESS(rv, rv); -@@ -165,24 +189,123 @@ void nsGNOMEShellSearchProvider::GetIDKe - - int nsGNOMEShellSearchProvider::GetIndexFromIDKey(const char* aIDKey) { - // ID is NN:URL where NN is index to our current history - // result container. - char tmp[] = {aIDKey[0], aIDKey[1], '\0'}; - return atoi(tmp); - } - -+class AsyncFaviconDataReady final : public nsIFaviconDataCallback { -+ public: -+ NS_DECL_ISUPPORTS -+ NS_DECL_NSIFAVICONDATACALLBACK -+ -+ AsyncFaviconDataReady(nsGNOMEShellSearchProvider* aSearchProvider, -+ int aIconIndex, int aSearchSerial) -+ : mSearchProvider(aSearchProvider), -+ mIconIndex(aIconIndex), -+ mSearchSerial(aSearchSerial){}; -+ -+ private: -+ ~AsyncFaviconDataReady() {} -+ -+ nsGNOMEShellSearchProvider* mSearchProvider; -+ int mIconIndex; -+ int mSearchSerial; -+}; -+ -+NS_IMPL_ISUPPORTS(AsyncFaviconDataReady, nsIFaviconDataCallback) -+ -+// Inspired by SurfaceToPackedBGRA -+static UniquePtr SurfaceToPackedRGBA(DataSourceSurface* aSurface) { -+ IntSize size = aSurface->GetSize(); -+ CheckedInt bufferSize = -+ CheckedInt(size.width * 4) * CheckedInt(size.height); -+ if (!bufferSize.isValid()) { -+ return nullptr; -+ } -+ UniquePtr imageBuffer(new (std::nothrow) -+ uint8_t[bufferSize.value()]); -+ if (!imageBuffer) { -+ return nullptr; -+ } -+ -+ DataSourceSurface::MappedSurface map; -+ if (!aSurface->Map(DataSourceSurface::MapType::READ, &map)) { -+ return nullptr; -+ } -+ -+ // Convert BGRA to RGBA -+ uint32_t* aSrc = (uint32_t*)map.mData; -+ uint32_t* aDst = (uint32_t*)imageBuffer.get(); -+ for (int i = 0; i < size.width * size.height; i++, aDst++, aSrc++) { -+ *aDst = *aSrc & 0xff00ff00; -+ *aDst |= (*aSrc & 0xff) << 16; -+ *aDst |= (*aSrc & 0xff0000) >> 16; -+ } -+ -+ aSurface->Unmap(); -+ -+ return imageBuffer; -+} -+ -+NS_IMETHODIMP -+AsyncFaviconDataReady::OnComplete(nsIURI* aFaviconURI, uint32_t aDataLen, -+ const uint8_t* aData, -+ const nsACString& aMimeType, -+ uint16_t aWidth) { -+ // This is a callback from some previous search so we don't want it -+ if (mSearchSerial != mSearchProvider->GetSearchSerial() || !aData || -+ !aDataLen) { -+ return NS_ERROR_FAILURE; -+ } -+ -+ // Decode the image from the format it was returned to us in (probably PNG) -+ nsCOMPtr container; -+ nsCOMPtr imgtool = do_CreateInstance("@mozilla.org/image/tools;1"); -+ nsresult rv = imgtool->DecodeImageFromBuffer( -+ reinterpret_cast(aData), aDataLen, aMimeType, -+ getter_AddRefs(container)); -+ NS_ENSURE_SUCCESS(rv, rv); -+ -+ RefPtr surface = container->GetFrame( -+ imgIContainer::FRAME_FIRST, -+ imgIContainer::FLAG_SYNC_DECODE | imgIContainer::FLAG_ASYNC_NOTIFY); -+ -+ if (!surface || surface->GetFormat() != SurfaceFormat::B8G8R8A8) { -+ return NS_ERROR_FAILURE; -+ } -+ -+ // Allocate a new buffer that we own. -+ RefPtr dataSurface = surface->GetDataSurface(); -+ UniquePtr data = SurfaceToPackedRGBA(dataSurface); -+ if (!data) { -+ return NS_ERROR_OUT_OF_MEMORY; -+ } -+ -+ mSearchProvider->SetHistoryIcon(mSearchSerial, std::move(data), -+ surface->GetSize().width, -+ surface->GetSize().height, mIconIndex); -+ return NS_OK; -+} -+ - void nsGNOMEShellSearchProvider::ComposeSearchResultReply( - DBusMessage* reply, const char* aSearchTerm) { - uint32_t childCount = 0; - nsresult rv = mHistResultContainer->GetChildCount(&childCount); - if (NS_FAILED(rv) || childCount == 0) { - return; - } - -+ // Obtain the favicon service and get the favicon for the specified page -+ nsCOMPtr favIconSvc( -+ do_GetService("@mozilla.org/browser/favicon-service;1")); -+ nsCOMPtr ios(do_GetService(NS_IOSERVICE_CONTRACTID)); -+ - if (childCount > MAX_SEARCH_RESULTS_NUM) { - childCount = MAX_SEARCH_RESULTS_NUM; - } - - DBusMessageIter iter; - dbus_message_iter_init_append(reply, &iter); - DBusMessageIter iterArray; - dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "s", &iterArray); -@@ -195,16 +318,22 @@ void nsGNOMEShellSearchProvider::Compose - } - if (!IsHistoryResultNodeURI(child)) { - continue; - } - - nsAutoCString uri; - child->GetUri(uri); - -+ nsCOMPtr iconIri; -+ ios->NewURI(uri, nullptr, nullptr, getter_AddRefs(iconIri)); -+ nsCOMPtr callback = -+ new AsyncFaviconDataReady(this, i, mSearchSerial); -+ favIconSvc->GetFaviconDataForPage(iconIri, callback, 0); -+ - nsAutoCString idKey; - GetIDKeyForURI(i, uri, idKey); - - const char* id = idKey.get(); - dbus_message_iter_append_basic(&iterArray, DBUS_TYPE_STRING, &id); - } - - nsPrintfCString searchString("%s:%s", KEYWORD_SEARCH_STRING, aSearchTerm); -@@ -221,17 +350,17 @@ DBusHandlerResult nsGNOMEShellSearchProv - int elements; - - if (!dbus_message_get_args(aMsg, nullptr, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, - &stringArray, &elements, DBUS_TYPE_INVALID) || - elements == 0) { - reply = dbus_message_new_error(aMsg, DBUS_BUS_NAME, "Wrong argument"); - } else { - reply = dbus_message_new_method_return(aMsg); -- nsresult rv = QueryHistory(stringArray[0]); -+ nsresult rv = NewHistorySearch(stringArray[0]); - if (NS_SUCCEEDED(rv)) { - ComposeSearchResultReply(reply, stringArray[0]); - } - dbus_free_string_array(stringArray); - } - - dbus_connection_send(mConnection, reply, nullptr); - dbus_message_unref(reply); -@@ -249,17 +378,17 @@ DBusHandlerResult nsGNOMEShellSearchProv - if (!dbus_message_get_args(aMsg, nullptr, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, - &unusedArray, &unusedNum, DBUS_TYPE_ARRAY, - DBUS_TYPE_STRING, &stringArray, &elements, - DBUS_TYPE_INVALID) || - elements == 0) { - reply = dbus_message_new_error(aMsg, DBUS_BUS_NAME, "Wrong argument"); - } else { - reply = dbus_message_new_method_return(aMsg); -- nsresult rv = QueryHistory(stringArray[0]); -+ nsresult rv = NewHistorySearch(stringArray[0]); - if (NS_SUCCEEDED(rv)) { - ComposeSearchResultReply(reply, stringArray[0]); - } - } - - if (unusedArray) { - dbus_free_string_array(unusedArray); - } -@@ -280,45 +409,88 @@ static void appendStringDictionary(DBusM - &iterDict); - dbus_message_iter_append_basic(&iterDict, DBUS_TYPE_STRING, &aKey); - dbus_message_iter_open_container(&iterDict, DBUS_TYPE_VARIANT, "s", &iterVar); - dbus_message_iter_append_basic(&iterVar, DBUS_TYPE_STRING, &aValue); - dbus_message_iter_close_container(&iterDict, &iterVar); - dbus_message_iter_close_container(aIter, &iterDict); - } - -+/* -+ "icon-data": a tuple of type (iiibiiay) describing a pixbuf with width, -+ height, rowstride, has-alpha, -+ bits-per-sample, channels, -+ image data -+*/ -+void GnomeHistoryIcon::AppendIcon(DBusMessageIter* aIter) { -+ DBusMessageIter iterDict, iterVar, iterStruct; -+ dbus_message_iter_open_container(aIter, DBUS_TYPE_DICT_ENTRY, nullptr, -+ &iterDict); -+ const char* key = "icon-data"; -+ dbus_message_iter_append_basic(&iterDict, DBUS_TYPE_STRING, &key); -+ dbus_message_iter_open_container(&iterDict, DBUS_TYPE_VARIANT, "(iiibiiay)", -+ &iterVar); -+ dbus_message_iter_open_container(&iterVar, DBUS_TYPE_STRUCT, nullptr, -+ &iterStruct); -+ -+ dbus_message_iter_append_basic(&iterStruct, DBUS_TYPE_INT32, &mWidth); -+ dbus_message_iter_append_basic(&iterStruct, DBUS_TYPE_INT32, &mHeight); -+ int rowstride = mWidth * 4; -+ dbus_message_iter_append_basic(&iterStruct, DBUS_TYPE_INT32, &rowstride); -+ int hasAlpha = true; -+ dbus_message_iter_append_basic(&iterStruct, DBUS_TYPE_BOOLEAN, &hasAlpha); -+ int bitsPerSample = 8; -+ dbus_message_iter_append_basic(&iterStruct, DBUS_TYPE_INT32, &bitsPerSample); -+ int channels = 4; -+ dbus_message_iter_append_basic(&iterStruct, DBUS_TYPE_INT32, &channels); -+ -+ DBusMessageIter iterArray; -+ dbus_message_iter_open_container(&iterStruct, DBUS_TYPE_ARRAY, "y", -+ &iterArray); -+ unsigned char* array = mData.get(); -+ dbus_message_iter_append_fixed_array(&iterArray, DBUS_TYPE_BYTE, &array, -+ mWidth * mHeight * 4); -+ dbus_message_iter_close_container(&iterStruct, &iterArray); -+ -+ dbus_message_iter_close_container(&iterVar, &iterStruct); -+ dbus_message_iter_close_container(&iterDict, &iterVar); -+ dbus_message_iter_close_container(aIter, &iterDict); -+} -+ - /* We can return those fields at GetResultMetas: - "id": the result ID - "name": the display name for the result - "icon": a serialized GIcon (see g_icon_serialize()), or alternatively, - "gicon": a textual representation of a GIcon (see g_icon_to_string()), - or alternativly, - "icon-data": a tuple of type (iiibiiay) describing a pixbuf with width, - height, rowstride, has-alpha, bits-per-sample, and image data - "description": an optional short description (1-2 lines) - */ - void nsGNOMEShellSearchProvider::AppendResultID(DBusMessageIter* aIter, - const char* aID) { -+ int index = GetIndexFromIDKey(aID); - nsCOMPtr child; -- mHistResultContainer->GetChild(GetIndexFromIDKey(aID), getter_AddRefs(child)); -+ mHistResultContainer->GetChild(index, getter_AddRefs(child)); - nsAutoCString title; -- if (NS_FAILED(child->GetTitle(title))) { -- return; -- } -+ nsAutoCString uri; -+ child->GetTitle(title); -+ child->GetUri(uri); - -- if (title.IsEmpty()) { -- if (NS_FAILED(child->GetUri(title)) || title.IsEmpty()) { -- return; -- } -- } -+ const char* titleStr = !(title.IsEmpty()) ? title.get() : uri.get(); -+ const char* descStr = uri.get(); - -- const char* titleStr = title.get(); - appendStringDictionary(aIter, "id", aID); - appendStringDictionary(aIter, "name", titleStr); -- appendStringDictionary(aIter, "gicon", "text-html"); -+ appendStringDictionary(aIter, "description", descStr); -+ if (mHistoryIcons[index].GetSearchSerial() == mSearchSerial) { -+ mHistoryIcons[index].AppendIcon(aIter); -+ } else { -+ appendStringDictionary(aIter, "gicon", "text-html"); -+ } - } - - void nsGNOMEShellSearchProvider::AppendSearchID(DBusMessageIter* aIter, - const char* aID) { - if (strlen(aID) < KEYWORD_SEARCH_STRING_LEN + 2) { - return; - } - appendStringDictionary(aIter, "id", KEYWORD_SEARCH_STRING); -diff --git a/browser/components/shell/nsGNOMEShellSearchProvider.h b/browser/components/shell/nsGNOMEShellSearchProvider.h ---- a/browser/components/shell/nsGNOMEShellSearchProvider.h -+++ b/browser/components/shell/nsGNOMEShellSearchProvider.h -@@ -7,49 +7,81 @@ - - #ifndef __nsGNOMEShellSearchProvider_h__ - #define __nsGNOMEShellSearchProvider_h__ - - #include "mozilla/DBusHelpers.h" - #include "nsINavHistoryService.h" - #include "nsUnixRemoteServer.h" - #include "nsCOMPtr.h" -+#include "mozilla/UniquePtr.h" -+ -+#define MAX_SEARCH_RESULTS_NUM 9 -+ -+class GnomeHistoryIcon { -+ public: -+ GnomeHistoryIcon() : mSearchSerial(-1), mWidth(0), mHeight(0){}; -+ -+ // From which search is this icon -+ void Set(int aSearchSerial, mozilla::UniquePtr aData, int aWidth, -+ int aHeight) { -+ mSearchSerial = aSearchSerial; -+ mWidth = aWidth; -+ mHeight = aHeight; -+ mData = std::move(aData); -+ } -+ -+ int GetSearchSerial() { return mSearchSerial; } -+ void AppendIcon(DBusMessageIter* aIter); -+ -+ private: -+ int mSearchSerial; -+ mozilla::UniquePtr mData; -+ int mWidth; -+ int mHeight; -+}; - - class nsGNOMEShellSearchProvider : public nsUnixRemoteServer { - public: -- nsGNOMEShellSearchProvider() : mConnection(nullptr) {} -+ nsGNOMEShellSearchProvider(); - ~nsGNOMEShellSearchProvider() { Shutdown(); } - - nsresult Startup(); - void Shutdown(); - - DBusHandlerResult HandleDBusMessage(DBusConnection* aConnection, - DBusMessage* msg); - void UnregisterDBusInterface(DBusConnection* aConnection); - -+ int GetSearchSerial() { return mSearchSerial; } -+ void SetHistoryIcon(int aSearchSerial, mozilla::UniquePtr aData, -+ int aWidth, int aHeight, int aIconIndex); -+ - private: - DBusHandlerResult Introspect(DBusMessage* msg); - - DBusHandlerResult GetInitialResultSet(DBusMessage* msg); - DBusHandlerResult GetSubsearchResultSet(DBusMessage* msg); - DBusHandlerResult GetResultMetas(DBusMessage* msg); - DBusHandlerResult ActivateResult(DBusMessage* msg); - DBusHandlerResult LaunchSearch(DBusMessage* msg); - -- nsresult QueryHistory(const char* aSearchTerm); -+ nsresult NewHistorySearch(const char* aSearchTerm); - void GetIDKeyForURI(int aIndex, nsAutoCString& aUri, nsAutoCString& aIDKey); - int GetIndexFromIDKey(const char* aIDKey); - bool IsHistoryResultNodeURI(nsINavHistoryResultNode* aHistoryNode); - void AppendResultID(DBusMessageIter* aIter, const char* aID); - void AppendSearchID(DBusMessageIter* aIter, const char* aID); - void ComposeSearchResultReply(DBusMessage* aReply, const char* aSearchTerm); - void LaunchWithID(const char* aID, uint32_t aTimeStamp); - void LaunchWithAllResults(uint32_t aTimeStamp); - - // The connection is owned by DBus library - RefPtr mConnection; - nsCOMPtr mHistResultContainer; - nsCOMPtr mHistoryService; - nsAutoCStringN<32> mSearchTerm; - nsAutoCString mGnomeSearchTitle; -+ int mSearchSerial; -+ GnomeHistoryIcon mHistoryIcons[MAX_SEARCH_RESULTS_NUM]; - }; - - #endif // __nsGNOMEShellSearchProvider_h__ - diff --git a/mozilla-gnome-shell-search-provider.patch b/mozilla-gnome-shell-search-provider.patch index 4660128..ebc9b80 100644 --- a/mozilla-gnome-shell-search-provider.patch +++ b/mozilla-gnome-shell-search-provider.patch @@ -1,7 +1,11 @@ -diff -up firefox-73.0/browser/components/shell/moz.build.gnome-shell-search-provider firefox-73.0/browser/components/shell/moz.build ---- firefox-73.0/browser/components/shell/moz.build.gnome-shell-search-provider 2020-02-07 22:12:59.000000000 +0100 -+++ firefox-73.0/browser/components/shell/moz.build 2020-02-11 09:03:31.638803105 +0100 -@@ -34,6 +34,11 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gt +diff -up firefox-75.0/browser/components/shell/moz.build.gnome-shell-search-provider firefox-75.0/browser/components/shell/moz.build +--- firefox-75.0/browser/components/shell/moz.build.gnome-shell-search-provider 2020-03-09 20:05:31.000000000 +0100 ++++ firefox-75.0/browser/components/shell/moz.build 2020-03-11 10:10:14.935836645 +0100 +@@ -36,10 +36,16 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gt + XPIDL_SOURCES += [ + 'nsIGNOMEShellService.idl', + ] +- SOURCES += [ 'nsGNOMEShellService.cpp', ] @@ -9,11 +13,13 @@ diff -up firefox-73.0/browser/components/shell/moz.build.gnome-shell-search-prov + SOURCES += [ + 'nsGNOMEShellSearchProvider.cpp', + ] -+ ++ LOCAL_INCLUDES += [ ++ '/netwerk/base', ++ ] elif CONFIG['OS_ARCH'] == 'WINNT': XPIDL_SOURCES += [ 'nsIWindowsShellService.idl', -@@ -60,6 +65,8 @@ for var in ('MOZ_APP_NAME', 'MOZ_APP_VER +@@ -66,6 +72,8 @@ for var in ('MOZ_APP_NAME', 'MOZ_APP_VER DEFINES[var] = '"%s"' % CONFIG[var] CXXFLAGS += CONFIG['TK_CFLAGS'] @@ -22,10 +28,10 @@ diff -up firefox-73.0/browser/components/shell/moz.build.gnome-shell-search-prov with Files('**'): BUG_COMPONENT = ('Firefox', 'Shell Integration') -diff -up firefox-73.0/browser/components/shell/nsGNOMEShellSearchProvider.cpp.gnome-shell-search-provider firefox-73.0/browser/components/shell/nsGNOMEShellSearchProvider.cpp ---- firefox-73.0/browser/components/shell/nsGNOMEShellSearchProvider.cpp.gnome-shell-search-provider 2020-02-11 09:00:59.350512802 +0100 -+++ firefox-73.0/browser/components/shell/nsGNOMEShellSearchProvider.cpp 2020-02-11 09:00:59.350512802 +0100 -@@ -0,0 +1,621 @@ +diff -up firefox-75.0/browser/components/shell/nsGNOMEShellSearchProvider.cpp.gnome-shell-search-provider firefox-75.0/browser/components/shell/nsGNOMEShellSearchProvider.cpp +--- firefox-75.0/browser/components/shell/nsGNOMEShellSearchProvider.cpp.gnome-shell-search-provider 2020-03-10 15:44:12.305387571 +0100 ++++ firefox-75.0/browser/components/shell/nsGNOMEShellSearchProvider.cpp 2020-03-11 10:18:05.196419671 +0100 +@@ -0,0 +1,796 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:expandtab:shiftwidth=2:tabstop=2: + */ @@ -35,6 +41,9 @@ diff -up firefox-73.0/browser/components/shell/nsGNOMEShellSearchProvider.cpp.gn + +#include "nsGNOMEShellSearchProvider.h" + ++#include "nsWeakReference.h" ++#include "nsNetCID.h" ++#include "nsIOService.h" +#include "nsIBaseWindow.h" +#include "nsIDocShell.h" +#include "nsPIDOMWindow.h" @@ -52,11 +61,17 @@ diff -up firefox-73.0/browser/components/shell/nsGNOMEShellSearchProvider.cpp.gn +#include "nsIFaviconService.h" +#include "RemoteUtils.h" +#include "nsIStringBundle.h" ++#include "imgIContainer.h" ++#include "imgITools.h" ++ ++#include "mozilla/gfx/DataSurfaceHelpers.h" + +#include +#include + -+#define MAX_SEARCH_RESULTS_NUM 9 ++using namespace mozilla; ++using namespace mozilla::gfx; ++ +#define KEYWORD_SEARCH_STRING "special:search" +#define KEYWORD_SEARCH_STRING_LEN 14 + @@ -114,7 +129,25 @@ diff -up firefox-73.0/browser/components/shell/nsGNOMEShellSearchProvider.cpp.gn + return DBUS_HANDLER_RESULT_HANDLED; +} + -+nsresult nsGNOMEShellSearchProvider::QueryHistory(const char* aSearchTerm) { ++nsGNOMEShellSearchProvider::nsGNOMEShellSearchProvider() ++ : mConnection(nullptr), mSearchSerial(0) { ++ memset(mHistoryIcons, 0, sizeof(mHistoryIcons)); ++} ++ ++void nsGNOMEShellSearchProvider::SetHistoryIcon(int aSearchSerial, ++ UniquePtr aData, ++ int aWidth, int aHeight, ++ int aIconIndex) { ++ MOZ_ASSERT(mSearchSerial == aSearchSerial); ++ MOZ_ASSERT(aIconIndex < MAX_SEARCH_RESULTS_NUM); ++ mHistoryIcons[aIconIndex].Set(aSearchSerial, std::move(aData), aWidth, ++ aHeight); ++} ++ ++nsresult nsGNOMEShellSearchProvider::NewHistorySearch(const char* aSearchTerm) { ++ // Initialize new search which invalidates all preview ones ++ mSearchSerial++; ++ + nsresult rv; + nsCOMPtr histQuery; + rv = mHistoryService->GetNewQuery(getter_AddRefs(histQuery)); @@ -198,6 +231,100 @@ diff -up firefox-73.0/browser/components/shell/nsGNOMEShellSearchProvider.cpp.gn + return atoi(tmp); +} + ++class AsyncFaviconDataReady final : public nsIFaviconDataCallback { ++ public: ++ NS_DECL_ISUPPORTS ++ NS_DECL_NSIFAVICONDATACALLBACK ++ ++ AsyncFaviconDataReady(nsGNOMEShellSearchProvider* aSearchProvider, ++ int aIconIndex, int aSearchSerial) ++ : mSearchProvider(aSearchProvider), ++ mIconIndex(aIconIndex), ++ mSearchSerial(aSearchSerial){}; ++ ++ private: ++ ~AsyncFaviconDataReady() {} ++ ++ nsGNOMEShellSearchProvider* mSearchProvider; ++ int mIconIndex; ++ int mSearchSerial; ++}; ++ ++NS_IMPL_ISUPPORTS(AsyncFaviconDataReady, nsIFaviconDataCallback) ++ ++// Inspired by SurfaceToPackedBGRA ++static UniquePtr SurfaceToPackedRGBA(DataSourceSurface* aSurface) { ++ IntSize size = aSurface->GetSize(); ++ CheckedInt bufferSize = ++ CheckedInt(size.width * 4) * CheckedInt(size.height); ++ if (!bufferSize.isValid()) { ++ return nullptr; ++ } ++ UniquePtr imageBuffer(new (std::nothrow) ++ uint8_t[bufferSize.value()]); ++ if (!imageBuffer) { ++ return nullptr; ++ } ++ ++ DataSourceSurface::MappedSurface map; ++ if (!aSurface->Map(DataSourceSurface::MapType::READ, &map)) { ++ return nullptr; ++ } ++ ++ // Convert BGRA to RGBA ++ uint32_t* aSrc = (uint32_t*)map.mData; ++ uint32_t* aDst = (uint32_t*)imageBuffer.get(); ++ for (int i = 0; i < size.width * size.height; i++, aDst++, aSrc++) { ++ *aDst = *aSrc & 0xff00ff00; ++ *aDst |= (*aSrc & 0xff) << 16; ++ *aDst |= (*aSrc & 0xff0000) >> 16; ++ } ++ ++ aSurface->Unmap(); ++ ++ return imageBuffer; ++} ++ ++NS_IMETHODIMP ++AsyncFaviconDataReady::OnComplete(nsIURI* aFaviconURI, uint32_t aDataLen, ++ const uint8_t* aData, ++ const nsACString& aMimeType, ++ uint16_t aWidth) { ++ // This is a callback from some previous search so we don't want it ++ if (mSearchSerial != mSearchProvider->GetSearchSerial() || !aData || ++ !aDataLen) { ++ return NS_ERROR_FAILURE; ++ } ++ ++ // Decode the image from the format it was returned to us in (probably PNG) ++ nsCOMPtr container; ++ nsCOMPtr imgtool = do_CreateInstance("@mozilla.org/image/tools;1"); ++ nsresult rv = imgtool->DecodeImageFromBuffer( ++ reinterpret_cast(aData), aDataLen, aMimeType, ++ getter_AddRefs(container)); ++ NS_ENSURE_SUCCESS(rv, rv); ++ ++ RefPtr surface = container->GetFrame( ++ imgIContainer::FRAME_FIRST, ++ imgIContainer::FLAG_SYNC_DECODE | imgIContainer::FLAG_ASYNC_NOTIFY); ++ ++ if (!surface || surface->GetFormat() != SurfaceFormat::B8G8R8A8) { ++ return NS_ERROR_FAILURE; ++ } ++ ++ // Allocate a new buffer that we own. ++ RefPtr dataSurface = surface->GetDataSurface(); ++ UniquePtr data = SurfaceToPackedRGBA(dataSurface); ++ if (!data) { ++ return NS_ERROR_OUT_OF_MEMORY; ++ } ++ ++ mSearchProvider->SetHistoryIcon(mSearchSerial, std::move(data), ++ surface->GetSize().width, ++ surface->GetSize().height, mIconIndex); ++ return NS_OK; ++} ++ +void nsGNOMEShellSearchProvider::ComposeSearchResultReply( + DBusMessage* reply, const char* aSearchTerm) { + uint32_t childCount = 0; @@ -206,6 +333,11 @@ diff -up firefox-73.0/browser/components/shell/nsGNOMEShellSearchProvider.cpp.gn + return; + } + ++ // Obtain the favicon service and get the favicon for the specified page ++ nsCOMPtr favIconSvc( ++ do_GetService("@mozilla.org/browser/favicon-service;1")); ++ nsCOMPtr ios(do_GetService(NS_IOSERVICE_CONTRACTID)); ++ + if (childCount > MAX_SEARCH_RESULTS_NUM) { + childCount = MAX_SEARCH_RESULTS_NUM; + } @@ -228,6 +360,12 @@ diff -up firefox-73.0/browser/components/shell/nsGNOMEShellSearchProvider.cpp.gn + nsAutoCString uri; + child->GetUri(uri); + ++ nsCOMPtr iconIri; ++ ios->NewURI(uri, nullptr, nullptr, getter_AddRefs(iconIri)); ++ nsCOMPtr callback = ++ new AsyncFaviconDataReady(this, i, mSearchSerial); ++ favIconSvc->GetFaviconDataForPage(iconIri, callback, 0); ++ + nsAutoCString idKey; + GetIDKeyForURI(i, uri, idKey); + @@ -254,7 +392,7 @@ diff -up firefox-73.0/browser/components/shell/nsGNOMEShellSearchProvider.cpp.gn + reply = dbus_message_new_error(aMsg, DBUS_BUS_NAME, "Wrong argument"); + } else { + reply = dbus_message_new_method_return(aMsg); -+ nsresult rv = QueryHistory(stringArray[0]); ++ nsresult rv = NewHistorySearch(stringArray[0]); + if (NS_SUCCEEDED(rv)) { + ComposeSearchResultReply(reply, stringArray[0]); + } @@ -282,7 +420,7 @@ diff -up firefox-73.0/browser/components/shell/nsGNOMEShellSearchProvider.cpp.gn + reply = dbus_message_new_error(aMsg, DBUS_BUS_NAME, "Wrong argument"); + } else { + reply = dbus_message_new_method_return(aMsg); -+ nsresult rv = QueryHistory(stringArray[0]); ++ nsresult rv = NewHistorySearch(stringArray[0]); + if (NS_SUCCEEDED(rv)) { + ComposeSearchResultReply(reply, stringArray[0]); + } @@ -313,6 +451,47 @@ diff -up firefox-73.0/browser/components/shell/nsGNOMEShellSearchProvider.cpp.gn + dbus_message_iter_close_container(aIter, &iterDict); +} + ++/* ++ "icon-data": a tuple of type (iiibiiay) describing a pixbuf with width, ++ height, rowstride, has-alpha, ++ bits-per-sample, channels, ++ image data ++*/ ++void GnomeHistoryIcon::AppendIcon(DBusMessageIter* aIter) { ++ DBusMessageIter iterDict, iterVar, iterStruct; ++ dbus_message_iter_open_container(aIter, DBUS_TYPE_DICT_ENTRY, nullptr, ++ &iterDict); ++ const char* key = "icon-data"; ++ dbus_message_iter_append_basic(&iterDict, DBUS_TYPE_STRING, &key); ++ dbus_message_iter_open_container(&iterDict, DBUS_TYPE_VARIANT, "(iiibiiay)", ++ &iterVar); ++ dbus_message_iter_open_container(&iterVar, DBUS_TYPE_STRUCT, nullptr, ++ &iterStruct); ++ ++ dbus_message_iter_append_basic(&iterStruct, DBUS_TYPE_INT32, &mWidth); ++ dbus_message_iter_append_basic(&iterStruct, DBUS_TYPE_INT32, &mHeight); ++ int rowstride = mWidth * 4; ++ dbus_message_iter_append_basic(&iterStruct, DBUS_TYPE_INT32, &rowstride); ++ int hasAlpha = true; ++ dbus_message_iter_append_basic(&iterStruct, DBUS_TYPE_BOOLEAN, &hasAlpha); ++ int bitsPerSample = 8; ++ dbus_message_iter_append_basic(&iterStruct, DBUS_TYPE_INT32, &bitsPerSample); ++ int channels = 4; ++ dbus_message_iter_append_basic(&iterStruct, DBUS_TYPE_INT32, &channels); ++ ++ DBusMessageIter iterArray; ++ dbus_message_iter_open_container(&iterStruct, DBUS_TYPE_ARRAY, "y", ++ &iterArray); ++ unsigned char* array = mData.get(); ++ dbus_message_iter_append_fixed_array(&iterArray, DBUS_TYPE_BYTE, &array, ++ mWidth * mHeight * 4); ++ dbus_message_iter_close_container(&iterStruct, &iterArray); ++ ++ dbus_message_iter_close_container(&iterVar, &iterStruct); ++ dbus_message_iter_close_container(&iterDict, &iterVar); ++ dbus_message_iter_close_container(aIter, &iterDict); ++} ++ +/* We can return those fields at GetResultMetas: + "id": the result ID + "name": the display name for the result @@ -325,23 +504,25 @@ diff -up firefox-73.0/browser/components/shell/nsGNOMEShellSearchProvider.cpp.gn +*/ +void nsGNOMEShellSearchProvider::AppendResultID(DBusMessageIter* aIter, + const char* aID) { ++ int index = GetIndexFromIDKey(aID); + nsCOMPtr child; -+ mHistResultContainer->GetChild(GetIndexFromIDKey(aID), getter_AddRefs(child)); ++ mHistResultContainer->GetChild(index, getter_AddRefs(child)); + nsAutoCString title; -+ if (NS_FAILED(child->GetTitle(title))) { -+ return; -+ } ++ nsAutoCString uri; ++ child->GetTitle(title); ++ child->GetUri(uri); + -+ if (title.IsEmpty()) { -+ if (NS_FAILED(child->GetUri(title)) || title.IsEmpty()) { -+ return; -+ } -+ } ++ const char* titleStr = !(title.IsEmpty()) ? title.get() : uri.get(); ++ const char* descStr = uri.get(); + -+ const char* titleStr = title.get(); + appendStringDictionary(aIter, "id", aID); + appendStringDictionary(aIter, "name", titleStr); -+ appendStringDictionary(aIter, "gicon", "text-html"); ++ appendStringDictionary(aIter, "description", descStr); ++ if (mHistoryIcons[index].GetSearchSerial() == mSearchSerial) { ++ mHistoryIcons[index].AppendIcon(aIter); ++ } else { ++ appendStringDictionary(aIter, "gicon", "text-html"); ++ } +} + +void nsGNOMEShellSearchProvider::AppendSearchID(DBusMessageIter* aIter, @@ -647,10 +828,10 @@ diff -up firefox-73.0/browser/components/shell/nsGNOMEShellSearchProvider.cpp.gn + // dbus_connection_unref() will be called by RefPtr here. + mConnection = nullptr; +} -diff -up firefox-73.0/browser/components/shell/nsGNOMEShellSearchProvider.h.gnome-shell-search-provider firefox-73.0/browser/components/shell/nsGNOMEShellSearchProvider.h ---- firefox-73.0/browser/components/shell/nsGNOMEShellSearchProvider.h.gnome-shell-search-provider 2020-02-11 09:00:59.350512802 +0100 -+++ firefox-73.0/browser/components/shell/nsGNOMEShellSearchProvider.h 2020-02-11 09:00:59.350512802 +0100 -@@ -0,0 +1,55 @@ +diff -up firefox-75.0/browser/components/shell/nsGNOMEShellSearchProvider.h.gnome-shell-search-provider firefox-75.0/browser/components/shell/nsGNOMEShellSearchProvider.h +--- firefox-75.0/browser/components/shell/nsGNOMEShellSearchProvider.h.gnome-shell-search-provider 2020-03-10 15:44:12.305387571 +0100 ++++ firefox-75.0/browser/components/shell/nsGNOMEShellSearchProvider.h 2020-03-10 15:44:12.308387552 +0100 +@@ -0,0 +1,87 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:expandtab:shiftwidth=2:tabstop=2: + */ @@ -665,10 +846,36 @@ diff -up firefox-73.0/browser/components/shell/nsGNOMEShellSearchProvider.h.gnom +#include "nsINavHistoryService.h" +#include "nsUnixRemoteServer.h" +#include "nsCOMPtr.h" ++#include "mozilla/UniquePtr.h" ++ ++#define MAX_SEARCH_RESULTS_NUM 9 ++ ++class GnomeHistoryIcon { ++ public: ++ GnomeHistoryIcon() : mSearchSerial(-1), mWidth(0), mHeight(0){}; ++ ++ // From which search is this icon ++ void Set(int aSearchSerial, mozilla::UniquePtr aData, int aWidth, ++ int aHeight) { ++ mSearchSerial = aSearchSerial; ++ mWidth = aWidth; ++ mHeight = aHeight; ++ mData = std::move(aData); ++ } ++ ++ int GetSearchSerial() { return mSearchSerial; } ++ void AppendIcon(DBusMessageIter* aIter); ++ ++ private: ++ int mSearchSerial; ++ mozilla::UniquePtr mData; ++ int mWidth; ++ int mHeight; ++}; + +class nsGNOMEShellSearchProvider : public nsUnixRemoteServer { + public: -+ nsGNOMEShellSearchProvider() : mConnection(nullptr) {} ++ nsGNOMEShellSearchProvider(); + ~nsGNOMEShellSearchProvider() { Shutdown(); } + + nsresult Startup(); @@ -678,6 +885,10 @@ diff -up firefox-73.0/browser/components/shell/nsGNOMEShellSearchProvider.h.gnom + DBusMessage* msg); + void UnregisterDBusInterface(DBusConnection* aConnection); + ++ int GetSearchSerial() { return mSearchSerial; } ++ void SetHistoryIcon(int aSearchSerial, mozilla::UniquePtr aData, ++ int aWidth, int aHeight, int aIconIndex); ++ + private: + DBusHandlerResult Introspect(DBusMessage* msg); + @@ -687,7 +898,7 @@ diff -up firefox-73.0/browser/components/shell/nsGNOMEShellSearchProvider.h.gnom + DBusHandlerResult ActivateResult(DBusMessage* msg); + DBusHandlerResult LaunchSearch(DBusMessage* msg); + -+ nsresult QueryHistory(const char* aSearchTerm); ++ nsresult NewHistorySearch(const char* aSearchTerm); + void GetIDKeyForURI(int aIndex, nsAutoCString& aUri, nsAutoCString& aIDKey); + int GetIndexFromIDKey(const char* aIDKey); + bool IsHistoryResultNodeURI(nsINavHistoryResultNode* aHistoryNode); @@ -703,13 +914,15 @@ diff -up firefox-73.0/browser/components/shell/nsGNOMEShellSearchProvider.h.gnom + nsCOMPtr mHistoryService; + nsAutoCStringN<32> mSearchTerm; + nsAutoCString mGnomeSearchTitle; ++ int mSearchSerial; ++ GnomeHistoryIcon mHistoryIcons[MAX_SEARCH_RESULTS_NUM]; +}; + +#endif // __nsGNOMEShellSearchProvider_h__ -diff -up firefox-73.0/browser/components/shell/nsGNOMEShellService.cpp.gnome-shell-search-provider firefox-73.0/browser/components/shell/nsGNOMEShellService.cpp ---- firefox-73.0/browser/components/shell/nsGNOMEShellService.cpp.gnome-shell-search-provider 2020-02-07 22:12:59.000000000 +0100 -+++ firefox-73.0/browser/components/shell/nsGNOMEShellService.cpp 2020-02-11 09:00:59.350512802 +0100 -@@ -89,6 +89,14 @@ nsresult nsGNOMEShellService::Init() { +diff -up firefox-75.0/browser/components/shell/nsGNOMEShellService.cpp.gnome-shell-search-provider firefox-75.0/browser/components/shell/nsGNOMEShellService.cpp +--- firefox-75.0/browser/components/shell/nsGNOMEShellService.cpp.gnome-shell-search-provider 2020-03-09 20:05:31.000000000 +0100 ++++ firefox-75.0/browser/components/shell/nsGNOMEShellService.cpp 2020-03-10 15:44:12.305387571 +0100 +@@ -101,6 +101,14 @@ nsresult nsGNOMEShellService::Init() { if (!giovfs && !gsettings) return NS_ERROR_NOT_AVAILABLE; @@ -724,9 +937,9 @@ diff -up firefox-73.0/browser/components/shell/nsGNOMEShellService.cpp.gnome-she // Check G_BROKEN_FILENAMES. If it's set, then filenames in glib use // the locale encoding. If it's not set, they use UTF-8. mUseLocaleFilenames = PR_GetEnv("G_BROKEN_FILENAMES") != nullptr; -diff -up firefox-73.0/browser/components/shell/nsGNOMEShellService.h.gnome-shell-search-provider firefox-73.0/browser/components/shell/nsGNOMEShellService.h ---- firefox-73.0/browser/components/shell/nsGNOMEShellService.h.gnome-shell-search-provider 2020-02-07 22:12:59.000000000 +0100 -+++ firefox-73.0/browser/components/shell/nsGNOMEShellService.h 2020-02-11 09:00:59.350512802 +0100 +diff -up firefox-75.0/browser/components/shell/nsGNOMEShellService.h.gnome-shell-search-provider firefox-75.0/browser/components/shell/nsGNOMEShellService.h +--- firefox-75.0/browser/components/shell/nsGNOMEShellService.h.gnome-shell-search-provider 2020-03-09 20:05:31.000000000 +0100 ++++ firefox-75.0/browser/components/shell/nsGNOMEShellService.h 2020-03-10 15:44:12.305387571 +0100 @@ -10,6 +10,9 @@ #include "nsToolkitShellService.h" #include "nsString.h" @@ -747,10 +960,10 @@ diff -up firefox-73.0/browser/components/shell/nsGNOMEShellService.h.gnome-shell bool GetAppPathFromLauncher(); bool mUseLocaleFilenames; nsCString mAppPath; -diff -up firefox-73.0/browser/locales/en-US/chrome/browser/browser.properties.gnome-shell-search-provider firefox-73.0/browser/locales/en-US/chrome/browser/browser.properties ---- firefox-73.0/browser/locales/en-US/chrome/browser/browser.properties.gnome-shell-search-provider 2020-02-07 22:13:00.000000000 +0100 -+++ firefox-73.0/browser/locales/en-US/chrome/browser/browser.properties 2020-02-11 09:00:59.350512802 +0100 -@@ -1047,3 +1047,7 @@ confirmationHint.breakageReport.label = +diff -up firefox-75.0/browser/locales/en-US/chrome/browser/browser.properties.gnome-shell-search-provider firefox-75.0/browser/locales/en-US/chrome/browser/browser.properties +--- firefox-75.0/browser/locales/en-US/chrome/browser/browser.properties.gnome-shell-search-provider 2020-03-09 20:05:31.000000000 +0100 ++++ firefox-75.0/browser/locales/en-US/chrome/browser/browser.properties 2020-03-10 15:44:12.306387565 +0100 +@@ -1044,3 +1044,7 @@ confirmationHint.breakageReport.label = # Used by the export of user's live bookmarks to an OPML file as a title for the file. # %S will be replaced with brandShortName livebookmarkMigration.title = %S Live Bookmarks @@ -758,9 +971,9 @@ diff -up firefox-73.0/browser/locales/en-US/chrome/browser/browser.properties.gn +# LOCALIZATION NOTE (gnomeSearchProviderSearch): +# Used for search by Gnome Shell activity screen, %s is a searched string. +gnomeSearchProviderSearch=Search the web for ā€œ%sā€ -diff -up firefox-73.0/toolkit/components/remote/moz.build.gnome-shell-search-provider firefox-73.0/toolkit/components/remote/moz.build ---- firefox-73.0/toolkit/components/remote/moz.build.gnome-shell-search-provider 2020-02-07 22:13:54.000000000 +0100 -+++ firefox-73.0/toolkit/components/remote/moz.build 2020-02-11 09:00:59.351512811 +0100 +diff -up firefox-75.0/toolkit/components/remote/moz.build.gnome-shell-search-provider firefox-75.0/toolkit/components/remote/moz.build +--- firefox-75.0/toolkit/components/remote/moz.build.gnome-shell-search-provider 2020-03-09 20:07:32.000000000 +0100 ++++ firefox-75.0/toolkit/components/remote/moz.build 2020-03-10 15:44:12.306387565 +0100 @@ -25,6 +25,10 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk' 'nsDBusRemoteServer.cpp', ] @@ -772,9 +985,9 @@ diff -up firefox-73.0/toolkit/components/remote/moz.build.gnome-shell-search-pro CXXFLAGS += CONFIG['TK_CFLAGS'] if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows': -diff -up firefox-73.0/toolkit/components/remote/nsDBusRemoteServer.cpp.gnome-shell-search-provider firefox-73.0/toolkit/components/remote/nsDBusRemoteServer.cpp ---- firefox-73.0/toolkit/components/remote/nsDBusRemoteServer.cpp.gnome-shell-search-provider 2020-02-07 22:13:54.000000000 +0100 -+++ firefox-73.0/toolkit/components/remote/nsDBusRemoteServer.cpp 2020-02-11 09:00:59.351512811 +0100 +diff -up firefox-75.0/toolkit/components/remote/nsDBusRemoteServer.cpp.gnome-shell-search-provider firefox-75.0/toolkit/components/remote/nsDBusRemoteServer.cpp +--- firefox-75.0/toolkit/components/remote/nsDBusRemoteServer.cpp.gnome-shell-search-provider 2020-03-09 20:07:00.000000000 +0100 ++++ firefox-75.0/toolkit/components/remote/nsDBusRemoteServer.cpp 2020-03-10 15:44:12.306387565 +0100 @@ -23,7 +23,7 @@ #include diff --git a/sources b/sources index c635466..ad589db 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ SHA512 (cbindgen-vendor.tar.xz) = a12d9dd45301614f3a7fcd77f61e3f731718fc418fcf84b0ac7363ef4ddd8ff60e057febef917620ac89d2d47d76b8dccfa71405935e346b849b93425732016a -SHA512 (firefox-74.0.source.tar.xz) = 710ae0803e7261ecda359b64edfd4142433619570817cc02d1e0381897a69cfa5863f01759d0658ffc16a72c568f01cf5ae3ec91777fa71db43cfa73340a5b88 -SHA512 (firefox-langpacks-74.0-20200310.tar.xz) = 4b67837cd6c23244339f064627a18a26c82e972cac4d2431d6cf588302b57977955ab2ebf0b529bec05ff90f5118b8ee9aefd436b0f3c060ae74acc0c2330578 +SHA512 (firefox-langpacks-75.0b2-20200311.tar.xz) = 43937ba89768e7a04be09bd6c71bd8ecd304cb3426de7a85196697010c72ce7b76085c7df6f5cbc3e5858f6db8a09809786af0ea10c35815a05e427a3d5bb4e7 +SHA512 (firefox-75.0b2.source.tar.xz) = 22292e90def9bc99c788a4eed13b7b887ccf95d7904ba649773c557854ffd4e22e3798404753a40146ef612c9bfbd71822f6b1547f0cfee6df8c52b47727f48c