Compare commits

..

No commits in common. "rawhide" and "f34" have entirely different histories.

49 changed files with 4958 additions and 480 deletions

130
.gitignore vendored
View file

@ -166,133 +166,3 @@
/icecat-78.14.0-rh1.tar.bz2
/icecat-78.15.0-langpacks.tar.gz
/icecat-78.15.0-rh1.tar.bz2
/icecat-91.2.0-langpacks.tar.gz
/icecat-91.2.0-rh1.tar.bz2
/icecat-91.3.0-langpacks.tar.gz
/icecat-91.3.0-rh1.tar.bz2
/icecat-91.4.0-langpacks.tar.gz
/icecat-91.4.0-rh1.tar.bz2
/icecat-91.4.1-langpacks.tar.gz
/icecat-91.4.1-rh1.tar.bz2
/icecat-91.5.0-langpacks.tar.gz
/icecat-91.5.0-rh1.tar.bz2
/icecat-91.6.0-langpacks.tar.gz
/icecat-91.6.0-rh1.tar.bz2
/icecat-91.6.1-langpacks.tar.gz
/icecat-91.6.1-rh1.tar.bz2
/icecat-91.7.0-langpacks.tar.gz
/icecat-91.7.0-rh1.tar.bz2
/icecat-91.7.1-langpacks.tar.gz
/icecat-91.7.1-rh1.tar.bz2
/icecat-91.8.0-langpacks.tar.gz
/icecat-91.8.0-rh1.tar.bz2
/icecat-91.9.0-langpacks.tar.gz
/icecat-91.9.0-rh1.tar.bz2
/icecat-91.9.1-langpacks.tar.gz
/icecat-91.9.1-rh1.tar.bz2
/icecat-91.10.0-langpacks.tar.gz
/icecat-91.10.0-rh1.tar.bz2
/icecat-91.10.0-rh2.tar.bz2
/icecat-91.10.0-rh3.tar.bz2
/icecat-91.11.0-langpacks.tar.gz
/icecat-91.11.0-rh1.tar.bz2
/icecat-91.12.0-langpacks.tar.gz
/icecat-91.12.0-rh1.tar.bz2
/icecat-91.13.0-langpacks.tar.gz
/icecat-91.13.0-rh1.tar.bz2
/icecat-102.2.0-langpacks.tar.gz
/icecat-102.2.0-rh1.tar.bz2
/icecat-102.3.0-langpacks.tar.gz
/icecat-102.3.0-rh1.tar.bz2
/icecat-102.4.0-langpacks.tar.gz
/icecat-102.4.0-rh1.tar.bz2
/icecat-102.5.0-langpacks.tar.gz
/icecat-102.5.0-rh1.tar.bz2
/icecat-102.6.0-langpacks.tar.gz
/icecat-102.6.0-rh1.tar.bz2
/icecat-102.7.0-langpacks.tar.gz
/icecat-102.7.0-rh1.tar.bz2
/icecat-102.8.0-langpacks.tar.gz
/icecat-102.8.0-rh1.tar.bz2
/icecat-102.9.0-langpacks.tar.gz
/icecat-102.9.0-rh1.tar.bz2
/icecat-102.10.0-langpacks.tar.gz
/icecat-102.10.0-rh1.tar.bz2
/icecat-102.11.0-langpacks.tar.gz
/icecat-102.11.0-rh1.tar.bz2
/icecat-102.11.0-rh2.tar.bz2
/icecat-102.12.0-langpacks.tar.gz
/icecat-102.12.0-rh1.tar.bz2
/icecat-102.13.0-langpacks.tar.gz
/icecat-102.13.0-rh1.tar.bz2
/icecat-102.14.0-langpacks.tar.gz
/icecat-102.14.0-rh1.tar.bz2
/icecat-102.15.0-langpacks.tar.gz
/icecat-102.15.0-rh1.tar.bz2
/icecat-115.3.1-langpacks.tar.gz
/icecat-115.3.1-rh1.tar.bz2
/icecat-115.3.1-rh2.tar.bz2
/icecat-115.4.0-langpacks.tar.gz
/icecat-115.4.0-rh1.tar.bz2
/icecat-115.4.0-rh2.tar.bz2
/icecat-115.5.0-langpacks.tar.gz
/icecat-115.5.0-rh1.tar.bz2
/icecat-115.6.0-langpacks.tar.gz
/icecat-115.6.0-rh1.tar.bz2
/icecat-115.7.0-langpacks.tar.gz
/icecat-115.7.0-rh1.tar.bz2
/icecat-115.8.0-langpacks.tar.gz
/icecat-115.8.0-rh1.tar.bz2
/icecat-115.9.0-langpacks.tar.gz
/icecat-115.9.0-rh1.tar.bz2
/icecat-115.10.0-langpacks.tar.gz
/icecat-115.10.0-rh1.tar.bz2
/icecat-115.11.0-langpacks.tar.gz
/icecat-115.11.0-rh1.tar.bz2
/icecat-115.12.0-langpacks.tar.gz
/icecat-115.12.0-rh1.tar.bz2
/icecat-115.13.0-langpacks.tar.gz
/icecat-115.13.0-rh1.tar.bz2
/icecat-115.14.0-langpacks.tar.gz
/icecat-115.14.0-rh1.tar.bz2
/icecat-115.15.0-langpacks.tar.gz
/icecat-115.15.0-rh1.tar.bz2
/icecat-115.16.0-langpacks.tar.gz
/icecat-115.16.0-rh1.tar.bz2
/icecat-115.16.1-langpacks.tar.gz
/icecat-115.16.1-rh1.tar.bz2
/icecat-115.17.0-langpacks.tar.gz
/icecat-115.17.0-rh1.tar.bz2
/icecat-115.18.0-langpacks.tar.gz
/icecat-115.18.0-rh1.tar.bz2
/icecat-115.18.0-rh2.tar.bz2
/icecat-115.19.0-langpacks.tar.gz
/icecat-115.19.0-rh1.tar.bz2
/icecat-115.20.0-langpacks.tar.gz
/icecat-115.20.0-rh1.tar.bz2
/icecat-115.21.0-langpacks.tar.gz
/icecat-115.21.0-rh1.tar.bz2
/icecat-115.22.0-langpacks.tar.gz
/icecat-115.22.0-rh1.tar.bz2
/icecat-115.23.0-langpacks.tar.gz
/icecat-115.23.0-rh1.tar.bz2
/icecat-115.23.1-langpacks.tar.gz
/icecat-115.23.1-rh1.tar.bz2
/icecat-115.24.0-langpacks.tar.gz
/icecat-115.24.0-rh1.tar.bz2
/icecat-128.12.0-langpacks.tar.gz
/icecat-128.12.0-rh1.tar.bz2
/icecat-128.13.0-langpacks.tar.gz
/icecat-128.13.0-rh1.tar.bz2
/icecat-128.14.0-langpacks.tar.gz
/icecat-128.14.0-rh1.tar.bz2
/icecat-140.3.0-langpacks.tar.gz
/icecat-140.3.0-rh1.tar.bz2
/icecat-140.4.0-langpacks.tar.gz
/icecat-140.4.0-rh1.tar.bz2
/icecat-140.5.0-langpacks.tar.gz
/icecat-140.5.0-rh1.tar.bz2
/icecat-140.6.0-langpacks.tar.gz
/icecat-140.6.0-rh1.tar.bz2
/icecat-140.7.0-langpacks.tar.gz
/icecat-140.7.0-rh1.tar.bz2

View file

@ -0,0 +1,12 @@
diff -up firefox-60.0/mfbt/LinuxSignal.h.mozilla-1238661 firefox-60.0/mfbt/LinuxSignal.h
--- firefox-60.0/mfbt/LinuxSignal.h.mozilla-1238661 2018-04-27 08:55:38.848241768 +0200
+++ firefox-60.0/mfbt/LinuxSignal.h 2018-04-27 09:06:47.946769859 +0200
@@ -22,7 +22,7 @@
void* aContext) {
asm volatile("nop; nop; nop; nop" : : : "memory");
- asm volatile("b %0" : : "X"(H) : "memory");
+ asm volatile("bx %0" : : "r"(H), "l"(aSignal), "l"(aInfo), "l"(aContext) : "memory");
}
# define MOZ_SIGNAL_TRAMPOLINE(h) (mozilla::SignalTrampoline<h>)

View file

