Compare commits

..

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

98 changed files with 11472 additions and 6562 deletions

350
.gitignore vendored
View file

@ -397,353 +397,3 @@ firefox-3.6.4.source.tar.bz2
/firefox-langpacks-76.0-20200502.tar.xz
/firefox-76.0.1.source.tar.xz
/firefox-langpacks-76.0.1-20200508.tar.xz
/firefox-77.0.source.tar.xz
/firefox-langpacks-77.0-20200529.tar.xz
/firefox-langpacks-77.0-20200602.tar.xz
/firefox-77.0.1.source.tar.xz
/firefox-langpacks-77.0.1-20200603.tar.xz
/firefox-78.0.source.tar.xz
/firefox-langpacks-78.0-20200629.tar.xz
/firefox-78.0.1.source.tar.xz
/firefox-langpacks-78.0.1-20200701.tar.xz
/firefox-78.0.2.source.tar.xz
/firefox-langpacks-78.0.2-20200709.tar.xz
/firefox-79.0.source.tar.xz
/firefox-langpacks-79.0-20200727.tar.xz
/firefox-80.0.source.tar.xz
/firefox-langpacks-80.0-20200818.tar.xz
/firefox-langpacks-80.0-20200820.tar.xz
/firefox-80.0.1.source.tar.xz
/firefox-langpacks-80.0.1-20200901.tar.xz
/firefox-81.0.source.tar.xz
/firefox-langpacks-81.0-20200915.tar.xz
/firefox-langpacks-81.0-20200921.tar.xz
/firefox-81.0.1.source.tar.xz
/firefox-langpacks-81.0.1-20200930.tar.xz
/firefox-81.0.2.source.tar.xz
/firefox-langpacks-81.0.2-20201012.tar.xz
/firefox-82.0.source.tar.xz
/firefox-langpacks-82.0-20201015.tar.xz
/firefox-82.0.1.source.tar.xz
/firefox-langpacks-82.0.1-20201028.tar.xz
/firefox-82.0.2.source.tar.xz
/firefox-langpacks-82.0.2-20201029.tar.xz
/firefox-82.0.3.source.tar.xz
/firefox-langpacks-82.0.3-20201109.tar.xz
/firefox-83.0.source.tar.xz
/firefox-langpacks-83.0-20201112.tar.xz
/firefox-langpacks-83.0-20201116.tar.xz
/firefox-testing.tar.gz
/site-packages.tar.gz
/mochitest-python.tar.gz
/firefox-84.0.source.tar.xz
/firefox-langpacks-84.0-20201210.tar.xz
/firefox-langpacks-84.0-20201214.tar.xz
/firefox-84.0.1.source.tar.xz
/firefox-langpacks-84.0.1-20201222.tar.xz
/firefox-84.0.2.source.tar.xz
/firefox-langpacks-84.0.2-20210106.tar.xz
/firefox-85.0.source.tar.xz
/firefox-langpacks-85.0-20210120.tar.xz
/firefox-85.0.1.source.tar.xz
/firefox-langpacks-85.0.1-20210208.tar.xz
/firefox-86.0.source.tar.xz
/firefox-langpacks-86.0-20210222.tar.xz
/firefox-86.0.1.source.tar.xz
/firefox-langpacks-86.0.1-20210312.tar.xz
/firefox-87.0.source.tar.xz
/firefox-langpacks-87.0-20210322.tar.xz
/firefox-langpacks-88.0-20210419.tar.xz
/firefox-88.0.source.tar.xz
/firefox-88.0.1.source.tar.xz
/firefox-langpacks-88.0.1-20210510.tar.xz
/firefox-langpacks-89.0-20210601.tar.xz
/firefox-89.0.source.tar.xz
/firefox-89.0.2.source.tar.xz
/firefox-langpacks-89.0.2-20210624.tar.xz
/firefox-90.0.source.tar.xz
/firefox-langpacks-90.0-20210712.tar.xz
/firefox-90.0.1.source.tar.xz
/firefox-langpacks-90.0.1-20210721.tar.xz
/firefox-90.0.2.source.tar.xz
/firefox-langpacks-90.0.2-20210722.tar.xz
/firefox-91.0.source.tar.xz
/firefox-langpacks-91.0-20210810.tar.xz
/firefox-91.0.2.source.tar.xz
/firefox-langpacks-91.0.2-20210826.tar.xz
/firefox-langpacks-92.0-20210903.tar.xz
/firefox-92.0.source.tar.xz
/firefox-92.0.1.source.tar.xz
/firefox-langpacks-92.0.1-20210927.tar.xz
/firefox-93.0.source.tar.xz
/firefox-langpacks-93.0-20210929.tar.xz
/firefox-94.0.source.tar.xz
/firefox-langpacks-94.0-20211031.tar.xz
/firefox-94.0.2.source.tar.xz
/firefox-langpacks-94.0.2-20211125.tar.xz
/firefox-95.0.source.tar.xz
/firefox-langpacks-95.0-20211203.tar.xz
/firefox-95.0.2.source.tar.xz
/firefox-langpacks-95.0.2-20211220.tar.xz
/firefox-96.0.source.tar.xz
/firefox-langpacks-96.0-20220111.tar.xz
/firefox-langpacks-96.0.1-20220118.tar.xz
/firefox-96.0.1.source.tar.xz
/firefox-96.0.3.source.tar.xz
/firefox-langpacks-96.0.3-20220131.tar.xz
/firefox-97.0.source.tar.xz
/firefox-langpacks-97.0-20220208.tar.xz
/firefox-97.0.1.source.tar.xz
/firefox-langpacks-97.0.1-20220218.tar.xz
/firefox-98.0.source.tar.xz
/firefox-langpacks-98.0-20220301.tar.xz
/firefox-langpacks-98.0-20220304.tar.xz
/firefox-langpacks-98.0-20220305.tar.xz
/firefox-98.0.2.source.tar.xz
/firefox-langpacks-98.0.2-20220331.tar.xz
/firefox-99.0.source.tar.xz
/firefox-langpacks-99.0-20220331.tar.xz
/firefox-langpacks-99.0.1-20220413.tar.xz
/firefox-99.0.1.source.tar.xz
/firefox-100.0.source.tar.xz
/firefox-langpacks-100.0-20220502.tar.xz
/firefox-100.0.1.source.tar.xz
/firefox-langpacks-100.0.1-20220518.tar.xz
/firefox-100.0.2.source.tar.xz
/firefox-langpacks-100.0.2-20220520.tar.xz
/firefox-101.0.source.tar.xz
/firefox-langpacks-101.0-20220530.tar.xz
/firefox-101.0.1.source.tar.xz
/firefox-langpacks-101.0.1-20220609.tar.xz
/firefox-102.0.source.tar.xz
/firefox-langpacks-102.0-20220628.tar.xz
/firefox-103.0.source.tar.xz
/firefox-langpacks-103.0-20220721.tar.xz
/firefox-103.0.1.source.tar.xz
/firefox-langpacks-103.0.1-20220802.tar.xz
/firefox-103.0.2.source.tar.xz
/firefox-langpacks-103.0.2-20220812.tar.xz
/firefox-104.0.source.tar.xz
/firefox-langpacks-104.0-20220816.tar.xz
/firefox-langpacks-104.0-20220822.tar.xz
/firefox-langpacks-104.0.1-20220830.tar.xz
/firefox-104.0.1.source.tar.xz
/firefox-104.0.2.source.tar.xz
/firefox-langpacks-104.0.2-20220906.tar.xz
/firefox-langpacks-105.0-20220920.tar.xz
/firefox-105.0.source.tar.xz
/firefox-105.0.1.source.tar.xz
/firefox-langpacks-105.0.1-20220922.tar.xz
/firefox-105.0.2.source.tar.xz
/firefox-langpacks-105.0.2-20221005.tar.xz
/firefox-langpacks-106.0-20221014.tar.xz
/firefox-106.0.source.tar.xz
/firefox-106.0.1.source.tar.xz
/firefox-langpacks-106.0.1-20221023.tar.xz
/firefox-106.0.3.source.tar.xz
/firefox-langpacks-106.0.3-20221031.tar.xz
/firefox-langpacks-107.0-20221114.tar.xz
/firefox-107.0.source.tar.xz
/firefox-107.0.1.source.tar.xz
/firefox-langpacks-107.0.1-20221206.tar.xz
/firefox-108.0.source.tar.xz
/firefox-langpacks-108.0-20221206.tar.xz
/firefox-langpacks-108.0-20221214.tar.xz
/firefox-108.0.1.source.tar.xz
/firefox-langpacks-108.0.1-20221218.tar.xz
/firefox-108.0.2.source.tar.xz
/firefox-langpacks-108.0.2-20230112.tar.xz
/firefox-109.0.source.tar.xz
/firefox-langpacks-109.0-20230111.tar.xz
/firefox-109.0.1.source.tar.xz
/firefox-langpacks-109.0.1-20230201.tar.xz
/firefox-110.0.source.tar.xz
/firefox-langpacks-110.0-20230210.tar.xz
/firefox-langpacks-110.0-20230214.tar.xz
/firefox-111.0.source.tar.xz
/firefox-langpacks-111.0-20230320.tar.xz
/firefox-langpacks-111.0.1-20230322.tar.xz
/firefox-111.0.1.source.tar.xz
/firefox-112.0.source.tar.xz
/firefox-langpacks-112.0-20230405.tar.xz
/firefox-langpacks-112.0-20230406.tar.xz
/firefox-langpacks-112.0.1-20230417.tar.xz
/firefox-112.0.1.source.tar.xz
/firefox-langpacks-112.0.2-20230427.tar.xz
/firefox-112.0.2.source.tar.xz
/firefox-langpacks-113.0-20230509.tar.xz
/firefox-113.0.source.tar.xz
/firefox-langpacks-113.0.1-20230515.tar.xz
/firefox-113.0.1.source.tar.xz
/firefox-114.0.source.tar.xz
/firefox-langpacks-114.0-20230605.tar.xz
/firefox-langpacks-114.0.2-20230620.tar.xz
/firefox-114.0.2.source.tar.xz
/firefox-langpacks-115.0-20230629.tar.xz
/firefox-115.0.source.tar.xz
/firefox-langpacks-115.0-20230703.tar.xz
/firefox-115.0.2.source.tar.xz
/firefox-langpacks-115.0.2-20230717.tar.xz
/firefox-116.0.source.tar.xz
/firefox-langpacks-116.0-20230725.tar.xz
/firefox-langpacks-116.0-20230731.tar.xz
/firefox-116.0.1.source.tar.xz
/firefox-langpacks-116.0.1-20230804.tar.xz
/firefox-langpacks-116.0.2-20230807.tar.xz
/firefox-116.0.2.source.tar.xz
/firefox-langpacks-116.0.3-20230817.tar.xz
/firefox-116.0.3.source.tar.xz
/firefox-117.0.source.tar.xz
/firefox-langpacks-117.0-20230828.tar.xz
/firefox-117.0.1.source.tar.xz
/firefox-langpacks-117.0.1-20230913.tar.xz
/firefox-118.0.source.tar.xz
/firefox-langpacks-118.0-20230925.tar.xz
/firefox-langpacks-118.0.1-20230929.tar.xz
/firefox-118.0.1.source.tar.xz
/firefox-118.0.2.source.tar.xz
/firefox-langpacks-118.0.2-20231010.tar.xz
/dump_syms-vendor.tar.xz
/firefox-langpacks-119.0.1-20231110.tar.xz
/firefox-119.0.1.source.tar.xz
/firefox-120.0.source.tar.xz
/firefox-langpacks-120.0-20231114.tar.xz
/firefox-langpacks-120.0-20231120.tar.xz
/firefox-120.0.1.source.tar.xz
/firefox-langpacks-120.0.1-20231201.tar.xz
/firefox-121.0.source.tar.xz
/firefox-langpacks-121.0-20231218.tar.xz
/firefox-121.0.1.source.tar.xz
/firefox-langpacks-121.0.1-20240112.tar.xz
/firefox-122.0.source.tar.xz
/firefox-langpacks-122.0-20240119.tar.xz
/firefox-langpacks-122.0.1-20240213.tar.xz
/firefox-122.0.1.source.tar.xz
/firefox-langpacks-123.0-20240219.tar.xz
/firefox-123.0.source.tar.xz
/firefox-123.0.1.source.tar.xz
/firefox-langpacks-123.0.1-20240307.tar.xz
/firefox-124.0.source.tar.xz
/firefox-langpacks-124.0-20240313.tar.xz
/firefox-124.0.1.source.tar.xz
/firefox-langpacks-124.0.1-20240322.tar.xz
/wasi-sdk-20.tar.gz
/wasi-sdk-20-1.fc39.src.rpm
/firefox-124.0.2.source.tar.xz
/firefox-langpacks-124.0.2-20240404.tar.xz
/firefox-langpacks-125.0-20240409.tar.xz
/firefox-125.0.source.tar.xz
/firefox-125.0.2.source.tar.xz
/firefox-langpacks-125.0.2-20240420.tar.xz
/firefox-125.0.3.source.tar.xz
/firefox-langpacks-125.0.3-20240429.tar.xz
/firefox-126.0.source.tar.xz
/firefox-langpacks-126.0-20240507.tar.xz
/firefox-127.0.source.tar.xz
/firefox-langpacks-127.0-20240610.tar.xz
/firefox-langpacks-127.0.2-20240625.tar.xz
/firefox-127.0.2.source.tar.xz
/firefox-128.0.source.tar.xz
/firefox-langpacks-128.0-20240702.tar.xz
/firefox-langpacks-128.0-20240708.tar.xz
/firefox-128.0.3.source.tar.xz
/firefox-langpacks-128.0.3-20240729.tar.xz
/firefox-129.0.source.tar.xz
/firefox-langpacks-129.0-20240730.tar.xz
/firefox-langpacks-129.0-20240802.tar.xz
/firefox-129.0.2.source.tar.xz
/firefox-langpacks-192.0.2-20240820.tar.xz
/firefox-langpacks-129.0.2-20240820.tar.xz
/firefox-langpacks-130.0-20240828.tar.xz
/firefox-130.0.source.tar.xz
/firefox-130.0.1.source.tar.xz
/firefox-langpacks-130.0.1-20240918.tar.xz
/firefox-langpacks-131.0-20240924.tar.xz
/firefox-131.0.source.tar.xz
/firefox-131.0.2.source.tar.xz
/firefox-langpacks-131.0.2-20241009.tar.xz
/firefox-131.0.3.source.tar.xz
/firefox-langpacks-131.0.3-20241015.tar.xz
/firefox-132.0.source.tar.xz
/firefox-langpacks-132.0-20241023.tar.xz
/firefox-132.0.1.source.tar.xz
/firefox-langpacks-132.0.1-20241105.tar.xz
/firefox-langpacks-132.0.2-20241115.tar.xz
/firefox-132.0.2.source.tar.xz
/firefox-133.0.source.tar.xz
/firefox-langpacks-133.0-20241122.tar.xz
/firefox-langpacks-133.0.3-20241211.tar.xz
/firefox-133.0.3.source.tar.xz
/firefox-langpacks-134.0-20250102.tar.xz
/firefox-134.0.source.tar.xz
/firefox-langpacks-134.0.1-20250115.tar.xz
/firefox-134.0.1.source.tar.xz
/firefox-134.0.2.source.tar.xz
/firefox-langpacks-134.0.2-20250122.tar.xz
/wasi-sdk-25.tar.gz
/wasm-component-ld-vendor.tar.xz
/firefox-135.0.source.tar.xz
/firefox-langpacks-135.0-20250204.tar.xz
/firefox-136.0.source.tar.xz
/firefox-langpacks-136.0-20250225.tar.xz
/firefox-langpacks-136.0-20250228.tar.xz
/firefox-136.0.1.source.tar.xz
/firefox-langpacks-136.0.1-20250312.tar.xz
/firefox-langpacks-136.0.2-20250319.tar.xz
/firefox-136.0.2.source.tar.xz
/firefox-136.0.3.source.tar.xz
/firefox-langpacks-136.0.3-20250325.tar.xz
/firefox-langpacks-137.0-20250326.tar.xz
/firefox-137.0.source.tar.xz
/firefox-langpacks-137.0-20250331.tar.xz
/firefox-137.0.1.source.tar.xz
/firefox-langpacks-137.0.1-20250414.tar.xz
/firefox-138.0.source.tar.xz
/firefox-langpacks-138.0-20250422.tar.xz
/firefox-langpacks-138.0.1-20250501.tar.xz
/firefox-138.0.1.source.tar.xz
/firefox-138.0.3.source.tar.xz
/firefox-langpacks-138.0.3-20250512.tar.xz
/firefox-langpacks-138.0.4-20250519.tar.xz
/firefox-138.0.4.source.tar.xz
/firefox-139.0.source.tar.xz
/firefox-langpacks-139.0-20250527.tar.xz
/firefox-langpacks-139.0.4-20250610.tar.xz
/firefox-139.0.4.source.tar.xz
/firefox-140.0.source.tar.xz
/firefox-langpacks-140.0-20250617.tar.xz
/firefox-140.0.1.source.tar.xz
/firefox-langpacks-140.0.1-20250627.tar.xz
/firefox-140.0.4.source.tar.xz
/firefox-langpacks-140.0.4-20250708.tar.xz
/firefox-141.0.source.tar.xz
/firefox-langpacks-141.0-20250717.tar.xz
/firefox-langpacks-141.0-20250718.tar.xz
/firefox-langpacks-141.2.0-20250806.tar.xz
/firefox-141.0.2.source.tar.xz
/firefox-langpacks-141.0.2-20250806.tar.xz
/firefox-langpacks-141.0.3-20250811.tar.xz
/firefox-141.0.3.source.tar.xz
/firefox-142.0.source.tar.xz
/firefox-langpacks-142.0-20250812.tar.xz
/firefox-langpacks-142.0.1-20250827.tar.xz
/firefox-142.0.1.source.tar.xz
/firefox-143.0.1.source.tar.xz
/firefox-langpacks-143.0.1-20250919.tar.xz
/firefox-langpacks-143.0.3-20250930.tar.xz
/firefox-143.0.3.source.tar.xz
/firefox-langpacks-144.0-20251009.tar.xz
/firefox-144.0.source.tar.xz
/firefox-langpacks-144.0-20251010.tar.xz
/firefox-145.0.source.tar.xz
/firefox-langpacks-145.0-20251105.tar.xz
/firefox-langpacks-145.0-20251111.tar.xz
/firefox-145.0.1.source.tar.xz
/firefox-langpacks-145.0.1-20251119.tar.xz
/firefox-146.0.source.tar.xz
/firefox-langpacks-146.0-20251202.tar.xz
/firefox-langpacks-146.0-20251208.tar.xz
/firefox-146.0.1.source.tar.xz
/firefox-langpacks-146.0.1-20251219.tar.xz
/firefox-langpacks-147.0-20260106.tar.xz
/firefox-147.0.source.tar.xz

View file

@ -1,31 +0,0 @@
diff -up firefox-142.0/build/unix/stdc++compat/stdc++compat.cpp.0001-GLIBCXX-fix-for-GCC-12 firefox-142.0/build/unix/stdc++compat/stdc++compat.cpp
--- firefox-142.0/build/unix/stdc++compat/stdc++compat.cpp.0001-GLIBCXX-fix-for-GCC-12 2025-08-11 20:04:27.000000000 +0200
+++ firefox-142.0/build/unix/stdc++compat/stdc++compat.cpp 2025-08-14 15:02:05.496137133 +0200
@@ -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
@@ -94,6 +95,19 @@ void operator delete(void* ptr, size_t s
}
# 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

File diff suppressed because it is too large Load diff

View file

@ -1,279 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martin Sirringhaus <msirringhaus@suse.de>
Date: Tue, 8 Aug 2023 16:18:24 +0300
Subject: [PATCH] Add KDE integration to Firefox
Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=140751
Bug: https://bugzilla.suse.com/show_bug.cgi?id=170055
How to apply this patch:
1. Import and apply it
2. cp browser/base/content/browser.xul browser/base/content/browser-kde.xul
3. Find editBookmarkPanelDoneButton
4. Replace #ifndef with #ifdef in the line above (this hanges the button order from Gnome-style to KDE-style)
5. hg qrefresh
---
browser/components/preferences/main.js | 18 +++
browser/components/shell/moz.build | 2 +
.../components/shell/nsKDEShellService.cpp | 109 ++++++++++++++++++
browser/components/shell/nsKDEShellService.h | 32 +++++
.../components/shell/nsUnixShellService.cpp | 22 ++++
browser/components/shell/nsUnixShellService.h | 15 +++
6 files changed, 198 insertions(+)
create mode 100644 browser/components/shell/nsKDEShellService.cpp
create mode 100644 browser/components/shell/nsKDEShellService.h
create mode 100644 browser/components/shell/nsUnixShellService.cpp
create mode 100644 browser/components/shell/nsUnixShellService.h
diff --git a/browser/components/preferences/main.js b/browser/components/preferences/main.js
index 820e46fb006567bfdf93e2a46da5e3c07d42bf10..57d1c21bdecc2d55d0bed30246e684d3b97ad7fa 100644
--- a/browser/components/preferences/main.js
+++ b/browser/components/preferences/main.js
@@ -294,6 +294,13 @@ var gMainPane = {
}, backoffTimes[this._backoffIndex]);
}
+ var env = Components.classes["@mozilla.org/process/environment;1"]
+ .getService(Components.interfaces.nsIEnvironment);
+ var kde_session = 0;
+ if (env.get('KDE_FULL_SESSION') == "true") {
+ kde_session = 1;
+ }
+
this.initBrowserContainers();
this.buildContentProcessCountMenuList();
@@ -1727,6 +1734,17 @@ var gMainPane = {
}
try {
shellSvc.setDefaultBrowser(true, false);
+ if (kde_session == 1) {
+ var shellObj = Components.classes["@mozilla.org/file/local;1"]
+ .createInstance(Components.interfaces.nsILocalFile);
+ shellObj.initWithPath("/usr/bin/kwriteconfig");
+ var process = Components.classes["@mozilla.org/process/util;1"]
+ .createInstance(Components.interfaces.nsIProcess);
+ process.init(shellObj);
+ var args = ["--file", "kdeglobals", "--group", "General", "--key",
+ "BrowserApplication", "firefox"];
+ process.run(false, args, args.length);
+ }
} catch (ex) {
console.error(ex);
return;
diff --git a/browser/components/shell/moz.build b/browser/components/shell/moz.build
index eb88cb287dc3f04022b74b978666118bbd5fa6b2..95277533781a7224d108e3c45731a6d9a89ba1a0 100644
--- a/browser/components/shell/moz.build
+++ b/browser/components/shell/moz.build
@@ -36,6 +36,8 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
SOURCES += [
"nsGNOMEShellService.cpp",
+ "nsKDEShellService.cpp",
+ "nsUnixShellService.cpp",
]
if CONFIG["MOZ_ENABLE_DBUS"]:
SOURCES += [
diff --git a/browser/components/shell/nsKDEShellService.cpp b/browser/components/shell/nsKDEShellService.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..152a3aca87ea73477bc75c4e93c01e5a52dda102
--- /dev/null
+++ b/browser/components/shell/nsKDEShellService.cpp
@@ -0,0 +1,109 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * 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/ArrayUtils.h"
+
+#include "nsCOMPtr.h"
+#include "nsKDEShellService.h"
+#include "nsShellService.h"
+#include "nsKDEUtils.h"
+#include "nsIPrefService.h"
+#include "nsIProcess.h"
+#include "nsIFile.h"
+#include "nsServiceManagerUtils.h"
+#include "nsComponentManagerUtils.h"
+#include "nsIMutableArray.h"
+#include "nsISupportsPrimitives.h"
+#include "nsArrayUtils.h"
+
+using namespace mozilla;
+
+nsresult
+nsKDEShellService::Init()
+{
+ if( !nsKDEUtils::kdeSupport())
+ return NS_ERROR_NOT_AVAILABLE;
+ return NS_OK;
+}
+
+NS_IMPL_ISUPPORTS(nsKDEShellService, nsIGNOMEShellService, nsIShellService)
+
+NS_IMETHODIMP
+nsKDEShellService::IsDefaultBrowser(bool aForAllTypes,
+ bool* aIsDefaultBrowser)
+{
+ *aIsDefaultBrowser = false;
+
+ nsCOMPtr<nsIMutableArray> command = do_CreateInstance( NS_ARRAY_CONTRACTID );
+ if (!command)
+ return NS_ERROR_FAILURE;
+
+ nsCOMPtr<nsISupportsCString> str = do_CreateInstance( NS_SUPPORTS_CSTRING_CONTRACTID );
+ if (!str)
+ return NS_ERROR_FAILURE;
+
+ str->SetData("ISDEFAULTBROWSER"_ns);
+ command->AppendElement( str );
+
+ if( nsKDEUtils::command( command ))
+ *aIsDefaultBrowser = true;
+ return NS_OK;
+}
+
+NS_IMETHODIMP
+nsKDEShellService::SetDefaultBrowser(bool aClaimAllTypes,
+ bool aForAllUsers)
+{
+ nsCOMPtr<nsIMutableArray> command = do_CreateInstance( NS_ARRAY_CONTRACTID );
+ if (!command)
+ return NS_ERROR_FAILURE;
+
+ nsCOMPtr<nsISupportsCString> cmdstr = do_CreateInstance( NS_SUPPORTS_CSTRING_CONTRACTID );
+ nsCOMPtr<nsISupportsCString> paramstr = do_CreateInstance( NS_SUPPORTS_CSTRING_CONTRACTID );
+ if (!cmdstr || !paramstr)
+ return NS_ERROR_FAILURE;
+
+ cmdstr->SetData("SETDEFAULTBROWSER"_ns);
+ command->AppendElement( cmdstr );
+
+ paramstr->SetData( aClaimAllTypes ? "ALLTYPES"_ns : "NORMAL"_ns );
+ command->AppendElement( paramstr );
+
+ return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE;
+}
+
+NS_IMETHODIMP
+nsKDEShellService::GetCanSetDesktopBackground(bool* aResult)
+{
+ *aResult = true;
+ return NS_OK;
+}
+
+NS_IMETHODIMP
+nsKDEShellService::SetDesktopBackground(dom::Element* aElement,
+ int32_t aPosition,
+ const nsACString& aImageName)
+{
+ return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+NS_IMETHODIMP
+nsKDEShellService::GetDesktopBackgroundColor(PRUint32 *aColor)
+{
+ return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+NS_IMETHODIMP
+nsKDEShellService::SetDesktopBackgroundColor(PRUint32 aColor)
+{
+ return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+NS_IMETHODIMP
+nsKDEShellService::IsDefaultForScheme(nsTSubstring<char> const& aScheme, bool* aIsDefaultBrowser)
+{
+ return NS_ERROR_NOT_IMPLEMENTED;
+}
+
diff --git a/browser/components/shell/nsKDEShellService.h b/browser/components/shell/nsKDEShellService.h
new file mode 100644
index 0000000000000000000000000000000000000000..8b0bb19164352453cfa453dd87c19263160b9ad8
--- /dev/null
+++ b/browser/components/shell/nsKDEShellService.h
@@ -0,0 +1,32 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#ifndef nskdeshellservice_h____
+#define nskdeshellservice_h____
+
+#include "nsIGNOMEShellService.h"
+#include "nsToolkitShellService.h"
+#include "nsString.h"
+#include "mozilla/Attributes.h"
+
+class nsKDEShellService final : public nsIGNOMEShellService,
+ public nsToolkitShellService
+{
+public:
+ nsKDEShellService() : mCheckedThisSession(false) { }
+
+ NS_DECL_ISUPPORTS
+ NS_DECL_NSISHELLSERVICE
+ NS_DECL_NSIGNOMESHELLSERVICE
+
+ nsresult Init();
+
+private:
+ ~nsKDEShellService() {}
+
+ bool mCheckedThisSession;
+};
+
+#endif // nskdeshellservice_h____
diff --git a/browser/components/shell/nsUnixShellService.cpp b/browser/components/shell/nsUnixShellService.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..abf266ebdc52e136f495911da3454e69c770c6db
--- /dev/null
+++ b/browser/components/shell/nsUnixShellService.cpp
@@ -0,0 +1,22 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * 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 "nsUnixShellService.h"
+#include "nsGNOMEShellService.h"
+#include "nsKDEShellService.h"
+#include "nsKDEUtils.h"
+#include "mozilla/ModuleUtils.h"
+
+NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGNOMEShellService, Init)
+NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsKDEShellService, Init)
+
+NS_IMETHODIMP
+nsUnixShellServiceConstructor(REFNSIID aIID, void **aResult)
+{
+ if( nsKDEUtils::kdeSupport())
+ return nsKDEShellServiceConstructor( aIID, aResult );
+ return nsGNOMEShellServiceConstructor( aIID, aResult );
+}
diff --git a/browser/components/shell/nsUnixShellService.h b/browser/components/shell/nsUnixShellService.h
new file mode 100644
index 0000000000000000000000000000000000000000..26b5dbac47dd9a8ec1fcb6c93575cca750692735
--- /dev/null
+++ b/browser/components/shell/nsUnixShellService.h
@@ -0,0 +1,15 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+#ifndef nsunixshellservice_h____
+#define nsunixshellservice_h____
+
+#include "nsIGNOMEShellService.h"
+
+NS_IMETHODIMP
+nsUnixShellServiceConstructor(nsISupports *aOuter, REFNSIID aIID, void **aResult);
+
+#endif // nsunixshellservice_h____

View file

@ -0,0 +1,15 @@
diff -up firefox-68.0/mfbt/LinuxSignal.h.1238661 firefox-68.0/mfbt/LinuxSignal.h
--- firefox-68.0/mfbt/LinuxSignal.h.1238661 2019-07-08 22:27:29.620749569 +0200
+++ firefox-68.0/mfbt/LinuxSignal.h 2019-07-08 22:44:17.794112428 +0200
@@ -22,7 +22,10 @@ __attribute__((naked)) void SignalTrampo
void* aContext) {
asm volatile("nop; nop; nop; nop" : : : "memory");
- asm volatile("b %0" : : "X"(H) : "memory");
+ // Because the assembler may generate additional insturctions below, we
+ // need to ensure NOPs are inserted first by separating them out above.
+
+ asm volatile("bx %0" : : "r"(H), "l"(aSignal), "l"(aInfo), "l"(aContext) : "memory");
}
# define MOZ_SIGNAL_TRAMPOLINE(h) (mozilla::SignalTrampoline<h>)

View file

@ -0,0 +1,36 @@
From: Andrew Osmond <aosmond@mozilla.com>
Date: Wed, 22 Jan 2020 15:19:20 +0000
Subject: Bug 1610814 - Fix NEON compile error with gcc and RGB unpacking.
r=lsalzman
This patch makes us use the correct intrinsic for loading a uint8x16
register. It is not entirely clear why clang accepts this without
complaint but beyond the types, it should be equivalent.
Differential Revision: https://phabricator.services.mozilla.com/D60667
---
gfx/2d/SwizzleNEON.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gfx/2d/SwizzleNEON.cpp b/gfx/2d/SwizzleNEON.cpp
index 6b34f76cab1..63f211ff294 100644
--- a/gfx/2d/SwizzleNEON.cpp
+++ b/gfx/2d/SwizzleNEON.cpp
@@ -412,7 +412,7 @@ void UnpackRowRGB24_NEON(const uint8_t* aSrc, uint8_t* aDst, int32_t aLength) {
src -= 4 * 3;
dst -= 4 * 4;
while (src >= aSrc) {
- uint8x16_t px = vld1q_u16(reinterpret_cast<const uint16_t*>(src));
+ uint8x16_t px = vld1q_u8(src);
// G2R2B1G1 R1B0G0R0 -> X1R1G1B1 X0R0G0B0
uint8x8_t pxlo = vtbl1_u8(vget_low_u8(px), masklo);
// B3G3R3B2 G2R2B1G1 -> X3R3G3B3 X2R2G2B2
@@ -420,7 +420,7 @@ void UnpackRowRGB24_NEON(const uint8_t* aSrc, uint8_t* aDst, int32_t aLength) {
vtbl1_u8(vext_u8(vget_low_u8(px), vget_high_u8(px), 4), maskhi);
px = vcombine_u8(pxlo, pxhi);
px = vorrq_u8(px, alpha);
- vst1q_u16(reinterpret_cast<uint16_t*>(dst), px);
+ vst1q_u8(dst, px);
src -= 4 * 3;
dst -= 4 * 4;
}

View file

@ -0,0 +1,74 @@
# HG changeset patch
# User Lars T Hansen <lhansen@mozilla.com>
# Date 1519822672 -3600
# Wed Feb 28 13:57:52 2018 +0100
# Node ID 672f0415217b202ae59a930769dffd9d6ba6b87c
# Parent 825fd04dacc6297d3a980ec4184079405950b35d
Bug 1375074 - Save and restore non-volatile x28 on ARM64 for generated unboxed object constructor.
diff --git a/js/src/jit-test/tests/bug1375074.js b/js/src/jit-test/tests/bug1375074.js
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/bug1375074.js
@@ -0,0 +1,18 @@
+// This forces the VM to start creating unboxed objects and thus stresses a
+// particular path into generated code for a specialized unboxed object
+// constructor.
+
+var K = 2000; // 2000 should be plenty
+var s = "[";
+var i;
+for ( i=0; i < K-1; i++ )
+ s = s + `{"i":${i}},`;
+s += `{"i":${i}}]`;
+var v = JSON.parse(s);
+
+assertEq(v.length == K, true);
+
+for ( i=0; i < K; i++) {
+ assertEq(v[i] instanceof Object, true);
+ assertEq(v[i].i, i);
+}
diff --git a/js/src/vm/UnboxedObject.cpp b/js/src/vm/UnboxedObject.cpp
--- a/js/src/vm/UnboxedObject.cpp
+++ b/js/src/vm/UnboxedObject.cpp
@@ -95,7 +95,15 @@ UnboxedLayout::makeConstructorCode(JSCon
#endif
#ifdef JS_CODEGEN_ARM64
- // ARM64 communicates stack address via sp, but uses a pseudo-sp for addressing.
+ // ARM64 communicates stack address via sp, but uses a pseudo-sp (PSP) for
+ // addressing. The register we use for PSP may however also be used by
+ // calling code, and it is nonvolatile, so save it. Do this as a special
+ // case first because the generic save/restore code needs the PSP to be
+ // initialized already.
+ MOZ_ASSERT(PseudoStackPointer64.Is(masm.GetStackPointer64()));
+ masm.Str(PseudoStackPointer64, vixl::MemOperand(sp, -16, vixl::PreIndex));
+
+ // Initialize the PSP from the SP.
masm.initStackPtr();
#endif
@@ -233,7 +241,22 @@ UnboxedLayout::makeConstructorCode(JSCon
masm.pop(ScratchDoubleReg);
masm.PopRegsInMask(savedNonVolatileRegisters);
+#ifdef JS_CODEGEN_ARM64
+ // Now restore the value that was in the PSP register on entry, and return.
+
+ // Obtain the correct SP from the PSP.
+ masm.Mov(sp, PseudoStackPointer64);
+
+ // Restore the saved value of the PSP register, this value is whatever the
+ // caller had saved in it, not any actual SP value, and it must not be
+ // overwritten subsequently.
+ masm.Ldr(PseudoStackPointer64, vixl::MemOperand(sp, 16, vixl::PostIndex));
+
+ // Perform a plain Ret(), as abiret() will move SP <- PSP and that is wrong.
+ masm.Ret(vixl::lr);
+#else
masm.abiret();
+#endif
masm.bind(&failureStoreOther);

View file

@ -1,33 +1,45 @@
diff -up firefox-134.0-build/firefox-134.0/gfx/skia/skia/modules/skcms/src/Transform_inl.h.aarch64-skia firefox-134.0-build/firefox-134.0/gfx/skia/skia/modules/skcms/src/Transform_inl.h
--- firefox-134.0/gfx/skia/skia/modules/skcms/src/Transform_inl.h.aarch64-skia 2024-12-30 19:30:46.000000000 +0100
+++ firefox-134.0/gfx/skia/skia/modules/skcms/src/Transform_inl.h 2025-01-02 20:51:07.855087265 +0100
@@ -151,7 +151,7 @@ SI U32 to_fixed(F f) { return (U32)cast
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_
}
SI F F_from_Half(U16 half) {
-#if defined(USING_NEON_F16C)
+#if 0 // defined(USING_NEON_F16C)
return vcvt_f32_f16((float16x4_t)half);
#elif defined(USING_AVX512F)
return (F)_mm512_cvtph_ps((__m256i)half);
@@ -178,7 +178,7 @@ SI F F_from_Half(U16 half) {
__attribute__((no_sanitize("unsigned-integer-overflow")))
#endif
SI U16 Half_from_F(F f) {
-#if defined(USING_NEON_F16C)
+#if 0 //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 );
diff -up firefox-134.0-build/firefox-134.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h.aarch64-skia firefox-134.0-build/firefox-134.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h
--- firefox-134.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h.aarch64-skia 2025-01-02 20:51:07.856087299 +0100
+++ firefox-134.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h 2025-01-02 23:09:47.802283444 +0100
@@ -1421,7 +1421,7 @@ SI F from_half(U16 h) {
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(SKRP_CPU_NEON) && defined(SK_CPU_ARM64)
+#if 0 // defined(SKRP_CPU_NEON) && defined(SK_CPU_ARM64)
return (U16)vcvt_f16_f32(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);
#elif defined(SKRP_CPU_SKX)
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-libaom.patch Normal file
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

21
build-arm-wasm.patch Normal file
View file

@ -0,0 +1,21 @@
diff -up firefox-72.0.2/js/src/wasm/WasmSignalHandlers.cpp.old firefox-72.0.2/js/src/wasm/WasmSignalHandlers.cpp
--- firefox-72.0.2/js/src/wasm/WasmSignalHandlers.cpp.old 2020-01-17 23:34:41.000000000 +0200
+++ firefox-72.0.2/js/src/wasm/WasmSignalHandlers.cpp 2020-02-02 08:07:54.670341986 +0200
@@ -249,7 +249,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)

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,13 @@
diff -up firefox-55.0.3/js/src/jit/ExecutableAllocator.h.wasm firefox-55.0.3/js/src/jit/ExecutableAllocator.h
--- firefox-55.0.3/js/src/jit/ExecutableAllocator.h.wasm 2017-09-05 11:32:12.235909468 +0200
+++ firefox-55.0.3/js/src/jit/ExecutableAllocator.h 2017-09-05 11:32:46.157916575 +0200
@@ -219,7 +219,7 @@ class ExecutableAllocator
static void poisonCode(JSRuntime* rt, JitPoisonRangeVector& ranges);
-#if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64) || defined(JS_SIMULATOR_ARM64)
+#if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64) || defined(JS_SIMULATOR_ARM64) || defined(JS_CODEGEN_NONE)
static void cacheFlush(void*, size_t)
{
}
diff -up firefox-55.0.3/js/src/jit-test/tests/wasm/bench/wasm_box2d.wasm firefox-55.0.3/js/src/jit-test/tests/wasm/bench/wasm_box2d

4946
build-cubeb-pulse-arm.patch Normal file

File diff suppressed because it is too large Load diff

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,14 @@
diff --git a/config/makefiles/rust.mk b/config/makefiles/rust.mk
--- a/config/makefiles/rust.mk
+++ b/config/makefiles/rust.mk
@@ -10,6 +10,10 @@
# commands can be executed directly by make, without doing a round-trip
# through a shell.
+MOZ_MAKE_FLAGS := $(filter-out -j%,$(MAKEFLAGS))
+MAKEFLAGS += -j1
+
+
cargo_host_flag := --target=$(RUST_HOST_TARGET)
cargo_target_flag := --target=$(RUST_TARGET)

View file

@ -0,0 +1,12 @@
diff -up firefox-61.0/build/autoconf/icu.m4.icu firefox-61.0/build/autoconf/icu.m4
--- firefox-61.0/build/autoconf/icu.m4.icu 2018-06-20 09:03:17.957565445 +0200
+++ firefox-61.0/build/autoconf/icu.m4 2018-06-20 09:08:28.159403451 +0200
@@ -77,7 +77,7 @@ if test -n "$USE_ICU"; then
# TODO: the l is actually endian-dependent
# We could make this set as 'l' or 'b' for little or big, respectively,
# but we'd need to check in a big-endian version of the file.
- ICU_DATA_FILE="icudt${version}l.dat"
+ ICU_DATA_FILE="icudt${version}b.dat"
fi
AC_SUBST(MOZ_ICU_VERSION)

View file

@ -0,0 +1,12 @@
diff -up firefox-60.5.0/js/src/jit/AtomicOperations.h.jit-atomic-lucky firefox-60.5.0/js/src/jit/AtomicOperations.h
--- firefox-60.5.0/js/src/jit/AtomicOperations.h.jit-atomic-lucky 2019-01-22 10:20:27.993697161 +0100
+++ firefox-60.5.0/js/src/jit/AtomicOperations.h 2019-01-22 10:23:15.337873762 +0100
@@ -394,7 +394,7 @@ inline bool AtomicOperations::isLockfree
#elif defined(__s390__) || defined(__s390x__)
#include "jit/none/AtomicOperations-feeling-lucky.h"
#else
-#error "No AtomicOperations support provided for this platform"
+#include "jit/none/AtomicOperations-feeling-lucky.h"
#endif
#endif // jit_AtomicOperations_h

51
build-ppc-jit.patch Normal file
View file

@ -0,0 +1,51 @@
diff -up firefox-55.0/js/src/jit/MIR.h.old firefox-55.0/js/src/jit/MIR.h
--- firefox-55.0/js/src/jit/MIR.h.old 2017-08-08 14:04:44.528460099 +0200
+++ firefox-55.0/js/src/jit/MIR.h 2017-08-08 14:05:11.045364831 +0200
@@ -12434,7 +12434,7 @@ class MNearbyInt
TRIVIAL_NEW_WRAPPERS
static bool HasAssemblerSupport(RoundingMode mode) {
- return Assembler::HasRoundInstruction(mode);
+ return false;
}
RoundingMode roundingMode() const { return roundingMode_; }
diff -up firefox-55.0/js/src/jit/ExecutableAllocator.h.old firefox-55.0/js/src/jit/ExecutableAllocator.h
--- firefox-55.0/js/src/jit/ExecutableAllocator.h.old 2017-08-09 09:24:18.784983505 +0200
+++ firefox-55.0/js/src/jit/ExecutableAllocator.h 2017-08-09 09:28:01.471100075 +0200
@@ -307,6 +307,10 @@ class ExecutableAllocator
{
sync_instruction_memory((caddr_t)code, size);
}
+#else
+ static void cacheFlush(void*, size_t)
+ {
+ }
#endif
private:
diff -up firefox-55.0/js/src/wasm/WasmBuiltins.cpp.old firefox-55.0/js/src/wasm/WasmBuiltins.cpp
--- firefox-55.0/js/src/wasm/WasmBuiltins.cpp.old 2017-08-09 12:50:46.877450765 +0200
+++ firefox-55.0/js/src/wasm/WasmBuiltins.cpp 2017-08-09 12:50:59.725406974 +0200
@@ -881,7 +881,6 @@ wasm::EnsureBuiltinThunksInitialized()
MOZ_ASSERT(!masm.numSymbolicAccesses());
#endif
- ExecutableAllocator::cacheFlush(thunks->codeBase, thunks->codeSize);
if (!ExecutableAllocator::makeExecutable(thunks->codeBase, thunks->codeSize))
return false;
diff -up firefox-55.0/js/src/wasm/WasmCode.cpp.old firefox-55.0/js/src/wasm/WasmCode.cpp
--- firefox-55.0/js/src/wasm/WasmCode.cpp.old 2017-08-09 12:50:37.205483731 +0200
+++ firefox-55.0/js/src/wasm/WasmCode.cpp 2017-08-09 12:51:10.365370708 +0200
@@ -287,8 +287,6 @@ CodeSegment::initialize(Tier tier,
if (!StaticallyLink(*this, linkData))
return false;
- ExecutableAllocator::cacheFlush(bytes_.get(), RoundupCodeLength(codeLength));
-
// Reprotect the whole region to avoid having separate RW and RX mappings.
if (!ExecutableAllocator::makeExecutable(bytes_.get(), RoundupCodeLength(codeLength)))
return false;
diff -up firefox-55.0/media/libyuv/libyuv/tools_libyuv/autoroller/unittests/testdata/DEPS.chromium.old firefox-55.0/media/libyuv/libyuv/tools_libyuv/autoroller/unittests/testdata/DEPS.chromium
diff -up firefox-55.0/media/webrtc/trunk/Makefile.old firefox-55.0/media/webrtc/trunk/Makefile

25
build-rust-ppc64le.patch Normal file
View file

@ -0,0 +1,25 @@
diff -up firefox-55.0/build/moz.configure/rust.configure.rust-ppc64le firefox-55.0/build/moz.configure/rust.configure
--- firefox-55.0/build/moz.configure/rust.configure.rust-ppc64le 2017-07-31 18:20:49.000000000 +0200
+++ firefox-55.0/build/moz.configure/rust.configure 2017-08-02 10:19:03.254220003 +0200
@@ -151,6 +151,9 @@ def rust_triple_alias(host_or_target):
('sparc64', 'Linux'): 'sparc64-unknown-linux-gnu',
('x86', 'Linux'): 'i686-unknown-linux-gnu',
('x86_64', 'Linux'): 'x86_64-unknown-linux-gnu',
+ ('ppc64le', 'Linux'): 'powerpc64le-unknown-linux-gnu',
+ ('ppc64', 'Linux'): 'powerpc64-unknown-linux-gnu',
+ ('s390x', 'Linux'): 's390x-unknown-linux-gnu',
# OS X
('x86', 'OSX'): 'i686-apple-darwin',
('x86_64', 'OSX'): 'x86_64-apple-darwin',
@@ -174,8 +177,10 @@ def rust_triple_alias(host_or_target):
('sparc64', 'SunOS'): 'sparcv9-sun-solaris',
}.get((host_or_target.cpu, os_or_kernel), None)
+ if (rustc_target == 'powerpc64-unknown-linux-gnu' and host_or_target.endianness == 'little'):
+ rustc_target = 'powerpc64le-unknown-linux-gnu'
if rustc_target is None:
- die("Don't know how to translate {} for rustc".format(host_or_target.alias))
+ die("Don't know how to translate {} for rustc, cpu: {}, os: {}".format(target.alias, target.cpu, os_or_kernel))
# Check to see whether our rustc has a reasonably functional stdlib
# for our chosen target.

View file

@ -1,11 +0,0 @@
diff -up thunderbird-145.0/security/sandbox/chromium/sandbox/linux/system_headers/linux_seccomp.h.seccomp thunderbird-145.0/security/sandbox/chromium/sandbox/linux/system_headers/linux_seccomp.h
--- thunderbird-145.0/security/sandbox/chromium/sandbox/linux/system_headers/linux_seccomp.h.seccomp 2025-12-09 13:42:31.378958842 +0100
+++ thunderbird-145.0/security/sandbox/chromium/sandbox/linux/system_headers/linux_seccomp.h 2025-12-09 13:42:37.886937626 +0100
@@ -6,6 +6,7 @@
#define SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_SECCOMP_H_
#include <stdint.h>
+#include <signal.h>
#include <sys/ioctl.h>
#include "build/build_config.h"

View file

@ -1,36 +0,0 @@
diff -up firefox-121.0/toolkit/content/jar.mn.disable-openh264-download firefox-121.0/toolkit/content/jar.mn
--- firefox-121.0/toolkit/content/jar.mn.disable-openh264-download 2023-12-18 20:15:04.352014249 +0100
+++ firefox-121.0/toolkit/content/jar.mn 2023-12-18 20:19:26.857929200 +0100
@@ -130,7 +130,6 @@ toolkit.jar:
#ifdef XP_MACOSX
content/global/macWindowMenu.js
#endif
- content/global/gmp-sources/openh264.json (gmp-sources/openh264.json)
content/global/gmp-sources/widevinecdm.json (gmp-sources/widevinecdm.json)
content/global/gmp-sources/widevinecdm_l1.json (gmp-sources/widevinecdm_l1.json)
diff -up firefox-121.0/toolkit/modules/GMPInstallManager.sys.mjs.disable-openh264-download firefox-121.0/toolkit/modules/GMPInstallManager.sys.mjs
--- firefox-121.0/toolkit/modules/GMPInstallManager.sys.mjs.disable-openh264-download 2023-12-11 21:42:21.000000000 +0100
+++ firefox-121.0/toolkit/modules/GMPInstallManager.sys.mjs 2023-12-18 20:18:52.665768579 +0100
@@ -35,11 +35,6 @@ function getScopedLogger(prefix) {
const LOCAL_GMP_SOURCES = [
{
- id: "gmp-gmpopenh264",
- src: "chrome://global/content/gmp-sources/openh264.json",
- installByDefault: true,
- },
- {
id: "gmp-widevinecdm",
src: "chrome://global/content/gmp-sources/widevinecdm.json",
installByDefault: true,
@@ -421,6 +416,9 @@ GMPInstallManager.prototype = {
* downloaderr, verifyerr or previouserrorencountered
*/
installAddon(gmpAddon) {
+ if (gmpAddon.isOpenH264) {
+ return Promise.reject({ type: "disabled" });
+ }
if (this._deferred) {
let log = getScopedLogger("GMPInstallManager.installAddon");
log.error("previous error encountered");

9
distribution.ini Normal file
View file

@ -0,0 +1,9 @@
[Global]
id=fedora
version=1.0
about=Mozilla Firefox for Fedora
[Preferences]
app.distributor=fedora
app.distributor.channel=fedora
app.partner.fedora=fedora

View file

@ -1,9 +0,0 @@
[Global]
id=__ID__
version=1.0
about=Mozilla Firefox for __NAME__
[Preferences]
app.distributor=__ID__
app.distributor.channel=__ID__
app.partner.fedora=__ID__

23
fedora-build.patch Normal file
View file

@ -0,0 +1,23 @@
diff -up firefox-54.0/media/libyuv/libyuv/tools_libyuv/autoroller/unittests/testdata/DEPS.chromium.old firefox-54.0/media/libyuv/libyuv/tools_libyuv/autoroller/unittests/testdata/DEPS.chromium
diff -up firefox-54.0/media/mtransport/third_party/nICEr/nicer.gyp.old firefox-54.0/media/mtransport/third_party/nICEr/nicer.gyp
--- firefox-54.0/media/mtransport/third_party/nICEr/nicer.gyp.old 2017-06-08 14:59:08.786996664 +0200
+++ firefox-54.0/media/mtransport/third_party/nICEr/nicer.gyp 2017-06-08 14:59:22.642946570 +0200
@@ -211,7 +211,6 @@
'-Wno-parentheses',
'-Wno-strict-prototypes',
'-Wmissing-prototypes',
- '-Wno-format',
],
'defines' : [
'LINUX',
diff -up firefox-54.0/media/mtransport/third_party/nrappkit/nrappkit.gyp.build firefox-54.0/media/mtransport/third_party/nrappkit/nrappkit.gyp
--- firefox-54.0/media/mtransport/third_party/nrappkit/nrappkit.gyp.build 2017-06-08 15:08:03.627063097 +0200
+++ firefox-54.0/media/mtransport/third_party/nrappkit/nrappkit.gyp 2017-06-08 15:08:15.657019606 +0200
@@ -206,7 +206,6 @@
'-Wno-parentheses',
'-Wno-strict-prototypes',
'-Wmissing-prototypes',
- '-Wno-format',
],
'defines' : [
'LINUX',

View file

@ -1,17 +0,0 @@
diff -up firefox-124.0/toolkit/xre/nsAppRunner.cpp.fedora-customization firefox-124.0/toolkit/xre/nsAppRunner.cpp
diff -up firefox-124.0/widget/gtk/nsWindow.cpp.fedora-customization firefox-124.0/widget/gtk/nsWindow.cpp
--- firefox-124.0/widget/gtk/nsWindow.cpp.fedora-customization 2024-03-13 12:35:57.098591719 +0100
+++ firefox-124.0/widget/gtk/nsWindow.cpp 2024-03-13 12:43:17.375928494 +0100
@@ -3459,6 +3459,12 @@ nsresult nsWindow::SetTitle(const nsAStr
return NS_OK;
}
+ const char* appTitle = getenv("MOZ_APP_TITLE");
+ if (appTitle) {
+ gtk_window_set_title(GTK_WINDOW(mShell), appTitle);
+ return NS_OK;
+ }
+
// convert the string into utf8 and set the title.
#define UTF8_FOLLOWBYTE(ch) (((ch) & 0xC0) == 0x80)
NS_ConvertUTF16toUTF8 titleUTF8(aTitle);

View file

@ -0,0 +1,9 @@
diff -up firefox-73.0/build/unix/run-mozilla.sh.old firefox-73.0/build/unix/run-mozilla.sh
--- firefox-73.0/build/unix/run-mozilla.sh.old 2020-02-12 09:58:00.150895904 +0100
+++ firefox-73.0/build/unix/run-mozilla.sh 2020-02-12 09:58:06.505860696 +0100
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/sh
#
# 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

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);

View file

@ -1,10 +1,10 @@
diff -up firefox-125.0/browser/app/profile/firefox.js.addons firefox-125.0/browser/app/profile/firefox.js
--- firefox-125.0/browser/app/profile/firefox.js.addons 2024-04-09 10:34:30.728405003 +0200
+++ firefox-125.0/browser/app/profile/firefox.js 2024-04-09 10:36:01.444584632 +0200
@@ -58,7 +58,8 @@ pref("extensions.systemAddon.update.enab
diff -up firefox-55.0/browser/app/profile/firefox.js.addons firefox-55.0/browser/app/profile/firefox.js
--- firefox-55.0/browser/app/profile/firefox.js.addons 2017-08-02 10:58:30.566363833 +0200
+++ firefox-55.0/browser/app/profile/firefox.js 2017-08-02 10:59:15.377216959 +0200
@@ -65,7 +65,8 @@ pref("extensions.systemAddon.update.url"
// Disable add-ons that are not installed by the user in all scopes by default.
// See the SCOPE constants in AddonManager.sys.mjs for values to use here.
// See the SCOPE constants in AddonManager.jsm for values to use here.
-pref("extensions.autoDisableScopes", 15);
+pref("extensions.autoDisableScopes", 0);
+pref("extensions.showMismatchUI", false);

19
firefox-fedora-ua.patch Normal file
View file

@ -0,0 +1,19 @@
diff -up firefox-65.0/netwerk/protocol/http/nsHttpHandler.cpp.fedora-ua firefox-65.0/netwerk/protocol/http/nsHttpHandler.cpp
--- firefox-65.0/netwerk/protocol/http/nsHttpHandler.cpp.fedora-ua 2019-01-28 14:28:35.806375063 +0100
+++ firefox-65.0/netwerk/protocol/http/nsHttpHandler.cpp 2019-01-28 14:30:25.886917219 +0100
@@ -873,6 +873,7 @@ void nsHttpHandler::BuildUserAgent() {
mUserAgent.SetCapacity(mLegacyAppName.Length() + mLegacyAppVersion.Length() +
#ifndef UA_SPARE_PLATFORM
mPlatform.Length() +
+ mPlatform.Length() + 8 +
#endif
mOscpu.Length() + mMisc.Length() + mProduct.Length() +
mProductSub.Length() + mAppName.Length() +
@@ -891,6 +892,7 @@ void nsHttpHandler::BuildUserAgent() {
if (!mPlatform.IsEmpty()) {
mUserAgent += mPlatform;
mUserAgent.AppendLiteral("; ");
+ mUserAgent.AppendLiteral("Fedora; ");
}
#endif
if (!mCompatDevice.IsEmpty()) {

View file

@ -1,24 +0,0 @@
--- firefox-109.0.1/gfx/2d/Rect.h.old 2023-02-07 09:44:24.946279843 +0100
+++ firefox-109.0.1/gfx/2d/Rect.h 2023-02-07 09:44:47.969032049 +0100
@@ -324,8 +324,8 @@ IntRectTyped<Units> RoundedToInt(const R
template <class Units>
bool RectIsInt32Safe(const RectTyped<Units>& aRect) {
- float min = (float)std::numeric_limits<std::int32_t>::min();
- float max = (float)std::numeric_limits<std::int32_t>::max();
+ float min = (float)std::numeric_limits<int32_t>::min();
+ float max = (float)std::numeric_limits<int32_t>::max();
return aRect.x > min && aRect.y > min && aRect.width < max &&
aRect.height < max && aRect.XMost() < max && aRect.YMost() < max;
}
diff -up firefox-109.0.1/toolkit/components/telemetry/pingsender/pingsender.cpp.old firefox-109.0.1/toolkit/components/telemetry/pingsender/pingsender.cpp
--- firefox-109.0.1/toolkit/components/telemetry/pingsender/pingsender.cpp.old 2023-02-07 11:03:41.788720090 +0100
+++ firefox-109.0.1/toolkit/components/telemetry/pingsender/pingsender.cpp 2023-02-07 11:04:29.195345659 +0100
@@ -10,6 +10,7 @@
#include <iomanip>
#include <string>
#include <vector>
+#include <cstdint>
#include <zlib.h>

View file

@ -1,19 +0,0 @@
diff -up firefox-137.0.2/toolkit/components/protobuf/src/google/protobuf/port_def.inc.s390 firefox-137.0.2/toolkit/components/protobuf/src/google/protobuf/port_def.inc
--- firefox-137.0.2/toolkit/components/protobuf/src/google/protobuf/port_def.inc.s390 2025-04-22 11:42:00.650759505 +0200
+++ firefox-137.0.2/toolkit/components/protobuf/src/google/protobuf/port_def.inc 2025-04-22 11:46:02.522031338 +0200
@@ -257,12 +257,14 @@
#if __has_cpp_attribute(clang::musttail) && !defined(__arm__) && \
!defined(_ARCH_PPC) && !defined(__wasm__) && \
!(defined(_MSC_VER) && defined(_M_IX86)) && \
- !(defined(__NDK_MAJOR__) && __NDK_MAJOR <= 24)
+ !(defined(__NDK_MAJOR__) && __NDK_MAJOR <= 24) && \
+ !defined(__s390__)
# ifndef PROTO2_OPENSOURCE
// Compilation fails on ARM32: b/195943306
// Compilation fails on powerpc64le: b/187985113
// Compilation fails on X86 Windows:
// https://github.com/llvm/llvm-project/issues/53271
+// Compilation fails on S390 for calls with more than 4 arguments
# endif
#define PROTOBUF_MUSTTAIL [[clang::musttail]]
#define PROTOBUF_TAILCALL true

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

@ -1,38 +0,0 @@
--- firefox-80.0.1/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h 2020-08-31 10:04:19.000000000 -0400
+++ firefox-80.0.1/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h 2020-09-12 07:24:35.298931628 -0400
@@ -1962,7 +1962,7 @@ struct kernel_statfs {
LSS_ENTRYPOINT \
"pop %%ebx" \
args \
- : "esp", "memory"); \
+ : "memory"); \
LSS_RETURN(type,__res)
#undef _syscall0
#define _syscall0(type,name) \
@@ -2019,7 +2019,7 @@ struct kernel_statfs {
: "i" (__NR_##name), "ri" ((long)(arg1)), \
"c" ((long)(arg2)), "d" ((long)(arg3)), \
"S" ((long)(arg4)), "D" ((long)(arg5)) \
- : "esp", "memory"); \
+ : "memory"); \
LSS_RETURN(type,__res); \
}
#undef _syscall6
@@ -2041,7 +2041,7 @@ struct kernel_statfs {
: "i" (__NR_##name), "0" ((long)(&__s)), \
"c" ((long)(arg2)), "d" ((long)(arg3)), \
"S" ((long)(arg4)), "D" ((long)(arg5)) \
- : "esp", "memory"); \
+ : "memory"); \
LSS_RETURN(type,__res); \
}
LSS_INLINE int LSS_NAME(clone)(int (*fn)(void *), void *child_stack,
@@ -2127,7 +2127,7 @@ struct kernel_statfs {
: "0"(-EINVAL), "i"(__NR_clone),
"m"(fn), "m"(child_stack), "m"(flags), "m"(arg),
"m"(parent_tidptr), "m"(newtls), "m"(child_tidptr)
- : "esp", "memory", "ecx", "edx", "esi", "edi");
+ : "memory", "ecx", "edx", "esi", "edi");
LSS_RETURN(int, __res);
}

View file

@ -1,12 +0,0 @@
diff -up firefox-105.0/mozglue/misc/SIMD_avx2.cpp.old firefox-105.0/mozglue/misc/SIMD_avx2.cpp
--- firefox-105.0/mozglue/misc/SIMD_avx2.cpp.old 2022-09-22 21:35:07.006221995 +0200
+++ firefox-105.0/mozglue/misc/SIMD_avx2.cpp 2022-09-22 21:36:12.972480517 +0200
@@ -55,7 +55,7 @@ __m256i CmpEq256(__m256i a, __m256i b) {
return _mm256_cmpeq_epi64(a, b);
}
-# if defined(__GNUC__) && !defined(__clang__)
+# if 0
// See the comment in SIMD.cpp over Load32BitsIntoXMM. This is just adapted
// from that workaround. Testing this, it also yields the correct instructions

View file

@ -0,0 +1,12 @@
diff -up firefox-75.0/intl/locale/LocaleService.cpp.locale-debug firefox-75.0/intl/locale/LocaleService.cpp
--- firefox-75.0/intl/locale/LocaleService.cpp.locale-debug 2020-04-06 22:42:20.196799809 +0200
+++ firefox-75.0/intl/locale/LocaleService.cpp 2020-04-06 22:43:02.522530317 +0200
@@ -372,8 +372,6 @@ LocaleService::GetDefaultLocale(nsACStri
// just use our hard-coded default below.
GetGREFileContents("update.locale", &locale);
locale.Trim(" \t\n\r");
- // This should never be empty.
- MOZ_ASSERT(!locale.IsEmpty());
if (CanonicalizeLanguageId(locale)) {
mDefaultLocale.Assign(locale);
}

View file

@ -1,20 +1,20 @@
. $topsrcdir/browser/config/mozconfig
ac_add_options --with-system-zlib
ac_add_options --with-system-bz2
ac_add_options --disable-strip
#ac_add_options --enable-libnotify
ac_add_options --enable-necko-wifi
ac_add_options --enable-startup-notification
ac_add_options --disable-updater
ac_add_options --enable-chrome-format=omni
ac_add_options --enable-pulseaudio
ac_add_options --enable-av1
ac_add_options --without-system-icu
ac_add_options --enable-release
ac_add_options --update-channel=release
# Workaround for mozbz#1341234
ac_add_options BINDGEN_CFLAGS="$(pkg-config nspr pixman-1 --cflags)"
ac_add_options --allow-addon-sideload
ac_add_options --with-system-fdk-aac
ac_add_options --enable-js-shell
ac_add_options --with-unsigned-addon-scopes=app,system
ac_add_options --disable-bootstrap
export BUILD_OFFICIAL=1
export MOZILLA_OFFICIAL=1

View file

@ -1,19 +0,0 @@
diff -up firefox-84.0.2/security/certverifier/NSSCertDBTrustDomain.cpp.nss-hack firefox-84.0.2/security/certverifier/NSSCertDBTrustDomain.cpp
--- firefox-84.0.2/security/certverifier/NSSCertDBTrustDomain.cpp.nss-hack 2021-01-11 12:12:02.585514543 +0100
+++ firefox-84.0.2/security/certverifier/NSSCertDBTrustDomain.cpp 2021-01-11 12:47:50.345984582 +0100
@@ -1619,6 +1619,15 @@ SECStatus InitializeNSS(const nsACString
return srv;
}
+ /* Sets the NSS_USE_ALG_IN_ANY_SIGNATURE bit.
+ * does not change NSS_USE_ALG_IN_CERT_SIGNATURE,
+ * so policy will still disable use of sha1 in
+ * certificate related signature processing. */
+ srv = NSS_SetAlgorithmPolicy(SEC_OID_SHA1, NSS_USE_ALG_IN_ANY_SIGNATURE, 0);
+ if (srv != SECSuccess) {
+ NS_WARNING("Unable to use SHA1 for Add-ons, expect broken/disabled Add-ons. See https://bugzilla.redhat.com/show_bug.cgi?id=1908018 for details.");
+ }
+
if (nssDbConfig == NSSDBConfig::ReadWrite) {
UniquePK11SlotInfo slot(PK11_GetInternalKeySlot());
if (!slot) {

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

@ -0,0 +1,12 @@
diff -up firefox-76.0/old-configure.in.nss-version firefox-76.0/old-configure.in
--- firefox-76.0/old-configure.in.nss-version 2020-05-03 19:12:01.771863688 +0200
+++ firefox-76.0/old-configure.in 2020-05-03 19:17:53.216898766 +0200
@@ -1506,7 +1506,7 @@ MOZ_ARG_WITH_BOOL(system-nss,
_USE_SYSTEM_NSS=1 )
if test -n "$_USE_SYSTEM_NSS"; then
- AM_PATH_NSS(3.51.1, [MOZ_SYSTEM_NSS=1], [AC_MSG_ERROR([you don't have NSS installed or your version is too old])])
+ AM_PATH_NSS(3.51, [MOZ_SYSTEM_NSS=1], [AC_MSG_ERROR([you don't have NSS installed or your version is too old])])
fi
NSS_CFLAGS="$NSS_CFLAGS -I${DIST}/include/nss"

536
firefox-pipewire-0-2.patch Normal file
View file

@ -0,0 +1,536 @@
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/desktop_capture_generic_gn/moz.build b/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build
index 90b40431c7e4..03581f7c38b5 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,28 @@ 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.2",
+ "glib-2.0",
+ "gio-2.0",
+ "gobject-2.0"
+ ]
+
+ CXXFLAGS += CONFIG['TK_CFLAGS']
+
+ 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..58ab8279f4b7 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
@@ -18,6 +18,11 @@
#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,6 +41,27 @@ const char kSessionInterfaceName[] = "org.freedesktop.portal.Session";
const char kRequestInterfaceName[] = "org.freedesktop.portal.Request";
const char kScreenCastInterfaceName[] = "org.freedesktop.portal.ScreenCast";
+
+// 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;
+ } else {
+ break;
+ }
+ }
+}
+
// static
void BaseCapturerPipeWire::OnStateChanged(void* data,
pw_remote_state old_state,
@@ -108,11 +134,13 @@ void BaseCapturerPipeWire::OnStreamFormatChanged(void* data,
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];
+ const struct spa_pod* params[3];
params[0] = reinterpret_cast<spa_pod*>(spa_pod_builder_object(
&builder,
// id to enumerate buffer requirements
@@ -141,8 +169,14 @@ void BaseCapturerPipeWire::OnStreamFormatChanged(void* data,
// 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);
+ params[2] = reinterpret_cast<spa_pod*>(
+ spa_pod_builder_object(&builder, that->pw_core_type_->param.idMeta,
+ that->pw_core_type_->param_meta.Meta, ":",
+ that->pw_core_type_->param_meta.type, "I",
+ that->pw_core_type_->meta.VideoCrop, ":",
+ that->pw_core_type_->param_meta.size, "i",
+ sizeof(struct spa_meta_video_crop)));
+ pw_stream_finish_format(that->pw_stream_, /*res=*/0, params, /*n_params=*/3);
}
// static
@@ -150,15 +184,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)
@@ -197,10 +241,6 @@ BaseCapturerPipeWire::~BaseCapturerPipeWire() {
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_);
}
@@ -290,12 +330,7 @@ void BaseCapturerPipeWire::InitPipeWireTypes() {
void 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_fraction pwFrameRateMin = spa_fraction{0, 1};
- spa_fraction pwFrameRateMax = spa_fraction{60, 1};
+ spa_rectangle pwMaxScreenBounds = spa_rectangle{INT32_MAX, INT32_MAX};
pw_properties* reuseProps = pw_properties_new("pipewire.client.reuse", "1",
/*end of varargs*/ nullptr);
@@ -313,27 +348,19 @@ void BaseCapturerPipeWire::CreateReceivingStream() {
// 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),
+ SPA_POD_PROP_ENUM(
+ 4, pw_type_->video_format.RGBx, pw_type_->video_format.BGRx,
+ pw_type_->video_format.RGBA, pw_type_->video_format.BGRA),
// 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_type_->format_video.size, "Rru", &pwMinScreenBounds,
+ SPA_POD_PROP_MIN_MAX(&pwMinScreenBounds, &pwMaxScreenBounds)));
pw_stream_add_listener(pw_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);
+ PW_STREAM_FLAG_AUTOCONNECT | PW_STREAM_FLAG_INACTIVE);
if (pw_stream_connect(pw_stream_, PW_DIRECTION_INPUT, /*port_path=*/nullptr,
flags, params,
/*n_params=*/1) != 0) {
@@ -344,15 +371,81 @@ void BaseCapturerPipeWire::CreateReceivingStream() {
}
void BaseCapturerPipeWire::HandleBuffer(pw_buffer* buffer) {
+ struct spa_meta_video_crop* 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 == pw_core_type_->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));
+ src = SPA_MEMBER(map, spaBuffer->datas[0].mapoffset, uint8_t);
+ } else if (spaBuffer->datas[0].type == pw_core_type_->data.DmaBuf) {
+ int fd;
+ fd = spaBuffer->datas[0].fd;
+
+ map = static_cast<uint8_t*>(mmap(
+ nullptr, spaBuffer->datas[0].maxsize + spaBuffer->datas[0].mapoffset,
+ PROT_READ, MAP_PRIVATE, fd, 0));
+ SyncDmaBuf(fd, DMA_BUF_SYNC_START);
+
+ src = SPA_MEMBER(map, spaBuffer->datas[0].mapoffset, uint8_t);
+ } else if (spaBuffer->datas[0].type == pw_core_type_->data.MemPtr) {
+ map = nullptr;
+ src = static_cast<uint8_t*>(spaBuffer->datas[0].data);
+ } else {
+ return;
+ }
- if (!(src = spaBuffer->datas[0].data)) {
+ if (!src) {
return;
}
- uint32_t maxSize = spaBuffer->datas[0].maxsize;
- int32_t srcStride = spaBuffer->datas[0].chunk->stride;
+ 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_video_crop*>(
+ spa_buffer_find_meta(spaBuffer, pw_core_type_->meta.VideoCrop)))) {
+ RTC_DCHECK(video_crop->width <= desktop_size_.width() &&
+ video_crop->height <= desktop_size_.height());
+ if ((video_crop->width != desktop_size_.width() ||
+ video_crop->height != desktop_size_.height()) && video_crop->width && video_crop->height) {
+ video_crop_size_ = DesktopSize(video_crop->width, video_crop->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 +454,39 @@ 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->y + video_crop_size_.height() <= desktop_size_.height())) {
+ for (int i = 0; i < video_crop->y; ++i) {
+ src += srcStride;
+ }
+ }
+ const int xOffset =
+ video_crop_size_initialized_ && (video_crop->x + video_crop_size_.width() <=
+ desktop_size_.width())
+ ? video_crop->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 == pw_type_->video_format.RGBx) {
+ 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 == pw_core_type_->data.DmaBuf) {
+ SyncDmaBuf(spaBuffer->datas[0].fd, DMA_BUF_SYNC_END);
+ }
+ munmap(map, spaBuffer->datas[0].maxsize + spaBuffer->datas[0].mapoffset);
}
}
@@ -725,10 +836,6 @@ 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);
-
g_variant_unref(options);
g_variant_unref(variant);
}
@@ -813,10 +920,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 +949,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..ef90a86a5a4b 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
@@ -32,7 +32,11 @@ class PipeWireType {
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,6 +47,12 @@ 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_core* pw_core_ = nullptr;
@@ -64,7 +74,7 @@ class BaseCapturerPipeWire : public DesktopCapturer {
gint32 pw_fd_ = -1;
CaptureSourceType capture_source_type_ =
- BaseCapturerPipeWire::CaptureSourceType::Screen;
+ BaseCapturerPipeWire::CaptureSourceType::kAny;
// <-- end of PipeWire types
@@ -78,10 +88,12 @@ 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;
@@ -95,6 +107,7 @@ class BaseCapturerPipeWire : public DesktopCapturer {
void ConvertRGBxToBGRx(uint8_t* frame, uint32_t size);
+ static void SyncDmaBuf(int fd, uint64_t start_or_end);
static void OnStateChanged(void* data,
pw_remote_state old_state,
pw_remote_state state,
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)

821
firefox-pipewire-0-3.patch Normal file
View file

@ -0,0 +1,821 @@
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/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..53e2683df2e8 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;
- if (!(buf = pw_stream_dequeue_buffer(that->pw_stream_))) {
+ 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 (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,120 @@ 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));
+ 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;
+
+ map = static_cast<uint8_t*>(mmap(
+ nullptr, spaBuffer->datas[0].maxsize + spaBuffer->datas[0].mapoffset,
+ PROT_READ, MAP_PRIVATE, fd, 0));
+ 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;
+ }
- if (!(src = spaBuffer->datas[0].data)) {
+ if (!src) {
return;
}
- uint32_t maxSize = spaBuffer->datas[0].maxsize;
- int32_t srcStride = spaBuffer->datas[0].chunk->stride;
+ 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 +388,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 +771,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 +856,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 +885,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

@ -2,11 +2,13 @@ pref("app.update.auto", false);
pref("app.update.enabled", false);
pref("app.update.autoInstallEnabled", false);
pref("general.smoothScroll", true);
pref("intl.locale.matchOS", true);
pref("intl.locale.requested", "");
pref("toolkit.storage.synchronous", 0);
pref("toolkit.networkmanager.disable", false);
pref("offline.autoDetect", true);
pref("browser.backspace_action", 2);
pref("browser.display.use_system_colors", true);
pref("browser.download.folderList", 1);
pref("browser.link.open_external", 3);
pref("browser.shell.checkDefaultBrowser", false);
@ -16,18 +18,20 @@ pref("ui.SpellCheckerUnderlineStyle", 1);
pref("startup.homepage_override_url", "");
pref("browser.startup.homepage", "data:text/plain,browser.startup.homepage=https://start.fedoraproject.org/");
pref("browser.newtabpage.pinned", '[{"url":"https://start.fedoraproject.org/","title":"Fedora Project - Start Page"}]');
pref("geo.wifi.uri", "https://location.services.mozilla.com/v1/geolocate?key=%MOZILLA_API_KEY%");
pref("media.gmp-gmpopenh264.provider.enabled",false);
pref("media.gmp-gmpopenh264.autoupdate",false);
pref("media.gmp-gmpopenh264.enabled",false);
pref("media.gmp.decoder.enabled", true);
pref("media.gmp-gmpopenh264.enabled",false);
pref("plugins.notifyMissingFlash", false);
/* See https://bugzilla.redhat.com/show_bug.cgi?id=1226489 */
pref("browser.display.use_system_colors", false);
pref("layers.use-image-offscreen-surfaces", false);
/* Allow sending credetials to all https:// sites */
pref("network.negotiate-auth.trusted-uris", "https://");
pref("spellchecker.dictionary_path","/usr/share/hunspell");
pref("spellchecker.dictionary_path","/usr/share/myspell");
/* Disable DoH by default */
pref("network.trr.mode", 5);
/* Enable per-user policy dir, see mozbz#1583466 */
pref("browser.policies.perUserDir", true);
pref("browser.gnome-search-provider.enabled",true);
/* Enable ffvpx playback for WebRTC */
pref("media.navigator.mediadatadecoder_vpx_enabled", true);

View file

@ -0,0 +1,5 @@
[Shell Search Provider]
DesktopId=firefox.desktop
BusName=org.mozilla.Firefox.SearchProvider
ObjectPath=/org/mozilla/Firefox/SearchProvider
Version=2

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

Before After
Before After

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

@ -11,7 +11,7 @@ MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xm
StartupNotify=true
Categories=Network;WebBrowser;
Keywords=web;browser;internet;
Actions=new-window;new-private-window;profile-manager-window;
Actions=new-window;new-private-window;
[Desktop Action new-window]
Name=Open a New Window
@ -228,8 +228,3 @@ Name[xh]=Ifestile yangasese entsha
Name[zh_CN]=
Name[zh_TW]=
Exec=firefox-wayland --private-window --name firefox-wayland %u
[Desktop Action profile-manager-window]
Name=Open the Profile Manager
Name[cs]=Správa profilů
Exec=firefox-wayland --name firefox-wayland --ProfileManager

View file

@ -11,7 +11,7 @@ MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xm
StartupNotify=true
Categories=Network;WebBrowser;
Keywords=web;browser;internet;
Actions=new-window;new-private-window;profile-manager-window;
Actions=new-window;new-private-window;
[Desktop Action new-window]
Name=Open a New Window
@ -228,8 +228,3 @@ Name[xh]=Ifestile yangasese entsha
Name[zh_CN]=
Name[zh_TW]=
Exec=firefox-x11 --private-window --name firefox-x11 %u
[Desktop Action profile-manager-window]
Name=Open the Profile Manager
Name[cs]=Správa profilů
Exec=firefox-x11 --name firefox-x11 --ProfileManager

View file

@ -1,4 +1,4 @@
.TH FIREFOX 1 "July 10, 2019" firefox "Linux User's Manual"
.TH FIREFOX 1 "November 30, 2017" firefox "Linux User's Manual"
.SH NAME
firefox \- a Web browser for X11 derived from the Mozilla browser
@ -6,10 +6,17 @@ firefox \- a Web browser for X11 derived from the Mozilla browser
.B firefox
[\fIOPTIONS\fR ...] [\fIURL\fR]
.B firefox-bin
[\fIOPTIONS\fR] [\fIURL\fR]
.SH DESCRIPTION
\fBMozilla Firefox\fR is an open-source web browser, designed for
standards compliance, performance and portability.
.SH USAGE
\fBfirefox\fR is a simple shell script that will set up the
environment for the actual executable, \fBfirefox-bin\fR.
.SH OPTIONS
A summary of the options supported by \fBfirefox\fR is included below.
@ -26,10 +33,10 @@ Make all warnings fatal
.SS "Firefox options"
.TP
.B \-h, \--help
.B \-h, \-help
Show summary of options.
.TP
.B \-v, \--version
.B \-v, \-version
Print Firefox version.
.TP
\fB\-P\fR \fIprofile\fR
@ -56,22 +63,11 @@ Start with \fIlocale\fR resources as UI Locale.
\fB\-\-safe\-mode\fR
Disables extensions and themes for this session.
.TP
\fB\--allow-downgrade\fR
Allows downgrading a profile.
.TP
\fB\--MOZ_LOG\fR=\fImodules\fR
Treated as \fBMOZ_LOG\fR=\fImodules\fR environment variable, overrides it.
.TP
\fB\--MOZ_LOG_FILE\fR=\fIfile\fR
Treated as \fBMOZ_LOG_FILE\fR=\fIfile\fR environment variable, overrides it. If
MOZ_LOG_FILE is not specified as an argument or as an environment variable,
logging will be written to stdout.
.TP
\fB\-\-headless\fR
Run without a GUI.
.TP
\fB\-\-save-recordings\fR
Save recordings for all content processes to a directory.
\fB\-\-marionette\fR
Enable remote control server.
.TP
\fB\-\-browser\fR
Open a browser window.
@ -97,9 +93,8 @@ Width and optionally height of screenshot.
\fB\-\-search\fR \fIterm\fR
Search \fIterm\fR with your default search engine.
.TP
\fB\-\-setDefaultBrowser\fR
Set this app as the default browser.
.TP
\fB\-\-jsconsole\fR
Open the Browser Console.
.TP
@ -120,16 +115,19 @@ Record drawing for a given URL.
.TP
\fB\-\-recording-output\fR \fIfile\fR
Specify destination file for a drawing recording.
.TP
\fB\-\-setDefaultBrowser\fR
Set this app as the default browser.
.SH FILES
\fI/usr/bin/firefox\fR - shell script wrapping
\fBfirefox\fR
.br
\fI/usr/lib64/firefox/firefox\fR - \fBfirefox\fR
\fI/usr/lib64/firefox/firefox-bin\fR - \fBfirefox\fR
executable
.SH VERSION
68.0
57.0
.SH BUGS
To report a bug, please visit \fIhttp://bugzilla.mozilla.org/\fR

View file

@ -54,6 +54,6 @@
<screenshot>https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/firefox/c.png</screenshot>
</screenshots>
<releases>
<release version="__VERSION__" date="__DATE__"/>
<release version="__VERSION__"/>
</releases>
</component>

View file

@ -1,520 +1,47 @@
[Desktop Entry]
Version=1.0
Name=Firefox
Name[ach]=Firefox
Name[af]=Firefox
Name[an]=Firefox
Name[ar]=Firefox
Name[ast]=Firefox
Name[az]=Firefox
Name[be]=Firefox
Name[bg]=Firefox
Name[bn]=Firefox
Name[br]=Firefox
Name[bs]=Firefox
Name[ca]=Firefox
Name[ca_valencia]=Firefox
Name[cak]=Firefox
Name[cs]=Firefox
Name[cy]=Firefox
Name[da]=Firefox
Name[de]=Firefox
Name[dsb]=Firefox
Name[el]=Firefox
Name[en_CA]=Firefox
Name[en_GB]=Firefox
Name[eo]=Firefox
Name[es_AR]=Firefox
Name[es_CL]=Firefox
Name[es_ES]=Firefox
Name[es_MX]=Firefox
Name[et]=Firefox
Name[eu]=Firefox
Name[fa]=Firefox
Name[ff]=Firefox
Name[fi]=Firefox
Name[fr]=Firefox
Name[fur]=Firefox
Name[fy_NL]=Firefox
Name[ga_IE]=Firefox
Name[gd]=Firefox
Name[gl]=Firefox
Name[gn]=Firefox
Name[gu_IN]=Firefox
Name[he]=Firefox
Name[hi_IN]=Firefox
Name[hr]=Firefox
Name[hsb]=Firefox
Name[hu]=Firefox
Name[hy_AM]=Firefox
Name[ia]=Firefox
Name[id]=Firefox
Name[is]=Firefox
Name[it]=Firefox
Name[ja]=Firefox
Name[ka]=Firefox
Name[kab]=Firefox
Name[kk]=Firefox
Name[km]=Firefox
Name[kn]=Firefox
Name[ko]=Firefox
Name[lij]=Firefox
Name[lt]=Firefox
Name[lv]=Firefox
Name[mk]=Firefox
Name[mr]=Firefox
Name[ms]=Firefox
Name[my]=Firefox
Name[nb_NO]=Firefox
Name[ne_NP]=Firefox
Name[nl]=Firefox
Name[nn_NO]=Firefox
Name[oc]=Firefox
Name[pa_IN]=Firefox
Name[pl]=Firefox
Name[pt_BR]=Firefox
Name[pt_PT]=Firefox
Name[rm]=Firefox
Name[ro]=Firefox
Name[ru]=Firefox
Name[sat]=Firefox
Name[sc]=Firefox
Name[sco]=Firefox
Name[si]=Firefox
Name[sk]=Firefox
Name[skr]=Firefox
Name[sl]=Firefox
Name[son]=Firefox
Name[sq]=Firefox
Name[sr]=Firefox
Name[sv_SE]=Firefox
Name[szl]=Firefox
Name[ta]=Firefox
Name[te]=Firefox
Name[tg]=Firefox
Name[th]=Firefox
Name[tl]=Firefox
Name[tr]=Firefox
Name[trs]=Firefox
Name[uk]=Firefox
Name[ur]=Firefox
Name[uz]=Firefox
Name[vi]=Firefox
Name[xh]=Firefox
Name[zh_CN]=Firefox
Name[zh_TW]=Firefox
Comment=Browse the World Wide Web
Comment[ach]=Browse the World Wide Web
Comment[af]=Browse the World Wide Web
Comment[an]=Browse the World Wide Web
Comment[ar]=تصفح شبكة الوِب العالمية
Comment[ast]=Browse the World Wide Web
Comment[az]=Browse the World Wide Web
Comment[be]=Аглядайце Сеціва
Comment[bg]=Разгледайте световната мрежа
Comment[bn]=
Comment[br]=Ergerzhout ar World Wide Web
Comment[bs]=Pretražujte World Wide Web
Comment[ca]=Navegeu pel Web
Comment[ca_valencia]=Browse the World Wide Web
Comment[cak]=Tok chupam Word Wide Web
Comment[cs]=Prohlížení stránek World Wide Webu
Comment[cy]=Pori'r We Fyd Eang
Comment[da]=Brug internettet
Comment[de]=Im Internet surfen
Comment[dsb]=Pśeglědajśo World Wide Web
Comment[el]=Περιηγηθείτε στον παγκόσμιο ιστό
Comment[en_CA]=Browse the World Wide Web
Comment[en_GB]=Browse the World Wide Web
Comment[eo]=Retumi en la reto
Comment[es_AR]=Navegar la World Wide Web
Comment[es_CL]=Navegar por la World Wide Web
Comment[es_ES]=Navegar por la web
Comment[es_MX]=Navegar por la web
Comment[et]=Browse the World Wide Web
Comment[eu]=Arakatu World Wide Web-a
Comment[fa]=Browse the World Wide Web
Comment[ff]=Browse the World Wide Web
Comment[fi]=Selaa Internetiä
Comment[fr]=Naviguer sur le Web
Comment[fur]=Navighe sul Web
Comment[fy_NL]=Navigearje op it wrâldwide web
Comment[ga_IE]=Browse the World Wide Web
Comment[gd]=Rùraich lìon na cruinne
Comment[gl]=Navegar pola World Wide Web
Comment[gn]=Eikundaha World Wide Web rupi
Comment[gu_IN]=Browse the World Wide Web
Comment[he]=גלישה באינטרנט
Comment[hi_IN]=Browse the World Wide Web
Comment[hr]=Pregledaj World Wide Web
Comment[hsb]=Přehladajće World Wide Web
Comment[hu]=Böngésszen a világhálón
Comment[hy_AM]=Զննի՛ր համաշխարհային սարդոստայնը
Comment[ia]=Navigar sur le Web
Comment[id]=Jelajahi World Wide Web
Comment[is]=Vafraðu um veraldarvefinn
Comment[it]=Naviga sul Web
Comment[ja]=World Wide Web
Comment[ka]=
Comment[kab]=Inig deg Web
Comment[kk]=Ғаламторды шолу
Comment[km]=Browse the World Wide Web
Comment[kn]=Browse the World Wide Web
Comment[ko]=
Comment[lij]=Browse the World Wide Web
Comment[lt]=Browse the World Wide Web
Comment[lv]=Pārlūkojiet globālo tīmekli
Comment[mk]=Browse the World Wide Web
Comment[mr]=Browse the World Wide Web
Comment[ms]=Browse the World Wide Web
Comment[my]=Browse the World Wide Web
Comment[nb_NO]=Surf på nettet
Comment[ne_NP]=
Comment[nl]=Navigeren op het wereldwijde web
Comment[nn_NO]=Surf på nettet
Comment[oc]=Navegar pel Web
Comment[pa_IN]=
Comment[pl]=Przeglądaj Internet
Comment[pt_BR]=Navegue na World Wide Web
Comment[pt_PT]=Navegar na Internet
Comment[rm]=Navigar en il web
Comment[ro]=Browse the World Wide Web
Comment[ru]=Доступ в Интернет
Comment[sat]=World Wide Web
Comment[sc]=Nàviga su Web
Comment[sco]=Browse the World Wide Web
Comment[si]=
Comment[sk]=Prehľadávať web (www)
Comment[skr]=ورلڈ وائیڈ ویب براؤز کرو
Comment[sl]=Brskanje po svetovnem spletu
Comment[son]=Browse the World Wide Web
Comment[sq]=Shfletoni në World Wide Web
Comment[sr]=Истражите интернет
Comment[sv_SE]=Surfa på webben
Comment[szl]=Browse the World Wide Web
Comment[ta]=Browse the World Wide Web
Comment[te]= ిిి
Comment[tg]=Ба шабакаи ҷаҳонии Интернет дастрасӣ пайдо намоед
Comment[th]=
Comment[tl]=Browse the World Wide Web
Comment[tr]=Webde gezin
Comment[trs]=Gāchē nu ngà World Wide Web
Comment[uk]=Переглядайте всесвітню мережу
Comment[ur]=Browse the World Wide Web
Comment[uz]=Browse the World Wide Web
Comment[vi]=Duyt web trên toàn thế gii
Comment[xh]=Browse the World Wide Web
Comment[zh_CN]=
Comment[zh_TW]=
GenericName=Web Browser
GenericName[ach]=Web Browser
GenericName[af]=Web Browser
GenericName[an]=Web Browser
GenericName[ar]=متصفح الإنترنت
GenericName[ast]=Web Browser
GenericName[az]=Web Browser
GenericName[be]=Вэб-браўзер
GenericName[bg]=Уеб браузър
GenericName[bn]=
GenericName[br]=Merdeer Web
GenericName[bs]=Web pretraživač
GenericName[ca]=Navegador web
GenericName[ca_valencia]=Web Browser
GenericName[cak]=Web Okik'amaya'l
GenericName[cs]=Webový prohlížeč
GenericName[cy]=Porwr Gwe
GenericName[da]=Webbrowser
GenericName[de]=Internet-Browser
GenericName[dsb]=Webwobglědowak
GenericName[el]=Πρόγραμμα περιήγησης
GenericName[en_CA]=Web Browser
GenericName[en_GB]=Web Browser
GenericName[eo]=Retumilo
GenericName[es_AR]=Navegador web
GenericName[es_CL]=Navegador Web
GenericName[es_ES]=Navegador web
GenericName[es_MX]=Navegador Web
GenericName[et]=Web Browser
GenericName[eu]=Web nabigatzailea
GenericName[fa]=Web Browser
GenericName[ff]=Web Browser
GenericName[fi]=Verkkoselain
GenericName[fr]=Navigateur web
GenericName[fur]=Navigadôr Web
GenericName[fy_NL]=Webbrowser
GenericName[ga_IE]=Web Browser
GenericName[gd]=Brabhsair-lìn
GenericName[gl]=Navegador web
GenericName[gn]=Ñanduti Kundahára
GenericName[gu_IN]=Web Browser
GenericName[he]=דפדפן אינטרנט
GenericName[hi_IN]=Web Browser
GenericName[hr]=Web preglednik
GenericName[hsb]=Webwobhladowak
GenericName[es]=Navegador web
GenericName[fa]=مرورگر اینترنتی
GenericName[fi]=WWW-selain
GenericName[fr]=Navigateur Web
GenericName[hu]=Webböngésző
GenericName[hy_AM]=Վեբ դիտարկիչ
GenericName[ia]=Navigator web
GenericName[id]=Peramban Web
GenericName[is]=Vafri
GenericName[it]=Browser web
GenericName[ja]=
GenericName[ka]=
GenericName[kab]=Iminig web
GenericName[kk]=Веб-браузері
GenericName[km]=Web Browser
GenericName[kn]=Web Browser
GenericName[it]=Browser Web
GenericName[ja]=
GenericName[ko]=
GenericName[lij]=Navegatô Web
GenericName[lt]=Web Browser
GenericName[lv]=Tīmekļa pārlūks
GenericName[mk]=Web Browser
GenericName[mr]=Web Browser
GenericName[ms]=Web Browser
GenericName[my]=Web Browser
GenericName[nb_NO]=Nettleser
GenericName[ne_NP]=
GenericName[nb]=Nettleser
GenericName[nl]=Webbrowser
GenericName[nn_NO]=Nettlesar
GenericName[oc]=Navegador Web
GenericName[pa_IN]=
GenericName[pl]=Przeglądarka internetowa
GenericName[pt_BR]=Navegador web
GenericName[pt_PT]=Navegador Web
GenericName[rm]=Navigatur web
GenericName[ro]=Web Browser
GenericName[ru]=Веб-браузер
GenericName[sat]=
GenericName[sc]=Navigadore web
GenericName[sco]=Web Browser
GenericName[si]=
GenericName[sk]=Webový prehliadač
GenericName[skr]=ویب براؤزر
GenericName[sl]=Spletni brskalnik
GenericName[son]=Web Browser
GenericName[sq]=Shfletues
GenericName[sr]=Веб прегледач
GenericName[sv_SE]=Webbläsare
GenericName[szl]=Web Browser
GenericName[ta]=Web Browser
GenericName[te]= ిిి
GenericName[tg]=Браузери веб
GenericName[th]=
GenericName[tl]=Web Browser
GenericName[tr]=Web Tarayıcısı
GenericName[trs]=Web riña gāchē nu
GenericName[uk]=Браузер
GenericName[ur]=Web Browser
GenericName[uz]=Web Browser
GenericName[vi]=Trình duyt web
GenericName[xh]=Web Browser
GenericName[zh_CN]=Web
GenericName[zh_TW]=
Keywords=Internet;WWW;Browser;Web;Explorer;
Keywords[ach]=Internet;WWW;Browser;Web;Explorer;
Keywords[af]=Internet;WWW;Browser;Web;Explorer;
Keywords[an]=Internet;WWW;Browser;Web;Explorer;
Keywords[ar]=إنترنت;WWW;متصفح;ويب;مستكشف;
Keywords[ast]=Internet;WWW;Browser;Web;Explorer;
Keywords[az]=Internet;WWW;Browser;Web;Explorer;
Keywords[be]=Internet;WWW;Browser;Web;Explorer;
Keywords[bg]=Internet;WWW;Browser;Web;Explorer;
Keywords[bn]=;WWW;;;;
Keywords[br]=Internet;WWW;Merdeer;Web;Ergerzhout;
Keywords[bs]=Internet;WWW;Pretraživač;Web;Istraživač;
Keywords[ca]=Internet;WWW;Browser;Web;Explorador;Navegador;
Keywords[ca_valencia]=Internet;WWW;Browser;Web;Explorer;
Keywords[cak]=K'amaya'l;WWW;Okik'amaya'l;Kanob'äl;
Keywords[cs]=internet;WWW;prohlížeč;web;
Keywords[cy]=Rhyngrwyd;WWW;Porwr;Gwe;Archwiliwr;
Keywords[da]=Internet;WWW;Browser;Nettet;Explorer;
Keywords[de]=Internet;WWW;Browser;Web;Explorer;
Keywords[dsb]=Internet;WWW;wobglědowak;Web;Explorer;
Keywords[el]=Internet;WWW;Browser;Web;Explorer;Διαδίκτυο;Ιστός;Ίντερνετ;
Keywords[en_CA]=Internet;WWW;Browser;Web;Explorer;
Keywords[en_GB]=Internet;WWW;Browser;Web;Explorer;
Keywords[eo]=Interreto;Retumilo;TTT;Teksaĵo;Reto;Internet;WWW;Browser;Web;Explorer;
Keywords[es_AR]=Internet;WWW;Navegador;Web;Explorador;
Keywords[es_CL]=Internet;WWW;Navegador;Web;Explorador;
Keywords[es_ES]=Internet;WWW;Navegador;Web;Explorador;
Keywords[es_MX]=Internet;WWW;Navegador;Web;Explorador;
Keywords[et]=Internet;WWW;Browser;Web;Explorer;
Keywords[eu]=Internet;WWW;Nabigatzailea;Web;Arakatzailea;
Keywords[fa]=Internet;WWW;Browser;Web;Explorer;
Keywords[ff]=Internet;WWW;Browser;Web;Explorer;
Keywords[fi]=Internet;WWW;Browser;Web;Explorer;netti;webbi;selain;
Keywords[fr]=Internet;WWW;Navigateur;Web;Explorer;
Keywords[fur]=Internet;WWW;Browser;Navigadôr;Web;Esploradôr;Explorer;
Keywords[fy_NL]=Ynternet;WWW;Browser;Web;Ferkenner;
Keywords[ga_IE]=Internet;WWW;Browser;Web;Explorer;
Keywords[gd]=Internet;WWW;Browser;Web;Explorer;eadar-lìon;brabhsair;brobhsair;lìon;taisgealaiche;
Keywords[gl]=Internet;WWW;Navegador;Web;Explorador;
Keywords[gn]=Internet;WWW;Browser;Web;Explorer;
Keywords[gu_IN]=Internet;WWW;Browser;Web;Explorer;
Keywords[he]=אינטרנט;WWW;דפדפן;רשת;סייר;מרשתת;
Keywords[hi_IN]=Internet;WWW;Browser;Web;Explorer;
Keywords[hr]=Internet;WWW;Preglednik;Web;Istraživač;
Keywords[hsb]=Internet;WWW;wobhladowak;Web;Explorer;
Keywords[hu]=Internet;WWW;Böngésző;Web;Világháló;
Keywords[hy_AM]=Համացանց,WWW,Զննիչ,Վեբ,Ցանցախույզ:
Keywords[ia]=Internet;WWW;Navigator;Web;Explorator;
Keywords[id]=Internet;WWW;Browser;Web;Explorer;
Keywords[is]=Internet;WWW; Vafri; Vefur; Explorer;
Keywords[it]=Internet;WWW;Browser;Web;Explorer;Navigatore;
Keywords[ja]=Internet;WWW;Browser;Web;Explorer;;;;
Keywords[ka]=;WWW;;; ;
Keywords[kab]=Internet;WWW;Browser;Web;Explorer;
Keywords[kk]=Internet;WWW;Browser;Web;Explorer;Интернет;Ғаламтор;Браузер;Желі;Шолғыш;
Keywords[km]=Internet;WWW;Browser;Web;Explorer;
Keywords[kn]=Internet;WWW;Browser;Web;Explorer;
Keywords[ko]=;;;;Internet;WWW;Browser;Web;Explorer;
Keywords[lij]=Internet;WWW;Browser;Web;Explorer;Navegatô;
Keywords[lt]=Internet;WWW;Browser;Web;Explorer;
Keywords[lv]=Internets;WWW;Pārlūkprogramma;Tīmeklis;
Keywords[mk]=Internet;WWW;Browser;Web;Explorer;
Keywords[mr]=Internet;WWW;Browser;Web;Explorer;
Keywords[ms]=Internet;WWW;Browser;Web;Explorer;
Keywords[my]=Internet;WWW;Browser;Web;Explorer;
Keywords[nb_NO]=Internett;WWW;Nettleser;Web;Utforsker;
Keywords[ne_NP]=Internet;WWW;Browser;Web;Explorer;
Keywords[nl]=Internet;WWW;Browser;Web;Verkenner;
Keywords[nn_NO]=Internett;WWW;Nettlesar;Web;Utforskar;
Keywords[oc]=Internet;WWW;Navegador;Navigador;Navegator;Navigator;Web;Explorer;
Keywords[pa_IN]=;WWW;;;;;;
Keywords[pl]=Internet;WWW;Przeglądarka;Browser;Wyszukiwarka;Web;Sieć;Explorer;Eksplorer;Strony;Witryny;internetowe;
Keywords[pt_BR]=Internet;WWW;Browser;Web;Explorer;Navegador;
Keywords[pt_PT]=Internet;WWW;Navegador;Web;Explorador;
Keywords[rm]=Internet;WWW;Browser;Web;Explorer;navigatur;
Keywords[ro]=Internet;WWW;Browser;Web;Explorer;
Keywords[ru]=Сеть;Интернет;Браузер;Доступ в Интернет;
Keywords[sat]=Internet;WWW;Browser;Web;Explorer;
Keywords[sc]=Internet;WWW;Navigadore;Web;Explorer;
Keywords[sco]=Internet;WWW;Browser;Web;Explorer;
Keywords[si]=;;;;Internet;WWW;Browser;Web;Explorer;
Keywords[sk]=Internet;WWW;Prehliadač;Web;Prieskumník;
Keywords[skr]=Internet;WWW;Browser;Web;Explorer;
Keywords[sl]=internet;www;brskalnik;splet;
Keywords[son]=Internet;WWW;Browser;Web;Explorer;
Keywords[sq]=Internet;WWW;Shfletues;Web;Eksplorues;
Keywords[sr]=Internet;WWW;Browser;Web;Explorer;интернет;прегледач;веб;мрежа;прегледач;
Keywords[sv_SE]=Internet;WWW;Webbläsare;Webb;Utforskare;
Keywords[szl]=Internet;WWW;Browser;Web;Explorer;
Keywords[ta]=Internet;WWW;Browser;Web;Explorer;
Keywords[te]=Internet;WWW;Browser;Web;Explorer;
Keywords[tg]=Интернет;WWW;Браузер;Сомона;Ҷустуҷӯгар;
Keywords[th]=;;;Internet;WWW;Browser;Web;Explorer;
Keywords[tl]=Internet;WWW;Browser;Web;Explorer;
Keywords[tr]=Internet;WWW;Browser;Web;Explorer;İnternet;Tarayıcı;
Keywords[trs]=Internet;WWW;Browser;Web;Explorer;
Keywords[uk]=Інтернет;WWW;Браузер;Веб;Переглядач;
Keywords[ur]=Internet;WWW;Browser;Web;Explorer;
Keywords[uz]=Internet;WWW;Browser;Web;Explorer;
Keywords[vi]=Internet;WWW;Trình duyt;Web;Duyt web;
Keywords[xh]=Internet;WWW;Browser;Web;Explorer;
Keywords[zh_CN]=Internet;WWW;Browser;Web;Explorer;
Keywords[zh_TW]=;;;;;Internet;WWW;Browser;Web;Explorer;
X-GNOME-FullName=Firefox Web Browser
X-GNOME-FullName[ach]=Firefox Web Browser
X-GNOME-FullName[af]=Firefox Web Browser
X-GNOME-FullName[an]=Firefox Web Browser
X-GNOME-FullName[ar]=متصفح Firefox
X-GNOME-FullName[ast]=Firefox Web Browser
X-GNOME-FullName[az]=Firefox Web Browser
X-GNOME-FullName[be]=Вэб-браўзер Firefox
X-GNOME-FullName[bg]=Firefox Уеб браузър
X-GNOME-FullName[bn]=Firefox Web Browser
X-GNOME-FullName[br]=Merdeer Web Firefox
X-GNOME-FullName[bs]=Firefox web pretraživač
X-GNOME-FullName[ca]=Navegador web Firefox
X-GNOME-FullName[ca_valencia]=Firefox Web Browser
X-GNOME-FullName[cak]=Firefox Web Browser
X-GNOME-FullName[cs]=Webový prohlížeč Firefox
X-GNOME-FullName[cy]=Porwr Gwe Firefox
X-GNOME-FullName[da]=Firefox-browser
X-GNOME-FullName[de]=Firefox-Web-Browser
X-GNOME-FullName[dsb]=Webwobglědowak Firefox
X-GNOME-FullName[el]=Πρόγραμμα περιήγησης Firefox
X-GNOME-FullName[en_CA]=Firefox Web Browser
X-GNOME-FullName[en_GB]=Firefox Web Browser
X-GNOME-FullName[eo]=Retumilo Firefox
X-GNOME-FullName[es_AR]=Navegador web Firefox
X-GNOME-FullName[es_CL]=Navegador web Firefox
X-GNOME-FullName[es_ES]=Navegador web Firefox
X-GNOME-FullName[es_MX]=Navegador web Firefox
X-GNOME-FullName[et]=Firefox Web Browser
X-GNOME-FullName[eu]=Firefox web nabigatzailea
X-GNOME-FullName[fa]=Firefox Web Browser
X-GNOME-FullName[ff]=Firefox Web Browser
X-GNOME-FullName[fi]=Firefox-verkkoselain
X-GNOME-FullName[fr]=Navigateur web Firefox
X-GNOME-FullName[fur]=Navigadôr web Firefox
X-GNOME-FullName[fy_NL]=Firefox-webbrowser
X-GNOME-FullName[ga_IE]=Firefox Web Browser
X-GNOME-FullName[gd]=Brabhsair-lìn Firefox
X-GNOME-FullName[gl]=Navegador web Firefox
X-GNOME-FullName[gn]=Firefox Ñanduti Kundahára
X-GNOME-FullName[gu_IN]=Firefox Web Browser
X-GNOME-FullName[he]=דפדפן אינטרנט Firefox
X-GNOME-FullName[hi_IN]=Firefox
X-GNOME-FullName[hr]=Firefox web preglednik
X-GNOME-FullName[hsb]=Webwobhladowak Firefox
X-GNOME-FullName[hu]=Firefox webböngésző
X-GNOME-FullName[hy_AM]=Firefox վեբ դիտարկիչ
X-GNOME-FullName[ia]=Navigator web Firefox
X-GNOME-FullName[id]=Firefox Peramban Web
X-GNOME-FullName[is]=Firefox-vafri
X-GNOME-FullName[it]=Browser web Firefox
X-GNOME-FullName[ja]=Firefox
X-GNOME-FullName[ka]=Firefox-
X-GNOME-FullName[kab]=Iminig web Firefox
X-GNOME-FullName[kk]=Firefox веб-браузері
X-GNOME-FullName[km]=Firefox Web Browser
X-GNOME-FullName[kn]=Firefox Web Browser
X-GNOME-FullName[ko]=Firefox
X-GNOME-FullName[lij]=Firefox Navegatô Web
X-GNOME-FullName[lt]=Firefox Web Browser
X-GNOME-FullName[lv]=Firefox tīmekļa pārlūks
X-GNOME-FullName[mk]=Firefox Web Browser
X-GNOME-FullName[mr]=Firefox Web Browser
X-GNOME-FullName[ms]=Firefox Web Browser
X-GNOME-FullName[my]=Firefox Web Browser
X-GNOME-FullName[nb_NO]=Firefox-nettleser
X-GNOME-FullName[ne_NP]=Firefox
X-GNOME-FullName[nl]=Firefox-webbrowser
X-GNOME-FullName[nn_NO]=Firefox-nettlesar
X-GNOME-FullName[oc]=Navegador web Firefox
X-GNOME-FullName[pa_IN]=Firefox
X-GNOME-FullName[pl]=Przeglądarka Firefox
X-GNOME-FullName[pt_BR]=Navegador web Firefox
X-GNOME-FullName[pt_PT]=Navegador Web Firefox
X-GNOME-FullName[rm]=Navigatur-web Firefox
X-GNOME-FullName[ro]=Firefox Web Browser
X-GNOME-FullName[ru]=Веб-браузер Firefox
X-GNOME-FullName[sat]=Firefox
X-GNOME-FullName[sc]=Navigadore web Firefox
X-GNOME-FullName[sco]=Firefox Web Browser
X-GNOME-FullName[si]=Firefox
X-GNOME-FullName[sk]=Webový prehliadač Firefox
X-GNOME-FullName[skr]=Firefox ویب براؤزر
X-GNOME-FullName[sl]=Spletni brskalnik Firefox
X-GNOME-FullName[son]=Firefox Web Browser
X-GNOME-FullName[sq]=Shfletuesi Firefox
X-GNOME-FullName[sr]=Firefox веб прегледач
X-GNOME-FullName[sv_SE]=Firefox webbläsare
X-GNOME-FullName[szl]=Firefox Web Browser
X-GNOME-FullName[ta]=Firefox Web Browser
X-GNOME-FullName[te]=Firefox Web Browser
X-GNOME-FullName[tg]=Браузери интернетии «Firefox»
X-GNOME-FullName[th]= Firefox
X-GNOME-FullName[tl]=Firefox Web Browser
X-GNOME-FullName[tr]=Firefox Web Tarayıcısı
X-GNOME-FullName[trs]=Firefox Web riña gāchē nu
X-GNOME-FullName[uk]=Браузер Firefox
X-GNOME-FullName[ur]=Firefox Web Browser
X-GNOME-FullName[uz]=Firefox Web Browser
X-GNOME-FullName[vi]=Trình duyt Web Firefox
X-GNOME-FullName[xh]=Firefox Web Browser
X-GNOME-FullName[zh_CN]=Firefox
X-GNOME-FullName[zh_TW]=Firefox
GenericName[nn]=Nettlesar
GenericName[no]=Nettleser
GenericName[pl]=Przeglądarka WWW
GenericName[pt]=Navegador Web
GenericName[pt_BR]=Navegador Web
GenericName[sk]=Internetový prehliadač
GenericName[sv]=Webbläsare
Comment=Browse the Web
Comment[ca]=Navegueu per el web
Comment[cs]=Prohlížení stránek World Wide Webu
Comment[de]=Im Internet surfen
Comment[es]=Navegue por la web
Comment[fa]=صفحات شبکه جهانی اینترنت را مرور نمایید
Comment[fi]=Selaa Internetin WWW-sivuja
Comment[fr]=Navigue sur Internet
Comment[hu]=A világháló böngészése
Comment[it]=Esplora il web
Comment[ja]=
Comment[ko]=
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[sk]=Prehliadanie internetu
Comment[sv]=Surfa på webben
Exec=firefox %u
Icon=firefox
Terminal=false
@ -522,324 +49,223 @@ Type=Application
MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https;
StartupNotify=true
Categories=Network;WebBrowser;
Actions=new-window;new-private-window;profile-manager-window;
# Activable desktop file crashes KDE so remove it for now
# DBusActivatable=true
Keywords=web;browser;internet;
Actions=new-window;new-private-window;
[Desktop Action new-window]
Name=New Window
Name[ach]=New Window
Name[af]=New Window
Name[an]=New Window
Name=Open a New Window
Name[ach]=Dirica manyen
Name[af]=Nuwe venster
Name[an]=Nueva finestra
Name[ar]=نافذة جديدة
Name[ast]=New Window
Name[az]=New Window
Name[as]=
Name[ast]=Ventana nueva
Name[az]=Yeni Pəncərə
Name[be]=Новае акно
Name[bg]=Нов прозорец
Name[bn]=
Name[bn_BD]= (N)
Name[bn_IN]=
Name[br]=Prenestr nevez
Name[brx]= '(N)
Name[bs]=Novi prozor
Name[ca]=Finestra nova
Name[ca_valencia]=New Window
Name[cak]=K'ak'a' Tzuwäch
Name[cak]=K'ak'a' tzuwäch
Name[cs]=Nové okno
Name[cy]=Ffenestr Newydd
Name[da]=Nyt vindue
Name[de]=Neues Fenster
Name[dsb]=Nowe wokno
Name[el]=Νέο παράθυρο
Name[en_CA]=New Window
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]=New Window
Name[et]=Uus aken
Name[eu]=Leiho berria
Name[fa]=پنجره جدید
Name[ff]=New Window
Name[ff]=Henorde Hesere
Name[fi]=Uusi ikkuna
Name[fr]=Nouvelle fenêtre
Name[fur]=Gnûf barcon
Name[fy_NL]=Nij finster
Name[ga_IE]=New Window
Name[ga_IE]=Fuinneog Nua
Name[gd]=Uinneag ùr
Name[gl]=Nova xanela
Name[gn]=Ovetã pyahu
Name[gu_IN]=New Window
Name[gu_IN]= િ
Name[he]=חלון חדש
Name[hi_IN]=New Window
Name[hi_IN]= ि
Name[hr]=Novi prozor
Name[hsb]=Nowe wokno
Name[hu]=Új ablak
Name[hy_AM]=Նոր պատուհան
Name[ia]=Nove fenestra
Name[hy_AM]=Նոր Պատուհան
Name[id]=Jendela Baru
Name[is]=Nýr gluggi
Name[it]=Nuova finestra
Name[ja]=
Name[ja_JP-mac]=
Name[ka]=
Name[kab]=Asfaylu amaynut
Name[kk]=Жаңа терезе
Name[km]=New Window
Name[kn]=New Window
Name[km]=
Name[kn]= ಿಿ
Name[ko]=
Name[lij]=Neuvo Barcon
Name[lt]=New Window
Name[kok]=
Name[ks]=نئئ وِنڈو
Name[lij]=Neuvo barcon
Name[lo]=
Name[lt]=Naujas langas
Name[ltg]=Jauns lūgs
Name[lv]=Jauns logs
Name[mk]=New Window
Name[mr]=New Window
Name[ms]=New Window
Name[my]=New Window
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[oc]=Fenèstra novèla
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]=New Window
Name[ro]=Fereastră nouă
Name[ru]=Новое окно
Name[sat]=
Name[sc]=Ventana noa
Name[sco]=New Window
Name[si]=
Name[sat]= ि (N)
Name[si]=
Name[sk]=Nové okno
Name[skr]=نویں ونڈو
Name[sl]=Novo okno
Name[son]=New Window
Name[son]=Zanfun taaga
Name[sq]=Dritare e Re
Name[sr]=Нови прозор
Name[sv_SE]=Nytt fönster
Name[szl]=New Window
Name[ta]=New Window
Name[te]= ిి
Name[tg]=Равзанаи нав
Name[ta]=ி
Name[te]= ి
Name[th]=
Name[tl]=New Window
Name[tr]=Yeni pencere
Name[trs]=Bēntanâ nākàa
Name[tsz]=Eraatarakua jimpani
Name[uk]=Нове вікно
Name[ur]=New Window
Name[uz]=New Window
Name[ur]=نیا دریچہ
Name[uz]=Yangi oyna
Name[vi]=Ca s mi
Name[xh]=New Window
Name[wo]=Palanteer bu bees
Name[xh]=Ifestile entsha
Name[zh_CN]=
Name[zh_TW]=
Exec=firefox --new-window %u
[Desktop Action new-private-window]
Name=New Private Window
Name[ach]=New Private Window
Name[af]=New Private Window
Name[an]=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[ast]=New Private Window
Name[az]=New Private Window
Name[be]=Новае прыватнае акно
Name[bg]=Нов личен прозорец
Name[bn]= ি
Name[br]=Prenestr prevez nevez
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[ca_valencia]=New Private Window
Name[cak]=K'ak'a' Ichinan Tzuwäch
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_CA]=New Private Window
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]=New Private Window
Name[et]=Uus privaatne aken
Name[eu]=Leiho pribatu berria
Name[fa]=پنجره ناشناس جدید
Name[ff]=New Private Window
Name[ff]=Henorde Suturo Hesere
Name[fi]=Uusi yksityinen ikkuna
Name[fr]=Nouvelle fenêtre privée
Name[fur]=Gnûf barcon privât
Name[fr]=Nouvelle fenêtre de navigation privée
Name[fy_NL]=Nij priveefinster
Name[ga_IE]=New Private Window
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]=New Private Window
Name[gu_IN]= િ
Name[he]=חלון פרטי חדש
Name[hi_IN]=New Private Window
Name[hi_IN]= ि ि
Name[hr]=Novi privatni prozor
Name[hsb]=Nowe priwatne wokno
Name[hu]=Új privát ablak
Name[hy_AM]=Նոր գաղտնի պատուհան
Name[ia]=Nove fenestra private
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[kab]=Asfaylu amaynut n tunigin tusligt
Name[kk]=Жаңа жекелік терезе
Name[km]=New Private Window
Name[kn]=New Private Window
Name[ko]=
Name[lij]=Neuvo Barcon Privòu
Name[lt]=New Private Window
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[mk]=New Private Window
Name[mr]=New Private Window
Name[ms]=New Private Window
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[oc]=Fenèstra privada novèla
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]=New Private Window
Name[ro]=Fereastră privată nouă
Name[ru]=Новое приватное окно
Name[sat]=
Name[sc]=Ventana privada noa
Name[sco]=New Private Window
Name[si]= .
Name[sk]=Nové súkromné okno
Name[skr]=نویں نجی ونڈو
Name[sat]= ि ि (W )
Name[si]= (W)
Name[sk]=Nové okno v režime Súkromné prehliadanie
Name[sl]=Novo zasebno okno
Name[son]=New Private Window
Name[son]=Sutura zanfun taaga
Name[sq]=Dritare e Re Private
Name[sr]=Нови приватни прозор
Name[sr]=Нови приватан прозор
Name[sv_SE]=Nytt privat fönster
Name[szl]=New Private Window
Name[ta]=New Private Window
Name[te]= ి ిి
Name[tg]=Равзанаи хусусии нав
Name[ta]=ி ி
Name[te]= ి ి
Name[th]=
Name[tl]=New Private Window
Name[tr]=Yeni gizli pencere
Name[trs]=Bēntanâ huì nākàa
Name[tsz]=Juchiiti eraatarakua jimpani
Name[uk]=Приватне вікно
Name[ur]=New Private Window
Name[uz]=New Private Window
Name[ur]=نیا نجی دریچہ
Name[uz]=Yangi maxfiy oyna
Name[vi]=Ca s riêng tư mi
Name[xh]=New Private Window
Name[zh_CN]=
Name[zh_TW]=
Name[wo]=Panlanteeru biir bu bees
Name[xh]=Ifestile yangasese entsha
Name[zh_CN]=
Name[zh_TW]=
Exec=firefox --private-window %u
[Desktop Action open-profile-manager]
Name=Open Profile Manager
Name[ach]=Open Profile Manager
Name[af]=Open Profile Manager
Name[an]=Open Profile Manager
Name[ar]=افتح مدير الملف الشخصي
Name[ast]=Open Profile Manager
Name[az]=Open Profile Manager
Name[be]=Адкрыць менеджар профіляў
Name[bg]=Отваряне на мениджъра на профили
Name[bn]=Open Profile Manager
Name[br]=Digeriñ an ardoer aeladoù
Name[bs]=Otvori Menadžera profila
Name[ca]=Obre el gestor de perfils
Name[ca_valencia]=Open Profile Manager
Name[cak]=Open Profile Manager
Name[cs]=Otevřete Správce profilů
Name[cy]=Agorwch y Rheolwr Proffil
Name[da]=Åbn profilhåndtering
Name[de]=Profilverwaltung öffnen
Name[dsb]=Profilowy zastojnik wócyniś
Name[el]=Άνοιγμα Διαχείρισης προφίλ
Name[en_CA]=Open Profile Manager
Name[en_GB]=Open Profile Manager
Name[eo]=Malfermi administranton de profiloj
Name[es_AR]=Abrir administrador de perfiles
Name[es_CL]=Abrir administrador de perfiles
Name[es_ES]=Abrir administrador de perfiles
Name[es_MX]=Abrir administrador de perfiles
Name[et]=Open Profile Manager
Name[eu]=Ireki profilen kudeatzailea
Name[fa]=Open Profile Manager
Name[ff]=Open Profile Manager
Name[fi]=Avaa profiilien hallinta
Name[fr]=Ouvrir le gestionnaire de profils
Name[fur]=Vierç gjestôr profîi
Name[fy_NL]=Profylbehearder iepenje
Name[ga_IE]=Open Profile Manager
Name[gd]=Fosgail manaidsear nam pròifilean
Name[gl]=Abrir o xestor de perfís
Name[gn]=Embojuruja mbaete ñangarekoha
Name[gu_IN]=Open Profile Manager
Name[he]=פתיחת מנהל הפרופילים
Name[hi_IN]=Open Profile Manager
Name[hr]=Otvori upravljač profila
Name[hsb]=Zrjadowak profilow wočinić
Name[hu]=Profilkezelő megnyitása
Name[hy_AM]=Բացեք պրոֆիլի կառավարիչը
Name[ia]=Aperir le gestor de profilo
Name[id]=Buka Pengelola Profil
Name[is]=Opna umsýslu notandasniða
Name[it]=Apri gestore profili
Name[ja]=
Name[ka]=
Name[kab]=Ldi amsefrak n umaɣnu
Name[kk]=Профильдер бақарушысын ашу
Name[km]=Open Profile Manager
Name[kn]=Open Profile Manager
Name[ko]=
Name[lij]=Open Profile Manager
Name[lt]=Open Profile Manager
Name[lv]=Atvērt profilu pārvaldnieku
Name[mk]=Open Profile Manager
Name[mr]=Open Profile Manager
Name[ms]=Open Profile Manager
Name[my]=Open Profile Manager
Name[nb_NO]=Åpne profilbehandler
Name[ne_NP]=Open Profile Manager
Name[nl]=Profielbeheerder openen
Name[nn_NO]=Opne profilhandsaming
Name[oc]=Dobrir lo gestionari de perfils
Name[pa_IN]=
Name[pl]=Menedżer profili
Name[pt_BR]=Abrir gerenciador de perfis
Name[pt_PT]=Abrir o Gestor de Perfis
Name[rm]=Avrir l'administraziun da profils
Name[ro]=Open Profile Manager
Name[ru]=Открыть менеджер профилей
Name[sat]=
Name[sc]=Aberi su gestore de profilos
Name[sco]=Open Profile Manager
Name[si]=
Name[sk]=Otvoriť Správcu profilov
Name[skr]=پروفائل منیجر کھولو
Name[sl]=Odpri upravitelja profilov
Name[son]=Open Profile Manager
Name[sq]=Hapni Përgjegjës Profilesh
Name[sr]=Отворите управљач профила
Name[sv_SE]=Öppna Profilhanteraren
Name[szl]=Open Profile Manager
Name[ta]=Open Profile Manager
Name[te]=Open Profile Manager
Name[tg]=Кушодани мудири профилҳо
Name[th]=
Name[tl]=Open Profile Manager
Name[tr]=Profil yöneticisini aç
Name[trs]=Sa nīkāj ñuūnj nej perfî huā nìnï̀nj ïn
Name[uk]=Відкрити менеджер профілів
Name[ur]=Open Profile Manager
Name[uz]=Open Profile Manager
Name[vi]=M trình qun lý h sơ
Name[xh]=Open Profile Manager
Name[zh_CN]=
Name[zh_TW]=
Exec=firefox --ProfileManager

View file

@ -64,7 +64,16 @@ MOZ_DIST_BIN="$MOZ_LIB_DIR/firefox"
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"
GETENFORCE_FILE="/usr/sbin/getenforce"
MOZ_LAUNCHER="$MOZ_DIST_BIN/run-mozilla.sh"
##
## Enable Wayland backend?
##
if __DEFAULT_WAYLAND__ && ! [ $MOZ_DISABLE_WAYLAND ]; then
if [ "$XDG_CURRENT_DESKTOP" == "GNOME" ]; then
export MOZ_ENABLE_WAYLAND=1
fi
fi
##
## Use D-Bus remote exclusively when there's Wayland display.
@ -108,14 +117,10 @@ export MOZ_PLUGIN_PATH
export MOZ_APP_LAUNCHER="/__PREFIX__/bin/firefox"
##
## We want Firefox to use Openh264 provided by Fedora.
##
## We used to configure it here but It's set by /etc/profile.d/gmpopenh264.sh
## script from mozilla-openh264 package now. Let's keep it here just
## for the record.
##
## export MOZ_GMP_PATH=$MOZ_LIB_DIR/mozilla/plugins/gmp-gmpopenh264/system-installed
## Set FONTCONFIG_PATH for Xft/fontconfig
##
FONTCONFIG_PATH="/etc/fonts:${MOZILLA_FIVE_HOME}/res/Xft"
export FONTCONFIG_PATH
##
## In order to better support certain scripts (such as Indic and some CJK
@ -130,10 +135,21 @@ export MOZ_APP_LAUNCHER="/__PREFIX__/bin/firefox"
# export MOZ_DISABLE_PANGO
#
##
## Disable the GNOME crash dialog, Moz has it's own
##
GNOME_DISABLE_CRASH_DIALOG=1
export GNOME_DISABLE_CRASH_DIALOG
##
## Disable the SLICE allocator (rhbz#1014858)
##
export G_SLICE=always-malloc
##
## Enable Xinput2 (mozbz#1207973)
##
export MOZ_USE_XINPUT2=${MOZ_USE_XINPUT2-1}
export MOZ_USE_XINPUT2=1
# OK, here's where all the real work gets done
@ -158,19 +174,11 @@ MOZILLA_DOWN=0
if ! [ $MOZ_DISABLE_LANGPACKS ] || [ $MOZ_DISABLE_LANGPACKS -eq 0 ]; then
if [ -x $MOZ_DIST_BIN/$MOZ_FIREFOX_FILE ]; then
# Is firefox running?
/__PREFIX__/bin/pidof $MOZ_PROGRAM > /dev/null 2>&1
/__PREFIX__/bin/pidof firefox > /dev/null 2>&1
MOZILLA_DOWN=$?
fi
fi
# When Firefox is not running, restore SELinux labels for profile files
# (rhbz#1731371)
if [ $MOZILLA_DOWN -ne 0 ]; then
if [ -x $GETENFORCE_FILE ] && [ `$GETENFORCE_FILE` != "Disabled" ]; then
(restorecon -vr ~/.mozilla/firefox/*/gmp-widevinecdm/* &)
fi
fi
# Modify language pack configuration only when firefox is not running
# and language packs are not disabled
if [ $MOZILLA_DOWN -ne 0 ]; then
@ -203,17 +211,8 @@ if [ $MOZILLA_DOWN -ne 0 ]; then
if [ -h $MOZ_LANGPACKS_DIR/$langpack ]; then
langpack=`readlink $MOZ_LANGPACKS_DIR/$langpack`
fi
if [ -e "/run/ostree-booted" ]; then
# Files on Silverblue has file create time set to 0,
# so in case the langpack is updated Firefox does not
# check for changes because it compares the file
# creation date to do so.
cp -f $MOZ_LANGPACKS_DIR/$langpack \
$MOZ_EXTENSIONS_PROFILE_DIR/$langpack
else
ln -s $MOZ_LANGPACKS_DIR/$langpack \
$MOZ_EXTENSIONS_PROFILE_DIR/$langpack
fi
ln -s $MOZ_LANGPACKS_DIR/$langpack \
$MOZ_EXTENSIONS_PROFILE_DIR/$langpack
echo $MOZ_EXTENSIONS_PROFILE_DIR/$langpack > $FEDORA_LANGPACK_CONFIG
return 0
fi
@ -227,11 +226,34 @@ fi
NSS_SSL_CBC_RANDOM_IV=${NSS_SSL_CBC_RANDOM_IV-1}
export NSS_SSL_CBC_RANDOM_IV
# MOZ_APP_REMOTINGNAME links Firefox with desktop file name
if [ -z "$MOZ_APP_REMOTINGNAME" ]
then
export MOZ_APP_REMOTINGNAME=__APP_NAME__
fi
# Prepare command line arguments
script_args=""
pass_arg_count=0
while [ $# -gt $pass_arg_count ]
do
case "$1" in
-g | --debug)
script_args="$script_args -g"
debugging=1
shift
;;
-d | --debugger)
if [ $# -gt 1 ]; then
script_args="$script_args -d $2"
shift 2
else
shift
fi
;;
*)
# Move the unrecognized argument to the end of the list.
arg="$1"
shift
set -- "$@" "$arg"
pass_arg_count=`expr $pass_arg_count + 1`
;;
esac
done
# Flatpak specific environment variables
%FLATPAK_ENV_VARS%
@ -243,7 +265,7 @@ export MOZ_ALLOW_DOWNGRADE=1
debugging=0
if [ $debugging = 1 ]
then
echo $MOZ_PROGRAM "$@"
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

View file

@ -1,21 +0,0 @@
#!/bin/bash
if [ -z $1 ]; then
echo "Fixes .cargo-checksum.json by removing deleted files and recompute sha256sum"
echo "Usage: $0 .cargo-checksum.json"
exit
fi
FILE=$1
#set -x
cp $FILE $1.backup
for i in $(cat .cargo-checksum.json|jq -r '.files| keys[]'); do
if [ ! -f $i ]; then
#echo $i non exist
sed -ie "s|\"$i\":\"[^\"]*\",||" $FILE
else
SHA=`sha256sum $i | cut -d " " -f1`
sed -ie "s|\"$i\":\"[^\"]*\"|\"$i\":\"$SHA\"|" $FILE
fi
#echo $i
done

View file

@ -12,7 +12,7 @@ to be used with 'cargo vendor' commmand.
"""
[dependencies]
cbindgen = "0.29.1"
cbindgen = "0.13.0"
[[bin]]
name = "dummy"

View file

@ -1,33 +0,0 @@
#!/bin/bash
set -x
# Dummy Cargo.toml file with cbindgen dependency
cat > Cargo.toml <<EOL
[package]
name = "dummy"
version = "0.0.1"
description = """
This is a dummy package which contains dependency on cbindgen
to be used with 'cargo vendor' commmand.
"""
[dependencies]
dump_syms = "=2.3.2"
time = "0.3.36"
[[bin]]
name = "dummy"
path = "dummy.rs"
doc = false
EOL
cargo install cargo-vendor
cargo vendor
cd vendor
tar -cJf ../dump_syms-vendor.tar.xz *
cd ..
rm -f Cargo.toml
rm -rf vendor

View file

@ -1 +0,0 @@
AIzaSyB2h2OuRcUgy5N-5hsZqiPW6sH3n_rptiQ

12
kiosk-workaround.patch Normal file
View file

@ -0,0 +1,12 @@
diff -up firefox-71.0/browser/base/content/browser.css.old firefox-71.0/browser/base/content/browser.css
--- firefox-71.0/browser/base/content/browser.css.old 2019-12-04 18:15:20.059908708 +0100
+++ firefox-71.0/browser/base/content/browser.css 2019-12-04 18:15:23.181905115 +0100
@@ -841,7 +841,7 @@ window[chromehidden~="toolbar"] toolbar:
/* Full Screen UI */
#fullscr-toggler {
- height: 1px;
+ height: 0px;
background: black;
}

99
mozilla-1170092.patch Normal file
View file

@ -0,0 +1,99 @@
diff -up firefox-75.0/extensions/pref/autoconfig/src/nsReadConfig.cpp.1170092 firefox-75.0/extensions/pref/autoconfig/src/nsReadConfig.cpp
--- firefox-75.0/extensions/pref/autoconfig/src/nsReadConfig.cpp.1170092 2020-04-03 21:34:41.000000000 +0200
+++ firefox-75.0/extensions/pref/autoconfig/src/nsReadConfig.cpp 2020-04-06 22:40:02.760674871 +0200
@@ -244,8 +244,20 @@ nsresult nsReadConfig::openAndEvaluateJS
if (NS_FAILED(rv)) return rv;
rv = NS_NewLocalFileInputStream(getter_AddRefs(inStr), jsFile);
- if (NS_FAILED(rv)) return rv;
+ if (NS_FAILED(rv)) {
+ // Look for cfg file in /etc/<application>/pref
+ rv = NS_GetSpecialDirectory(NS_APP_PREFS_SYSTEM_CONFIG_DIR,
+ getter_AddRefs(jsFile));
+ NS_ENSURE_SUCCESS(rv, rv);
+
+ rv = jsFile->AppendNative(NS_LITERAL_CSTRING("pref"));
+ NS_ENSURE_SUCCESS(rv, rv);
+ rv = jsFile->AppendNative(nsDependentCString(aFileName));
+ NS_ENSURE_SUCCESS(rv, rv);
+ rv = NS_NewLocalFileInputStream(getter_AddRefs(inStr), jsFile);
+ NS_ENSURE_SUCCESS(rv, rv);
+ }
} else {
nsAutoCString location("resource://gre/defaults/autoconfig/");
location += aFileName;
diff -up firefox-75.0/modules/libpref/Preferences.cpp.1170092 firefox-75.0/modules/libpref/Preferences.cpp
--- firefox-75.0/modules/libpref/Preferences.cpp.1170092 2020-04-06 22:40:02.761674865 +0200
+++ firefox-75.0/modules/libpref/Preferences.cpp 2020-04-06 22:40:57.675325227 +0200
@@ -4468,6 +4468,9 @@ nsresult Preferences::InitInitialObjects
//
// Thus, in the omni.jar case, we always load app-specific default
// preferences from omni.jar, whether or not `$app == $gre`.
+ //
+ // At very end load configuration from system config location:
+ // - /etc/firefox/pref/*.js
nsresult rv = NS_ERROR_FAILURE;
UniquePtr<nsZipFind> find;
diff -up firefox-75.0/toolkit/xre/nsXREDirProvider.cpp.1170092 firefox-75.0/toolkit/xre/nsXREDirProvider.cpp
--- firefox-75.0/toolkit/xre/nsXREDirProvider.cpp.1170092 2020-04-03 21:35:39.000000000 +0200
+++ firefox-75.0/toolkit/xre/nsXREDirProvider.cpp 2020-04-06 22:40:02.761674865 +0200
@@ -60,6 +60,7 @@
#endif
#ifdef XP_UNIX
# include <ctype.h>
+# include "nsIXULAppInfo.h"
#endif
#ifdef XP_IOS
# include "UIKitDirProvider.h"
@@ -533,6 +534,21 @@ nsXREDirProvider::GetFile(const char* aP
}
}
}
+
+#if defined(XP_UNIX)
+ if (!strcmp(aProperty, NS_APP_PREFS_SYSTEM_CONFIG_DIR)) {
+ nsCString sysConfigDir = NS_LITERAL_CSTRING("/etc/");
+ nsCOMPtr<nsIXULAppInfo> appInfo = do_GetService("@mozilla.org/xre/app-info;1");
+ if (!appInfo)
+ return NS_ERROR_NOT_AVAILABLE;
+ nsCString appName;
+ appInfo->GetName(appName);
+ ToLowerCase(appName);
+ sysConfigDir.Append(appName);
+ return NS_NewNativeLocalFile(sysConfigDir, false, aFile);
+ }
+#endif
+
if (NS_FAILED(rv) || !file) return NS_ERROR_FAILURE;
if (ensureFilePermissions) {
@@ -845,6 +861,16 @@ nsresult nsXREDirProvider::GetFilesInter
LoadDirIntoArray(mXULAppDir, kAppendPrefDir, directories);
+ // Add /etc/<application>/pref/ directory if it exists
+ nsCOMPtr<nsIFile> systemPrefDir;
+ rv = NS_GetSpecialDirectory(NS_APP_PREFS_SYSTEM_CONFIG_DIR,
+ getter_AddRefs(systemPrefDir));
+ if (NS_SUCCEEDED(rv)) {
+ rv = systemPrefDir->AppendNative(NS_LITERAL_CSTRING("pref"));
+ if (NS_SUCCEEDED(rv))
+ directories.AppendObject(systemPrefDir);
+ }
+
rv = NS_NewArrayEnumerator(aResult, directories, NS_GET_IID(nsIFile));
} else if (!strcmp(aProperty, NS_APP_CHROME_DIR_LIST)) {
// NS_APP_CHROME_DIR_LIST is only used to get default (native) icons
diff -up firefox-75.0/xpcom/io/nsAppDirectoryServiceDefs.h.1170092 firefox-75.0/xpcom/io/nsAppDirectoryServiceDefs.h
--- firefox-75.0/xpcom/io/nsAppDirectoryServiceDefs.h.1170092 2020-04-03 21:35:39.000000000 +0200
+++ firefox-75.0/xpcom/io/nsAppDirectoryServiceDefs.h 2020-04-06 22:40:02.761674865 +0200
@@ -60,6 +60,7 @@
#define NS_APP_PREFS_DEFAULTS_DIR_LIST "PrefDL"
#define NS_APP_PREFS_OVERRIDE_DIR \
"PrefDOverride" // Directory for per-profile defaults
+#define NS_APP_PREFS_SYSTEM_CONFIG_DIR "PrefSysConf" // Directory with system-wide configuration
#define NS_APP_USER_PROFILE_50_DIR "ProfD"
#define NS_APP_USER_PROFILE_LOCAL_50_DIR "ProfLD"

View file

@ -1,12 +1,13 @@
diff -up firefox-133.0/widget/gtk/nsWindow.cpp.1196777 firefox-133.0/widget/gtk/nsWindow.cpp
--- firefox-133.0/widget/gtk/nsWindow.cpp.1196777 2024-11-22 09:32:52.293470407 +0100
+++ firefox-133.0/widget/gtk/nsWindow.cpp 2024-11-22 10:21:54.996441520 +0100
@@ -191,7 +191,7 @@ constexpr gint kEvents =
GDK_VISIBILITY_NOTIFY_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK |
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_SMOOTH_SCROLL_MASK |
GDK_TOUCH_MASK | GDK_SCROLL_MASK | GDK_POINTER_MOTION_MASK |
- GDK_PROPERTY_CHANGE_MASK;
+ GDK_PROPERTY_CHANGE_MASK | GDK_FOCUS_CHANGE_MASK;
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;
/* utility functions */
static bool is_mouse_in_window(GdkWindow* aWindow, gdouble aMouseX,
#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.
}

21
mozilla-1516081.patch Normal file
View file

@ -0,0 +1,21 @@
diff -up firefox-71.0/build/moz.configure/lto-pgo.configure.1516081 firefox-71.0/build/moz.configure/lto-pgo.configure
--- firefox-71.0/build/moz.configure/lto-pgo.configure.1516081 2019-11-26 01:02:19.000000000 +0100
+++ firefox-71.0/build/moz.configure/lto-pgo.configure 2019-11-26 11:04:10.993077232 +0100
@@ -71,7 +71,7 @@ set_config('PGO_PROFILE_PATH', pgo_profi
def pgo_flags(compiler, target, profdata):
if compiler.type == 'gcc':
return namespace(
- gen_cflags=['-fprofile-generate'],
+ gen_cflags=['-fprofile-generate', '-DMOZ_PROFILE_INSTRUMENTATION'],
gen_ldflags=['-fprofile-generate'],
use_cflags=['-fprofile-use', '-fprofile-correction',
'-Wcoverage-mismatch'],
@@ -92,7 +92,7 @@ def pgo_flags(compiler, target, profdata
gen_ldflags = ['-fprofile-generate']
return namespace(
- gen_cflags=[prefix + '-fprofile-generate'],
+ gen_cflags=[prefix + '-fprofile-generate', '-DMOZ_PROFILE_INSTRUMENTATION'],
gen_ldflags=gen_ldflags,
use_cflags=[prefix + '-fprofile-use=%s' % profdata,
# Some error messages about mismatched profile data

View file

@ -1,15 +1,16 @@
diff -up firefox-84.0/security/sandbox/linux/moz.build.1516803 firefox-84.0/security/sandbox/linux/moz.build
--- firefox-84.0/security/sandbox/linux/moz.build.1516803 2020-12-10 16:17:55.425139545 +0100
+++ firefox-84.0/security/sandbox/linux/moz.build 2020-12-10 16:29:21.945860841 +0100
@@ -114,9 +114,8 @@ if CONFIG["CC_TYPE"] in ("clang", "gcc")
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"]
-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
DEFINES['NS_NO_XPCOM'] = True
DisableStlWrapping()

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));
}

97
mozilla-1619543.patch Normal file
View file

@ -0,0 +1,97 @@
diff --git a/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp b/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp
--- a/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp
@@ -101,17 +101,22 @@
: LinkResult::UnknownFutureLibAVVersion;
}
-#define AV_FUNC_OPTION(func, ver) \
+#define AV_FUNC_OPTION_SILENT(func, ver) \
if ((ver)&version) { \
if (!(func = (decltype(func))PR_FindSymbol( \
((ver)&AV_FUNC_AVUTIL_MASK) ? mAVUtilLib : mAVCodecLib, \
#func))) { \
- FFMPEG_LOG("Couldn't load function " #func); \
} \
} else { \
func = (decltype(func)) nullptr; \
}
+#define AV_FUNC_OPTION(func, ver) \
+ AV_FUNC_OPTION_SILENT(func, ver) \
+ if ((ver)&version && (func) == (decltype(func)) nullptr) { \
+ FFMPEG_LOG("Couldn't load function " #func); \
+ }
+
#define AV_FUNC(func, ver) \
AV_FUNC_OPTION(func, ver) \
if ((ver)&version && !func) { \
@@ -153,30 +158,29 @@
AV_FUNC_OPTION(av_frame_get_colorspace, AV_FUNC_AVUTIL_ALL)
AV_FUNC_OPTION(av_frame_get_color_range, AV_FUNC_AVUTIL_ALL)
#ifdef MOZ_WAYLAND
- AV_FUNC_OPTION(avcodec_get_hw_config, AV_FUNC_58)
- AV_FUNC_OPTION(av_hwdevice_ctx_create, AV_FUNC_58)
- AV_FUNC_OPTION(av_buffer_ref, AV_FUNC_AVUTIL_58)
- AV_FUNC_OPTION(av_buffer_unref, AV_FUNC_AVUTIL_58)
- AV_FUNC_OPTION(av_hwframe_transfer_get_formats, AV_FUNC_58)
- AV_FUNC_OPTION(av_hwdevice_ctx_create_derived, AV_FUNC_58)
- AV_FUNC_OPTION(av_hwframe_ctx_alloc, AV_FUNC_58)
- AV_FUNC_OPTION(av_dict_set, AV_FUNC_58)
- AV_FUNC_OPTION(av_dict_free, AV_FUNC_58)
+ AV_FUNC_OPTION_SILENT(avcodec_get_hw_config, AV_FUNC_58)
+ AV_FUNC_OPTION_SILENT(av_hwdevice_ctx_create, AV_FUNC_58)
+ AV_FUNC_OPTION_SILENT(av_buffer_ref, AV_FUNC_AVUTIL_58)
+ AV_FUNC_OPTION_SILENT(av_buffer_unref, AV_FUNC_AVUTIL_58)
+ AV_FUNC_OPTION_SILENT(av_hwframe_transfer_get_formats, AV_FUNC_58)
+ AV_FUNC_OPTION_SILENT(av_hwdevice_ctx_create_derived, AV_FUNC_58)
+ AV_FUNC_OPTION_SILENT(av_hwframe_ctx_alloc, AV_FUNC_58)
+ AV_FUNC_OPTION_SILENT(av_dict_set, AV_FUNC_58)
+ AV_FUNC_OPTION_SILENT(av_dict_free, AV_FUNC_58)
#endif
#undef AV_FUNC
#undef AV_FUNC_OPTION
#ifdef MOZ_WAYLAND
-# define VA_FUNC_OPTION(func) \
+# define VA_FUNC_OPTION_SILENT(func) \
if (!(func = (decltype(func))PR_FindSymbol(mVALib, #func))) { \
- FFMPEG_LOG("Couldn't load function " #func); \
func = (decltype(func)) nullptr; \
}
// mVALib is optional and may not be present.
if (mVALib) {
- VA_FUNC_OPTION(vaExportSurfaceHandle)
- VA_FUNC_OPTION(vaSyncSurface)
+ VA_FUNC_OPTION_SILENT(vaExportSurfaceHandle)
+ VA_FUNC_OPTION_SILENT(vaSyncSurface)
}
# undef VA_FUNC_OPTION
#endif
diff --git a/dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp b/dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp
--- a/dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp
@@ -66,6 +66,9 @@
PR_UnloadLibrary(sLibAV.mVALib);
sLibAV.mVALib = nullptr;
}
+ if (!sLibAV.mVALib) {
+ FFMPEG_LOG("VA-API support: Missing or old %s library.\n", lib);
+ }
}
#endif
diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
@@ -173,7 +173,7 @@
FFMPEG_LOG("Initialising VA-API FFmpeg decoder");
if (!mLib->IsVAAPIAvailable()) {
- FFMPEG_LOG("libva library is missing");
+ FFMPEG_LOG("libva library or symbols are missing.");
return NS_ERROR_NOT_AVAILABLE;
}

349
mozilla-1619882-1.patch Normal file
View file

@ -0,0 +1,349 @@
diff --git a/gfx/layers/ipc/LayersSurfaces.ipdlh b/gfx/layers/ipc/LayersSurfaces.ipdlh
--- a/gfx/layers/ipc/LayersSurfaces.ipdlh
+++ b/gfx/layers/ipc/LayersSurfaces.ipdlh
@@ -71,6 +71,8 @@
uint32_t[] offsets;
YUVColorSpace yUVColorSpace;
FileDescriptor[] fence;
+ uint32_t uid;
+ FileDescriptor[] refCount;
};
struct SurfaceTextureDescriptor {
diff --git a/widget/gtk/WaylandDMABufSurface.h b/widget/gtk/WaylandDMABufSurface.h
--- a/widget/gtk/WaylandDMABufSurface.h
+++ b/widget/gtk/WaylandDMABufSurface.h
@@ -40,6 +40,23 @@
class WaylandDMABufSurfaceRGBA;
+class DMABufRefcount {
+ public:
+ DMABufRefcount();
+ DMABufRefcount(int aFd);
+
+ bool Created() { return mFd > 0; };
+ int GetFD() { return mFd; }
+ uint64_t GetRefcount();
+ void RefAdd();
+ void Release();
+
+ ~DMABufRefcount();
+
+ private:
+ int mFd;
+};
+
class WaylandDMABufSurface {
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(WaylandDMABufSurface)
@@ -82,6 +99,14 @@
void FenceWait();
void FenceDelete();
+ void SetUID(uint32_t aUID) { mUID = aUID; };
+ uint32_t GetUID() { return mUID; };
+
+ void GlobalRefCountCreate();
+ bool IsGlobalRefSet();
+ void GlobalRefAdd();
+ void GlobalRefRelease();
+
WaylandDMABufSurface(SurfaceType aSurfaceType);
protected:
@@ -89,6 +114,8 @@
virtual void ReleaseSurface() = 0;
bool FenceCreate(int aFd);
+ bool GlobalRefCountImport(int aFd);
+
virtual ~WaylandDMABufSurface() { FenceDelete(); };
SurfaceType mSurfaceType;
@@ -102,6 +129,9 @@
EGLSyncKHR mSync;
RefPtr<mozilla::gl::GLContext> mGL;
+
+ mozilla::UniquePtr<DMABufRefcount> mGlobalRefCount;
+ uint32_t mUID;
};
class WaylandDMABufSurfaceRGBA : public WaylandDMABufSurface {
diff --git a/widget/gtk/WaylandDMABufSurface.cpp b/widget/gtk/WaylandDMABufSurface.cpp
--- a/widget/gtk/WaylandDMABufSurface.cpp
+++ b/widget/gtk/WaylandDMABufSurface.cpp
@@ -17,6 +17,8 @@
#include <unistd.h>
#include <sys/time.h>
#include <dlfcn.h>
+#include <sys/mman.h>
+#include <sys/eventfd.h>
#include "mozilla/widget/gbm.h"
#include "mozilla/widget/va_drmcommon.h"
@@ -57,6 +59,73 @@
# define VA_FOURCC_NV12 0x3231564E
#endif
+void DMABufRefcount::RefAdd() {
+ uint64_t counter;
+ read(mFd, &counter, sizeof(counter));
+ counter++;
+ write(mFd, &counter, sizeof(counter));
+}
+
+void DMABufRefcount::Release() {
+ uint64_t counter;
+ read(mFd, &counter, sizeof(counter));
+ counter--;
+ write(mFd, &counter, sizeof(counter));
+}
+
+uint64_t DMABufRefcount::GetRefcount() {
+ uint64_t counter;
+ read(mFd, &counter, sizeof(counter));
+ write(mFd, &counter, sizeof(counter));
+ return counter;
+}
+
+DMABufRefcount::DMABufRefcount()
+ : mFd(eventfd(1, EFD_CLOEXEC | EFD_NONBLOCK)) {}
+
+DMABufRefcount::DMABufRefcount(int aFd) : mFd(aFd) {}
+
+DMABufRefcount::~DMABufRefcount() {
+ if (mFd > 0) {
+ close(mFd);
+ }
+}
+
+void WaylandDMABufSurface::GlobalRefCountCreate() {
+ MOZ_ASSERT(!mGlobalRefCount);
+ mGlobalRefCount = MakeUnique<DMABufRefcount>();
+ if (!mGlobalRefCount->Created()) {
+ NS_WARNING("Failed to create dmabuf global ref count!");
+ mGlobalRefCount = nullptr;
+ }
+}
+
+bool WaylandDMABufSurface::GlobalRefCountImport(int aFd) {
+ MOZ_ASSERT(!mGlobalRefCount);
+ mGlobalRefCount = MakeUnique<DMABufRefcount>(aFd);
+ if (!mGlobalRefCount->Created()) {
+ NS_WARNING("Failed to import dmabuf global ref count!");
+ mGlobalRefCount = nullptr;
+ return false;
+ }
+ return true;
+}
+
+bool WaylandDMABufSurface::IsGlobalRefSet() {
+ MOZ_ASSERT(mGlobalRefCount);
+ return mGlobalRefCount->GetRefcount() > 1;
+}
+
+void WaylandDMABufSurface::GlobalRefAdd() {
+ MOZ_ASSERT(mGlobalRefCount);
+ mGlobalRefCount->RefAdd();
+}
+
+void WaylandDMABufSurface::GlobalRefRelease() {
+ MOZ_ASSERT(mGlobalRefCount);
+ mGlobalRefCount->Release();
+}
+
WaylandDMABufSurface::WaylandDMABufSurface(SurfaceType aSurfaceType)
: mSurfaceType(aSurfaceType),
mBufferModifier(DRM_FORMAT_MOD_INVALID),
@@ -64,7 +133,9 @@
mDrmFormats(),
mStrides(),
mOffsets(),
- mSync(0) {
+ mSync(0),
+ mGlobalRefCount(nullptr),
+ mUID(0) {
for (auto& slot : mDmabufFds) {
slot = -1;
}
@@ -316,6 +387,7 @@
mBufferPlaneCount = desc.fds().Length();
mGbmBufferFlags = desc.flags();
MOZ_RELEASE_ASSERT(mBufferPlaneCount <= DMABUF_BUFFER_PLANES);
+ mUID = desc.uid();
for (int i = 0; i < mBufferPlaneCount; i++) {
mDmabufFds[i] = desc.fds()[i].ClonePlatformHandle().release();
@@ -329,6 +401,13 @@
close(fd);
}
}
+
+ if (desc.refCount().Length() > 0) {
+ int fd = desc.refCount()[0].ClonePlatformHandle().release();
+ if (!GlobalRefCountImport(fd)) {
+ close(fd);
+ }
+ }
}
bool WaylandDMABufSurfaceRGBA::Create(const SurfaceDescriptor& aDesc) {
@@ -346,6 +425,7 @@
AutoTArray<uint32_t, DMABUF_BUFFER_PLANES> offsets;
AutoTArray<uintptr_t, DMABUF_BUFFER_PLANES> images;
AutoTArray<ipc::FileDescriptor, 1> fenceFDs;
+ AutoTArray<ipc::FileDescriptor, 1> refCountFDs;
width.AppendElement(mWidth);
height.AppendElement(mHeight);
@@ -362,9 +442,14 @@
egl->fDupNativeFenceFDANDROID(egl->Display(), mSync)));
}
- aOutDescriptor = SurfaceDescriptorDMABuf(
- mSurfaceType, mBufferModifier, mGbmBufferFlags, fds, width, height,
- format, strides, offsets, GetYUVColorSpace(), fenceFDs);
+ if (mGlobalRefCount) {
+ refCountFDs.AppendElement(ipc::FileDescriptor(mGlobalRefCount->GetFD()));
+ }
+
+ aOutDescriptor =
+ SurfaceDescriptorDMABuf(mSurfaceType, mBufferModifier, mGbmBufferFlags,
+ fds, width, height, format, strides, offsets,
+ GetYUVColorSpace(), fenceFDs, mUID, refCountFDs);
return true;
}
@@ -693,6 +778,7 @@
mBufferPlaneCount = aDesc.fds().Length();
mBufferModifier = aDesc.modifier();
mColorSpace = aDesc.yUVColorSpace();
+ mUID = aDesc.uid();
MOZ_RELEASE_ASSERT(mBufferPlaneCount <= DMABUF_BUFFER_PLANES);
for (int i = 0; i < mBufferPlaneCount; i++) {
@@ -710,6 +796,13 @@
close(fd);
}
}
+
+ if (aDesc.refCount().Length() > 0) {
+ int fd = aDesc.refCount()[0].ClonePlatformHandle().release();
+ if (!GlobalRefCountImport(fd)) {
+ close(fd);
+ }
+ }
}
bool WaylandDMABufSurfaceNV12::Serialize(
@@ -721,6 +814,7 @@
AutoTArray<uint32_t, DMABUF_BUFFER_PLANES> strides;
AutoTArray<uint32_t, DMABUF_BUFFER_PLANES> offsets;
AutoTArray<ipc::FileDescriptor, 1> fenceFDs;
+ AutoTArray<ipc::FileDescriptor, 1> refCountFDs;
for (int i = 0; i < mBufferPlaneCount; i++) {
width.AppendElement(mWidth[i]);
@@ -737,9 +831,13 @@
egl->fDupNativeFenceFDANDROID(egl->Display(), mSync)));
}
+ if (mGlobalRefCount) {
+ refCountFDs.AppendElement(ipc::FileDescriptor(mGlobalRefCount->GetFD()));
+ }
+
aOutDescriptor = SurfaceDescriptorDMABuf(
mSurfaceType, mBufferModifier, 0, fds, width, height, format, strides,
- offsets, GetYUVColorSpace(), fenceFDs);
+ offsets, GetYUVColorSpace(), fenceFDs, mUID, refCountFDs);
return true;
}
diff --git a/widget/gtk/WindowSurfaceWayland.h b/widget/gtk/WindowSurfaceWayland.h
--- a/widget/gtk/WindowSurfaceWayland.h
+++ b/widget/gtk/WindowSurfaceWayland.h
@@ -36,8 +36,6 @@
int aImageDataSize);
private:
- int CreateTemporaryFile(int aSize);
-
wl_shm_pool* mShmPool;
int mShmPoolFd;
int mAllocatedSize;
diff --git a/widget/gtk/WindowSurfaceWayland.cpp b/widget/gtk/WindowSurfaceWayland.cpp
--- a/widget/gtk/WindowSurfaceWayland.cpp
+++ b/widget/gtk/WindowSurfaceWayland.cpp
@@ -206,42 +206,25 @@
return mWindowSurfaceWayland->GetWaylandDisplay();
}
-int WaylandShmPool::CreateTemporaryFile(int aSize) {
- const char* tmppath = getenv("XDG_RUNTIME_DIR");
- MOZ_RELEASE_ASSERT(tmppath, "Missing XDG_RUNTIME_DIR env variable.");
-
- nsPrintfCString tmpname("%s/mozilla-shared-XXXXXX", tmppath);
-
- char* filename;
- int fd = -1;
- int ret = 0;
-
- if (tmpname.GetMutableData(&filename)) {
- fd = mkstemp(filename);
- if (fd >= 0) {
- int flags = fcntl(fd, F_GETFD);
- if (flags >= 0) {
- fcntl(fd, F_SETFD, flags | FD_CLOEXEC);
- }
- }
- }
-
+static int WaylandAllocateShmMemory(int aSize) {
+ static int counter = 0;
+ nsPrintfCString shmName("/wayland.mozilla.ipc.%d", counter++);
+ int fd = shm_open(shmName.get(), O_CREAT | O_RDWR | O_EXCL, 0600);
if (fd >= 0) {
- unlink(tmpname.get());
+ shm_unlink(shmName.get());
} else {
- printf_stderr("Unable to create mapping file %s\n", filename);
+ printf_stderr("Unable to SHM memory segment\n");
MOZ_CRASH();
}
+ int ret = 0;
#ifdef HAVE_POSIX_FALLOCATE
do {
ret = posix_fallocate(fd, 0, aSize);
} while (ret == EINTR);
if (ret != 0) {
close(fd);
- MOZ_CRASH_UNSAFE_PRINTF(
- "posix_fallocate() fails on %s size %d error code %d\n", filename,
- aSize, ret);
+ MOZ_CRASH("posix_fallocate() fails to allocate shm memory");
}
#else
do {
@@ -249,8 +232,7 @@
} while (ret < 0 && errno == EINTR);
if (ret < 0) {
close(fd);
- MOZ_CRASH_UNSAFE_PRINTF("ftruncate() fails on %s size %d error code %d\n",
- filename, aSize, ret);
+ MOZ_CRASH("ftruncate() fails to allocate shm memory");
}
#endif
@@ -259,7 +241,7 @@
WaylandShmPool::WaylandShmPool(nsWaylandDisplay* aWaylandDisplay, int aSize)
: mAllocatedSize(aSize) {
- mShmPoolFd = CreateTemporaryFile(mAllocatedSize);
+ mShmPoolFd = WaylandAllocateShmMemory(mAllocatedSize);
mImageData = mmap(nullptr, mAllocatedSize, PROT_READ | PROT_WRITE, MAP_SHARED,
mShmPoolFd, 0);
MOZ_RELEASE_ASSERT(mImageData != MAP_FAILED,

155
mozilla-1619882-2.patch Normal file
View file

@ -0,0 +1,155 @@
diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h
--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h
+++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h
@@ -10,17 +10,26 @@
#include "FFmpegLibWrapper.h"
#include "FFmpegDataDecoder.h"
#include "SimpleMap.h"
+#ifdef MOZ_WAYLAND_USE_VAAPI
+# include "mozilla/widget/WaylandDMABufSurface.h"
+# include <list>
+#endif
namespace mozilla {
#ifdef MOZ_WAYLAND_USE_VAAPI
+
class VAAPIFrameHolder {
public:
- VAAPIFrameHolder(FFmpegLibWrapper* aLib, AVBufferRef* aVAAPIDeviceContext,
+ VAAPIFrameHolder(RefPtr<WaylandDMABufSurface> aSurface,
+ FFmpegLibWrapper* aLib, AVBufferRef* aVAAPIDeviceContext,
AVBufferRef* aAVHWFramesContext, AVBufferRef* aHWFrame);
~VAAPIFrameHolder();
+ bool IsUsed() { return mSurface->IsGlobalRefSet(); }
+
private:
+ RefPtr<WaylandDMABufSurface> mSurface;
FFmpegLibWrapper* mLib;
AVBufferRef* mVAAPIDeviceContext;
AVBufferRef* mAVHWFramesContext;
@@ -97,6 +106,7 @@
MediaResult CreateImageVAAPI(int64_t aOffset, int64_t aPts, int64_t aDuration,
MediaDataDecoder::DecodedData& aResults);
+ void ReleaseUnusedVAAPIFrames();
#endif
/**
@@ -112,6 +122,7 @@
AVBufferRef* mVAAPIDeviceContext;
const bool mDisableHardwareDecoding;
VADisplay mDisplay;
+ std::list<UniquePtr<VAAPIFrameHolder>> mFrameHolders;
#endif
RefPtr<KnowsCompositor> mImageAllocator;
RefPtr<ImageContainer> mImageContainer;
diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
@@ -122,19 +122,30 @@
return AV_PIX_FMT_NONE;
}
-VAAPIFrameHolder::VAAPIFrameHolder(FFmpegLibWrapper* aLib,
+VAAPIFrameHolder::VAAPIFrameHolder(RefPtr<WaylandDMABufSurface> aSurface,
+ FFmpegLibWrapper* aLib,
AVBufferRef* aVAAPIDeviceContext,
AVBufferRef* aAVHWFramesContext,
AVBufferRef* aHWFrame)
- : mLib(aLib),
+ : mSurface(aSurface),
+ mLib(aLib),
mVAAPIDeviceContext(mLib->av_buffer_ref(aVAAPIDeviceContext)),
mAVHWFramesContext(mLib->av_buffer_ref(aAVHWFramesContext)),
- mHWFrame(mLib->av_buffer_ref(aHWFrame)){};
+ mHWFrame(mLib->av_buffer_ref(aHWFrame)) {
+ FFMPEG_LOG("VAAPIFrameHolder is adding dmabuf surface UID = %d\n",
+ mSurface->GetUID());
+ // Create global refcount object to track mSurface usage over
+ // processes.
+ mSurface->GlobalRefCountCreate();
+}
VAAPIFrameHolder::~VAAPIFrameHolder() {
+ FFMPEG_LOG("VAAPIFrameHolder is releasing dmabuf surface UID = %d\n",
+ mSurface->GetUID());
mLib->av_buffer_unref(&mHWFrame);
mLib->av_buffer_unref(&mAVHWFramesContext);
mLib->av_buffer_unref(&mVAAPIDeviceContext);
+ mSurface = nullptr;
}
AVCodec* FFmpegVideoDecoder<LIBAV_VER>::FindVAAPICodec() {
@@ -418,6 +428,13 @@
NS_WARNING("FFmpeg h264 decoder failed to allocate frame.");
return MediaResult(NS_ERROR_OUT_OF_MEMORY, __func__);
}
+
+# ifdef MOZ_WAYLAND_USE_VAAPI
+ if (mVAAPIDeviceContext) {
+ ReleaseUnusedVAAPIFrames();
+ }
+# endif
+
res = mLib->avcodec_receive_frame(mCodecContext, mFrame);
if (res == int(AVERROR_EOF)) {
return NS_ERROR_DOM_MEDIA_END_OF_STREAM;
@@ -624,9 +641,16 @@
}
#ifdef MOZ_WAYLAND_USE_VAAPI
-static void VAAPIFrameReleaseCallback(VAAPIFrameHolder* aVAAPIFrameHolder) {
- auto frameHolder = static_cast<VAAPIFrameHolder*>(aVAAPIFrameHolder);
- delete frameHolder;
+void FFmpegVideoDecoder<LIBAV_VER>::ReleaseUnusedVAAPIFrames() {
+ std::list<UniquePtr<VAAPIFrameHolder>>::iterator holder =
+ mFrameHolders.begin();
+ while (holder != mFrameHolders.end()) {
+ if (!(*holder)->IsUsed()) {
+ holder = mFrameHolders.erase(holder);
+ } else {
+ holder++;
+ }
+ }
}
MediaResult FFmpegVideoDecoder<LIBAV_VER>::CreateImageVAAPI(
@@ -663,20 +687,28 @@
RESULT_DETAIL("Unable to allocate WaylandDMABufSurfaceNV12."));
}
+# ifdef MOZ_LOGGING
+ static int uid = 0;
+ surface->SetUID(++uid);
+ FFMPEG_LOG("Created dmabuf UID = %d HW surface %x\n", uid, surface_id);
+# endif
+
surface->SetYUVColorSpace(GetFrameColorSpace());
// mFrame->buf[0] is a reference to H264 VASurface for this mFrame.
- // We need create WaylandDMABUFSurfaceImage on top of it,
+ // We need create WaylandDMABUFSurface on top of it,
// create EGLImage/Texture on top of it and render it by GL.
// FFmpeg tends to reuse the particual VASurface for another frame
// even when the mFrame is not released. To keep VASurface as is
- // we explicitly reference it and keep until WaylandDMABUFSurfaceImage
- // is live.
- RefPtr<layers::Image> im = new layers::WaylandDMABUFSurfaceImage(
- surface, VAAPIFrameReleaseCallback,
- new VAAPIFrameHolder(mLib, mVAAPIDeviceContext,
- mCodecContext->hw_frames_ctx, mFrame->buf[0]));
+ // we explicitly reference it and keep until there's any reference to
+ // attached WaylandDMABUFSurface.
+ auto holder = MakeUnique<VAAPIFrameHolder>(surface, mLib, mVAAPIDeviceContext,
+ mCodecContext->hw_frames_ctx,
+ mFrame->buf[0]);
+ mFrameHolders.push_back(std::move(holder));
+
+ RefPtr<layers::Image> im = new layers::WaylandDMABUFSurfaceImage(surface);
RefPtr<VideoData> vp = VideoData::CreateFromImage(
mInfo.mDisplay, aOffset, TimeUnit::FromMicroseconds(aPts),

51
mozilla-1619882-3.patch Normal file
View file

@ -0,0 +1,51 @@
diff --git a/gfx/layers/WaylandDMABUFSurfaceImage.h b/gfx/layers/WaylandDMABUFSurfaceImage.h
--- a/gfx/layers/WaylandDMABUFSurfaceImage.h
+++ b/gfx/layers/WaylandDMABUFSurfaceImage.h
@@ -13,29 +13,16 @@
#include "mozilla/layers/TextureClient.h"
namespace mozilla {
-class VAAPIFrameHolder;
-}
-
-namespace mozilla {
namespace layers {
-typedef void (*AVFrameReleaseCallback)(VAAPIFrameHolder* aFrameHolder);
-
class WaylandDMABUFSurfaceImage : public Image {
public:
- explicit WaylandDMABUFSurfaceImage(WaylandDMABufSurface* aSurface,
- AVFrameReleaseCallback aReleaseCallback,
- VAAPIFrameHolder* aFrameHolder)
- : Image(nullptr, ImageFormat::WAYLAND_DMABUF),
- mSurface(aSurface),
- mReleaseCallback(aReleaseCallback),
- mFrameHolder(aFrameHolder) {}
+ explicit WaylandDMABUFSurfaceImage(WaylandDMABufSurface* aSurface)
+ : Image(nullptr, ImageFormat::WAYLAND_DMABUF), mSurface(aSurface) {
+ mSurface->GlobalRefAdd();
+ }
- ~WaylandDMABUFSurfaceImage() {
- if (mReleaseCallback) {
- mReleaseCallback(mFrameHolder);
- }
- }
+ ~WaylandDMABUFSurfaceImage() { mSurface->GlobalRefRelease(); }
WaylandDMABufSurface* GetSurface() { return mSurface; }
@@ -52,11 +39,6 @@
private:
RefPtr<WaylandDMABufSurface> mSurface;
RefPtr<TextureClient> mTextureClient;
-
- // When WaylandDMABUFSurfaceImage is created on top of ffmpeg frame located at
- // GPU memory we need to keep it until painting of the frame is finished.
- AVFrameReleaseCallback mReleaseCallback;
- VAAPIFrameHolder* mFrameHolder;
};
} // namespace layers

20
mozilla-1625431.patch Normal file
View file

@ -0,0 +1,20 @@
diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
@@ -172,6 +172,15 @@
MediaResult FFmpegVideoDecoder<LIBAV_VER>::InitVAAPIDecoder() {
FFMPEG_LOG("Initialising VA-API FFmpeg decoder");
+ auto layersBackend = mImageAllocator
+ ? mImageAllocator->GetCompositorBackendType()
+ : layers::LayersBackend::LAYERS_BASIC;
+ if (layersBackend != layers::LayersBackend::LAYERS_OPENGL &&
+ layersBackend != layers::LayersBackend::LAYERS_WR) {
+ FFMPEG_LOG("VA-API works with HW accelerated backend only!");
+ return NS_ERROR_NOT_AVAILABLE;
+ }
+
if (!mLib->IsVAAPIAvailable()) {
FFMPEG_LOG("libva library or symbols are missing.");
return NS_ERROR_NOT_AVAILABLE;

67
mozilla-1628690.patch Normal file
View file

@ -0,0 +1,67 @@
diff --git a/dom/media/platforms/ffmpeg/FFmpegDecoderModule.h b/dom/media/platforms/ffmpeg/FFmpegDecoderModule.h
--- a/dom/media/platforms/ffmpeg/FFmpegDecoderModule.h
+++ b/dom/media/platforms/ffmpeg/FFmpegDecoderModule.h
@@ -49,7 +49,9 @@
RefPtr<MediaDataDecoder> decoder = new FFmpegVideoDecoder<V>(
mLib, aParams.mTaskQueue, aParams.VideoConfig(),
aParams.mKnowsCompositor, aParams.mImageContainer,
- aParams.mOptions.contains(CreateDecoderParams::Option::LowLatency));
+ aParams.mOptions.contains(CreateDecoderParams::Option::LowLatency),
+ aParams.mOptions.contains(
+ CreateDecoderParams::Option::HardwareDecoderNotAllowed));
return decoder.forget();
}
diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h
--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h
+++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h
@@ -48,7 +48,8 @@
public:
FFmpegVideoDecoder(FFmpegLibWrapper* aLib, TaskQueue* aTaskQueue,
const VideoInfo& aConfig, KnowsCompositor* aAllocator,
- ImageContainer* aImageContainer, bool aLowLatency);
+ ImageContainer* aImageContainer, bool aLowLatency,
+ bool aDisableHardwareDecoding);
RefPtr<InitPromise> Init() override;
void InitCodecContext() override;
@@ -109,6 +110,7 @@
#ifdef MOZ_WAYLAND_USE_VAAPI
AVBufferRef* mVAAPIDeviceContext;
+ const bool mDisableHardwareDecoding;
#endif
RefPtr<KnowsCompositor> mImageAllocator;
RefPtr<ImageContainer> mImageContainer;
diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
@@ -270,10 +270,11 @@
FFmpegVideoDecoder<LIBAV_VER>::FFmpegVideoDecoder(
FFmpegLibWrapper* aLib, TaskQueue* aTaskQueue, const VideoInfo& aConfig,
KnowsCompositor* aAllocator, ImageContainer* aImageContainer,
- bool aLowLatency)
+ bool aLowLatency, bool aDisableHardwareDecoding)
: FFmpegDataDecoder(aLib, aTaskQueue, GetCodecId(aConfig.mMimeType)),
#ifdef MOZ_WAYLAND_USE_VAAPI
mVAAPIDeviceContext(nullptr),
+ mDisableHardwareDecoding(aDisableHardwareDecoding),
#endif
mImageAllocator(aAllocator),
mImageContainer(aImageContainer),
@@ -289,9 +290,11 @@
MediaResult rv;
#ifdef MOZ_WAYLAND_USE_VAAPI
- rv = InitVAAPIDecoder();
- if (NS_SUCCEEDED(rv)) {
- return InitPromise::CreateAndResolve(TrackInfo::kVideoTrack, __func__);
+ if (!mDisableHardwareDecoding) {
+ rv = InitVAAPIDecoder();
+ if (NS_SUCCEEDED(rv)) {
+ return InitPromise::CreateAndResolve(TrackInfo::kVideoTrack, __func__);
+ }
}
#endif

298
mozilla-1630754.patch Normal file
View file

@ -0,0 +1,298 @@
diff --git a/dom/media/platforms/ffmpeg/FFmpegLibWrapper.h b/dom/media/platforms/ffmpeg/FFmpegLibWrapper.h
--- a/dom/media/platforms/ffmpeg/FFmpegLibWrapper.h
+++ b/dom/media/platforms/ffmpeg/FFmpegLibWrapper.h
@@ -116,9 +116,9 @@
#ifdef MOZ_WAYLAND
const AVCodecHWConfig* (*avcodec_get_hw_config)(const AVCodec* codec,
int index);
- int (*av_hwdevice_ctx_create)(AVBufferRef** device_ctx, int type,
- const char* device, AVDictionary* opts,
- int flags);
+ AVBufferRef* (*av_hwdevice_ctx_alloc)(int);
+ int (*av_hwdevice_ctx_init)(AVBufferRef* ref);
+
AVBufferRef* (*av_buffer_ref)(AVBufferRef* buf);
void (*av_buffer_unref)(AVBufferRef** buf);
int (*av_hwframe_transfer_get_formats)(AVBufferRef* hwframe_ctx, int dir,
@@ -132,12 +132,16 @@
int (*vaExportSurfaceHandle)(void*, unsigned int, uint32_t, uint32_t, void*);
int (*vaSyncSurface)(void*, unsigned int);
+ int (*vaInitialize)(void* dpy, int* major_version, int* minor_version);
+ int (*vaTerminate)(void* dpy);
+ void* (*vaGetDisplayWl)(struct wl_display* display);
#endif
PRLibrary* mAVCodecLib;
PRLibrary* mAVUtilLib;
#ifdef MOZ_WAYLAND
PRLibrary* mVALib;
+ PRLibrary* mVALibWayland;
#endif
private:
diff --git a/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp b/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp
--- a/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp
@@ -159,7 +159,8 @@
AV_FUNC_OPTION(av_frame_get_color_range, AV_FUNC_AVUTIL_ALL)
#ifdef MOZ_WAYLAND
AV_FUNC_OPTION_SILENT(avcodec_get_hw_config, AV_FUNC_58)
- AV_FUNC_OPTION_SILENT(av_hwdevice_ctx_create, AV_FUNC_58)
+ AV_FUNC_OPTION_SILENT(av_hwdevice_ctx_init, AV_FUNC_58)
+ AV_FUNC_OPTION_SILENT(av_hwdevice_ctx_alloc, AV_FUNC_58)
AV_FUNC_OPTION_SILENT(av_buffer_ref, AV_FUNC_AVUTIL_58)
AV_FUNC_OPTION_SILENT(av_buffer_unref, AV_FUNC_AVUTIL_58)
AV_FUNC_OPTION_SILENT(av_hwframe_transfer_get_formats, AV_FUNC_58)
@@ -181,8 +182,21 @@
if (mVALib) {
VA_FUNC_OPTION_SILENT(vaExportSurfaceHandle)
VA_FUNC_OPTION_SILENT(vaSyncSurface)
+ VA_FUNC_OPTION_SILENT(vaInitialize)
+ VA_FUNC_OPTION_SILENT(vaTerminate)
}
-# undef VA_FUNC_OPTION
+# undef VA_FUNC_OPTION_SILENT
+
+# define VAW_FUNC_OPTION_SILENT(func) \
+ if (!(func = (decltype(func))PR_FindSymbol(mVALibWayland, #func))) { \
+ FFMPEG_LOG("Couldn't load function " #func); \
+ }
+
+ // mVALibWayland is optional and may not be present.
+ if (mVALibWayland) {
+ VAW_FUNC_OPTION_SILENT(vaGetDisplayWl)
+ }
+# undef VAW_FUNC_OPTION_SILENT
#endif
avcodec_register_all();
@@ -218,6 +232,9 @@
if (mVALib) {
PR_UnloadLibrary(mVALib);
}
+ if (mVALibWayland) {
+ PR_UnloadLibrary(mVALibWayland);
+ }
#endif
PodZero(this);
}
@@ -226,13 +243,16 @@
bool FFmpegLibWrapper::IsVAAPIAvailable() {
# define VA_FUNC_LOADED(func) (func != nullptr)
return VA_FUNC_LOADED(avcodec_get_hw_config) &&
- VA_FUNC_LOADED(av_hwdevice_ctx_create) &&
+ VA_FUNC_LOADED(av_hwdevice_ctx_alloc) &&
+ VA_FUNC_LOADED(av_hwdevice_ctx_init) &&
VA_FUNC_LOADED(av_buffer_ref) && VA_FUNC_LOADED(av_buffer_unref) &&
VA_FUNC_LOADED(av_hwframe_transfer_get_formats) &&
VA_FUNC_LOADED(av_hwdevice_ctx_create_derived) &&
VA_FUNC_LOADED(av_hwframe_ctx_alloc) && VA_FUNC_LOADED(av_dict_set) &&
VA_FUNC_LOADED(av_dict_free) &&
- VA_FUNC_LOADED(vaExportSurfaceHandle) && VA_FUNC_LOADED(vaSyncSurface);
+ VA_FUNC_LOADED(vaExportSurfaceHandle) &&
+ VA_FUNC_LOADED(vaSyncSurface) && VA_FUNC_LOADED(vaInitialize) &&
+ VA_FUNC_LOADED(vaTerminate) && VA_FUNC_LOADED(vaGetDisplayWl);
}
#endif
diff --git a/dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp b/dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp
--- a/dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp
@@ -9,6 +9,9 @@
#include "mozilla/ArrayUtils.h"
#include "FFmpegLog.h"
#include "prlink.h"
+#ifdef MOZ_WAYLAND
+# include "gfxPlatformGtk.h"
+#endif
namespace mozilla {
@@ -54,21 +57,33 @@
}
#ifdef MOZ_WAYLAND
- {
- const char* lib = "libva.so.2";
+ if (gfxPlatformGtk::GetPlatform()->UseWaylandHardwareVideoDecoding()) {
+ const char* libWayland = "libva-wayland.so.2";
PRLibSpec lspec;
lspec.type = PR_LibSpec_Pathname;
- lspec.value.pathname = lib;
- sLibAV.mVALib = PR_LoadLibraryWithFlags(lspec, PR_LD_NOW | PR_LD_LOCAL);
- // Don't use libva when it's missing vaExportSurfaceHandle.
- if (sLibAV.mVALib &&
- !PR_FindSymbol(sLibAV.mVALib, "vaExportSurfaceHandle")) {
- PR_UnloadLibrary(sLibAV.mVALib);
- sLibAV.mVALib = nullptr;
+ lspec.value.pathname = libWayland;
+ sLibAV.mVALibWayland =
+ PR_LoadLibraryWithFlags(lspec, PR_LD_NOW | PR_LD_LOCAL);
+ if (!sLibAV.mVALibWayland) {
+ FFMPEG_LOG("VA-API support: Missing or old %s library.\n", libWayland);
}
- if (!sLibAV.mVALib) {
- FFMPEG_LOG("VA-API support: Missing or old %s library.\n", lib);
+
+ if (sLibAV.mVALibWayland) {
+ const char* lib = "libva.so.2";
+ lspec.value.pathname = lib;
+ sLibAV.mVALib = PR_LoadLibraryWithFlags(lspec, PR_LD_NOW | PR_LD_LOCAL);
+ // Don't use libva when it's missing vaExportSurfaceHandle.
+ if (sLibAV.mVALib &&
+ !PR_FindSymbol(sLibAV.mVALib, "vaExportSurfaceHandle")) {
+ PR_UnloadLibrary(sLibAV.mVALib);
+ sLibAV.mVALib = nullptr;
+ }
+ if (!sLibAV.mVALib) {
+ FFMPEG_LOG("VA-API support: Missing or old %s library.\n", lib);
+ }
}
+ } else {
+ FFMPEG_LOG("VA-API FFmpeg is disabled by platform");
}
#endif
diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h
--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h
+++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h
@@ -111,6 +111,7 @@
#ifdef MOZ_WAYLAND_USE_VAAPI
AVBufferRef* mVAAPIDeviceContext;
const bool mDisableHardwareDecoding;
+ VADisplay mDisplay;
#endif
RefPtr<KnowsCompositor> mImageAllocator;
RefPtr<ImageContainer> mImageContainer;
diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
@@ -154,14 +154,44 @@
return nullptr;
}
+class VAAPIDisplayHolder {
+ public:
+ VAAPIDisplayHolder(FFmpegLibWrapper* aLib, VADisplay aDisplay)
+ : mLib(aLib), mDisplay(aDisplay){};
+ ~VAAPIDisplayHolder() { mLib->vaTerminate(mDisplay); }
+
+ private:
+ FFmpegLibWrapper* mLib;
+ VADisplay mDisplay;
+};
+
+static void VAAPIDisplayReleaseCallback(struct AVHWDeviceContext* hwctx) {
+ auto displayHolder = static_cast<VAAPIDisplayHolder*>(hwctx->user_opaque);
+ delete displayHolder;
+}
+
bool FFmpegVideoDecoder<LIBAV_VER>::CreateVAAPIDeviceContext() {
- AVDictionary* opts = nullptr;
- mLib->av_dict_set(&opts, "connection_type", "drm", 0);
- bool ret =
- (mLib->av_hwdevice_ctx_create(
- &mVAAPIDeviceContext, AV_HWDEVICE_TYPE_VAAPI, NULL, NULL, 0) == 0);
- mLib->av_dict_free(&opts);
- if (!ret) {
+ mVAAPIDeviceContext = mLib->av_hwdevice_ctx_alloc(AV_HWDEVICE_TYPE_VAAPI);
+ if (!mVAAPIDeviceContext) {
+ return false;
+ }
+ AVHWDeviceContext* hwctx = (AVHWDeviceContext*)mVAAPIDeviceContext->data;
+ AVVAAPIDeviceContext* vactx = (AVVAAPIDeviceContext*)hwctx->hwctx;
+
+ mDisplay = mLib->vaGetDisplayWl(widget::WaylandDisplayGet()->GetDisplay());
+
+ hwctx->user_opaque = new VAAPIDisplayHolder(mLib, mDisplay);
+ hwctx->free = VAAPIDisplayReleaseCallback;
+
+ int major, minor;
+ int status = mLib->vaInitialize(mDisplay, &major, &minor);
+ if (status != VA_STATUS_SUCCESS) {
+ return false;
+ }
+
+ vactx->display = mDisplay;
+
+ if (mLib->av_hwdevice_ctx_init(mVAAPIDeviceContext) < 0) {
return false;
}
@@ -172,6 +202,11 @@
MediaResult FFmpegVideoDecoder<LIBAV_VER>::InitVAAPIDecoder() {
FFMPEG_LOG("Initialising VA-API FFmpeg decoder");
+ if (!mLib->IsVAAPIAvailable()) {
+ FFMPEG_LOG("libva library or symbols are missing.");
+ return NS_ERROR_NOT_AVAILABLE;
+ }
+
auto layersBackend = mImageAllocator
? mImageAllocator->GetCompositorBackendType()
: layers::LayersBackend::LAYERS_BASIC;
@@ -181,16 +216,6 @@
return NS_ERROR_NOT_AVAILABLE;
}
- if (!mLib->IsVAAPIAvailable()) {
- FFMPEG_LOG("libva library or symbols are missing.");
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- if (!gfxPlatformGtk::GetPlatform()->UseWaylandHardwareVideoDecoding()) {
- FFMPEG_LOG("VA-API FFmpeg is disabled by platform");
- return NS_ERROR_NOT_AVAILABLE;
- }
-
AVCodec* codec = FindVAAPICodec();
if (!codec) {
FFMPEG_LOG("Couldn't find ffmpeg VA-API decoder");
@@ -275,6 +300,7 @@
#ifdef MOZ_WAYLAND_USE_VAAPI
mVAAPIDeviceContext(nullptr),
mDisableHardwareDecoding(aDisableHardwareDecoding),
+ mDisplay(nullptr),
#endif
mImageAllocator(aAllocator),
mImageContainer(aImageContainer),
@@ -606,16 +632,10 @@
" duration=%" PRId64 " opaque=%" PRId64,
aPts, mFrame->pkt_dts, aDuration, mCodecContext->reordered_opaque);
- AVHWDeviceContext* device_ctx = (AVHWDeviceContext*)mVAAPIDeviceContext->data;
- AVVAAPIDeviceContext* VAAPIDeviceContext =
- (AVVAAPIDeviceContext*)device_ctx->hwctx;
VADRMPRIMESurfaceDescriptor va_desc;
-
VASurfaceID surface_id = (VASurfaceID)(uintptr_t)mFrame->data[3];
-
VAStatus vas = mLib->vaExportSurfaceHandle(
- VAAPIDeviceContext->display, surface_id,
- VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME_2,
+ mDisplay, surface_id, VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME_2,
VA_EXPORT_SURFACE_READ_ONLY | VA_EXPORT_SURFACE_SEPARATE_LAYERS,
&va_desc);
if (vas != VA_STATUS_SUCCESS) {
@@ -623,7 +643,7 @@
NS_ERROR_OUT_OF_MEMORY,
RESULT_DETAIL("Unable to get frame by vaExportSurfaceHandle()"));
}
- vas = mLib->vaSyncSurface(VAAPIDeviceContext->display, surface_id);
+ vas = mLib->vaSyncSurface(mDisplay, surface_id);
if (vas != VA_STATUS_SUCCESS) {
NS_WARNING("vaSyncSurface() failed.");
}
diff --git a/dom/media/platforms/ffmpeg/moz.build b/dom/media/platforms/ffmpeg/moz.build
--- a/dom/media/platforms/ffmpeg/moz.build
+++ b/dom/media/platforms/ffmpeg/moz.build
@@ -20,4 +20,7 @@
'FFmpegRuntimeLinker.cpp',
]
+if CONFIG['MOZ_WAYLAND']:
+ include('/ipc/chromium/chromium-config.mozbuild')
+
FINAL_LIBRARY = 'xul'

41
mozilla-1632059.patch Normal file
View file

@ -0,0 +1,41 @@
diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
@@ -178,7 +178,12 @@
AVHWDeviceContext* hwctx = (AVHWDeviceContext*)mVAAPIDeviceContext->data;
AVVAAPIDeviceContext* vactx = (AVVAAPIDeviceContext*)hwctx->hwctx;
- mDisplay = mLib->vaGetDisplayWl(widget::WaylandDisplayGet()->GetDisplay());
+ wl_display* display = widget::WaylandDisplayGetWLDisplay();
+ if (!display) {
+ FFMPEG_LOG("Can't get default wayland display.");
+ return false;
+ }
+ mDisplay = mLib->vaGetDisplayWl(display);
hwctx->user_opaque = new VAAPIDisplayHolder(mLib, mDisplay);
hwctx->free = VAAPIDisplayReleaseCallback;
diff --git a/widget/gtk/nsWaylandDisplay.cpp b/widget/gtk/nsWaylandDisplay.cpp
--- a/widget/gtk/nsWaylandDisplay.cpp
+++ b/widget/gtk/nsWaylandDisplay.cpp
@@ -35,6 +35,9 @@
wl_display* WaylandDisplayGetWLDisplay(GdkDisplay* aGdkDisplay) {
if (!aGdkDisplay) {
aGdkDisplay = gdk_display_get_default();
+ if (!aGdkDisplay || GDK_IS_X11_DISPLAY(aGdkDisplay)) {
+ return nullptr;
+ }
}
// Available as of GTK 3.8+
@@ -537,8 +540,7 @@
StaticPrefs::widget_wayland_dmabuf_webgl_enabled();
}
bool nsWaylandDisplay::IsDMABufVAAPIEnabled() {
- return IsDMABufEnabled() &&
- StaticPrefs::widget_wayland_dmabuf_vaapi_enabled();
+ return StaticPrefs::widget_wayland_dmabuf_vaapi_enabled();
}
void* nsGbmLib::sGbmLibHandle = nullptr;

52
mozilla-1632456.patch Normal file
View file

@ -0,0 +1,52 @@
changeset: 531979:da64e8ddf04b
tag: tip
parent: 531977:9a0589e208e8
user: Martin Stransky <stransky@redhat.com>
date: Mon May 25 22:29:45 2020 +0200
files: dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
description:
Bug 1632456 [Wayland] Release mVAAPIDeviceContext when FFmpegVideoDecoder::CreateVAAPIDeviceContext() fails, r?jya
Differential Revision: https://phabricator.services.mozilla.com/D76745
diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
@@ -187,32 +187,35 @@ bool FFmpegVideoDecoder<LIBAV_VER>::Crea
return false;
}
AVHWDeviceContext* hwctx = (AVHWDeviceContext*)mVAAPIDeviceContext->data;
AVVAAPIDeviceContext* vactx = (AVVAAPIDeviceContext*)hwctx->hwctx;
wl_display* display = widget::WaylandDisplayGetWLDisplay();
if (!display) {
FFMPEG_LOG("Can't get default wayland display.");
+ mLib->av_buffer_unref(&mVAAPIDeviceContext);
return false;
}
mDisplay = mLib->vaGetDisplayWl(display);
hwctx->user_opaque = new VAAPIDisplayHolder(mLib, mDisplay);
hwctx->free = VAAPIDisplayReleaseCallback;
int major, minor;
int status = mLib->vaInitialize(mDisplay, &major, &minor);
if (status != VA_STATUS_SUCCESS) {
+ mLib->av_buffer_unref(&mVAAPIDeviceContext);
return false;
}
vactx->display = mDisplay;
if (mLib->av_hwdevice_ctx_init(mVAAPIDeviceContext) < 0) {
+ mLib->av_buffer_unref(&mVAAPIDeviceContext);
return false;
}
mCodecContext->hw_device_ctx = mLib->av_buffer_ref(mVAAPIDeviceContext);
return true;
}
MediaResult FFmpegVideoDecoder<LIBAV_VER>::InitVAAPIDecoder() {

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.

View file

@ -1,550 +0,0 @@
diff -up firefox-127.0/media/ffvpx/libavcodec/codec_list.c.1667096 firefox-127.0/media/ffvpx/libavcodec/codec_list.c
--- firefox-127.0/media/ffvpx/libavcodec/codec_list.c.1667096 2024-06-06 23:33:57.000000000 +0200
+++ firefox-127.0/media/ffvpx/libavcodec/codec_list.c 2024-06-10 12:42:39.353913204 +0200
@@ -11,6 +11,9 @@ static const FFCodec * const codec_list[
#if CONFIG_MP3_DECODER
&ff_mp3_decoder,
#endif
+#ifdef CONFIG_LIBFDK_AAC
+ &ff_libfdk_aac_decoder,
+#endif
#if CONFIG_LIBDAV1D
&ff_libdav1d_decoder,
#endif
diff -up firefox-127.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 firefox-127.0/media/ffvpx/libavcodec/libfdk-aacdec.c
--- firefox-127.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 2024-06-10 12:42:39.354913201 +0200
+++ firefox-127.0/media/ffvpx/libavcodec/libfdk-aacdec.c 2024-06-10 16:28:30.332367814 +0200
@@ -0,0 +1,498 @@
+/*
+ * AAC decoder wrapper
+ * Copyright (c) 2012 Martin Storsjo
+ *
+ * This file is part of FFmpeg.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <fdk-aac/aacdecoder_lib.h>
+
+#include "libavutil/channel_layout.h"
+#include "libavutil/common.h"
+#include "libavutil/opt.h"
+#include "libavutil/mem.h"
+#include "avcodec.h"
+#include "codec_internal.h"
+#include "decode.h"
+
+#ifdef AACDECODER_LIB_VL0
+#define FDKDEC_VER_AT_LEAST(vl0, vl1) \
+ ((AACDECODER_LIB_VL0 > vl0) || \
+ (AACDECODER_LIB_VL0 == vl0 && AACDECODER_LIB_VL1 >= vl1))
+#else
+#define FDKDEC_VER_AT_LEAST(vl0, vl1) 0
+#endif
+
+#if !FDKDEC_VER_AT_LEAST(2, 5) // < 2.5.10
+#define AAC_PCM_MAX_OUTPUT_CHANNELS AAC_PCM_OUTPUT_CHANNELS
+#endif
+
+enum ConcealMethod {
+ CONCEAL_METHOD_SPECTRAL_MUTING = 0,
+ CONCEAL_METHOD_NOISE_SUBSTITUTION = 1,
+ CONCEAL_METHOD_ENERGY_INTERPOLATION = 2,
+ CONCEAL_METHOD_NB,
+};
+
+typedef struct FDKAACDecContext {
+ const AVClass *class;
+ HANDLE_AACDECODER handle;
+ uint8_t *decoder_buffer;
+ int decoder_buffer_size;
+ uint8_t *anc_buffer;
+ int conceal_method;
+ int drc_level;
+ int drc_boost;
+ int drc_heavy;
+ int drc_effect;
+ int drc_cut;
+ int album_mode;
+ int level_limit;
+#if FDKDEC_VER_AT_LEAST(2, 5) // 2.5.10
+ int output_delay_set;
+ int flush_samples;
+ int delay_samples;
+#endif
+ AVChannelLayout downmix_layout;
+} FDKAACDecContext;
+
+
+#define DMX_ANC_BUFFSIZE 128
+#define DECODER_MAX_CHANNELS 8
+#define DECODER_BUFFSIZE 2048 * sizeof(INT_PCM)
+
+#define OFFSET(x) offsetof(FDKAACDecContext, x)
+#define AD AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM
+static const AVOption fdk_aac_dec_options[] = {
+ { "conceal", "Error concealment method", OFFSET(conceal_method), AV_OPT_TYPE_INT, { .i64 = CONCEAL_METHOD_NOISE_SUBSTITUTION }, CONCEAL_METHOD_SPECTRAL_MUTING, CONCEAL_METHOD_NB - 1, AD, "conceal" },
+ { "spectral", "Spectral muting", 0, AV_OPT_TYPE_CONST, { .i64 = CONCEAL_METHOD_SPECTRAL_MUTING }, INT_MIN, INT_MAX, AD, "conceal" },
+ { "noise", "Noise Substitution", 0, AV_OPT_TYPE_CONST, { .i64 = CONCEAL_METHOD_NOISE_SUBSTITUTION }, INT_MIN, INT_MAX, AD, "conceal" },
+ { "energy", "Energy Interpolation", 0, AV_OPT_TYPE_CONST, { .i64 = CONCEAL_METHOD_ENERGY_INTERPOLATION }, INT_MIN, INT_MAX, AD, "conceal" },
+ { "drc_boost", "Dynamic Range Control: boost, where [0] is none and [127] is max boost",
+ OFFSET(drc_boost), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 127, AD, NULL },
+ { "drc_cut", "Dynamic Range Control: attenuation factor, where [0] is none and [127] is max compression",
+ OFFSET(drc_cut), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 127, AD, NULL },
+ { "drc_level", "Dynamic Range Control: reference level, quantized to 0.25dB steps where [0] is 0dB and [127] is -31.75dB, -1 for auto, and -2 for disabled",
+ OFFSET(drc_level), AV_OPT_TYPE_INT, { .i64 = -1}, -2, 127, AD, NULL },
+ { "drc_heavy", "Dynamic Range Control: heavy compression, where [1] is on (RF mode) and [0] is off",
+ OFFSET(drc_heavy), AV_OPT_TYPE_INT, { .i64 = -1}, -1, 1, AD, NULL },
+#if FDKDEC_VER_AT_LEAST(2, 5) // 2.5.10
+ { "level_limit", "Signal level limiting",
+ OFFSET(level_limit), AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, AD },
+#endif
+#if FDKDEC_VER_AT_LEAST(3, 0) // 3.0.0
+ { "drc_effect","Dynamic Range Control: effect type, where e.g. [0] is none and [6] is general",
+ OFFSET(drc_effect), AV_OPT_TYPE_INT, { .i64 = -1}, -1, 8, AD, NULL },
+#endif
+#if FDKDEC_VER_AT_LEAST(3, 1) // 3.1.0
+ { "album_mode","Dynamic Range Control: album mode, where [0] is off and [1] is on",
+ OFFSET(album_mode), AV_OPT_TYPE_INT, { .i64 = -1}, -1, 1, AD, NULL },
+#endif
+ { "downmix", "Request a specific channel layout from the decoder", OFFSET(downmix_layout), AV_OPT_TYPE_CHLAYOUT, {.str = NULL}, .flags = AD },
+ { NULL }
+};
+
+static const AVClass fdk_aac_dec_class = {
+ .class_name = "libfdk-aac decoder",
+ .item_name = av_default_item_name,
+ .option = fdk_aac_dec_options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
+static int get_stream_info(AVCodecContext *avctx)
+{
+ FDKAACDecContext *s = avctx->priv_data;
+ CStreamInfo *info = aacDecoder_GetStreamInfo(s->handle);
+ int channel_counts[0x24] = { 0 };
+ int i, ch_error = 0;
+ uint64_t ch_layout = 0;
+
+ if (!info) {
+ av_log(avctx, AV_LOG_ERROR, "Unable to get stream info\n");
+ return AVERROR_UNKNOWN;
+ }
+
+ if (info->sampleRate <= 0) {
+ av_log(avctx, AV_LOG_ERROR, "Stream info not initialized\n");
+ return AVERROR_UNKNOWN;
+ }
+ avctx->sample_rate = info->sampleRate;
+ avctx->frame_size = info->frameSize;
+#if FDKDEC_VER_AT_LEAST(2, 5) // 2.5.10
+ if (!s->output_delay_set && info->outputDelay) {
+ // Set this only once.
+ s->flush_samples = info->outputDelay;
+ s->delay_samples = info->outputDelay;
+ s->output_delay_set = 1;
+ }
+#endif
+
+ for (i = 0; i < info->numChannels; i++) {
+ AUDIO_CHANNEL_TYPE ctype = info->pChannelType[i];
+ if (ctype <= ACT_NONE || ctype >= FF_ARRAY_ELEMS(channel_counts)) {
+ av_log(avctx, AV_LOG_WARNING, "unknown channel type\n");
+ break;
+ }
+ channel_counts[ctype]++;
+ }
+ av_log(avctx, AV_LOG_DEBUG,
+ "%d channels - front:%d side:%d back:%d lfe:%d top:%d\n",
+ info->numChannels,
+ channel_counts[ACT_FRONT], channel_counts[ACT_SIDE],
+ channel_counts[ACT_BACK], channel_counts[ACT_LFE],
+ channel_counts[ACT_FRONT_TOP] + channel_counts[ACT_SIDE_TOP] +
+ channel_counts[ACT_BACK_TOP] + channel_counts[ACT_TOP]);
+
+ switch (channel_counts[ACT_FRONT]) {
+ case 4:
+ ch_layout |= AV_CH_LAYOUT_STEREO | AV_CH_FRONT_LEFT_OF_CENTER |
+ AV_CH_FRONT_RIGHT_OF_CENTER;
+ break;
+ case 3:
+ ch_layout |= AV_CH_LAYOUT_STEREO | AV_CH_FRONT_CENTER;
+ break;
+ case 2:
+ ch_layout |= AV_CH_LAYOUT_STEREO;
+ break;
+ case 1:
+ ch_layout |= AV_CH_FRONT_CENTER;
+ break;
+ default:
+ av_log(avctx, AV_LOG_WARNING,
+ "unsupported number of front channels: %d\n",
+ channel_counts[ACT_FRONT]);
+ ch_error = 1;
+ break;
+ }
+ if (channel_counts[ACT_SIDE] > 0) {
+ if (channel_counts[ACT_SIDE] == 2) {
+ ch_layout |= AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT;
+ } else {
+ av_log(avctx, AV_LOG_WARNING,
+ "unsupported number of side channels: %d\n",
+ channel_counts[ACT_SIDE]);
+ ch_error = 1;
+ }
+ }
+ if (channel_counts[ACT_BACK] > 0) {
+ switch (channel_counts[ACT_BACK]) {
+ case 3:
+ ch_layout |= AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT | AV_CH_BACK_CENTER;
+ break;
+ case 2:
+ ch_layout |= AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT;
+ break;
+ case 1:
+ ch_layout |= AV_CH_BACK_CENTER;
+ break;
+ default:
+ av_log(avctx, AV_LOG_WARNING,
+ "unsupported number of back channels: %d\n",
+ channel_counts[ACT_BACK]);
+ ch_error = 1;
+ break;
+ }
+ }
+ if (channel_counts[ACT_LFE] > 0) {
+ if (channel_counts[ACT_LFE] == 1) {
+ ch_layout |= AV_CH_LOW_FREQUENCY;
+ } else {
+ av_log(avctx, AV_LOG_WARNING,
+ "unsupported number of LFE channels: %d\n",
+ channel_counts[ACT_LFE]);
+ ch_error = 1;
+ }
+ }
+
+ av_channel_layout_uninit(&avctx->ch_layout);
+ av_channel_layout_from_mask(&avctx->ch_layout, ch_layout);
+ if (!ch_error && avctx->ch_layout.nb_channels != info->numChannels) {
+ av_log(avctx, AV_LOG_WARNING, "unsupported channel configuration\n");
+ ch_error = 1;
+ }
+ if (ch_error)
+ avctx->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC;
+
+ return 0;
+}
+
+static av_cold int fdk_aac_decode_close(AVCodecContext *avctx)
+{
+ FDKAACDecContext *s = avctx->priv_data;
+
+ if (s->handle)
+ aacDecoder_Close(s->handle);
+ av_freep(&s->decoder_buffer);
+ av_freep(&s->anc_buffer);
+
+ return 0;
+}
+
+static av_cold int fdk_aac_decode_init(AVCodecContext *avctx)
+{
+ FDKAACDecContext *s = avctx->priv_data;
+ AAC_DECODER_ERROR err;
+
+ s->handle = aacDecoder_Open(avctx->extradata_size ? TT_MP4_RAW : TT_MP4_ADTS, 1);
+ if (!s->handle) {
+ av_log(avctx, AV_LOG_ERROR, "Error opening decoder\n");
+ return AVERROR_UNKNOWN;
+ }
+
+ if (avctx->extradata_size) {
+ if ((err = aacDecoder_ConfigRaw(s->handle, &avctx->extradata,
+ &avctx->extradata_size)) != AAC_DEC_OK) {
+ av_log(avctx, AV_LOG_ERROR, "Unable to set extradata\n");
+ return AVERROR_INVALIDDATA;
+ }
+ }
+
+ if ((err = aacDecoder_SetParam(s->handle, AAC_CONCEAL_METHOD,
+ s->conceal_method)) != AAC_DEC_OK) {
+ av_log(avctx, AV_LOG_ERROR, "Unable to set error concealment method\n");
+ return AVERROR_UNKNOWN;
+ }
+
+#if FF_API_OLD_CHANNEL_LAYOUT
+FF_DISABLE_DEPRECATION_WARNINGS
+ if (avctx->request_channel_layout) {
+ av_channel_layout_uninit(&s->downmix_layout);
+ av_channel_layout_from_mask(&s->downmix_layout, avctx->request_channel_layout);
+ }
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+ if (s->downmix_layout.nb_channels > 0 &&
+ s->downmix_layout.order != AV_CHANNEL_ORDER_NATIVE) {
+ int downmix_channels = -1;
+
+ switch (s->downmix_layout.u.mask) {
+ case AV_CH_LAYOUT_STEREO:
+ case AV_CH_LAYOUT_STEREO_DOWNMIX:
+ downmix_channels = 2;
+ break;
+ case AV_CH_LAYOUT_MONO:
+ downmix_channels = 1;
+ break;
+ default:
+ av_log(avctx, AV_LOG_WARNING, "Invalid downmix option\n");
+ break;
+ }
+
+ if (downmix_channels != -1) {
+ if (aacDecoder_SetParam(s->handle, AAC_PCM_MAX_OUTPUT_CHANNELS,
+ downmix_channels) != AAC_DEC_OK) {
+ av_log(avctx, AV_LOG_WARNING, "Unable to set output channels in the decoder\n");
+ } else {
+ s->anc_buffer = av_malloc(DMX_ANC_BUFFSIZE);
+ if (!s->anc_buffer) {
+ av_log(avctx, AV_LOG_ERROR, "Unable to allocate ancillary buffer for the decoder\n");
+ return AVERROR(ENOMEM);
+ }
+ if (aacDecoder_AncDataInit(s->handle, s->anc_buffer, DMX_ANC_BUFFSIZE)) {
+ av_log(avctx, AV_LOG_ERROR, "Unable to register downmix ancillary buffer in the decoder\n");
+ return AVERROR_UNKNOWN;
+ }
+ }
+ }
+ }
+
+ if (s->drc_boost != -1) {
+ if (aacDecoder_SetParam(s->handle, AAC_DRC_BOOST_FACTOR, s->drc_boost) != AAC_DEC_OK) {
+ av_log(avctx, AV_LOG_ERROR, "Unable to set DRC boost factor in the decoder\n");
+ return AVERROR_UNKNOWN;
+ }
+ }
+
+ if (s->drc_cut != -1) {
+ if (aacDecoder_SetParam(s->handle, AAC_DRC_ATTENUATION_FACTOR, s->drc_cut) != AAC_DEC_OK) {
+ av_log(avctx, AV_LOG_ERROR, "Unable to set DRC attenuation factor in the decoder\n");
+ return AVERROR_UNKNOWN;
+ }
+ }
+
+ if (s->drc_level != -1) {
+ // This option defaults to -1, i.e. not calling
+ // aacDecoder_SetParam(AAC_DRC_REFERENCE_LEVEL) at all, which defaults
+ // to the level from DRC metadata, if available. The user can set
+ // -drc_level -2, which calls aacDecoder_SetParam(
+ // AAC_DRC_REFERENCE_LEVEL) with a negative value, which then
+ // explicitly disables the feature.
+ if (aacDecoder_SetParam(s->handle, AAC_DRC_REFERENCE_LEVEL, s->drc_level) != AAC_DEC_OK) {
+ av_log(avctx, AV_LOG_ERROR, "Unable to set DRC reference level in the decoder\n");
+ return AVERROR_UNKNOWN;
+ }
+ }
+
+ if (s->drc_heavy != -1) {
+ if (aacDecoder_SetParam(s->handle, AAC_DRC_HEAVY_COMPRESSION, s->drc_heavy) != AAC_DEC_OK) {
+ av_log(avctx, AV_LOG_ERROR, "Unable to set DRC heavy compression in the decoder\n");
+ return AVERROR_UNKNOWN;
+ }
+ }
+
+#if FDKDEC_VER_AT_LEAST(2, 5) // 2.5.10
+ // Setting this parameter to -1 enables the auto behaviour in the library.
+ if (aacDecoder_SetParam(s->handle, AAC_PCM_LIMITER_ENABLE, s->level_limit) != AAC_DEC_OK) {
+ av_log(avctx, AV_LOG_ERROR, "Unable to set in signal level limiting in the decoder\n");
+ return AVERROR_UNKNOWN;
+ }
+#endif
+
+#if FDKDEC_VER_AT_LEAST(3, 0) // 3.0.0
+ if (s->drc_effect != -1) {
+ if (aacDecoder_SetParam(s->handle, AAC_UNIDRC_SET_EFFECT, s->drc_effect) != AAC_DEC_OK) {
+ av_log(avctx, AV_LOG_ERROR, "Unable to set DRC effect type in the decoder\n");
+ return AVERROR_UNKNOWN;
+ }
+ }
+#endif
+
+#if FDKDEC_VER_AT_LEAST(3, 1) // 3.1.0
+ if (s->album_mode != -1) {
+ if (aacDecoder_SetParam(s->handle, AAC_UNIDRC_ALBUM_MODE, s->album_mode) != AAC_DEC_OK) {
+ av_log(avctx, AV_LOG_ERROR, "Unable to set album mode in the decoder\n");
+ return AVERROR_UNKNOWN;
+ }
+ }
+#endif
+
+ avctx->sample_fmt = AV_SAMPLE_FMT_S16;
+
+ s->decoder_buffer_size = DECODER_BUFFSIZE * DECODER_MAX_CHANNELS;
+ s->decoder_buffer = av_malloc(s->decoder_buffer_size);
+ if (!s->decoder_buffer)
+ return AVERROR(ENOMEM);
+
+ return 0;
+}
+
+static int fdk_aac_decode_frame(AVCodecContext *avctx, AVFrame *frame,
+ int *got_frame_ptr, AVPacket *avpkt)
+{
+ FDKAACDecContext *s = avctx->priv_data;
+ int ret;
+ AAC_DECODER_ERROR err;
+ UINT valid = avpkt->size;
+ UINT flags = 0;
+ int input_offset = 0;
+
+ if (avpkt->size) {
+ err = aacDecoder_Fill(s->handle, &avpkt->data, &avpkt->size, &valid);
+ if (err != AAC_DEC_OK) {
+ av_log(avctx, AV_LOG_ERROR, "aacDecoder_Fill() failed: %x\n", err);
+ return AVERROR_INVALIDDATA;
+ }
+ } else {
+#if FDKDEC_VER_AT_LEAST(2, 5) // 2.5.10
+ /* Handle decoder draining */
+ if (s->flush_samples > 0) {
+ flags |= AACDEC_FLUSH;
+ } else {
+ return AVERROR_EOF;
+ }
+#else
+ return AVERROR_EOF;
+#endif
+ }
+
+ err = aacDecoder_DecodeFrame(s->handle, (INT_PCM *) s->decoder_buffer,
+ s->decoder_buffer_size / sizeof(INT_PCM),
+ flags);
+ if (err == AAC_DEC_NOT_ENOUGH_BITS) {
+ ret = avpkt->size - valid;
+ goto end;
+ }
+ if (err != AAC_DEC_OK) {
+ av_log(avctx, AV_LOG_ERROR,
+ "aacDecoder_DecodeFrame() failed: %x\n", err);
+ ret = AVERROR_UNKNOWN;
+ goto end;
+ }
+
+ if ((ret = get_stream_info(avctx)) < 0)
+ goto end;
+ frame->nb_samples = avctx->frame_size;
+
+#if FDKDEC_VER_AT_LEAST(2, 5) // 2.5.10
+ if (flags & AACDEC_FLUSH) {
+ // Only return the right amount of samples at the end; if calling the
+ // decoder with AACDEC_FLUSH, it will keep returning frames indefinitely.
+ frame->nb_samples = FFMIN(s->flush_samples, frame->nb_samples);
+ av_log(s, AV_LOG_DEBUG, "Returning %d/%d delayed samples.\n",
+ frame->nb_samples, s->flush_samples);
+ s->flush_samples -= frame->nb_samples;
+ } else {
+ // Trim off samples from the start to compensate for extra decoder
+ // delay. We could also just adjust the pts, but this avoids
+ // including the extra samples in the output altogether.
+ if (s->delay_samples) {
+ int drop_samples = FFMIN(s->delay_samples, frame->nb_samples);
+ av_log(s, AV_LOG_DEBUG, "Dropping %d/%d delayed samples.\n",
+ drop_samples, s->delay_samples);
+ s->delay_samples -= drop_samples;
+ frame->nb_samples -= drop_samples;
+ input_offset = drop_samples * avctx->ch_layout.nb_channels;
+ if (frame->nb_samples <= 0)
+ return 0;
+ }
+ }
+#endif
+
+ if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
+ goto end;
+
+ memcpy(frame->extended_data[0], s->decoder_buffer + input_offset,
+ avctx->ch_layout.nb_channels * frame->nb_samples *
+ av_get_bytes_per_sample(avctx->sample_fmt));
+
+ *got_frame_ptr = 1;
+ ret = avpkt->size - valid;
+
+end:
+ return ret;
+}
+
+static av_cold void fdk_aac_decode_flush(AVCodecContext *avctx)
+{
+ FDKAACDecContext *s = avctx->priv_data;
+ AAC_DECODER_ERROR err;
+
+ if (!s->handle)
+ return;
+
+ if ((err = aacDecoder_SetParam(s->handle,
+ AAC_TPDEC_CLEAR_BUFFER, 1)) != AAC_DEC_OK)
+ av_log(avctx, AV_LOG_WARNING, "failed to clear buffer when flushing\n");
+}
+
+const FFCodec ff_libfdk_aac_decoder = {
+ .p.name = "libfdk_aac",
+ CODEC_LONG_NAME("Fraunhofer FDK AAC"),
+ .p.type = AVMEDIA_TYPE_AUDIO,
+ .p.id = AV_CODEC_ID_AAC,
+ .priv_data_size = sizeof(FDKAACDecContext),
+ .init = fdk_aac_decode_init,
+ FF_CODEC_DECODE_CB(fdk_aac_decode_frame),
+ .close = fdk_aac_decode_close,
+ .flush = fdk_aac_decode_flush,
+ .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF
+#if FDKDEC_VER_AT_LEAST(2, 5) // 2.5.10
+ | AV_CODEC_CAP_DELAY
+#endif
+ ,
+ .p.priv_class = &fdk_aac_dec_class,
+ .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
+ .p.wrapper_name = "libfdk",
+};
diff -up firefox-127.0/media/ffvpx/libavcodec/moz.build.1667096 firefox-127.0/media/ffvpx/libavcodec/moz.build
--- firefox-127.0/media/ffvpx/libavcodec/moz.build.1667096 2024-06-06 23:33:58.000000000 +0200
+++ firefox-127.0/media/ffvpx/libavcodec/moz.build 2024-06-10 12:42:39.354913201 +0200
@@ -151,6 +151,12 @@ else:
CXXFLAGS += CONFIG["MOZ_LIBVPX_CFLAGS"]
OS_LIBS += CONFIG["MOZ_LIBVPX_LIBS"]
+if CONFIG['MOZ_FDK_AAC']:
+ SOURCES += [
+ 'libfdk-aacdec.c',
+ ]
+ OS_LIBS += CONFIG['MOZ_FDK_AAC_LIBS']
+
SYMBOLS_FILE = 'avcodec.symbols'
NoVisibilityFlags()
diff -up firefox-127.0/toolkit/moz.configure.1667096 firefox-127.0/toolkit/moz.configure
--- firefox-127.0/toolkit/moz.configure.1667096 2024-06-10 12:42:39.312913316 +0200
+++ firefox-127.0/toolkit/moz.configure 2024-06-10 12:42:39.355913199 +0200
@@ -2412,6 +2412,15 @@ with only_when(compile_environment):
set_config("MOZ_SYSTEM_PNG", True, when="--with-system-png")
+# FDK AAC support
+# ==============================================================
+option('--with-system-fdk-aac',
+ help='Use system libfdk-aac (located with pkgconfig)')
+
+system_fdk_aac = pkg_check_modules('MOZ_FDK_AAC', 'fdk-aac',
+ when='--with-system-fdk-aac')
+
+set_config('MOZ_FDK_AAC', depends(when=system_fdk_aac)(lambda: True))
# FFmpeg's ffvpx configuration
# ==============================================================

111
mozilla-440908.patch Normal file
View file

@ -0,0 +1,111 @@
diff -up firefox-56.0/modules/libpref/prefapi.cpp.440908 firefox-56.0/modules/libpref/prefapi.cpp
--- firefox-56.0/modules/libpref/prefapi.cpp.440908 2017-09-14 22:15:52.000000000 +0200
+++ firefox-56.0/modules/libpref/prefapi.cpp 2017-09-25 10:39:39.266572792 +0200
@@ -1036,8 +1036,8 @@ void PREF_ReaderCallback(void *clo
PrefValue value,
PrefType type,
bool isDefault,
- bool isStickyDefault)
-
+ bool isStickyDefault,
+ bool isLocked)
{
uint32_t flags = 0;
if (isDefault) {
@@ -1049,4 +1049,6 @@ void PREF_ReaderCallback(void *clo
flags |= kPrefForceSet;
}
pref_HashPref(pref, value, type, flags);
+ if (isLocked)
+ PREF_LockPref(pref, true);
}
diff -up firefox-56.0/modules/libpref/prefapi.h.440908 firefox-56.0/modules/libpref/prefapi.h
--- firefox-56.0/modules/libpref/prefapi.h.440908 2017-07-31 18:20:51.000000000 +0200
+++ firefox-56.0/modules/libpref/prefapi.h 2017-09-25 10:39:39.267572789 +0200
@@ -246,8 +246,8 @@ void PREF_ReaderCallback( void *closure,
PrefValue value,
PrefType type,
bool isDefault,
- bool isStickyDefault);
-
+ bool isStickyDefault,
+ bool isLocked);
/*
* Callback whenever we change a preference
diff -up firefox-56.0/modules/libpref/prefread.cpp.440908 firefox-56.0/modules/libpref/prefread.cpp
--- firefox-56.0/modules/libpref/prefread.cpp.440908 2017-09-14 22:15:52.000000000 +0200
+++ firefox-56.0/modules/libpref/prefread.cpp 2017-09-25 10:39:39.267572789 +0200
@@ -43,6 +43,7 @@ enum {
#define BITS_PER_HEX_DIGIT 4
static const char kUserPref[] = "user_pref";
+static const char kLockPref[] = "lockPref";
static const char kPref[] = "pref";
static const char kPrefSticky[] = "sticky_pref";
static const char kTrue[] = "true";
@@ -146,7 +147,7 @@ pref_DoCallback(PrefParseState *ps)
break;
}
(*ps->reader)(ps->closure, ps->lb, value, ps->vtype, ps->fdefault,
- ps->fstickydefault);
+ ps->fstickydefault, ps->flock);
return true;
}
@@ -215,6 +216,7 @@ PREF_ParseBuf(PrefParseState *ps, const
ps->vtype = PrefType::Invalid;
ps->fdefault = false;
ps->fstickydefault = false;
+ ps->flock = false;
}
switch (c) {
case '/': /* begin comment block or line? */
@@ -225,11 +227,14 @@ PREF_ParseBuf(PrefParseState *ps, const
break;
case 'u': /* indicating user_pref */
case 's': /* indicating sticky_pref */
+ case 'l': /* indicating lockPref */
case 'p': /* indicating pref */
if (c == 'u') {
ps->smatch = kUserPref;
} else if (c == 's') {
ps->smatch = kPrefSticky;
+ } else if (c == 'l') {
+ ps->smatch = kLockPref;
} else {
ps->smatch = kPref;
}
@@ -277,8 +282,10 @@ PREF_ParseBuf(PrefParseState *ps, const
/* name parsing */
case PREF_PARSE_UNTIL_NAME:
if (c == '\"' || c == '\'') {
- ps->fdefault = (ps->smatch == kPref || ps->smatch == kPrefSticky);
+ ps->fdefault = (ps->smatch == kPref || ps->smatch == kPrefSticky
+ || ps->smatch == kLockPref);
ps->fstickydefault = (ps->smatch == kPrefSticky);
+ ps->flock = (ps->smatch == kLockPref);
ps->quotechar = c;
ps->nextstate = PREF_PARSE_UNTIL_COMMA; /* return here when done */
state = PREF_PARSE_QUOTED_STRING;
diff -up firefox-56.0/modules/libpref/prefread.h.440908 firefox-56.0/modules/libpref/prefread.h
--- firefox-56.0/modules/libpref/prefread.h.440908 2017-09-14 22:15:52.000000000 +0200
+++ firefox-56.0/modules/libpref/prefread.h 2017-09-25 10:39:39.267572789 +0200
@@ -34,7 +34,8 @@ typedef void (*PrefReader)(void *c
PrefValue val,
PrefType type,
bool defPref,
- bool stickyPref);
+ bool stickyPref,
+ bool lockPref);
/**
* Report any errors or warnings we encounter during parsing.
@@ -62,6 +63,7 @@ typedef struct PrefParseState {
PrefType vtype; /* PREF_STRING,INT,BOOL */
bool fdefault; /* true if (default) pref */
bool fstickydefault; /* true if (sticky) pref */
+ bool flock; /* true if pref to be locked */
} PrefParseState;
/**

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)

View file

@ -0,0 +1,157 @@
diff -up firefox-75.0/browser/components/shell/nsGNOMEShellSearchProvider.cpp.gnome-shell-search-fixes firefox-75.0/browser/components/shell/nsGNOMEShellSearchProvider.cpp
--- firefox-75.0/browser/components/shell/nsGNOMEShellSearchProvider.cpp.gnome-shell-search-fixes 2020-04-07 08:01:50.587124776 +0200
+++ firefox-75.0/browser/components/shell/nsGNOMEShellSearchProvider.cpp 2020-04-07 10:14:02.530380225 +0200
@@ -26,6 +26,8 @@
#include "nsIStringBundle.h"
#include "imgIContainer.h"
#include "imgITools.h"
+#include "nsNetCID.h"
+#include "nsIIOService.h"
#include "mozilla/gfx/DataSurfaceHelpers.h"
@@ -289,20 +291,12 @@ AsyncFaviconDataReady::OnComplete(nsIURI
}
void nsGNOMEShellSearchProvider::ComposeSearchResultReply(
- DBusMessage* reply, const char* aSearchTerm) {
+ DBusMessage* reply, const char* aSearchTerm, bool aSearchOnly) {
uint32_t childCount = 0;
- nsresult rv = mHistResultContainer->GetChildCount(&childCount);
- if (NS_FAILED(rv) || childCount == 0) {
- return;
- }
-
- // Obtain the favicon service and get the favicon for the specified page
- nsCOMPtr<nsIFaviconService> favIconSvc(
- do_GetService("@mozilla.org/browser/favicon-service;1"));
- nsCOMPtr<nsIIOService> ios(do_GetService(NS_IOSERVICE_CONTRACTID));
+ nsresult rv = NS_OK;
- if (childCount > MAX_SEARCH_RESULTS_NUM) {
- childCount = MAX_SEARCH_RESULTS_NUM;
+ if (!aSearchOnly) {
+ nsresult rv = mHistResultContainer->GetChildCount(&childCount);
}
DBusMessageIter iter;
@@ -310,30 +304,41 @@ void nsGNOMEShellSearchProvider::Compose
DBusMessageIter iterArray;
dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "s", &iterArray);
- for (uint32_t i = 0; i < childCount; i++) {
- nsCOMPtr<nsINavHistoryResultNode> child;
- mHistResultContainer->GetChild(i, getter_AddRefs(child));
- if (NS_WARN_IF(NS_FAILED(rv))) {
- continue;
- }
- if (!IsHistoryResultNodeURI(child)) {
- continue;
+ if (NS_SUCCEEDED(rv) && childCount > 0) {
+ // Obtain the favicon service and get the favicon for the specified page
+ nsCOMPtr<nsIFaviconService> favIconSvc(
+ do_GetService("@mozilla.org/browser/favicon-service;1"));
+ nsCOMPtr<nsIIOService> ios(do_GetService(NS_IOSERVICE_CONTRACTID));
+
+ if (childCount > MAX_SEARCH_RESULTS_NUM) {
+ childCount = MAX_SEARCH_RESULTS_NUM;
}
- nsAutoCString uri;
- child->GetUri(uri);
+ for (uint32_t i = 0; i < childCount; i++) {
+ nsCOMPtr<nsINavHistoryResultNode> child;
+ mHistResultContainer->GetChild(i, getter_AddRefs(child));
+ if (NS_WARN_IF(NS_FAILED(rv))) {
+ continue;
+ }
+ if (!child || !IsHistoryResultNodeURI(child)) {
+ continue;
+ }
- nsCOMPtr<nsIURI> iconIri;
- ios->NewURI(uri, nullptr, nullptr, getter_AddRefs(iconIri));
- nsCOMPtr<nsIFaviconDataCallback> callback =
- new AsyncFaviconDataReady(this, i, mSearchSerial);
- favIconSvc->GetFaviconDataForPage(iconIri, callback, 0);
+ nsAutoCString uri;
+ child->GetUri(uri);
- nsAutoCString idKey;
- GetIDKeyForURI(i, uri, idKey);
+ nsCOMPtr<nsIURI> iconIri;
+ ios->NewURI(uri, nullptr, nullptr, getter_AddRefs(iconIri));
+ nsCOMPtr<nsIFaviconDataCallback> callback =
+ new AsyncFaviconDataReady(this, i, mSearchSerial);
+ favIconSvc->GetFaviconDataForPage(iconIri, callback, 0);
- const char* id = idKey.get();
- dbus_message_iter_append_basic(&iterArray, DBUS_TYPE_STRING, &id);
+ nsAutoCString idKey;
+ GetIDKeyForURI(i, uri, idKey);
+
+ const char* id = idKey.get();
+ dbus_message_iter_append_basic(&iterArray, DBUS_TYPE_STRING, &id);
+ }
}
nsPrintfCString searchString("%s:%s", KEYWORD_SEARCH_STRING, aSearchTerm);
@@ -346,7 +351,7 @@ void nsGNOMEShellSearchProvider::Compose
DBusHandlerResult nsGNOMEShellSearchProvider::GetInitialResultSet(
DBusMessage* aMsg) {
DBusMessage* reply;
- char** stringArray;
+ char** stringArray = nullptr;
int elements;
if (!dbus_message_get_args(aMsg, nullptr, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING,
@@ -356,9 +361,10 @@ DBusHandlerResult nsGNOMEShellSearchProv
} else {
reply = dbus_message_new_method_return(aMsg);
nsresult rv = NewHistorySearch(stringArray[0]);
- if (NS_SUCCEEDED(rv)) {
- ComposeSearchResultReply(reply, stringArray[0]);
- }
+ ComposeSearchResultReply(reply, stringArray[0],
+ /* search only */ NS_FAILED(rv));
+ }
+ if (stringArray) {
dbus_free_string_array(stringArray);
}
@@ -384,9 +390,8 @@ DBusHandlerResult nsGNOMEShellSearchProv
} else {
reply = dbus_message_new_method_return(aMsg);
nsresult rv = NewHistorySearch(stringArray[0]);
- if (NS_SUCCEEDED(rv)) {
- ComposeSearchResultReply(reply, stringArray[0]);
- }
+ ComposeSearchResultReply(reply, stringArray[0],
+ /* search only */ NS_FAILED(rv));
}
if (unusedArray) {
@@ -556,6 +561,10 @@ void nsGNOMEShellSearchProvider::LaunchW
nsCOMPtr<nsINavHistoryResultNode> child;
mHistResultContainer->GetChild(keyIndex, getter_AddRefs(child));
+ if (!child) {
+ return;
+ }
+
nsAutoCString uri;
nsresult rv = child->GetUri(uri);
if (NS_FAILED(rv)) {
diff -up firefox-75.0/browser/components/shell/nsGNOMEShellSearchProvider.h.gnome-shell-search-fixes firefox-75.0/browser/components/shell/nsGNOMEShellSearchProvider.h
--- firefox-75.0/browser/components/shell/nsGNOMEShellSearchProvider.h.gnome-shell-search-fixes 2020-04-07 08:01:50.587124776 +0200
+++ firefox-75.0/browser/components/shell/nsGNOMEShellSearchProvider.h 2020-04-07 09:56:30.857553820 +0200
@@ -70,7 +70,8 @@ class nsGNOMEShellSearchProvider : publi
bool IsHistoryResultNodeURI(nsINavHistoryResultNode* aHistoryNode);
void AppendResultID(DBusMessageIter* aIter, const char* aID);
void AppendSearchID(DBusMessageIter* aIter, const char* aID);
- void ComposeSearchResultReply(DBusMessage* aReply, const char* aSearchTerm);
+ void ComposeSearchResultReply(DBusMessage* aReply, const char* aSearchTerm,
+ bool aSearchOnly);
void LaunchWithID(const char* aID, uint32_t aTimeStamp);
void LaunchWithAllResults(uint32_t aTimeStamp);

View file

@ -0,0 +1,453 @@
changeset: 504680:441b26f2d4f4
parent: 504674:5a55ac856fc4
user: Martin Stransky <stransky@redhat.com>
date: Mon Dec 02 12:21:08 2019 +0100
files: browser/components/shell/nsGNOMEShellSearchProvider.cpp browser/components/shell/nsGNOMEShellSearchProvider.h
description:
Bug 1239694 Use history icons with Gnome shell search provider, r?jhorak
Differential Revision: https://phabricator.services.mozilla.com/D55434
diff --git a/browser/components/shell/nsGNOMEShellSearchProvider.cpp b/browser/components/shell/nsGNOMEShellSearchProvider.cpp
--- a/browser/components/shell/nsGNOMEShellSearchProvider.cpp
+++ b/browser/components/shell/nsGNOMEShellSearchProvider.cpp
@@ -19,21 +19,27 @@
#include "nsPrintfCString.h"
#include "nsCOMPtr.h"
#include "nsGTKToolkit.h"
#include "nsINavHistoryService.h"
#include "nsToolkitCompsCID.h"
#include "nsIFaviconService.h"
#include "RemoteUtils.h"
#include "nsIStringBundle.h"
+#include "imgIContainer.h"
+#include "imgITools.h"
+
+#include "mozilla/gfx/DataSurfaceHelpers.h"
#include <dbus/dbus.h>
#include <dbus/dbus-glib-lowlevel.h>
-#define MAX_SEARCH_RESULTS_NUM 9
+using namespace mozilla;
+using namespace mozilla::gfx;
+
#define KEYWORD_SEARCH_STRING "special:search"
#define KEYWORD_SEARCH_STRING_LEN 14
#define DBUS_BUS_NAME "org.mozilla.Firefox.SearchProvider"
#define DBUS_OBJECT_PATH "/org/mozilla/Firefox/SearchProvider"
static const char* introspect_template =
"<!DOCTYPE node PUBLIC \"-//freedesktop//DTD D-BUS Object Introspection "
@@ -81,17 +87,35 @@ DBusHandlerResult nsGNOMEShellSearchProv
DBUS_TYPE_INVALID);
dbus_connection_send(mConnection, reply, nullptr);
dbus_message_unref(reply);
return DBUS_HANDLER_RESULT_HANDLED;
}
-nsresult nsGNOMEShellSearchProvider::QueryHistory(const char* aSearchTerm) {
+nsGNOMEShellSearchProvider::nsGNOMEShellSearchProvider()
+ : mConnection(nullptr), mSearchSerial(0) {
+ memset(mHistoryIcons, 0, sizeof(mHistoryIcons));
+}
+
+void nsGNOMEShellSearchProvider::SetHistoryIcon(int aSearchSerial,
+ UniquePtr<uint8_t[]> aData,
+ int aWidth, int aHeight,
+ int aIconIndex) {
+ MOZ_ASSERT(mSearchSerial == aSearchSerial);
+ MOZ_ASSERT(aIconIndex < MAX_SEARCH_RESULTS_NUM);
+ mHistoryIcons[aIconIndex].Set(aSearchSerial, std::move(aData), aWidth,
+ aHeight);
+}
+
+nsresult nsGNOMEShellSearchProvider::NewHistorySearch(const char* aSearchTerm) {
+ // Initialize new search which invalidates all preview ones
+ mSearchSerial++;
+
nsresult rv;
nsCOMPtr<nsINavHistoryQuery> histQuery;
rv = mHistoryService->GetNewQuery(getter_AddRefs(histQuery));
NS_ENSURE_SUCCESS(rv, rv);
nsAutoCString searchTerm(aSearchTerm);
rv = histQuery->SetSearchTerms(NS_ConvertUTF8toUTF16(searchTerm));
NS_ENSURE_SUCCESS(rv, rv);
@@ -165,24 +189,123 @@ void nsGNOMEShellSearchProvider::GetIDKe
int nsGNOMEShellSearchProvider::GetIndexFromIDKey(const char* aIDKey) {
// ID is NN:URL where NN is index to our current history
// result container.
char tmp[] = {aIDKey[0], aIDKey[1], '\0'};
return atoi(tmp);
}
+class AsyncFaviconDataReady final : public nsIFaviconDataCallback {
+ public:
+ NS_DECL_ISUPPORTS
+ NS_DECL_NSIFAVICONDATACALLBACK
+
+ AsyncFaviconDataReady(nsGNOMEShellSearchProvider* aSearchProvider,
+ int aIconIndex, int aSearchSerial)
+ : mSearchProvider(aSearchProvider),
+ mIconIndex(aIconIndex),
+ mSearchSerial(aSearchSerial){};
+
+ private:
+ ~AsyncFaviconDataReady() {}
+
+ nsGNOMEShellSearchProvider* mSearchProvider;
+ int mIconIndex;
+ int mSearchSerial;
+};
+
+NS_IMPL_ISUPPORTS(AsyncFaviconDataReady, nsIFaviconDataCallback)
+
+// Inspired by SurfaceToPackedBGRA
+static UniquePtr<uint8_t[]> SurfaceToPackedRGBA(DataSourceSurface* aSurface) {
+ IntSize size = aSurface->GetSize();
+ CheckedInt<size_t> bufferSize =
+ CheckedInt<size_t>(size.width * 4) * CheckedInt<size_t>(size.height);
+ if (!bufferSize.isValid()) {
+ return nullptr;
+ }
+ UniquePtr<uint8_t[]> imageBuffer(new (std::nothrow)
+ uint8_t[bufferSize.value()]);
+ if (!imageBuffer) {
+ return nullptr;
+ }
+
+ DataSourceSurface::MappedSurface map;
+ if (!aSurface->Map(DataSourceSurface::MapType::READ, &map)) {
+ return nullptr;
+ }
+
+ // Convert BGRA to RGBA
+ uint32_t* aSrc = (uint32_t*)map.mData;
+ uint32_t* aDst = (uint32_t*)imageBuffer.get();
+ for (int i = 0; i < size.width * size.height; i++, aDst++, aSrc++) {
+ *aDst = *aSrc & 0xff00ff00;
+ *aDst |= (*aSrc & 0xff) << 16;
+ *aDst |= (*aSrc & 0xff0000) >> 16;
+ }
+
+ aSurface->Unmap();
+
+ return imageBuffer;
+}
+
+NS_IMETHODIMP
+AsyncFaviconDataReady::OnComplete(nsIURI* aFaviconURI, uint32_t aDataLen,
+ const uint8_t* aData,
+ const nsACString& aMimeType,
+ uint16_t aWidth) {
+ // This is a callback from some previous search so we don't want it
+ if (mSearchSerial != mSearchProvider->GetSearchSerial() || !aData ||
+ !aDataLen) {
+ return NS_ERROR_FAILURE;
+ }
+
+ // Decode the image from the format it was returned to us in (probably PNG)
+ nsCOMPtr<imgIContainer> container;
+ nsCOMPtr<imgITools> imgtool = do_CreateInstance("@mozilla.org/image/tools;1");
+ nsresult rv = imgtool->DecodeImageFromBuffer(
+ reinterpret_cast<const char*>(aData), aDataLen, aMimeType,
+ getter_AddRefs(container));
+ NS_ENSURE_SUCCESS(rv, rv);
+
+ RefPtr<SourceSurface> surface = container->GetFrame(
+ imgIContainer::FRAME_FIRST,
+ imgIContainer::FLAG_SYNC_DECODE | imgIContainer::FLAG_ASYNC_NOTIFY);
+
+ if (!surface || surface->GetFormat() != SurfaceFormat::B8G8R8A8) {
+ return NS_ERROR_FAILURE;
+ }
+
+ // Allocate a new buffer that we own.
+ RefPtr<DataSourceSurface> dataSurface = surface->GetDataSurface();
+ UniquePtr<uint8_t[]> data = SurfaceToPackedRGBA(dataSurface);
+ if (!data) {
+ return NS_ERROR_OUT_OF_MEMORY;
+ }
+
+ mSearchProvider->SetHistoryIcon(mSearchSerial, std::move(data),
+ surface->GetSize().width,
+ surface->GetSize().height, mIconIndex);
+ return NS_OK;
+}
+
void nsGNOMEShellSearchProvider::ComposeSearchResultReply(
DBusMessage* reply, const char* aSearchTerm) {
uint32_t childCount = 0;
nsresult rv = mHistResultContainer->GetChildCount(&childCount);
if (NS_FAILED(rv) || childCount == 0) {
return;
}
+ // Obtain the favicon service and get the favicon for the specified page
+ nsCOMPtr<nsIFaviconService> favIconSvc(
+ do_GetService("@mozilla.org/browser/favicon-service;1"));
+ nsCOMPtr<nsIIOService> ios(do_GetService(NS_IOSERVICE_CONTRACTID));
+
if (childCount > MAX_SEARCH_RESULTS_NUM) {
childCount = MAX_SEARCH_RESULTS_NUM;
}
DBusMessageIter iter;
dbus_message_iter_init_append(reply, &iter);
DBusMessageIter iterArray;
dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "s", &iterArray);
@@ -195,16 +318,22 @@ void nsGNOMEShellSearchProvider::Compose
}
if (!IsHistoryResultNodeURI(child)) {
continue;
}
nsAutoCString uri;
child->GetUri(uri);
+ nsCOMPtr<nsIURI> iconIri;
+ ios->NewURI(uri, nullptr, nullptr, getter_AddRefs(iconIri));
+ nsCOMPtr<nsIFaviconDataCallback> callback =
+ new AsyncFaviconDataReady(this, i, mSearchSerial);
+ favIconSvc->GetFaviconDataForPage(iconIri, callback, 0);
+
nsAutoCString idKey;
GetIDKeyForURI(i, uri, idKey);
const char* id = idKey.get();
dbus_message_iter_append_basic(&iterArray, DBUS_TYPE_STRING, &id);
}
nsPrintfCString searchString("%s:%s", KEYWORD_SEARCH_STRING, aSearchTerm);
@@ -221,17 +350,17 @@ DBusHandlerResult nsGNOMEShellSearchProv
int elements;
if (!dbus_message_get_args(aMsg, nullptr, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING,
&stringArray, &elements, DBUS_TYPE_INVALID) ||
elements == 0) {
reply = dbus_message_new_error(aMsg, DBUS_BUS_NAME, "Wrong argument");
} else {
reply = dbus_message_new_method_return(aMsg);
- nsresult rv = QueryHistory(stringArray[0]);
+ nsresult rv = NewHistorySearch(stringArray[0]);
if (NS_SUCCEEDED(rv)) {
ComposeSearchResultReply(reply, stringArray[0]);
}
dbus_free_string_array(stringArray);
}
dbus_connection_send(mConnection, reply, nullptr);
dbus_message_unref(reply);
@@ -249,17 +378,17 @@ DBusHandlerResult nsGNOMEShellSearchProv
if (!dbus_message_get_args(aMsg, nullptr, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING,
&unusedArray, &unusedNum, DBUS_TYPE_ARRAY,
DBUS_TYPE_STRING, &stringArray, &elements,
DBUS_TYPE_INVALID) ||
elements == 0) {
reply = dbus_message_new_error(aMsg, DBUS_BUS_NAME, "Wrong argument");
} else {
reply = dbus_message_new_method_return(aMsg);
- nsresult rv = QueryHistory(stringArray[0]);
+ nsresult rv = NewHistorySearch(stringArray[0]);
if (NS_SUCCEEDED(rv)) {
ComposeSearchResultReply(reply, stringArray[0]);
}
}
if (unusedArray) {
dbus_free_string_array(unusedArray);
}
@@ -280,45 +409,88 @@ static void appendStringDictionary(DBusM
&iterDict);
dbus_message_iter_append_basic(&iterDict, DBUS_TYPE_STRING, &aKey);
dbus_message_iter_open_container(&iterDict, DBUS_TYPE_VARIANT, "s", &iterVar);
dbus_message_iter_append_basic(&iterVar, DBUS_TYPE_STRING, &aValue);
dbus_message_iter_close_container(&iterDict, &iterVar);
dbus_message_iter_close_container(aIter, &iterDict);
}
+/*
+ "icon-data": a tuple of type (iiibiiay) describing a pixbuf with width,
+ height, rowstride, has-alpha,
+ bits-per-sample, channels,
+ image data
+*/
+void GnomeHistoryIcon::AppendIcon(DBusMessageIter* aIter) {
+ DBusMessageIter iterDict, iterVar, iterStruct;
+ dbus_message_iter_open_container(aIter, DBUS_TYPE_DICT_ENTRY, nullptr,
+ &iterDict);
+ const char* key = "icon-data";
+ dbus_message_iter_append_basic(&iterDict, DBUS_TYPE_STRING, &key);
+ dbus_message_iter_open_container(&iterDict, DBUS_TYPE_VARIANT, "(iiibiiay)",
+ &iterVar);
+ dbus_message_iter_open_container(&iterVar, DBUS_TYPE_STRUCT, nullptr,
+ &iterStruct);
+
+ dbus_message_iter_append_basic(&iterStruct, DBUS_TYPE_INT32, &mWidth);
+ dbus_message_iter_append_basic(&iterStruct, DBUS_TYPE_INT32, &mHeight);
+ int rowstride = mWidth * 4;
+ dbus_message_iter_append_basic(&iterStruct, DBUS_TYPE_INT32, &rowstride);
+ int hasAlpha = true;
+ dbus_message_iter_append_basic(&iterStruct, DBUS_TYPE_BOOLEAN, &hasAlpha);
+ int bitsPerSample = 8;
+ dbus_message_iter_append_basic(&iterStruct, DBUS_TYPE_INT32, &bitsPerSample);
+ int channels = 4;
+ dbus_message_iter_append_basic(&iterStruct, DBUS_TYPE_INT32, &channels);
+
+ DBusMessageIter iterArray;
+ dbus_message_iter_open_container(&iterStruct, DBUS_TYPE_ARRAY, "y",
+ &iterArray);
+ unsigned char* array = mData.get();
+ dbus_message_iter_append_fixed_array(&iterArray, DBUS_TYPE_BYTE, &array,
+ mWidth * mHeight * 4);
+ dbus_message_iter_close_container(&iterStruct, &iterArray);
+
+ dbus_message_iter_close_container(&iterVar, &iterStruct);
+ dbus_message_iter_close_container(&iterDict, &iterVar);
+ dbus_message_iter_close_container(aIter, &iterDict);
+}
+
/* We can return those fields at GetResultMetas:
"id": the result ID
"name": the display name for the result
"icon": a serialized GIcon (see g_icon_serialize()), or alternatively,
"gicon": a textual representation of a GIcon (see g_icon_to_string()),
or alternativly,
"icon-data": a tuple of type (iiibiiay) describing a pixbuf with width,
height, rowstride, has-alpha, bits-per-sample, and image data
"description": an optional short description (1-2 lines)
*/
void nsGNOMEShellSearchProvider::AppendResultID(DBusMessageIter* aIter,
const char* aID) {
+ int index = GetIndexFromIDKey(aID);
nsCOMPtr<nsINavHistoryResultNode> child;
- mHistResultContainer->GetChild(GetIndexFromIDKey(aID), getter_AddRefs(child));
+ mHistResultContainer->GetChild(index, getter_AddRefs(child));
nsAutoCString title;
- if (NS_FAILED(child->GetTitle(title))) {
- return;
- }
+ nsAutoCString uri;
+ child->GetTitle(title);
+ child->GetUri(uri);
- if (title.IsEmpty()) {
- if (NS_FAILED(child->GetUri(title)) || title.IsEmpty()) {
- return;
- }
- }
+ const char* titleStr = !(title.IsEmpty()) ? title.get() : uri.get();
+ const char* descStr = uri.get();
- const char* titleStr = title.get();
appendStringDictionary(aIter, "id", aID);
appendStringDictionary(aIter, "name", titleStr);
- appendStringDictionary(aIter, "gicon", "text-html");
+ appendStringDictionary(aIter, "description", descStr);
+ if (mHistoryIcons[index].GetSearchSerial() == mSearchSerial) {
+ mHistoryIcons[index].AppendIcon(aIter);
+ } else {
+ appendStringDictionary(aIter, "gicon", "text-html");
+ }
}
void nsGNOMEShellSearchProvider::AppendSearchID(DBusMessageIter* aIter,
const char* aID) {
if (strlen(aID) < KEYWORD_SEARCH_STRING_LEN + 2) {
return;
}
appendStringDictionary(aIter, "id", KEYWORD_SEARCH_STRING);
diff --git a/browser/components/shell/nsGNOMEShellSearchProvider.h b/browser/components/shell/nsGNOMEShellSearchProvider.h
--- a/browser/components/shell/nsGNOMEShellSearchProvider.h
+++ b/browser/components/shell/nsGNOMEShellSearchProvider.h
@@ -7,49 +7,81 @@
#ifndef __nsGNOMEShellSearchProvider_h__
#define __nsGNOMEShellSearchProvider_h__
#include "mozilla/DBusHelpers.h"
#include "nsINavHistoryService.h"
#include "nsUnixRemoteServer.h"
#include "nsCOMPtr.h"
+#include "mozilla/UniquePtr.h"
+
+#define MAX_SEARCH_RESULTS_NUM 9
+
+class GnomeHistoryIcon {
+ public:
+ GnomeHistoryIcon() : mSearchSerial(-1), mWidth(0), mHeight(0){};
+
+ // From which search is this icon
+ void Set(int aSearchSerial, mozilla::UniquePtr<uint8_t[]> aData, int aWidth,
+ int aHeight) {
+ mSearchSerial = aSearchSerial;
+ mWidth = aWidth;
+ mHeight = aHeight;
+ mData = std::move(aData);
+ }
+
+ int GetSearchSerial() { return mSearchSerial; }
+ void AppendIcon(DBusMessageIter* aIter);
+
+ private:
+ int mSearchSerial;
+ mozilla::UniquePtr<uint8_t[]> mData;
+ int mWidth;
+ int mHeight;
+};
class nsGNOMEShellSearchProvider : public nsUnixRemoteServer {
public:
- nsGNOMEShellSearchProvider() : mConnection(nullptr) {}
+ nsGNOMEShellSearchProvider();
~nsGNOMEShellSearchProvider() { Shutdown(); }
nsresult Startup();
void Shutdown();
DBusHandlerResult HandleDBusMessage(DBusConnection* aConnection,
DBusMessage* msg);
void UnregisterDBusInterface(DBusConnection* aConnection);
+ int GetSearchSerial() { return mSearchSerial; }
+ void SetHistoryIcon(int aSearchSerial, mozilla::UniquePtr<uint8_t[]> aData,
+ int aWidth, int aHeight, int aIconIndex);
+
private:
DBusHandlerResult Introspect(DBusMessage* msg);
DBusHandlerResult GetInitialResultSet(DBusMessage* msg);
DBusHandlerResult GetSubsearchResultSet(DBusMessage* msg);
DBusHandlerResult GetResultMetas(DBusMessage* msg);
DBusHandlerResult ActivateResult(DBusMessage* msg);
DBusHandlerResult LaunchSearch(DBusMessage* msg);
- nsresult QueryHistory(const char* aSearchTerm);
+ nsresult NewHistorySearch(const char* aSearchTerm);
void GetIDKeyForURI(int aIndex, nsAutoCString& aUri, nsAutoCString& aIDKey);
int GetIndexFromIDKey(const char* aIDKey);
bool IsHistoryResultNodeURI(nsINavHistoryResultNode* aHistoryNode);
void AppendResultID(DBusMessageIter* aIter, const char* aID);
void AppendSearchID(DBusMessageIter* aIter, const char* aID);
void ComposeSearchResultReply(DBusMessage* aReply, const char* aSearchTerm);
void LaunchWithID(const char* aID, uint32_t aTimeStamp);
void LaunchWithAllResults(uint32_t aTimeStamp);
// The connection is owned by DBus library
RefPtr<DBusConnection> mConnection;
nsCOMPtr<nsINavHistoryContainerResultNode> mHistResultContainer;
nsCOMPtr<nsINavHistoryService> mHistoryService;
nsAutoCStringN<32> mSearchTerm;
nsAutoCString mGnomeSearchTitle;
+ int mSearchSerial;
+ GnomeHistoryIcon mHistoryIcons[MAX_SEARCH_RESULTS_NUM];
};
#endif // __nsGNOMEShellSearchProvider_h__

View file

@ -0,0 +1,786 @@
diff -up firefox-73.0/browser/components/shell/moz.build.gnome-shell-search-provider firefox-73.0/browser/components/shell/moz.build
--- firefox-73.0/browser/components/shell/moz.build.gnome-shell-search-provider 2020-02-07 22:12:59.000000000 +0100
+++ firefox-73.0/browser/components/shell/moz.build 2020-02-11 09:03:31.638803105 +0100
@@ -34,6 +34,11 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gt
SOURCES += [
'nsGNOMEShellService.cpp',
]
+ if CONFIG['MOZ_ENABLE_DBUS']:
+ SOURCES += [
+ 'nsGNOMEShellSearchProvider.cpp',
+ ]
+
elif CONFIG['OS_ARCH'] == 'WINNT':
XPIDL_SOURCES += [
'nsIWindowsShellService.idl',
@@ -60,6 +65,8 @@ for var in ('MOZ_APP_NAME', 'MOZ_APP_VER
DEFINES[var] = '"%s"' % CONFIG[var]
CXXFLAGS += CONFIG['TK_CFLAGS']
+if CONFIG['MOZ_ENABLE_DBUS']:
+ CXXFLAGS += CONFIG['MOZ_DBUS_GLIB_CFLAGS']
with Files('**'):
BUG_COMPONENT = ('Firefox', 'Shell Integration')
diff -up firefox-73.0/browser/components/shell/nsGNOMEShellSearchProvider.cpp.gnome-shell-search-provider firefox-73.0/browser/components/shell/nsGNOMEShellSearchProvider.cpp
--- firefox-73.0/browser/components/shell/nsGNOMEShellSearchProvider.cpp.gnome-shell-search-provider 2020-02-11 09:00:59.350512802 +0100
+++ firefox-73.0/browser/components/shell/nsGNOMEShellSearchProvider.cpp 2020-02-11 09:00:59.350512802 +0100
@@ -0,0 +1,621 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim:expandtab:shiftwidth=2:tabstop=2:
+ */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "nsGNOMEShellSearchProvider.h"
+
+#include "nsIBaseWindow.h"
+#include "nsIDocShell.h"
+#include "nsPIDOMWindow.h"
+#include "mozilla/ModuleUtils.h"
+#include "mozilla/Base64.h"
+#include "nsIServiceManager.h"
+#include "nsIWidget.h"
+#include "nsIAppShellService.h"
+#include "nsAppShellCID.h"
+#include "nsPrintfCString.h"
+#include "nsCOMPtr.h"
+#include "nsGTKToolkit.h"
+#include "nsINavHistoryService.h"
+#include "nsToolkitCompsCID.h"
+#include "nsIFaviconService.h"
+#include "RemoteUtils.h"
+#include "nsIStringBundle.h"
+
+#include <dbus/dbus.h>
+#include <dbus/dbus-glib-lowlevel.h>
+
+#define MAX_SEARCH_RESULTS_NUM 9
+#define KEYWORD_SEARCH_STRING "special:search"
+#define KEYWORD_SEARCH_STRING_LEN 14
+
+#define DBUS_BUS_NAME "org.mozilla.Firefox.SearchProvider"
+#define DBUS_OBJECT_PATH "/org/mozilla/Firefox/SearchProvider"
+
+static const char* introspect_template =
+ "<!DOCTYPE node PUBLIC \"-//freedesktop//DTD D-BUS Object Introspection "
+ "1.0//EN\"\n"
+ "\"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd\";>\n"
+ "<node>\n"
+ " <interface name=\"org.freedesktop.DBus.Introspectable\">\n"
+ " <method name=\"Introspect\">\n"
+ " <arg name=\"data\" direction=\"out\" type=\"s\"/>\n"
+ " </method>\n"
+ " </interface>\n"
+ " <interface name=\"org.gnome.Shell.SearchProvider2\">\n"
+ " <method name=\"GetInitialResultSet\">\n"
+ " <arg type=\"as\" name=\"terms\" direction=\"in\" />\n"
+ " <arg type=\"as\" name=\"results\" direction=\"out\" />\n"
+ " </method>\n"
+ " <method name=\"GetSubsearchResultSet\">\n"
+ " <arg type=\"as\" name=\"previous_results\" direction=\"in\" />\n"
+ " <arg type=\"as\" name=\"terms\" direction=\"in\" />\n"
+ " <arg type=\"as\" name=\"results\" direction=\"out\" />\n"
+ " </method>\n"
+ " <method name=\"GetResultMetas\">\n"
+ " <arg type=\"as\" name=\"identifiers\" direction=\"in\" />\n"
+ " <arg type=\"aa{sv}\" name=\"metas\" direction=\"out\" />\n"
+ " </method>\n"
+ " <method name=\"ActivateResult\">\n"
+ " <arg type=\"s\" name=\"identifier\" direction=\"in\" />\n"
+ " <arg type=\"as\" name=\"terms\" direction=\"in\" />\n"
+ " <arg type=\"u\" name=\"timestamp\" direction=\"in\" />\n"
+ " </method>\n"
+ " <method name=\"LaunchSearch\">\n"
+ " <arg type=\"as\" name=\"terms\" direction=\"in\" />\n"
+ " <arg type=\"u\" name=\"timestamp\" direction=\"in\" />\n"
+ " </method>\n"
+ "</interface>\n"
+ "</node>\n";
+
+DBusHandlerResult nsGNOMEShellSearchProvider::Introspect(DBusMessage* aMsg) {
+ DBusMessage* reply;
+
+ reply = dbus_message_new_method_return(aMsg);
+ if (!reply) return DBUS_HANDLER_RESULT_NEED_MEMORY;
+
+ dbus_message_append_args(reply, DBUS_TYPE_STRING, &introspect_template,
+ DBUS_TYPE_INVALID);
+
+ dbus_connection_send(mConnection, reply, nullptr);
+ dbus_message_unref(reply);
+
+ return DBUS_HANDLER_RESULT_HANDLED;
+}
+
+nsresult nsGNOMEShellSearchProvider::QueryHistory(const char* aSearchTerm) {
+ nsresult rv;
+ nsCOMPtr<nsINavHistoryQuery> histQuery;
+ rv = mHistoryService->GetNewQuery(getter_AddRefs(histQuery));
+ NS_ENSURE_SUCCESS(rv, rv);
+
+ nsAutoCString searchTerm(aSearchTerm);
+ rv = histQuery->SetSearchTerms(NS_ConvertUTF8toUTF16(searchTerm));
+ NS_ENSURE_SUCCESS(rv, rv);
+
+ nsCOMPtr<nsINavHistoryQueryOptions> histQueryOpts;
+ rv = mHistoryService->GetNewQueryOptions(getter_AddRefs(histQueryOpts));
+ NS_ENSURE_SUCCESS(rv, rv);
+
+ // We want to get the URIs for every item in the user's history with the
+ // given host
+ rv = histQueryOpts->SetResultType(nsINavHistoryQueryOptions::RESULTS_AS_URI);
+ NS_ENSURE_SUCCESS(rv, rv);
+
+ rv = histQueryOpts->SetSortingMode(
+ nsINavHistoryQueryOptions::SORT_BY_VISITCOUNT_DESCENDING);
+ NS_ENSURE_SUCCESS(rv, rv);
+
+ rv = histQueryOpts->SetMaxResults(MAX_SEARCH_RESULTS_NUM);
+ NS_ENSURE_SUCCESS(rv, rv);
+
+ // We only search history, because searching both bookmarks and history
+ // is not supported, and history tends to be more comprehensive.
+ rv = histQueryOpts->SetQueryType(
+ nsINavHistoryQueryOptions::QUERY_TYPE_HISTORY);
+ NS_ENSURE_SUCCESS(rv, rv);
+
+ nsCOMPtr<nsINavHistoryResult> histResult;
+ rv = mHistoryService->ExecuteQuery(histQuery, histQueryOpts,
+ getter_AddRefs(histResult));
+ NS_ENSURE_SUCCESS(rv, rv);
+
+ // Delete former search results
+ mHistResultContainer = nullptr;
+
+ rv = histResult->GetRoot(getter_AddRefs(mHistResultContainer));
+ NS_ENSURE_SUCCESS(rv, rv);
+
+ rv = mHistResultContainer->SetContainerOpen(true);
+ NS_ENSURE_SUCCESS(rv, rv);
+
+ uint32_t childCount = 0;
+ rv = mHistResultContainer->GetChildCount(&childCount);
+ NS_ENSURE_SUCCESS(rv, rv);
+
+ return childCount != 0 ? NS_OK : NS_ERROR_FAILURE;
+}
+
+bool nsGNOMEShellSearchProvider::IsHistoryResultNodeURI(
+ nsINavHistoryResultNode* aHistoryNode) {
+ uint32_t type;
+ nsresult rv = aHistoryNode->GetType(&type);
+ if (NS_FAILED(rv) || type != nsINavHistoryResultNode::RESULT_TYPE_URI)
+ return false;
+
+ nsAutoCString title;
+ rv = aHistoryNode->GetTitle(title);
+ if (NS_SUCCEEDED(rv) && !title.IsEmpty()) {
+ return true;
+ }
+
+ rv = aHistoryNode->GetUri(title);
+ return NS_SUCCEEDED(rv) && !title.IsEmpty();
+}
+
+void nsGNOMEShellSearchProvider::GetIDKeyForURI(int aIndex, nsAutoCString& aUri,
+ nsAutoCString& aIDKey) {
+ // Compose ID as NN:URL where NN is index to our current history
+ // result container.
+ aIDKey = nsPrintfCString("%.2d:%s", aIndex, aUri.get());
+}
+
+int nsGNOMEShellSearchProvider::GetIndexFromIDKey(const char* aIDKey) {
+ // ID is NN:URL where NN is index to our current history
+ // result container.
+ char tmp[] = {aIDKey[0], aIDKey[1], '\0'};
+ return atoi(tmp);
+}
+
+void nsGNOMEShellSearchProvider::ComposeSearchResultReply(
+ DBusMessage* reply, const char* aSearchTerm) {
+ uint32_t childCount = 0;
+ nsresult rv = mHistResultContainer->GetChildCount(&childCount);
+ if (NS_FAILED(rv) || childCount == 0) {
+ return;
+ }
+
+ if (childCount > MAX_SEARCH_RESULTS_NUM) {
+ childCount = MAX_SEARCH_RESULTS_NUM;
+ }
+
+ DBusMessageIter iter;
+ dbus_message_iter_init_append(reply, &iter);
+ DBusMessageIter iterArray;
+ dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "s", &iterArray);
+
+ for (uint32_t i = 0; i < childCount; i++) {
+ nsCOMPtr<nsINavHistoryResultNode> child;
+ mHistResultContainer->GetChild(i, getter_AddRefs(child));
+ if (NS_WARN_IF(NS_FAILED(rv))) {
+ continue;
+ }
+ if (!IsHistoryResultNodeURI(child)) {
+ continue;
+ }
+
+ nsAutoCString uri;
+ child->GetUri(uri);
+
+ nsAutoCString idKey;
+ GetIDKeyForURI(i, uri, idKey);
+
+ const char* id = idKey.get();
+ dbus_message_iter_append_basic(&iterArray, DBUS_TYPE_STRING, &id);
+ }
+
+ nsPrintfCString searchString("%s:%s", KEYWORD_SEARCH_STRING, aSearchTerm);
+ const char* search = searchString.get();
+ dbus_message_iter_append_basic(&iterArray, DBUS_TYPE_STRING, &search);
+
+ dbus_message_iter_close_container(&iter, &iterArray);
+}
+
+DBusHandlerResult nsGNOMEShellSearchProvider::GetInitialResultSet(
+ DBusMessage* aMsg) {
+ DBusMessage* reply;
+ char** stringArray;
+ int elements;
+
+ if (!dbus_message_get_args(aMsg, nullptr, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING,
+ &stringArray, &elements, DBUS_TYPE_INVALID) ||
+ elements == 0) {
+ reply = dbus_message_new_error(aMsg, DBUS_BUS_NAME, "Wrong argument");
+ } else {
+ reply = dbus_message_new_method_return(aMsg);
+ nsresult rv = QueryHistory(stringArray[0]);
+ if (NS_SUCCEEDED(rv)) {
+ ComposeSearchResultReply(reply, stringArray[0]);
+ }
+ dbus_free_string_array(stringArray);
+ }
+
+ dbus_connection_send(mConnection, reply, nullptr);
+ dbus_message_unref(reply);
+
+ return DBUS_HANDLER_RESULT_HANDLED;
+}
+
+DBusHandlerResult nsGNOMEShellSearchProvider::GetSubsearchResultSet(
+ DBusMessage* aMsg) {
+ DBusMessage* reply;
+
+ char **unusedArray = nullptr, **stringArray = nullptr;
+ int unusedNum, elements;
+
+ if (!dbus_message_get_args(aMsg, nullptr, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING,
+ &unusedArray, &unusedNum, DBUS_TYPE_ARRAY,
+ DBUS_TYPE_STRING, &stringArray, &elements,
+ DBUS_TYPE_INVALID) ||
+ elements == 0) {
+ reply = dbus_message_new_error(aMsg, DBUS_BUS_NAME, "Wrong argument");
+ } else {
+ reply = dbus_message_new_method_return(aMsg);
+ nsresult rv = QueryHistory(stringArray[0]);
+ if (NS_SUCCEEDED(rv)) {
+ ComposeSearchResultReply(reply, stringArray[0]);
+ }
+ }
+
+ if (unusedArray) {
+ dbus_free_string_array(unusedArray);
+ }
+ if (stringArray) {
+ dbus_free_string_array(stringArray);
+ }
+
+ dbus_connection_send(mConnection, reply, nullptr);
+ dbus_message_unref(reply);
+
+ return DBUS_HANDLER_RESULT_HANDLED;
+}
+
+static void appendStringDictionary(DBusMessageIter* aIter, const char* aKey,
+ const char* aValue) {
+ DBusMessageIter iterDict, iterVar;
+ dbus_message_iter_open_container(aIter, DBUS_TYPE_DICT_ENTRY, nullptr,
+ &iterDict);
+ dbus_message_iter_append_basic(&iterDict, DBUS_TYPE_STRING, &aKey);
+ dbus_message_iter_open_container(&iterDict, DBUS_TYPE_VARIANT, "s", &iterVar);
+ dbus_message_iter_append_basic(&iterVar, DBUS_TYPE_STRING, &aValue);
+ dbus_message_iter_close_container(&iterDict, &iterVar);
+ dbus_message_iter_close_container(aIter, &iterDict);
+}
+
+/* We can return those fields at GetResultMetas:
+ "id": the result ID
+ "name": the display name for the result
+ "icon": a serialized GIcon (see g_icon_serialize()), or alternatively,
+ "gicon": a textual representation of a GIcon (see g_icon_to_string()),
+ or alternativly,
+ "icon-data": a tuple of type (iiibiiay) describing a pixbuf with width,
+ height, rowstride, has-alpha, bits-per-sample, and image data
+ "description": an optional short description (1-2 lines)
+*/
+void nsGNOMEShellSearchProvider::AppendResultID(DBusMessageIter* aIter,
+ const char* aID) {
+ nsCOMPtr<nsINavHistoryResultNode> child;
+ mHistResultContainer->GetChild(GetIndexFromIDKey(aID), getter_AddRefs(child));
+ nsAutoCString title;
+ if (NS_FAILED(child->GetTitle(title))) {
+ return;
+ }
+
+ if (title.IsEmpty()) {
+ if (NS_FAILED(child->GetUri(title)) || title.IsEmpty()) {
+ return;
+ }
+ }
+
+ const char* titleStr = title.get();
+ appendStringDictionary(aIter, "id", aID);
+ appendStringDictionary(aIter, "name", titleStr);
+ appendStringDictionary(aIter, "gicon", "text-html");
+}
+
+void nsGNOMEShellSearchProvider::AppendSearchID(DBusMessageIter* aIter,
+ const char* aID) {
+ if (strlen(aID) < KEYWORD_SEARCH_STRING_LEN + 2) {
+ return;
+ }
+ appendStringDictionary(aIter, "id", KEYWORD_SEARCH_STRING);
+ mSearchTerm = nsAutoCStringN<32>(aID + KEYWORD_SEARCH_STRING_LEN + 1);
+ nsPrintfCString searchString(mGnomeSearchTitle.get(), mSearchTerm.get());
+ appendStringDictionary(aIter, "name", searchString.get());
+ appendStringDictionary(aIter, "gicon", "org.mozilla.Firefox");
+}
+
+DBusHandlerResult nsGNOMEShellSearchProvider::GetResultMetas(
+ DBusMessage* aMsg) {
+ DBusMessage* reply;
+ char** stringArray;
+ int elements;
+
+ if (!dbus_message_get_args(aMsg, nullptr, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING,
+ &stringArray, &elements, DBUS_TYPE_INVALID) ||
+ elements == 0) {
+ reply = dbus_message_new_error(aMsg, DBUS_BUS_NAME, "Wrong argument");
+ } else {
+ reply = dbus_message_new_method_return(aMsg);
+
+ DBusMessageIter iter;
+ dbus_message_iter_init_append(reply, &iter);
+ DBusMessageIter iterArray;
+ dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "a{sv}",
+ &iterArray);
+
+ DBusMessageIter iterArray2;
+ for (int i = 0; i < elements; i++) {
+ dbus_message_iter_open_container(&iterArray, DBUS_TYPE_ARRAY, "{sv}",
+ &iterArray2);
+ if (strncmp(stringArray[i], KEYWORD_SEARCH_STRING,
+ KEYWORD_SEARCH_STRING_LEN) == 0) {
+ AppendSearchID(&iterArray2, stringArray[i]);
+ } else {
+ AppendResultID(&iterArray2, stringArray[i]);
+ }
+ dbus_message_iter_close_container(&iterArray, &iterArray2);
+ }
+
+ dbus_message_iter_close_container(&iter, &iterArray);
+ dbus_free_string_array(stringArray);
+ }
+
+ dbus_connection_send(mConnection, reply, nullptr);
+ dbus_message_unref(reply);
+
+ return DBUS_HANDLER_RESULT_HANDLED;
+}
+
+void nsGNOMEShellSearchProvider::LaunchWithID(const char* aID,
+ uint32_t aTimeStamp) {
+ char* commandLine = nullptr;
+ int tmp;
+
+ if (strncmp(aID, KEYWORD_SEARCH_STRING, KEYWORD_SEARCH_STRING_LEN) == 0) {
+ nsPrintfCString searchString("search:%s", mSearchTerm.get());
+ const char* urlList[2] = {"unused", searchString.get()};
+ commandLine = ConstructCommandLine(2, (char**)urlList, 0, &tmp);
+ } else {
+ int keyIndex = atoi(aID);
+ nsCOMPtr<nsINavHistoryResultNode> child;
+ mHistResultContainer->GetChild(keyIndex, getter_AddRefs(child));
+
+ nsAutoCString uri;
+ nsresult rv = child->GetUri(uri);
+ if (NS_FAILED(rv)) {
+ return;
+ }
+
+ const char* urlList[2] = {"unused", uri.get()};
+ commandLine = ConstructCommandLine(2, (char**)urlList, 0, &tmp);
+ }
+
+ if (commandLine) {
+ HandleCommandLine(commandLine, aTimeStamp);
+ free(commandLine);
+ }
+}
+
+void nsGNOMEShellSearchProvider::LaunchWithAllResults(uint32_t aTimeStamp) {
+ uint32_t childCount = 0;
+ nsresult rv = mHistResultContainer->GetChildCount(&childCount);
+ if (NS_FAILED(rv) || childCount == 0) {
+ return;
+ }
+
+ if (childCount > MAX_SEARCH_RESULTS_NUM) {
+ childCount = MAX_SEARCH_RESULTS_NUM;
+ }
+
+ char** urlList = (char**)moz_xmalloc(sizeof(char*) * (childCount + 2));
+ int urlListElements = 0;
+
+ urlList[urlListElements++] = strdup("unused");
+
+ for (uint32_t i = 0; i < childCount; i++) {
+ nsCOMPtr<nsINavHistoryResultNode> child;
+ mHistResultContainer->GetChild(i, getter_AddRefs(child));
+
+ if (!IsHistoryResultNodeURI(child)) {
+ continue;
+ }
+
+ nsAutoCString uri;
+ nsresult rv = child->GetUri(uri);
+ if (NS_FAILED(rv)) {
+ continue;
+ }
+ urlList[urlListElements++] = strdup(uri.get());
+ }
+
+ nsPrintfCString searchString("search:%s", mSearchTerm.get());
+ urlList[urlListElements++] = strdup(searchString.get());
+
+ int tmp;
+ char* commandLine = ConstructCommandLine(urlListElements, urlList, 0, &tmp);
+ if (commandLine) {
+ HandleCommandLine(commandLine, aTimeStamp);
+ free(commandLine);
+ }
+
+ for (int i = 0; i < urlListElements; i++) {
+ free(urlList[i]);
+ }
+ free(urlList);
+}
+
+DBusHandlerResult nsGNOMEShellSearchProvider::ActivateResult(
+ DBusMessage* aMsg) {
+ DBusMessage* reply;
+ char* resultID;
+ char** stringArray;
+ int elements;
+ uint32_t timestamp;
+
+ if (!dbus_message_get_args(aMsg, nullptr, DBUS_TYPE_STRING, &resultID,
+ DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &stringArray,
+ &elements, DBUS_TYPE_UINT32, &timestamp,
+ DBUS_TYPE_INVALID) ||
+ resultID == nullptr) {
+ reply = dbus_message_new_error(aMsg, DBUS_BUS_NAME, "Wrong argument");
+ } else {
+ reply = dbus_message_new_method_return(aMsg);
+ LaunchWithID(resultID, timestamp);
+ dbus_free_string_array(stringArray);
+ }
+
+ dbus_connection_send(mConnection, reply, nullptr);
+ dbus_message_unref(reply);
+
+ return DBUS_HANDLER_RESULT_HANDLED;
+}
+
+DBusHandlerResult nsGNOMEShellSearchProvider::LaunchSearch(DBusMessage* aMsg) {
+ DBusMessage* reply;
+ char** stringArray;
+ int elements;
+ uint32_t timestamp;
+
+ if (!dbus_message_get_args(aMsg, nullptr, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING,
+ &stringArray, &elements, DBUS_TYPE_UINT32,
+ &timestamp, DBUS_TYPE_INVALID) ||
+ elements == 0) {
+ reply = dbus_message_new_error(aMsg, DBUS_BUS_NAME, "Wrong argument");
+ } else {
+ reply = dbus_message_new_method_return(aMsg);
+ LaunchWithAllResults(timestamp);
+ dbus_free_string_array(stringArray);
+ }
+
+ dbus_connection_send(mConnection, reply, nullptr);
+ dbus_message_unref(reply);
+
+ return DBUS_HANDLER_RESULT_HANDLED;
+}
+
+DBusHandlerResult nsGNOMEShellSearchProvider::HandleDBusMessage(
+ DBusConnection* aConnection, DBusMessage* aMsg) {
+ NS_ASSERTION(mConnection == aConnection, "Wrong D-Bus connection.");
+
+ const char* method = dbus_message_get_member(aMsg);
+ const char* iface = dbus_message_get_interface(aMsg);
+
+ if ((strcmp("Introspect", method) == 0) &&
+ (strcmp("org.freedesktop.DBus.Introspectable", iface) == 0)) {
+ return Introspect(aMsg);
+ }
+
+ if (strcmp("org.gnome.Shell.SearchProvider2", iface) == 0) {
+ if (strcmp("GetInitialResultSet", method) == 0) {
+ return GetInitialResultSet(aMsg);
+ }
+ if (strcmp("GetSubsearchResultSet", method) == 0) {
+ return GetSubsearchResultSet(aMsg);
+ }
+ if (strcmp("GetResultMetas", method) == 0) {
+ return GetResultMetas(aMsg);
+ }
+ if (strcmp("ActivateResult", method) == 0) {
+ return ActivateResult(aMsg);
+ }
+ if (strcmp("LaunchSearch", method) == 0) {
+ return LaunchSearch(aMsg);
+ }
+ }
+
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+}
+
+void nsGNOMEShellSearchProvider::UnregisterDBusInterface(
+ DBusConnection* aConnection) {
+ NS_ASSERTION(mConnection == aConnection, "Wrong D-Bus connection.");
+ // Not implemented
+}
+
+static DBusHandlerResult message_handler(DBusConnection* conn,
+ DBusMessage* aMsg, void* user_data) {
+ auto interface = static_cast<nsGNOMEShellSearchProvider*>(user_data);
+ return interface->HandleDBusMessage(conn, aMsg);
+}
+
+static void unregister(DBusConnection* conn, void* user_data) {
+ auto interface = static_cast<nsGNOMEShellSearchProvider*>(user_data);
+ interface->UnregisterDBusInterface(conn);
+}
+
+static DBusObjectPathVTable remoteHandlersTable = {
+ .unregister_function = unregister,
+ .message_function = message_handler,
+};
+
+nsresult nsGNOMEShellSearchProvider::Startup() {
+ if (mConnection && dbus_connection_get_is_connected(mConnection)) {
+ // We're already connected so we don't need to reconnect
+ return NS_ERROR_ALREADY_INITIALIZED;
+ }
+
+ nsCOMPtr<nsIStringBundleService> sbs =
+ do_GetService(NS_STRINGBUNDLE_CONTRACTID);
+ if (NS_WARN_IF(!sbs)) {
+ return NS_ERROR_FAILURE;
+ }
+
+ nsCOMPtr<nsIStringBundle> bundle;
+ sbs->CreateBundle("chrome://browser/locale/browser.properties",
+ getter_AddRefs(bundle));
+ if (NS_WARN_IF(!bundle)) {
+ return NS_ERROR_FAILURE;
+ }
+
+ nsAutoString searchTitle;
+ bundle->GetStringFromName("gnomeSearchProviderSearch", searchTitle);
+ mGnomeSearchTitle = NS_ConvertUTF16toUTF8(searchTitle);
+
+ mHistoryService = do_GetService(NS_NAVHISTORYSERVICE_CONTRACTID);
+ if (!mHistoryService) {
+ return NS_ERROR_FAILURE;
+ }
+
+ mConnection =
+ already_AddRefed<DBusConnection>(dbus_bus_get(DBUS_BUS_SESSION, nullptr));
+ if (!mConnection) {
+ return NS_ERROR_FAILURE;
+ }
+ dbus_connection_set_exit_on_disconnect(mConnection, false);
+ dbus_connection_setup_with_g_main(mConnection, nullptr);
+
+ DBusError err;
+ dbus_error_init(&err);
+ dbus_bus_request_name(mConnection, DBUS_BUS_NAME, DBUS_NAME_FLAG_DO_NOT_QUEUE,
+ &err);
+ // The interface is already owned - there is another application/profile
+ // instance already running.
+ if (dbus_error_is_set(&err)) {
+ dbus_error_free(&err);
+ mConnection = nullptr;
+ return NS_ERROR_FAILURE;
+ }
+
+ if (!dbus_connection_register_object_path(mConnection, DBUS_OBJECT_PATH,
+ &remoteHandlersTable, this)) {
+ mConnection = nullptr;
+ return NS_ERROR_FAILURE;
+ }
+
+ return NS_OK;
+}
+
+void nsGNOMEShellSearchProvider::Shutdown() {
+ if (!mConnection) {
+ return;
+ }
+
+ dbus_connection_unregister_object_path(mConnection, DBUS_OBJECT_PATH);
+
+ // dbus_connection_unref() will be called by RefPtr here.
+ mConnection = nullptr;
+}
diff -up firefox-73.0/browser/components/shell/nsGNOMEShellSearchProvider.h.gnome-shell-search-provider firefox-73.0/browser/components/shell/nsGNOMEShellSearchProvider.h
--- firefox-73.0/browser/components/shell/nsGNOMEShellSearchProvider.h.gnome-shell-search-provider 2020-02-11 09:00:59.350512802 +0100
+++ firefox-73.0/browser/components/shell/nsGNOMEShellSearchProvider.h 2020-02-11 09:00:59.350512802 +0100
@@ -0,0 +1,55 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim:expandtab:shiftwidth=2:tabstop=2:
+ */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#ifndef __nsGNOMEShellSearchProvider_h__
+#define __nsGNOMEShellSearchProvider_h__
+
+#include "mozilla/DBusHelpers.h"
+#include "nsINavHistoryService.h"
+#include "nsUnixRemoteServer.h"
+#include "nsCOMPtr.h"
+
+class nsGNOMEShellSearchProvider : public nsUnixRemoteServer {
+ public:
+ nsGNOMEShellSearchProvider() : mConnection(nullptr) {}
+ ~nsGNOMEShellSearchProvider() { Shutdown(); }
+
+ nsresult Startup();
+ void Shutdown();
+
+ DBusHandlerResult HandleDBusMessage(DBusConnection* aConnection,
+ DBusMessage* msg);
+ void UnregisterDBusInterface(DBusConnection* aConnection);
+
+ private:
+ DBusHandlerResult Introspect(DBusMessage* msg);
+
+ DBusHandlerResult GetInitialResultSet(DBusMessage* msg);
+ DBusHandlerResult GetSubsearchResultSet(DBusMessage* msg);
+ DBusHandlerResult GetResultMetas(DBusMessage* msg);
+ DBusHandlerResult ActivateResult(DBusMessage* msg);
+ DBusHandlerResult LaunchSearch(DBusMessage* msg);
+
+ nsresult QueryHistory(const char* aSearchTerm);
+ void GetIDKeyForURI(int aIndex, nsAutoCString& aUri, nsAutoCString& aIDKey);
+ int GetIndexFromIDKey(const char* aIDKey);
+ bool IsHistoryResultNodeURI(nsINavHistoryResultNode* aHistoryNode);
+ void AppendResultID(DBusMessageIter* aIter, const char* aID);
+ void AppendSearchID(DBusMessageIter* aIter, const char* aID);
+ void ComposeSearchResultReply(DBusMessage* aReply, const char* aSearchTerm);
+ void LaunchWithID(const char* aID, uint32_t aTimeStamp);
+ void LaunchWithAllResults(uint32_t aTimeStamp);
+
+ // The connection is owned by DBus library
+ RefPtr<DBusConnection> mConnection;
+ nsCOMPtr<nsINavHistoryContainerResultNode> mHistResultContainer;
+ nsCOMPtr<nsINavHistoryService> mHistoryService;
+ nsAutoCStringN<32> mSearchTerm;
+ nsAutoCString mGnomeSearchTitle;
+};
+
+#endif // __nsGNOMEShellSearchProvider_h__
diff -up firefox-73.0/browser/components/shell/nsGNOMEShellService.cpp.gnome-shell-search-provider firefox-73.0/browser/components/shell/nsGNOMEShellService.cpp
--- firefox-73.0/browser/components/shell/nsGNOMEShellService.cpp.gnome-shell-search-provider 2020-02-07 22:12:59.000000000 +0100
+++ firefox-73.0/browser/components/shell/nsGNOMEShellService.cpp 2020-02-11 09:00:59.350512802 +0100
@@ -89,6 +89,14 @@ nsresult nsGNOMEShellService::Init() {
if (!giovfs && !gsettings) return NS_ERROR_NOT_AVAILABLE;
+#ifdef MOZ_ENABLE_DBUS
+ const char* currentDesktop = getenv("XDG_CURRENT_DESKTOP");
+ if (currentDesktop && strstr(currentDesktop, "GNOME") != nullptr &&
+ Preferences::GetBool("browser.gnome-search-provider.enabled", false)) {
+ mSearchProvider.Startup();
+ }
+#endif
+
// Check G_BROKEN_FILENAMES. If it's set, then filenames in glib use
// the locale encoding. If it's not set, they use UTF-8.
mUseLocaleFilenames = PR_GetEnv("G_BROKEN_FILENAMES") != nullptr;
diff -up firefox-73.0/browser/components/shell/nsGNOMEShellService.h.gnome-shell-search-provider firefox-73.0/browser/components/shell/nsGNOMEShellService.h
--- firefox-73.0/browser/components/shell/nsGNOMEShellService.h.gnome-shell-search-provider 2020-02-07 22:12:59.000000000 +0100
+++ firefox-73.0/browser/components/shell/nsGNOMEShellService.h 2020-02-11 09:00:59.350512802 +0100
@@ -10,6 +10,9 @@
#include "nsToolkitShellService.h"
#include "nsString.h"
#include "mozilla/Attributes.h"
+#ifdef MOZ_ENABLE_DBUS
+# include "nsGNOMEShellSearchProvider.h"
+#endif
class nsGNOMEShellService final : public nsIGNOMEShellService,
public nsToolkitShellService {
@@ -28,6 +31,9 @@ class nsGNOMEShellService final : public
bool KeyMatchesAppName(const char* aKeyValue) const;
bool CheckHandlerMatchesAppName(const nsACString& handler) const;
+#ifdef MOZ_ENABLE_DBUS
+ nsGNOMEShellSearchProvider mSearchProvider;
+#endif
bool GetAppPathFromLauncher();
bool mUseLocaleFilenames;
nsCString mAppPath;
diff -up firefox-73.0/browser/locales/en-US/chrome/browser/browser.properties.gnome-shell-search-provider firefox-73.0/browser/locales/en-US/chrome/browser/browser.properties
--- firefox-73.0/browser/locales/en-US/chrome/browser/browser.properties.gnome-shell-search-provider 2020-02-07 22:13:00.000000000 +0100
+++ firefox-73.0/browser/locales/en-US/chrome/browser/browser.properties 2020-02-11 09:00:59.350512802 +0100
@@ -1047,3 +1047,7 @@ confirmationHint.breakageReport.label =
# Used by the export of user's live bookmarks to an OPML file as a title for the file.
# %S will be replaced with brandShortName
livebookmarkMigration.title = %S Live Bookmarks
+
+# LOCALIZATION NOTE (gnomeSearchProviderSearch):
+# Used for search by Gnome Shell activity screen, %s is a searched string.
+gnomeSearchProviderSearch=Search the web for “%s”
diff -up firefox-73.0/toolkit/components/remote/moz.build.gnome-shell-search-provider firefox-73.0/toolkit/components/remote/moz.build
--- firefox-73.0/toolkit/components/remote/moz.build.gnome-shell-search-provider 2020-02-07 22:13:54.000000000 +0100
+++ firefox-73.0/toolkit/components/remote/moz.build 2020-02-11 09:00:59.351512811 +0100
@@ -25,6 +25,10 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk'
'nsDBusRemoteServer.cpp',
]
CXXFLAGS += CONFIG['MOZ_DBUS_GLIB_CFLAGS']
+ EXPORTS += [
+ 'nsUnixRemoteServer.h',
+ 'RemoteUtils.h',
+ ]
CXXFLAGS += CONFIG['TK_CFLAGS']
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
diff -up firefox-73.0/toolkit/components/remote/nsDBusRemoteServer.cpp.gnome-shell-search-provider firefox-73.0/toolkit/components/remote/nsDBusRemoteServer.cpp
--- firefox-73.0/toolkit/components/remote/nsDBusRemoteServer.cpp.gnome-shell-search-provider 2020-02-07 22:13:54.000000000 +0100
+++ firefox-73.0/toolkit/components/remote/nsDBusRemoteServer.cpp 2020-02-11 09:00:59.351512811 +0100
@@ -23,7 +23,7 @@
#include <dlfcn.h>
-const char* introspect_template =
+static const char* introspect_template =
"<!DOCTYPE node PUBLIC \"-//freedesktop//DTD D-BUS Object Introspection "
"1.0//EN\"\n"
"\"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd\";>\n"

View file

@ -1,3 +0,0 @@
[D-BUS Service]
Name=org.mozilla.firefox.SearchProvider
Exec=/usr/lib64/firefox/firefox --dbus-service /usr/bin/firefox

View file

@ -1,61 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2019 Firefox contributors -->
<component type="desktop-application">
<id>org.mozilla.firefox</id>
<metadata_license>CC0-1.0</metadata_license>
<name>Firefox</name>
<summary>Web Browser</summary>
<summary xml:lang="ca">Navegador web</summary>
<summary xml:lang="cs">Webový prohlížeč</summary>
<summary xml:lang="es">Navegador web</summary>
<summary xml:lang="fa">مرورگر اینترنتی</summary>
<summary xml:lang="fi">WWW-selain</summary>
<summary xml:lang="fr">Navigateur Web</summary>
<summary xml:lang="hu">Webböngésző</summary>
<summary xml:lang="it">Browser Web</summary>
<summary xml:lang="ja">ウェブ・ブラウザ</summary>
<summary xml:lang="ko">웹 브라우저</summary>
<summary xml:lang="nb">Nettleser</summary>
<summary xml:lang="nl">Webbrowser</summary>
<summary xml:lang="nn">Nettlesar</summary>
<summary xml:lang="no">Nettleser</summary>
<summary xml:lang="pl">Przeglądarka WWW</summary>
<summary xml:lang="pt">Navegador Web</summary>
<summary xml:lang="pt_BR">Navegador Web</summary>
<summary xml:lang="sk">Internetový prehliadač</summary>
<summary xml:lang="sv">Webbläsare</summary>
<description>
<p>
Bringing together all kinds of awesomeness to make browsing better for you.
Get to your favorite sites quickly even if you dont remember the URLs.
Type your term into the location bar (aka the Awesome Bar) and the autocomplete
function will include possible matches from your browsing history, bookmarked
sites and open tabs.
</p>
</description>
<url type="homepage">https://www.mozilla.org</url>
<update_contact>stransky@redhat.com</update_contact>
<kudos>
<kudo>ModernToolkit</kudo>
<kudo>SearchProvider</kudo>
</kudos>
<project_group>Mozilla</project_group>
<project_license>GPL-3.0+</project_license>
<developer_name>Mozilla Corporation</developer_name>
<url type="bugtracker">https://bugzilla.mozilla.org/</url>
<url type="help">https://support.mozilla.org/</url>
<translation type="gettext">firefox</translation>
<launchable type="desktop-id">org.mozilla.firefox.desktop</launchable>
<provides>
<id>firefox.desktop</id>
</provides>
<screenshots>
<screenshot type="default">https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/firefox/a.png</screenshot>
<screenshot>https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/firefox/b.png</screenshot>
<screenshot>https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/firefox/c.png</screenshot>
</screenshots>
<content_rating type="oars-1.1"/>
<releases>
<release version="__VERSION__" date="__DATE__"/>
</releases>
</component>

View file

@ -1,276 +0,0 @@
[Desktop Entry]
Version=1.0
Name=Firefox
GenericName=Web Browser
GenericName[ca]=Navegador web
GenericName[cs]=Webový prohlížeč
GenericName[es]=Navegador web
GenericName[fa]=مرورگر اینترنتی
GenericName[fi]=WWW-selain
GenericName[fr]=Navigateur Web
GenericName[hu]=Webböngésző
GenericName[it]=Browser Web
GenericName[ja]=
GenericName[ko]=
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[sk]=Internetový prehliadač
GenericName[sv]=Webbläsare
Comment=Browse the Web
Comment[ca]=Navegueu per el web
Comment[cs]=Prohlížení stránek World Wide Webu
Comment[de]=Im Internet surfen
Comment[es]=Navegue por la web
Comment[fa]=صفحات شبکه جهانی اینترنت را مرور نمایید
Comment[fi]=Selaa Internetin WWW-sivuja
Comment[fr]=Navigue sur Internet
Comment[hu]=A világháló böngészése
Comment[it]=Esplora il web
Comment[ja]=
Comment[ko]=
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[sk]=Prehliadanie internetu
Comment[sv]=Surfa på webben
Exec=firefox %u
Icon=firefox
Terminal=false
Type=Application
MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https;
StartupNotify=true
Categories=Network;WebBrowser;
Keywords=web;browser;internet;
Actions=new-window;new-private-window;profile-manager-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]=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]=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
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=firefox --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=firefox --private-window %u
[Desktop Action profile-manager-window]
Name=Open the Profile Manager
Name[cs]=Správa profilů
Name[de]=Profilverwaltung öffnen
Name[fr]=Ouvrir le gestionnaire de profils
Exec=firefox --ProfileManager

View file

@ -1,5 +0,0 @@
[Shell Search Provider]
DesktopId=org.mozilla.firefox.desktop
BusName=org.mozilla.firefox.SearchProvider
ObjectPath=/org/mozilla/firefox/SearchProvider
Version=2

150
pgo.patch
View file

@ -1,128 +1,30 @@
diff -up firefox-145.0/build/moz.configure/lto-pgo.configure.pgo firefox-145.0/build/moz.configure/lto-pgo.configure
--- firefox-145.0/build/moz.configure/lto-pgo.configure.pgo 2025-11-03 16:56:55.000000000 +0100
+++ firefox-145.0/build/moz.configure/lto-pgo.configure 2025-11-05 13:59:53.477443914 +0100
@@ -96,12 +96,16 @@ set_config("PGO_PROFILE_PATH", pgo_profi
diff -up firefox-70.0/build/mozconfig.pgo firefox-70.0/build/mozconfig
diff -up firefox-70.0/build/unix/mozconfig.unix.pgo firefox-70.0/build/unix/mozconfig.unix
--- firefox-70.0/build/unix/mozconfig.unix.pgo 2019-10-18 18:05:36.461701704 +0200
+++ firefox-70.0/build/unix/mozconfig.unix 2019-10-18 20:25:48.036037912 +0200
@@ -6,6 +6,15 @@ if [ -n "$FORCE_GCC" ]; then
CC="$MOZ_FETCHES_DIR/gcc/bin/gcc"
CXX="$MOZ_FETCHES_DIR/gcc/bin/g++"
@depends(
"--enable-profile-use",
+ c_compiler,
pgo_profile_path,
llvm_profdata,
llvm_profdata_order,
build_environment,
)
-def orderfile_path(profile_use, path, profdata, profdata_order, build_env):
+def orderfile_path(profile_use, compiler, path, profdata, profdata_order, build_env):
+ if compiler.type == "gcc":
+ return None
+ 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
+
if not profile_use:
return None
# 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 firefox-70.0/extensions/spellcheck/src/moz.build.pgo firefox-70.0/extensions/spellcheck/src/moz.build
--- firefox-70.0/extensions/spellcheck/src/moz.build.pgo 2019-10-16 23:20:18.000000000 +0200
+++ firefox-70.0/extensions/spellcheck/src/moz.build 2019-10-18 18:05:36.461701704 +0200
@@ -31,3 +31,5 @@ EXPORTS.mozilla += [
@@ -145,7 +149,7 @@ def pgo_flags(
return namespace(
gen_cflags=["-fprofile-generate"],
gen_ldflags=["-fprofile-generate"],
- use_cflags=["-fprofile-use", "-fprofile-correction", "-Wcoverage-mismatch"],
+ use_cflags=["-fprofile-use", "-fprofile-correction", "-Wno-coverage-mismatch"],
use_ldflags=["-fprofile-use"],
)
diff -up firefox-145.0/build/pgo/profileserver.py.pgo firefox-145.0/build/pgo/profileserver.py
--- firefox-145.0/build/pgo/profileserver.py.pgo 2025-11-03 16:56:55.000000000 +0100
+++ firefox-145.0/build/pgo/profileserver.py 2025-11-05 13:59:53.477602066 +0100
@@ -10,7 +10,7 @@ import subprocess
import sys
import mozcrash
-from mozbuild.base import BinaryNotFoundException, MozbuildObject
+from mozbuild.base import BinaryNotFoundException, MozbuildObject, BuildEnvironmentNotFoundException
from mozfile import TemporaryDirectory, json
from mozhttpd import MozHttpd
from mozprofile import FirefoxProfile, Preferences
@@ -96,9 +96,22 @@ if __name__ == "__main__":
locations = ServerLocations()
locations.add_host(host="127.0.0.1", 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 CONFIG['CC_TYPE'] in ('clang', 'gcc'):
CXXFLAGS += ['-Wno-error=shadow']
+
+ 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
diff -up firefox-145.0/gfx/2d/moz.build.pgo firefox-145.0/gfx/2d/moz.build
--- firefox-145.0/gfx/2d/moz.build.pgo 2025-11-03 16:56:57.000000000 +0100
+++ firefox-145.0/gfx/2d/moz.build 2025-11-05 14:21:20.485610837 +0100
@@ -137,11 +137,11 @@ if CONFIG["INTEL_ARCHITECTURE"]:
DEFINES["USE_SSE2"] = True
# The file uses SSE2 intrinsics, so it needs special compile flags on some
# compilers.
- SOURCES["ConvolutionFilterAVX2.cpp"].flags += ["-mavx2"]
+ SOURCES["ConvolutionFilterAVX2.cpp"].flags += ["-mavx2", "-fno-lto"]
SOURCES["ConvolutionFilterSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
SOURCES["FilterProcessingSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
SOURCES["ImageScalingSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
- SOURCES["SwizzleAVX2.cpp"].flags += ["-mavx2"]
+ SOURCES["SwizzleAVX2.cpp"].flags += ["-mavx2", "-fno-lto"]
SOURCES["SwizzleSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
SOURCES["SwizzleSSSE3.cpp"].flags += CONFIG["SSSE3_FLAGS"]
diff -up firefox-145.0/gfx/skia/generate_mozbuild.py.pgo firefox-145.0/gfx/skia/generate_mozbuild.py
--- firefox-145.0/gfx/skia/generate_mozbuild.py.pgo 2025-11-03 16:56:57.000000000 +0100
+++ firefox-145.0/gfx/skia/generate_mozbuild.py 2025-11-05 13:59:53.477947055 +0100
@@ -50,8 +50,8 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind
if CONFIG['INTEL_ARCHITECTURE']:
SOURCES['skia/modules/skcms/skcms.cc'].flags += ['-DSKCMS_DISABLE_SKX']
skia_ssse3_flags = ['-Dskvx=skvx_ssse3', '-mssse3']
- skia_avx_flags = ['-Dskvx=skvx_avx', '-mavx']
- skia_hsw_flags = ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma']
+ skia_avx_flags = ['-Dskvx=skvx_avx', '-mavx', '-fno-lto']
+ skia_hsw_flags = ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma', '-fno-lto']
SOURCES['skia/src/core/SkBitmapProcState_opts_ssse3.cpp'].flags += skia_ssse3_flags
SOURCES['skia/src/core/SkBlitMask_opts_ssse3.cpp'].flags += skia_ssse3_flags
SOURCES['skia/src/core/SkSwizzler_opts_ssse3.cpp'].flags += ['-Dskvx=skvx_ssse3']
diff -up firefox-145.0/gfx/skia/moz.build.pgo firefox-145.0/gfx/skia/moz.build
--- firefox-145.0/gfx/skia/moz.build.pgo 2025-11-03 16:56:57.000000000 +0100
+++ firefox-145.0/gfx/skia/moz.build 2025-11-05 13:59:53.478077484 +0100
@@ -597,8 +597,8 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind
if CONFIG['INTEL_ARCHITECTURE']:
SOURCES['skia/modules/skcms/skcms.cc'].flags += ['-DSKCMS_DISABLE_SKX']
skia_ssse3_flags = ['-Dskvx=skvx_ssse3', '-mssse3']
- skia_avx_flags = ['-Dskvx=skvx_avx', '-mavx']
- skia_hsw_flags = ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma']
+ skia_avx_flags = ['-Dskvx=skvx_avx', '-mavx', '-fno-lto']
+ skia_hsw_flags = ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma', '-fno-lto']
SOURCES['skia/src/core/SkBitmapProcState_opts_ssse3.cpp'].flags += skia_ssse3_flags
SOURCES['skia/src/core/SkBlitMask_opts_ssse3.cpp'].flags += skia_ssse3_flags
SOURCES['skia/src/core/SkSwizzler_opts_ssse3.cpp'].flags += ['-Dskvx=skvx_ssse3']
diff -up firefox-145.0/toolkit/components/terminator/nsTerminator.cpp.pgo firefox-145.0/toolkit/components/terminator/nsTerminator.cpp
--- firefox-145.0/toolkit/components/terminator/nsTerminator.cpp.pgo 2025-11-03 16:57:15.000000000 +0100
+++ firefox-145.0/toolkit/components/terminator/nsTerminator.cpp 2025-11-05 13:59:53.478238011 +0100
@@ -330,6 +330,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());
// crashAfterTicks is guaranteed to be > 0 as
// crashAfterMS >= ADDITIONAL_WAIT_BEFORE_CRASH_MS >> HEARTBEAT_INTERVAL_MS
+CXXFLAGS += ['-fno-devirtualize']
\ No newline at end of file

View file

@ -1,13 +0,0 @@
#!/usr/bin/bash
# Print reftest failures and compose them to html
TEST_DIR="$1"
TEST_FLAVOUR="$2"
OUTPUT_FILE="failures-reftest$TEST_FLAVOUR.html"
grep --text -e "REFTEST TEST-UNEXPECTED-PASS" -e "REFTEST TEST-UNEXPECTED-FAIL" -e "IMAGE 1 (TEST):" -e "IMAGE 2 (REFERENCE):" $TEST_DIR/reftest$TEST_FLAVOUR 2>&1 > $OUTPUT_FILE
sed -i '/REFTEST IMAGE 1/a ">' $OUTPUT_FILE
sed -i '/REFTEST IMAGE 2/a "><BR><BR>' $OUTPUT_FILE
sed -i '/REFTEST TEST/a <BR>' $OUTPUT_FILE
sed -i -e 's/^REFTEST IMAGE 1 (TEST): /<img border=2 src="/' $OUTPUT_FILE
sed -i -e 's/^REFTEST IMAGE 2 (REFERENCE): /<img border=2 src="/' $OUTPUT_FILE

View file

@ -1,9 +0,0 @@
#!/usr/bin/bash
# Print failed tests
TEST_DIR=$1
TEST_FLAVOUR=$2
grep "TEST-UNEXPECTED-FAIL" $TEST_DIR/mochitest$TEST_FLAVOUR 2>&1 > failures-mochitest$TEST_FLAVOUR.txt
grep --text -e " FAIL " -e " TIMEOUT " $TEST_DIR/xpcshell$TEST_FLAVOUR 2>&1 > failures-xpcshell$TEST_FLAVOUR.txt
grep --text -e "REFTEST TEST-UNEXPECTED-PASS" -e "REFTEST TEST-UNEXPECTED-FAIL" $TEST_DIR/reftest$TEST_FLAVOUR 2>&1 > failures-reftest$TEST_FLAVOUR.txt

View file

@ -1,9 +0,0 @@
#!/usr/bin/bash
# Analyze and print test failures
export TEST_DIR="test_results"
#./print-errors $TEST_DIR ""
./print-errors $TEST_DIR "-wr"
#./print-error-reftest $TEST_DIR ""
./print-error-reftest $TEST_DIR "-wr"

View file

@ -1,10 +0,0 @@
#!/usr/bin/bash
# Analyze and print general test results
export TEST_DIR="test_results"
echo "Test results"
#echo "Basic compositor"
#./psummary $TEST_DIR ""
echo "WebRender"
./psummary $TEST_DIR "-wr"

View file

@ -1,23 +0,0 @@
#!/usr/bin/bash
# Analyze and print specialized (basic/webrender) test results
TEST_DIR=$1
TEST_FLAVOUR=$2
MPASS=`grep "TEST_END: Test OK" $TEST_DIR/mochitest$TEST_FLAVOUR | wc -l`
MERR=`grep "TEST_END: Test ERROR" $TEST_DIR/mochitest$TEST_FLAVOUR | wc -l`
MUNEX=`grep "TEST-UNEXPECTED-FAIL" $TEST_DIR/mochitest$TEST_FLAVOUR | wc -l`
echo "Mochitest PASSED: $MPASS FAILED: $MERR UNEXPECTED-FAILURES: $MUNEX"
XPCPASS=`grep --text "Expected results:" $TEST_DIR/xpcshell$TEST_FLAVOUR | cut -d ' ' -f 3`
XPCFAIL=`grep --text "Unexpected results:" $TEST_DIR/xpcshell$TEST_FLAVOUR | cut -d ' ' -f 3`
echo "XPCShell: PASSED: $XPCPASS FAILED: $XPCFAIL"
CRPASS=`grep "REFTEST INFO | Successful:" $TEST_DIR/crashtest$TEST_FLAVOUR | cut -d ' ' -f 5`
CRFAIL=`grep "^REFTEST INFO | Unexpected:" $TEST_DIR/crashtest$TEST_FLAVOUR | cut -d ' ' -f 5`
echo "Crashtest: PASSED: $CRPASS FAILED: $CRFAIL"
RFPASS=`grep --text "REFTEST INFO | Successful:" $TEST_DIR/reftest$TEST_FLAVOUR | cut -d ' ' -f 5`
RFUN=`grep --text "^REFTEST INFO | Unexpected:" $TEST_DIR/reftest$TEST_FLAVOUR | cut -d ' ' -f 5`
RFKNOWN=`grep --text "REFTEST INFO | Known problems:" $TEST_DIR/reftest$TEST_FLAVOUR | cut -d ' ' -f 6`
echo "Reftest: PASSED: $RFPASS FAILED: $RFUN Known issues: $RFKNOWN"

View file

@ -1,12 +1,12 @@
diff -up firefox-132.0/extensions/auth/nsAuthSambaNTLM.cpp.rhbz-1173156 firefox-132.0/extensions/auth/nsAuthSambaNTLM.cpp
--- firefox-132.0/extensions/auth/nsAuthSambaNTLM.cpp.rhbz-1173156 2024-10-23 09:26:41.433895188 +0200
+++ firefox-132.0/extensions/auth/nsAuthSambaNTLM.cpp 2024-10-23 10:05:11.025801336 +0200
@@ -153,7 +153,7 @@ nsresult nsAuthSambaNTLM::SpawnNTLMAuthH
options.fds_to_remap.push_back(
std::pair{fromChildPipeWrite.get(), STDOUT_FILENO});
- std::vector<std::string> argvVec{"ntlm_auth", "--helper-protocol",
+ std::vector<std::string> argvVec{"/usr/bin/ntlm_auth", "--helper-protocol",
"ntlmssp-client-1", "--use-cached-creds",
"--username", username};
diff -up firefox-60.5.0/extensions/auth/nsAuthSambaNTLM.cpp.rhbz-1173156 firefox-60.5.0/extensions/auth/nsAuthSambaNTLM.cpp
--- firefox-60.5.0/extensions/auth/nsAuthSambaNTLM.cpp.rhbz-1173156 2019-01-22 10:36:09.284069020 +0100
+++ firefox-60.5.0/extensions/auth/nsAuthSambaNTLM.cpp 2019-01-22 10:37:12.669757744 +0100
@@ -161,7 +161,7 @@ nsresult nsAuthSambaNTLM::SpawnNTLMAuthH
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

@ -0,0 +1,72 @@
diff --git a/security/certverifier/CertVerifier.cpp b/security/certverifier/CertVerifier.cpp
--- a/security/certverifier/CertVerifier.cpp
+++ b/security/certverifier/CertVerifier.cpp
@@ -120,16 +120,20 @@ IsCertChainRootBuiltInRoot(const UniqueC
}
CERTCertificate* root = rootNode->cert;
if (!root) {
return Result::FATAL_ERROR_LIBRARY_FAILURE;
}
return IsCertBuiltInRoot(root, result);
}
+// The term "builtin root" traditionally refers to a root CA certificate that
+// has been added to the NSS trust store, because it has been approved
+// for inclusion according to the Mozilla CA policy, and might be accepted
+// by Mozilla applications as an issuer for certificates seen on the public web.
Result
IsCertBuiltInRoot(CERTCertificate* cert, bool& result)
{
result = false;
#ifdef DEBUG
nsCOMPtr<nsINSSComponent> component(do_GetService(PSM_COMPONENT_CONTRACTID));
if (!component) {
return Result::FATAL_ERROR_LIBRARY_FAILURE;
@@ -142,25 +146,38 @@ IsCertBuiltInRoot(CERTCertificate* cert,
return Success;
}
#endif // DEBUG
AutoSECMODListReadLock lock;
for (SECMODModuleList* list = SECMOD_GetDefaultModuleList(); list;
list = list->next) {
for (int i = 0; i < list->module->slotCount; i++) {
PK11SlotInfo* slot = list->module->slots[i];
- // PK11_HasRootCerts should return true if and only if the given slot has
- // an object with a CKA_CLASS of CKO_NETSCAPE_BUILTIN_ROOT_LIST, which
- // should be true only of the builtin root list.
- // If we can find a copy of the given certificate on the slot with the
- // builtin root list, that certificate must be a builtin.
- if (PK11_IsPresent(slot) && PK11_HasRootCerts(slot) &&
- PK11_FindCertInSlot(slot, cert, nullptr) != CK_INVALID_HANDLE) {
- result = true;
- return Success;
+ // We're searching for the "builtin root module", which is a module that
+ // contains an object with a CKA_CLASS of CKO_NETSCAPE_BUILTIN_ROOT_LIST.
+ // We use PK11_HasRootCerts() to identify a module with that property.
+ // In the past, we exclusively used the PKCS#11 module named nssckbi,
+ // which is provided by the NSS library.
+ // Nowadays, some distributions use a replacement module, which contains
+ // the builtin roots, but which also contains additional CA certificates,
+ // such as CAs trusted in a local deployment.
+ // We want to be able to distinguish between these two categories,
+ // because a CA, which may issue certificates for the public web,
+ // is expected to comply with additional requirements.
+ // If the certificate has attribute CKA_NSS_MOZILLA_CA_POLICY set to true,
+ // then we treat it as a "builtin root".
+ if (PK11_IsPresent(slot) && PK11_HasRootCerts(slot)) {
+ CK_OBJECT_HANDLE handle = PK11_FindCertInSlot(slot, cert, nullptr);
+ if (handle != CK_INVALID_HANDLE &&
+ PK11_HasAttributeSet(slot, handle, CKA_NSS_MOZILLA_CA_POLICY,
+ false)) {
+ // Attribute was found, and is set to true
+ result = true;
+ break;
+ }
}
}
}
return Success;
}
static Result
BuildCertChainForOneKeyUsage(NSSCertDBTrustDomain& trustDomain, Input certDER,

View file

@ -1,80 +0,0 @@
#!/usr/bin/bash
# usage: run-tests-wayland [test flavour]
set -x
RUN_XPCSHELL_TEST=1
RUN_REFTEST=1
RUN_MOCHITEST=1
RUN_CRASHTEST=1
while (( "$#" )); do
SELECTED_TEST=$1
if [ "$SELECTED_TEST" = "xpcshell" ] ; then
RUN_XPCSHELL_TEST=1
elif [ "$SELECTED_TEST" = "reftest" ] ; then
RUN_REFTEST=1
elif [ "$SELECTED_TEST" = "mochitest" ] ; then
RUN_MOCHITEST=1
elif [ "$SELECTED_TEST" = "crashtest" ] ; then
RUN_CRASHTEST=1
fi
shift
done
export MACH_USE_SYSTEM_PYTHON=1
export MOZ_NODE_PATH=/usr/bin/node
MOCHITEST_PARAMS="--timeout 1 --chunk-by-dir 4"
TEST_DIR="test_results"
mkdir $TEST_DIR
env | grep "DISPLAY"
# Fix for system nss
ln -s /usr/bin/certutil objdir/dist/bin/certutil
ln -s /usr/bin/pk12util objdir/dist/bin/pk12util
NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"
export MOZ_ENABLE_WAYLAND=1
if [ $RUN_XPCSHELL_TEST -ne 0 ] ; then
# ./mach xpcshell-test 2>&1 | cat - | tee $TEST_DIR/xpcshell
./mach xpcshell-test --enable-webrender 2>&1 | cat - | tee $TEST_DIR/xpcshell-wr
sleep 60
fi
# Basic render testing
export TEST_PARAMS="--setpref reftest.ignoreWindowSize=true --setpref widget.wayland.test-workarounds.enabled=true"
#export TEST_FLAVOUR=""
#if [ $RUN_REFTEST -ne 0 ] ; then
# ./mach reftest --marionette localhost:$(($(($RANDOM))+2000)) $TEST_PARAMS 2>&1 | tee $TEST_DIR/reftest$TEST_FLAVOUR
#fi
#if [ $RUN_CRASHTEST -ne 0 ] ; then
# ./mach crashtest --marionette localhost:$(($(($RANDOM))+2000)) $TEST_PARAMS 2>&1 | tee $TEST_DIR/crashtest$TEST_FLAVOUR
#fi
#if [ $RUN_MOCHITEST -ne 0 ] ; then
# ./mach mochitest --marionette localhost:$(($(($RANDOM))+2000)) $MOCHITEST_PARAMS $TEST_PARAMS 2>&1 | tee $TEST_DIR/mochitest$TEST_FLAVOUR
#fi
# WebRender testing
export TEST_PARAMS="--enable-webrender $TEST_PARAMS"
export TEST_FLAVOUR="-wr"
# Use dom/base/test or dom/base/test/chrome for short version
export MOCHITEST_DIR='dom'
if [ $RUN_REFTEST -ne 0 ] ; then
./mach reftest $TEST_PARAMS 2>&1 | tee $TEST_DIR/reftest$TEST_FLAVOUR
sleep 60
fi
if [ $RUN_CRASHTEST -ne 0 ] ; then
./mach crashtest $TEST_PARAMS 2>&1 | tee $TEST_DIR/crashtest$TEST_FLAVOUR
sleep 60
fi
if [ $RUN_MOCHITEST -ne 0 ] ; then
./mach mochitest $MOCHITEST_DIR $MOCHITEST_PARAMS $TEST_PARAMS 2>&1 | tee $TEST_DIR/mochitest$TEST_FLAVOUR
sleep 60
fi
rm -f objdir/dist/bin/certutil
rm -f objdir/dist/bin/pk12util

View file

@ -1,39 +0,0 @@
#!/usr/bin/bash
set -x
export MACH_USE_SYSTEM_PYTHON=1
export MOZ_NODE_PATH=/usr/bin/node
export X_PARAMS="-screen 0 1600x1200x24"
export MOCHITEST_PARAMS="--timeout 1 --chunk-by-dir 4"
export TEST_DIR="test_results"
# Fix for system nss
ln -s /usr/bin/certutil objdir/dist/bin/certutil
ln -s /usr/bin/pk12util objdir/dist/bin/pk12util
NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"
# Basic render testing
export TEST_PARAMS=""
export TEST_FLAVOUR=""
#xvfb-run -s "$X_PARAMS" -n 91 ./mach xpcshell-test --sequential $TEST_PARAMS 2>&1 | cat - | tee $TEST_DIR/xpcshell
#xvfb-run -s "$X_PARAMS" -n 92 ./mach reftest --marionette localhost:$(($(($RANDOM))+2000)) $TEST_PARAMS 2>&1 | tee $TEST_DIR/reftest$TEST_FLAVOUR
#xvfb-run -s "$X_PARAMS" -n 93 ./mach crashtest --marionette localhost:$(($(($RANDOM))+2000)) $TEST_PARAMS 2>&1 | tee $TEST_DIR/crashtest$TEST_FLAVOUR
#xvfb-run -s "$X_PARAMS" -n 94 ./mach mochitest --marionette localhost:$(($(($RANDOM))+2000)) $MOCHITEST_PARAMS $TEST_PARAMS 2>&1 | tee $TEST_DIR/mochitest$TEST_FLAVOUR
# WebRender testing
export TEST_PARAMS="--enable-webrender $TEST_PARAMS"
export TEST_FLAVOUR="-wr"
#xvfb-run -s "$X_PARAMS" -n 95 ./mach xpcshell-test --sequential $TEST_PARAMS 2>&1 | cat - | tee $TEST_DIR/xpcshell-wr
#sleep 60
#xvfb-run -s "$X_PARAMS" -n 96 ./mach reftest $TEST_PARAMS 2>&1 | tee $TEST_DIR/reftest$TEST_FLAVOUR
#sleep 60
#xvfb-run -s "$X_PARAMS" -n 97 ./mach crashtest $TEST_PARAMS 2>&1 | tee $TEST_DIR/crashtest$TEST_FLAVOUR
#sleep 60
#export DISPLAY=:0
#./mach mochitest dom/base/test/ $MOCHITEST_PARAMS $TEST_PARAMS 2>&1 | tee $TEST_DIR/mochitest$TEST_FLAVOUR
export DISPLAY=:98
xvfb-run -s "$X_PARAMS" -n 98 ./mach mochitest dom/base/test/ $MOCHITEST_PARAMS $TEST_PARAMS 2>&1 | tee $TEST_DIR/mochitest$TEST_FLAVOUR
rm -f objdir/dist/bin/certutil
rm -f objdir/dist/bin/pk12util

View file

@ -1,59 +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=firefox-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."

File diff suppressed because one or more lines are too long

10
sources
View file

@ -1,7 +1,3 @@
SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36
SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a
SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa
SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465
SHA512 (cbindgen-vendor.tar.xz) = bea420e66bdd1c7c944655dd3e01abd6e7d6ac4b245c7ee190f31d800f7786f21e5cae11715b479bf795f4369d18c40dc12df19e0b643664f2f78e5c8a681415
SHA512 (firefox-langpacks-147.0-20260106.tar.xz) = 4006c6e8dda8722509c1d1756807373d431d75b20d5a0c3f19e72a2a0dc76df62b15ef871e3fff2d30b2682e6a56b4a4541d8445ea1b83641559a3270e0057b7
SHA512 (firefox-147.0.source.tar.xz) = ac9017b1a2da7b2f139392c394c36341fd3476e3d4ea1a3c7e5e7bf100dc30d185132ef9256be7e6b0f9dbfc69234ac571ea1fc6db9d84543b15772f4ec85161
SHA512 (cbindgen-vendor.tar.xz) = a12d9dd45301614f3a7fcd77f61e3f731718fc418fcf84b0ac7363ef4ddd8ff60e057febef917620ac89d2d47d76b8dccfa71405935e346b849b93425732016a
SHA512 (firefox-76.0.1.source.tar.xz) = 188d7dc51200662048f808e32eced55979a69059bf88eac8386307f9371adad4ca524819d99a001b6d900147b8f216d5d330430f15f11eae0b01cccf8f39681f
SHA512 (firefox-langpacks-76.0.1-20200508.tar.xz) = 86ff8486282914fdb6203bd099f6bcaf266c4453dd56c1876768c26d281ab0089ad0f141f86f912bfebc9677cc0b82583f86231bb2612ae2d5820078666fc9dc

View file

@ -1,35 +0,0 @@
diff -up firefox-134.0.1/toolkit/moz.configure.wasi firefox-134.0.1/toolkit/moz.configure
--- firefox-134.0.1/toolkit/moz.configure.wasi 2025-01-13 14:46:04.000000000 +0100
+++ firefox-134.0.1/toolkit/moz.configure 2025-01-17 08:39:38.870092763 +0100
@@ -2767,7 +2776,7 @@ with only_when(requires_wasm_sandboxing
def wasi_sysroot_flags(wasi_sysroot):
if wasi_sysroot:
log.info("Using wasi sysroot in %s", wasi_sysroot)
- return ["--sysroot=%s" % wasi_sysroot]
+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-147.0-build/firefox-147.0/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"]
return []
set_config("WASI_SYSROOT", wasi_sysroot)
diff -up firefox-134.0.1/wasi-sdk-25/cmake/wasi-sdk-toolchain.cmake.wasi firefox-134.0.1/wasi-sdk-25/cmake/wasi-sdk-toolchain.cmake
--- firefox-134.0.1/wasi-sdk-25/cmake/wasi-sdk-toolchain.cmake.wasi 2025-01-17 08:40:23.004159900 +0100
+++ firefox-134.0.1/wasi-sdk-25/cmake/wasi-sdk-toolchain.cmake 2025-01-17 08:40:35.478178790 +0100
@@ -126,7 +126,7 @@ endif()
add_custom_command(
OUTPUT ${wasm_component_ld}
COMMAND
- cargo install --root ${wasm_component_ld_root} ${rust_target_flag}
+ cargo install --offline --root ${wasm_component_ld_root} ${rust_target_flag}
wasm-component-ld@${wasm_component_ld_version}
COMMAND
cmake -E make_directory ${wasi_tmp_install}/bin
diff -up firefox-134.0.2/wasi-sdk-25/version.py.wasi firefox-134.0.2/wasi-sdk-25/version.py
--- firefox-134.0.2/wasi-sdk-25/version.py.wasi 2025-01-16 08:03:26.042654800 +0100
+++ firefox-134.0.2/wasi-sdk-25/version.py 2025-01-22 14:08:34.563909971 +0100
@@ -60,6 +60,7 @@ assert parse_git_version(
def git_version():
+ return 25
version = exec(['git', 'describe', '--long', '--candidates=999',
'--match=wasi-sdk-*', '--dirty=+m', f'--abbrev={GIT_REF_LEN}'],
os.path.dirname(sys.argv[0]))

View file

@ -1,35 +0,0 @@
diff -up firefox-134.0.1/toolkit/moz.configure.wasi firefox-134.0.1/toolkit/moz.configure
--- firefox-134.0.1/toolkit/moz.configure.wasi 2025-01-13 14:46:04.000000000 +0100
+++ firefox-134.0.1/toolkit/moz.configure 2025-01-17 08:39:38.870092763 +0100
@@ -2767,7 +2776,7 @@ with only_when(requires_wasm_sandboxing
def wasi_sysroot_flags(wasi_sysroot):
if wasi_sysroot:
log.info("Using wasi sysroot in %s", wasi_sysroot)
- return ["--sysroot=%s" % wasi_sysroot]
+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "LIBCLANG_RT_PLACEHOLDER"]
return []
set_config("WASI_SYSROOT", wasi_sysroot)
diff -up firefox-134.0.1/wasi-sdk-25/cmake/wasi-sdk-toolchain.cmake.wasi firefox-134.0.1/wasi-sdk-25/cmake/wasi-sdk-toolchain.cmake
--- firefox-134.0.1/wasi-sdk-25/cmake/wasi-sdk-toolchain.cmake.wasi 2025-01-17 08:40:23.004159900 +0100
+++ firefox-134.0.1/wasi-sdk-25/cmake/wasi-sdk-toolchain.cmake 2025-01-17 08:40:35.478178790 +0100
@@ -126,7 +126,7 @@ endif()
add_custom_command(
OUTPUT ${wasm_component_ld}
COMMAND
- cargo install --root ${wasm_component_ld_root} ${rust_target_flag}
+ cargo install --offline --root ${wasm_component_ld_root} ${rust_target_flag}
wasm-component-ld@${wasm_component_ld_version}
COMMAND
cmake -E make_directory ${wasi_tmp_install}/bin
diff -up firefox-134.0.2/wasi-sdk-25/version.py.wasi firefox-134.0.2/wasi-sdk-25/version.py
--- firefox-134.0.2/wasi-sdk-25/version.py.wasi 2025-01-16 08:03:26.042654800 +0100
+++ firefox-134.0.2/wasi-sdk-25/version.py 2025-01-22 14:08:34.563909971 +0100
@@ -60,6 +60,7 @@ assert parse_git_version(
def git_version():
+ return 25
version = exec(['git', 'describe', '--long', '--candidates=999',
'--match=wasi-sdk-*', '--dirty=+m', f'--abbrev={GIT_REF_LEN}'],
os.path.dirname(sys.argv[0]))