@ -6,29 +6,25 @@ Extensions included to this version of IceCat:
GNU LibreJS aims to address the JavaScript problem described in the article
"[The JavaScript Trap](https://www.gnu.org/philosophy/javascript-trap.html)" of Richard Stallman.
* HTTPS Everywhere
* JShelter
HTTPS Everywhere is an extension that encrypts your communications with
many major websites, making your browsing more secure.
Mitigates potential threats from JavaScript, including fingerprinting,
tracking, and data collection. Slightly modifies the results of API calls,
differently on different domains, so that the cross-site fingerprint is not
stable. Applies security counter-measures that are likely not to break web pages.
Allows fine-grained control over the restrictions and counter-measures applied
to each domain.
* ViewTube
Watch videos from video sharing websites with extra options.
* A set of companion extensions for LibreJS by Nathan Nichols
are pre-installed, and provide workarounds to use some services at USPS,
RSF.org, SumOfUs.org, pay.gov, McDonalds, goteo.org and Google Docs
without using nonfree JavaScript.
* A series of configuration changes and tweaks were applied to ensure that
IceCat does not initiate network connections that the user has not explicitly
requested. This implies not downloading feeds, updates, blacklists or any
other similar data needed during startup.
Origin of the name
The name “IceCat” was coined to show our relationship to the Mozilla Firefox browser. Ice isn't Fire and a Cat isn't a Fox, so it is clearly a different package (we don't want Mozilla blamed for our mistakes, nor cause confusion with their trademarks), but is equally clearly intimately related (of course nearly all of the work comes from the Mozilla foundation effort, so we want to give credit).

45
build-aarch64-skia.patch Normal file
View file

@ -0,0 +1,45 @@
diff -up firefox-72.0/gfx/skia/skia/include/private/SkHalf.h.aarch64-skia firefox-72.0/gfx/skia/skia/include/private/SkHalf.h
--- firefox-72.0/gfx/skia/skia/include/private/SkHalf.h.aarch64-skia 2020-01-02 22:33:02.000000000 +0100
+++ firefox-72.0/gfx/skia/skia/include/private/SkHalf.h 2020-01-03 09:00:37.537296105 +0100
@@ -40,7 +40,7 @@ static inline Sk4h SkFloatToHalf_finite_
static inline Sk4f SkHalfToFloat_finite_ftz(uint64_t rgba) {
Sk4h hs = Sk4h::Load(&rgba);
-#if !defined(SKNX_NO_SIMD) && defined(SK_CPU_ARM64)
+#if 0 // !defined(SKNX_NO_SIMD) && defined(SK_CPU_ARM64)
float32x4_t fs;
asm ("fcvtl %[fs].4s, %[hs].4h \n" // vcvt_f32_f16(...)
: [fs] "=w" (fs) // =w: write-only NEON register
@@ -62,7 +62,7 @@ static inline Sk4f SkHalfToFloat_finite_
}
static inline Sk4h SkFloatToHalf_finite_ftz(const Sk4f& fs) {
-#if !defined(SKNX_NO_SIMD) && defined(SK_CPU_ARM64)
+#if 0 // !defined(SKNX_NO_SIMD) && defined(SK_CPU_ARM64)
float32x4_t vec = fs.fVec;
asm ("fcvtn %[vec].4h, %[vec].4s \n" // vcvt_f16_f32(vec)
: [vec] "+w" (vec)); // +w: read-write NEON register
diff -up firefox-72.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h.aarch64-skia firefox-72.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h
--- firefox-72.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h.aarch64-skia 2020-01-03 09:00:37.538296107 +0100
+++ firefox-72.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h 2020-01-03 10:11:41.259219508 +0100
@@ -1087,7 +1087,7 @@ SI F from_half(U16 h) {
}
SI U16 to_half(F f) {
-#if defined(JUMPER_IS_NEON) && defined(SK_CPU_ARM64) \
+#if 0 //defined(JUMPER_IS_NEON) && defined(SK_CPU_ARM64) \
&& !defined(SK_BUILD_FOR_GOOGLE3) // Temporary workaround for some Google3 builds.
return vcvt_f16_f32(f);
diff -up firefox-72.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h.aarch64-skia firefox-72.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h
--- firefox-72.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h.aarch64-skia 2020-01-03 09:00:37.538296107 +0100
+++ firefox-72.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h 2020-01-03 10:11:53.513250979 +0100
@@ -183,8 +183,6 @@ SI F F_from_Half(U16 half) {
SI U16 Half_from_F(F f) {
#if defined(USING_NEON_FP16)
return bit_pun<U16>(f);
-#elif defined(USING_NEON_F16C)
- return (U16)vcvt_f16_f32(f);
#elif defined(USING_AVX512F)
return (U16)_mm512_cvtps_ph((__m512 )f, _MM_FROUND_CUR_DIRECTION );
#elif defined(USING_AVX_F16C)

12
build-arm-libopus.patch Normal file
View file

@ -0,0 +1,12 @@
diff -up firefox-66.0/media/libopus/silk/arm/arm_silk_map.c.old firefox-66.0/media/libopus/silk/arm/arm_silk_map.c
--- firefox-66.0/media/libopus/silk/arm/arm_silk_map.c.old 2019-03-12 21:07:35.356677522 +0100
+++ firefox-66.0/media/libopus/silk/arm/arm_silk_map.c 2019-03-12 21:07:42.937693394 +0100
@@ -28,7 +28,7 @@ POSSIBILITY OF SUCH DAMAGE.
# include "config.h"
#endif
-#include "main_FIX.h"
+#include "fixed/main_FIX.h"
#include "NSQ.h"
#include "SigProc_FIX.h"

View file

@ -0,0 +1,12 @@
diff -up firefox-65.0/toolkit/moz.configure.disable-elfhack firefox-65.0/toolkit/moz.configure
--- firefox-65.0/toolkit/moz.configure.disable-elfhack 2019-01-28 14:16:48.530345132 +0100
+++ firefox-65.0/toolkit/moz.configure 2019-01-28 14:18:03.231029682 +0100
@@ -1036,7 +1036,7 @@ with only_when('--enable-compile-environ
help='{Enable|Disable} elf hacks')
set_config('USE_ELF_HACK',
- depends_if('--enable-elf-hack')(lambda _: True))
+ depends_if('--enable-elf-hack')(lambda _: False))
@depends(check_build_environment)

View file

@ -0,0 +1,41 @@
diff --git a/dom/media/platforms/PDMFactory.cpp b/dom/media/platforms/PDMFactory.cpp
--- a/dom/media/platforms/PDMFactory.cpp
+++ b/dom/media/platforms/PDMFactory.cpp
@@ -21,16 +21,17 @@
#include "mozilla/GpuDecoderModule.h"
#include "mozilla/RemoteDecoderModule.h"
#include "mozilla/SharedThreadPool.h"
#include "mozilla/StaticPrefs_media.h"
#include "mozilla/StaticPtr.h"
#include "mozilla/SyncRunnable.h"
#include "mozilla/TaskQueue.h"
#include "mozilla/gfx/gfxVars.h"
+#include "gfxPlatformGtk.h"
#ifdef XP_WIN
# include "WMFDecoderModule.h"
# include "mozilla/WindowsVersion.h"
#endif
#ifdef MOZ_FFVPX
# include "FFVPXRuntimeLinker.h"
#endif
@@ -362,17 +363,18 @@ void PDMFactory::CreatePDMs() {
#endif
#ifdef MOZ_OMX
if (StaticPrefs::media_omx_enabled()) {
m = OmxDecoderModule::Create();
StartupPDM(m);
}
#endif
#ifdef MOZ_FFVPX
- if (StaticPrefs::media_ffvpx_enabled()) {
+ if (StaticPrefs::media_ffvpx_enabled() &&
+ !gfxPlatformGtk::GetPlatform()->UseWaylandHardwareVideoDecoding()) {
m = FFVPXRuntimeLinker::CreateDecoderModule();
StartupPDM(m);
}
#endif
#ifdef MOZ_FFMPEG
if (StaticPrefs::media_ffmpeg_enabled()) {
m = FFmpegRuntimeLinker::CreateDecoderModule();
mFFmpegFailedToLoad = !StartupPDM(m);

12
firefox-nss-version.patch Normal file
View file

@ -0,0 +1,12 @@
diff -up firefox-78.0/toolkit/moz.configure.nss-version firefox-78.0/toolkit/moz.configure
--- firefox-78.0/toolkit/moz.configure.nss-version 2020-06-30 08:47:09.657501414 +0200
+++ firefox-78.0/toolkit/moz.configure 2020-06-30 08:47:12.652510169 +0200
@@ -2089,7 +2089,7 @@ option('--with-system-nss', help='Use sy
imply_option('--with-system-nspr', True, when='--with-system-nss')
-nss_pkg = pkg_check_modules('NSS', 'nss >= 3.53.1', when='--with-system-nss', config=False)
+nss_pkg = pkg_check_modules('NSS', 'nss >= 3.53.0', when='--with-system-nss', config=False)
set_config('MOZ_SYSTEM_NSS', True, when='--with-system-nss')

846
firefox-pipewire.patch Normal file
View file

@ -0,0 +1,846 @@
diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
index 2081d0c683a4..641133bf1ea4 100644
--- a/config/system-headers.mozbuild
+++ b/config/system-headers.mozbuild
@@ -314,6 +314,7 @@ system_headers = [
'Gestalt.h',
'getopt.h',
'gio/gio.h',
+ 'gio/gunixfdlist.h',
'glibconfig.h',
'glib.h',
'glib-object.h',
@@ -607,6 +608,7 @@ system_headers = [
'Pgenerr.h',
'PGenErr.h',
'Ph.h',
+ 'pipewire/pipewire.h',
'pixman.h',
'pk11func.h',
'pk11pqg.h',
diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn b/media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn
index ba885217b3ba..201d3b755221 100644
--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn
+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn
@@ -158,7 +158,7 @@ if (rtc_include_tests) {
if (is_linux) {
if (rtc_use_pipewire) {
pkg_config("pipewire") {
- packages = [ "libpipewire-0.2" ]
+ packages = [ "libpipewire-0.3" ]
defines = [ "WEBRTC_USE_PIPEWIRE" ]
}
diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build b/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build
index 90b40431c7e4..d844aa79d591 100644
--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build
+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build
@@ -194,6 +194,30 @@ if CONFIG["OS_TARGET"] == "Linux":
"/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc"
]
+# PipeWire specific files
+if CONFIG["OS_TARGET"] == "Linux":
+
+ DEFINES["WEBRTC_USE_PIPEWIRE"] = "1"
+
+ OS_LIBS += [
+ "rt",
+ "pipewire-0.3",
+ "glib-2.0",
+ "gio-2.0",
+ "gobject-2.0"
+ ]
+
+ CXXFLAGS += CONFIG['TK_CFLAGS']
+ CXXFLAGS += [ "-I/usr/include/pipewire-0.3" ]
+ CXXFLAGS += [ "-I/usr/include/spa-0.2" ]
+
+ UNIFIED_SOURCES += [
+ "/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc",
+ "/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc",
+ "/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc"
+ ]
+
+
if CONFIG["OS_TARGET"] == "NetBSD":
DEFINES["USE_X11"] = "1"
diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h b/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h
index 1eb8ead26efa..316468eed1fc 100644
--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h
+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h
@@ -141,7 +141,7 @@ class DesktopCaptureOptions {
bool disable_effects_ = true;
bool detect_updated_region_ = false;
#if defined(WEBRTC_USE_PIPEWIRE)
- bool allow_pipewire_ = false;
+ bool allow_pipewire_ = true;
#endif
};
diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc b/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc
index 379341c833de..76349f1fbd4d 100644
--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc
+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc
@@ -15,8 +15,11 @@
#include <spa/param/format-utils.h>
#include <spa/param/props.h>
-#include <spa/param/video/raw-utils.h>
-#include <spa/support/type-map.h>
+
+#include <linux/dma-buf.h>
+#include <sys/mman.h>
+#include <sys/ioctl.h>
+#include <sys/syscall.h>
#include <memory>
#include <utility>
@@ -36,31 +39,36 @@ const char kSessionInterfaceName[] = "org.freedesktop.portal.Session";
const char kRequestInterfaceName[] = "org.freedesktop.portal.Request";
const char kScreenCastInterfaceName[] = "org.freedesktop.portal.ScreenCast";
-// static
-void BaseCapturerPipeWire::OnStateChanged(void* data,
- pw_remote_state old_state,
- pw_remote_state state,
- const char* error_message) {
- BaseCapturerPipeWire* that = static_cast<BaseCapturerPipeWire*>(data);
- RTC_DCHECK(that);
- switch (state) {
- case PW_REMOTE_STATE_ERROR:
- RTC_LOG(LS_ERROR) << "PipeWire remote state error: " << error_message;
- break;
- case PW_REMOTE_STATE_CONNECTED:
- RTC_LOG(LS_INFO) << "PipeWire remote state: connected.";
- that->CreateReceivingStream();
- break;
- case PW_REMOTE_STATE_CONNECTING:
- RTC_LOG(LS_INFO) << "PipeWire remote state: connecting.";
+// static
+void BaseCapturerPipeWire::SyncDmaBuf(int fd, uint64_t start_or_end) {
+ struct dma_buf_sync sync = { 0 };
+
+ sync.flags = start_or_end | DMA_BUF_SYNC_READ;
+
+ while(true) {
+ int ret;
+ ret = ioctl (fd, DMA_BUF_IOCTL_SYNC, &sync);
+ if (ret == -1 && errno == EINTR) {
+ continue;
+ } else if (ret == -1) {
+ RTC_LOG(LS_ERROR) << "Failed to synchronize DMA buffer: " << g_strerror(errno);
break;
- case PW_REMOTE_STATE_UNCONNECTED:
- RTC_LOG(LS_INFO) << "PipeWire remote state: unconnected.";
+ } else {
break;
+ }
}
}
+// static
+void BaseCapturerPipeWire::OnCoreError(void *data,
+ uint32_t id,
+ int seq,
+ int res,
+ const char *message) {
+ RTC_LOG(LS_ERROR) << "core error: " << message;
+}
+
// static
void BaseCapturerPipeWire::OnStreamStateChanged(void* data,
pw_stream_state old_state,
@@ -73,76 +81,54 @@ void BaseCapturerPipeWire::OnStreamStateChanged(void* data,
case PW_STREAM_STATE_ERROR:
RTC_LOG(LS_ERROR) << "PipeWire stream state error: " << error_message;
break;
- case PW_STREAM_STATE_CONFIGURE:
- pw_stream_set_active(that->pw_stream_, true);
- break;
- case PW_STREAM_STATE_UNCONNECTED:
- case PW_STREAM_STATE_CONNECTING:
- case PW_STREAM_STATE_READY:
case PW_STREAM_STATE_PAUSED:
case PW_STREAM_STATE_STREAMING:
+ case PW_STREAM_STATE_UNCONNECTED:
+ case PW_STREAM_STATE_CONNECTING:
break;
}
}
// static
-void BaseCapturerPipeWire::OnStreamFormatChanged(void* data,
- const struct spa_pod* format) {
+void BaseCapturerPipeWire::OnStreamParamChanged(void *data, uint32_t id,
+ const struct spa_pod *format) {
BaseCapturerPipeWire* that = static_cast<BaseCapturerPipeWire*>(data);
RTC_DCHECK(that);
- RTC_LOG(LS_INFO) << "PipeWire stream format changed.";
+ RTC_LOG(LS_INFO) << "PipeWire stream param changed.";
- if (!format) {
- pw_stream_finish_format(that->pw_stream_, /*res=*/0, /*params=*/nullptr,
- /*n_params=*/0);
+ if (!format || id != SPA_PARAM_Format) {
return;
}
- that->spa_video_format_ = new spa_video_info_raw();
- spa_format_video_raw_parse(format, that->spa_video_format_,
- &that->pw_type_->format_video);
+ spa_format_video_raw_parse(format, &that->spa_video_format_);
- auto width = that->spa_video_format_->size.width;
- auto height = that->spa_video_format_->size.height;
+ auto width = that->spa_video_format_.size.width;
+ auto height = that->spa_video_format_.size.height;
auto stride = SPA_ROUND_UP_N(width * kBytesPerPixel, 4);
auto size = height * stride;
+ that->desktop_size_ = DesktopSize(width, height);
+
uint8_t buffer[1024] = {};
auto builder = spa_pod_builder{buffer, sizeof(buffer)};
// Setup buffers and meta header for new format.
- const struct spa_pod* params[2];
- params[0] = reinterpret_cast<spa_pod*>(spa_pod_builder_object(
- &builder,
- // id to enumerate buffer requirements
- that->pw_core_type_->param.idBuffers,
- that->pw_core_type_->param_buffers.Buffers,
- // Size: specified as integer (i) and set to specified size
- ":", that->pw_core_type_->param_buffers.size, "i", size,
- // Stride: specified as integer (i) and set to specified stride
- ":", that->pw_core_type_->param_buffers.stride, "i", stride,
- // Buffers: specifies how many buffers we want to deal with, set as
- // integer (i) where preferred number is 8, then allowed number is defined
- // as range (r) from min and max values and it is undecided (u) to allow
- // negotiation
- ":", that->pw_core_type_->param_buffers.buffers, "iru", 8,
- SPA_POD_PROP_MIN_MAX(1, 32),
- // Align: memory alignment of the buffer, set as integer (i) to specified
- // value
- ":", that->pw_core_type_->param_buffers.align, "i", 16));
- params[1] = reinterpret_cast<spa_pod*>(spa_pod_builder_object(
- &builder,
- // id to enumerate supported metadata
- that->pw_core_type_->param.idMeta, that->pw_core_type_->param_meta.Meta,
- // Type: specified as id or enum (I)
- ":", that->pw_core_type_->param_meta.type, "I",
- that->pw_core_type_->meta.Header,
- // Size: size of the metadata, specified as integer (i)
- ":", that->pw_core_type_->param_meta.size, "i",
- sizeof(struct spa_meta_header)));
-
- pw_stream_finish_format(that->pw_stream_, /*res=*/0, params, /*n_params=*/2);
+ const struct spa_pod* params[3];
+ params[0] = reinterpret_cast<spa_pod *>(spa_pod_builder_add_object(&builder,
+ SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers,
+ SPA_PARAM_BUFFERS_size, SPA_POD_Int(size),
+ SPA_PARAM_BUFFERS_stride, SPA_POD_Int(stride),
+ SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(8, 1, 32)));
+ params[1] = reinterpret_cast<spa_pod *>(spa_pod_builder_add_object(&builder,
+ SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta,
+ SPA_PARAM_META_type, SPA_POD_Id(SPA_META_Header),
+ SPA_PARAM_META_size, SPA_POD_Int(sizeof(struct spa_meta_header))));
+ params[2] = reinterpret_cast<spa_pod *>(spa_pod_builder_add_object(&builder,
+ SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta,
+ SPA_PARAM_META_type, SPA_POD_Id (SPA_META_VideoCrop),
+ SPA_PARAM_META_size, SPA_POD_Int (sizeof(struct spa_meta_region))));
+ pw_stream_update_params(that->pw_stream_, params, 3);
}
// static
@@ -150,15 +136,25 @@ void BaseCapturerPipeWire::OnStreamProcess(void* data) {
BaseCapturerPipeWire* that = static_cast<BaseCapturerPipeWire*>(data);
RTC_DCHECK(that);
- pw_buffer* buf = nullptr;
+ struct pw_buffer *next_buffer;
+ struct pw_buffer *buffer = nullptr;
+
+ next_buffer = pw_stream_dequeue_buffer(that->pw_stream_);
+ while (next_buffer) {
+ buffer = next_buffer;
+ next_buffer = pw_stream_dequeue_buffer(that->pw_stream_);
- if (!(buf = pw_stream_dequeue_buffer(that->pw_stream_))) {
+ if (next_buffer)
+ pw_stream_queue_buffer (that->pw_stream_, buffer);
+ }
+
+ if (!buffer) {
return;
}
- that->HandleBuffer(buf);
+ that->HandleBuffer(buffer);
- pw_stream_queue_buffer(that->pw_stream_, buf);
+ pw_stream_queue_buffer(that->pw_stream_, buffer);
}
BaseCapturerPipeWire::BaseCapturerPipeWire(CaptureSourceType source_type)
@@ -169,38 +165,22 @@ BaseCapturerPipeWire::~BaseCapturerPipeWire() {
pw_thread_loop_stop(pw_main_loop_);
}
- if (pw_type_) {
- delete pw_type_;
- }
-
- if (spa_video_format_) {
- delete spa_video_format_;
- }
-
if (pw_stream_) {
pw_stream_destroy(pw_stream_);
}
- if (pw_remote_) {
- pw_remote_destroy(pw_remote_);
+ if (pw_core_) {
+ pw_core_disconnect(pw_core_);
}
- if (pw_core_) {
- pw_core_destroy(pw_core_);
+ if (pw_context_) {
+ pw_context_destroy(pw_context_);
}
if (pw_main_loop_) {
pw_thread_loop_destroy(pw_main_loop_);
}
- if (pw_loop_) {
- pw_loop_destroy(pw_loop_);
- }
-
- if (current_frame_) {
- free(current_frame_);
- }
-
if (start_request_signal_id_) {
g_dbus_connection_signal_unsubscribe(connection_, start_request_signal_id_);
}
@@ -250,27 +230,35 @@ void BaseCapturerPipeWire::InitPortal() {
void BaseCapturerPipeWire::InitPipeWire() {
pw_init(/*argc=*/nullptr, /*argc=*/nullptr);
- pw_loop_ = pw_loop_new(/*properties=*/nullptr);
- pw_main_loop_ = pw_thread_loop_new(pw_loop_, "pipewire-main-loop");
-
- pw_core_ = pw_core_new(pw_loop_, /*properties=*/nullptr);
- pw_core_type_ = pw_core_get_type(pw_core_);
- pw_remote_ = pw_remote_new(pw_core_, nullptr, /*user_data_size=*/0);
+ pw_main_loop_ = pw_thread_loop_new("pipewire-main-loop", nullptr);
+ pw_context_ = pw_context_new(pw_thread_loop_get_loop(pw_main_loop_), nullptr, 0);
+ if (!pw_context_) {
+ RTC_LOG(LS_ERROR) << "Failed to create PipeWire context";
+ return;
+ }
- InitPipeWireTypes();
+ pw_core_ = pw_context_connect(pw_context_, nullptr, 0);
+ if (!pw_core_) {
+ RTC_LOG(LS_ERROR) << "Failed to connect PipeWire context";
+ return;
+ }
// Initialize event handlers, remote end and stream-related.
- pw_remote_events_.version = PW_VERSION_REMOTE_EVENTS;
- pw_remote_events_.state_changed = &OnStateChanged;
+ pw_core_events_.version = PW_VERSION_CORE_EVENTS;
+ pw_core_events_.error = &OnCoreError;
pw_stream_events_.version = PW_VERSION_STREAM_EVENTS;
pw_stream_events_.state_changed = &OnStreamStateChanged;
- pw_stream_events_.format_changed = &OnStreamFormatChanged;
+ pw_stream_events_.param_changed = &OnStreamParamChanged;
pw_stream_events_.process = &OnStreamProcess;
- pw_remote_add_listener(pw_remote_, &spa_remote_listener_, &pw_remote_events_,
- this);
- pw_remote_connect_fd(pw_remote_, pw_fd_);
+ pw_core_add_listener(pw_core_, &spa_core_listener_, &pw_core_events_, this);
+
+ pw_stream_ = CreateReceivingStream();
+ if (!pw_stream_) {
+ RTC_LOG(LS_ERROR) << "Failed to create PipeWire stream";
+ return;
+ }
if (pw_thread_loop_start(pw_main_loop_) < 0) {
RTC_LOG(LS_ERROR) << "Failed to start main PipeWire loop";
@@ -278,81 +266,132 @@ void BaseCapturerPipeWire::InitPipeWire() {
}
}
-void BaseCapturerPipeWire::InitPipeWireTypes() {
- spa_type_map* map = pw_core_type_->map;
- pw_type_ = new PipeWireType();
-
- spa_type_media_type_map(map, &pw_type_->media_type);
- spa_type_media_subtype_map(map, &pw_type_->media_subtype);
- spa_type_format_video_map(map, &pw_type_->format_video);
- spa_type_video_format_map(map, &pw_type_->video_format);
-}
-
-void BaseCapturerPipeWire::CreateReceivingStream() {
+pw_stream* BaseCapturerPipeWire::CreateReceivingStream() {
spa_rectangle pwMinScreenBounds = spa_rectangle{1, 1};
- spa_rectangle pwScreenBounds =
- spa_rectangle{static_cast<uint32_t>(desktop_size_.width()),
- static_cast<uint32_t>(desktop_size_.height())};
+ spa_rectangle pwMaxScreenBounds = spa_rectangle{INT32_MAX, INT32_MAX};
- spa_fraction pwFrameRateMin = spa_fraction{0, 1};
- spa_fraction pwFrameRateMax = spa_fraction{60, 1};
+ auto stream = pw_stream_new(pw_core_, "webrtc-pipewire-stream", nullptr);
- pw_properties* reuseProps = pw_properties_new("pipewire.client.reuse", "1",
- /*end of varargs*/ nullptr);
- pw_stream_ = pw_stream_new(pw_remote_, "webrtc-consume-stream", reuseProps);
+ if (!stream) {
+ RTC_LOG(LS_ERROR) << "Could not create receiving stream.";
+ return nullptr;
+ }
uint8_t buffer[1024] = {};
- const spa_pod* params[1];
- spa_pod_builder builder = spa_pod_builder{buffer, sizeof(buffer)};
- params[0] = reinterpret_cast<spa_pod*>(spa_pod_builder_object(
- &builder,
- // id to enumerate formats
- pw_core_type_->param.idEnumFormat, pw_core_type_->spa_format, "I",
- pw_type_->media_type.video, "I", pw_type_->media_subtype.raw,
- // Video format: specified as id or enum (I), preferred format is BGRx,
- // then allowed formats are enumerated (e) and the format is undecided (u)
- // to allow negotiation
- ":", pw_type_->format_video.format, "Ieu", pw_type_->video_format.BGRx,
- SPA_POD_PROP_ENUM(2, pw_type_->video_format.RGBx,
- pw_type_->video_format.BGRx),
- // Video size: specified as rectangle (R), preferred size is specified as
- // first parameter, then allowed size is defined as range (r) from min and
- // max values and the format is undecided (u) to allow negotiation
- ":", pw_type_->format_video.size, "Rru", &pwScreenBounds, 2,
- &pwMinScreenBounds, &pwScreenBounds,
- // Frame rate: specified as fraction (F) and set to minimum frame rate
- // value
- ":", pw_type_->format_video.framerate, "F", &pwFrameRateMin,
- // Max frame rate: specified as fraction (F), preferred frame rate is set
- // to maximum value, then allowed frame rate is defined as range (r) from
- // min and max values and it is undecided (u) to allow negotiation
- ":", pw_type_->format_video.max_framerate, "Fru", &pwFrameRateMax, 2,
- &pwFrameRateMin, &pwFrameRateMax));
-
- pw_stream_add_listener(pw_stream_, &spa_stream_listener_, &pw_stream_events_,
- this);
+ const spa_pod* params[2];
+ spa_pod_builder builder = SPA_POD_BUILDER_INIT(buffer, sizeof (buffer));
+
+ params[0] = reinterpret_cast<spa_pod *>(spa_pod_builder_add_object(&builder,
+ SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat,
+ SPA_FORMAT_mediaType, SPA_POD_Id(SPA_MEDIA_TYPE_video),
+ SPA_FORMAT_mediaSubtype, SPA_POD_Id(SPA_MEDIA_SUBTYPE_raw),
+ SPA_FORMAT_VIDEO_format, SPA_POD_CHOICE_ENUM_Id(5, SPA_VIDEO_FORMAT_BGRx, SPA_VIDEO_FORMAT_RGBx, SPA_VIDEO_FORMAT_RGBA,
+ SPA_VIDEO_FORMAT_BGRx, SPA_VIDEO_FORMAT_BGRA),
+ SPA_FORMAT_VIDEO_size, SPA_POD_CHOICE_RANGE_Rectangle(&pwMinScreenBounds,
+ &pwMinScreenBounds,
+ &pwMaxScreenBounds),
+ 0));
+ pw_stream_add_listener(stream, &spa_stream_listener_, &pw_stream_events_, this);
+
pw_stream_flags flags = static_cast<pw_stream_flags>(
- PW_STREAM_FLAG_AUTOCONNECT | PW_STREAM_FLAG_INACTIVE |
- PW_STREAM_FLAG_MAP_BUFFERS);
- if (pw_stream_connect(pw_stream_, PW_DIRECTION_INPUT, /*port_path=*/nullptr,
- flags, params,
- /*n_params=*/1) != 0) {
+ PW_STREAM_FLAG_AUTOCONNECT | PW_STREAM_FLAG_INACTIVE);
+
+ if (pw_stream_connect(stream, PW_DIRECTION_INPUT, pw_stream_node_id_, PW_STREAM_FLAG_AUTOCONNECT, params, 1) != 0) {
RTC_LOG(LS_ERROR) << "Could not connect receiving stream.";
portal_init_failed_ = true;
- return;
}
+
+ return stream;
}
void BaseCapturerPipeWire::HandleBuffer(pw_buffer* buffer) {
+ struct spa_meta_region* video_crop;
spa_buffer* spaBuffer = buffer->buffer;
- void* src = nullptr;
+ uint8_t *map = nullptr;
+ uint8_t* src = nullptr;
+ uint8_t* dst = nullptr;
+
+ if (spaBuffer->datas[0].chunk->size == 0) {
+ map = nullptr;
+ src = nullptr;
+ } else if (spaBuffer->datas[0].type == SPA_DATA_MemFd) {
+ map = static_cast<uint8_t*>(mmap(
+ nullptr, spaBuffer->datas[0].maxsize + spaBuffer->datas[0].mapoffset,
+ PROT_READ, MAP_PRIVATE, spaBuffer->datas[0].fd, 0));
+
+ if (map == MAP_FAILED) {
+ RTC_LOG(LS_ERROR) << "Failed to mmap the memory: " << std::strerror(errno);
+ return;
+ }
+
+ src = SPA_MEMBER(map, spaBuffer->datas[0].mapoffset, uint8_t);
+ } else if (spaBuffer->datas[0].type == SPA_DATA_DmaBuf) {
+ int fd;
+ fd = spaBuffer->datas[0].fd;
- if (!(src = spaBuffer->datas[0].data)) {
+ map = static_cast<uint8_t*>(mmap(
+ nullptr, spaBuffer->datas[0].maxsize + spaBuffer->datas[0].mapoffset,
+ PROT_READ, MAP_PRIVATE, fd, 0));
+
+ if (map == MAP_FAILED) {
+ RTC_LOG(LS_ERROR) << "Failed to mmap the memory: " << std::strerror(errno);
+ return;
+ }
+
+ SyncDmaBuf(fd, DMA_BUF_SYNC_START);
+
+ src = SPA_MEMBER(map, spaBuffer->datas[0].mapoffset, uint8_t);
+ } else if (spaBuffer->datas[0].type == SPA_DATA_MemPtr) {
+ map = nullptr;
+ src = static_cast<uint8_t*>(spaBuffer->datas[0].data);
+ } else {
return;
}
- uint32_t maxSize = spaBuffer->datas[0].maxsize;
- int32_t srcStride = spaBuffer->datas[0].chunk->stride;
+ if (!src) {
+ return;
+ }
+
+ DesktopSize prev_crop_size = DesktopSize(0, 0);
+ if (video_crop_size_initialized_) {
+ prev_crop_size = video_crop_size_;
+ }
+
+ if ((video_crop = static_cast<struct spa_meta_region*>(
+ spa_buffer_find_meta_data(spaBuffer, SPA_META_VideoCrop, sizeof(*video_crop))))) {
+ RTC_DCHECK(video_crop->region.size.width <= desktop_size_.width() &&
+ video_crop->region.size.height <= desktop_size_.height());
+ if ((video_crop->region.size.width != desktop_size_.width() ||
+ video_crop->region.size.height != desktop_size_.height()) && video_crop->region.size.width && video_crop->region.size.height) {
+ video_crop_size_ = DesktopSize(video_crop->region.size.width, video_crop->region.size.height);
+ video_crop_size_initialized_ = true;
+ } else {
+ video_crop_size_initialized_ = false;
+ }
+ } else {
+ video_crop_size_initialized_ = false;
+ }
+
+ size_t frame_size;
+ if (video_crop_size_initialized_) {
+ frame_size =
+ video_crop_size_.width() * video_crop_size_.height() * kBytesPerPixel;
+ } else {
+ frame_size =
+ desktop_size_.width() * desktop_size_.height() * kBytesPerPixel;
+ }
+
+ if (!current_frame_ ||
+ (video_crop_size_initialized_ && !video_crop_size_.equals(prev_crop_size))) {
+ current_frame_ = std::make_unique<uint8_t[]>(frame_size);
+ }
+ RTC_DCHECK(current_frame_ != nullptr);
+
+ const int32_t dstStride = video_crop_size_initialized_
+ ? video_crop_size_.width() * kBytesPerPixel
+ : desktop_size_.width() * kBytesPerPixel;
+ const int32_t srcStride = spaBuffer->datas[0].chunk->stride;
+
if (srcStride != (desktop_size_.width() * kBytesPerPixel)) {
RTC_LOG(LS_ERROR) << "Got buffer with stride different from screen stride: "
<< srcStride
@@ -361,21 +400,40 @@ void BaseCapturerPipeWire::HandleBuffer(pw_buffer* buffer) {
return;
}
- if (!current_frame_) {
- current_frame_ = static_cast<uint8_t*>(malloc(maxSize));
+ dst = current_frame_.get();
+
+ // Adjust source content based on crop video position
+ if (video_crop_size_initialized_ &&
+ (video_crop->region.position.y + video_crop_size_.height() <= desktop_size_.height())) {
+ for (int i = 0; i < video_crop->region.position.y; ++i) {
+ src += srcStride;
+ }
+ }
+ const int xOffset =
+ video_crop_size_initialized_ && (video_crop->region.position.x + video_crop_size_.width() <=
+ desktop_size_.width())
+ ? video_crop->region.position.x * kBytesPerPixel
+ : 0;
+ const int height = video_crop_size_initialized_ ? video_crop_size_.height() : desktop_size_.height();
+ for (int i = 0; i < height; ++i) {
+ // Adjust source content based on crop video position if needed
+ src += xOffset;
+ std::memcpy(dst, src, dstStride);
+ // If both sides decided to go with the RGBx format we need to convert it to
+ // BGRx to match color format expected by WebRTC.
+ if (spa_video_format_.format == SPA_VIDEO_FORMAT_RGBx ||
+ spa_video_format_.format == SPA_VIDEO_FORMAT_RGBA) {
+ ConvertRGBxToBGRx(dst, dstStride);
+ }
+ src += srcStride - xOffset;
+ dst += dstStride;
}
- RTC_DCHECK(current_frame_ != nullptr);
- // If both sides decided to go with the RGBx format we need to convert it to
- // BGRx to match color format expected by WebRTC.
- if (spa_video_format_->format == pw_type_->video_format.RGBx) {
- uint8_t* tempFrame = static_cast<uint8_t*>(malloc(maxSize));
- std::memcpy(tempFrame, src, maxSize);
- ConvertRGBxToBGRx(tempFrame, maxSize);
- std::memcpy(current_frame_, tempFrame, maxSize);
- free(tempFrame);
- } else {
- std::memcpy(current_frame_, src, maxSize);
+ if (map) {
+ if (spaBuffer->datas[0].type == SPA_DATA_DmaBuf) {
+ SyncDmaBuf(spaBuffer->datas[0].fd, DMA_BUF_SYNC_END);
+ }
+ munmap(map, spaBuffer->datas[0].maxsize + spaBuffer->datas[0].mapoffset);
}
}
@@ -725,10 +783,7 @@ void BaseCapturerPipeWire::OnStartRequestResponseSignal(
g_variant_get(variant, "(u@a{sv})", &stream_id, &options);
RTC_DCHECK(options != nullptr);
- g_variant_lookup(options, "size", "(ii)", &width, &height);
-
- that->desktop_size_.set(width, height);
-
+ that->pw_stream_node_id_ = stream_id;
g_variant_unref(options);
g_variant_unref(variant);
}
@@ -813,10 +868,15 @@ void BaseCapturerPipeWire::CaptureFrame() {
return;
}
- std::unique_ptr<DesktopFrame> result(new BasicDesktopFrame(desktop_size_));
+ DesktopSize frame_size = desktop_size_;
+ if (video_crop_size_initialized_) {
+ frame_size = video_crop_size_;
+ }
+
+ std::unique_ptr<DesktopFrame> result(new BasicDesktopFrame(frame_size));
result->CopyPixelsFrom(
- current_frame_, (desktop_size_.width() * kBytesPerPixel),
- DesktopRect::MakeWH(desktop_size_.width(), desktop_size_.height()));
+ current_frame_.get(), (frame_size.width() * kBytesPerPixel),
+ DesktopRect::MakeWH(frame_size.width(), frame_size.height()));
if (!result) {
callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr);
return;
@@ -837,4 +897,22 @@ bool BaseCapturerPipeWire::SelectSource(SourceId id) {
return true;
}
+// static
+std::unique_ptr<DesktopCapturer>
+BaseCapturerPipeWire::CreateRawScreenCapturer(
+ const DesktopCaptureOptions& options) {
+ std::unique_ptr<BaseCapturerPipeWire> capturer =
+ std::make_unique<BaseCapturerPipeWire>(BaseCapturerPipeWire::CaptureSourceType::kAny);
+ return std::move(capturer);}
+
+// static
+std::unique_ptr<DesktopCapturer>
+BaseCapturerPipeWire::CreateRawWindowCapturer(
+ const DesktopCaptureOptions& options) {
+
+ std::unique_ptr<BaseCapturerPipeWire> capturer =
+ std::make_unique<BaseCapturerPipeWire>(BaseCapturerPipeWire::CaptureSourceType::kAny);
+ return std::move(capturer);
+}
+
} // namespace webrtc
diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.h b/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.h
index 56b101acbaa6..de54157d1a2a 100644
--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.h
+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.h
@@ -22,17 +22,13 @@
namespace webrtc {
-class PipeWireType {
- public:
- spa_type_media_type media_type;
- spa_type_media_subtype media_subtype;
- spa_type_format_video format_video;
- spa_type_video_format video_format;
-};
-
class BaseCapturerPipeWire : public DesktopCapturer {
public:
- enum CaptureSourceType { Screen = 1, Window };
+ enum CaptureSourceType : uint32_t {
+ kScreen = 0b01,
+ kWindow = 0b10,
+ kAny = 0b11
+ };
explicit BaseCapturerPipeWire(CaptureSourceType source_type);
~BaseCapturerPipeWire() override;
@@ -43,28 +39,32 @@ class BaseCapturerPipeWire : public DesktopCapturer {
bool GetSourceList(SourceList* sources) override;
bool SelectSource(SourceId id) override;
+ static std::unique_ptr<DesktopCapturer> CreateRawScreenCapturer(
+ const DesktopCaptureOptions& options);
+
+ static std::unique_ptr<DesktopCapturer> CreateRawWindowCapturer(
+ const DesktopCaptureOptions& options);
+
private:
// PipeWire types -->
+ pw_context* pw_context_ = nullptr;
pw_core* pw_core_ = nullptr;
- pw_type* pw_core_type_ = nullptr;
pw_stream* pw_stream_ = nullptr;
- pw_remote* pw_remote_ = nullptr;
- pw_loop* pw_loop_ = nullptr;
pw_thread_loop* pw_main_loop_ = nullptr;
- PipeWireType* pw_type_ = nullptr;
+ spa_hook spa_core_listener_ = {};
spa_hook spa_stream_listener_ = {};
- spa_hook spa_remote_listener_ = {};
+ pw_core_events pw_core_events_ = {};
pw_stream_events pw_stream_events_ = {};
- pw_remote_events pw_remote_events_ = {};
- spa_video_info_raw* spa_video_format_ = nullptr;
+ struct spa_video_info_raw spa_video_format_;
+ guint32 pw_stream_node_id_ = 0;
gint32 pw_fd_ = -1;
CaptureSourceType capture_source_type_ =
- BaseCapturerPipeWire::CaptureSourceType::Screen;
+ BaseCapturerPipeWire::CaptureSourceType::kAny;
// <-- end of PipeWire types
@@ -78,33 +78,37 @@ class BaseCapturerPipeWire : public DesktopCapturer {
guint sources_request_signal_id_ = 0;
guint start_request_signal_id_ = 0;
+ bool video_crop_size_initialized_ = false;
+ DesktopSize video_crop_size_;;
DesktopSize desktop_size_ = {};
DesktopCaptureOptions options_ = {};
- uint8_t* current_frame_ = nullptr;
+ std::unique_ptr<uint8_t[]> current_frame_;
Callback* callback_ = nullptr;
bool portal_init_failed_ = false;
void InitPortal();
void InitPipeWire();
- void InitPipeWireTypes();
- void CreateReceivingStream();
+ pw_stream* CreateReceivingStream();
void HandleBuffer(pw_buffer* buffer);
void ConvertRGBxToBGRx(uint8_t* frame, uint32_t size);
- static void OnStateChanged(void* data,
- pw_remote_state old_state,
- pw_remote_state state,
- const char* error);
+ static void SyncDmaBuf(int fd, uint64_t start_or_end);
+ static void OnCoreError(void *data,
+ uint32_t id,
+ int seq,
+ int res,
+ const char *message);
+ static void OnStreamParamChanged(void *data,
+ uint32_t id,
+ const struct spa_pod *format);
static void OnStreamStateChanged(void* data,
pw_stream_state old_state,
pw_stream_state state,
const char* error_message);
-
- static void OnStreamFormatChanged(void* data, const struct spa_pod* format);
static void OnStreamProcess(void* data);
static void OnNewBuffer(void* data, uint32_t id);
diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc b/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc
index 26956fc67dc8..3813d697bb38 100644
--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc
+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc
@@ -15,7 +15,7 @@
namespace webrtc {
ScreenCapturerPipeWire::ScreenCapturerPipeWire()
- : BaseCapturerPipeWire(BaseCapturerPipeWire::CaptureSourceType::Screen) {}
+ : BaseCapturerPipeWire(BaseCapturerPipeWire::CaptureSourceType::kScreen) {}
ScreenCapturerPipeWire::~ScreenCapturerPipeWire() {}
// static
diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc b/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc
index 35436475cb4d..c43a1f1a0c4e 100644
--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc
+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc
@@ -15,7 +15,7 @@
namespace webrtc {
WindowCapturerPipeWire::WindowCapturerPipeWire()
- : BaseCapturerPipeWire(BaseCapturerPipeWire::CaptureSourceType::Window) {}
+ : BaseCapturerPipeWire(BaseCapturerPipeWire::CaptureSourceType::kWindow) {}
WindowCapturerPipeWire::~WindowCapturerPipeWire() {}
// static
diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc b/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc
index cf8a9dd0e0db..d27fab8d28d9 100644
--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc
+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc
@@ -26,7 +26,7 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawScreenCapturer(
const DesktopCaptureOptions& options) {
#if defined(WEBRTC_USE_PIPEWIRE)
if (options.allow_pipewire() && DesktopCapturer::IsRunningUnderWayland()) {
- return ScreenCapturerPipeWire::CreateRawScreenCapturer(options);
+ return BaseCapturerPipeWire::CreateRawScreenCapturer(options);
}
#endif // defined(WEBRTC_USE_PIPEWIRE)
diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc b/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc
index 82359e50c2db..bb9724cf7cc2 100644
--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc
+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc
@@ -26,7 +26,7 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawWindowCapturer(
const DesktopCaptureOptions& options) {
#if defined(WEBRTC_USE_PIPEWIRE)
if (options.allow_pipewire() && DesktopCapturer::IsRunningUnderWayland()) {
- return WindowCapturerPipeWire::CreateRawWindowCapturer(options);
+ return BaseCapturerPipeWire::CreateRawWindowCapturer(options);
}
#endif // defined(WEBRTC_USE_PIPEWIRE)

View file

@ -0,0 +1,14 @@
diff -up firefox-76.0.1/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp.old firefox-76.0.1/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
--- firefox-76.0.1/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp.old 2020-05-13 14:28:26.556800474 +0200
+++ firefox-76.0.1/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp 2020-05-13 14:28:31.562768959 +0200
@@ -43,7 +43,7 @@ typedef int VAStatus;
#endif
// Use some extra HW frames for potential rendering lags.
-#define EXTRA_HW_FRAMES 6
+#define EXTRA_HW_FRAMES 20
typedef mozilla::layers::Image Image;
typedef mozilla::layers::PlanarYCbCrImage PlanarYCbCrImage;
diff -up firefox-76.0.1/media/libyuv/libyuv/tools_libyuv/autoroller/unittests/testdata/DEPS.chromium.old firefox-76.0.1/media/libyuv/libyuv/tools_libyuv/autoroller/unittests/testdata/DEPS.chromium
diff -up firefox-76.0.1/media/webrtc/trunk/Makefile.old firefox-76.0.1/media/webrtc/trunk/Makefile

View file

@ -1,45 +0,0 @@
From efd5bc0715e5477318be95a76811cda0a89e8289 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= <emilio@crisal.io>
Date: Fri, 4 Mar 2022 12:00:26 +0100
Subject: [PATCH] GLIBCXX fix for GCC 12?
---
build/unix/stdc++compat/stdc++compat.cpp | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/build/unix/stdc++compat/stdc++compat.cpp b/build/unix/stdc++compat/stdc++compat.cpp
index 0180f6bcfa998..8d7a542ff11f0 100644
--- a/build/unix/stdc++compat/stdc++compat.cpp
+++ b/build/unix/stdc++compat/stdc++compat.cpp
@@ -24,6 +24,7 @@
GLIBCXX_3.4.27 is from gcc 10
GLIBCXX_3.4.28 is from gcc 10
GLIBCXX_3.4.29 is from gcc 11
+ GLIBCXX_3.4.30 is from gcc 12
This file adds the necessary compatibility tricks to avoid symbols with
version GLIBCXX_3.4.20 and bigger, keeping binary compatibility with
@@ -69,6 +70,19 @@ void __attribute__((weak)) __throw_bad_array_new_length() { MOZ_CRASH(); }
} // namespace std
#endif
+#if _GLIBCXX_RELEASE >= 12
+namespace std {
+
+/* This avoids the GLIBCXX_3.4.30 symbol version. */
+void __attribute__((weak))
+__glibcxx_assert_fail(const char* __file, int __line, const char* __function,
+ const char* __condition) {
+ MOZ_CRASH();
+}
+
+} // namespace std
+#endif
+
/* While we generally don't build with exceptions, we have some host tools
* that do use them. libstdc++ from GCC 5.0 added exception constructors with
* char const* argument. Older versions only have a constructor with
--
2.35.1

View file

@ -0,0 +1,12 @@
diff -up firefox-73.0/media/libaom/moz.build.old firefox-73.0/media/libaom/moz.build
--- firefox-73.0/media/libaom/moz.build.old 2020-02-07 23:13:28.000000000 +0200
+++ firefox-73.0/media/libaom/moz.build 2020-02-17 10:30:08.509805092 +0200
@@ -55,7 +55,7 @@ elif CONFIG['CPU_ARCH'] == 'arm':
for f in SOURCES:
if f.endswith('neon.c'):
- SOURCES[f].flags += CONFIG['VPX_ASFLAGS']
+ SOURCES[f].flags += CONFIG['NEON_FLAGS']
if CONFIG['OS_TARGET'] == 'Android':
# For cpu-features.h

View file

@ -0,0 +1,36 @@
# Fixes installation of those addons which don't have ID on IceCat ("Cannot find id for addon" error).
--- a/toolkit/mozapps/extensions/internal/XPIInstall.jsm
+++ b/toolkit/mozapps/extensions/internal/XPIInstall.jsm
@@ -627,8 +627,30 @@
throw new Error(`Extension is signed with an invalid id (${addon.id})`);
}
}
- if (!addon.id && aLocation.isTemporary) {
- addon.id = generateTemporaryInstallID(aPackage.file);
+ if (!addon.id) {
+ if (aInstallLocation.name == KEY_APP_TEMPORARY) {
+ addon.id = generateTemporaryInstallID(aZipReader.file);
+ } else {
+ try {
+ let sigInput = aZipReader.getInputStream("META-INF/cose.sig");
+ let sigBinary = Cc['@mozilla.org/binaryinputstream;1']
+ .createInstance(Ci.nsIBinaryInputStream);
+ sigBinary.setInputStream(sigInput);
+ var sig = ''
+ var sigCount;
+ while ((sigCount = sigBinary.available()) > 0) {
+ sig += sigBinary.readBytes(sigCount);
+ }
+ let sigMatch = sig.match(/\{\w{8}-\w{4}-\w{4}-\w{4}-\w{12}\}/g)
+ if (sigMatch && sigMatch.length == 1) {
+ addon.id = sigMatch[0]
+ } else {
+ logger.warn("Failed to find addon id");
+ }
+ } catch (e) {
+ logger.warn("Failed to process META-INF/cose.sig");
+ }
+ }
}
}

View file

@ -0,0 +1,32 @@
--- browser/installer/package-manifest.orig.in 2017-03-24 21:09:39.027022000 +0100
+++ browser/installer/package-manifest.in 2017-03-24 23:07:21.881504771 +0100
@@ -74,9 +74,9 @@
#endif
#ifndef MOZ_SYSTEM_NSPR
#ifndef MOZ_FOLD_LIBS
-@BINPATH@/@DLL_PREFIX@nspr4@DLL_SUFFIX@
-@BINPATH@/@DLL_PREFIX@plc4@DLL_SUFFIX@
-@BINPATH@/@DLL_PREFIX@plds4@DLL_SUFFIX@
+#@BINPATH@/@DLL_PREFIX@nspr4@DLL_SUFFIX@
+#@BINPATH@/@DLL_PREFIX@plc4@DLL_SUFFIX@
+#@BINPATH@/@DLL_PREFIX@plds4@DLL_SUFFIX@
#endif
#endif
#ifdef XP_MACOSX
@@ -610,11 +610,11 @@
@RESPATH@/chrome/recording.manifest
@RESPATH@/chrome/recording/*
#ifdef MOZ_GTK
-@RESPATH@/browser/chrome/icons/default/default16.png
-@RESPATH@/browser/chrome/icons/default/default32.png
-@RESPATH@/browser/chrome/icons/default/default48.png
-@RESPATH@/browser/chrome/icons/default/default64.png
-@RESPATH@/browser/chrome/icons/default/default128.png
+#@RESPATH@/browser/chrome/icons/default/default16.png
+#@RESPATH@/browser/chrome/icons/default/default32.png
+#@RESPATH@/browser/chrome/icons/default/default48.png
+@RESPATH@/browser/chrome/icons/default/default64.png
+@RESPATH@/browser/chrome/icons/default/default128.png
#endif
@RESPATH@/browser/features/*

11
icecat-fix_jar.patch Normal file
View file

@ -0,0 +1,11 @@
--- browser/locales/jar.orig.mn 2017-03-19 19:59:09.000000000 +0100
+++ browser/locales/jar.mn 2017-03-22 19:49:57.602190867 +0100
@@ -14,7 +14,7 @@
@AB_CD@.jar:
% locale browser @AB_CD@ %locale/browser/
# bookmarks.html is produced by LOCALIZED_GENERATED_FILES.
- locale/browser/bookmarks.html (bookmarks.html)
+ locale/browser/bookmarks.html (generic/profile/bookmarks.html.in)
locale/browser/accounts.properties (%chrome/browser/accounts.properties)
locale/browser/app-extension-fields.properties (%chrome/browser/app-extension-fields.properties)

View file

@ -1,14 +0,0 @@
diff -up firefox-114.0.2/gfx/wr/swgl/src/gl.cc.inline firefox-114.0.2/gfx/wr/swgl/src/gl.cc
--- firefox-114.0.2/gfx/wr/swgl/src/gl.cc.inline 2023-06-22 11:08:53.294593327 +0200
+++ firefox-114.0.2/gfx/wr/swgl/src/gl.cc 2023-06-22 11:12:43.663486734 +0200
@@ -58,9 +58,7 @@ WINBASEAPI BOOL WINAPI QueryPerformanceF
}
#else
-// GCC is slower when dealing with always_inline, especially in debug builds.
-// When using Clang, use always_inline more aggressively.
-# if defined(__clang__) || defined(NDEBUG)
+# if defined(__clang__) || defined (__GNUC__) || defined(NDEBUG)
# define ALWAYS_INLINE __attribute__((always_inline)) inline
# else
# define ALWAYS_INLINE inline

View file

@ -0,0 +1,62 @@
diff -ur a/js/xpconnect/src/XPCJSContext.cpp b/js/xpconnect/src/XPCJSContext.cpp
--- a/js/xpconnect/src/XPCJSContext.cpp 2021-07-05 21:16:02.000000000 +0200
+++ b/js/xpconnect/src/XPCJSContext.cpp 2021-07-19 15:01:24.083460460 +0200
@@ -81,14 +81,6 @@
using namespace JS;
using mozilla::dom::AutoEntryScript;
-// The watchdog thread loop is pretty trivial, and should not require much stack
-// space to do its job. So only give it 32KiB or the platform minimum.
-#if !defined(PTHREAD_STACK_MIN)
-# define PTHREAD_STACK_MIN 0
-#endif
-static constexpr size_t kWatchdogStackSize =
- PTHREAD_STACK_MIN < 32 * 1024 ? 32 * 1024 : PTHREAD_STACK_MIN;
-
static void WatchdogMain(void* arg);
class Watchdog;
class WatchdogManager;
@@ -161,7 +153,7 @@
// watchdog, we need to join it on shutdown.
mThread = PR_CreateThread(PR_USER_THREAD, WatchdogMain, this,
PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD,
- PR_JOINABLE_THREAD, kWatchdogStackSize);
+ PR_JOINABLE_THREAD, 0);
if (!mThread) {
MOZ_CRASH("PR_CreateThread failed!");
}
diff -ur a/security/sandbox/linux/launch/SandboxLaunch.cpp b/security/sandbox/linux/launch/SandboxLaunch.cpp
--- a/security/sandbox/linux/launch/SandboxLaunch.cpp 2021-07-05 18:20:36.000000000 +0200
+++ b/security/sandbox/linux/launch/SandboxLaunch.cpp 2021-07-20 08:39:17.272136982 +0200
@@ -489,7 +489,8 @@ static int CloneCallee(void* aPtr) {
// we don't currently support sandboxing under valgrind.
MOZ_NEVER_INLINE MOZ_ASAN_BLACKLIST static pid_t DoClone(int aFlags,
jmp_buf* aCtx) {
- uint8_t miniStack[PTHREAD_STACK_MIN];
+ static constexpr size_t kStackAlignment = 16;
+ uint8_t miniStack[4096] __attribute__((aligned(kStackAlignment)));
#ifdef __hppa__
void* stackPtr = miniStack;
#else
@@ -510,13 +511,19 @@ static pid_t ForkWithFlags(int aFlags) {
CLONE_CHILD_CLEARTID;
MOZ_RELEASE_ASSERT((aFlags & kBadFlags) == 0);
+ // Block signals due to small stack in DoClone.
+ sigset_t oldSigs;
+ BlockAllSignals(&oldSigs);
+
+ int ret = 0;
jmp_buf ctx;
if (setjmp(ctx) == 0) {
// In the parent and just called setjmp:
- return DoClone(aFlags | SIGCHLD, &ctx);
+ ret = DoClone(aFlags | SIGCHLD, &ctx);
}
+ RestoreSignals(&oldSigs);
// In the child and have longjmp'ed:
- return 0;
+ return ret;
}
static bool WriteStringToFile(const char* aPath, const char* aStr,

View file

@ -1,6 +1,6 @@
#!/bin/bash
VERSION=140.7.0
VERSION=78.15.0
URL=https://ftp.mozilla.org/pub/firefox/releases/${VERSION}esr/linux-x86_64/xpi/
for u in $URL; do
@ -17,7 +17,6 @@ done
# mv "${FILE}" "${newfile}" ;
#done
#popd
rm -f icecat-*-langpacks.tar.gz
tar -zcvf icecat-${VERSION}-langpacks.tar.gz langpacks
rm -rf langpacks
exit 0

View file

@ -0,0 +1,20 @@
--- old-configure.orig.in 2019-03-02 21:49:16.000000000 +0100
+++ old-configure.in 2019-03-04 12:14:23.842685662 +0100
@@ -1715,7 +1715,7 @@
MOZ_SYSTEM_LIBEVENT=
elif test -z "$MOZ_SYSTEM_LIBEVENT"; then
CFLAGS="-I${LIBEVENT_DIR}/include $CFLAGS"
- LDFLAGS="-L${LIBEVENT_DIR}/lib $LDFLAGS"
+ LDFLAGS="-L${LIBDIR} $LDFLAGS"
MOZ_CHECK_HEADER(event.h,
[if test ! -f "${LIBEVENT_DIR}/include/event.h"; then
AC_MSG_ERROR([event.h found, but is not in ${LIBEVENT_DIR}/include])
@@ -1724,7 +1724,7 @@
AC_CHECK_LIB(event, event_init,
[MOZ_SYSTEM_LIBEVENT=1
MOZ_LIBEVENT_CFLAGS="-I${LIBEVENT_DIR}/include"
- MOZ_LIBEVENT_LIBS="-L${LIBEVENT_DIR}/lib -levent"],
+ MOZ_LIBEVENT_LIBS="-L${LIBDIR} -levent"],
[MOZ_SYSTEM_LIBEVENT= MOZ_LIBEVENT_CFLAGS= MOZ_LIBEVENT_LIBS=])
fi
CFLAGS=$_SAVE_CFLAGS

View file

@ -6,7 +6,6 @@ export MOZ_TELEMETRY_REPORTING=
mk_add_options BUILD_OFFICIAL=1
mk_add_options MOZILLA_OFFICIAL=1
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir
ac_add_options --without-wasm-sandboxed-libraries
ac_add_options --prefix="$PREFIX"
ac_add_options --libdir="$LIBDIR"

View file

@ -0,0 +1,84 @@
# HG changeset patch
# User alwu <alwu@mozilla.com>
# Date 1608617164 0
# Node ID 1c00de8c800ee726863fab0a9245e2c9a8e58136
# Parent ab7649dc7fddc8fd9a81a54d61b1e7221fc298ca
Bug 1613672 - return `NS_ERROR_DOM_MEDIA_CANCELED` to indicate that track buffer manager has been detached from the demuxer. r=jya
When we shutdown `MediaSourceDecoder`, it would trigger a shutdown for `MDSM` and a detaching for media source.
In the previous one, that would eventually shutdown `MediaFormatReader` via tasks going through different threads (main->MDSM->MFR's supervisor).
In the latter one, it would eventually detach the `TrackBufferManager` from the `MediaSourceTrackDemuxer`. (main->Demuxer's supervisor)
As these two tasks running in different threads, and the latter usually get finished before the former one, which would result in `MediaSourceTrackDemuxer` no longer being able to get a sample.
When that happens, the reader hasn't been shutdown yet, so it's still holding track demuxers and keeps requesting data from them. Then demuxers would return error because their corresponding track managers have been detached.
The reader would report the demuxing error to the console, but that's acutally not a fatal error, because in this situation the reader is going to be shutdown soon. Therefore, return `NS_ERROR_DOM_MEDIA_CANCELED` to allow MFR to treat this error differently.
Differential Revision: https://phabricator.services.mozilla.com/D100153
diff --git a/dom/media/mediasource/MediaSourceDemuxer.cpp b/dom/media/mediasource/MediaSourceDemuxer.cpp
--- a/dom/media/mediasource/MediaSourceDemuxer.cpp
+++ b/dom/media/mediasource/MediaSourceDemuxer.cpp
@@ -338,17 +338,17 @@ void MediaSourceTrackDemuxer::BreakCycle
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
Unused << rv;
}
RefPtr<MediaSourceTrackDemuxer::SeekPromise> MediaSourceTrackDemuxer::DoSeek(
const TimeUnit& aTime) {
if (!mManager) {
return SeekPromise::CreateAndReject(
- MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
+ MediaResult(NS_ERROR_DOM_MEDIA_CANCELED,
RESULT_DETAIL("manager is detached.")),
__func__);
}
MOZ_ASSERT(OnTaskQueue());
TimeIntervals buffered = mManager->Buffered(mType);
// Fuzz factor represents a +/- threshold. So when seeking it allows the gap
// to be twice as big as the fuzz value. We only want to allow EOS_FUZZ gap.
@@ -390,17 +390,17 @@ RefPtr<MediaSourceTrackDemuxer::SeekProm
}
return SeekPromise::CreateAndResolve(seekTime, __func__);
}
RefPtr<MediaSourceTrackDemuxer::SamplesPromise>
MediaSourceTrackDemuxer::DoGetSamples(int32_t aNumSamples) {
if (!mManager) {
return SamplesPromise::CreateAndReject(
- MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
+ MediaResult(NS_ERROR_DOM_MEDIA_CANCELED,
RESULT_DETAIL("manager is detached.")),
__func__);
}
MOZ_ASSERT(OnTaskQueue());
if (mReset) {
// If a seek (or reset) was recently performed, we ensure that the data
// we are about to retrieve is still available.
@@ -446,17 +446,17 @@ MediaSourceTrackDemuxer::DoGetSamples(in
return SamplesPromise::CreateAndResolve(samples, __func__);
}
RefPtr<MediaSourceTrackDemuxer::SkipAccessPointPromise>
MediaSourceTrackDemuxer::DoSkipToNextRandomAccessPoint(
const TimeUnit& aTimeThreadshold) {
if (!mManager) {
return SkipAccessPointPromise::CreateAndReject(
- SkipFailureHolder(MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
+ SkipFailureHolder(MediaResult(NS_ERROR_DOM_MEDIA_CANCELED,
RESULT_DETAIL("manager is detached.")),
0),
__func__);
}
MOZ_ASSERT(OnTaskQueue());
uint32_t parsed = 0;
// Ensure that the data we are about to skip to is still available.

View file

@ -0,0 +1,27 @@
# Bug 1669471 - Get rid of `DeprecationWarning` in `file_generate.py` r=firefox-build-system-reviewers,mhentges
# `imp` is deprecated since Python 3.4 and later Python versions are very noisy about printing `DeprecationWarning`s; instead, use its replacement, `importlib`.
--- a/python/mozbuild/mozbuild/action/file_generate.py
+++ b/python/mozbuild/mozbuild/action/file_generate.py
@@ -9,7 +9,7 @@
from __future__ import absolute_import, print_function
import argparse
-import imp
+import importlib.util
import os
import six
import sys
@@ -56,9 +56,9 @@
# Since we're invoking the script in a roundabout way, we provide this
# bit of convenience.
sys.path.append(os.path.dirname(script))
- with open(script, 'r') as fh:
- module = imp.load_module('script', fh, script,
- ('.py', 'r', imp.PY_SOURCE))
+ spec = importlib.util.spec_from_file_location('script', script)
+ module = importlib.util.module_from_spec(spec)
+ spec.loader.exec_module(module)
method = args.method_name
if not hasattr(module, method):
print('Error: script "{0}" is missing a {1} method'.format(script, method),

143
icecat-pgo.patch Normal file
View file

@ -0,0 +1,143 @@
diff -up a/build/moz.configure/lto-pgo.configure.pgo b/build/moz.configure/lto-pgo.configure
--- a/build/moz.configure/lto-pgo.configure.pgo 2020-09-30 19:41:10.000000000 +0200
+++ b/build/moz.configure/lto-pgo.configure 2020-10-01 14:48:15.459225300 +0200
@@ -69,12 +69,14 @@ set_config('PGO_PROFILE_PATH', pgo_profi
@imports(_from='__builtin__', _import='min')
def pgo_flags(compiler, profdata, target_is_windows):
if compiler.type == 'gcc':
+ #profile_use = '-fprofile-use=$(topobjdir)'
+ profile_use = '-fprofile-use'
return namespace(
gen_cflags=['-fprofile-generate'],
gen_ldflags=['-fprofile-generate'],
- use_cflags=['-fprofile-use', '-fprofile-correction',
+ use_cflags=[profile_use, '-fprofile-correction',
'-Wcoverage-mismatch'],
- use_ldflags=['-fprofile-use'],
+ use_ldflags=[profile_use],
)
if compiler.type in ('clang-cl', 'clang'):
@@ -192,13 +194,13 @@ def lto(value, c_compiler, ld64_known_go
cflags.append("-flto")
ldflags.append("-flto")
else:
- cflags.append("-flto=thin")
- ldflags.append("-flto=thin")
+ cflags.append("-flto")
+ ldflags.append("-flto")
elif c_compiler.type == 'clang-cl':
if len(value) and value[0].lower() == 'full':
cflags.append("-flto")
else:
- cflags.append("-flto=thin")
+ cflags.append("-flto")
# With clang-cl, -flto can only be used with -c or -fuse-ld=lld.
# AC_TRY_LINKs during configure don't have -c, so pass -fuse-ld=lld.
cflags.append("-fuse-ld=lld");
diff -up a/build/pgo/profileserver.py.pgo b/build/pgo/profileserver.py
--- a/build/pgo/profileserver.py.pgo 2020-09-30 19:41:10.000000000 +0200
+++ b/build/pgo/profileserver.py 2020-10-01 13:54:58.535312905 +0200
@@ -11,7 +11,7 @@
import subprocess
import mozcrash
-from mozbuild.base import MozbuildObject, BinaryNotFoundException
+from mozbuild.base import MozbuildObject, BinaryNotFoundException, BuildEnvironmentNotFoundException
from mozfile import TemporaryDirectory
from mozhttpd import MozHttpd
from mozprofile import IceCatProfile, Preferences
@@ -84,9 +84,22 @@ if __name__ == '__main__':
port=PORT,
options='primary,privileged')
- old_profraw_files = glob.glob('*.profraw')
- for f in old_profraw_files:
- os.remove(f)
+ using_gcc = False
+ try:
+ if build.config_environment.substs.get('CC_TYPE') == 'gcc':
+ using_gcc = True
+ except BuildEnvironmentNotFoundException:
+ pass
+
+ if using_gcc:
+ for dirpath, _, filenames in os.walk('.'):
+ for f in filenames:
+ if f.endswith('.gcda'):
+ os.remove(os.path.join(dirpath, f))
+ else:
+ old_profraw_files = glob.glob('*.profraw')
+ for f in old_profraw_files:
+ os.remove(f)
with TemporaryDirectory() as profilePath:
# TODO: refactor this into mozprofile
@@ -191,6 +204,11 @@
print("IceCat exited successfully, but produced a crashreport")
sys.exit(1)
+
+ print('Copying profile data....')
+ os.system('pwd');
+ os.system('tar cf profdata.tar.gz `find . -name "*.gcda"`; cd ..; tar xf instrumented/profdata.tar.gz;');
+
llvm_profdata = env.get('LLVM_PROFDATA')
if llvm_profdata:
profraw_files = glob.glob('*.profraw')
diff -up a/build/unix/mozconfig.unix.pgo b/build/unix/mozconfig.unix
--- a/build/unix/mozconfig.unix.pgo 2020-09-30 19:41:10.000000000 +0200
+++ b/build/unix/mozconfig.unix 2020-10-01 13:54:58.535312905 +0200
@@ -6,6 +6,15 @@ if [ -n "$FORCE_GCC" ]; then
CC="$MOZ_FETCHES_DIR/gcc/bin/gcc"
CXX="$MOZ_FETCHES_DIR/gcc/bin/g++"
+ if [ -n "$MOZ_PGO" ]; then
+ if [ -z "$USE_ARTIFACT" ]; then
+ ac_add_options --enable-lto
+ fi
+ export AR="$topsrcdir/gcc/bin/gcc-ar"
+ export NM="$topsrcdir/gcc/bin/gcc-nm"
+ export RANLIB="$topsrcdir/gcc/bin/gcc-ranlib"
+ fi
+
# We want to make sure we use binutils and other binaries in the tooltool
# package.
mk_add_options "export PATH=$MOZ_FETCHES_DIR/gcc/bin:$PATH"
diff -up a/extensions/spellcheck/src/moz.build.pgo b/extensions/spellcheck/src/moz.build
--- a/extensions/spellcheck/src/moz.build.pgo 2020-09-30 19:41:17.000000000 +0200
+++ b/extensions/spellcheck/src/moz.build 2020-10-01 13:54:58.535312905 +0200
@@ -31,3 +31,5 @@ EXPORTS.mozilla += [
if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
CXXFLAGS += ['-Wno-error=shadow']
+
+CXXFLAGS += ['-fno-devirtualize']
\ No newline at end of file
diff -up a/python/mozbuild/mozbuild/build_commands.py.pgo b/python/mozbuild/mozbuild/build_commands.py
--- a/python/mozbuild/mozbuild/build_commands.py.pgo 2020-09-30 19:41:46.000000000 +0200
+++ b/python/mozbuild/mozbuild/build_commands.py 2020-10-01 13:54:58.535312905 +0200
@@ -108,7 +108,8 @@ class Build(MachCommandBase):
return status
pgo_env = os.environ.copy()
- pgo_env['LLVM_PROFDATA'] = instr.config_environment.substs.get('LLVM_PROFDATA')
+ if instr.config_environment.substs.get('CC_TYPE') != 'gcc':
+ pgo_env['LLVM_PROFDATA'] = instr.config_environment.substs.get('LLVM_PROFDATA')
pgo_env['JARLOG_FILE'] = mozpath.join(orig_topobjdir, 'jarlog/en-US.log')
pgo_cmd = [
instr.virtualenv_manager.python_path,
--- a/toolkit/components/terminator/nsTerminator.cpp.pgo 2020-10-07 09:22:26.698243673 +0200
+++ b/toolkit/components/terminator/nsTerminator.cpp 2020-10-07 09:22:43.026312999 +0200
@@ -418,6 +418,11 @@ 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.
+ crashAfterMS = INT32_MAX;
+
UniquePtr<Options> options(new Options());
const PRIntervalTime ticksDuration = PR_MillisecondsToInterval(1000);
options->crashAfterTicks = crashAfterMS / ticksDuration;

View file

@ -0,0 +1,928 @@
# HG changeset patch
# User Emilio Cobos Álvarez <emilio@crisal.io>
# Date 1625585189 0
# Node ID 2418633d529c6df00a83e973295eed0e891990a6
# Parent 0b5bfe85b344b34894f72176099da78c3849b5cc
Bug 1719144 - Fix various imports for Python 3.10. r=firefox-build-system-reviewers,mhentges
These are enough for me to run bootstrap+configure+build.
Some touch third-party code (gyp), but per discussion in the earlier
versions of this revision that seems fine.
Differential Revision: https://phabricator.services.mozilla.com/D119080
diff --git a/python/mach/mach/config.py b/python/mach/mach/config.py
--- a/python/mach/mach/config.py
+++ b/python/mach/mach/config.py
@@ -17,6 +17,7 @@
from __future__ import absolute_import, unicode_literals
import collections
+import collections.abc
import os
import sys
import six
@@ -144,7 +145,7 @@
return _
-class ConfigSettings(collections.Mapping):
+class ConfigSettings(collections.abc.Mapping):
"""Interface for configuration settings.
This is the main interface to the configuration.
@@ -190,7 +191,7 @@
will result in exceptions being raised.
"""
- class ConfigSection(collections.MutableMapping, object):
+ class ConfigSection(collections.abc.MutableMapping, object):
"""Represents an individual config section."""
def __init__(self, config, name, settings):
object.__setattr__(self, '_config', config)
@@ -312,8 +313,8 @@
self._config.write(fh)
@classmethod
- def _format_metadata(cls, provider, section, option, type_cls, description,
- default=DefaultValue, extra=None):
+ def _format_metadata(cls, provider, section, option, type_cls, description,
+ default=DefaultValue, extra=None):
"""Formats and returns the metadata for a setting.
Each setting must have:
@@ -340,10 +340,7 @@
if isinstance(type_cls, string_types):
type_cls = TYPE_CLASSES[type_cls]
- meta = {
- 'description': description,
- 'type_cls': type_cls,
- }
+ meta = {'description': description, 'type_cls': type_cls}
if default != DefaultValue:
meta['default'] = default
diff --git a/python/mach/mach/decorators.py b/python/mach/mach/decorators.py
--- a/python/mach/mach/decorators.py
+++ b/python/mach/mach/decorators.py
@@ -1,16 +1,17 @@
# 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/.
from __future__ import absolute_import, unicode_literals
import argparse
import collections
+import collections.abc
from .base import MachError
from .registrar import Registrar
from mozbuild.base import MachCommandBase
class _MachCommand(object):
"""Container for mach command metadata."""
@@ -140,7 +141,7 @@
'Conditions argument must take a list ' + \
'of functions. Found %s instead.'
- if not isinstance(command.conditions, collections.Iterable):
+ if not isinstance(command.conditions, collections.abc.Iterable):
msg = msg % (command.name, type(command.conditions))
raise MachError(msg)
diff --git a/python/mach/mach/main.py b/python/mach/mach/main.py
--- a/python/mach/mach/main.py
+++ b/python/mach/mach/main.py
@@ -11,17 +11,17 @@ import argparse
import codecs
import errno
import imp
import logging
import os
import sys
import traceback
import uuid
-from collections import Iterable
+from collections.abc import Iterable
from six import string_types
from .base import (
CommandContext,
MachError,
MissingFileError,
NoCommandError,
diff --git a/python/mozbuild/mozbuild/backend/configenvironment.py b/python/mozbuild/mozbuild/backend/configenvironment.py
--- a/python/mozbuild/mozbuild/backend/configenvironment.py
+++ b/python/mozbuild/mozbuild/backend/configenvironment.py
@@ -4,17 +4,18 @@
from __future__ import absolute_import, print_function
import os
import six
import sys
import json
-from collections import Iterable, OrderedDict
+from collections.abc import Iterable
+from collections import OrderedDict
from types import ModuleType
import mozpack.path as mozpath
from mozbuild.util import (
FileAvoidWrite,
memoized_property,
ReadOnlyDict,
@@ -63,10 +64,7 @@
compile(source, path, 'exec', dont_inherit=1)
)
- g = {
- '__builtins__': __builtins__,
- '__file__': path,
- }
+ g = {"__builtins__": __builtins__, "__file__": path}
l = {}
try:
exec(code_cache[path][1], g, l)
diff --git a/python/mozbuild/mozbuild/makeutil.py b/python/mozbuild/mozbuild/makeutil.py
--- a/python/mozbuild/mozbuild/makeutil.py
+++ b/python/mozbuild/mozbuild/makeutil.py
@@ -7,7 +7,7 @@
import os
import re
import six
-from collections import Iterable
+from collections.abc import Iterable
class Makefile(object):
diff --git a/python/mozbuild/mozbuild/util.py b/python/mozbuild/mozbuild/util.py
--- a/python/mozbuild/mozbuild/util.py
+++ b/python/mozbuild/mozbuild/util.py
@@ -4,16 +4,17 @@
# This file contains miscellaneous utility functions that don't belong anywhere
# in particular.
from __future__ import absolute_import, print_function, unicode_literals
import argparse
import collections
+import collections.abc
import ctypes
import difflib
import errno
import functools
import hashlib
import io
import itertools
import os
@@ -782,7 +783,7 @@
self._strings = StrictOrderingOnAppendList()
self._children = {}
- class StringListAdaptor(collections.Sequence):
+ class StringListAdaptor(collections.abc.Sequence):
def __init__(self, hsl):
self._hsl = hsl
diff --git a/taskcluster/taskgraph/util/schema.py b/taskcluster/taskgraph/util/schema.py
--- a/taskcluster/taskgraph/util/schema.py
+++ b/taskcluster/taskgraph/util/schema.py
@@ -6,7 +6,7 @@
import re
import pprint
-import collections
+import collections.abc
import voluptuous
from six import text_type, iteritems
@@ -160,7 +160,7 @@
'Unexpected type in YAML schema: {} @ {}'.format(
type(k).__name__, path))
- if isinstance(sch, collections.Mapping):
+ if isinstance(sch, collections.abc.Mapping):
for k, v in iteritems(sch):
child = "{}[{!r}]".format(path, k)
check_identifier(child, k)
diff --git a/third_party/python/gyp/pylib/gyp/common.py b/third_party/python/gyp/pylib/gyp/common.py
--- a/third_party/python/gyp/pylib/gyp/common.py
+++ b/third_party/python/gyp/pylib/gyp/common.py
@@ -1,15 +1,16 @@
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import with_statement
import collections
+import collections.abc
import errno
import filecmp
import os.path
import re
import tempfile
import sys
@@ -489,17 +490,17 @@ def uniquer(seq, idfun=None):
marker = idfun(item)
if marker in seen: continue
seen[marker] = 1
result.append(item)
return result
# Based on http://code.activestate.com/recipes/576694/.
-class OrderedSet(collections.MutableSet):
+class OrderedSet(collections.abc.MutableSet):
def __init__(self, iterable=None):
self.end = end = []
end += [None, end, end] # sentinel node for doubly linked list
self.map = {} # key --> [key, prev, next]
if iterable is not None:
self |= iterable
def __len__(self):
# HG changeset patch
# User Emilio Cobos Álvarez <emilio@crisal.io>
# Date 1625657350 -7200
# Node ID 6b2a1a09cd4735386414483dd4050c25f9e58e86
# Parent d2ab10b1b1619f8e2473837ed9043ad28c842aa5
Bug 1719144 - Keep some code python2 compatible since we still run it in some windows talos jobs.
MANUAL PUSH: Orange fix CLOSED TREE
diff --git a/testing/mozbase/manifestparser/manifestparser/filters.py b/testing/mozbase/manifestparser/manifestparser/filters.py
--- a/testing/mozbase/manifestparser/manifestparser/filters.py
+++ b/testing/mozbase/manifestparser/manifestparser/filters.py
@@ -12,7 +12,7 @@
import itertools
import os
-from collections import defaultdict, MutableSequence
+from collections.abc import MutableSequence
import six
from six import string_types
--- a/third_party/python/pyyaml/lib3/yaml/constructor.orig.py 2021-07-13 12:14:20.000000000 +0200
+++ b/third_party/python/pyyaml/lib3/yaml/constructor.py 2021-07-14 14:36:31.579176122 +0200
@@ -5,7 +5,7 @@
from .error import *
from .nodes import *
-import collections, datetime, base64, binascii, re, sys, types
+import collections.abc, datetime, base64, binascii, re, sys, types
class ConstructorError(MarkedYAMLError):
pass
@@ -123,7 +123,7 @@
mapping = {}
for key_node, value_node in node.value:
key = self.construct_object(key_node, deep=deep)
- if not isinstance(key, collections.Hashable):
+ if not isinstance(key, collections.abc.Hashable):
raise ConstructorError("while constructing a mapping", node.start_mark,
"found unhashable key", key_node.start_mark)
value = self.construct_object(value_node, deep=deep)
--- a/third_party/python/requests/requests/cookies.orig.py 2021-08-02 21:40:27.000000000 +0200
+++ b/third_party/python/requests/requests/cookies.py 2021-08-03 21:46:38.917998970 +0200
@@ -10,6 +10,7 @@
import time
import calendar
import collections
+import collections.abc
from .compat import cookielib, urlparse, urlunparse, Morsel
try:
@@ -161,7 +162,7 @@
Use .get and .set and include domain and path args in order to be more specific."""
-class RequestsCookieJar(cookielib.CookieJar, collections.MutableMapping):
+class RequestsCookieJar(cookielib.CookieJar, collections.abc.MutableMapping):
"""Compatibility class; is a cookielib.CookieJar, but exposes a dict
interface.
--- a/third_party/python/requests/requests/utils.orig.py 2021-08-02 21:40:27.000000000 +0200
+++ b/third_party/python/requests/requests/utils.py 2021-08-03 21:47:12.396466647 +0200
@@ -12,6 +12,7 @@
import cgi
import codecs
import collections
+import collections.abc
import io
import os
import platform
--- a/third_party/python/requests/requests/structures.orig.py 2021-08-02 21:40:27.000000000 +0200
+++ b/third_party/python/requests/requests/structures.py 2021-08-04 08:03:34.858332348 +0200
@@ -9,9 +9,10 @@
"""
import collections
+import collections.abc
-class CaseInsensitiveDict(collections.MutableMapping):
+class CaseInsensitiveDict(collections.abc.MutableMapping):
"""
A case-insensitive ``dict``-like object.
diff -up a/third_party/python/voluptuous/voluptuous-0.11.5.dist-info/RECORD.build-python-2 b/third_party/python/voluptuous/voluptuous-0.11.5.dist-info/RECORD
diff -up a/third_party/python/voluptuous/voluptuous-0.12.1.dist-info/COPYING.build-python-2 b/third_party/python/voluptuous/voluptuous-0.12.1.dist-info/COPYING
--- a/third_party/python/voluptuous/voluptuous-0.12.1.dist-info/COPYING.build-python-2 2021-07-21 09:42:47.774128166 +0200
+++ b/third_party/python/voluptuous/voluptuous-0.12.1.dist-info/COPYING 2021-07-21 09:42:47.774128166 +0200
@@ -0,0 +1,25 @@
+Copyright (c) 2010, Alec Thomas
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ - Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+ - Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+ - Neither the name of SwapOff.org nor the names of its contributors may
+ be used to endorse or promote products derived from this software without
+ specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff -up a/third_party/python/voluptuous/voluptuous-0.12.1.dist-info/RECORD.build-python-2 b/third_party/python/voluptuous/voluptuous-0.12.1.dist-info/RECORD
--- a/third_party/python/voluptuous/voluptuous-0.12.1.dist-info/RECORD.build-python-2 2021-07-21 09:42:47.774128166 +0200
+++ b/third_party/python/voluptuous/voluptuous-0.12.1.dist-info/RECORD 2021-07-21 09:42:47.774128166 +0200
@@ -0,0 +1,11 @@
+voluptuous/__init__.py,sha256=tSYWPAIWee6YwcMK8hxmaiagG_swokUMeH8MluJLWZM,203
+voluptuous/error.py,sha256=fLRmJwKp0bqRGgBM34ztg9MTxhEOf465sbQcvJlEtAk,4026
+voluptuous/humanize.py,sha256=hZlhdN4aVeGDIXdtSTeyEbmku65SDPRuut3mOfuRQP0,1606
+voluptuous/schema_builder.py,sha256=xVJpf3uJMyS1CKwzDw3rEK39ebqDiF_A2Kbq4VnZ3Aw,43677
+voluptuous/util.py,sha256=RXLZ2b5y-A4az3teG6UpCx2UZcXpS11sIVCdORyKar8,3150
+voluptuous/validators.py,sha256=xZgyKH-EVqUHCHral5gzViXq4HfEjJEsGdQy7z6llc0,32798
+voluptuous-0.12.1.dist-info/COPYING,sha256=JHtJdren-k2J2Vh8qlCVVh60bcVFfyJ59ipitUUq3qk,1486
+voluptuous-0.12.1.dist-info/METADATA,sha256=OdEydy5NydPFFzAhP8qj_YqJsQPQvoIt5ZT1t8B14Ok,20120
+voluptuous-0.12.1.dist-info/WHEEL,sha256=S6zePDbUAjzMmpYOg2cHDxuYFWw7WiOXt6ogM6hIB5Q,92
+voluptuous-0.12.1.dist-info/top_level.txt,sha256=TTdVb7M-vndb67UqTmAxuVjpAUakrlAWJYqvo3w4Iqc,11
+voluptuous-0.12.1.dist-info/RECORD,,
diff -up a/third_party/python/voluptuous/voluptuous/error.py.build-python-2 b/third_party/python/voluptuous/voluptuous/error.py
--- a/third_party/python/voluptuous/voluptuous/error.py.build-python-2 2021-07-05 21:16:03.000000000 +0200
+++ b/third_party/python/voluptuous/voluptuous/error.py 2021-07-21 09:42:47.775128197 +0200
@@ -142,11 +142,11 @@ class BooleanInvalid(Invalid):
class UrlInvalid(Invalid):
- """The value is not a url."""
+ """The value is not a URL."""
class EmailInvalid(Invalid):
- """The value is not a email."""
+ """The value is not an email address."""
class FileInvalid(Invalid):
diff -up a/third_party/python/voluptuous/voluptuous/__init__.py.build-python-2 b/third_party/python/voluptuous/voluptuous/__init__.py
--- a/third_party/python/voluptuous/voluptuous/__init__.py.build-python-2 2021-07-05 21:16:03.000000000 +0200
+++ b/third_party/python/voluptuous/voluptuous/__init__.py 2021-07-21 09:42:47.775128197 +0200
@@ -5,5 +5,5 @@ from voluptuous.validators import *
from voluptuous.util import *
from voluptuous.error import *
-__version__ = '0.11.5'
+__version__ = '0.12.1'
__author__ = 'alecthomas'
diff -up a/third_party/python/voluptuous/voluptuous/schema_builder.py.build-python-2 b/third_party/python/voluptuous/voluptuous/schema_builder.py
--- a/third_party/python/voluptuous/voluptuous/schema_builder.py.build-python-2 2021-07-05 21:16:03.000000000 +0200
+++ b/third_party/python/voluptuous/voluptuous/schema_builder.py 2021-07-21 09:42:47.775128197 +0200
@@ -22,6 +22,11 @@ else:
def iteritems(d):
return d.iteritems()
+if sys.version_info >= (3, 3):
+ _Mapping = collections.abc.Mapping
+else:
+ _Mapping = collections.Mapping
+
"""Schema validation for Python data structures.
Given eg. a nested data structure like this:
@@ -280,7 +285,7 @@ class Schema(object):
return schema.__voluptuous_compile__(self)
if isinstance(schema, Object):
return self._compile_object(schema)
- if isinstance(schema, collections.Mapping):
+ if isinstance(schema, _Mapping):
return self._compile_dict(schema)
elif isinstance(schema, list):
return self._compile_list(schema)
@@ -610,11 +615,11 @@ class Schema(object):
if not isinstance(data, seq_type):
raise er.SequenceTypeInvalid('expected a %s' % seq_type_name, path)
- # Empty seq schema, allow any data.
+ # Empty seq schema, reject any data.
if not schema:
if data:
raise er.MultipleInvalid([
- er.ValueInvalid('not a valid value', [value]) for value in data
+ er.ValueInvalid('not a valid value', path if path else data)
])
return data
@@ -735,7 +740,7 @@ class Schema(object):
result = self.schema.copy()
- # returns the key that may have been passed as arugment to Marker constructor
+ # returns the key that may have been passed as an argument to Marker constructor
def key_literal(key):
return (key.schema if isinstance(key, Marker) else key)
@@ -771,9 +776,10 @@ class Schema(object):
result[key] = value
# recompile and send old object
+ result_cls = type(self)
result_required = (required if required is not None else self.required)
result_extra = (extra if extra is not None else self.extra)
- return Schema(result, required=result_required, extra=result_extra)
+ return result_cls(result, required=result_required, extra=result_extra)
def _compile_scalar(schema):
@@ -809,7 +815,7 @@ def _compile_scalar(schema):
def validate_callable(path, data):
try:
return schema(data)
- except ValueError as e:
+ except ValueError:
raise er.ValueInvalid('not a valid value', path)
except er.Invalid as e:
e.prepend(path)
@@ -1121,8 +1127,11 @@ class Inclusive(Optional):
True
"""
- def __init__(self, schema, group_of_inclusion, msg=None):
- super(Inclusive, self).__init__(schema, msg=msg)
+ def __init__(self, schema, group_of_inclusion,
+ msg=None, description=None, default=UNDEFINED):
+ super(Inclusive, self).__init__(schema, msg=msg,
+ default=default,
+ description=description)
self.group_of_inclusion = group_of_inclusion
diff -up a/third_party/python/voluptuous/voluptuous/util.py.build-python-2 b/third_party/python/voluptuous/voluptuous/util.py
--- a/third_party/python/voluptuous/voluptuous/util.py.build-python-2 2021-07-05 21:16:03.000000000 +0200
+++ b/third_party/python/voluptuous/voluptuous/util.py 2021-07-21 09:42:47.776128229 +0200
@@ -7,6 +7,14 @@ from voluptuous import validators
__author__ = 'tusharmakkar08'
+def _fix_str(v):
+ if sys.version_info[0] == 2 and isinstance(v, unicode):
+ s = v
+ else:
+ s = str(v)
+ return s
+
+
def Lower(v):
"""Transform a string to lower case.
@@ -14,7 +22,7 @@ def Lower(v):
>>> s('HI')
'hi'
"""
- return str(v).lower()
+ return _fix_str(v).lower()
def Upper(v):
@@ -24,7 +32,7 @@ def Upper(v):
>>> s('hi')
'HI'
"""
- return str(v).upper()
+ return _fix_str(v).upper()
def Capitalize(v):
@@ -34,7 +42,7 @@ def Capitalize(v):
>>> s('hello world')
'Hello world'
"""
- return str(v).capitalize()
+ return _fix_str(v).capitalize()
def Title(v):
@@ -44,7 +52,7 @@ def Title(v):
>>> s('hello world')
'Hello World'
"""
- return str(v).title()
+ return _fix_str(v).title()
def Strip(v):
@@ -54,7 +62,7 @@ def Strip(v):
>>> s(' hello world ')
'hello world'
"""
- return str(v).strip()
+ return _fix_str(v).strip()
class DefaultTo(object):
diff -up a/third_party/python/voluptuous/voluptuous/validators.py.build-python-2 b/third_party/python/voluptuous/voluptuous/validators.py
--- a/third_party/python/voluptuous/voluptuous/validators.py.build-python-2 2021-07-05 21:16:03.000000000 +0200
+++ b/third_party/python/voluptuous/voluptuous/validators.py 2021-07-21 09:42:47.776128229 +0200
@@ -192,15 +192,26 @@ class _WithSubValidators(object):
def __init__(self, *validators, **kwargs):
self.validators = validators
self.msg = kwargs.pop('msg', None)
+ self.required = kwargs.pop('required', False)
+ self.discriminant = kwargs.pop('discriminant', None)
def __voluptuous_compile__(self, schema):
- self._compiled = [
- schema._compile(v)
- for v in self.validators
- ]
+ self._compiled = []
+ old_required = schema.required
+ self.schema = schema
+ for v in self.validators:
+ schema.required = self.required
+ self._compiled.append(schema._compile(v))
+ schema.required = old_required
return self._run
def _run(self, path, value):
+ if self.discriminant is not None:
+ self._compiled = [
+ self.schema._compile(v)
+ for v in self.discriminant(value, self.validators)
+ ]
+
return self._exec(self._compiled, value, path)
def __call__(self, v):
@@ -218,7 +229,7 @@ class Any(_WithSubValidators):
"""Use the first validated value.
:param msg: Message to deliver to user if validation fails.
- :param kwargs: All other keyword arguments are passed to the sub-Schema constructors.
+ :param kwargs: All other keyword arguments are passed to the sub-schema constructors.
:returns: Return value of the first validator that passes.
>>> validate = Schema(Any('true', 'false',
@@ -262,13 +273,57 @@ class Any(_WithSubValidators):
Or = Any
+class Union(_WithSubValidators):
+ """Use the first validated value among those selected by discriminant.
+
+ :param msg: Message to deliver to user if validation fails.
+ :param discriminant(value, validators): Returns the filtered list of validators based on the value.
+ :param kwargs: All other keyword arguments are passed to the sub-schema constructors.
+ :returns: Return value of the first validator that passes.
+
+ >>> validate = Schema(Union({'type':'a', 'a_val':'1'},{'type':'b', 'b_val':'2'},
+ ... discriminant=lambda val, alt: filter(
+ ... lambda v : v['type'] == val['type'] , alt)))
+ >>> validate({'type':'a', 'a_val':'1'}) == {'type':'a', 'a_val':'1'}
+ True
+ >>> with raises(MultipleInvalid, "not a valid value for dictionary value @ data['b_val']"):
+ ... validate({'type':'b', 'b_val':'5'})
+
+ ```discriminant({'type':'b', 'a_val':'5'}, [{'type':'a', 'a_val':'1'},{'type':'b', 'b_val':'2'}])``` is invoked
+
+ Without the discriminant, the exception would be "extra keys not allowed @ data['b_val']"
+ """
+
+ def _exec(self, funcs, v, path=None):
+ error = None
+ for func in funcs:
+ try:
+ if path is None:
+ return func(v)
+ else:
+ return func(path, v)
+ except Invalid as e:
+ if error is None or len(e.path) > len(error.path):
+ error = e
+ else:
+ if error:
+ raise error if self.msg is None else AnyInvalid(
+ self.msg, path=path)
+ raise AnyInvalid(self.msg or 'no valid value found',
+ path=path)
+
+
+# Convenience alias
+Switch = Union
+
+
class All(_WithSubValidators):
"""Value must pass all validators.
The output of each validator is passed as input to the next.
:param msg: Message to deliver to user if validation fails.
- :param kwargs: All other keyword arguments are passed to the sub-Schema constructors.
+ :param kwargs: All other keyword arguments are passed to the sub-schema constructors.
>>> validate = Schema(All('10', Coerce(int)))
>>> validate('10')
@@ -303,7 +358,7 @@ class Match(object):
>>> with raises(MultipleInvalid, 'expected string or buffer'):
... validate(123)
- Pattern may also be a _compiled regular expression:
+ Pattern may also be a compiled regular expression:
>>> validate = Schema(Match(re.compile(r'0x[A-F0-9]+', re.I)))
>>> validate('0x123ef4')
@@ -361,38 +416,38 @@ def _url_validation(v):
return parsed
-@message('expected an Email', cls=EmailInvalid)
+@message('expected an email address', cls=EmailInvalid)
def Email(v):
- """Verify that the value is an Email or not.
+ """Verify that the value is an email address or not.
>>> s = Schema(Email())
- >>> with raises(MultipleInvalid, 'expected an Email'):
+ >>> with raises(MultipleInvalid, 'expected an email address'):
... s("a.com")
- >>> with raises(MultipleInvalid, 'expected an Email'):
+ >>> with raises(MultipleInvalid, 'expected an email address'):
... s("a@.com")
- >>> with raises(MultipleInvalid, 'expected an Email'):
+ >>> with raises(MultipleInvalid, 'expected an email address'):
... s("a@.com")
>>> s('t@x.com')
't@x.com'
"""
try:
if not v or "@" not in v:
- raise EmailInvalid("Invalid Email")
+ raise EmailInvalid("Invalid email address")
user_part, domain_part = v.rsplit('@', 1)
if not (USER_REGEX.match(user_part) and DOMAIN_REGEX.match(domain_part)):
- raise EmailInvalid("Invalid Email")
+ raise EmailInvalid("Invalid email address")
return v
except:
raise ValueError
-@message('expected a Fully qualified domain name URL', cls=UrlInvalid)
+@message('expected a fully qualified domain name URL', cls=UrlInvalid)
def FqdnUrl(v):
- """Verify that the value is a Fully qualified domain name URL.
+ """Verify that the value is a fully qualified domain name URL.
>>> s = Schema(FqdnUrl())
- >>> with raises(MultipleInvalid, 'expected a Fully qualified domain name URL'):
+ >>> with raises(MultipleInvalid, 'expected a fully qualified domain name URL'):
... s("http://localhost/")
>>> s('http://w3.org')
'http://w3.org'
@@ -423,14 +478,14 @@ def Url(v):
raise ValueError
-@message('not a file', cls=FileInvalid)
+@message('Not a file', cls=FileInvalid)
@truth
def IsFile(v):
"""Verify the file exists.
>>> os.path.basename(IsFile()(__file__)).startswith('validators.py')
True
- >>> with raises(FileInvalid, 'not a file'):
+ >>> with raises(FileInvalid, 'Not a file'):
... IsFile()("random_filename_goes_here.py")
>>> with raises(FileInvalid, 'Not a file'):
... IsFile()(None)
@@ -445,7 +500,7 @@ def IsFile(v):
raise FileInvalid('Not a file')
-@message('not a directory', cls=DirInvalid)
+@message('Not a directory', cls=DirInvalid)
@truth
def IsDir(v):
"""Verify the directory exists.
@@ -487,11 +542,11 @@ def PathExists(v):
raise PathInvalid("Not a Path")
-def Maybe(validator):
+def Maybe(validator, msg=None):
"""Validate that the object matches given validator or is None.
- :raises Invalid: if the value does not match the given validator and is not
- None
+ :raises Invalid: If the value does not match the given validator and is not
+ None.
>>> s = Schema(Maybe(int))
>>> s(10)
@@ -500,7 +555,7 @@ def Maybe(validator):
... s("string")
"""
- return Any(None, validator)
+ return Any(validator, None, msg=msg)
class Range(object):
@@ -533,23 +588,30 @@ class Range(object):
self.msg = msg
def __call__(self, v):
- if self.min_included:
- if self.min is not None and not v >= self.min:
- raise RangeInvalid(
- self.msg or 'value must be at least %s' % self.min)
- else:
- if self.min is not None and not v > self.min:
- raise RangeInvalid(
- self.msg or 'value must be higher than %s' % self.min)
- if self.max_included:
- if self.max is not None and not v <= self.max:
- raise RangeInvalid(
- self.msg or 'value must be at most %s' % self.max)
- else:
- if self.max is not None and not v < self.max:
- raise RangeInvalid(
- self.msg or 'value must be lower than %s' % self.max)
- return v
+ try:
+ if self.min_included:
+ if self.min is not None and not v >= self.min:
+ raise RangeInvalid(
+ self.msg or 'value must be at least %s' % self.min)
+ else:
+ if self.min is not None and not v > self.min:
+ raise RangeInvalid(
+ self.msg or 'value must be higher than %s' % self.min)
+ if self.max_included:
+ if self.max is not None and not v <= self.max:
+ raise RangeInvalid(
+ self.msg or 'value must be at most %s' % self.max)
+ else:
+ if self.max is not None and not v < self.max:
+ raise RangeInvalid(
+ self.msg or 'value must be lower than %s' % self.max)
+
+ return v
+
+ # Objects that lack a partial ordering, e.g. None or strings will raise TypeError
+ except TypeError:
+ raise RangeInvalid(
+ self.msg or 'invalid value or type (must have a partial ordering)')
def __repr__(self):
return ('Range(min=%r, max=%r, min_included=%r,'
@@ -579,11 +641,17 @@ class Clamp(object):
self.msg = msg
def __call__(self, v):
- if self.min is not None and v < self.min:
- v = self.min
- if self.max is not None and v > self.max:
- v = self.max
- return v
+ try:
+ if self.min is not None and v < self.min:
+ v = self.min
+ if self.max is not None and v > self.max:
+ v = self.max
+ return v
+
+ # Objects that lack a partial ordering, e.g. None or strings will raise TypeError
+ except TypeError:
+ raise RangeInvalid(
+ self.msg or 'invalid value or type (must have a partial ordering)')
def __repr__(self):
return 'Clamp(min=%s, max=%s)' % (self.min, self.max)
@@ -598,13 +666,19 @@ class Length(object):
self.msg = msg
def __call__(self, v):
- if self.min is not None and len(v) < self.min:
- raise LengthInvalid(
- self.msg or 'length of value must be at least %s' % self.min)
- if self.max is not None and len(v) > self.max:
- raise LengthInvalid(
- self.msg or 'length of value must be at most %s' % self.max)
- return v
+ try:
+ if self.min is not None and len(v) < self.min:
+ raise LengthInvalid(
+ self.msg or 'length of value must be at least %s' % self.min)
+ if self.max is not None and len(v) > self.max:
+ raise LengthInvalid(
+ self.msg or 'length of value must be at most %s' % self.max)
+ return v
+
+ # Objects that havbe no length e.g. None or strings will raise TypeError
+ except TypeError:
+ raise RangeInvalid(
+ self.msg or 'invalid value or type')
def __repr__(self):
return 'Length(min=%s, max=%s)' % (self.min, self.max)
@@ -663,7 +737,8 @@ class In(object):
except TypeError:
check = True
if check:
- raise InInvalid(self.msg or 'value is not allowed')
+ raise InInvalid(self.msg or
+ 'value must be one of {}'.format(sorted(self.container)))
return v
def __repr__(self):
@@ -683,7 +758,8 @@ class NotIn(object):
except TypeError:
check = True
if check:
- raise NotInInvalid(self.msg or 'value is not allowed')
+ raise NotInInvalid(self.msg or
+ 'value must not be one of {}'.format(sorted(self.container)))
return v
def __repr__(self):
@@ -722,7 +798,7 @@ class ExactSequence(object):
the validators.
:param msg: Message to deliver to user if validation fails.
- :param kwargs: All other keyword arguments are passed to the sub-Schema
+ :param kwargs: All other keyword arguments are passed to the sub-schema
constructors.
>>> from voluptuous import Schema, ExactSequence
@@ -887,7 +963,7 @@ class Unordered(object):
class Number(object):
"""
Verify the number of digits that are present in the number(Precision),
- and the decimal places(Scale)
+ and the decimal places(Scale).
:raises Invalid: If the value does not match the provided Precision and Scale.
@@ -951,13 +1027,13 @@ class SomeOf(_WithSubValidators):
The output of each validator is passed as input to the next.
:param min_valid: Minimum number of valid schemas.
- :param validators: a list of schemas or validators to match input against
+ :param validators: List of schemas or validators to match input against.
:param max_valid: Maximum number of valid schemas.
:param msg: Message to deliver to user if validation fails.
- :param kwargs: All other keyword arguments are passed to the sub-Schema constructors.
+ :param kwargs: All other keyword arguments are passed to the sub-schema constructors.
- :raises NotEnoughValid: if the minimum number of validations isn't met
- :raises TooManyValid: if the more validations than the given amount is met
+ :raises NotEnoughValid: If the minimum number of validations isn't met.
+ :raises TooManyValid: If the maximum number of validations is exceeded.
>>> validate = Schema(SomeOf(min_valid=2, validators=[Range(1, 5), Any(float, int), 6.6]))
>>> validate(6.6)
Add to Phrasebook
No word lists for English (USA) → Italian...
Create a new word list...
Copy

23
icecat-wayland.desktop Normal file
View file

@ -0,0 +1,23 @@
[Desktop Entry]
Version=1.0
Name=GNU IceCat on Wayland
Comment=Browse the World Wide Web
GenericName=Web Browser
Keywords=Internet;WWW;Browser;Web;Explorer;
Exec=icecat-wayland --name icecat-wayland %u
Icon=icecat
Terminal=false
Type=Application
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;x-scheme-handler/chrome;video/webm;application/x-xpinstall;
Categories=Network;WebBrowser;
StartupNotify=true
Name[en_US]=GNU IceCat on Wayland
Actions=new-window;new-private-window;
[Desktop Action new-window]
Name=Open a New Window
Exec=icecat-wayland --name icecat-wayland --new-window %u
[Desktop Action new-private-window]
Name=Open a New Private Window
Exec=icecat-wayland --private-window --name icecat-wayland %u

7
icecat-wayland.sh.in Normal file
View file

@ -0,0 +1,7 @@
#!/bin/bash
#
# Run GNU IceCat under Wayland
#
export MOZ_ENABLE_WAYLAND=1
exec /__PREFIX__/bin/icecat "$@"

338
icecat-x11.desktop Normal file
View file

@ -0,0 +1,338 @@
[Desktop Entry]
Version=1.0
Name=GNU IceCat on X11
Comment=Browse the World Wide Web
Comment[ar]=تصفح الشبكة العنكبوتية العالمية
Comment[ast]=Restola pela Rede
Comment[bn]=
Comment[ca]=Navegueu per la web
Comment[cs]=Prohlížení stránek World Wide Webu
Comment[da]=Surf på internettet
Comment[de]=Im Internet surfen
Comment[el]=Μπορείτε να περιηγηθείτε στο διαδίκτυο (Web)
Comment[es]=Navegue por la web
Comment[et]=Lehitse veebi
Comment[fa]=صفحات شبکه جهانی اینترنت را مرور نمایید
Comment[fi]=Selaa Internetin WWW-sivuja
Comment[fr]=Naviguer sur le Web
Comment[gl]=Navegar pola rede
Comment[he]=גלישה ברחבי האינטרנט
Comment[hr]=Pretražite web
Comment[hu]=A világháló böngészése
Comment[it]=Esplora il web
Comment[ja]=
Comment[ko]=
Comment[ku]=Li torê bigere
Comment[lt]=Naršykite internete
Comment[nb]=Surf på nettet
Comment[nl]=Verken het internet
Comment[nn]=Surf på nettet
Comment[no]=Surf på nettet
Comment[pl]=Przeglądanie stron WWW
Comment[pt]=Navegue na Internet
Comment[pt_BR]=Navegue na Internet
Comment[ro]=Navigați pe Internet
Comment[ru]=Доступ в Интернет
Comment[sk]=Prehliadanie internetu
Comment[sl]=Brskajte po spletu
Comment[sv]=Surfa på webben
Comment[tr]=İnternet'te Gezinin
Comment[ug]=دۇنيادىكى توربەتلەرنى كۆرگىلى بولىدۇ
Comment[uk]=Перегляд сторінок Інтернету
Comment[vi]=Đ duyt các trang web
Comment[zh_CN]=
Comment[zh_TW]=
GenericName=Web Browser
GenericName[ar]=متصفح ويب
GenericName[ast]=Restolador Web
GenericName[bn]=
GenericName[ca]=Navegador web
GenericName[cs]=Webový prohlížeč
GenericName[da]=Webbrowser
GenericName[el]=Περιηγητής διαδικτύου
GenericName[es]=Navegador web
GenericName[et]=Veebibrauser
GenericName[fa]=مرورگر اینترنتی
GenericName[fi]=WWW-selain
GenericName[fr]=Navigateur Web
GenericName[gl]=Navegador Web
GenericName[he]=דפדפן אינטרנט
GenericName[hr]=Web preglednik
GenericName[hu]=Webböngésző
GenericName[it]=Browser web
GenericName[ja]=
GenericName[ko]=
GenericName[ku]=Geroka torê
GenericName[lt]=Interneto naršyklė
GenericName[nb]=Nettleser
GenericName[nl]=Webbrowser
GenericName[nn]=Nettlesar
GenericName[no]=Nettleser
GenericName[pl]=Przeglądarka WWW
GenericName[pt]=Navegador Web
GenericName[pt_BR]=Navegador Web
GenericName[ro]=Navigator Internet
GenericName[ru]=Веб-браузер
GenericName[sk]=Internetový prehliadač
GenericName[sl]=Spletni brskalnik
GenericName[sv]=Webbläsare
GenericName[tr]=Web Tarayıcı
GenericName[ug]=توركۆرگۈ
GenericName[uk]=Веб-браузер
GenericName[vi]=Trình duyt Web
GenericName[zh_CN]=
GenericName[zh_TW]=
Keywords=Internet;WWW;Browser;Web;Explorer;
Keywords[ar]=انترنت;إنترنت;متصفح;ويب;وب;
Keywords[ast]=Internet;WWW;Restolador;Web;Esplorador;
Keywords[ca]=Internet;WWW;Navegador;Web;Explorador;Explorer;
Keywords[cs]=Internet;WWW;Prohlížeč;Web;Explorer;
Keywords[da]=Internet;Internettet;WWW;Browser;Browse;Web;Surf;Nettet;
Keywords[de]=Internet;WWW;Browser;Web;Explorer;Webseite;Site;surfen;online;browsen;
Keywords[el]=Internet;WWW;Browser;Web;Explorer;Διαδίκτυο;Περιηγητής;IceCat;Φιρεφοχ;Ιντερνετ;
Keywords[es]=Explorador;Internet;WWW;
Keywords[fi]=Internet;WWW;Browser;Web;Explorer;selain;Internet-selain;internetselain;verkkoselain;netti;surffaa;
Keywords[fr]=Internet;WWW;Browser;Web;Explorer;Fureteur;Surfer;Navigateur;
Keywords[he]=דפדפן;אינטרנט;רשת;אתרים;אתר;פיירפוקס;מוזילה;
Keywords[hr]=Internet;WWW;preglednik;Web;
Keywords[hu]=Internet;WWW;Böngésző;Web;Háló;Net;Explorer;
Keywords[it]=Internet;WWW;Browser;Web;Navigatore;
Keywords[is]=Internet;WWW;Vafri;Vefur;Netvafri;Flakk;
Keywords[ja]=Internet;WWW;Web;;;;;
Keywords[nb]=Internett;WWW;Nettleser;Explorer;Web;Browser;Nettside;
Keywords[nl]=Internet;WWW;Browser;Web;Explorer;Verkenner;Website;Surfen;Online;
Keywords[pt]=Internet;WWW;Browser;Web;Explorador;Navegador;
Keywords[pt_BR]=Internet;WWW;Browser;Web;Explorador;Navegador;
Keywords[ru]=Internet;WWW;Browser;Web;Explorer;интернет;браузер;веб;файрфокс;огнелис;
Keywords[sk]=Internet;WWW;Prehliadač;Web;Explorer;
Keywords[sl]=Internet;WWW;Browser;Web;Explorer;Brskalnik;Splet;
Keywords[tr]=İnternet;WWW;Tarayıcı;Web;Gezgin;Web sitesi;Site;sörf;çevrimiçi;tara;
Keywords[uk]=Internet;WWW;Browser;Web;Explorer;Інтернет;мережа;переглядач;оглядач;браузер;веб;файрфокс;вогнелис;перегляд;
Keywords[vi]=Internet;WWW;Browser;Web;Explorer;Trình duyt;Trang web;
Keywords[zh_CN]=Internet;WWW;Browser;Web;Explorer;;;;;IceCat;ff;;;
Keywords[zh_TW]=Internet;WWW;Browser;Web;Explorer;;;;;;;
Exec=icecat-x11 --name icecat-x11 %u
Icon=icecat
Terminal=false
Type=Application
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;x-scheme-handler/chrome;video/webm;application/x-xpinstall;
Categories=Network;WebBrowser;
StartupNotify=true
Name[en_US]=GNU IceCat on X11
Actions=new-window;new-private-window;
[Desktop Action new-window]
Name=Open a New Window
Name[ach]=Dirica manyen
Name[af]=Nuwe venster
Name[an]=Nueva finestra
Name[ar]=نافذة جديدة
Name[as]=
Name[ast]=Ventana nueva
Name[az]=Yeni Pəncərə
Name[be]=Новае акно
Name[bg]=Нов прозорец
Name[bn-BD]= (N)
Name[bn-IN]=
Name[br]=Prenestr nevez
Name[brx]= '(N)
Name[bs]=Novi prozor
Name[ca]=Finestra nova
Name[cak]=K'ak'a' tzuwäch
Name[cs]=Nové okno
Name[cy]=Ffenestr Newydd
Name[da]=Nyt vindue
Name[de]=&#xad;Neues Fenster
Name[dsb]=Nowe wokno
Name[el]=Νέο παράθυρο
Name[en-GB]=New Window
Name[en-US]=New Window
Name[en-ZA]=New Window
Name[eo]=Nova fenestro
Name[es-AR]=Nueva ventana
Name[es-CL]=Nueva ventana
Name[es-ES]=Nueva ventana
Name[es-MX]=Nueva ventana
Name[et]=Uus aken
Name[eu]=Leiho berria
Name[fa]=پنجره جدید
Name[ff]=Henorde Hesere
Name[fi]=Uusi ikkuna
Name[fr]=&#xad;Nouvelle fenêtre
Name[fy-NL]=Nij finster
Name[ga-IE]=Fuinneog Nua
Name[gd]=Uinneag ùr
Name[gl]=Nova xanela
Name[gn]=Ovetã pyahu
Name[gu-IN]= િ
Name[he]=חלון חדש
Name[hi-IN]= ि
Name[hr]=Novi prozor
Name[hsb]=Nowe wokno
Name[hu]=Új ablak
Name[hy-AM]=Նոր Պատուհան
Name[id]=Jendela Baru
Name[is]=Nýr gluggi
Name[it]=Nuova finestra&#173;
Name[ja]=
Name[ja-JP-mac]=
Name[ka]=
Name[kk]=Жаңа терезе
Name[km]=
Name[kn]= ಿಿ
Name[ko]=
Name[kok]=
Name[ks]=نئئ وِنڈو
Name[lij]=Neuvo barcon
Name[lo]=
Name[lt]=Naujas langas
Name[ltg]=Jauns lūgs
Name[lv]=Jauns logs
Name[mai]= ि
Name[mk]=Нов прозорец
Name[ml]=ി
Name[mr]=
Name[ms]=Tetingkap Baru
Name[my]=
Name[nb-NO]=Nytt vindu
Name[ne-NP]=
Name[nl]=Nieuw venster
Name[nn-NO]=Nytt vindauge
Name[or]= ି
Name[pa-IN]= ਿ
Name[pl]=Nowe okno
Name[pt-BR]=Nova janela
Name[pt-PT]=Nova janela
Name[rm]=Nova fanestra
Name[ro]=Fereastră nouă
Name[ru]=Новое окно
Name[sat]= ि (N)
Name[si]=
Name[sk]=Nové okno
Name[sl]=Novo okno
Name[son]=Zanfun taaga
Name[sq]=Dritare e Re
Name[sr]=Нови прозор
Name[sv-SE]=Nytt fönster
Name[ta]=ி
Name[te]= ి
Name[th]=
Name[tr]=Yeni pencere
Name[tsz]=Eraatarakua jimpani
Name[uk]=Нове вікно
Name[ur]=نیا دریچہ
Name[uz]=Yangi oyna
Name[vi]=Ca s mi
Name[wo]=Palanteer bu bees
Name[xh]=Ifestile entsha
Name[zh-CN]=
Name[zh-TW]=
Exec=icecat-x11 --name icecat-x11 --new-window %u
[Desktop Action new-private-window]
Name=Open a New Private Window
Name[ach]=Dirica manyen me mung
Name[af]=Nuwe privaatvenster
Name[an]=Nueva finestra privada
Name[ar]=نافذة خاصة جديدة
Name[as]= ি
Name[ast]=Ventana privada nueva
Name[az]=Yeni Məxfi Pəncərə
Name[be]=Новае акно адасаблення
Name[bg]=Нов прозорец за поверително сърфиране
Name[bn-BD]= ি
Name[bn-IN]= ি
Name[br]=Prenestr merdeiñ prevez nevez
Name[brx]= '
Name[bs]=Novi privatni prozor
Name[ca]=Finestra privada nova
Name[cak]=K'ak'a' ichinan tzuwäch
Name[cs]=Nové anonymní okno
Name[cy]=Ffenestr Breifat Newydd
Name[da]=Nyt privat vindue
Name[de]=Neues privates Fenster
Name[dsb]=Nowe priwatne wokno
Name[el]=Νέο παράθυρο ιδιωτικής περιήγησης
Name[en-GB]=New Private Window
Name[en-US]=New Private Window
Name[en-ZA]=New Private Window
Name[eo]=Nova privata fenestro
Name[es-AR]=Nueva ventana privada
Name[es-CL]=Nueva ventana privada
Name[es-ES]=Nueva ventana privada
Name[es-MX]=Nueva ventana privada
Name[et]=Uus privaatne aken
Name[eu]=Leiho pribatu berria
Name[fa]=پنجره ناشناس جدید
Name[ff]=Henorde Suturo Hesere
Name[fi]=Uusi yksityinen ikkuna
Name[fr]=Nouvelle fenêtre de navigation privée
Name[fy-NL]=Nij priveefinster
Name[ga-IE]=Fuinneog Nua Phríobháideach
Name[gd]=Uinneag phrìobhaideach ùr
Name[gl]=Nova xanela privada
Name[gn]=Ovetã ñemi pyahu
Name[gu-IN]= િ
Name[he]=חלון פרטי חדש
Name[hi-IN]= ि ि
Name[hr]=Novi privatni prozor
Name[hsb]=Nowe priwatne wokno
Name[hu]=Új privát ablak
Name[hy-AM]=Սկսել Գաղտնի դիտարկում
Name[id]=Jendela Mode Pribadi Baru
Name[is]=Nýr huliðsgluggi
Name[it]=Nuova finestra anonima
Name[ja]=
Name[ja-JP-mac]=
Name[ka]=
Name[kk]=Жаңа жекелік терезе
Name[km]=
Name[kn]= ಿ ಿಿ
Name[ko]=
Name[kok]= ि
Name[ks]=نْو پرایوٹ وینڈو&amp;
Name[lij]=Neuvo barcon privou
Name[lo]=
Name[lt]=Naujas privataus naršymo langas
Name[ltg]=Jauns privatais lūgs
Name[lv]=Jauns privātais logs
Name[mai]= ि ि (W)
Name[mk]=Нов приватен прозорец
Name[ml]=ി
Name[mr]= ि
Name[ms]=Tetingkap Persendirian Baharu
Name[my]=New Private Window
Name[nb-NO]=Nytt privat vindu
Name[ne-NP]= ि
Name[nl]=Nieuw privévenster
Name[nn-NO]=Nytt privat vindauge
Name[or]= ି ି
Name[pa-IN]= ਿ
Name[pl]=Nowe okno prywatne
Name[pt-BR]=Nova janela privativa
Name[pt-PT]=Nova janela privada
Name[rm]=Nova fanestra privata
Name[ro]=Fereastră privată nouă
Name[ru]=Новое приватное окно
Name[sat]= ि ि (W )
Name[si]= (W)
Name[sk]=Nové okno v režime Súkromné prehliadanie
Name[sl]=Novo zasebno okno
Name[son]=Sutura zanfun taaga
Name[sq]=Dritare e Re Private
Name[sr]=Нови приватан прозор
Name[sv-SE]=Nytt privat fönster
Name[ta]=ி ி
Name[te]= ి ి
Name[th]=
Name[tr]=Yeni gizli pencere
Name[tsz]=Juchiiti eraatarakua jimpani
Name[uk]=Приватне вікно
Name[ur]=نیا نجی دریچہ
Name[uz]=Yangi maxfiy oyna
Name[vi]=Ca s riêng tư mi
Name[wo]=Panlanteeru biir bu bees
Name[xh]=Ifestile yangasese entsha
Name[zh-CN]=
Name[zh-TW]=
Exec=icecat-x11 --name icecat-x11 --private-window %u

7
icecat-x11.sh.in Normal file
View file

@ -0,0 +1,7 @@
#!/bin/bash
#
# Run GNU IceCat on X11 backend
#
export MOZ_DISABLE_WAYLAND=1
exec /__PREFIX__/bin/icecat "$@"

View file

@ -33,6 +33,10 @@
HTTPS Everywhere is an extension that encrypts your communications with many major websites, making your browsing more secure
</li>
<li>
ViewTube
Watch videos from video sharing websites with extra options
</li>
<li>
A set of companion extensions for LibreJS by Nathan Nichols (https://addons.mozilla.org/en-US/firefox/user/NateN1222/)
are pre-installed, and provide workarounds to use some services at USPS, RSF.org, SumOfUs.org, pay.gov, McDonald's, goteo.org
and Google Docs without using nonfree JavaScript.
@ -47,16 +51,16 @@
<url type="homepage">http://www.gnu.org/software/gnuzilla/</url>
<screenshots>
<screenshot type="default">
<image>https://sagitter.fedorapeople.org/icecat/icecat-screenshots/icecat1021.png</image>
<image>https://sagitter.fedorapeople.org/icecat/icecat-screenshots/icecat681.png</image>
</screenshot>
<screenshot>
<image>https://sagitter.fedorapeople.org/icecat/icecat-screenshots/icecat1022.png</image>
<image>https://sagitter.fedorapeople.org/icecat/icecat-screenshots/icecat682.png</image>
</screenshot>
<screenshot>
<image>https://sagitter.fedorapeople.org/icecat/icecat-screenshots/icecat1023.png</image>
<image>https://sagitter.fedorapeople.org/icecat/icecat-screenshots/icecat683.png</image>
</screenshot>
<screenshot>
<image>https://sagitter.fedorapeople.org/icecat/icecat-screenshots/icecat1024.png</image>
<image>https://sagitter.fedorapeople.org/icecat/icecat-screenshots/icecat684.png</image>
</screenshot>
</screenshots>
<updatecontact>sagitter_at_fedoraproject.org</updatecontact>

11
icecat.metainfo.xml Normal file
View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="addon">
<id>mozilla-requestpolicy</id>
<extends>icecat.desktop</extends>
<name>mozilla-requestpolicy</name>
<summary>Extension that gives you control over cross-site requests</summary>
<url type="homepage">https://requestpolicycontinued.github.io/</url>
<url type="bugtracker">https://github.com/requestpolicycontinued/requestpolicy/issues</url>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0+ and LGPL-3.0+</project_license>
</component>

View file

@ -39,12 +39,12 @@ cmdname=`basename $0`
MOZ_ARCH=$(uname -m)
case $MOZ_ARCH in
x86_64 | s390x | sparc64)
MOZ_LIB_DIR="/__PREFIX__/lib64"
SECONDARY_LIB_DIR="/__PREFIX__/lib"
MOZ_LIB_DIR="/usr/lib64"
SECONDARY_LIB_DIR="/usr/lib"
;;
* )
MOZ_LIB_DIR="/__PREFIX__/lib"
SECONDARY_LIB_DIR="/__PREFIX__/lib64"
MOZ_LIB_DIR="/usr/lib"
SECONDARY_LIB_DIR="/usr/lib64"
;;
esac
@ -64,21 +64,15 @@ MOZ_DIST_BIN="$MOZ_LIB_DIR/icecat"
MOZ_LANGPACKS_DIR="$MOZ_DIST_BIN/langpacks"
MOZ_EXTENSIONS_PROFILE_DIR="$HOME/.mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"
MOZ_PROGRAM="$MOZ_DIST_BIN/$MOZ_FIREFOX_FILE"
MOZ_LAUNCHER="$MOZ_DIST_BIN/icecat"
GETENFORCE_FILE="/usr/sbin/getenforce"
MOZ_LAUNCHER="$MOZ_DIST_BIN/run-icecat.sh"
##
## Enable Wayland backend?
## Enable Wayland backend by default?
##
if ! [ $MOZ_DISABLE_WAYLAND ] && [ "$WAYLAND_DISPLAY" ]; then
if __DEFAULT_WAYLAND__ && ! [ $MOZ_DISABLE_WAYLAND ]; then
if [ "$XDG_CURRENT_DESKTOP" == "GNOME" ]; then
export MOZ_ENABLE_WAYLAND=1
fi
## Enable Wayland on KDE/Sway
##
if [ "$XDG_SESSION_TYPE" == "wayland" ]; then
export MOZ_ENABLE_WAYLAND=1
fi
fi
##
@ -92,7 +86,7 @@ fi
## Set MOZ_GRE_CONF
##
MOZ_GRE_CONF=/etc/gre.d/gre.conf
if [ "$MOZ_LIB_DIR" == "/__PREFIX__/lib64" ]; then
if [ "$MOZ_LIB_DIR" == "/usr/lib64" ]; then
MOZ_GRE_CONF=/etc/gre.d/gre64.conf
fi
export MOZ_GRE_CONF
@ -181,7 +175,7 @@ MOZILLA_DOWN=0
if ! [ $MOZ_DISABLE_LANGPACKS ] || [ $MOZ_DISABLE_LANGPACKS -eq 0 ]; then
if [ -x $MOZ_DIST_BIN/$MOZ_FIREFOX_FILE ]; then
# Is icecat running?
/__PREFIX__/pidof icecat > /dev/null 2>&1
/usr/bin/pidof icecat > /dev/null 2>&1
MOZILLA_DOWN=$?
fi
fi
@ -213,8 +207,8 @@ if [ $MOZILLA_DOWN -ne 0 ]; then
CURRENT_LOCALE=${CURRENT_LOCALE:-$LANG}
# Try with a local variant first, then without a local variant
SHORTMOZLOCALE=`echo $CURRENT_LOCALE | sed "s|_\([^.]*\).*||g" | sed "s|\..*||g"`
MOZLOCALE=`echo $CURRENT_LOCALE | sed "s|_\([^.]*\).*|-\1|g" | sed "s|\..*||g"`
SHORTMOZLOCALE=`echo $CURRENT_LOCALE | sed "s|_\([^.]*\).*||g"`
MOZLOCALE=`echo $CURRENT_LOCALE | sed "s|_\([^.]*\).*|-\1|g"`
function create_langpack_link() {
local language=$*
@ -269,11 +263,13 @@ do
;;
esac
done
## Allow downgrade because during distro upgrade the build time can be
## older in newer version than the previous one.
##
export MOZ_ALLOW_DOWNGRADE=1
# Run the browser
debugging=0
if [ $debugging = 1 ]
then
echo $MOZ_LAUNCHER $script_args $MOZ_PROGRAM "$@"
fi
exec $MOZ_PROGRAM "$@"
exec $MOZ_LAUNCHER $script_args $MOZ_PROGRAM "$@"

File diff suppressed because it is too large Load diff

13
mozilla-1196777.patch Normal file
View file

@ -0,0 +1,13 @@
diff -up firefox-68.0/widget/gtk/nsWindow.cpp.1196777 firefox-68.0/widget/gtk/nsWindow.cpp
--- firefox-68.0/widget/gtk/nsWindow.cpp.1196777 2019-07-02 11:47:06.864726826 +0200
+++ firefox-68.0/widget/gtk/nsWindow.cpp 2019-07-02 11:48:09.896544339 +0200
@@ -156,7 +156,8 @@ const gint kEvents =
#if GTK_CHECK_VERSION(3, 4, 0)
GDK_SMOOTH_SCROLL_MASK | GDK_TOUCH_MASK |
#endif
- GDK_SCROLL_MASK | GDK_POINTER_MOTION_MASK | GDK_PROPERTY_CHANGE_MASK;
+ GDK_SCROLL_MASK | GDK_POINTER_MOTION_MASK | GDK_PROPERTY_CHANGE_MASK |
+ GDK_FOCUS_CHANGE_MASK;
#if !GTK_CHECK_VERSION(3, 22, 0)
typedef enum {

496
mozilla-1337988.patch Normal file
View file

@ -0,0 +1,496 @@
diff -up firefox-56.0/dom/plugins/base/nsJSNPRuntime.cpp.1337988 firefox-56.0/dom/plugins/base/nsJSNPRuntime.cpp
--- firefox-56.0/dom/plugins/base/nsJSNPRuntime.cpp.1337988 2017-09-14 22:15:56.000000000 +0200
+++ firefox-56.0/dom/plugins/base/nsJSNPRuntime.cpp 2017-09-25 10:34:11.205611698 +0200
@@ -1719,7 +1719,7 @@ NPObjWrapper_ObjectMoved(JSObject *obj,
auto entry =
static_cast<NPObjWrapperHashEntry*>(sNPObjWrappers->Search(npobj));
MOZ_ASSERT(entry && entry->mJSObj);
- MOZ_ASSERT(entry->mJSObj == old);
+ MOZ_ASSERT(entry->mJSObj.unbarrieredGetPtr() == old);
entry->mJSObj = obj;
}
diff -up firefox-56.0/js/ipc/JavaScriptShared.cpp.1337988 firefox-56.0/js/ipc/JavaScriptShared.cpp
--- firefox-56.0/js/ipc/JavaScriptShared.cpp.1337988 2017-07-31 18:20:47.000000000 +0200
+++ firefox-56.0/js/ipc/JavaScriptShared.cpp 2017-09-25 10:34:11.205611698 +0200
@@ -101,7 +101,7 @@ IdToObjectMap::has(const ObjectId& id, c
auto p = table_.lookup(id);
if (!p)
return false;
- return p->value() == obj;
+ return p->value().unbarrieredGet() == obj;
}
#endif
diff -up firefox-56.0/js/public/RootingAPI.h.1337988 firefox-56.0/js/public/RootingAPI.h
--- firefox-56.0/js/public/RootingAPI.h.1337988 2017-07-31 18:20:47.000000000 +0200
+++ firefox-56.0/js/public/RootingAPI.h 2017-09-25 10:34:11.206611695 +0200
@@ -148,6 +148,10 @@ template<typename T>
struct PersistentRootedMarker;
} /* namespace gc */
+#define DECLARE_POINTER_COMPARISON_OPS(T) \
+ bool operator==(const T& other) const { return get() == other; } \
+ bool operator!=(const T& other) const { return get() != other; }
+
// Important: Return a reference so passing a Rooted<T>, etc. to
// something that takes a |const T&| is not a GC hazard.
#define DECLARE_POINTER_CONSTREF_OPS(T) \
@@ -237,8 +241,6 @@ class Heap : public js::HeapBase<T, Heap
static_assert(js::IsHeapConstructibleType<T>::value,
"Type T must be a public GC pointer type");
public:
- using ElementType = T;
-
Heap() {
static_assert(sizeof(T) == sizeof(Heap<T>),
"Heap<T> must be binary compatible with T.");
@@ -385,8 +387,6 @@ template <typename T>
class TenuredHeap : public js::HeapBase<T, TenuredHeap<T>>
{
public:
- using ElementType = T;
-
TenuredHeap() : bits(0) {
static_assert(sizeof(T) == sizeof(TenuredHeap<T>),
"TenuredHeap<T> must be binary compatible with T.");
@@ -394,6 +394,9 @@ class TenuredHeap : public js::HeapBase<
explicit TenuredHeap(T p) : bits(0) { setPtr(p); }
explicit TenuredHeap(const TenuredHeap<T>& p) : bits(0) { setPtr(p.getPtr()); }
+ bool operator==(const TenuredHeap<T>& other) { return bits == other.bits; }
+ bool operator!=(const TenuredHeap<T>& other) { return bits != other.bits; }
+
void setPtr(T newPtr) {
MOZ_ASSERT((reinterpret_cast<uintptr_t>(newPtr) & flagsMask) == 0);
if (newPtr)
@@ -470,8 +473,6 @@ class MOZ_NONHEAP_CLASS Handle : public
friend class JS::MutableHandle<T>;
public:
- using ElementType = T;
-
/* Creates a handle from a handle of a type convertible to T. */
template <typename S>
MOZ_IMPLICIT Handle(Handle<S> handle,
@@ -533,6 +534,7 @@ class MOZ_NONHEAP_CLASS Handle : public
MOZ_IMPLICIT Handle(MutableHandle<S>& root,
typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy = 0);
+ DECLARE_POINTER_COMPARISON_OPS(T);
DECLARE_POINTER_CONSTREF_OPS(T);
DECLARE_NONPOINTER_ACCESSOR_METHODS(*ptr);
@@ -559,8 +561,6 @@ template <typename T>
class MOZ_STACK_CLASS MutableHandle : public js::MutableHandleBase<T, MutableHandle<T>>
{
public:
- using ElementType = T;
-
inline MOZ_IMPLICIT MutableHandle(Rooted<T>* root);
inline MOZ_IMPLICIT MutableHandle(PersistentRooted<T>* root);
@@ -589,6 +589,7 @@ class MOZ_STACK_CLASS MutableHandle : pu
return h;
}
+ DECLARE_POINTER_COMPARISON_OPS(T);
DECLARE_POINTER_CONSTREF_OPS(T);
DECLARE_NONPOINTER_ACCESSOR_METHODS(*ptr);
DECLARE_NONPOINTER_MUTABLE_ACCESSOR_METHODS(*ptr);
@@ -805,8 +806,6 @@ class MOZ_RAII Rooted : public js::Roote
}
public:
- using ElementType = T;
-
template <typename RootingContext>
explicit Rooted(const RootingContext& cx)
: ptr(GCPolicy<T>::initial())
@@ -839,6 +838,7 @@ class MOZ_RAII Rooted : public js::Roote
ptr = mozilla::Move(value);
}
+ DECLARE_POINTER_COMPARISON_OPS(T);
DECLARE_POINTER_CONSTREF_OPS(T);
DECLARE_POINTER_ASSIGN_OPS(Rooted, T);
DECLARE_NONPOINTER_ACCESSOR_METHODS(ptr);
@@ -903,14 +903,13 @@ template <typename T>
class MOZ_RAII FakeRooted : public RootedBase<T, FakeRooted<T>>
{
public:
- using ElementType = T;
-
template <typename CX>
explicit FakeRooted(CX* cx) : ptr(JS::GCPolicy<T>::initial()) {}
template <typename CX>
FakeRooted(CX* cx, T initial) : ptr(initial) {}
+ DECLARE_POINTER_COMPARISON_OPS(T);
DECLARE_POINTER_CONSTREF_OPS(T);
DECLARE_POINTER_ASSIGN_OPS(FakeRooted, T);
DECLARE_NONPOINTER_ACCESSOR_METHODS(ptr);
@@ -931,8 +930,6 @@ template <typename T>
class FakeMutableHandle : public js::MutableHandleBase<T, FakeMutableHandle<T>>
{
public:
- using ElementType = T;
-
MOZ_IMPLICIT FakeMutableHandle(T* t) {
ptr = t;
}
@@ -1124,8 +1121,6 @@ class PersistentRooted : public js::Root
}
public:
- using ElementType = T;
-
PersistentRooted() : ptr(GCPolicy<T>::initial()) {}
explicit PersistentRooted(RootingContext* cx)
@@ -1203,6 +1198,7 @@ class PersistentRooted : public js::Root
}
}
+ DECLARE_POINTER_COMPARISON_OPS(T);
DECLARE_POINTER_CONSTREF_OPS(T);
DECLARE_POINTER_ASSIGN_OPS(PersistentRooted, T);
DECLARE_NONPOINTER_ACCESSOR_METHODS(ptr);
@@ -1234,8 +1230,6 @@ class JS_PUBLIC_API(ObjectPtr)
Heap<JSObject*> value;
public:
- using ElementType = JSObject*;
-
ObjectPtr() : value(nullptr) {}
explicit ObjectPtr(JSObject* obj) : value(obj) {}
@@ -1342,177 +1336,6 @@ Swap(JS::TenuredHeap<T>& aX, JS::Tenured
} /* namespace mozilla */
-namespace js {
-namespace detail {
-
-// DefineComparisonOps is a trait which selects which wrapper classes to define
-// operator== and operator!= for. It supplies a getter function to extract the
-// value to compare. This is used to avoid triggering the automatic read
-// barriers where appropriate.
-//
-// If DefineComparisonOps is not specialized for a particular wrapper you may
-// get errors such as 'invalid operands to binary expression' or 'no match for
-// operator==' when trying to compare against instances of the wrapper.
-
-template <typename T>
-struct DefineComparisonOps : mozilla::FalseType {};
-
-template <typename T>
-struct DefineComparisonOps<JS::Heap<T>> : mozilla::TrueType {
- static const T& get(const JS::Heap<T>& v) { return v.unbarrieredGet(); }
-};
-
-template <typename T>
-struct DefineComparisonOps<JS::TenuredHeap<T>> : mozilla::TrueType {
- static const T get(const JS::TenuredHeap<T>& v) { return v.unbarrieredGetPtr(); }
-};
-
-template <>
-struct DefineComparisonOps<JS::ObjectPtr> : mozilla::TrueType {
- static const JSObject* get(const JS::ObjectPtr& v) { return v.unbarrieredGet(); }
-};
-
-template <typename T>
-struct DefineComparisonOps<JS::Rooted<T>> : mozilla::TrueType {
- static const T& get(const JS::Rooted<T>& v) { return v.get(); }
-};
-
-template <typename T>
-struct DefineComparisonOps<JS::Handle<T>> : mozilla::TrueType {
- static const T& get(const JS::Handle<T>& v) { return v.get(); }
-};
-
-template <typename T>
-struct DefineComparisonOps<JS::MutableHandle<T>> : mozilla::TrueType {
- static const T& get(const JS::MutableHandle<T>& v) { return v.get(); }
-};
-
-template <typename T>
-struct DefineComparisonOps<JS::PersistentRooted<T>> : mozilla::TrueType {
- static const T& get(const JS::PersistentRooted<T>& v) { return v.get(); }
-};
-
-template <typename T>
-struct DefineComparisonOps<js::FakeRooted<T>> : mozilla::TrueType {
- static const T& get(const js::FakeRooted<T>& v) { return v.get(); }
-};
-
-template <typename T>
-struct DefineComparisonOps<js::FakeMutableHandle<T>> : mozilla::TrueType {
- static const T& get(const js::FakeMutableHandle<T>& v) { return v.get(); }
-};
-
-} /* namespace detail */
-} /* namespace js */
-
-// Overload operator== and operator!= for all types with the DefineComparisonOps
-// trait using the supplied getter.
-//
-// There are four cases:
-
-// Case 1: comparison between two wrapper objects.
-
-template <typename T, typename U>
-typename mozilla::EnableIf<js::detail::DefineComparisonOps<T>::value &&
- js::detail::DefineComparisonOps<U>::value, bool>::Type
-operator==(const T& a, const U& b) {
- return js::detail::DefineComparisonOps<T>::get(a) == js::detail::DefineComparisonOps<U>::get(b);
-}
-
-template <typename T, typename U>
-typename mozilla::EnableIf<js::detail::DefineComparisonOps<T>::value &&
- js::detail::DefineComparisonOps<U>::value, bool>::Type
-operator!=(const T& a, const U& b) {
- return !(a == b);
-}
-
-// Case 2: comparison between a wrapper object and its unwrapped element type.
-
-template <typename T>
-typename mozilla::EnableIf<js::detail::DefineComparisonOps<T>::value, bool>::Type
-operator==(const T& a, const typename T::ElementType& b) {
- return js::detail::DefineComparisonOps<T>::get(a) == b;
-}
-
-template <typename T>
-typename mozilla::EnableIf<js::detail::DefineComparisonOps<T>::value, bool>::Type
-operator!=(const T& a, const typename T::ElementType& b) {
- return !(a == b);
-}
-
-template <typename T>
-typename mozilla::EnableIf<js::detail::DefineComparisonOps<T>::value, bool>::Type
-operator==(const typename T::ElementType& a, const T& b) {
- return a == js::detail::DefineComparisonOps<T>::get(b);
-}
-
-template <typename T>
-typename mozilla::EnableIf<js::detail::DefineComparisonOps<T>::value, bool>::Type
-operator!=(const typename T::ElementType& a, const T& b) {
- return !(a == b);
-}
-
-// Case 3: For pointer wrappers, comparison between the wrapper and a const
-// element pointer.
-
-template <typename T>
-typename mozilla::EnableIf<js::detail::DefineComparisonOps<T>::value &&
- mozilla::IsPointer<typename T::ElementType>::value, bool>::Type
-operator==(const typename mozilla::RemovePointer<typename T::ElementType>::Type* a, const T& b) {
- return a == js::detail::DefineComparisonOps<T>::get(b);
-}
-
-template <typename T>
-typename mozilla::EnableIf<js::detail::DefineComparisonOps<T>::value &&
- mozilla::IsPointer<typename T::ElementType>::value, bool>::Type
-operator!=(const typename mozilla::RemovePointer<typename T::ElementType>::Type* a, const T& b) {
- return !(a == b);
-}
-
-template <typename T>
-typename mozilla::EnableIf<js::detail::DefineComparisonOps<T>::value &&
- mozilla::IsPointer<typename T::ElementType>::value, bool>::Type
-operator==(const T& a, const typename mozilla::RemovePointer<typename T::ElementType>::Type* b) {
- return js::detail::DefineComparisonOps<T>::get(a) == b;
-}
-
-template <typename T>
-typename mozilla::EnableIf<js::detail::DefineComparisonOps<T>::value &&
- mozilla::IsPointer<typename T::ElementType>::value, bool>::Type
-operator!=(const T& a, const typename mozilla::RemovePointer<typename T::ElementType>::Type* b) {
- return !(a == b);
-}
-
-// Case 4: For pointer wrappers, comparison between the wrapper and nullptr.
-
-template <typename T>
-typename mozilla::EnableIf<js::detail::DefineComparisonOps<T>::value &&
- mozilla::IsPointer<typename T::ElementType>::value, bool>::Type
-operator==(std::nullptr_t a, const T& b) {
- return a == js::detail::DefineComparisonOps<T>::get(b);
-}
-
-template <typename T>
-typename mozilla::EnableIf<js::detail::DefineComparisonOps<T>::value &&
- mozilla::IsPointer<typename T::ElementType>::value, bool>::Type
-operator!=(std::nullptr_t a, const T& b) {
- return !(a == b);
-}
-
-template <typename T>
-typename mozilla::EnableIf<js::detail::DefineComparisonOps<T>::value &&
- mozilla::IsPointer<typename T::ElementType>::value, bool>::Type
-operator==(const T& a, std::nullptr_t b) {
- return js::detail::DefineComparisonOps<T>::get(a) == b;
-}
-
-template <typename T>
-typename mozilla::EnableIf<js::detail::DefineComparisonOps<T>::value &&
- mozilla::IsPointer<typename T::ElementType>::value, bool>::Type
-operator!=(const T& a, std::nullptr_t b) {
- return !(a == b);
-}
-
#undef DELETE_ASSIGNMENT_OPS
#endif /* js_RootingAPI_h */
diff -up firefox-56.0/js/src/gc/Barrier.h.1337988 firefox-56.0/js/src/gc/Barrier.h
--- firefox-56.0/js/src/gc/Barrier.h.1337988 2017-09-14 22:16:01.000000000 +0200
+++ firefox-56.0/js/src/gc/Barrier.h 2017-09-25 10:34:11.206611695 +0200
@@ -353,8 +353,8 @@ class WriteBarrieredBase : public Barrie
explicit WriteBarrieredBase(const T& v) : BarrieredBase<T>(v) {}
public:
- using ElementType = T;
+ DECLARE_POINTER_COMPARISON_OPS(T);
DECLARE_POINTER_CONSTREF_OPS(T);
// Use this if the automatic coercion to T isn't working.
@@ -612,13 +612,14 @@ class ReadBarriered : public ReadBarrier
return *this;
}
- const T& get() const {
- if (InternalBarrierMethods<T>::isMarkable(this->value))
- this->read();
+ const T get() const {
+ if (!InternalBarrierMethods<T>::isMarkable(this->value))
+ return JS::GCPolicy<T>::initial();
+ this->read();
return this->value;
}
- const T& unbarrieredGet() const {
+ const T unbarrieredGet() const {
return this->value;
}
@@ -626,9 +627,9 @@ class ReadBarriered : public ReadBarrier
return bool(this->value);
}
- operator const T&() const { return get(); }
+ operator const T() const { return get(); }
- const T& operator->() const { return get(); }
+ const T operator->() const { return get(); }
T* unsafeGet() { return &this->value; }
T const* unsafeGet() const { return &this->value; }
@@ -955,35 +956,6 @@ typedef ReadBarriered<WasmTableObject*>
typedef ReadBarriered<Value> ReadBarrieredValue;
-namespace detail {
-
-template <typename T>
-struct DefineComparisonOps<PreBarriered<T>> : mozilla::TrueType {
- static const T& get(const PreBarriered<T>& v) { return v.get(); }
-};
-
-template <typename T>
-struct DefineComparisonOps<GCPtr<T>> : mozilla::TrueType {
- static const T& get(const GCPtr<T>& v) { return v.get(); }
-};
-
-template <typename T>
-struct DefineComparisonOps<HeapPtr<T>> : mozilla::TrueType {
- static const T& get(const HeapPtr<T>& v) { return v.get(); }
-};
-
-template <typename T>
-struct DefineComparisonOps<ReadBarriered<T>> : mozilla::TrueType {
- static const T& get(const ReadBarriered<T>& v) { return v.unbarrieredGet(); }
-};
-
-template <>
-struct DefineComparisonOps<HeapSlot> : mozilla::TrueType {
- static const Value& get(const HeapSlot& v) { return v.get(); }
-};
-
-} /* namespace detail */
-
} /* namespace js */
#endif /* gc_Barrier_h */
diff -up firefox-56.0/js/src/jsapi-tests/testGCHeapPostBarriers.cpp.1337988 firefox-56.0/js/src/jsapi-tests/testGCHeapPostBarriers.cpp
--- firefox-56.0/js/src/jsapi-tests/testGCHeapPostBarriers.cpp.1337988 2017-09-14 22:16:02.000000000 +0200
+++ firefox-56.0/js/src/jsapi-tests/testGCHeapPostBarriers.cpp 2017-09-25 10:34:11.206611695 +0200
@@ -5,7 +5,6 @@
* 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/TypeTraits.h"
#include "mozilla/UniquePtr.h"
#include "js/RootingAPI.h"
diff -up firefox-56.0/js/src/vm/SharedMem.h.1337988 firefox-56.0/js/src/vm/SharedMem.h
--- firefox-56.0/js/src/vm/SharedMem.h.1337988 2017-06-15 22:52:29.000000000 +0200
+++ firefox-56.0/js/src/vm/SharedMem.h 2017-09-25 10:34:11.206611695 +0200
@@ -12,8 +12,8 @@
template<typename T>
class SharedMem
{
- // static_assert(mozilla::IsPointer<T>::value,
- // "SharedMem encapsulates pointer types");
+ static_assert(mozilla::IsPointer<T>::value,
+ "SharedMem encapsulates pointer types");
enum Sharedness {
IsUnshared,
diff -up firefox-56.0/js/xpconnect/src/XPCInlines.h.1337988 firefox-56.0/js/xpconnect/src/XPCInlines.h
--- firefox-56.0/js/xpconnect/src/XPCInlines.h.1337988 2017-09-14 22:16:03.000000000 +0200
+++ firefox-56.0/js/xpconnect/src/XPCInlines.h 2017-09-25 10:34:11.206611695 +0200
@@ -465,7 +465,7 @@ inline
void XPCWrappedNativeTearOff::JSObjectMoved(JSObject* obj, const JSObject* old)
{
MOZ_ASSERT(!IsMarked());
- MOZ_ASSERT(mJSObject == old);
+ MOZ_ASSERT(mJSObject.unbarrieredGetPtr() == old);
mJSObject = obj;
}
diff -up firefox-56.0/js/xpconnect/src/XPCWrappedNative.cpp.1337988 firefox-56.0/js/xpconnect/src/XPCWrappedNative.cpp
--- firefox-56.0/js/xpconnect/src/XPCWrappedNative.cpp.1337988 2017-09-14 22:16:03.000000000 +0200
+++ firefox-56.0/js/xpconnect/src/XPCWrappedNative.cpp 2017-09-25 10:34:11.207611692 +0200
@@ -874,7 +874,7 @@ void
XPCWrappedNative::FlatJSObjectMoved(JSObject* obj, const JSObject* old)
{
JS::AutoAssertGCCallback inCallback;
- MOZ_ASSERT(mFlatJSObject == old);
+ MOZ_ASSERT(mFlatJSObject.unbarrieredGetPtr() == old);
nsWrapperCache* cache = nullptr;
CallQueryInterface(mIdentity, &cache);
diff -up firefox-56.0/js/xpconnect/src/XPCWrappedNativeProto.cpp.1337988 firefox-56.0/js/xpconnect/src/XPCWrappedNativeProto.cpp
--- firefox-56.0/js/xpconnect/src/XPCWrappedNativeProto.cpp.1337988 2017-07-31 18:20:47.000000000 +0200
+++ firefox-56.0/js/xpconnect/src/XPCWrappedNativeProto.cpp 2017-09-25 10:34:11.207611692 +0200
@@ -101,7 +101,7 @@ XPCWrappedNativeProto::CallPostCreatePro
void
XPCWrappedNativeProto::JSProtoObjectFinalized(js::FreeOp* fop, JSObject* obj)
{
- MOZ_ASSERT(obj == mJSProtoObject, "huh?");
+ MOZ_ASSERT(obj == mJSProtoObject.unbarrieredGet(), "huh?");
#ifdef DEBUG
// Check that this object has already been swept from the map.
@@ -117,7 +117,7 @@ XPCWrappedNativeProto::JSProtoObjectFina
void
XPCWrappedNativeProto::JSProtoObjectMoved(JSObject* obj, const JSObject* old)
{
- MOZ_ASSERT(mJSProtoObject == old);
+ MOZ_ASSERT(mJSProtoObject.unbarrieredGet() == old);
mJSProtoObject.init(obj); // Update without triggering barriers.
}

View file

@ -1,6 +1,7 @@
--- a/js/xpconnect/src/XPCWrappedNative.cpp.1512162 2019-07-17 22:51:30.000000000 +0200
+++ b/js/xpconnect/src/XPCWrappedNative.cpp 2019-07-25 08:08:18.512528313 +0200
@@ -1055,7 +1055,7 @@
diff -up firefox-68.0.1/js/xpconnect/src/XPCWrappedNative.cpp.1512162 firefox-68.0.1/js/xpconnect/src/XPCWrappedNative.cpp
--- firefox-68.0.1/js/xpconnect/src/XPCWrappedNative.cpp.1512162 2019-07-17 22:51:30.000000000 +0200
+++ firefox-68.0.1/js/xpconnect/src/XPCWrappedNative.cpp 2019-07-25 08:08:18.512528313 +0200
@@ -1092,7 +1092,7 @@ class MOZ_STACK_CLASS CallMethodHelper f
MOZ_ALWAYS_INLINE bool GetOutParamSource(uint8_t paramIndex,
MutableHandleValue srcp) const;
@ -9,7 +10,7 @@
MOZ_ALWAYS_INLINE bool QueryInterfaceFastPath();
@@ -1102,7 +1102,7 @@
@@ -1139,7 +1139,7 @@ class MOZ_STACK_CLASS CallMethodHelper f
~CallMethodHelper();
@ -18,3 +19,25 @@
// Trace implementation so we can put our CallMethodHelper in a Rooted<T>.
void trace(JSTracer* aTrc);
@@ -1157,6 +1157,10 @@ bool XPCWrappedNative::CallMethod(XPCCal
return helper.get().Call();
}
+#if (__GNUC__ && __linux__ && __PPC64__ && _LITTLE_ENDIAN)
+// Work around a compiler bug on ppc64le (bug 1512162).
+__attribute__ ((noinline,noclone))
+#endif
bool CallMethodHelper::Call() {
mCallContext.SetRetVal(JS::UndefinedValue());
@@ -1315,6 +1319,10 @@ bool CallMethodHelper::GetOutParamSource
return true;
}
+#if (__GNUC__ && __linux__ && __PPC64__ && _LITTLE_ENDIAN)
+// Work around a compiler bug on ppc64le (bug 1512162).
+__attribute__ ((noinline,noclone))
+#endif
bool CallMethodHelper::GatherAndConvertResults() {
// now we iterate through the native params to gather and convert results
uint8_t paramCount = mMethodInfo->GetParamCount();

16
mozilla-1516803.patch Normal file
View file

@ -0,0 +1,16 @@
diff --git a/security/sandbox/linux/moz.build b/security/sandbox/linux/moz.build
--- a/security/sandbox/linux/moz.build
+++ b/security/sandbox/linux/moz.build
@@ -99,9 +99,8 @@
# 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.
-for f in CONFIG['OS_CXXFLAGS']:
- if f.startswith('-flto') and CONFIG['CC_TYPE'] != 'clang':
- LDFLAGS += ['--param lto-partitions=1']
+if CONFIG['CC_TYPE'] != 'clang':
+ LDFLAGS += ['--param', 'lto-partitions=1']
DEFINES['NS_NO_XPCOM'] = True
DisableStlWrapping()

22
mozilla-1526653.patch Normal file
View file

@ -0,0 +1,22 @@
diff --git a/js/src/wasm/WasmSignalHandlers.cpp b/js/src/wasm/WasmSignalHandlers.cpp
index 636537f847862ef693dd6582e2783de4e3d403c5..383c380f04ceb6a111dbfe9a046e3454a56e31b4 100644
--- a/js/src/wasm/WasmSignalHandlers.cpp
+++ b/js/src/wasm/WasmSignalHandlers.cpp
@@ -248,7 +248,16 @@ using mozilla::DebugOnly;
#endif
#ifdef WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS
-# include <sys/user.h>
+struct user_vfp {
+ unsigned long long fpregs[32];
+ unsigned long fpscr;
+};
+
+struct user_vfp_exc {
+ unsigned long fpexc;
+ unsigned long fpinst;
+ unsigned long fpinst2;
+};
#endif
#if defined(ANDROID)

View file

@ -0,0 +1,51 @@
diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -1155,6 +1155,28 @@
}
}
+bool IsPopupWithoutToplevelParent(nsMenuPopupFrame* aMenuPopupFrame) {
+ // Check if the popup is autocomplete (like tags autocomplete
+ // in the bookmark edit popup).
+ nsAtom* popupId = aMenuPopupFrame->GetContent()->GetID();
+ if (popupId && popupId->Equals(NS_LITERAL_STRING("PopupAutoComplete"))) {
+ return true;
+ }
+
+ // Check if the popup is in popupnotificationcontent (like choosing capture
+ // device when starting webrtc session).
+ nsIFrame* parentFrame = aMenuPopupFrame->GetParent();
+ if (!parentFrame) {
+ return false;
+ }
+ parentFrame = parentFrame->GetParent();
+ if (parentFrame && parentFrame->GetContent()->NodeName().EqualsLiteral(
+ "popupnotificationcontent")) {
+ return true;
+ }
+ return false;
+}
+
// Wayland keeps strong popup window hierarchy. We need to track active
// (visible) popup windows and make sure we hide popup on the same level
// before we open another one on that level. It means that every open
@@ -1211,10 +1233,14 @@
LOG(("...[%p] GetParentMenuWidget() = %p\n", (void*)this, parentWindow));
// If the popup is a regular menu but GetParentMenuWidget() returns
- // nullptr which means it's connected non-menu parent
- // (bookmark toolbar for instance).
+ // nullptr which means is not a submenu of any other menu.
// In this case use a parent given at nsWindow::Create().
- if (!parentWindow && !menuPopupFrame->IsContextMenu()) {
+ // But we have to avoid using mToplevelParentWindow in case the popup
+ // is in 'popupnotificationcontent' element or autocomplete popup,
+ // otherwise the popupnotification would disappear when for
+ // example opening a popup with microphone selection.
+ if (!parentWindow && !menuPopupFrame->IsContextMenu() &&
+ !IsPopupWithoutToplevelParent(menuPopupFrame)) {
parentWindow =
get_window_for_gtk_widget(GTK_WIDGET(mToplevelParentWindow));
}

96
mozilla-1634213.patch Normal file
View file

@ -0,0 +1,96 @@
diff --git a/gfx/gl/GLScreenBuffer.cpp b/gfx/gl/GLScreenBuffer.cpp
--- a/gfx/gl/GLScreenBuffer.cpp
+++ b/gfx/gl/GLScreenBuffer.cpp
@@ -88,10 +88,14 @@
#if defined(XP_MACOSX)
factory = SurfaceFactory_IOSurface::Create(gl, caps, ipcChannel, flags);
#elif defined(MOZ_WAYLAND)
- if (gl->GetContextType() == GLContextType::EGL) {
- if (gfxPlatformGtk::GetPlatform()->UseWaylandDMABufWebGL()) {
- factory =
- MakeUnique<SurfaceFactory_DMABUF>(gl, caps, ipcChannel, flags);
+ if (gl->GetContextType() == GLContextType::EGL &&
+ gfxPlatformGtk::GetPlatform()->UseWaylandDMABufWebGL()) {
+ auto DMABUFFactory =
+ MakeUnique<SurfaceFactory_DMABUF>(gl, caps, ipcChannel, flags);
+ if (DMABUFFactory && DMABUFFactory->CanCreateSurface()) {
+ factory = std::move(DMABUFFactory);
+ } else {
+ gfxPlatformGtk::GetPlatform()->DisableWaylandDMABufWebGL();
}
}
#elif defined(MOZ_X11)
diff --git a/gfx/gl/SharedSurfaceDMABUF.h b/gfx/gl/SharedSurfaceDMABUF.h
--- a/gfx/gl/SharedSurfaceDMABUF.h
+++ b/gfx/gl/SharedSurfaceDMABUF.h
@@ -71,6 +71,11 @@
bool hasAlpha = mReadCaps.alpha;
return SharedSurface_DMABUF::Create(mGL, mFormats, size, hasAlpha);
}
+
+ bool CanCreateSurface() {
+ UniquePtr<SharedSurface> test = CreateShared(gfx::IntSize(1, 1));
+ return test != nullptr;
+ }
};
} // namespace gl
diff --git a/gfx/thebes/gfxPlatformGtk.h b/gfx/thebes/gfxPlatformGtk.h
--- a/gfx/thebes/gfxPlatformGtk.h
+++ b/gfx/thebes/gfxPlatformGtk.h
@@ -88,7 +88,8 @@
#ifdef MOZ_WAYLAND
bool UseWaylandDMABufTextures();
- bool UseWaylandDMABufWebGL();
+ bool UseWaylandDMABufWebGL() { return mUseWebGLDmabufBackend; }
+ void DisableWaylandDMABufWebGL() { mUseWebGLDmabufBackend = false; }
bool UseWaylandHardwareVideoDecoding();
#endif
@@ -110,6 +111,9 @@
#ifdef MOZ_X11
Display* mCompositorDisplay;
#endif
+#ifdef MOZ_WAYLAND
+ bool mUseWebGLDmabufBackend;
+#endif
};
#endif /* GFX_PLATFORM_GTK_H */
diff --git a/gfx/thebes/gfxPlatformGtk.cpp b/gfx/thebes/gfxPlatformGtk.cpp
--- a/gfx/thebes/gfxPlatformGtk.cpp
+++ b/gfx/thebes/gfxPlatformGtk.cpp
@@ -116,6 +116,9 @@
Factory::ReleaseFTLibrary(gPlatformFTLibrary);
gPlatformFTLibrary = nullptr;
+
+ mUseWebGLDmabufBackend =
+ IsWaylandDisplay() && nsWaylandDisplay::IsDMABufWebGLEnabled();
}
void gfxPlatformGtk::FlushContentDrawing() {
@@ -725,9 +728,6 @@
bool gfxPlatformGtk::UseWaylandDMABufTextures() {
return IsWaylandDisplay() && nsWaylandDisplay::IsDMABufTexturesEnabled();
}
-bool gfxPlatformGtk::UseWaylandDMABufWebGL() {
- return IsWaylandDisplay() && nsWaylandDisplay::IsDMABufWebGLEnabled();
-}
bool gfxPlatformGtk::UseWaylandHardwareVideoDecoding() {
return IsWaylandDisplay() && nsWaylandDisplay::IsDMABufVAAPIEnabled() &&
gfxPlatform::CanUseHardwareVideoDecoding();
diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml
--- a/modules/libpref/init/StaticPrefList.yaml
+++ b/modules/libpref/init/StaticPrefList.yaml
@@ -9111,7 +9111,7 @@
# Use DMABuf backend for WebGL on Wayland.
- name: widget.wayland-dmabuf-webgl.enabled
type: RelaxedAtomicBool
- value: false
+ value: true
mirror: always
# Use VA-API for video playback on Wayland.

18
mozilla-1640567.patch Normal file
View file

@ -0,0 +1,18 @@
diff --git a/layout/xul/nsMenuPopupFrame.cpp b/layout/xul/nsMenuPopupFrame.cpp
--- a/layout/xul/nsMenuPopupFrame.cpp
+++ b/layout/xul/nsMenuPopupFrame.cpp
@@ -1422,11 +1422,9 @@
!GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
screenPoint = nsPoint(anchorRect.x, anchorRect.y);
mAnchorRect = anchorRect;
- } else
+ }
#endif
- {
- screenPoint = AdjustPositionForAnchorAlign(anchorRect, hFlip, vFlip);
- }
+ screenPoint = AdjustPositionForAnchorAlign(anchorRect, hFlip, vFlip);
} else {
// with no anchor, the popup is positioned relative to the root frame
anchorRect = rootScreenRect;

13
mozilla-1669442.patch Normal file
View file

@ -0,0 +1,13 @@
diff --git a/config/recurse.mk b/config/recurse.mk
--- a/config/recurse.mk
+++ b/config/recurse.mk
@@ -206,7 +206,7 @@
# Interdependencies that moz.build world don't know about yet for compilation.
# Note some others are hardcoded or "guessed" in recursivemake.py and emitter.py
ifeq ($(MOZ_WIDGET_TOOLKIT),gtk)
-toolkit/library/target: widget/gtk/mozgtk/gtk3/target
+toolkit/library/build/target: widget/gtk/mozgtk/gtk3/target
endif
ifndef MOZ_FOLD_LIBS

15
mozilla-1669639.patch Normal file
View file

@ -0,0 +1,15 @@
diff -up firefox-81.0.1/build/mach_bootstrap.py.old firefox-81.0.1/build/mach_bootstrap.py
--- firefox-81.0.1/build/mach_bootstrap.py.old 2020-10-06 14:16:06.212974910 +0200
+++ firefox-81.0.1/build/mach_bootstrap.py 2020-10-06 14:19:03.313179557 +0200
@@ -507,7 +507,10 @@ class ImportHook(object):
# doesn't happen or because it doesn't matter).
if not os.path.exists(module.__file__[:-1]):
if os.path.exists(module.__file__):
- os.remove(module.__file__)
+ try:
+ os.remove(module.__file__)
+ except:
+ pass
del sys.modules[module.__name__]
module = self(name, globals, locals, fromlist, level)

32
mozilla-1692706.patch Normal file
View file

@ -0,0 +1,32 @@
# HG changeset patch
# User Ian Neal <iann_cvs@blueyonder.co.uk>
# Date 1614236439 0
# Node ID cc45c336687916a6d1bfed79a80dc8a292b139a5
# Parent 8024f219bda91c98fcbba16f2bfc6b4833014bfc
Bug 1692706 - Update ccache stats parser for ccache 4.x. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D105863
diff --git a/python/mozbuild/mozbuild/controller/building.py b/python/mozbuild/mozbuild/controller/building.py
--- a/python/mozbuild/mozbuild/controller/building.py
+++ b/python/mozbuild/mozbuild/controller/building.py
@@ -842,7 +842,7 @@
DIRECTORY_DESCRIPTION = "cache directory"
PRIMARY_CONFIG_DESCRIPTION = "primary config"
- SECONDARY_CONFIG_DESCRIPTION = "secondary config (readonly)"
+ SECONDARY_CONFIG_DESCRIPTION = "secondary config"
ABSOLUTE_KEYS = {'cache_files', 'cache_size', 'cache_max_size'}
FORMAT_KEYS = {'cache_size', 'cache_max_size'}
@@ -874,7 +874,9 @@
line, self.PRIMARY_CONFIG_DESCRIPTION)
elif line.startswith(self.SECONDARY_CONFIG_DESCRIPTION):
self.secondary_config = self._strip_prefix(
- line, self.SECONDARY_CONFIG_DESCRIPTION)
+ self._strip_prefix(line, self.SECONDARY_CONFIG_DESCRIPTION),
+ "(readonly)",
+ )
else:
for stat_key, stat_description in self.STATS_KEYS:
if line.startswith(stat_description):

View file

@ -0,0 +1,54 @@
# HG changeset patch
# User Alexandre Lissy <lissyx+mozillians@lissyx.dyndns.org>
# Date 1623246328 0
# Node ID ecb4011a0c76a1c7040054a44712e277f3dc24a1
# Parent 9ec189804055442e5cc98d69dd01b71e90ed0cb5
Bug 1715254 - Deny clone3 to force glibc fallback r=gcp
Differential Revision: https://phabricator.services.mozilla.com/D117297
diff --git a/security/sandbox/linux/SandboxFilter.cpp b/security/sandbox/linux/SandboxFilter.cpp
--- a/security/sandbox/linux/SandboxFilter.cpp
+++ b/security/sandbox/linux/SandboxFilter.cpp
@@ -853,16 +853,19 @@ class SandboxPolicyCommon : public Sandb
// Yield
case __NR_sched_yield:
return Allow();
// Thread creation.
case __NR_clone:
return ClonePolicy(InvalidSyscall());
+ case __NR_clone3:
+ return Error(ENOSYS);
+
// More thread creation.
#ifdef __NR_set_robust_list
case __NR_set_robust_list:
return Allow();
#endif
#ifdef ANDROID
case __NR_set_tid_address:
return Allow();
@@ -1499,16 +1502,19 @@ class ContentSandboxPolicy : public Sand
// the child would inherit the seccomp-bpf policy and almost
// certainly die from an unexpected SIGSYS. We also can't have
// fork() crash, currently, because there are too many system
// libraries/plugins that try to run commands. But they can
// usually do something reasonable on error.
case __NR_clone:
return ClonePolicy(Error(EPERM));
+ case __NR_clone3:
+ return Error(ENOSYS);
+
# ifdef __NR_fadvise64
case __NR_fadvise64:
return Allow();
# endif
# ifdef __NR_fadvise64_64
case __NR_fadvise64_64:
return Allow();

14
mozilla-build-arm.patch Normal file
View file

@ -0,0 +1,14 @@
diff -up firefox-52.0/gfx/skia/skia/include/core/SkPreConfig.h.arm firefox-52.0/gfx/skia/skia/include/core/SkPreConfig.h
--- firefox-52.0/gfx/skia/skia/include/core/SkPreConfig.h.arm 2017-03-03 13:53:52.480754536 +0100
+++ firefox-52.0/gfx/skia/skia/include/core/SkPreConfig.h 2017-03-03 13:56:01.476018102 +0100
@@ -203,6 +203,10 @@
#define SK_ARM_HAS_CRC32
#endif
+#if defined(__aarch64__)
+ #undef SK_ARM_HAS_NEON
+#endif
+
//////////////////////////////////////////////////////////////////////
#if !defined(SKIA_IMPLEMENTATION)

12
rhbz-1173156.patch Normal file
View file

@ -0,0 +1,12 @@
diff -up a/extensions/auth/nsAuthSambaNTLM.cpp.old b/extensions/auth/nsAuthSambaNTLM.cpp
--- a/extensions/auth/nsAuthSambaNTLM.cpp.old 2014-11-25 12:23:22.000000000 +0100
+++ b/extensions/auth/nsAuthSambaNTLM.cpp 2014-12-23 15:26:36.606674625 +0100
@@ -161,7 +161,7 @@
const char* username = PR_GetEnv("USER");
if (!username) return NS_ERROR_FAILURE;
- const char* const args[] = {"ntlm_auth",
+ const char* const args[] = {"/usr/bin/ntlm_auth",
"--helper-protocol",
"ntlmssp-client-1",
"--use-cached-creds",

View file

@ -0,0 +1,23 @@
diff -up firefox-55.0/js/src/old-configure.in.rhbz-1219542-s390 firefox-55.0/js/src/old-configure.in
--- firefox-55.0/js/src/old-configure.in.rhbz-1219542-s390 2017-07-31 18:20:48.000000000 +0200
+++ firefox-55.0/js/src/old-configure.in 2017-08-02 14:31:32.190243669 +0200
@@ -541,7 +541,7 @@ case "$host" in
*-linux*|*-kfreebsd*-gnu|*-gnu*)
HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
- HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
+ HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O1}"
;;
*)
@@ -617,8 +617,8 @@ case "$target" in
*-*linux*)
if test "$GNU_CC" -o "$GNU_CXX"; then
- MOZ_PGO_OPTIMIZE_FLAGS="-O3"
- MOZ_OPTIMIZE_FLAGS="-O3"
+ MOZ_PGO_OPTIMIZE_FLAGS="-O1"
+ MOZ_OPTIMIZE_FLAGS="-O1"
if test -z "$CLANG_CC"; then
MOZ_OPTIMIZE_FLAGS="-freorder-blocks $MOZ_OPTIMIZE_FLAGS"
fi

View file

@ -1,60 +0,0 @@
#!/usr/bin/bash
# Run wayland compositor and set WAYLAND_DISPLAY env variable
set -x
echo export DESKTOP_SESSION=gnome > $HOME/.xsessionrc
echo export XDG_CURRENT_DESKTOP=GNOME > $HOME/.xsessionrc
echo export XDG_SESSION_TYPE=wayland >> $HOME/.xsessionrc
# Turn off the screen saver and screen locking
gsettings set org.gnome.desktop.screensaver idle-activation-enabled false
gsettings set org.gnome.desktop.screensaver lock-enabled false
gsettings set org.gnome.desktop.screensaver lock-delay 3600
# Disable the screen saver
# This starts the gnome-keyring-daemon with an unlocked login keyring. libsecret uses this to
# store secrets. Firefox uses libsecret to store a key that protects sensitive information like
# credit card numbers.
if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
# if not found, launch a new one
eval `dbus-launch --sh-syntax`
fi
if [ -z "$XDG_RUNTIME_DIR" ]; then
export XDG_RUNTIME_DIR=$HOME
fi
export WAYLAND_DISPLAY=icecat-pgo-wayland-0
if [ -S "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY" ]; then
rm -f $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY
rm -f $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY.lock
fi
echo "Launch mutter for $WAYLAND_DISPLAY"
mutter --headless --virtual-monitor 1920x1080 --wayland-display=$WAYLAND_DISPLAY --no-x11 & MUTTER_PID=$!
export MUTTER_PID
echo "Mutter PID $MUTTER_PID"
echo "Waiting for mutter to start..."
sleep 5
retry_count=0
max_retries=5
until [ $retry_count -gt $max_retries ]; do
if [ -S "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY" ]; then
retry_count=$(($max_retries + 1))
else
retry_count=$(($retry_count + 1))
echo "Waiting for Mutter, retry: $retry_count"
sleep 2
fi
done
if [ ! -S "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY" ]; then
echo "Mutter failed to start!"
exit 1
fi
echo "Mutter is running, $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY is here."

View file

@ -1,5 +1,5 @@
SHA512 (cbindgen-vendor.tar.xz) = 647dcadf3507bd05262613d03ff18a8c876bcbb4e83ce59f911128ae020ac16695298987c6c14f8b7a7aee5bb096740c6885c0a854d8b26431fc9a8ff864c369
SHA512 (icecat-140.7.0-langpacks.tar.gz) = a4618e3272b48be4307c79222bdd55f321aefb6d6ba08beb10178d0b95530bc4130cf86901d0906e714bd75106ad8513957fe3ad335431c8faf5b2d9767e17de
SHA512 (icecat-140.7.0-rh1.tar.bz2) = 7a19f7928322bea905828e6a4e981395687f1b649e37518a8000bcfcb29446b424ee592f708d0c7c93ebeb901820752785f883a937e9361e9f172a0a9bacb603
SHA512 (cbindgen-vendor.tar.xz) = 41a8c7717849f225f0ce81f2829fbb50c326b58126b330b2e3f0704afdf07a3fa7be40e47f412d9fee8516cad15720769c0e1672b0aa470a7973e04db6d53ac5
SHA512 (icecat-78.15.0-langpacks.tar.gz) = f46d8be1a5dca39d68c3c55f6764ddfec8c99f3a15b1112e873f7e7828a21739a3a1a927ee03465107ee80c8878d6fecaedaa9c6d4657e211293c40bd36ea2ea
SHA512 (icecat-78.15.0-rh1.tar.bz2) = 01f8f941df48a78b654d5ac81ad0ac1aae9ac6aecc769beafefc62590ebc30a2e98df72517df3c2cd8a657b4cfceed2b51f6eda979c5f3bc3208f89ce43953a7
SHA512 (icecat-COPYING-licensefiles.tar.gz) = ed541845170f1d209e322b0def3248d571e0c42c4a17c74e83197e743bd8a128a1475f5312d905c8e70d047eddeac17e604373892eb6d5f1720c5c361849c42c
SHA512 (icecat.png) = a3cec16cb15a27c3c91b53e2c534e78b07911011ff1331e450c0baf8e13b76da7cea2a90e5d75191fa88cfbfd40a0a7f3e553e92b64d0043dadd5ad5edfdf81c