!9 Update to 79.0

Merge pull request !9 from jpzhang187/master
This commit is contained in:
openeuler-ci-bot 2020-08-22 10:13:07 +08:00 committed by Gitee
commit 649de3b033
68 changed files with 3865 additions and 2126 deletions

View File

@ -1,35 +0,0 @@
From f8f381bf03b528000e3269451efe945a38fe5f0a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= <emilio@crisal.io>
Date: Sun, 13 Jan 2019 21:42:38 +0100
Subject: [PATCH] Bug 1519629 - Document a few more macros.
---
servo/components/style/gecko/regen_atoms.py | 1 +
servo/components/style/gecko_string_cache/namespace.rs | 2 ++
2 files changed, 3 insertions(+)
diff --git a/servo/components/style/gecko/regen_atoms.py b/servo/components/style/gecko/regen_atoms.py
index 3666121..fde5463 100755
--- a/servo/components/style/gecko/regen_atoms.py
+++ b/servo/components/style/gecko/regen_atoms.py
@@ -202,6 +202,7 @@ RULE_TEMPLATE = ('("{atom}") =>\n '
' }}}};')
MACRO = '''
+/// Returns a static atom by passing the literal string it represents.
#[macro_export]
macro_rules! atom {{
{}
diff --git a/servo/components/style/gecko_string_cache/namespace.rs b/servo/components/style/gecko_string_cache/namespace.rs
index aad7b03..cf01819 100644
--- a/servo/components/style/gecko_string_cache/namespace.rs
+++ b/servo/components/style/gecko_string_cache/namespace.rs
@@ -11,6 +11,8 @@ use std::fmt;
use std::ops::Deref;
use string_cache::{Atom, WeakAtom};
+/// In Gecko namespaces are just regular atoms, so this is a simple macro to
+/// forward one macro to the other.
#[macro_export]
macro_rules! ns {
() => {

View File

@ -1,62 +0,0 @@
From 9d5e559547d0b4c7eb6d3c1843cc929328e0f2e4 Mon Sep 17 00:00:00 2001
From: Simon Sapin <simon.sapin@exyr.org>
Date: Fri, 11 Jan 2019 14:03:44 +0100
Subject: [PATCH] Bug 1519729 - Document public macros. r=emilio
Undocumented public macros emit warnings in nightly-2019-01-11,
and we #![deny] that warning.
Cherry-picks a commit from https://github.com/servo/servo/pull/22674
---
.../style/properties/properties.mako.rs | 17 ++++++++++++++++-
servo/components/style_traits/values.rs | 2 +-
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/servo/components/style/properties/properties.mako.rs b/servo/components/style/properties/properties.mako.rs
index 2d91273be15a7..9220c3b1a6655 100644
--- a/servo/components/style/properties/properties.mako.rs
+++ b/servo/components/style/properties/properties.mako.rs
@@ -3821,7 +3821,14 @@ impl AliasId {
}
}
-// NOTE(emilio): Callers are responsible to deal with prefs.
+/// Call the given macro with tokens like this for each longhand and shorthand properties
+/// that is enabled in content:
+///
+/// ```
+/// [CamelCaseName, SetCamelCaseName, PropertyId::Longhand(LonghandId::CamelCaseName)],
+/// ```
+///
+/// NOTE(emilio): Callers are responsible to deal with prefs.
#[macro_export]
macro_rules! css_properties_accessors {
($macro_name: ident) => {
@@ -3844,6 +3851,14 @@ macro_rules! css_properties_accessors {
}
}
+/// Call the given macro with tokens like this for each longhand properties:
+///
+/// ```
+/// { snake_case_ident, true }
+/// ```
+///
+/// … where the boolean indicates whether the property value type
+/// is wrapped in a `Box<_>` in the corresponding `PropertyDeclaration` variant.
#[macro_export]
macro_rules! longhand_properties_idents {
($macro_name: ident) => {
diff --git a/servo/components/style_traits/values.rs b/servo/components/style_traits/values.rs
index 2851082c22e05..0d7ee3f506ce2 100644
--- a/servo/components/style_traits/values.rs
+++ b/servo/components/style_traits/values.rs
@@ -432,7 +432,7 @@ impl_to_css_for_predefined_type!(::cssparser::RGBA);
impl_to_css_for_predefined_type!(::cssparser::Color);
impl_to_css_for_predefined_type!(::cssparser::UnicodeRange);
-#[macro_export]
+/// Define an enum type with unit variants that each corrsepond to a CSS keyword.
macro_rules! define_css_keyword_enum {
(pub enum $name:ident { $($variant:ident = $css:expr,)+ }) => {
#[allow(missing_docs)]

View File

@ -1,39 +0,0 @@
From 9bdfa9fecaf15456ba634fdef4c5130d4bf663e6 Mon Sep 17 00:00:00 2001
From: Simon Sapin <simon.sapin@exyr.org>
Date: Fri, 11 Jan 2019 14:02:28 +0100
Subject: [PATCH] Bug 1519729 - Remove unused macro. r=emilio
Cherry-picks a commit from https://github.com/servo/servo/pull/22674
---
servo/components/style_traits/values.rs | 18 ------------------
1 file changed, 18 deletions(-)
diff --git a/servo/components/style_traits/values.rs b/servo/components/style_traits/values.rs
index 6da235c07b645..2851082c22e05 100644
--- a/servo/components/style_traits/values.rs
+++ b/servo/components/style_traits/values.rs
@@ -158,24 +158,6 @@ where
}
}
-#[macro_export]
-macro_rules! serialize_function {
- ($dest: expr, $name: ident($( $arg: expr, )+)) => {
- serialize_function!($dest, $name($($arg),+))
- };
- ($dest: expr, $name: ident($first_arg: expr $( , $arg: expr )*)) => {
- {
- $dest.write_str(concat!(stringify!($name), "("))?;
- $first_arg.to_css($dest)?;
- $(
- $dest.write_str(", ")?;
- $arg.to_css($dest)?;
- )*
- $dest.write_char(')')
- }
- }
-}
-
/// Convenience wrapper to serialise CSS values separated by a given string.
pub struct SequenceWriter<'a, 'b: 'a, W: 'b> {
inner: &'a mut CssWriter<'b, W>,

View File

@ -1,25 +0,0 @@
From 2b08ae08b260aa17327f811e5eaf9f7aeba3dfec Mon Sep 17 00:00:00 2001
From: lqd <remy.rakic+github@gmail.com>
Date: Fri, 11 Jan 2019 16:35:26 +0100
Subject: [PATCH] Bug 1519729 - Typo fix in new doc-comment. r=emilio
Cherry-picks a commit from https://github.com/servo/servo/pull/22674
Co-Authored-By: SimonSapin <simon.sapin@exyr.org>
---
servo/components/style_traits/values.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/servo/components/style_traits/values.rs b/servo/components/style_traits/values.rs
index 0d7ee3f506ce2..582e34eb3db03 100644
--- a/servo/components/style_traits/values.rs
+++ b/servo/components/style_traits/values.rs
@@ -432,7 +432,7 @@ impl_to_css_for_predefined_type!(::cssparser::RGBA);
impl_to_css_for_predefined_type!(::cssparser::Color);
impl_to_css_for_predefined_type!(::cssparser::UnicodeRange);
-/// Define an enum type with unit variants that each corrsepond to a CSS keyword.
+/// Define an enum type with unit variants that each correspond to a CSS keyword.
macro_rules! define_css_keyword_enum {
(pub enum $name:ident { $($variant:ident = $css:expr,)+ }) => {
#[allow(missing_docs)]

View File

@ -1,72 +0,0 @@
From c4573875e2765595093d23b2e73cfa3a976a4ed0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= <emilio@crisal.io>
Date: Mon, 11 Mar 2019 19:28:37 +0000
Subject: [PATCH] Bug 1533969 - Fix build error with newer glibc. r=nbp
New glibc versions provide a wrapper for gettid, which means that our stuff
fails to build with:
```
/home/emilio/src/moz/gecko/js/src/util/NativeStack.cpp:28:14: error: static declaration of 'gettid' follows non-static declaration
static pid_t gettid() { return syscall(__NR_gettid); }
^
/usr/include/bits/unistd_ext.h:34:16: note: previous declaration is here
extern __pid_t gettid (void) __THROW;
```
Differential Revision: https://phabricator.services.mozilla.com/D22829
--HG--
extra : moz-landing-system : lando
---
js/src/util/NativeStack.cpp | 2 +-
tools/profiler/core/platform.h | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/js/src/util/NativeStack.cpp b/js/src/util/NativeStack.cpp
index 57beda99c76c1..b988faee7c5b7 100644
--- a/js/src/util/NativeStack.cpp
+++ b/js/src/util/NativeStack.cpp
@@ -25,11 +25,7 @@
# include <sys/syscall.h>
# include <sys/types.h>
# include <unistd.h>
-static pid_t
-gettid()
-{
- return syscall(__NR_gettid);
-}
+# define gettid() static_cast<pid_t>(syscall(__NR_gettid))
# endif
#else
# error "Unsupported platform"
diff --git a/tools/profiler/core/platform.h b/tools/profiler/core/platform.h
index f02faf2822364..8379eb0347554 100644
--- a/tools/profiler/core/platform.h
+++ b/tools/profiler/core/platform.h
@@ -39,22 +39,16 @@
#include "PlatformMacros.h"
#include <vector>
-// We need a definition of gettid(), but glibc doesn't provide a
+// We need a definition of gettid(), but old glibc versions don't provide a
// wrapper for it.
#if defined(__GLIBC__)
#include <unistd.h>
#include <sys/syscall.h>
-static inline pid_t gettid()
-{
- return (pid_t) syscall(SYS_gettid);
-}
+# define gettid() static_cast<pid_t>(syscall(SYS_gettid))
#elif defined(GP_OS_darwin)
#include <unistd.h>
#include <sys/syscall.h>
-static inline pid_t gettid()
-{
- return (pid_t) syscall(SYS_thread_selfid);
-}
+# define gettid() static_cast<pid_t>(syscall(SYS_thread_selfid))
#elif defined(GP_OS_android)
#include <unistd.h>
#elif defined(GP_OS_windows)

View File

@ -1,61 +0,0 @@
From be4391585f7069c6bcb9efb364a97bd3554d6a01 Mon Sep 17 00:00:00 2001
From: Kartikaya Gupta <kgupta@mozilla.com>
Date: Wed, 5 Jun 2019 14:06:25 +0000
Subject: [PATCH] Bug 1556597 - Fix warnings in webrender_bindings in nightly
rust. r=Gankro
Depends on D33782
Differential Revision: https://phabricator.services.mozilla.com/D33783
--HG--
extra : moz-landing-system : lando
---
gfx/webrender_bindings/src/bindings.rs | 4 ++--
gfx/webrender_bindings/src/moz2d_renderer.rs | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/gfx/webrender_bindings/src/bindings.rs b/gfx/webrender_bindings/src/bindings.rs
index cf3b9efa1d898..f2693b99474bc 100644
--- a/gfx/webrender_bindings/src/bindings.rs
+++ b/gfx/webrender_bindings/src/bindings.rs
@@ -577,7 +577,7 @@ extern "C" {
}
impl RenderNotifier for CppNotifier {
- fn clone(&self) -> Box<RenderNotifier> {
+ fn clone(&self) -> Box<dyn RenderNotifier> {
Box::new(CppNotifier {
window_id: self.window_id,
})
@@ -1167,7 +1167,7 @@ pub extern "C" fn wr_window_new(window_id: WrWindowId,
-> bool {
assert!(unsafe { is_in_render_thread() });
- let recorder: Option<Box<ApiRecordingReceiver>> = if unsafe { gfx_use_wrench() } {
+ let recorder: Option<Box<dyn ApiRecordingReceiver>> = if unsafe { gfx_use_wrench() } {
let name = format!("wr-record-{}.bin", window_id.0);
Some(Box::new(BinaryRecorder::new(&PathBuf::from(name))))
} else {
diff --git a/gfx/webrender_bindings/src/moz2d_renderer.rs b/gfx/webrender_bindings/src/moz2d_renderer.rs
index ee672ee..6d9dcb2 100644
--- a/gfx/webrender_bindings/src/moz2d_renderer.rs
+++ b/webrender_bindings/src/moz2d_renderer.rs
@@ -365,7 +365,7 @@ impl BlobImageRenderer for Moz2dImageRenderer {
}
fn request(&mut self,
- resources: &BlobImageResources,
+ resources: &dyn BlobImageResources,
request: BlobImageRequest,
descriptor: &BlobImageDescriptor,
dirty_rect: Option<DeviceUintRect>) {
@@ -403,7 +403,7 @@ impl BlobImageRenderer for Moz2dImageRenderer {
unsafe { AddNativeFontHandle(key, cstr.as_ptr() as *mut c_void, handle.index) };
}
- fn process_fonts(mut extra_data: BufReader, resources: &BlobImageResources) {
+ fn process_fonts(mut extra_data: BufReader, resources: &dyn BlobImageResources) {
let font_count = extra_data.read_usize();
for _ in 0..font_count {
let key = extra_data.read_font_key();

View File

@ -1,102 +0,0 @@
From c73d875661b96789047dd5cdccff82f1f639924d Mon Sep 17 00:00:00 2001
From: Jan Odvarko <odvarko@gmail.com>
Date: Wed, 12 Feb 2020 11:52:30 +0000
Subject: [PATCH] Bug 1607742 - Escape method argument r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D60413
--HG--
extra : moz-landing-system : lando
---
devtools/client/shared/curl.js | 33 ++++++++++++++++++++++-----------
1 file changed, 22 insertions(+), 11 deletions(-)
diff --git a/devtools/client/shared/curl.js b/devtools/client/shared/curl.js
index 30d8382..6d862be 100644
--- a/devtools/client/shared/curl.js
+++ b/devtools/client/shared/curl.js
@@ -59,6 +59,17 @@ const Curl = {
const utils = CurlUtils;
let command = ["curl"];
+ // Make sure to use the following helpers to sanitize arguments before execution.
+ const addParam = value => {
+ const safe = /^[a-zA-Z-]+$/.test(value) ? value : escapeString(value);
+ command.push(safe);
+ };
+
+ const addPostData = value => {
+ const safe = /^[a-zA-Z-]+$/.test(value) ? value : escapeString(value);
+ postData.push(safe);
+ };
+
const ignoredHeaders = new Set();
// The cURL command is expected to run on the same platform that Firefox runs
@@ -67,7 +78,7 @@ const Curl = {
utils.escapeStringWin : utils.escapeStringPosix;
// Add URL.
- command.push(escapeString(data.url));
+ addParam(data.url);
let postDataText = null;
const multipartRequest = utils.isMultipartRequest(data);
@@ -77,15 +88,15 @@ const Curl = {
if (utils.isUrlEncodedRequest(data) ||
["PUT", "POST", "PATCH"].includes(data.method)) {
postDataText = data.postDataText;
- postData.push("--data");
- postData.push(escapeString(utils.writePostDataTextParams(postDataText)));
+ addPostData("--data");
+ addPostData(utils.writePostDataTextParams(postDataText));
ignoredHeaders.add("content-length");
} else if (multipartRequest) {
postDataText = data.postDataText;
- postData.push("--data-binary");
+ addPostData("--data-binary");
const boundary = utils.getMultipartBoundary(data);
const text = utils.removeBinaryDataFromMultipartText(postDataText, boundary);
- postData.push(escapeString(text));
+ addPostData(text);
ignoredHeaders.add("content-length");
}
// curl generates the host header itself based on the given URL
@@ -95,13 +106,13 @@ const Curl = {
// For servers that supports HEAD.
// This will fetch the header of a document only.
if (data.method == "HEAD") {
- command.push("-I");
+ addParam("-I");
} else if (!(data.method == "GET" || data.method == "POST")) {
// Add method.
// For HEAD, GET and POST requests this is not necessary. GET is the
// default, if --data or --binary is added POST is used, -I implies HEAD.
- command.push("-X");
- command.push(data.method);
+ addParam("-X");
+ addParam(data.method);
}
// Add request headers.
@@ -113,14 +124,14 @@ const Curl = {
for (let i = 0; i < headers.length; i++) {
const header = headers[i];
if (header.name.toLowerCase() === "accept-encoding") {
- command.push("--compressed");
+ addParam("--compressed");
continue;
}
if (ignoredHeaders.has(header.name.toLowerCase())) {
continue;
}
- command.push("-H");
- command.push(escapeString(header.name + ": " + header.value));
+ addParam("-H");
+ addParam(header.name + ": " + header.value);
}
// Add post data.
--
2.23.0

View File

@ -1,415 +0,0 @@
From 187b93c6acb2340749b1586bd12afac1d619b136 Mon Sep 17 00:00:00 2001
From: Jan de Mooij <jdemooij@mozilla.com>
Date: Tue, 4 Feb 2020 14:18:11 +0000
Subject: [PATCH] Bug 1608256 - Remove MakeMRegExpHoistable optimization
.
r=tcampbell
It's a lot of code and doesn't seem to affect Octane-regexp.
Differential Revision: https://phabricator.services.mozilla.com/D61427
--HG--
extra : moz-landing-system : lando
---
js/src/jit/Ion.cpp | 8 -
js/src/jit/IonAnalysis.cpp | 267 --------------------------------
js/src/jit/IonAnalysis.h | 3 -
js/src/jit/Lowering.cpp | 11 +-
js/src/jit/MIR.h | 8 -
js/src/vm/CommonPropertyNames.h | 6 -
6 files changed, 3 insertions(+), 300 deletions(-)
diff --git a/js/src/jit/Ion.cpp b/js/src/jit/Ion.cpp
index fd31413..08d49bd 100644
--- a/js/src/jit/Ion.cpp
+++ b/js/src/jit/Ion.cpp
@@ -1361,14 +1361,6 @@ OptimizeMIR(MIRGenerator* mir)
if (mir->shouldCancel("Start"))
return false;
- if (!mir->compilingWasm()) {
- if (!MakeMRegExpHoistable(mir, graph))
- return false;
-
- if (mir->shouldCancel("Make MRegExp Hoistable"))
- return false;
- }
-
gs.spewPass("BuildSSA");
AssertBasicGraphCoherency(graph);
diff --git a/js/src/jit/IonAnalysis.cpp b/js/src/jit/IonAnalysis.cpp
index fd89546..217a4c5 100644
--- a/js/src/jit/IonAnalysis.cpp
+++ b/js/src/jit/IonAnalysis.cpp
@@ -2033,273 +2033,6 @@ jit::ApplyTypeInformation(MIRGenerator* mir, MIRGraph& graph)
return true;
}
-// Check if `def` is only the N-th operand of `useDef`.
-static inline size_t
-IsExclusiveNthOperand(MDefinition* useDef, size_t n, MDefinition* def)
-{
- uint32_t num = useDef->numOperands();
- if (n >= num || useDef->getOperand(n) != def)
- return false;
-
- for (uint32_t i = 0; i < num; i++) {
- if (i == n)
- continue;
- if (useDef->getOperand(i) == def)
- return false;
- }
-
- return true;
-}
-
-static size_t
-IsExclusiveThisArg(MCall* call, MDefinition* def)
-{
- return IsExclusiveNthOperand(call, MCall::IndexOfThis(), def);
-}
-
-static size_t
-IsExclusiveFirstArg(MCall* call, MDefinition* def)
-{
- return IsExclusiveNthOperand(call, MCall::IndexOfArgument(0), def);
-}
-
-static bool
-IsRegExpHoistableCall(CompileRuntime* runtime, MCall* call, MDefinition* def)
-{
- if (call->isConstructing())
- return false;
-
- JSAtom* name;
- if (WrappedFunction* fun = call->getSingleTarget()) {
- if (!fun->isSelfHostedBuiltin())
- return false;
- name = GetSelfHostedFunctionName(fun->rawJSFunction());
- } else {
- MDefinition* funDef = call->getFunction();
- if (funDef->isDebugCheckSelfHosted())
- funDef = funDef->toDebugCheckSelfHosted()->input();
- if (funDef->isTypeBarrier())
- funDef = funDef->toTypeBarrier()->input();
-
- if (!funDef->isCallGetIntrinsicValue())
- return false;
- name = funDef->toCallGetIntrinsicValue()->name();
- }
-
- // Hoistable only if the RegExp is the first argument of RegExpBuiltinExec.
- if (name == runtime->names().RegExpBuiltinExec ||
- name == runtime->names().UnwrapAndCallRegExpBuiltinExec ||
- name == runtime->names().RegExpMatcher ||
- name == runtime->names().RegExpTester ||
- name == runtime->names().RegExpSearcher)
- {
- return IsExclusiveFirstArg(call, def);
- }
-
- if (name == runtime->names().RegExp_prototype_Exec)
- return IsExclusiveThisArg(call, def);
-
- return false;
-}
-
-static bool
-CanCompareRegExp(MCompare* compare, MDefinition* def)
-{
- MDefinition* value;
- if (compare->lhs() == def) {
- value = compare->rhs();
- } else {
- MOZ_ASSERT(compare->rhs() == def);
- value = compare->lhs();
- }
-
- // Comparing two regexp that weren't cloned will give different result
- // than if they were cloned.
- if (value->mightBeType(MIRType::Object))
- return false;
-
- // Make sure @@toPrimitive is not called which could notice
- // the difference between a not cloned/cloned regexp.
-
- JSOp op = compare->jsop();
- // Strict equality comparison won't invoke @@toPrimitive.
- if (op == JSOP_STRICTEQ || op == JSOP_STRICTNE)
- return true;
-
- if (op != JSOP_EQ && op != JSOP_NE) {
- // Relational comparison always invoke @@toPrimitive.
- MOZ_ASSERT(op == JSOP_GT || op == JSOP_GE || op == JSOP_LT || op == JSOP_LE);
- return false;
- }
-
- // Loose equality comparison can invoke @@toPrimitive.
- if (value->mightBeType(MIRType::Boolean) || value->mightBeType(MIRType::String) ||
- value->mightBeType(MIRType::Int32) ||
- value->mightBeType(MIRType::Double) || value->mightBeType(MIRType::Float32) ||
- value->mightBeType(MIRType::Symbol))
- {
- return false;
- }
-
- return true;
-}
-
-static inline void
-SetNotInWorklist(MDefinitionVector& worklist)
-{
- for (size_t i = 0; i < worklist.length(); i++)
- worklist[i]->setNotInWorklist();
-}
-
-static bool
-IsRegExpHoistable(MIRGenerator* mir, MDefinition* regexp, MDefinitionVector& worklist,
- bool* hoistable)
-{
- MOZ_ASSERT(worklist.length() == 0);
-
- if (!worklist.append(regexp))
- return false;
- regexp->setInWorklist();
-
- for (size_t i = 0; i < worklist.length(); i++) {
- MDefinition* def = worklist[i];
- if (mir->shouldCancel("IsRegExpHoistable outer loop"))
- return false;
-
- for (MUseIterator use = def->usesBegin(); use != def->usesEnd(); use++) {
- if (mir->shouldCancel("IsRegExpHoistable inner loop"))
- return false;
-
- // Ignore resume points. At this point all uses are listed.
- // No DCE or GVN or something has happened.
- if (use->consumer()->isResumePoint())
- continue;
-
- MDefinition* useDef = use->consumer()->toDefinition();
-
- // Step through a few white-listed ops.
- if (useDef->isPhi() || useDef->isFilterTypeSet() || useDef->isGuardShape()) {
- if (useDef->isInWorklist())
- continue;
-
- if (!worklist.append(useDef))
- return false;
- useDef->setInWorklist();
- continue;
- }
-
- // Instructions that doesn't invoke unknown code that may modify
- // RegExp instance or pass it to elsewhere.
- if (useDef->isRegExpMatcher() || useDef->isRegExpTester() ||
- useDef->isRegExpSearcher())
- {
- if (IsExclusiveNthOperand(useDef, 0, def))
- continue;
- } else if (useDef->isLoadFixedSlot() || useDef->isTypeOf()) {
- continue;
- } else if (useDef->isCompare()) {
- if (CanCompareRegExp(useDef->toCompare(), def))
- continue;
- }
- // Instructions that modifies `lastIndex` property.
- else if (useDef->isStoreFixedSlot()) {
- if (IsExclusiveNthOperand(useDef, 0, def)) {
- MStoreFixedSlot* store = useDef->toStoreFixedSlot();
- if (store->slot() == RegExpObject::lastIndexSlot())
- continue;
- }
- } else if (useDef->isSetPropertyCache()) {
- if (IsExclusiveNthOperand(useDef, 0, def)) {
- MSetPropertyCache* setProp = useDef->toSetPropertyCache();
- if (setProp->idval()->isConstant()) {
- Value propIdVal = setProp->idval()->toConstant()->toJSValue();
- if (propIdVal.isString()) {
- CompileRuntime* runtime = mir->runtime;
- if (propIdVal.toString() == runtime->names().lastIndex)
- continue;
- }
- }
- }
- }
- // MCall is safe only for some known safe functions.
- else if (useDef->isCall()) {
- if (IsRegExpHoistableCall(mir->runtime, useDef->toCall(), def))
- continue;
- }
-
- // Everything else is unsafe.
- SetNotInWorklist(worklist);
- worklist.clear();
- *hoistable = false;
-
- return true;
- }
- }
-
- SetNotInWorklist(worklist);
- worklist.clear();
- *hoistable = true;
- return true;
-}
-
-bool
-jit::MakeMRegExpHoistable(MIRGenerator* mir, MIRGraph& graph)
-{
- // If we are compiling try blocks, regular expressions may be observable
- // from catch blocks (which Ion does not compile). For now just disable the
- // pass in this case.
- if (graph.hasTryBlock())
- return true;
-
- MDefinitionVector worklist(graph.alloc());
-
- for (ReversePostorderIterator block(graph.rpoBegin()); block != graph.rpoEnd(); block++) {
- if (mir->shouldCancel("MakeMRegExpHoistable outer loop"))
- return false;
-
- for (MDefinitionIterator iter(*block); iter; iter++) {
- if (!*iter)
- MOZ_CRASH("confirm bug 1263794.");
-
- if (mir->shouldCancel("MakeMRegExpHoistable inner loop"))
- return false;
-
- if (!iter->isRegExp())
- continue;
-
- MRegExp* regexp = iter->toRegExp();
-
- bool hoistable = false;
- if (!IsRegExpHoistable(mir, regexp, worklist, &hoistable))
- return false;
-
- if (!hoistable)
- continue;
-
- // Make MRegExp hoistable
- regexp->setMovable();
- regexp->setDoNotClone();
-
- // That would be incorrect for global/sticky, because lastIndex
- // could be wrong. Therefore setting the lastIndex to 0. That is
- // faster than a not movable regexp.
- RegExpObject* source = regexp->source();
- if (source->sticky() || source->global()) {
- if (!graph.alloc().ensureBallast())
- return false;
- MConstant* zero = MConstant::New(graph.alloc(), Int32Value(0));
- regexp->block()->insertAfter(regexp, zero);
-
- MStoreFixedSlot* lastIndex =
- MStoreFixedSlot::New(graph.alloc(), regexp, RegExpObject::lastIndexSlot(), zero);
- regexp->block()->insertAfter(zero, lastIndex);
- }
- }
- }
-
- return true;
-}
-
void
jit::RenumberBlocks(MIRGraph& graph)
{
diff --git a/js/src/jit/IonAnalysis.h b/js/src/jit/IonAnalysis.h
index 512c6bd..d49783c 100644
--- a/js/src/jit/IonAnalysis.h
+++ b/js/src/jit/IonAnalysis.h
@@ -59,9 +59,6 @@ EliminateDeadCode(MIRGenerator* mir, MIRGraph& graph);
MOZ_MUST_USE bool
ApplyTypeInformation(MIRGenerator* mir, MIRGraph& graph);
-MOZ_MUST_USE bool
-MakeMRegExpHoistable(MIRGenerator* mir, MIRGraph& graph);
-
void
RenumberBlocks(MIRGraph& graph);
diff --git a/js/src/jit/Lowering.cpp b/js/src/jit/Lowering.cpp
index 3b52ec5..2ba15a6 100644
--- a/js/src/jit/Lowering.cpp
+++ b/js/src/jit/Lowering.cpp
@@ -2413,14 +2413,9 @@ LIRGenerator::visitToObjectOrNull(MToObjectOrNull* ins)
void
LIRGenerator::visitRegExp(MRegExp* ins)
{
- if (ins->mustClone()) {
- LRegExp* lir = new(alloc()) LRegExp(temp());
- define(lir, ins);
- assignSafepoint(lir, ins);
- } else {
- RegExpObject* source = ins->source();
- define(new(alloc()) LPointer(source), ins);
- }
+ LRegExp* lir = new(alloc()) LRegExp(temp());
+ define(lir, ins);
+ assignSafepoint(lir, ins);
}
void
diff --git a/js/src/jit/MIR.h b/js/src/jit/MIR.h
index e90b500..4a97c41 100644
--- a/js/src/jit/MIR.h
+++ b/js/src/jit/MIR.h
@@ -8605,14 +8605,12 @@ class MDefFun
class MRegExp : public MNullaryInstruction
{
CompilerGCPointer<RegExpObject*> source_;
- bool mustClone_;
bool hasShared_;
MRegExp(TempAllocator& alloc, CompilerConstraintList* constraints, RegExpObject* source,
bool hasShared)
: MNullaryInstruction(classOpcode),
source_(source),
- mustClone_(true),
hasShared_(hasShared)
{
setResultType(MIRType::Object);
@@ -8623,12 +8621,6 @@ class MRegExp : public MNullaryInstruction
INSTRUCTION_HEADER(RegExp)
TRIVIAL_NEW_WRAPPERS_WITH_ALLOC
- void setDoNotClone() {
- mustClone_ = false;
- }
- bool mustClone() const {
- return mustClone_;
- }
bool hasShared() const {
return hasShared_;
}
diff --git a/js/src/vm/CommonPropertyNames.h b/js/src/vm/CommonPropertyNames.h
index 0d537fb..3d2eeb5 100644
--- a/js/src/vm/CommonPropertyNames.h
+++ b/js/src/vm/CommonPropertyNames.h
@@ -346,12 +346,7 @@
"ReadableStreamDefaultReader_releaseLock") \
macro(ReadableStreamTee, ReadableStreamTee, "ReadableStreamTee") \
macro(reason, reason, "reason") \
- macro(RegExpBuiltinExec, RegExpBuiltinExec, "RegExpBuiltinExec") \
macro(RegExpFlagsGetter, RegExpFlagsGetter, "RegExpFlagsGetter") \
- macro(RegExpMatcher, RegExpMatcher, "RegExpMatcher") \
- macro(RegExpSearcher, RegExpSearcher, "RegExpSearcher") \
- macro(RegExpTester, RegExpTester, "RegExpTester") \
- macro(RegExp_prototype_Exec, RegExp_prototype_Exec, "RegExp_prototype_Exec") \
macro(Reify, Reify, "Reify") \
macro(reject, reject, "reject") \
macro(rejected, rejected, "rejected") \
@@ -429,7 +424,6 @@
macro(uninitialized, uninitialized, "uninitialized") \
macro(unsized, unsized, "unsized") \
macro(unwatch, unwatch, "unwatch") \
- macro(UnwrapAndCallRegExpBuiltinExec, UnwrapAndCallRegExpBuiltinExec, "UnwrapAndCallRegExpBuiltinExec") \
macro(url, url, "url") \
macro(usage, usage, "usage") \
macro(useAsm, useAsm, "use asm") \
--
2.23.0

View File

@ -1,133 +0,0 @@
From 235ee6bbd95335ede2a095e3e2ed67022afe7800 Mon Sep 17 00:00:00 2001
From: Perry Jiang <perry@mozilla.com>
Date: Wed, 19 Feb 2020 17:56:08 +0000
Subject: [PATCH] Bug 1604847 - let ClientSourceOpChild finish
initialization
r=dom-workers-and-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D63239
--HG--
extra : moz-landing-system : lando
---
dom/clients/manager/ClientSourceChild.cpp | 2 +-
dom/clients/manager/ClientSourceOpChild.cpp | 28 ++++++++++++++++++++-
dom/clients/manager/ClientSourceOpChild.h | 22 ++++++++++------
3 files changed, 43 insertions(+), 9 deletions(-)
diff --git a/dom/clients/manager/ClientSourceChild.cpp b/dom/clients/manager/ClientSourceChild.cpp
index 0f13a63..e4a8330 100644
--- a/dom/clients/manager/ClientSourceChild.cpp
+++ b/dom/clients/manager/ClientSourceChild.cpp
@@ -37,7 +37,7 @@ ClientSourceChild::AllocPClientSourceOpChild(const ClientOpConstructorArgs& aArg
bool
ClientSourceChild::DeallocPClientSourceOpChild(PClientSourceOpChild* aActor)
{
- delete aActor;
+ static_cast<ClientSourceOpChild*>(aActor)->ScheduleDeletion();
return true;
}
diff --git a/dom/clients/manager/ClientSourceOpChild.cpp b/dom/clients/manager/ClientSourceOpChild.cpp
index dff99d2..b19787f 100644
--- a/dom/clients/manager/ClientSourceOpChild.cpp
+++ b/dom/clients/manager/ClientSourceOpChild.cpp
@@ -8,6 +8,7 @@
#include "ClientSource.h"
#include "ClientSourceChild.h"
+#include "mozilla/Assertions.h"
#include "mozilla/Unused.h"
namespace mozilla {
@@ -72,7 +73,7 @@ ClientSourceOpChild::DoSourceOp(Method aMethod, const Args& aArgs)
void
ClientSourceOpChild::ActorDestroy(ActorDestroyReason aReason)
{
- mPromiseRequestHolder.DisconnectIfExists();
+ Cleanup();
}
void
@@ -111,6 +112,31 @@ ClientSourceOpChild::Init(const ClientOpConstructorArgs& aArgs)
break;
}
}
+
+ mInitialized.Flip();
+
+ if (mDeletionRequested) {
+ Cleanup();
+ delete this;
+ }
+}
+
+void ClientSourceOpChild::ScheduleDeletion() {
+ if (mInitialized) {
+ Cleanup();
+ delete this;
+ return;
+ }
+
+ mDeletionRequested.Flip();
+}
+
+ClientSourceOpChild::~ClientSourceOpChild() {
+ MOZ_DIAGNOSTIC_ASSERT(mInitialized);
+}
+
+void ClientSourceOpChild::Cleanup() {
+ mPromiseRequestHolder.DisconnectIfExists();
}
} // namespace dom
diff --git a/dom/clients/manager/ClientSourceOpChild.h b/dom/clients/manager/ClientSourceOpChild.h
index 1132353..7f30eb0 100644
--- a/dom/clients/manager/ClientSourceOpChild.h
+++ b/dom/clients/manager/ClientSourceOpChild.h
@@ -6,6 +6,7 @@
#ifndef _mozilla_dom_ClientSourceOpChild_h
#define _mozilla_dom_ClientSourceOpChild_h
+#include "mozilla/dom/FlippedOnce.h"
#include "mozilla/dom/PClientSourceOpChild.h"
#include "ClientOpPromise.h"
@@ -16,7 +17,17 @@ class ClientSource;
class ClientSourceOpChild final : public PClientSourceOpChild
{
- MozPromiseRequestHolder<ClientOpPromise> mPromiseRequestHolder;
+ public:
+ void Init(const ClientOpConstructorArgs& aArgs);
+
+ // Deletes "this" after initialization (or immediately if already
+ // initialized.) It's UB to use "this" after calling ScheduleDeletion.
+ void ScheduleDeletion();
+
+ private:
+ ~ClientSourceOpChild();
+
+ void Cleanup();
ClientSource*
GetSource() const;
@@ -29,12 +40,9 @@ class ClientSourceOpChild final : public PClientSourceOpChild
void
ActorDestroy(ActorDestroyReason aReason) override;
-public:
- ClientSourceOpChild() = default;
- ~ClientSourceOpChild() = default;
-
- void
- Init(const ClientOpConstructorArgs& aArgs);
+ MozPromiseRequestHolder<ClientOpPromise> mPromiseRequestHolder;
+ FlippedOnce<false> mDeletionRequested;
+ FlippedOnce<false> mInitialized;
};
} // namespace dom
--
2.23.0

View File

@ -1,74 +0,0 @@
From 311de0b6358ba2b8eae20dcc5baf29472a273fc6 Mon Sep 17 00:00:00 2001
From: Simon Giesecke <sgiesecke@mozilla.com>
Date: Tue, 3 Dec 2019 15:25:49 +0000
Subject: [PATCH] Bug 1598164 - Added FlippedOnce class template to help
reducing statefulness of boolean flags.
r=dom-workers-and-storage-reviewers,ytausky
Differential Revision: https://phabricator.services.mozilla.com/D55080
--HG--
extra : moz-landing-system : lando
---
dom/indexedDB/FlippedOnce.h | 39 +++++++++++++++++++++++++++++++++++++
dom/indexedDB/moz.build | 1 +
2 files changed, 40 insertions(+)
create mode 100644 dom/indexedDB/FlippedOnce.h
diff --git a/dom/indexedDB/FlippedOnce.h b/dom/indexedDB/FlippedOnce.h
new file mode 100644
index 0000000000000..94cd8570a4b6e
--- /dev/null
+++ b/dom/indexedDB/FlippedOnce.h
@@ -0,0 +1,39 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=8 sts=2 et sw=2 tw=80: */
+/* 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 mozilla_dom_indexeddb_flippedonce_h__
+#define mozilla_dom_indexeddb_flippedonce_h__
+
+#include "mozilla/Assertions.h"
+#include "mozilla/Attributes.h"
+
+namespace mozilla {
+
+// A state-restricted bool, which can only be flipped once. It isn't required to
+// be flipped during its lifetime.
+template <bool Initial>
+class FlippedOnce {
+ public:
+ FlippedOnce(const FlippedOnce&) = delete;
+ FlippedOnce& operator=(const FlippedOnce&) = delete;
+
+ FlippedOnce() = default;
+
+ MOZ_IMPLICIT operator bool() const { return mValue; };
+
+ void Flip() {
+ MOZ_ASSERT(mValue == Initial);
+ EnsureFlipped();
+ }
+
+ void EnsureFlipped() { mValue = !Initial; }
+
+ private:
+ bool mValue = Initial;
+};
+} // namespace mozilla
+
+#endif
diff --git a/dom/indexedDB/moz.build b/dom/indexedDB/moz.build
index 4302528e6847b..5237528963127 100644
--- a/dom/indexedDB/moz.build
+++ b/dom/indexedDB/moz.build
@@ -24,6 +24,7 @@ XPCSHELL_TESTS_MANIFESTS += [
]
EXPORTS.mozilla.dom += [
+ 'FlippedOnce.h',
'IDBCursor.h',
'IDBDatabase.h',
'IDBEvents.h',

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

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

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

12
build-arm-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

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

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

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)

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

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,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

@ -1,30 +1,12 @@
diff -up firefox-57.0b5/js/src/jit/AtomicOperations.h.jit-atomic-lucky firefox-57.0b5/js/src/jit/AtomicOperations.h diff -up firefox-60.5.0/js/src/jit/AtomicOperations.h.jit-atomic-lucky firefox-60.5.0/js/src/jit/AtomicOperations.h
--- firefox-57.0b5/js/src/jit/AtomicOperations.h.jit-atomic-lucky 2017-10-06 12:34:02.338973607 +0200 --- firefox-60.5.0/js/src/jit/AtomicOperations.h.jit-atomic-lucky 2019-01-22 10:20:27.993697161 +0100
+++ firefox-57.0b5/js/src/jit/AtomicOperations.h 2017-10-06 12:38:24.632622215 +0200 +++ firefox-60.5.0/js/src/jit/AtomicOperations.h 2019-01-22 10:23:15.337873762 +0100
@@ -415,7 +415,7 @@ AtomicOperations::isLockfreeJS(int32_t s @@ -394,7 +394,7 @@ inline bool AtomicOperations::isLockfree
#elif defined(__s390__) || defined(__s390x__) #elif defined(__s390__) || defined(__s390x__)
# include "jit/none/AtomicOperations-feeling-lucky.h" #include "jit/none/AtomicOperations-feeling-lucky.h"
#else #else
-# error "No AtomicOperations support provided for this platform" -#error "No AtomicOperations support provided for this platform"
+# include "jit/none/AtomicOperations-feeling-lucky.h" +#include "jit/none/AtomicOperations-feeling-lucky.h"
#endif #endif
#endif // jit_AtomicOperations_h #endif // jit_AtomicOperations_h
diff -up firefox-57.0b5/js/src/jit/none/AtomicOperations-feeling-lucky.h.jit-atomic-lucky firefox-57.0b5/js/src/jit/none/AtomicOperations-feeling-lucky.h
--- firefox-57.0b5/js/src/jit/none/AtomicOperations-feeling-lucky.h.jit-atomic-lucky 2017-09-19 06:18:28.000000000 +0200
+++ firefox-57.0b5/js/src/jit/none/AtomicOperations-feeling-lucky.h 2017-10-06 12:34:02.338973607 +0200
@@ -79,6 +79,14 @@
# define GNUC_COMPATIBLE
#endif
+#ifdef __s390__
+# define GNUC_COMPATIBLE
+#endif
+
+#ifdef __s390x__
+# define GNUC_COMPATIBLE
+#endif
+
// The default implementation tactic for gcc/clang is to use the newer
// __atomic intrinsics added for use in C++11 <atomic>. Where that
// isn't available, we use GCC's older __sync functions instead.

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.

BIN
cbindgen-vendor.tar.xz Normal file

Binary file not shown.

View File

@ -6,5 +6,5 @@ about=Mozilla Firefox for Openeuler
[Preferences] [Preferences]
app.distributor=openeuler app.distributor=openeuler
app.distributor.channel=openeuler app.distributor.channel=openeuler
app.partner.fedora=openeuler app.partner.openeuler=openeuler

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

@ -0,0 +1,13 @@
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.jsm for values to use here.
-pref("extensions.autoDisableScopes", 15);
+pref("extensions.autoDisableScopes", 0);
+pref("extensions.showMismatchUI", false);
// Scopes to scan for changes at startup.
pref("extensions.startupScanScopes", 0);

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,24 +1,19 @@
. $topsrcdir/browser/config/mozconfig . $topsrcdir/browser/config/mozconfig
ac_add_options --prefix="$PREFIX"
ac_add_options --libdir="$LIBDIR"
ac_add_options --with-system-zlib ac_add_options --with-system-zlib
ac_add_options --with-system-bz2
ac_add_options --disable-strip ac_add_options --disable-strip
ac_add_options --disable-tests
#ac_add_options --enable-libnotify #ac_add_options --enable-libnotify
ac_add_options --enable-necko-wifi ac_add_options --enable-necko-wifi
ac_add_options --enable-startup-notification
ac_add_options --disable-updater ac_add_options --disable-updater
ac_add_options --enable-chrome-format=omni ac_add_options --enable-chrome-format=omni
ac_add_options --enable-pulseaudio ac_add_options --enable-pulseaudio
ac_add_options --with-system-icu ac_add_options --enable-av1
ac_add_options --with-mozilla-api-keyfile=../mozilla-api-key ac_add_options --without-system-icu
ac_add_options --with-google-api-keyfile=../google-api-key
ac_add_options --enable-release ac_add_options --enable-release
ac_add_options --enable-pie ac_add_options --update-channel=release
# Workaround for mozbz#1341234 # Workaround for mozbz#1341234
ac_add_options BINDGEN_CFLAGS="$(pkg-config nspr pixman-1 --cflags)" ac_add_options BINDGEN_CFLAGS="$(pkg-config nspr pixman-1 --cflags)"
ac_add_options --allow-addon-sideload
export BUILD_OFFICIAL=1 export BUILD_OFFICIAL=1
export MOZILLA_OFFICIAL=1 export MOZILLA_OFFICIAL=1

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

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

526
firefox-pipewire-0-2.patch Normal file
View File

@ -0,0 +1,526 @@
diff -up firefox-79.0/config/system-headers.mozbuild.firefox-pipewire-0-2 firefox-79.0/config/system-headers.mozbuild
--- firefox-79.0/config/system-headers.mozbuild.firefox-pipewire-0-2 2020-07-21 00:49:36.000000000 +0200
+++ firefox-79.0/config/system-headers.mozbuild 2020-07-29 11:03:51.455284187 +0200
@@ -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 -up firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build.firefox-pipewire-0-2 firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build
--- firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build.firefox-pipewire-0-2 2020-07-29 11:03:51.455284187 +0200
+++ firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build 2020-07-29 11:04:40.898017241 +0200
@@ -231,6 +231,27 @@ if CONFIG["OS_TARGET"] == "OpenBSD":
"/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"] == "WINNT":
DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
diff -up firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h.firefox-pipewire-0-2 firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h
--- firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h.firefox-pipewire-0-2 2020-07-20 22:54:16.000000000 +0200
+++ firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h 2020-07-29 11:03:51.456284181 +0200
@@ -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 -up firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc.firefox-pipewire-0-2 firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc
--- firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc.firefox-pipewire-0-2 2020-07-20 22:54:27.000000000 +0200
+++ firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc 2020-07-29 11:03:51.618283306 +0200
@@ -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[] = "or
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::OnStreamForma
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::OnStreamForma
// 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::OnStreamProce
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)
@@ -197,10 +241,6 @@ BaseCapturerPipeWire::~BaseCapturerPipeW
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::InitPipeWireT
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::CreateReceivi
// 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::CreateReceivi
}
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(
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::OnStartReques
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(
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 -up firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.h.firefox-pipewire-0-2 firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.h
--- firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.h.firefox-pipewire-0-2 2020-07-20 22:54:40.000000000 +0200
+++ firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.h 2020-07-29 11:03:51.619283301 +0200
@@ -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 Desk
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 Desk
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 Desk
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 Desk
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 -up firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc.firefox-pipewire-0-2 firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc
--- firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc.firefox-pipewire-0-2 2020-07-20 22:53:57.000000000 +0200
+++ firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc 2020-07-29 11:03:51.619283301 +0200
@@ -15,7 +15,7 @@
namespace webrtc {
ScreenCapturerPipeWire::ScreenCapturerPipeWire()
- : BaseCapturerPipeWire(BaseCapturerPipeWire::CaptureSourceType::Screen) {}
+ : BaseCapturerPipeWire(BaseCapturerPipeWire::CaptureSourceType::kScreen) {}
ScreenCapturerPipeWire::~ScreenCapturerPipeWire() {}
// static
diff -up firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc.firefox-pipewire-0-2 firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc
--- firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc.firefox-pipewire-0-2 2020-07-20 22:54:18.000000000 +0200
+++ firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc 2020-07-29 11:03:51.619283301 +0200
@@ -15,7 +15,7 @@
namespace webrtc {
WindowCapturerPipeWire::WindowCapturerPipeWire()
- : BaseCapturerPipeWire(BaseCapturerPipeWire::CaptureSourceType::Window) {}
+ : BaseCapturerPipeWire(BaseCapturerPipeWire::CaptureSourceType::kWindow) {}
WindowCapturerPipeWire::~WindowCapturerPipeWire() {}
// static
diff -up firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc.firefox-pipewire-0-2 firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc
--- firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc.firefox-pipewire-0-2 2020-07-20 22:54:40.000000000 +0200
+++ firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc 2020-07-29 11:03:51.620283296 +0200
@@ -26,7 +26,7 @@ std::unique_ptr<DesktopCapturer> Desktop
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 -up firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc.firefox-pipewire-0-2 firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc
--- firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc.firefox-pipewire-0-2 2020-07-20 22:53:32.000000000 +0200
+++ firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc 2020-07-29 11:03:51.620283296 +0200
@@ -26,7 +26,7 @@ std::unique_ptr<DesktopCapturer> Desktop
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)

834
firefox-pipewire-0-3.patch Normal file
View File

@ -0,0 +1,834 @@
diff -up firefox-79.0/config/system-headers.mozbuild.firefox-pipewire-0-3 firefox-79.0/config/system-headers.mozbuild
--- firefox-79.0/config/system-headers.mozbuild.firefox-pipewire-0-3 2020-07-21 00:49:36.000000000 +0200
+++ firefox-79.0/config/system-headers.mozbuild 2020-07-28 10:06:59.485481599 +0200
@@ -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 -up firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn.firefox-pipewire-0-3 firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn
--- firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn.firefox-pipewire-0-3 2020-07-20 22:53:33.000000000 +0200
+++ firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn 2020-07-28 10:06:59.485481599 +0200
@@ -158,7 +158,7 @@ if (rtc_include_tests) {
if (is_linux) {
if (rtc_use_pipewire) {
pkg_config("pipewire") {
- packages = [ "libpipewire-0.2" ]
+ packages = [ "libpipewire-0.3" ]
defines = [ "WEBRTC_USE_PIPEWIRE" ]
}
diff -up firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build.firefox-pipewire-0-3 firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build
--- firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build.firefox-pipewire-0-3 2020-07-28 10:06:59.486481593 +0200
+++ firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build 2020-07-28 10:11:51.231907101 +0200
@@ -174,6 +174,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.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"] == "Darwin":
DEFINES["CR_XCODE_VERSION"] = "0920"
diff -up firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h.firefox-pipewire-0-3 firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h
--- firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h.firefox-pipewire-0-3 2020-07-20 22:54:16.000000000 +0200
+++ firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h 2020-07-28 10:06:59.486481593 +0200
@@ -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 -up firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc.firefox-pipewire-0-3 firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc
--- firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc.firefox-pipewire-0-3 2020-07-20 22:54:27.000000000 +0200
+++ firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc 2020-07-28 10:06:59.500481514 +0200
@@ -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,32 +39,37 @@ const char kSessionInterfaceName[] = "or
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);
+void BaseCapturerPipeWire::SyncDmaBuf(int fd, uint64_t start_or_end) {
+ struct dma_buf_sync sync = { 0 };
- 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.";
+ 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,
pw_stream_state state,
@@ -73,76 +81,54 @@ void BaseCapturerPipeWire::OnStreamState
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::OnStreamProce
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 (next_buffer)
+ pw_stream_queue_buffer (that->pw_stream_, buffer);
+ }
- if (!(buf = pw_stream_dequeue_buffer(that->pw_stream_))) {
+ 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::~BaseCapturerPipeW
pw_thread_loop_stop(pw_main_loop_);
}
- if (pw_type_) {
- delete pw_type_;
- }
-
- if (spa_video_format_) {
- delete spa_video_format_;
- }
-
if (pw_stream_) {
pw_stream_destroy(pw_stream_);
}
- if (pw_remote_) {
- pw_remote_destroy(pw_remote_);
+ if (pw_core_) {
+ pw_core_disconnect(pw_core_);
}
- if (pw_core_) {
- pw_core_destroy(pw_core_);
+ if (pw_context_) {
+ pw_context_destroy(pw_context_);
}
if (pw_main_loop_) {
pw_thread_loop_destroy(pw_main_loop_);
}
- if (pw_loop_) {
- pw_loop_destroy(pw_loop_);
- }
-
- if (current_frame_) {
- free(current_frame_);
- }
-
if (start_request_signal_id_) {
g_dbus_connection_signal_unsubscribe(connection_, start_request_signal_id_);
}
@@ -250,27 +230,35 @@ void BaseCapturerPipeWire::InitPortal()
void BaseCapturerPipeWire::InitPipeWire() {
pw_init(/*argc=*/nullptr, /*argc=*/nullptr);
- pw_loop_ = pw_loop_new(/*properties=*/nullptr);
- pw_main_loop_ = pw_thread_loop_new(pw_loop_, "pipewire-main-loop");
-
- pw_core_ = pw_core_new(pw_loop_, /*properties=*/nullptr);
- pw_core_type_ = pw_core_get_type(pw_core_);
- pw_remote_ = pw_remote_new(pw_core_, nullptr, /*user_data_size=*/0);
+ pw_main_loop_ = pw_thread_loop_new("pipewire-main-loop", nullptr);
+ pw_context_ = pw_context_new(pw_thread_loop_get_loop(pw_main_loop_), nullptr, 0);
+ if (!pw_context_) {
+ RTC_LOG(LS_ERROR) << "Failed to create PipeWire context";
+ return;
+ }
- InitPipeWireTypes();
+ pw_core_ = pw_context_connect(pw_context_, nullptr, 0);
+ if (!pw_core_) {
+ RTC_LOG(LS_ERROR) << "Failed to connect PipeWire context";
+ return;
+ }
// Initialize event handlers, remote end and stream-related.
- pw_remote_events_.version = PW_VERSION_REMOTE_EVENTS;
- pw_remote_events_.state_changed = &OnStateChanged;
+ pw_core_events_.version = PW_VERSION_CORE_EVENTS;
+ pw_core_events_.error = &OnCoreError;
pw_stream_events_.version = PW_VERSION_STREAM_EVENTS;
pw_stream_events_.state_changed = &OnStreamStateChanged;
- pw_stream_events_.format_changed = &OnStreamFormatChanged;
+ pw_stream_events_.param_changed = &OnStreamParamChanged;
pw_stream_events_.process = &OnStreamProcess;
- pw_remote_add_listener(pw_remote_, &spa_remote_listener_, &pw_remote_events_,
- this);
- pw_remote_connect_fd(pw_remote_, pw_fd_);
+ pw_core_add_listener(pw_core_, &spa_core_listener_, &pw_core_events_, this);
+
+ pw_stream_ = CreateReceivingStream();
+ if (!pw_stream_) {
+ RTC_LOG(LS_ERROR) << "Failed to create PipeWire stream";
+ return;
+ }
if (pw_thread_loop_start(pw_main_loop_) < 0) {
RTC_LOG(LS_ERROR) << "Failed to start main PipeWire loop";
@@ -278,81 +266,132 @@ void BaseCapturerPipeWire::InitPipeWire(
}
}
-void BaseCapturerPipeWire::InitPipeWireTypes() {
- spa_type_map* map = pw_core_type_->map;
- pw_type_ = new PipeWireType();
+pw_stream* BaseCapturerPipeWire::CreateReceivingStream() {
+ spa_rectangle pwMinScreenBounds = spa_rectangle{1, 1};
+ spa_rectangle pwMaxScreenBounds = spa_rectangle{INT32_MAX, INT32_MAX};
- 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);
-}
+ auto stream = pw_stream_new(pw_core_, "webrtc-pipewire-stream", nullptr);
-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};
-
- 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));
+ 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_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);
- if (pw_stream_connect(pw_stream_, PW_DIRECTION_INPUT, /*port_path=*/nullptr,
- flags, params,
- /*n_params=*/1) != 0) {
+ PW_STREAM_FLAG_AUTOCONNECT | PW_STREAM_FLAG_INACTIVE);
+
+ if (pw_stream_connect(stream, PW_DIRECTION_INPUT, pw_stream_node_id_, PW_STREAM_FLAG_AUTOCONNECT, params, 1) != 0) {
RTC_LOG(LS_ERROR) << "Could not connect receiving stream.";
portal_init_failed_ = true;
- return;
}
+
+ return stream;
}
void BaseCapturerPipeWire::HandleBuffer(pw_buffer* buffer) {
+ struct spa_meta_region* video_crop;
spa_buffer* spaBuffer = buffer->buffer;
- void* src = nullptr;
+ uint8_t *map = nullptr;
+ uint8_t* src = nullptr;
+ uint8_t* dst = nullptr;
+
+ if (spaBuffer->datas[0].chunk->size == 0) {
+ map = nullptr;
+ src = nullptr;
+ } else if (spaBuffer->datas[0].type == SPA_DATA_MemFd) {
+ map = static_cast<uint8_t*>(mmap(
+ nullptr, spaBuffer->datas[0].maxsize + spaBuffer->datas[0].mapoffset,
+ PROT_READ, MAP_PRIVATE, spaBuffer->datas[0].fd, 0));
+
+ if (map == MAP_FAILED) {
+ RTC_LOG(LS_ERROR) << "Failed to mmap the memory: " << std::strerror(errno);
+ return;
+ }
+
+ src = SPA_MEMBER(map, spaBuffer->datas[0].mapoffset, uint8_t);
+ } else if (spaBuffer->datas[0].type == SPA_DATA_DmaBuf) {
+ int fd;
+ fd = spaBuffer->datas[0].fd;
+
+ map = static_cast<uint8_t*>(mmap(
+ nullptr, spaBuffer->datas[0].maxsize + spaBuffer->datas[0].mapoffset,
+ PROT_READ, MAP_PRIVATE, fd, 0));
+
+ if (map == MAP_FAILED) {
+ RTC_LOG(LS_ERROR) << "Failed to mmap the memory: " << std::strerror(errno);
+ return;
+ }
- if (!(src = spaBuffer->datas[0].data)) {
+ SyncDmaBuf(fd, DMA_BUF_SYNC_START);
+
+ src = SPA_MEMBER(map, spaBuffer->datas[0].mapoffset, uint8_t);
+ } else if (spaBuffer->datas[0].type == SPA_DATA_MemPtr) {
+ map = nullptr;
+ src = static_cast<uint8_t*>(spaBuffer->datas[0].data);
+ } else {
return;
}
- uint32_t maxSize = spaBuffer->datas[0].maxsize;
- int32_t srcStride = spaBuffer->datas[0].chunk->stride;
+ if (!src) {
+ return;
+ }
+
+ DesktopSize prev_crop_size = DesktopSize(0, 0);
+ if (video_crop_size_initialized_) {
+ prev_crop_size = video_crop_size_;
+ }
+
+ if ((video_crop = static_cast<struct spa_meta_region*>(
+ spa_buffer_find_meta_data(spaBuffer, SPA_META_VideoCrop, sizeof(*video_crop))))) {
+ RTC_DCHECK(video_crop->region.size.width <= desktop_size_.width() &&
+ video_crop->region.size.height <= desktop_size_.height());
+ if ((video_crop->region.size.width != desktop_size_.width() ||
+ video_crop->region.size.height != desktop_size_.height()) && video_crop->region.size.width && video_crop->region.size.height) {
+ video_crop_size_ = DesktopSize(video_crop->region.size.width, video_crop->region.size.height);
+ video_crop_size_initialized_ = true;
+ } else {
+ video_crop_size_initialized_ = false;
+ }
+ } else {
+ video_crop_size_initialized_ = false;
+ }
+
+ size_t frame_size;
+ if (video_crop_size_initialized_) {
+ frame_size =
+ video_crop_size_.width() * video_crop_size_.height() * kBytesPerPixel;
+ } else {
+ frame_size =
+ desktop_size_.width() * desktop_size_.height() * kBytesPerPixel;
+ }
+
+ if (!current_frame_ ||
+ (video_crop_size_initialized_ && !video_crop_size_.equals(prev_crop_size))) {
+ current_frame_ = std::make_unique<uint8_t[]>(frame_size);
+ }
+ RTC_DCHECK(current_frame_ != nullptr);
+
+ const int32_t dstStride = video_crop_size_initialized_
+ ? video_crop_size_.width() * kBytesPerPixel
+ : desktop_size_.width() * kBytesPerPixel;
+ const int32_t srcStride = spaBuffer->datas[0].chunk->stride;
+
if (srcStride != (desktop_size_.width() * kBytesPerPixel)) {
RTC_LOG(LS_ERROR) << "Got buffer with stride different from screen stride: "
<< srcStride
@@ -361,21 +400,40 @@ void BaseCapturerPipeWire::HandleBuffer(
return;
}
- if (!current_frame_) {
- current_frame_ = static_cast<uint8_t*>(malloc(maxSize));
+ dst = current_frame_.get();
+
+ // Adjust source content based on crop video position
+ if (video_crop_size_initialized_ &&
+ (video_crop->region.position.y + video_crop_size_.height() <= desktop_size_.height())) {
+ for (int i = 0; i < video_crop->region.position.y; ++i) {
+ src += srcStride;
+ }
+ }
+ const int xOffset =
+ video_crop_size_initialized_ && (video_crop->region.position.x + video_crop_size_.width() <=
+ desktop_size_.width())
+ ? video_crop->region.position.x * kBytesPerPixel
+ : 0;
+ const int height = video_crop_size_initialized_ ? video_crop_size_.height() : desktop_size_.height();
+ for (int i = 0; i < height; ++i) {
+ // Adjust source content based on crop video position if needed
+ src += xOffset;
+ std::memcpy(dst, src, dstStride);
+ // If both sides decided to go with the RGBx format we need to convert it to
+ // BGRx to match color format expected by WebRTC.
+ if (spa_video_format_.format == SPA_VIDEO_FORMAT_RGBx ||
+ spa_video_format_.format == SPA_VIDEO_FORMAT_RGBA) {
+ ConvertRGBxToBGRx(dst, dstStride);
+ }
+ src += srcStride - xOffset;
+ dst += dstStride;
}
- RTC_DCHECK(current_frame_ != nullptr);
- // If both sides decided to go with the RGBx format we need to convert it to
- // BGRx to match color format expected by WebRTC.
- if (spa_video_format_->format == pw_type_->video_format.RGBx) {
- uint8_t* tempFrame = static_cast<uint8_t*>(malloc(maxSize));
- std::memcpy(tempFrame, src, maxSize);
- ConvertRGBxToBGRx(tempFrame, maxSize);
- std::memcpy(current_frame_, tempFrame, maxSize);
- free(tempFrame);
- } else {
- std::memcpy(current_frame_, src, maxSize);
+ if (map) {
+ if (spaBuffer->datas[0].type == SPA_DATA_DmaBuf) {
+ SyncDmaBuf(spaBuffer->datas[0].fd, DMA_BUF_SYNC_END);
+ }
+ munmap(map, spaBuffer->datas[0].maxsize + spaBuffer->datas[0].mapoffset);
}
}
@@ -725,10 +783,7 @@ void BaseCapturerPipeWire::OnStartReques
g_variant_get(variant, "(u@a{sv})", &stream_id, &options);
RTC_DCHECK(options != nullptr);
- g_variant_lookup(options, "size", "(ii)", &width, &height);
-
- that->desktop_size_.set(width, height);
-
+ that->pw_stream_node_id_ = stream_id;
g_variant_unref(options);
g_variant_unref(variant);
}
@@ -813,10 +868,15 @@ void BaseCapturerPipeWire::CaptureFrame(
return;
}
- std::unique_ptr<DesktopFrame> result(new BasicDesktopFrame(desktop_size_));
+ DesktopSize frame_size = desktop_size_;
+ if (video_crop_size_initialized_) {
+ frame_size = video_crop_size_;
+ }
+
+ std::unique_ptr<DesktopFrame> result(new BasicDesktopFrame(frame_size));
result->CopyPixelsFrom(
- current_frame_, (desktop_size_.width() * kBytesPerPixel),
- DesktopRect::MakeWH(desktop_size_.width(), desktop_size_.height()));
+ current_frame_.get(), (frame_size.width() * kBytesPerPixel),
+ DesktopRect::MakeWH(frame_size.width(), frame_size.height()));
if (!result) {
callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr);
return;
@@ -837,4 +897,22 @@ bool BaseCapturerPipeWire::SelectSource(
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 -up firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.h.firefox-pipewire-0-3 firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.h
--- firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.h.firefox-pipewire-0-3 2020-07-20 22:54:40.000000000 +0200
+++ firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.h 2020-07-28 10:06:59.501481508 +0200
@@ -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 Desk
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 Desk
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 -up firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc.firefox-pipewire-0-3 firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc
--- firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc.firefox-pipewire-0-3 2020-07-20 22:53:57.000000000 +0200
+++ firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc 2020-07-28 10:06:59.501481508 +0200
@@ -15,7 +15,7 @@
namespace webrtc {
ScreenCapturerPipeWire::ScreenCapturerPipeWire()
- : BaseCapturerPipeWire(BaseCapturerPipeWire::CaptureSourceType::Screen) {}
+ : BaseCapturerPipeWire(BaseCapturerPipeWire::CaptureSourceType::kScreen) {}
ScreenCapturerPipeWire::~ScreenCapturerPipeWire() {}
// static
diff -up firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc.firefox-pipewire-0-3 firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc
--- firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc.firefox-pipewire-0-3 2020-07-20 22:54:18.000000000 +0200
+++ firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc 2020-07-28 10:06:59.501481508 +0200
@@ -15,7 +15,7 @@
namespace webrtc {
WindowCapturerPipeWire::WindowCapturerPipeWire()
- : BaseCapturerPipeWire(BaseCapturerPipeWire::CaptureSourceType::Window) {}
+ : BaseCapturerPipeWire(BaseCapturerPipeWire::CaptureSourceType::kWindow) {}
WindowCapturerPipeWire::~WindowCapturerPipeWire() {}
// static
diff -up firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc.firefox-pipewire-0-3 firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc
--- firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc.firefox-pipewire-0-3 2020-07-20 22:54:40.000000000 +0200
+++ firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc 2020-07-28 10:06:59.501481508 +0200
@@ -26,7 +26,7 @@ std::unique_ptr<DesktopCapturer> Desktop
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 -up firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc.firefox-pipewire-0-3 firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc
--- firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc.firefox-pipewire-0-3 2020-07-20 22:53:32.000000000 +0200
+++ firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc 2020-07-28 10:06:59.501481508 +0200
@@ -26,7 +26,7 @@ std::unique_ptr<DesktopCapturer> Desktop
const DesktopCaptureOptions& options) {
#if defined(WEBRTC_USE_PIPEWIRE)
if (options.allow_pipewire() && DesktopCapturer::IsRunningUnderWayland()) {
- return WindowCapturerPipeWire::CreateRawWindowCapturer(options);
+ return BaseCapturerPipeWire::CreateRawWindowCapturer(options);
}
#endif // defined(WEBRTC_USE_PIPEWIRE)

View File

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

64
firefox-symbolic.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 7.3 KiB

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 StartupNotify=true
Categories=Network;WebBrowser; Categories=Network;WebBrowser;
Keywords=web;browser;internet; Keywords=web;browser;internet;
Actions=new-window;new-private-window; Actions=new-window;new-private-window;profile-manager-window;
[Desktop Action new-window] [Desktop Action new-window]
Name=Open a New Window Name=Open a New Window
@ -24,8 +24,8 @@ Name[ast]=Ventana nueva
Name[az]=Yeni Pəncərə Name[az]=Yeni Pəncərə
Name[be]=Новае акно Name[be]=Новае акно
Name[bg]=Нов прозорец Name[bg]=Нов прозорец
Name[bn-BD]= (N) Name[bn_BD]= (N)
Name[bn-IN]= Name[bn_IN]=
Name[br]=Prenestr nevez Name[br]=Prenestr nevez
Name[brx]= '(N) Name[brx]= '(N)
Name[bs]=Novi prozor Name[bs]=Novi prozor
@ -37,37 +37,37 @@ Name[da]=Nyt vindue
Name[de]=Neues Fenster Name[de]=Neues Fenster
Name[dsb]=Nowe wokno Name[dsb]=Nowe wokno
Name[el]=Νέο παράθυρο Name[el]=Νέο παράθυρο
Name[en-GB]=New Window Name[en_GB]=New Window
Name[en-US]=New Window Name[en_US]=New Window
Name[en-ZA]=New Window Name[en_ZA]=New Window
Name[eo]=Nova fenestro Name[eo]=Nova fenestro
Name[es-AR]=Nueva ventana Name[es_AR]=Nueva ventana
Name[es-CL]=Nueva ventana Name[es_CL]=Nueva ventana
Name[es-ES]=Nueva ventana Name[es_ES]=Nueva ventana
Name[es-MX]=Nueva ventana Name[es_MX]=Nueva ventana
Name[et]=Uus aken Name[et]=Uus aken
Name[eu]=Leiho berria Name[eu]=Leiho berria
Name[fa]=پنجره جدید Name[fa]=پنجره جدید
Name[ff]=Henorde Hesere Name[ff]=Henorde Hesere
Name[fi]=Uusi ikkuna Name[fi]=Uusi ikkuna
Name[fr]=Nouvelle fenêtre Name[fr]=Nouvelle fenêtre
Name[fy-NL]=Nij finster Name[fy_NL]=Nij finster
Name[ga-IE]=Fuinneog Nua Name[ga_IE]=Fuinneog Nua
Name[gd]=Uinneag ùr Name[gd]=Uinneag ùr
Name[gl]=Nova xanela Name[gl]=Nova xanela
Name[gn]=Ovetã pyahu Name[gn]=Ovetã pyahu
Name[gu-IN]= િ Name[gu_IN]= િ
Name[he]=חלון חדש Name[he]=חלון חדש
Name[hi-IN]= ि Name[hi_IN]= ि
Name[hr]=Novi prozor Name[hr]=Novi prozor
Name[hsb]=Nowe wokno Name[hsb]=Nowe wokno
Name[hu]=Új ablak Name[hu]=Új ablak
Name[hy-AM]=Նոր Պատուհան Name[hy_AM]=Նոր Պատուհան
Name[id]=Jendela Baru Name[id]=Jendela Baru
Name[is]=Nýr gluggi Name[is]=Nýr gluggi
Name[it]=Nuova finestra Name[it]=Nuova finestra
Name[ja]= Name[ja]=
Name[ja-JP-mac]= Name[ja_JP-mac]=
Name[ka]= Name[ka]=
Name[kk]=Жаңа терезе Name[kk]=Жаңа терезе
Name[km]= Name[km]=
@ -86,15 +86,15 @@ Name[ml]=പുതിയ ജാലകം
Name[mr]= Name[mr]=
Name[ms]=Tetingkap Baru Name[ms]=Tetingkap Baru
Name[my]= Name[my]=
Name[nb-NO]=Nytt vindu Name[nb_NO]=Nytt vindu
Name[ne-NP]= Name[ne_NP]=
Name[nl]=Nieuw venster Name[nl]=Nieuw venster
Name[nn-NO]=Nytt vindauge Name[nn_NO]=Nytt vindauge
Name[or]= ି Name[or]= ି
Name[pa-IN]= ਿ Name[pa_IN]= ਿ
Name[pl]=Nowe okno Name[pl]=Nowe okno
Name[pt-BR]=Nova janela Name[pt_BR]=Nova janela
Name[pt-PT]=Nova janela Name[pt_PT]=Nova janela
Name[rm]=Nova fanestra Name[rm]=Nova fanestra
Name[ro]=Fereastră nouă Name[ro]=Fereastră nouă
Name[ru]=Новое окно Name[ru]=Новое окно
@ -105,7 +105,7 @@ Name[sl]=Novo okno
Name[son]=Zanfun taaga Name[son]=Zanfun taaga
Name[sq]=Dritare e Re Name[sq]=Dritare e Re
Name[sr]=Нови прозор Name[sr]=Нови прозор
Name[sv-SE]=Nytt fönster Name[sv_SE]=Nytt fönster
Name[ta]=ி Name[ta]=ி
Name[te]= ి Name[te]= ి
Name[th]= Name[th]=
@ -117,8 +117,8 @@ Name[uz]=Yangi oyna
Name[vi]=Ca s mi Name[vi]=Ca s mi
Name[wo]=Palanteer bu bees Name[wo]=Palanteer bu bees
Name[xh]=Ifestile entsha Name[xh]=Ifestile entsha
Name[zh-CN]= Name[zh_CN]=
Name[zh-TW]= Name[zh_TW]=
Exec=firefox-wayland --name firefox-wayland --new-window %u Exec=firefox-wayland --name firefox-wayland --new-window %u
[Desktop Action new-private-window] [Desktop Action new-private-window]
@ -132,8 +132,8 @@ Name[ast]=Ventana privada nueva
Name[az]=Yeni Məxfi Pəncərə Name[az]=Yeni Məxfi Pəncərə
Name[be]=Новае акно адасаблення Name[be]=Новае акно адасаблення
Name[bg]=Нов прозорец за поверително сърфиране Name[bg]=Нов прозорец за поверително сърфиране
Name[bn-BD]= ি Name[bn_BD]= ি
Name[bn-IN]= ি Name[bn_IN]= ি
Name[br]=Prenestr merdeiñ prevez nevez Name[br]=Prenestr merdeiñ prevez nevez
Name[brx]= ' Name[brx]= '
Name[bs]=Novi privatni prozor Name[bs]=Novi privatni prozor
@ -145,37 +145,37 @@ Name[da]=Nyt privat vindue
Name[de]=Neues privates Fenster Name[de]=Neues privates Fenster
Name[dsb]=Nowe priwatne wokno Name[dsb]=Nowe priwatne wokno
Name[el]=Νέο παράθυρο ιδιωτικής περιήγησης Name[el]=Νέο παράθυρο ιδιωτικής περιήγησης
Name[en-GB]=New Private Window Name[en_GB]=New Private Window
Name[en-US]=New Private Window Name[en_US]=New Private Window
Name[en-ZA]=New Private Window Name[en_ZA]=New Private Window
Name[eo]=Nova privata fenestro Name[eo]=Nova privata fenestro
Name[es-AR]=Nueva ventana privada Name[es_AR]=Nueva ventana privada
Name[es-CL]=Nueva ventana privada Name[es_CL]=Nueva ventana privada
Name[es-ES]=Nueva ventana privada Name[es_ES]=Nueva ventana privada
Name[es-MX]=Nueva ventana privada Name[es_MX]=Nueva ventana privada
Name[et]=Uus privaatne aken Name[et]=Uus privaatne aken
Name[eu]=Leiho pribatu berria Name[eu]=Leiho pribatu berria
Name[fa]=پنجره ناشناس جدید Name[fa]=پنجره ناشناس جدید
Name[ff]=Henorde Suturo Hesere Name[ff]=Henorde Suturo Hesere
Name[fi]=Uusi yksityinen ikkuna Name[fi]=Uusi yksityinen ikkuna
Name[fr]=Nouvelle fenêtre de navigation privée Name[fr]=Nouvelle fenêtre de navigation privée
Name[fy-NL]=Nij priveefinster Name[fy_NL]=Nij priveefinster
Name[ga-IE]=Fuinneog Nua Phríobháideach Name[ga_IE]=Fuinneog Nua Phríobháideach
Name[gd]=Uinneag phrìobhaideach ùr Name[gd]=Uinneag phrìobhaideach ùr
Name[gl]=Nova xanela privada Name[gl]=Nova xanela privada
Name[gn]=Ovetã ñemi pyahu Name[gn]=Ovetã ñemi pyahu
Name[gu-IN]= િ Name[gu_IN]= િ
Name[he]=חלון פרטי חדש Name[he]=חלון פרטי חדש
Name[hi-IN]= ि ि Name[hi_IN]= ि ि
Name[hr]=Novi privatni prozor Name[hr]=Novi privatni prozor
Name[hsb]=Nowe priwatne wokno Name[hsb]=Nowe priwatne wokno
Name[hu]=Új privát ablak Name[hu]=Új privát ablak
Name[hy-AM]=Սկսել Գաղտնի դիտարկում Name[hy_AM]=Սկսել Գաղտնի դիտարկում
Name[id]=Jendela Mode Pribadi Baru Name[id]=Jendela Mode Pribadi Baru
Name[is]=Nýr huliðsgluggi Name[is]=Nýr huliðsgluggi
Name[it]=Nuova finestra anonima Name[it]=Nuova finestra anonima
Name[ja]= Name[ja]=
Name[ja-JP-mac]= Name[ja_JP-mac]=
Name[ka]= Name[ka]=
Name[kk]=Жаңа жекелік терезе Name[kk]=Жаңа жекелік терезе
Name[km]= Name[km]=
@ -194,15 +194,15 @@ Name[ml]=പുതിയ സ്വകാര്യ ജാലകം
Name[mr]= ि Name[mr]= ि
Name[ms]=Tetingkap Persendirian Baharu Name[ms]=Tetingkap Persendirian Baharu
Name[my]=New Private Window Name[my]=New Private Window
Name[nb-NO]=Nytt privat vindu Name[nb_NO]=Nytt privat vindu
Name[ne-NP]= ि Name[ne_NP]= ि
Name[nl]=Nieuw privévenster Name[nl]=Nieuw privévenster
Name[nn-NO]=Nytt privat vindauge Name[nn_NO]=Nytt privat vindauge
Name[or]= ି ି Name[or]= ି ି
Name[pa-IN]= ਿ Name[pa_IN]= ਿ
Name[pl]=Nowe okno prywatne Name[pl]=Nowe okno prywatne
Name[pt-BR]=Nova janela privativa Name[pt_BR]=Nova janela privativa
Name[pt-PT]=Nova janela privada Name[pt_PT]=Nova janela privada
Name[rm]=Nova fanestra privata Name[rm]=Nova fanestra privata
Name[ro]=Fereastră privată nouă Name[ro]=Fereastră privată nouă
Name[ru]=Новое приватное окно Name[ru]=Новое приватное окно
@ -213,7 +213,7 @@ Name[sl]=Novo zasebno okno
Name[son]=Sutura zanfun taaga Name[son]=Sutura zanfun taaga
Name[sq]=Dritare e Re Private Name[sq]=Dritare e Re Private
Name[sr]=Нови приватан прозор Name[sr]=Нови приватан прозор
Name[sv-SE]=Nytt privat fönster Name[sv_SE]=Nytt privat fönster
Name[ta]=ி ி Name[ta]=ி ி
Name[te]= ి ి Name[te]= ి ి
Name[th]= Name[th]=
@ -225,7 +225,11 @@ Name[uz]=Yangi maxfiy oyna
Name[vi]=Ca s riêng tư mi Name[vi]=Ca s riêng tư mi
Name[wo]=Panlanteeru biir bu bees Name[wo]=Panlanteeru biir bu bees
Name[xh]=Ifestile yangasese entsha Name[xh]=Ifestile yangasese entsha
Name[zh-CN]= Name[zh_CN]=
Name[zh-TW]= Name[zh_TW]=
Exec=firefox-wayland --private-window --name firefox-wayland %u 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

@ -1,7 +1,7 @@
#!/bin/bash #!/usr/bin/bash
# #
# Run Firefox under Wayland # Run Firefox under Wayland
# #
export GDK_BACKEND=wayland export MOZ_ENABLE_WAYLAND=1
exec /usr/bin/firefox "$@" exec /__PREFIX__/bin/firefox "$@"

235
firefox-x11.desktop Normal file
View File

@ -0,0 +1,235 @@
[Desktop Entry]
Version=1.0
Name=Firefox on X11
GenericName=Web Browser
Comment=Browse the Web
Exec=firefox-x11 --name firefox-x11 %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-x11 --name firefox-x11 --new-window %u
[Desktop Action new-private-window]
Name=Open a New Private Window
Name[ach]=Dirica manyen me mung
Name[af]=Nuwe privaatvenster
Name[an]=Nueva finestra privada
Name[ar]=نافذة خاصة جديدة
Name[as]= ি
Name[ast]=Ventana privada nueva
Name[az]=Yeni Məxfi Pəncərə
Name[be]=Новае акно адасаблення
Name[bg]=Нов прозорец за поверително сърфиране
Name[bn_BD]= ি
Name[bn_IN]= ি
Name[br]=Prenestr merdeiñ prevez nevez
Name[brx]= '
Name[bs]=Novi privatni prozor
Name[ca]=Finestra privada nova
Name[cak]=K'ak'a' ichinan tzuwäch
Name[cs]=Nové anonymní okno
Name[cy]=Ffenestr Breifat Newydd
Name[da]=Nyt privat vindue
Name[de]=Neues privates Fenster
Name[dsb]=Nowe priwatne wokno
Name[el]=Νέο παράθυρο ιδιωτικής περιήγησης
Name[en_GB]=New Private Window
Name[en_US]=New Private Window
Name[en_ZA]=New Private Window
Name[eo]=Nova privata fenestro
Name[es_AR]=Nueva ventana privada
Name[es_CL]=Nueva ventana privada
Name[es_ES]=Nueva ventana privada
Name[es_MX]=Nueva ventana privada
Name[et]=Uus privaatne aken
Name[eu]=Leiho pribatu berria
Name[fa]=پنجره ناشناس جدید
Name[ff]=Henorde Suturo Hesere
Name[fi]=Uusi yksityinen ikkuna
Name[fr]=Nouvelle fenêtre de navigation privée
Name[fy_NL]=Nij priveefinster
Name[ga_IE]=Fuinneog Nua Phríobháideach
Name[gd]=Uinneag phrìobhaideach ùr
Name[gl]=Nova xanela privada
Name[gn]=Ovetã ñemi pyahu
Name[gu_IN]= િ
Name[he]=חלון פרטי חדש
Name[hi_IN]= ि ि
Name[hr]=Novi privatni prozor
Name[hsb]=Nowe priwatne wokno
Name[hu]=Új privát ablak
Name[hy_AM]=Սկսել Գաղտնի դիտարկում
Name[id]=Jendela Mode Pribadi Baru
Name[is]=Nýr huliðsgluggi
Name[it]=Nuova finestra anonima
Name[ja]=
Name[ja_JP-mac]=
Name[ka]=
Name[kk]=Жаңа жекелік терезе
Name[km]=
Name[kn]= ಿ ಿಿ
Name[ko]=
Name[kok]= ि
Name[ks]=نْو پرایوٹ وینڈو&amp;
Name[lij]=Neuvo barcon privou
Name[lo]=
Name[lt]=Naujas privataus naršymo langas
Name[ltg]=Jauns privatais lūgs
Name[lv]=Jauns privātais logs
Name[mai]= ि ि (W)
Name[mk]=Нов приватен прозорец
Name[ml]=ി
Name[mr]= ि
Name[ms]=Tetingkap Persendirian Baharu
Name[my]=New Private Window
Name[nb_NO]=Nytt privat vindu
Name[ne_NP]= ि
Name[nl]=Nieuw privévenster
Name[nn_NO]=Nytt privat vindauge
Name[or]= ି ି
Name[pa_IN]= ਿ
Name[pl]=Nowe okno prywatne
Name[pt_BR]=Nova janela privativa
Name[pt_PT]=Nova janela privada
Name[rm]=Nova fanestra privata
Name[ro]=Fereastră privată nouă
Name[ru]=Новое приватное окно
Name[sat]= ि ि (W )
Name[si]= (W)
Name[sk]=Nové okno v režime Súkromné prehliadanie
Name[sl]=Novo zasebno okno
Name[son]=Sutura zanfun taaga
Name[sq]=Dritare e Re Private
Name[sr]=Нови приватан прозор
Name[sv_SE]=Nytt privat fönster
Name[ta]=ி ி
Name[te]= ి ి
Name[th]=
Name[tr]=Yeni gizli pencere
Name[tsz]=Juchiiti eraatarakua jimpani
Name[uk]=Приватне вікно
Name[ur]=نیا نجی دریچہ
Name[uz]=Yangi maxfiy oyna
Name[vi]=Ca s riêng tư mi
Name[wo]=Panlanteeru biir bu bees
Name[xh]=Ifestile yangasese entsha
Name[zh_CN]=
Name[zh_TW]=
Exec=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

7
firefox-x11.sh.in Normal file
View File

@ -0,0 +1,7 @@
#!/usr/bin/bash
#
# Run Firefox on X11 backend
#
export MOZ_DISABLE_WAYLAND=1
exec /__PREFIX__/bin/firefox "$@"

View File

@ -60,7 +60,7 @@ Open new instance, not a new window in running instance.
\fB\-\-UILocale\fR \fIlocale\fR \fB\-\-UILocale\fR \fIlocale\fR
Start with \fIlocale\fR resources as UI Locale. Start with \fIlocale\fR resources as UI Locale.
.TP .TP
\fB\-\-save\-mode\fR \fB\-\-safe\-mode\fR
Disables extensions and themes for this session. Disables extensions and themes for this session.
.TP .TP
\fB\-\-headless\fR \fB\-\-headless\fR

53
firefox.appdata.xml.in Normal file
View File

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2019 Firefox contributors -->
<component type="desktop">
<id>firefox.desktop</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>
<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>
<provides>
<id>firefox.desktop</id>
</provides>
<releases>
<release version="__VERSION__"/>
</releases>
</component>

View File

@ -37,7 +37,7 @@ Comment[nb]=Surf på nettet
Comment[nl]=Verken het internet Comment[nl]=Verken het internet
Comment[nn]=Surf på nettet Comment[nn]=Surf på nettet
Comment[no]=Surf på nettet Comment[no]=Surf på nettet
Comment[pl]=Przeglądanie stron WWW Comment[pl]=Przeglądanie stron WWW
Comment[pt]=Navegue na Internet Comment[pt]=Navegue na Internet
Comment[pt_BR]=Navegue na Internet Comment[pt_BR]=Navegue na Internet
Comment[sk]=Prehliadanie internetu Comment[sk]=Prehliadanie internetu
@ -50,7 +50,7 @@ MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xm
StartupNotify=true StartupNotify=true
Categories=Network;WebBrowser; Categories=Network;WebBrowser;
Keywords=web;browser;internet; Keywords=web;browser;internet;
Actions=new-window;new-private-window; Actions=new-window;new-private-window;profile-manager-window;
[Desktop Action new-window] [Desktop Action new-window]
Name=Open a New Window Name=Open a New Window
@ -63,8 +63,8 @@ Name[ast]=Ventana nueva
Name[az]=Yeni Pəncərə Name[az]=Yeni Pəncərə
Name[be]=Новае акно Name[be]=Новае акно
Name[bg]=Нов прозорец Name[bg]=Нов прозорец
Name[bn-BD]= (N) Name[bn_BD]= (N)
Name[bn-IN]= Name[bn_IN]=
Name[br]=Prenestr nevez Name[br]=Prenestr nevez
Name[brx]= '(N) Name[brx]= '(N)
Name[bs]=Novi prozor Name[bs]=Novi prozor
@ -76,37 +76,37 @@ Name[da]=Nyt vindue
Name[de]=Neues Fenster Name[de]=Neues Fenster
Name[dsb]=Nowe wokno Name[dsb]=Nowe wokno
Name[el]=Νέο παράθυρο Name[el]=Νέο παράθυρο
Name[en-GB]=New Window Name[en_GB]=New Window
Name[en-US]=New Window Name[en_US]=New Window
Name[en-ZA]=New Window Name[en_ZA]=New Window
Name[eo]=Nova fenestro Name[eo]=Nova fenestro
Name[es-AR]=Nueva ventana Name[es_AR]=Nueva ventana
Name[es-CL]=Nueva ventana Name[es_CL]=Nueva ventana
Name[es-ES]=Nueva ventana Name[es_ES]=Nueva ventana
Name[es-MX]=Nueva ventana Name[es_MX]=Nueva ventana
Name[et]=Uus aken Name[et]=Uus aken
Name[eu]=Leiho berria Name[eu]=Leiho berria
Name[fa]=پنجره جدید Name[fa]=پنجره جدید
Name[ff]=Henorde Hesere Name[ff]=Henorde Hesere
Name[fi]=Uusi ikkuna Name[fi]=Uusi ikkuna
Name[fr]=Nouvelle fenêtre Name[fr]=Nouvelle fenêtre
Name[fy-NL]=Nij finster Name[fy_NL]=Nij finster
Name[ga-IE]=Fuinneog Nua Name[ga_IE]=Fuinneog Nua
Name[gd]=Uinneag ùr Name[gd]=Uinneag ùr
Name[gl]=Nova xanela Name[gl]=Nova xanela
Name[gn]=Ovetã pyahu Name[gn]=Ovetã pyahu
Name[gu-IN]= િ Name[gu_IN]= િ
Name[he]=חלון חדש Name[he]=חלון חדש
Name[hi-IN]= ि Name[hi_IN]= ि
Name[hr]=Novi prozor Name[hr]=Novi prozor
Name[hsb]=Nowe wokno Name[hsb]=Nowe wokno
Name[hu]=Új ablak Name[hu]=Új ablak
Name[hy-AM]=Նոր Պատուհան Name[hy_AM]=Նոր Պատուհան
Name[id]=Jendela Baru Name[id]=Jendela Baru
Name[is]=Nýr gluggi Name[is]=Nýr gluggi
Name[it]=Nuova finestra Name[it]=Nuova finestra
Name[ja]= Name[ja]=
Name[ja-JP-mac]= Name[ja_JP-mac]=
Name[ka]= Name[ka]=
Name[kk]=Жаңа терезе Name[kk]=Жаңа терезе
Name[km]= Name[km]=
@ -125,15 +125,15 @@ Name[ml]=പുതിയ ജാലകം
Name[mr]= Name[mr]=
Name[ms]=Tetingkap Baru Name[ms]=Tetingkap Baru
Name[my]= Name[my]=
Name[nb-NO]=Nytt vindu Name[nb_NO]=Nytt vindu
Name[ne-NP]= Name[ne_NP]=
Name[nl]=Nieuw venster Name[nl]=Nieuw venster
Name[nn-NO]=Nytt vindauge Name[nn_NO]=Nytt vindauge
Name[or]= ି Name[or]= ି
Name[pa-IN]= ਿ Name[pa_IN]= ਿ
Name[pl]=Nowe okno Name[pl]=Nowe okno
Name[pt-BR]=Nova janela Name[pt_BR]=Nova janela
Name[pt-PT]=Nova janela Name[pt_PT]=Nova janela
Name[rm]=Nova fanestra Name[rm]=Nova fanestra
Name[ro]=Fereastră nouă Name[ro]=Fereastră nouă
Name[ru]=Новое окно Name[ru]=Новое окно
@ -144,7 +144,7 @@ Name[sl]=Novo okno
Name[son]=Zanfun taaga Name[son]=Zanfun taaga
Name[sq]=Dritare e Re Name[sq]=Dritare e Re
Name[sr]=Нови прозор Name[sr]=Нови прозор
Name[sv-SE]=Nytt fönster Name[sv_SE]=Nytt fönster
Name[ta]=ி Name[ta]=ி
Name[te]= ి Name[te]= ి
Name[th]= Name[th]=
@ -156,10 +156,8 @@ Name[uz]=Yangi oyna
Name[vi]=Ca s mi Name[vi]=Ca s mi
Name[wo]=Palanteer bu bees Name[wo]=Palanteer bu bees
Name[xh]=Ifestile entsha Name[xh]=Ifestile entsha
Name[zh-CN]= Name[zh_CN]=
Name[zh-TW]= Name[zh_TW]=
Exec=firefox --new-window %u Exec=firefox --new-window %u
[Desktop Action new-private-window] [Desktop Action new-private-window]
@ -173,8 +171,8 @@ Name[ast]=Ventana privada nueva
Name[az]=Yeni Məxfi Pəncərə Name[az]=Yeni Məxfi Pəncərə
Name[be]=Новае акно адасаблення Name[be]=Новае акно адасаблення
Name[bg]=Нов прозорец за поверително сърфиране Name[bg]=Нов прозорец за поверително сърфиране
Name[bn-BD]= ি Name[bn_BD]= ি
Name[bn-IN]= ি Name[bn_IN]= ি
Name[br]=Prenestr merdeiñ prevez nevez Name[br]=Prenestr merdeiñ prevez nevez
Name[brx]= ' Name[brx]= '
Name[bs]=Novi privatni prozor Name[bs]=Novi privatni prozor
@ -186,37 +184,37 @@ Name[da]=Nyt privat vindue
Name[de]=Neues privates Fenster Name[de]=Neues privates Fenster
Name[dsb]=Nowe priwatne wokno Name[dsb]=Nowe priwatne wokno
Name[el]=Νέο παράθυρο ιδιωτικής περιήγησης Name[el]=Νέο παράθυρο ιδιωτικής περιήγησης
Name[en-GB]=New Private Window Name[en_GB]=New Private Window
Name[en-US]=New Private Window Name[en_US]=New Private Window
Name[en-ZA]=New Private Window Name[en_ZA]=New Private Window
Name[eo]=Nova privata fenestro Name[eo]=Nova privata fenestro
Name[es-AR]=Nueva ventana privada Name[es_AR]=Nueva ventana privada
Name[es-CL]=Nueva ventana privada Name[es_CL]=Nueva ventana privada
Name[es-ES]=Nueva ventana privada Name[es_ES]=Nueva ventana privada
Name[es-MX]=Nueva ventana privada Name[es_MX]=Nueva ventana privada
Name[et]=Uus privaatne aken Name[et]=Uus privaatne aken
Name[eu]=Leiho pribatu berria Name[eu]=Leiho pribatu berria
Name[fa]=پنجره ناشناس جدید Name[fa]=پنجره ناشناس جدید
Name[ff]=Henorde Suturo Hesere Name[ff]=Henorde Suturo Hesere
Name[fi]=Uusi yksityinen ikkuna Name[fi]=Uusi yksityinen ikkuna
Name[fr]=Nouvelle fenêtre de navigation privée Name[fr]=Nouvelle fenêtre de navigation privée
Name[fy-NL]=Nij priveefinster Name[fy_NL]=Nij priveefinster
Name[ga-IE]=Fuinneog Nua Phríobháideach Name[ga_IE]=Fuinneog Nua Phríobháideach
Name[gd]=Uinneag phrìobhaideach ùr Name[gd]=Uinneag phrìobhaideach ùr
Name[gl]=Nova xanela privada Name[gl]=Nova xanela privada
Name[gn]=Ovetã ñemi pyahu Name[gn]=Ovetã ñemi pyahu
Name[gu-IN]= િ Name[gu_IN]= િ
Name[he]=חלון פרטי חדש Name[he]=חלון פרטי חדש
Name[hi-IN]= ि ि Name[hi_IN]= ि ि
Name[hr]=Novi privatni prozor Name[hr]=Novi privatni prozor
Name[hsb]=Nowe priwatne wokno Name[hsb]=Nowe priwatne wokno
Name[hu]=Új privát ablak Name[hu]=Új privát ablak
Name[hy-AM]=Սկսել Գաղտնի դիտարկում Name[hy_AM]=Սկսել Գաղտնի դիտարկում
Name[id]=Jendela Mode Pribadi Baru Name[id]=Jendela Mode Pribadi Baru
Name[is]=Nýr huliðsgluggi Name[is]=Nýr huliðsgluggi
Name[it]=Nuova finestra anonima Name[it]=Nuova finestra anonima
Name[ja]= Name[ja]=
Name[ja-JP-mac]= Name[ja_JP-mac]=
Name[ka]= Name[ka]=
Name[kk]=Жаңа жекелік терезе Name[kk]=Жаңа жекелік терезе
Name[km]= Name[km]=
@ -235,15 +233,15 @@ Name[ml]=പുതിയ സ്വകാര്യ ജാലകം
Name[mr]= ि Name[mr]= ि
Name[ms]=Tetingkap Persendirian Baharu Name[ms]=Tetingkap Persendirian Baharu
Name[my]=New Private Window Name[my]=New Private Window
Name[nb-NO]=Nytt privat vindu Name[nb_NO]=Nytt privat vindu
Name[ne-NP]= ि Name[ne_NP]= ि
Name[nl]=Nieuw privévenster Name[nl]=Nieuw privévenster
Name[nn-NO]=Nytt privat vindauge Name[nn_NO]=Nytt privat vindauge
Name[or]= ି ି Name[or]= ି ି
Name[pa-IN]= ਿ Name[pa_IN]= ਿ
Name[pl]=Nowe okno prywatne Name[pl]=Nowe okno prywatne
Name[pt-BR]=Nova janela privativa Name[pt_BR]=Nova janela privativa
Name[pt-PT]=Nova janela privada Name[pt_PT]=Nova janela privada
Name[rm]=Nova fanestra privata Name[rm]=Nova fanestra privata
Name[ro]=Fereastră privată nouă Name[ro]=Fereastră privată nouă
Name[ru]=Новое приватное окно Name[ru]=Новое приватное окно
@ -254,7 +252,7 @@ Name[sl]=Novo zasebno okno
Name[son]=Sutura zanfun taaga Name[son]=Sutura zanfun taaga
Name[sq]=Dritare e Re Private Name[sq]=Dritare e Re Private
Name[sr]=Нови приватан прозор Name[sr]=Нови приватан прозор
Name[sv-SE]=Nytt privat fönster Name[sv_SE]=Nytt privat fönster
Name[ta]=ி ி Name[ta]=ி ி
Name[te]= ి ి Name[te]= ి ి
Name[th]= Name[th]=
@ -266,7 +264,11 @@ Name[uz]=Yangi maxfiy oyna
Name[vi]=Ca s riêng tư mi Name[vi]=Ca s riêng tư mi
Name[wo]=Panlanteeru biir bu bees Name[wo]=Panlanteeru biir bu bees
Name[xh]=Ifestile yangasese entsha Name[xh]=Ifestile yangasese entsha
Name[zh-CN]= Name[zh_CN]=
Name[zh-TW]= Name[zh_TW]=
Exec=firefox --private-window %u Exec=firefox --private-window %u
[Desktop Action profile-manager-window]
Name=Open the Profile Manager
Name[cs]=Správa profilů
Exec=firefox --ProfileManager

View File

@ -1,2 +1,35 @@
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);
pref("network.manage-offline-status", true);
pref("extensions.shownSelectionUI", true);
pref("ui.SpellCheckerUnderlineStyle", 1);
pref("startup.homepage_override_url", "");
pref("browser.startup.homepage", "data:text/plain,browser.startup.homepage=https://openeuler.org/zh/"); pref("browser.startup.homepage", "data:text/plain,browser.startup.homepage=https://openeuler.org/zh/");
pref("browser.newtabpage.pinned", '[{"url":"https://openeuler.org/zh/","title":"Openeuler Project - Start Page"}]'); pref("browser.newtabpage.pinned", '[{"url":"https://openeuler.org/zh/","title":"Openeuler 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-gmpopenh264.enabled",false);
pref("plugins.notifyMissingFlash", 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/myspell");
/* Disable DoH by default */
pref("network.trr.mode", 5);
/* Enable per-user policy dir */
pref("browser.policies.perUserDir", true);
pref("browser.gnome-search-provider.enabled",true);

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/bash
# #
# The contents of this file are subject to the Netscape Public # The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file # License Version 1.1 (the "License"); you may not use this file
@ -17,10 +17,10 @@
# Copyright (C) 1998 Netscape Communications Corporation. All # Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved. # Rights Reserved.
# #
# Contributor(s): # Contributor(s):
# #
## ##
## Usage: ## Usage:
## ##
## $ firefox ## $ firefox
@ -39,12 +39,12 @@ cmdname=`basename $0`
MOZ_ARCH=$(uname -m) MOZ_ARCH=$(uname -m)
case $MOZ_ARCH in case $MOZ_ARCH in
x86_64 | s390x | sparc64) x86_64 | s390x | sparc64)
MOZ_LIB_DIR="/usr/lib64" MOZ_LIB_DIR="/__PREFIX__/lib64"
SECONDARY_LIB_DIR="/usr/lib" SECONDARY_LIB_DIR="/__PREFIX__/lib"
;; ;;
* ) * )
MOZ_LIB_DIR="/usr/lib" MOZ_LIB_DIR="/__PREFIX__/lib"
SECONDARY_LIB_DIR="/usr/lib64" SECONDARY_LIB_DIR="/__PREFIX__/lib64"
;; ;;
esac esac
@ -66,11 +66,27 @@ MOZ_EXTENSIONS_PROFILE_DIR="$HOME/.mozilla/extensions/{ec8030f7-c20a-464f-9b0e-1
MOZ_PROGRAM="$MOZ_DIST_BIN/$MOZ_FIREFOX_FILE" MOZ_PROGRAM="$MOZ_DIST_BIN/$MOZ_FIREFOX_FILE"
MOZ_LAUNCHER="$MOZ_DIST_BIN/run-mozilla.sh" 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.
##
if [ "$WAYLAND_DISPLAY" ]; then
export MOZ_DBUS_REMOTE=1
fi
## ##
## Set MOZ_GRE_CONF ## Set MOZ_GRE_CONF
## ##
MOZ_GRE_CONF=/etc/gre.d/gre.conf MOZ_GRE_CONF=/etc/gre.d/gre.conf
if [ "$MOZ_LIB_DIR" == "/usr/lib64" ]; then if [ "$MOZ_LIB_DIR" == "/__PREFIX__/lib64" ]; then
MOZ_GRE_CONF=/etc/gre.d/gre64.conf MOZ_GRE_CONF=/etc/gre.d/gre64.conf
fi fi
export MOZ_GRE_CONF export MOZ_GRE_CONF
@ -98,7 +114,7 @@ export MOZ_PLUGIN_PATH
## ##
## Set MOZ_APP_LAUNCHER for gnome-session ## Set MOZ_APP_LAUNCHER for gnome-session
## ##
export MOZ_APP_LAUNCHER="/usr/bin/firefox" export MOZ_APP_LAUNCHER="/__PREFIX__/bin/firefox"
## ##
## Set FONTCONFIG_PATH for Xft/fontconfig ## Set FONTCONFIG_PATH for Xft/fontconfig
@ -107,9 +123,9 @@ FONTCONFIG_PATH="/etc/fonts:${MOZILLA_FIVE_HOME}/res/Xft"
export FONTCONFIG_PATH export FONTCONFIG_PATH
## ##
## In order to better support certain scripts (such as Indic and some CJK ## In order to better support certain scripts (such as Indic and some CJK
## scripts), Fedora builds its Firefox, with permission from the Mozilla ## scripts), openeuler builds its Firefox, with permission from the Mozilla
## Corporation, with the Pango system as its text renderer. This change ## Corporation, with the Pango system as its text renderer. This change
## may negatively impact performance on some pages. To disable the use of ## may negatively impact performance on some pages. To disable the use of
## Pango, set MOZ_DISABLE_PANGO=1 in your environment before launching ## Pango, set MOZ_DISABLE_PANGO=1 in your environment before launching
## Firefox. ## Firefox.
@ -148,30 +164,30 @@ export MOZ_USE_XINPUT2=1
# #
## ##
## Automatically installed langpacks are tracked by .fedora-langpack-install ## Automatically installed langpacks are tracked by .openeuler-langpack-install
## config file. ## config file.
## ##
FEDORA_LANGPACK_CONFIG="$MOZ_EXTENSIONS_PROFILE_DIR/.fedora-langpack-install" OPENEULER_LANGPACK_CONFIG="$MOZ_EXTENSIONS_PROFILE_DIR/.openeuler-langpack-install"
# MOZ_DISABLE_LANGPACKS disables language packs completely # MOZ_DISABLE_LANGPACKS disables language packs completely
MOZILLA_DOWN=0 MOZILLA_DOWN=0
if ! [ $MOZ_DISABLE_LANGPACKS ] || [ $MOZ_DISABLE_LANGPACKS -eq 0 ]; then if ! [ $MOZ_DISABLE_LANGPACKS ] || [ $MOZ_DISABLE_LANGPACKS -eq 0 ]; then
if [ -x $MOZ_DIST_BIN/$MOZ_FIREFOX_FILE ]; then if [ -x $MOZ_DIST_BIN/$MOZ_FIREFOX_FILE ]; then
# Is firefox running? # Is firefox running?
/usr/bin/pidof firefox > /dev/null 2>&1 /__PREFIX__/bin/pidof firefox > /dev/null 2>&1
MOZILLA_DOWN=$? MOZILLA_DOWN=$?
fi fi
fi fi
# Modify language pack configuration only when firefox is not running # Modify language pack configuration only when firefox is not running
# and language packs are not disabled # and language packs are not disabled
if [ $MOZILLA_DOWN -ne 0 ]; then if [ $MOZILLA_DOWN -ne 0 ]; then
# Clear already installed langpacks # Clear already installed langpacks
mkdir -p $MOZ_EXTENSIONS_PROFILE_DIR mkdir -p $MOZ_EXTENSIONS_PROFILE_DIR
if [ -f $FEDORA_LANGPACK_CONFIG ]; then if [ -f $OPENEULER_LANGPACK_CONFIG ]; then
rm `cat $FEDORA_LANGPACK_CONFIG` > /dev/null 2>&1 rm `cat $OPENEULER_LANGPACK_CONFIG` > /dev/null 2>&1
rm $FEDORA_LANGPACK_CONFIG > /dev/null 2>&1 rm $OPENEULER_LANGPACK_CONFIG > /dev/null 2>&1
# remove all empty langpacks dirs while they block installation of langpacks # remove all empty langpacks dirs while they block installation of langpacks
rmdir $MOZ_EXTENSIONS_PROFILE_DIR/langpack* > /dev/null 2>&1 rmdir $MOZ_EXTENSIONS_PROFILE_DIR/langpack* > /dev/null 2>&1
fi fi
@ -182,22 +198,22 @@ if [ $MOZILLA_DOWN -ne 0 ]; then
CURRENT_LOCALE=${CURRENT_LOCALE:-$LANG} CURRENT_LOCALE=${CURRENT_LOCALE:-$LANG}
# Try with a local variant first, then without a local variant # Try with a local variant first, then without a local variant
SHORTMOZLOCALE=`echo $CURRENT_LOCALE | sed "s|_\([^.]*\).*||g"` SHORTMOZLOCALE=`echo $CURRENT_LOCALE | sed "s|_\([^.]*\).*||g" | sed "s|\..*||g"`
MOZLOCALE=`echo $CURRENT_LOCALE | sed "s|_\([^.]*\).*|-\1|g"` MOZLOCALE=`echo $CURRENT_LOCALE | sed "s|_\([^.]*\).*|-\1|g" | sed "s|\..*||g"`
function create_langpack_link() { function create_langpack_link() {
local language=$* local language=$*
local langpack=langpack-${language}@firefox.mozilla.org.xpi local langpack=langpack-${language}@firefox.mozilla.org.xpi
if [ -f $MOZ_LANGPACKS_DIR/$langpack ]; then if [ -f $MOZ_LANGPACKS_DIR/$langpack ]; then
rm -rf $MOZ_EXTENSIONS_PROFILE_DIR/$langpack rm -rf $MOZ_EXTENSIONS_PROFILE_DIR/$langpack
# If the target file is a symlink (the fallback langpack), # If the target file is a symlink (the fallback langpack),
# install the original file instead of the fallback one # install the original file instead of the fallback one
if [ -h $MOZ_LANGPACKS_DIR/$langpack ]; then if [ -h $MOZ_LANGPACKS_DIR/$langpack ]; then
langpack=`readlink $MOZ_LANGPACKS_DIR/$langpack` langpack=`readlink $MOZ_LANGPACKS_DIR/$langpack`
fi fi
ln -s $MOZ_LANGPACKS_DIR/$langpack \ ln -s $MOZ_LANGPACKS_DIR/$langpack \
$MOZ_EXTENSIONS_PROFILE_DIR/$langpack $MOZ_EXTENSIONS_PROFILE_DIR/$langpack
echo $MOZ_EXTENSIONS_PROFILE_DIR/$langpack > $FEDORA_LANGPACK_CONFIG echo $MOZ_EXTENSIONS_PROFILE_DIR/$langpack > $OPENEULER_LANGPACK_CONFIG
return 0 return 0
fi fi
return 1 return 1
@ -239,9 +255,11 @@ do
esac esac
done done
if ! [ "$GDK_BACKEND" ]; then # Flatpak specific environment variables
export GDK_BACKEND=x11 %FLATPAK_ENV_VARS%
fi
# Don't throw "old profile" dialog box.
export MOZ_ALLOW_DOWNGRADE=1
# Run the browser # Run the browser
debugging=0 debugging=0
@ -250,5 +268,4 @@ then
echo $MOZ_LAUNCHER $script_args $MOZ_PROGRAM "$@" echo $MOZ_LAUNCHER $script_args $MOZ_PROGRAM "$@"
fi fi
exec $MOZ_LAUNCHER $script_args $MOZ_PROGRAM "$@" exec $MOZ_LAUNCHER $script_args $MOZ_PROGRAM "$@"

View File

@ -1,214 +1,593 @@
Name: firefox %global release_build 1
Summary: Mozilla Firefox Web browser %global debug_build 0
Version: 62.0.3 %global build_with_clang 0
Release: 7 %global build_with_asan 0
URL: https://www.mozilla.org/firefox/ %global enable_mozilla_crashreporter 0
License: MPLv1.1 or GPLv2+ or LGPLv2+ %ifarch x86_64 %{ix86}
Source0: http://download-origin.cdn.mozilla.net/pub/firefox/releases/62.0.3/source/firefox-62.0.3.source.tar.xz %global enable_mozilla_crashreporter 1
Source1: firefox-langpacks-%{version}-20181002.tar.xz %endif
Source2: firefox-mozconfig %if %{build_with_asan}
Source3: firefox.js %global enable_mozilla_crashreporter 0
Source4: firefox.desktop %endif
Source5: firefox.sh.in %if 0%{?flatpak}
Source7: mozilla-api-key %global enable_mozilla_crashreporter 0
Source6: firefox.1 %endif
Source9: distribution.ini %global system_nss 1
Source10: google-api-key %global system_ffi 1
Source11: firefox-wayland.sh.in %ifarch armv7hl
Source12: firefox-wayland.desktop %global system_libvpx 1
%else
Patch0001: build-jit-atomic-always-lucky.patch %global system_libvpx 0
Patch0004: mozilla-build-arm.patch %endif
Patch0006: rhbz-1173156.patch %global hardened_build 1
Patch0008: mozilla-1170092.patch %global system_jpeg 1
Patch0009: rhbz-1354671.patch %global run_tests 0
Patch0010: mozilla-1196777.patch %global disable_elfhack 1
Patch0011: mozilla-256180.patch %global use_bundled_cbindgen 1
Patch0012: mozilla-1353817.patch %ifarch x86_64 aarch64
Patch0016: mozilla-1467125.patch %if %{release_build}
Patch0017: mozilla-1467128.patch %global build_with_pgo 0
Patch0018: mozilla-1415078.patch %else
Patch0019: openeuler-20200525.patch %global build_with_pgo 0
%endif
Patch6000: CVE-2020-6811.patch %global pgo_wayland 0
Patch6001: CVE-2020-6814-Add-FlippedOnce-class.patch %endif
Patch6002: CVE-2020-6814-1.patch %global wayland_backend_default 1
Patch6003: CVE-2020-6814-2.patch %if 0%{?flatpak}
Patch6004: rust-cssparser-Fix-a-future-compat-warning.patch %global wayland_backend_default 1
Patch6005: Bug-1519729-Remove-unused-macro.patch %global build_with_pgo 0
Patch6006: Bug-1519729-Document-public-macros.patch %endif
Patch6007: Bug-1519729-Typo-fix-in-new-doc-comment.patch %ifarch ppc64 s390x
Patch6008: Bug-1556597-Fix-warnings-in-webrender_bindings-in-nightly-rust.patch %global big_endian 1
Patch6009: Bug-1519629-Document-a-few-more-macros.patch %endif
Patch6010: Bug-1533969-Fix-build-error-with-newer-glibc.patch %ifarch armv7hl
%define _unpackaged_files_terminate_build 0
BuildRequires: pkgconfig(nspr) >= 4.19 pkgconfig(nss) >= 3.37.3 pkgconfig(libpng) pkgconfig(libffi) %global debug_package %{nil}
BuildRequires: pkgconfig(zlib) pkgconfig(libIDL-2.0) pkgconfig(gtk+-3.0) pkgconfig(gtk+-2.0) pkgconfig(krb5) %endif
BuildRequires: pkgconfig(pango) pkgconfig(freetype2) >= 2.1.9 pkgconfig(xt) pkgconfig(xrender) pkgconfig(dri) %if 0%{?build_with_pgo}
BuildRequires: pkgconfig(libstartup-notification-1.0) pkgconfig(libnotify) >= 0.7.0 pkgconfig(libcurl) %global use_xvfb 1
BuildRequires: pkgconfig(libpulse) pkgconfig(icu-i18n) pkgconfig(gconf-2.0) yasm clang clang-libs autoconf213 %global build_tests 1
BuildRequires: libjpeg-devel bzip2-devel dbus-glib-devel llvm-devel libvpx-devel >= 1.4.0 python2-devel llvm zip %endif
BuildRequires: desktop-file-utils rust cargo clang-devel nss-static >= 3.37.3 nss-devel >= 3.37.3 %if 0%{?run_tests}
%global use_xvfb 1
Requires: mozilla-filesystem p11-kit-trust nspr >= 4.19 nss >= 3.37.3 u2f-hidraw-policy %global build_tests 1
%endif
Provides: webclient firefox-wayland = %{version}-%{release} %global firefox_app_id \{ec8030f7-c20a-464f-9b0e-13a3a9e97384\}
Obsoletes: mozilla <= 37:1.7.13 firefox-wayland <= %{version}-%{release} %global cairo_version 1.13.1
%global freetype_version 2.1.9
%global libnotify_version 0.7.0
%if %{?system_libvpx}
%global libvpx_version 1.8.2
%endif
%if %{?system_nss}
%global nspr_version 4.21
%global nspr_build_version %{nspr_version}
%global nss_version 3.54
%global nss_build_version %{nss_version}
%endif
%global mozappdir %{_libdir}/%{name}
%global mozappdirdev %{_libdir}/%{name}-devel-%{version}
%global langpackdir %{mozappdir}/langpacks
%global tarballdir firefox-%{version}
%global official_branding 1
%bcond_without langpacks
%if !%{release_build}
%global pre_tag .npgo
%endif
%if %{build_with_clang}
%global pre_tag .clang
%global build_with_pgo 0
%endif
%if %{build_with_asan}
%global pre_tag .asan
%global build_with_pgo 0
%endif
%if !%{system_nss}
%global nss_tag .nss
%endif
Summary: Mozilla Firefox Web browser
Name: firefox
Version: 79.0
Release: 1
URL: https://www.mozilla.org/firefox/
License: MPLv1.1 or GPLv2+ or LGPLv2+
Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}/source/firefox-%{version}.source.tar.xz
%if %{with langpacks}
Source1: firefox-langpacks-%{version}-20200727.tar.xz
%endif
Source2: cbindgen-vendor.tar.xz
Source3: testing.tar.xz
Source10: firefox-mozconfig
Source12: firefox.js
Source20: firefox.desktop
Source21: firefox.sh.in
Source23: firefox.1
Source24: mozilla-api-key
Source25: firefox-symbolic.svg
Source26: distribution.ini
Source27: google-api-key
Source28: firefox-wayland.sh.in
Source29: firefox-wayland.desktop
Source30: firefox-x11.sh.in
Source31: firefox-x11.desktop
Source32: node-stdout-nonblocking-wrapper
Source33: firefox.appdata.xml.in
Source34: firefox-search-provider.ini
Patch3: mozilla-build-arm.patch
Patch25: rhbz-1219542-s390-build.patch
Patch26: build-icu-big-endian.patch
Patch32: build-rust-ppc64le.patch
Patch35: build-ppc-jit.patch
Patch37: build-jit-atomic-always-lucky.patch
Patch38: build-cacheFlush-missing.patch
Patch40: build-aarch64-skia.patch
Patch41: build-disable-elfhack.patch
Patch44: build-arm-libopus.patch
Patch46: firefox-nss-version.patch
Patch48: build-arm-wasm.patch
Patch49: build-arm-libaom.patch
Patch51: mozilla-1640982.patch
Patch215: firefox-enable-addons.patch
Patch219: rhbz-1173156.patch
Patch224: mozilla-1170092.patch
Patch226: rhbz-1354671.patch
Patch227: firefox-locale-debug.patch
Patch402: mozilla-1196777.patch
Patch412: mozilla-1337988.patch
Patch417: bug1375074-save-restore-x28.patch
Patch422: mozilla-1580174-webrtc-popup.patch
Patch574: firefox-pipewire-0-2.patch
Patch575: firefox-pipewire-0-3.patch
Patch584: firefox-disable-ffvpx-with-vapi.patch
Patch585: firefox-vaapi-extra-frames.patch
Patch586: mozilla-1645671.patch
Patch589: mozilla-1656436.patch
Patch600: pgo.patch
Patch601: mozilla-1516081.patch
Patch602: mozilla-1516803.patch
%if %{?system_nss}
BuildRequires: pkgconfig(nspr) >= %{nspr_version} pkgconfig(nss) >= %{nss_version}
BuildRequires: nss-static >= %{nss_version}
%endif
BuildRequires: pkgconfig(libpng)
%if %{?system_jpeg}
BuildRequires: libjpeg-devel
%endif
BuildRequires: zip bzip2-devel pkgconfig(zlib) pkgconfig(gtk+-3.0) pkgconfig(gtk+-2.0)
BuildRequires: pkgconfig(krb5) pkgconfig(pango) pkgconfig(freetype2) >= %{freetype_version}
BuildRequires: pkgconfig(xt) pkgconfig(xrender) pkgconfig(libstartup-notification-1.0)
BuildRequires: pkgconfig(libnotify) >= %{libnotify_version} pkgconfig(dri) pkgconfig(libcurl)
BuildRequires: dbus-glib-devel
%if %{?system_libvpx}
BuildRequires: libvpx-devel >= %{libvpx_version}
%endif
BuildRequires: autoconf213 pkgconfig(libpulse) yasm llvm llvm-devel clang clang-libs
%if 0%{?build_with_clang}
BuildRequires: lld
%endif
BuildRequires: pipewire-devel
%if !0%{?use_bundled_cbindgen}
BuildRequires: cbindgen
%endif
BuildRequires: nodejs nasm >= 1.13 libappstream-glib
%if 0%{?big_endian}
BuildRequires: icu
%endif
Requires: mozilla-filesystem p11-kit-trust
%if %{?system_nss}
Requires: nspr >= %{nspr_build_version} nss >= %{nss_build_version}
%endif
BuildRequires: python3-devel
%if !0%{?flatpak}
Requires: u2f-hidraw-policy
%endif
BuildRequires: nss-devel >= 3.29.1-2.1
Requires: nss >= 3.48.0
BuildRequires: desktop-file-utils
%if !0%{?flatpak}
%endif
%if %{?system_ffi}
BuildRequires: pkgconfig(libffi)
%endif
%if 0%{?use_xvfb}
BuildRequires: xorg-x11-server-Xvfb
%endif
%if 0%{?pgo_wayland}
BuildRequires: mutter
%endif
BuildRequires: rust cargo clang-devel
%if %{build_with_asan}
BuildRequires: libasan libasan-static
%endif
BuildRequires: perl-interpreter
Obsoletes: mozilla <= 37:1.7.13
Provides: webclient
%description %description
Mozilla Firefox is an open-source web browser, designed for standards Mozilla Firefox is an open-source web browser, designed for standards
compliance, performance and portability. compliance, performance and portability.
%if %{enable_mozilla_crashreporter}
%global moz_debug_prefix %{_prefix}/lib/debug
%global moz_debug_dir %{moz_debug_prefix}%{mozappdir}
%global uname_m %(uname -m)
%global symbols_file_name %{name}-%{version}.en-US.%{_os}-%{uname_m}.crashreporter-symbols.zip
%global symbols_file_path %{moz_debug_dir}/%{symbols_file_name}
%global _find_debuginfo_opts -p %{symbols_file_path} -o debugcrashreporter.list
%global crashreporter_pkg_name mozilla-crashreporter-%{name}-debuginfo
%package -n %{crashreporter_pkg_name}
Summary: Debugging symbols used by Mozilla's crash reporter servers
%description -n %{crashreporter_pkg_name}
This package provides debug information for Firefox, for use by
Mozilla's crash reporter servers. If you are trying to locally
debug %{name}, you want to install %{name}-debuginfo instead.
%files -n %{crashreporter_pkg_name} -f debugcrashreporter.list
%endif
%if 0%{?wayland_backend_default}
%package x11
Summary: Firefox X11 launcher.
Requires: %{name}
%description x11
The firefox-x11 package contains launcher and desktop file
to run Firefox explicitly on X11.
%files x11
%{_bindir}/firefox-x11
%{_datadir}/applications/firefox-x11.desktop
%endif
%package wayland
Summary: Firefox Wayland launcher.
Requires: %{name}
%description wayland
The firefox-wayland package contains launcher and desktop file
to run Firefox explicitly on Wayland.
%files wayland
%{_bindir}/firefox-wayland
%{_datadir}/applications/firefox-wayland.desktop
%if %{run_tests}
%global testsuite_pkg_name mozilla-%{name}-testresults
%package -n %{testsuite_pkg_name}
Summary: Results of testsuite
%description -n %{testsuite_pkg_name}
This package contains results of tests executed during build.
%files -n %{testsuite_pkg_name}
/test_results
%endif
%prep %prep
%autosetup -n firefox-%{version} -p1 %setup -q -n %{tarballdir}
tar -xf %{SOURCE3}
rm -f .mozconfig %ifarch s390
cp %{SOURCE2} .mozconfig %patch25 -p1 -b .rhbz-1219542-s390
cp %{SOURCE7} mozilla-api-key %endif
cp %{SOURCE10} google-api-key %patch40 -p1 -b .aarch64-skia
%if 0%{?disable_elfhack}
%patch41 -p1 -b .disable-elfhack
%endif
%patch3 -p1 -b .arm
%patch44 -p1 -b .build-arm-libopus
%if 0%{?big_endian}
%patch26 -p1 -b .icu
%endif
%patch48 -p1 -b .build-arm-wasm
%patch49 -p1 -b .build-arm-libaom
%patch51 -p1 -b .mozilla-1640982
%patch215 -p1 -b .addons
%patch219 -p1 -b .rhbz-1173156
%patch224 -p1 -b .1170092
%ifarch aarch64
%patch226 -p1 -b .1354671
%endif
%patch227 -p1 -b .locale-debug
%patch402 -p1 -b .1196777
%patch574 -p1 -b .firefox-pipewire-0-2
%patch584 -p1 -b .firefox-disable-ffvpx-with-vapi
%patch585 -p1 -b .firefox-vaapi-extra-frames
%patch586 -p1 -b .mozilla-1645671
%patch589 -p1 -b .mozilla-1656436
%patch600 -p1 -b .pgo
%patch602 -p1 -b .1516803
%{__rm} -f .mozconfig
%{__cp} %{SOURCE10} .mozconfig
echo "ac_add_options --enable-default-toolkit=cairo-gtk3-wayland" >> .mozconfig echo "ac_add_options --enable-default-toolkit=cairo-gtk3-wayland" >> .mozconfig
echo "ac_add_options --enable-official-branding" >> .mozconfig %if %{official_branding}
echo "ac_add_options --with-system-nspr" >> .mozconfig echo "ac_add_options --enable-official-branding" >> .mozconfig
echo "ac_add_options --with-system-nss" >> .mozconfig %endif
echo "ac_add_options --disable-system-sqlite" >> .mozconfig %{__cp} %{SOURCE24} mozilla-api-key
echo "ac_add_options --disable-system-cairo" >> .mozconfig %{__cp} %{SOURCE27} google-api-key
echo "ac_add_options --enable-system-ffi" >> .mozconfig echo "ac_add_options --prefix=\"%{_prefix}\"" >> .mozconfig
echo "ac_add_options --disable-debug" >> .mozconfig echo "ac_add_options --libdir=\"%{_libdir}\"" >> .mozconfig
echo "ac_add_options --disable-crashreporter" >> .mozconfig %if %{?system_nss}
echo "ac_add_options --without-system-jpeg" >> .mozconfig echo "ac_add_options --with-system-nspr" >> .mozconfig
echo "ac_add_options --with-system-libvpx" >> .mozconfig echo "ac_add_options --with-system-nss" >> .mozconfig
echo "ac_add_options --without-system-icu" >> .mozconfig %else
echo "ac_add_options --without-system-nspr" >> .mozconfig
echo "ac_add_options --enable-optimize='-g -O2'" >> .mozconfig echo "ac_add_options --without-system-nss" >> .mozconfig
echo "ac_add_options --disable-jemalloc" >> .mozconfig %endif
echo "ac_add_options --disable-webrtc" >> .mozconfig %if %{?system_ffi}
echo "ac_add_options --enable-system-ffi" >> .mozconfig
%endif
%ifarch %{arm}
echo "ac_add_options --disable-elf-hack" >> .mozconfig
%endif
%if %{?debug_build}
echo "ac_add_options --enable-debug" >> .mozconfig
echo "ac_add_options --disable-optimize" >> .mozconfig
%else
%global optimize_flags "none"
%ifarch ppc64le aarch64
%global optimize_flags "-g -O2"
%endif
%if %{optimize_flags} != "none"
echo 'ac_add_options --enable-optimize=%{?optimize_flags}' >> .mozconfig
%else
echo 'ac_add_options --enable-optimize' >> .mozconfig
%endif
echo "ac_add_options --disable-debug" >> .mozconfig
%endif
%ifnarch %{ix86} x86_64
echo "ac_add_options --disable-jemalloc" >> .mozconfig
%endif
%if !%{enable_mozilla_crashreporter}
echo "ac_add_options --disable-crashreporter" >> .mozconfig
%endif
%if 0%{?build_tests}
echo "ac_add_options --enable-tests" >> .mozconfig
%else
echo "ac_add_options --disable-tests" >> .mozconfig
%endif
%if !%{?system_jpeg}
echo "ac_add_options --without-system-jpeg" >> .mozconfig
%else
echo "ac_add_options --with-system-jpeg" >> .mozconfig
%endif
%if %{?system_libvpx}
echo "ac_add_options --with-system-libvpx" >> .mozconfig
%else
echo "ac_add_options --without-system-libvpx" >> .mozconfig
%endif
%ifarch s390 s390x
echo "ac_add_options --disable-ion" >> .mozconfig
%endif
%if %{build_with_asan}
echo "ac_add_options --enable-address-sanitizer" >> .mozconfig
echo "ac_add_options --disable-jemalloc" >> .mozconfig
%endif
echo "ac_add_options --with-mozilla-api-keyfile=`pwd`/mozilla-api-key" >> .mozconfig
echo "ac_add_options --with-google-safebrowsing-api-keyfile=`pwd`/google-api-key" >> .mozconfig
echo 'export NODEJS="%{_buildrootdir}/bin/node-stdout-nonblocking-wrapper"' >> .mozconfig
chmod -x third_party/rust/itertools/src/lib.rs chmod -x third_party/rust/itertools/src/lib.rs
chmod a-x third_party/rust/gfx-backend-vulkan/src/*.rs
chmod a-x third_party/rust/gfx-hal/src/*.rs
chmod a-x third_party/rust/ash/src/extensions/ext/*.rs
chmod a-x third_party/rust/ash/src/extensions/khr/*.rs
%build %build
echo "Generate big endian version of config/external/icu/data/icud58l.dat" %if 0%{?use_bundled_cbindgen}
mkdir -p my_rust_vendor
find ./ -name config.guess -exec cp /usr/lib/rpm/config.guess {} ';' cd my_rust_vendor
%{__tar} xf %{SOURCE2}
mkdir -p .cargo
cat > .cargo/config <<EOL
[source.crates-io]
replace-with = "vendored-sources"
[source.vendored-sources]
directory = "`pwd`"
EOL
env CARGO_HOME=.cargo cargo install cbindgen
export PATH=`pwd`/.cargo/bin:$PATH
%endif
cd -
echo "Generate big endian version of config/external/icu/data/icudt67l.dat"
%if 0%{?big_endian}
icupkg -tb config/external/icu/data/icudt67l.dat config/external/icu/data/icudt67b.dat
ls -l config/external/icu/data
rm -f config/external/icu/data/icudt*l.dat
%endif
mkdir %{_buildrootdir}/bin || :
chmod a+x %{SOURCE32}
cp %{SOURCE32} %{_buildrootdir}/bin || :
find ./ -path ./third_party/rust -prune -o -name config.guess -exec cp /usr/lib/rpm/config.guess {} ';'
MOZ_OPT_FLAGS=$(echo "%{optflags}" | %{__sed} -e 's/-Wall//') MOZ_OPT_FLAGS=$(echo "%{optflags}" | %{__sed} -e 's/-Wall//')
MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -Wformat-security -Wformat -Werror=format-security" MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-Werror=format-security//')
MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -fno-delete-null-pointer-checks" MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -fpermissive"
%if %{?hardened_build}
MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -fPIC -Wl,-z,relro -Wl,-z,now" MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -fPIC -Wl,-z,relro -Wl,-z,now"
%endif
%if %{?debug_build}
MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-O2//')
%endif
%ifarch s390
MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-g/-g1/')
export MOZ_DEBUG_FLAGS=" "
%endif
%ifarch %{arm} %{ix86}
MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-g/-g0/')
export MOZ_DEBUG_FLAGS=" "
%endif
%if !0%{?build_with_clang}
%ifarch s390 ppc aarch64 %{ix86}
MOZ_LINK_FLAGS="-Wl,--no-keep-memory -Wl,--reduce-memory-overheads" MOZ_LINK_FLAGS="-Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
export CFLAGS=$MOZ_OPT_FLAGS %endif
export CXXFLAGS=$MOZ_OPT_FLAGS %ifarch %{arm}
export LDFLAGS=$MOZ_LINK_FLAGS MOZ_LINK_FLAGS="-Wl,--no-keep-memory -Wl,--strip-debug"
export PREFIX='%{_prefix}' echo "ac_add_options --enable-linker=gold" >> .mozconfig
export LIBDIR='%{_libdir}' %endif
export MOZ_MAKE_FLAGS="$MOZ_SMP_FLAGS" %endif
export MOZ_SERVICES_SYNC="1" %if 0%{?flatpak}
export STRIP=/bin/true MOZ_LINK_FLAGS="$MOZ_LINK_FLAGS -L%{_libdir}"
%endif
%ifarch %{arm} %{ix86}
export RUSTFLAGS="-Cdebuginfo=0"
%endif
%if %{build_with_asan}
MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -fsanitize=address -Dxmalloc=myxmalloc"
MOZ_LINK_FLAGS="$MOZ_LINK_FLAGS -fsanitize=address -ldl"
%endif
MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -DNSS_PKCS11_3_0_STRICT"
%if !%{build_with_clang}
echo "export CFLAGS=\"$MOZ_OPT_FLAGS\"" >> .mozconfig
echo "export CXXFLAGS=\"$MOZ_OPT_FLAGS\"" >> .mozconfig
echo "export LDFLAGS=\"$MOZ_LINK_FLAGS\"" >> .mozconfig
%endif
%if 0%{?build_with_clang}
echo "export LLVM_PROFDATA=\"llvm-profdata\"" >> .mozconfig
echo "export AR=\"llvm-ar\"" >> .mozconfig
echo "export NM=\"llvm-nm\"" >> .mozconfig
echo "export RANLIB=\"llvm-ranlib\"" >> .mozconfig
echo "ac_add_options --enable-linker=lld" >> .mozconfig
%else
echo "export CC=gcc" >> .mozconfig
echo "export CXX=g++" >> .mozconfig
echo "export AR=\"gcc-ar\"" >> .mozconfig
echo "export NM=\"gcc-nm\"" >> .mozconfig
echo "export RANLIB=\"gcc-ranlib\"" >> .mozconfig
%endif
%if 0%{?build_with_pgo}
echo "ac_add_options MOZ_PGO=1" >> .mozconfig
echo "ac_add_options --enable-lto" >> .mozconfig
%endif
MOZ_SMP_FLAGS=-j1 MOZ_SMP_FLAGS=-j1
[ -z "$RPM_BUILD_NCPUS" ] && RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`" %ifarch %{ix86}
[ -z "$RPM_BUILD_NCPUS" ] && \
RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"
[ "$RPM_BUILD_NCPUS" -ge 2 ] && MOZ_SMP_FLAGS=-j2
%endif
%ifarch x86_64 ppc ppc64 ppc64le aarch64
[ -z "$RPM_BUILD_NCPUS" ] && \
RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"
[ "$RPM_BUILD_NCPUS" -ge 2 ] && MOZ_SMP_FLAGS=-j2 [ "$RPM_BUILD_NCPUS" -ge 2 ] && MOZ_SMP_FLAGS=-j2
[ "$RPM_BUILD_NCPUS" -ge 4 ] && MOZ_SMP_FLAGS=-j4 [ "$RPM_BUILD_NCPUS" -ge 4 ] && MOZ_SMP_FLAGS=-j4
[ "$RPM_BUILD_NCPUS" -ge 8 ] && MOZ_SMP_FLAGS=-j8 [ "$RPM_BUILD_NCPUS" -ge 8 ] && MOZ_SMP_FLAGS=-j8
%endif
./mach build echo "export MOZ_MAKE_FLAGS=\"$MOZ_SMP_FLAGS\"" >> .mozconfig
echo "export MOZ_SERVICES_SYNC=1" >> .mozconfig
echo "export STRIP=/bin/true" >> .mozconfig
%if 0%{?build_with_pgo}
%if 0%{?pgo_wayland}
xvfb-run mutter --wayland --nested &
if [ -z "$WAYLAND_DISPLAY" ]; then
export WAYLAND_DISPLAY=wayland-0
else
export WAYLAND_DISPLAY=wayland-1
fi
MOZ_ENABLE_WAYLAND=1 ./mach build 2>&1 | cat -
%else
GDK_BACKEND=x11 xvfb-run ./mach build 2>&1 | cat -
%endif
%else
./mach build -v 2>&1 | cat -
%endif
%if %{enable_mozilla_crashreporter}
make -C objdir buildsymbols
%endif
%if %{?run_tests}
%if %{?system_nss}
ln -s %{_prefix}/bin/certutil objdir/dist/bin/certutil
ln -s %{_prefix}/bin/pk12util objdir/dist/bin/pk12util
%endif
mkdir test_results
./mach --log-no-times check-spidermonkey &> test_results/check-spidermonkey || true
./mach --log-no-times check-spidermonkey &> test_results/check-spidermonkey-2nd-run || true
./mach --log-no-times cppunittest &> test_results/cppunittest || true
xvfb-run ./mach --log-no-times crashtest &> test_results/crashtest || true
./mach --log-no-times gtest &> test_results/gtest || true
xvfb-run ./mach --log-no-times jetpack-test &> test_results/jetpack-test || true
xvfb-run ./mach --log-no-times mochitest-a11y &> test_results/mochitest-a11y || true
xvfb-run ./mach --log-no-times mochitest-browser &> test_results/mochitest-browser || true
xvfb-run ./mach --log-no-times mochitest-chrome &> test_results/mochitest-chrome || true
xvfb-run ./mach --log-no-times mochitest-devtools &> test_results/mochitest-devtools || true
xvfb-run ./mach --log-no-times mochitest-plain &> test_results/mochitest-plain || true
xvfb-run ./mach --log-no-times reftest &> test_results/reftest || true
xvfb-run ./mach --log-no-times webapprt-test-chrome &> test_results/webapprt-test-chrome || true
xvfb-run ./mach --log-no-times webapprt-test-content &> test_results/webapprt-test-content || true
./mach --log-no-times webidl-parser-test &> test_results/webidl-parser-test || true
xvfb-run ./mach --log-no-times xpcshell-test &> test_results/xpcshell-test || true
%if %{?system_nss}
rm -f objdir/dist/bin/certutil
rm -f objdir/dist/bin/pk12util
%endif
%endif
%install %install
%if !0%{?flatpak}
cat > objdir/dist/bin/browser/defaults/preferences/firefox-l10n.js << EOF %endif
%{__cat} > objdir/dist/bin/browser/defaults/preferences/firefox-l10n.js << EOF
pref("general.useragent.locale", "chrome://global/locale/intl.properties"); pref("general.useragent.locale", "chrome://global/locale/intl.properties");
EOF EOF
DESTDIR=%{buildroot} make -C objdir install
DESTDIR=$RPM_BUILD_ROOT make -C objdir install %{__mkdir_p} %{buildroot}{%{_libdir},%{_bindir},%{_datadir}/applications}
desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE20}
mkdir -p $RPM_BUILD_ROOT{%{_libdir},%{_bindir},%{_datadir}/applications} %if 0%{?wayland_backend_default}
desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE31}
desktop-file-install --dir $RPM_BUILD_ROOT%{_datadir}/applications %{SOURCE4} %endif
desktop-file-install --dir $RPM_BUILD_ROOT%{_datadir}/applications %{SOURCE12} desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE29}
%if 0%{?wayland_backend_default}
rm -rf $RPM_BUILD_ROOT%{_bindir}/firefox %global wayland_default true
cat %{SOURCE5} > $RPM_BUILD_ROOT%{_bindir}/firefox %else
cat %{SOURCE11} > $RPM_BUILD_ROOT%{_bindir}/firefox-wayland %global wayland_default false
chmod 755 $RPM_BUILD_ROOT%{_bindir}/firefox %endif
chmod 755 $RPM_BUILD_ROOT%{_bindir}/firefox-wayland %{__rm} -rf %{buildroot}%{_bindir}/firefox
%{__sed} -e 's/__DEFAULT_WAYLAND__/%{wayland_default}/' \
install -p -D -m 644 %{SOURCE6} $RPM_BUILD_ROOT%{_mandir}/man1/firefox.1 -e 's,/__PREFIX__,%{_prefix},g' %{SOURCE21} > %{buildroot}%{_bindir}/firefox
%{__chmod} 755 %{buildroot}%{_bindir}/firefox
rm -f $RPM_BUILD_ROOT/%{_libdir}/%{name}/firefox-config %if 0%{?flatpak}
rm -f $RPM_BUILD_ROOT/%{_libdir}/%{name}/update-settings.ini sed -i -e 's|%FLATPAK_ENV_VARS%|export TMPDIR="$XDG_CACHE_HOME/tmp"|' %{buildroot}%{_bindir}/firefox
%else
sed -i -e 's|%FLATPAK_ENV_VARS%||' %{buildroot}%{_bindir}/firefox
%endif
%if 0%{?wayland_backend_default}
%{__sed} -e 's,/__PREFIX__,%{_prefix},g' %{SOURCE30} > %{buildroot}%{_bindir}/firefox-x11
%{__chmod} 755 %{buildroot}%{_bindir}/firefox-x11
%endif
%{__sed} -e 's,/__PREFIX__,%{_prefix},g' %{SOURCE28} > %{buildroot}%{_bindir}/firefox-wayland
%{__chmod} 755 %{buildroot}%{_bindir}/firefox-wayland
%{__install} -p -D -m 644 %{SOURCE23} %{buildroot}%{_mandir}/man1/firefox.1
%{__rm} -f %{buildroot}/%{mozappdir}/firefox-config
%{__rm} -f %{buildroot}/%{mozappdir}/update-settings.ini
for s in 16 22 24 32 48 256; do for s in 16 22 24 32 48 256; do
mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${s}x${s}/apps %{__mkdir_p} %{buildroot}%{_datadir}/icons/hicolor/${s}x${s}/apps
cp -p browser/branding/official/default${s}.png \ %{__cp} -p browser/branding/official/default${s}.png \
$RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${s}x${s}/apps/firefox.png %{buildroot}%{_datadir}/icons/hicolor/${s}x${s}/apps/firefox.png
done done
%{__mkdir_p} %{buildroot}%{_datadir}/icons/hicolor/symbolic/apps
mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/symbolic/apps %{__cp} -p %{SOURCE25} \
mkdir -p $RPM_BUILD_ROOT%{_datadir}/appdata %{buildroot}%{_datadir}/icons/hicolor/symbolic/apps
cat > $RPM_BUILD_ROOT%{_datadir}/appdata/%{name}.appdata.xml <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2014 Richard Hughes <richard@hughsie.com> -->
<!--
BugReportURL: https://bugzilla.mozilla.org/show_bug.cgi?id=1071061
SentUpstream: 2014-09-22
-->
<application>
<id type="desktop">firefox.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<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>
<!-- FIXME: Needs another couple of paragraphs -->
</description>
<url type="homepage">http://www.mozilla.org/</url>
<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>
<!-- FIXME: change this to an upstream email address for spec updates
<updatecontact>someone_who_cares@upstream_project.org</updatecontact>
-->
</application>
EOF
echo > %{name}.lang echo > %{name}.lang
mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{name}/langpacks %if %{with langpacks}
tar xf %{SOURCE1} %{__mkdir_p} %{buildroot}%{langpackdir}
%{__tar} xf %{SOURCE1}
for langpack in `ls firefox-langpacks/*.xpi`; do for langpack in `ls firefox-langpacks/*.xpi`; do
language=`basename $langpack .xpi` language=`basename $langpack .xpi`
extensionID=langpack-$language@firefox.mozilla.org extensionID=langpack-$language@firefox.mozilla.org
mkdir -p $extensionID %{__mkdir_p} $extensionID
unzip -qq $langpack -d $extensionID unzip -qq $langpack -d $extensionID
find $extensionID -type f | xargs chmod 644 find $extensionID -type f | xargs chmod 644
cd $extensionID cd $extensionID
zip -qq -r9mX ../${extensionID}.xpi * zip -qq -r9mX ../${extensionID}.xpi *
cd - cd -
%{__install} -m 644 ${extensionID}.xpi %{buildroot}%{langpackdir}
install -m 644 ${extensionID}.xpi $RPM_BUILD_ROOT%{_libdir}/%{name}/langpacks
language=`echo $language | sed -e 's/-/_/g'` language=`echo $language | sed -e 's/-/_/g'`
echo "%%lang($language) %{_libdir}/%{name}/langpacks/${extensionID}.xpi" >> %{name}.lang %if 0%{?flatpak}
echo "%{langpackdir}/${extensionID}.xpi" >> %{name}.lang
%else
echo "%%lang($language) %{langpackdir}/${extensionID}.xpi" >> %{name}.lang
%endif
done done
rm -rf firefox-langpacks %{__rm} -rf firefox-langpacks
function create_default_langpack() { function create_default_langpack() {
language_long=$1 language_long=$1
language_short=$2 language_short=$2
cd $RPM_BUILD_ROOT%{_libdir}/%{name}/langpacks cd %{buildroot}%{langpackdir}
ln -s langpack-$language_long@firefox.mozilla.org.xpi langpack-$language_short@firefox.mozilla.org.xpi ln -s langpack-$language_long@firefox.mozilla.org.xpi langpack-$language_short@firefox.mozilla.org.xpi
cd - cd -
echo "%%lang($language_short) %{_libdir}/%{name}/langpacks/langpack-$language_short@firefox.mozilla.org.xpi" >> %{name}.lang echo "%%lang($language_short) %{langpackdir}/langpack-$language_short@firefox.mozilla.org.xpi" >> %{name}.lang
} }
create_default_langpack "bn-IN" "bn"
create_default_langpack "es-AR" "es" create_default_langpack "es-AR" "es"
create_default_langpack "fy-NL" "fy" create_default_langpack "fy-NL" "fy"
create_default_langpack "ga-IE" "ga" create_default_langpack "ga-IE" "ga"
@ -221,32 +600,62 @@ create_default_langpack "pa-IN" "pa"
create_default_langpack "pt-PT" "pt" create_default_langpack "pt-PT" "pt"
create_default_langpack "sv-SE" "sv" create_default_langpack "sv-SE" "sv"
create_default_langpack "zh-TW" "zh" create_default_langpack "zh-TW" "zh"
%endif
%{__mkdir_p} %{buildroot}/%{mozappdir}/browser/defaults/preferences
%{__mkdir_p} %{buildroot}/%{_sysconfdir}/%{name}/pref
%{__mkdir_p} %{buildroot}%{_datadir}/mozilla/extensions/%{firefox_app_id}
%{__mkdir_p} %{buildroot}%{_libdir}/mozilla/extensions/%{firefox_app_id}
%{__install} -p -c -m 644 LICENSE %{buildroot}/%{mozappdir}
%{__rm} -rf %{buildroot}%{mozappdir}/dictionaries
ln -s %{_datadir}/myspell %{buildroot}%{mozappdir}/dictionaries
%if %{enable_mozilla_crashreporter}
sed -i -e "s/\[Crash Reporter\]/[Crash Reporter]\nEnabled=1/" %{buildroot}/%{mozappdir}/application.ini
%{__mkdir_p} %{buildroot}/%{moz_debug_dir}
%{__cp} objdir/dist/%{symbols_file_name} %{buildroot}/%{moz_debug_dir}
%endif
%if %{run_tests}
%{__mkdir_p} %{buildroot}/test_results
%{__cp} test_results/* %{buildroot}/test_results
%endif
%{__cp} %{SOURCE12} %{buildroot}%{mozappdir}/browser/defaults/preferences
%{__cp} build/unix/run-mozilla.sh %{buildroot}%{mozappdir}
%{__mkdir_p} %{buildroot}%{mozappdir}/distribution
%{__cp} %{SOURCE26} %{buildroot}%{mozappdir}/distribution
mkdir -p %{buildroot}%{_datadir}/metainfo
%{__sed} -e 's/__VERSION__/%{version}/' %{SOURCE33} > %{buildroot}%{_datadir}/metainfo/firefox.appdata.xml
mkdir -p %{buildroot}%{_datadir}/gnome-shell/search-providers
%{__cp} %{SOURCE34} %{buildroot}%{_datadir}/gnome-shell/search-providers
rm -f %{buildroot}%{mozappdirdev}/sdk/lib/libmozjs.so
rm -f %{buildroot}%{mozappdirdev}/sdk/lib/libmozalloc.so
rm -f %{buildroot}%{mozappdirdev}/sdk/lib/libxul.so
mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/defaults/preferences %pretrans -p <lua>
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pref require 'posix'
mkdir -p $RPM_BUILD_ROOT%{_datadir}/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384} require 'os'
mkdir -p $RPM_BUILD_ROOT%{_libdir}/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384} if (posix.stat("%{mozappdir}/browser/defaults/preferences", "type") == "link") then
posix.unlink("%{mozappdir}/browser/defaults/preferences")
posix.mkdir("%{mozappdir}/browser/defaults/preferences")
if (posix.stat("%{mozappdir}/defaults/preferences", "type") == "directory") then
for i,filename in pairs(posix.dir("%{mozappdir}/defaults/preferences")) do
os.rename("%{mozappdir}/defaults/preferences/"..filename, "%{mozappdir}/browser/defaults/preferences/"..filename)
end
f = io.open("%{mozappdir}/defaults/preferences/README","w")
if f then
f:write("Content of this directory has been moved to %{mozappdir}/browser/defaults/preferences.")
f:close()
end
end
end
install -p -c -m 644 LICENSE $RPM_BUILD_ROOT/%{_libdir}/%{name} %check
appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/*.appdata.xml
rm -rf $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
ln -s %{_datadir}/myspell $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
cp %{SOURCE3} $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/defaults/preferences
cp build/unix/run-mozilla.sh $RPM_BUILD_ROOT%{_libdir}/%{name}
mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{name}/distribution
cp %{SOURCE9} $RPM_BUILD_ROOT%{_libdir}/%{name}/distribution
rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}-devel-%{version}/sdk/lib/libmozjs.so
rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}-devel-%{version}/sdk/lib/libmozalloc.so
rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}-devel-%{version}/sdk/lib/libxul.so
%preun %preun
if [ $1 -eq 0 ]; then if [ $1 -eq 0 ]; then
rm -rf %{_libdir}/%{name}/components %{__rm} -rf %{mozappdir}/components
rm -rf %{_libdir}/%{name}/extensions %{__rm} -rf %{mozappdir}/extensions
rm -rf %{_libdir}/%{name}/plugins %{__rm} -rf %{mozappdir}/plugins
rm -rf %{_libdir}/%{name}/langpacks %{__rm} -rf %{langpackdir}
fi fi
%post %post
@ -260,74 +669,71 @@ if [ $1 -eq 0 ] ; then
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi fi
%pretrans -p <lua>
require 'posix'
require 'os'
if (posix.stat("%{_libdir}/%{name}/browser/defaults/preferences", "type") == "link") then
posix.unlink("%{_libdir}/%{name}/browser/defaults/preferences")
posix.mkdir("%{_libdir}/%{name}/browser/defaults/preferences")
if (posix.stat("%{_libdir}/%{name}/defaults/preferences", "type") == "directory") then
for i,filename in pairs(posix.dir("%{_libdir}/%{name}/defaults/preferences")) do
os.rename("%{_libdir}/%{name}/defaults/preferences/"..filename, "%{_libdir}/%{name}/browser/defaults/preferences/"..filename)
end
f = io.open("%{_libdir}/%{name}/defaults/preferences/README","w")
if f then
f:write("Content of this directory has been moved to %{_libdir}/%{name}/browser/defaults/preferences.")
f:close()
end
end
end
%posttrans %posttrans
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%files -f %{name}.lang %files -f %{name}.lang
%license %{_libdir}/%{name}/LICENSE
%doc %{_mandir}/man1/*
%{_bindir}/firefox %{_bindir}/firefox
%{_bindir}/firefox-wayland %{mozappdir}/firefox
%{mozappdir}/firefox-bin
%doc %{_mandir}/man1/*
%dir %{_sysconfdir}/%{name} %dir %{_sysconfdir}/%{name}
%dir %{_sysconfdir}/%{name}/* %dir %{_sysconfdir}/%{name}/*
%dir %{_datadir}/mozilla/extensions/* %dir %{_datadir}/mozilla/extensions/*
%dir %{_libdir}/mozilla/extensions/* %dir %{_libdir}/mozilla/extensions/*
%dir %{_libdir}/%{name}
%dir %{_libdir}/%{name}/langpacks
%attr(644, root, root) %{_libdir}/%{name}/browser/blocklist.xml
%{_libdir}/%{name}/*.so
%{_libdir}/%{name}/gtk2/*.so
%{_libdir}/%{name}/firefox
%{_libdir}/%{name}/firefox-bin
%{_libdir}/%{name}/browser/chrome
%{_libdir}/%{name}/browser/chrome.manifest
%{_libdir}/%{name}/browser/omni.ja
%{_libdir}/%{name}/browser/defaults/preferences/firefox.js
%{_libdir}/%{name}/browser/features/*.xpi
%{_libdir}/%{name}/distribution/distribution.ini
%{_libdir}/%{name}/defaults/pref/channel-prefs.js
%{_libdir}/%{name}/dependentlibs.list
%{_libdir}/%{name}/dictionaries
%{_libdir}/%{name}/omni.ja
%{_libdir}/%{name}/platform.ini
%{_libdir}/%{name}/plugin-container
%{_libdir}/%{name}/gmp-clearkey
%{_libdir}/%{name}/fonts/TwemojiMozilla.ttf
%{_libdir}/%{name}/chrome.manifest
%{_libdir}/%{name}/run-mozilla.sh
%{_libdir}/%{name}/application.ini
%{_libdir}/%{name}/pingsender
%ghost %{_libdir}/%{name}/browser/features/aushelper@mozilla.org.xpi
%exclude %{_libdir}/%{name}/removed-files
%{_datadir}/appdata/*.appdata.xml
%{_datadir}/applications/%{name}.desktop %{_datadir}/applications/%{name}.desktop
%{_datadir}/metainfo/*.appdata.xml
%{_datadir}/gnome-shell/search-providers/*.ini
%dir %{mozappdir}
%license %{mozappdir}/LICENSE
%{mozappdir}/browser/chrome
%{mozappdir}/browser/defaults/preferences/firefox.js
%{mozappdir}/browser/features/*.xpi
%{mozappdir}/distribution/distribution.ini
%ghost %{mozappdir}/browser/features/aushelper@mozilla.org.xpi
%if %{with langpacks}
%dir %{langpackdir}
%endif
%{mozappdir}/browser/omni.ja
%{mozappdir}/run-mozilla.sh
%{mozappdir}/application.ini
%{mozappdir}/pingsender
%exclude %{mozappdir}/removed-files
%{_datadir}/icons/hicolor/16x16/apps/firefox.png %{_datadir}/icons/hicolor/16x16/apps/firefox.png
%{_datadir}/icons/hicolor/22x22/apps/firefox.png %{_datadir}/icons/hicolor/22x22/apps/firefox.png
%{_datadir}/icons/hicolor/24x24/apps/firefox.png %{_datadir}/icons/hicolor/24x24/apps/firefox.png
%{_datadir}/icons/hicolor/256x256/apps/firefox.png %{_datadir}/icons/hicolor/256x256/apps/firefox.png
%{_datadir}/icons/hicolor/32x32/apps/firefox.png %{_datadir}/icons/hicolor/32x32/apps/firefox.png
%{_datadir}/icons/hicolor/48x48/apps/firefox.png %{_datadir}/icons/hicolor/48x48/apps/firefox.png
%{_datadir}/applications/firefox-wayland.desktop %{_datadir}/icons/hicolor/symbolic/apps/firefox-symbolic.svg
%if %{enable_mozilla_crashreporter}
%{mozappdir}/crashreporter
%{mozappdir}/crashreporter.ini
%{mozappdir}/minidump-analyzer
%{mozappdir}/Throbber-small.gif
%{mozappdir}/browser/crashreporter-override.ini
%endif
%{mozappdir}/*.so
%{mozappdir}/gtk2/*.so
%{mozappdir}/defaults/pref/channel-prefs.js
%{mozappdir}/dependentlibs.list
%{mozappdir}/dictionaries
%{mozappdir}/omni.ja
%{mozappdir}/platform.ini
%{mozappdir}/plugin-container
%{mozappdir}/gmp-clearkey
%{mozappdir}/fonts/TwemojiMozilla.ttf
%if !%{?system_nss}
%exclude %{mozappdir}/libnssckbi.so
%endif
%if %{build_with_asan}
%{mozappdir}/llvm-symbolizer
%endif
%changelog %changelog
* Mon Aug 17 2020 zhangjiapeng <zhangjiapeng9@huawei.com> - 79.0-1
- Update to 79.0-1
* Wed Jul 22 2020 lingsheng <lingsheng@huawei.com> - 62.0.3-7 * Wed Jul 22 2020 lingsheng <lingsheng@huawei.com> - 62.0.3-7
- Fix firefox build with rust 1.38 - Fix firefox build with rust 1.38

View File

@ -1,4 +0,0 @@
version_control: github
src_repo: mozilla/gecko-dev
tag_prefix: ^B2G_
seperator: _

View File

@ -1,56 +1,57 @@
diff -up firefox-58.0/extensions/pref/autoconfig/src/nsReadConfig.cpp.1170092 firefox-58.0/extensions/pref/autoconfig/src/nsReadConfig.cpp diff -up firefox-75.0/extensions/pref/autoconfig/src/nsReadConfig.cpp.1170092 firefox-75.0/extensions/pref/autoconfig/src/nsReadConfig.cpp
--- firefox-58.0/extensions/pref/autoconfig/src/nsReadConfig.cpp.1170092 2018-01-11 21:17:03.000000000 +0100 --- firefox-75.0/extensions/pref/autoconfig/src/nsReadConfig.cpp.1170092 2020-04-03 21:34:41.000000000 +0200
+++ firefox-58.0/extensions/pref/autoconfig/src/nsReadConfig.cpp 2018-01-23 13:59:45.446495820 +0100 +++ firefox-75.0/extensions/pref/autoconfig/src/nsReadConfig.cpp 2020-04-06 22:40:02.760674871 +0200
@@ -239,9 +239,20 @@ nsresult nsReadConfig::openAndEvaluateJS @@ -244,8 +244,20 @@ nsresult nsReadConfig::openAndEvaluateJS
return rv; if (NS_FAILED(rv)) return rv;
rv = NS_NewLocalFileInputStream(getter_AddRefs(inStr), jsFile); rv = NS_NewLocalFileInputStream(getter_AddRefs(inStr), jsFile);
- if (NS_FAILED(rv)) - if (NS_FAILED(rv)) return rv;
- return rv; + if (NS_FAILED(rv)) {
+ if (NS_FAILED(rv)) { + // Look for cfg file in /etc/<application>/pref
+ // Look for cfg file in /etc/<application>/pref + rv = NS_GetSpecialDirectory(NS_APP_PREFS_SYSTEM_CONFIG_DIR,
+ rv = NS_GetSpecialDirectory(NS_APP_PREFS_SYSTEM_CONFIG_DIR, + getter_AddRefs(jsFile));
+ getter_AddRefs(jsFile)); + NS_ENSURE_SUCCESS(rv, rv);
+ NS_ENSURE_SUCCESS(rv, rv);
+ +
+ rv = jsFile->AppendNative(NS_LITERAL_CSTRING("pref")); + rv = jsFile->AppendNative(NS_LITERAL_CSTRING("pref"));
+ NS_ENSURE_SUCCESS(rv, rv); + NS_ENSURE_SUCCESS(rv, rv);
+ rv = jsFile->AppendNative(nsDependentCString(aFileName)); + rv = jsFile->AppendNative(nsDependentCString(aFileName));
+ NS_ENSURE_SUCCESS(rv, rv); + NS_ENSURE_SUCCESS(rv, rv);
+ rv = NS_NewLocalFileInputStream(getter_AddRefs(inStr), jsFile); + rv = NS_NewLocalFileInputStream(getter_AddRefs(inStr), jsFile);
+ NS_ENSURE_SUCCESS(rv, rv); + NS_ENSURE_SUCCESS(rv, rv);
+ } + }
} else { } else {
nsAutoCString location("resource://gre/defaults/autoconfig/"); nsAutoCString location("resource://gre/defaults/autoconfig/");
location += aFileName; location += aFileName;
diff -up firefox-58.0/modules/libpref/Preferences.cpp.1170092 firefox-58.0/modules/libpref/Preferences.cpp diff -up firefox-75.0/modules/libpref/Preferences.cpp.1170092 firefox-75.0/modules/libpref/Preferences.cpp
--- firefox-58.0/modules/libpref/Preferences.cpp.1170092 2018-01-23 13:59:45.447495817 +0100 --- firefox-75.0/modules/libpref/Preferences.cpp.1170092 2020-04-06 22:40:02.761674865 +0200
+++ firefox-58.0/modules/libpref/Preferences.cpp 2018-01-23 14:02:51.456987774 +0100 +++ firefox-75.0/modules/libpref/Preferences.cpp 2020-04-06 22:40:57.675325227 +0200
@@ -4402,6 +4402,8 @@ pref_InitInitialObjects() @@ -4468,6 +4468,9 @@ nsresult Preferences::InitInitialObjects
// //
// Thus, in the omni.jar case, we always load app-specific default // Thus, in the omni.jar case, we always load app-specific default
// preferences from omni.jar, whether or not `$app == $gre`. // preferences from omni.jar, whether or not `$app == $gre`.
+ //
+ // At very end load configuration from system config location: + // At very end load configuration from system config location:
+ // - /etc/firefox/pref/*.js + // - /etc/firefox/pref/*.js
nsresult rv; nsresult rv = NS_ERROR_FAILURE;
nsZipFind* findPtr; UniquePtr<nsZipFind> find;
diff -up firefox-58.0/toolkit/xre/nsXREDirProvider.cpp.1170092 firefox-58.0/toolkit/xre/nsXREDirProvider.cpp diff -up firefox-75.0/toolkit/xre/nsXREDirProvider.cpp.1170092 firefox-75.0/toolkit/xre/nsXREDirProvider.cpp
--- firefox-58.0/toolkit/xre/nsXREDirProvider.cpp.1170092 2018-01-11 21:17:06.000000000 +0100 --- firefox-75.0/toolkit/xre/nsXREDirProvider.cpp.1170092 2020-04-03 21:35:39.000000000 +0200
+++ firefox-58.0/toolkit/xre/nsXREDirProvider.cpp 2018-01-23 13:59:45.447495817 +0100 +++ firefox-75.0/toolkit/xre/nsXREDirProvider.cpp 2020-04-06 22:40:02.761674865 +0200
@@ -59,6 +59,7 @@ @@ -60,6 +60,7 @@
#endif #endif
#ifdef XP_UNIX #ifdef XP_UNIX
#include <ctype.h> # include <ctype.h>
+#include "nsIXULAppInfo.h" +# include "nsIXULAppInfo.h"
#endif #endif
#ifdef XP_IOS #ifdef XP_IOS
#include "UIKitDirProvider.h" # include "UIKitDirProvider.h"
@@ -554,6 +555,20 @@ nsXREDirProvider::GetFile(const char* aP @@ -533,6 +534,21 @@ nsXREDirProvider::GetFile(const char* aP
} }
} }
} }
+
+#if defined(XP_UNIX) +#if defined(XP_UNIX)
+ if (!strcmp(aProperty, NS_APP_PREFS_SYSTEM_CONFIG_DIR)) { + if (!strcmp(aProperty, NS_APP_PREFS_SYSTEM_CONFIG_DIR)) {
+ nsCString sysConfigDir = NS_LITERAL_CSTRING("/etc/"); + nsCString sysConfigDir = NS_LITERAL_CSTRING("/etc/");
@ -65,32 +66,34 @@ diff -up firefox-58.0/toolkit/xre/nsXREDirProvider.cpp.1170092 firefox-58.0/tool
+ } + }
+#endif +#endif
+ +
if (NS_FAILED(rv) || !file) if (NS_FAILED(rv) || !file) return NS_ERROR_FAILURE;
return NS_ERROR_FAILURE;
if (ensureFilePermissions) {
@@ -845,6 +861,16 @@ nsresult nsXREDirProvider::GetFilesInter
@@ -887,6 +902,14 @@ nsXREDirProvider::GetFilesInternal(const
LoadDirIntoArray(mXULAppDir, kAppendPrefDir, directories); LoadDirIntoArray(mXULAppDir, kAppendPrefDir, directories);
LoadDirsIntoArray(mAppBundleDirectories,
kAppendPrefDir, directories);
+ // Add /etc/<application>/pref/ directory if it exists + // Add /etc/<application>/pref/ directory if it exists
+ nsCOMPtr<nsIFile> systemPrefDir; + nsCOMPtr<nsIFile> systemPrefDir;
+ rv = NS_GetSpecialDirectory(NS_APP_PREFS_SYSTEM_CONFIG_DIR, getter_AddRefs(systemPrefDir)); + rv = NS_GetSpecialDirectory(NS_APP_PREFS_SYSTEM_CONFIG_DIR,
+ getter_AddRefs(systemPrefDir));
+ if (NS_SUCCEEDED(rv)) { + if (NS_SUCCEEDED(rv)) {
+ rv = systemPrefDir->AppendNative(NS_LITERAL_CSTRING("pref")); + rv = systemPrefDir->AppendNative(NS_LITERAL_CSTRING("pref"));
+ if (NS_SUCCEEDED(rv)) + if (NS_SUCCEEDED(rv))
+ directories.AppendObject(systemPrefDir); + directories.AppendObject(systemPrefDir);
+ } + }
+
rv = NS_NewArrayEnumerator(aResult, directories); rv = NS_NewArrayEnumerator(aResult, directories, NS_GET_IID(nsIFile));
} } else if (!strcmp(aProperty, NS_APP_CHROME_DIR_LIST)) {
diff -up firefox-58.0/xpcom/io/nsAppDirectoryServiceDefs.h.1170092 firefox-58.0/xpcom/io/nsAppDirectoryServiceDefs.h // NS_APP_CHROME_DIR_LIST is only used to get default (native) icons
--- firefox-58.0/xpcom/io/nsAppDirectoryServiceDefs.h.1170092 2018-01-23 13:59:45.447495817 +0100 diff -up firefox-75.0/xpcom/io/nsAppDirectoryServiceDefs.h.1170092 firefox-75.0/xpcom/io/nsAppDirectoryServiceDefs.h
+++ firefox-58.0/xpcom/io/nsAppDirectoryServiceDefs.h 2018-01-23 14:02:02.871120476 +0100 --- firefox-75.0/xpcom/io/nsAppDirectoryServiceDefs.h.1170092 2020-04-03 21:35:39.000000000 +0200
@@ -59,6 +59,7 @@ +++ firefox-75.0/xpcom/io/nsAppDirectoryServiceDefs.h 2020-04-06 22:40:02.761674865 +0200
#define NS_APP_PREFS_50_FILE "PrefF" @@ -60,6 +60,7 @@
#define NS_APP_PREFS_DEFAULTS_DIR_LIST "PrefDL" #define NS_APP_PREFS_DEFAULTS_DIR_LIST "PrefDL"
#define NS_APP_PREFS_OVERRIDE_DIR "PrefDOverride" // Directory for per-profile defaults #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_PREFS_SYSTEM_CONFIG_DIR "PrefSysConf" // Directory with system-wide configuration
#define NS_APP_USER_PROFILE_50_DIR "ProfD" #define NS_APP_USER_PROFILE_50_DIR "ProfD"
#define NS_APP_USER_PROFILE_LOCAL_50_DIR "ProfLD" #define NS_APP_USER_PROFILE_LOCAL_50_DIR "ProfLD"

View File

@ -1,28 +1,13 @@
# HG changeset patch diff -up firefox-68.0/widget/gtk/nsWindow.cpp.1196777 firefox-68.0/widget/gtk/nsWindow.cpp
# User Martin Stransky <stransky@redhat.com> --- firefox-68.0/widget/gtk/nsWindow.cpp.1196777 2019-07-02 11:47:06.864726826 +0200
# Parent 4e3ad95d689a5beabf3c1f41d958794fe00e3767 +++ firefox-68.0/widget/gtk/nsWindow.cpp 2019-07-02 11:48:09.896544339 +0200
Bug 1196777 - Ask GDK to receive focus events, r=?karlt @@ -156,7 +156,8 @@ const gint kEvents =
#if GTK_CHECK_VERSION(3, 4, 0)
diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp GDK_SMOOTH_SCROLL_MASK | GDK_TOUCH_MASK |
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -142,17 +142,18 @@ const gint kEvents = GDK_EXPOSURE_MASK |
GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK |
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
#if GTK_CHECK_VERSION(3,4,0)
GDK_SMOOTH_SCROLL_MASK |
GDK_TOUCH_MASK |
#endif #endif
GDK_SCROLL_MASK | - GDK_SCROLL_MASK | GDK_POINTER_MOTION_MASK | GDK_PROPERTY_CHANGE_MASK;
GDK_POINTER_MOTION_MASK | + GDK_SCROLL_MASK | GDK_POINTER_MOTION_MASK | GDK_PROPERTY_CHANGE_MASK |
- GDK_PROPERTY_CHANGE_MASK; + GDK_FOCUS_CHANGE_MASK;
+ GDK_PROPERTY_CHANGE_MASK |
+ GDK_FOCUS_CHANGE_MASK;
/* utility functions */ #if !GTK_CHECK_VERSION(3, 22, 0)
static bool is_mouse_in_window(GdkWindow* aWindow, typedef enum {
gdouble aMouseX, gdouble aMouseY);
static nsWindow *get_window_for_gtk_widget(GtkWidget *widget);
static nsWindow *get_window_for_gdk_window(GdkWindow *window);
static GtkWidget *get_gtk_widget_for_gdk_window(GdkWindow *window);
static GdkCursor *get_gtk_cursor(nsCursor aCursor);

496
mozilla-1337988.patch Normal file
View File

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

View File

@ -1,27 +0,0 @@
From 1cc652f5525f458b0b4ceb12af24bf5a4367db32 Mon Sep 17 00:00:00 2001
From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Date: Tue, 23 May 2017 13:09:48 -0400
Subject: [PATCH] Bug 1353817: Include SkNx_neon.h for ARM64 too
This fixes build errors as arm_neon.h was missing along with some
missing converters.
---
gfx/skia/skia/src/core/SkNx.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gfx/skia/skia/src/core/SkNx.h b/gfx/skia/skia/src/core/SkNx.h
index 6bca856..b0427aa 100644
--- a/gfx/skia/skia/src/core/SkNx.h
+++ b/gfx/skia/skia/src/core/SkNx.h
@@ -299,7 +299,7 @@ typedef SkNx<4, uint32_t> Sk4u;
// Include platform specific specializations if available.
#if !defined(SKNX_NO_SIMD) && SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2
#include "../opts/SkNx_sse.h"
-#elif !defined(SKNX_NO_SIMD) && defined(SK_ARM_HAS_NEON)
+#elif !defined(SKNX_NO_SIMD) && (defined(SK_ARM_HAS_NEON) || defined(SK_CPU_ARM64))
#include "../opts/SkNx_neon.h"
#else
--
2.9.4

View File

@ -1,57 +0,0 @@
diff --git a/toolkit/components/remote/nsRemoteService.cpp b/toolkit/components/remote/nsRemoteService.cpp
--- a/toolkit/components/remote/nsRemoteService.cpp
+++ b/toolkit/components/remote/nsRemoteService.cpp
@@ -34,20 +34,18 @@
NS_IMETHODIMP
nsRemoteService::Startup(const char* aAppName, const char* aProfileName)
{
-#if defined(MOZ_ENABLE_DBUS)
+#if defined(MOZ_ENABLE_DBUS) && defined(MOZ_WAYLAND)
nsresult rv;
mDBusRemoteService = new nsDBusRemoteService();
rv = mDBusRemoteService->Startup(aAppName, aProfileName);
if (NS_FAILED(rv)) {
mDBusRemoteService = nullptr;
}
+#elif !defined(MOZ_WAYLAND)
+ mGtkRemoteService = new nsGTKRemoteService();
+ mGtkRemoteService->Startup(aAppName, aProfileName);
#endif
- if (GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
- mGtkRemoteService = new nsGTKRemoteService();
- mGtkRemoteService->Startup(aAppName, aProfileName);
- }
-
if (!mDBusRemoteService && !mGtkRemoteService)
return NS_ERROR_FAILURE;
@@ -73,7 +71,7 @@
NS_IMETHODIMP
nsRemoteService::Shutdown()
{
-#if defined(MOZ_ENABLE_DBUS)
+#if defined(MOZ_ENABLE_DBUS) && defined(MOZ_WAYLAND)
if (mDBusRemoteService) {
mDBusRemoteService->Shutdown();
mDBusRemoteService = nullptr;
diff --git a/widget/xremoteclient/moz.build b/widget/xremoteclient/moz.build
--- a/widget/xremoteclient/moz.build
+++ b/widget/xremoteclient/moz.build
@@ -11,7 +11,6 @@
SOURCES += [
'RemoteUtils.cpp',
- 'XRemoteClient.cpp',
]
if CONFIG['MOZ_ENABLE_DBUS'] and CONFIG['MOZ_WAYLAND']:
@@ -20,3 +19,7 @@
]
CXXFLAGS += CONFIG['TK_CFLAGS']
CXXFLAGS += CONFIG['MOZ_DBUS_GLIB_CFLAGS']
+else:
+ SOURCES += [
+ 'XRemoteClient.cpp',
+ ]

View File

@ -1,26 +0,0 @@
diff --git a/widget/gtk/WindowSurfaceWayland.cpp b/widget/gtk/WindowSurfaceWayland.cpp
--- a/widget/gtk/WindowSurfaceWayland.cpp
+++ b/widget/gtk/WindowSurfaceWayland.cpp
@@ -146,18 +146,19 @@ static StaticMutex gWaylandDisplaysMutex
//
// nsWaylandDisplay is our interface to wayland compositor. It provides wayland
// global objects as we need (wl_display, wl_shm) and operates wl_event_queue on
// compositor (not the main) thread.
static nsWaylandDisplay* WaylandDisplayGet(wl_display *aDisplay);
static void WaylandDisplayRelease(wl_display *aDisplay);
static void WaylandDisplayLoop(wl_display *aDisplay);
-// TODO: is the 60pfs loop correct?
-#define EVENT_LOOP_DELAY (1000/60)
+// TODO: Bug 1467125 - We need to integrate wl_display_dispatch_queue_pending() with
+// compositor event loop.
+#define EVENT_LOOP_DELAY (1000/240)
// Get WaylandDisplay for given wl_display and actual calling thread.
static nsWaylandDisplay*
WaylandDisplayGetLocked(wl_display *aDisplay, const StaticMutexAutoLock&)
{
nsWaylandDisplay* waylandDisplay = nullptr;
int len = gWaylandDisplays.Count();

View File

@ -1,359 +0,0 @@
diff --git a/gfx/thebes/gfxPlatformGtk.h b/gfx/thebes/gfxPlatformGtk.h
--- a/gfx/thebes/gfxPlatformGtk.h
+++ b/gfx/thebes/gfxPlatformGtk.h
@@ -102,23 +102,42 @@ public:
#endif
#ifdef MOZ_X11
Display* GetCompositorDisplay() {
return mCompositorDisplay;
}
#endif // MOZ_X11
+#ifdef MOZ_WAYLAND
+ void SetWaylandLastVsync(uint32_t aVsyncTimestamp) {
+ mWaylandLastVsyncTimestamp = aVsyncTimestamp;
+ }
+ int64_t GetWaylandLastVsync() {
+ return mWaylandLastVsyncTimestamp;
+ }
+ void SetWaylandFrameDelay(int64_t aFrameDelay) {
+ mWaylandFrameDelay = aFrameDelay;
+ }
+ int64_t GetWaylandFrameDelay() {
+ return mWaylandFrameDelay;
+ }
+#endif
+
protected:
bool CheckVariationFontSupport() override;
int8_t mMaxGenericSubstitutions;
private:
virtual void GetPlatformCMSOutputProfile(void *&mem,
size_t &size) override;
#ifdef MOZ_X11
Display* mCompositorDisplay;
#endif
+#ifdef MOZ_WAYLAND
+ int64_t mWaylandLastVsyncTimestamp;
+ int64_t mWaylandFrameDelay;
+#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
@@ -46,16 +46,20 @@
#include "GLContextGLX.h"
#include "GLXLibrary.h"
/* Undefine the Status from Xlib since it will conflict with system headers on OSX */
#if defined(__APPLE__) && defined(Status)
#undef Status
#endif
+#ifdef MOZ_WAYLAND
+#include <gdk/gdkwayland.h>
+#endif
+
#endif /* MOZ_X11 */
#include <fontconfig/fontconfig.h>
#include "nsMathUtils.h"
#define GDK_PIXMAP_SIZE_MAX 32767
@@ -89,16 +93,22 @@ gfxPlatformGtk::gfxPlatformGtk()
#ifdef MOZ_X11
if (gfxPlatform::IsHeadless() && GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
mCompositorDisplay = XOpenDisplay(nullptr);
MOZ_ASSERT(mCompositorDisplay, "Failed to create compositor display!");
} else {
mCompositorDisplay = nullptr;
}
#endif // MOZ_X11
+#ifdef MOZ_WAYLAND
+ // Wayland compositors use g_get_monotonic_time() to get timestamps.
+ mWaylandLastVsyncTimestamp = (g_get_monotonic_time() / 1000);
+ // Set default display fps to 60
+ mWaylandFrameDelay = 1000/60;
+#endif
}
gfxPlatformGtk::~gfxPlatformGtk()
{
#ifdef MOZ_X11
if (mCompositorDisplay) {
XCloseDisplay(mCompositorDisplay);
}
@@ -505,26 +515,26 @@ gfxPlatformGtk::CheckVariationFontSuppor
// until at least 2.7.1.
FT_Int major, minor, patch;
FT_Library_Version(GetFTLibrary(), &major, &minor, &patch);
return major * 1000000 + minor * 1000 + patch >= 2007001;
}
#ifdef MOZ_X11
-class GLXVsyncSource final : public VsyncSource
+class GtkVsyncSource final : public VsyncSource
{
public:
- GLXVsyncSource()
+ GtkVsyncSource()
{
MOZ_ASSERT(NS_IsMainThread());
mGlobalDisplay = new GLXDisplay();
}
- virtual ~GLXVsyncSource()
+ virtual ~GtkVsyncSource()
{
MOZ_ASSERT(NS_IsMainThread());
}
virtual Display& GetGlobalDisplay() override
{
return *mGlobalDisplay;
}
@@ -536,39 +546,52 @@ public:
public:
GLXDisplay() : mGLContext(nullptr)
, mXDisplay(nullptr)
, mSetupLock("GLXVsyncSetupLock")
, mVsyncThread("GLXVsyncThread")
, mVsyncTask(nullptr)
, mVsyncEnabledLock("GLXVsyncEnabledLock")
, mVsyncEnabled(false)
+#ifdef MOZ_WAYLAND
+ , mIsWaylandDisplay(false)
+#endif
{
}
// Sets up the display's GL context on a worker thread.
// Required as GLContexts may only be used by the creating thread.
// Returns true if setup was a success.
bool Setup()
{
MonitorAutoLock lock(mSetupLock);
MOZ_ASSERT(NS_IsMainThread());
if (!mVsyncThread.Start())
return false;
RefPtr<Runnable> vsyncSetup =
- NewRunnableMethod("GLXVsyncSource::GLXDisplay::SetupGLContext",
+ NewRunnableMethod("GtkVsyncSource::GLXDisplay::SetupGLContext",
this,
&GLXDisplay::SetupGLContext);
mVsyncThread.message_loop()->PostTask(vsyncSetup.forget());
// Wait until the setup has completed.
lock.Wait();
return mGLContext != nullptr;
}
+#ifdef MOZ_WAYLAND
+ bool SetupWayland()
+ {
+ MonitorAutoLock lock(mSetupLock);
+ MOZ_ASSERT(NS_IsMainThread());
+ mIsWaylandDisplay = true;
+ return mVsyncThread.Start();
+ }
+#endif
+
// Called on the Vsync thread to setup the GL context.
void SetupGLContext()
{
MonitorAutoLock lock(mSetupLock);
MOZ_ASSERT(!NS_IsMainThread());
MOZ_ASSERT(!mGLContext, "GLContext already setup!");
// Create video sync timer on a separate Display to prevent locking the
@@ -613,29 +636,35 @@ public:
}
lock.NotifyAll();
}
virtual void EnableVsync() override
{
MOZ_ASSERT(NS_IsMainThread());
+#if !defined(MOZ_WAYLAND)
MOZ_ASSERT(mGLContext, "GLContext not setup!");
+#endif
MonitorAutoLock lock(mVsyncEnabledLock);
if (mVsyncEnabled) {
return;
}
mVsyncEnabled = true;
// If the task has not nulled itself out, it hasn't yet realized
// that vsync was disabled earlier, so continue its execution.
if (!mVsyncTask) {
mVsyncTask = NewRunnableMethod(
- "GLXVsyncSource::GLXDisplay::RunVsync", this, &GLXDisplay::RunVsync);
+ "GtkVsyncSource::GLXDisplay::RunVsync", this,
+#if defined(MOZ_WAYLAND)
+ mIsWaylandDisplay ? &GLXDisplay::RunVsyncWayland :
+#endif
+ &GLXDisplay::RunVsync);
RefPtr<Runnable> addrefedTask = mVsyncTask;
mVsyncThread.message_loop()->PostTask(addrefedTask.forget());
}
}
virtual void DisableVsync() override
{
MonitorAutoLock lock(mVsyncEnabledLock);
@@ -650,17 +679,17 @@ public:
virtual void Shutdown() override
{
MOZ_ASSERT(NS_IsMainThread());
DisableVsync();
// Cleanup thread-specific resources before shutting down.
RefPtr<Runnable> shutdownTask = NewRunnableMethod(
- "GLXVsyncSource::GLXDisplay::Cleanup", this, &GLXDisplay::Cleanup);
+ "GtkVsyncSource::GLXDisplay::Cleanup", this, &GLXDisplay::Cleanup);
mVsyncThread.message_loop()->PostTask(shutdownTask.forget());
// Stop, waiting for the cleanup task to finish execution.
mVsyncThread.Stop();
}
private:
virtual ~GLXDisplay()
@@ -709,50 +738,96 @@ public:
}
}
lastVsync = TimeStamp::Now();
NotifyVsync(lastVsync);
}
}
+#ifdef MOZ_WAYLAND
+ /* VSync on Wayland is tricky as we can get only "last VSync" event signal.
+ * That means we should draw next frame at "last Vsync + frame delay" time.
+ */
+ void RunVsyncWayland()
+ {
+ MOZ_ASSERT(!NS_IsMainThread());
+
+ for (;;) {
+ {
+ MonitorAutoLock lock(mVsyncEnabledLock);
+ if (!mVsyncEnabled) {
+ mVsyncTask = nullptr;
+ return;
+ }
+ }
+
+ gint64 lastVsync = gfxPlatformGtk::GetPlatform()->GetWaylandLastVsync();
+ gint64 currTime = (g_get_monotonic_time() / 1000);
+
+ gint64 remaining = gfxPlatformGtk::GetPlatform()->GetWaylandFrameDelay() -
+ (currTime - lastVsync);
+ if (remaining > 0) {
+ PlatformThread::Sleep(remaining);
+ } else {
+ // Time from last HW Vsync is longer than our frame delay,
+ // use our approximation then.
+ gfxPlatformGtk::GetPlatform()->SetWaylandLastVsync(currTime);
+ }
+
+ NotifyVsync(TimeStamp::Now());
+ }
+ }
+#endif
+
void Cleanup() {
MOZ_ASSERT(!NS_IsMainThread());
mGLContext = nullptr;
- XCloseDisplay(mXDisplay);
+ if (mXDisplay)
+ XCloseDisplay(mXDisplay);
}
// Owned by the vsync thread.
RefPtr<gl::GLContextGLX> mGLContext;
_XDisplay* mXDisplay;
Monitor mSetupLock;
base::Thread mVsyncThread;
RefPtr<Runnable> mVsyncTask;
Monitor mVsyncEnabledLock;
bool mVsyncEnabled;
+#ifdef MOZ_WAYLAND
+ bool mIsWaylandDisplay;
+#endif
};
private:
// We need a refcounted VsyncSource::Display to use chromium IPC runnables.
RefPtr<GLXDisplay> mGlobalDisplay;
};
already_AddRefed<gfx::VsyncSource>
gfxPlatformGtk::CreateHardwareVsyncSource()
{
+#ifdef MOZ_WAYLAND
+ if (GDK_IS_WAYLAND_DISPLAY(gdk_display_get_default())) {
+ RefPtr<VsyncSource> vsyncSource = new GtkVsyncSource();
+ VsyncSource::Display& display = vsyncSource->GetGlobalDisplay();
+ static_cast<GtkVsyncSource::GLXDisplay&>(display).SetupWayland();
+ return vsyncSource.forget();
+ }
+#endif
+
// Only use GLX vsync when the OpenGL compositor is being used.
// The extra cost of initializing a GLX context while blocking the main
// thread is not worth it when using basic composition.
- // Also don't use it on non-X11 displays.
if (gfxConfig::IsEnabled(Feature::HW_COMPOSITING)) {
- if (GDK_IS_X11_DISPLAY(gdk_display_get_default()) &&
- gl::sGLXLibrary.SupportsVideoSync()) {
- RefPtr<VsyncSource> vsyncSource = new GLXVsyncSource();
+ if (gl::sGLXLibrary.SupportsVideoSync()) {
+ RefPtr<VsyncSource> vsyncSource = new GtkVsyncSource();
VsyncSource::Display& display = vsyncSource->GetGlobalDisplay();
- if (!static_cast<GLXVsyncSource::GLXDisplay&>(display).Setup()) {
+ if (!static_cast<GtkVsyncSource::GLXDisplay&>(display).Setup()) {
NS_WARNING("Failed to setup GLContext, falling back to software vsync.");
return gfxPlatform::CreateHardwareVsyncSource();
}
return vsyncSource.forget();
}
NS_WARNING("SGI_video_sync unsupported. Falling back to software vsync.");
}
return gfxPlatform::CreateHardwareVsyncSource();
diff --git a/widget/gtk/WindowSurfaceWayland.cpp b/widget/gtk/WindowSurfaceWayland.cpp
--- a/widget/gtk/WindowSurfaceWayland.cpp
+++ b/widget/gtk/WindowSurfaceWayland.cpp
@@ -546,16 +546,18 @@ WindowBackBuffer::Lock()
mWaylandDisplay->GetSurfaceFormat());
}
static void
frame_callback_handler(void *data, struct wl_callback *callback, uint32_t time)
{
auto surface = reinterpret_cast<WindowSurfaceWayland*>(data);
surface->FrameCallbackHandler();
+
+ gfxPlatformGtk::GetPlatform()->SetWaylandLastVsync(time);
}
static const struct wl_callback_listener frame_listener = {
frame_callback_handler
};
WindowSurfaceWayland::WindowSurfaceWayland(nsWindow *aWindow)
: mWindow(aWindow)

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

16
mozilla-1516803.patch Normal file
View File

@ -0,0 +1,16 @@
diff --git a/security/sandbox/linux/moz.build b/security/sandbox/linux/moz.build
--- a/security/sandbox/linux/moz.build
+++ b/security/sandbox/linux/moz.build
@@ -99,9 +99,8 @@
# gcc lto likes to put the top level asm in syscall.cc in a different partition
# from the function using it which breaks the build. Work around that by
# forcing there to be only one partition.
-for f in CONFIG['OS_CXXFLAGS']:
- if f.startswith('-flto') and CONFIG['CC_TYPE'] != 'clang':
- LDFLAGS += ['--param lto-partitions=1']
+if CONFIG['CC_TYPE'] != 'clang':
+ LDFLAGS += ['--param', 'lto-partitions=1']
DEFINES['NS_NO_XPCOM'] = True
DisableStlWrapping()

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

16
mozilla-1640982.patch Normal file
View File

@ -0,0 +1,16 @@
diff --git a/config/makefiles/rust.mk b/config/makefiles/rust.mk
--- a/config/makefiles/rust.mk
+++ b/config/makefiles/rust.mk
@@ -61,7 +61,11 @@
# Enable link-time optimization for release builds, but not when linking
# gkrust_gtest.
ifeq (,$(findstring gkrust_gtest,$(RUST_LIBRARY_FILE)))
+# Pass -Clto for older versions of rust, and CARGO_PROFILE_RELEASE_LTO=true
+# for newer ones that support it. Combining the latter with -Clto works, so
+# set both everywhere.
cargo_rustc_flags += -Clto
+export CARGO_PROFILE_RELEASE_LTO=true
endif
endif
endif

67
mozilla-1645671.patch Normal file
View File

@ -0,0 +1,67 @@
changeset: 544864:a8603f131703
tag: tip
parent: 544861:161920b70ae4
user: Martin Stransky <stransky@redhat.com>
date: Fri Jul 31 13:39:48 2020 +0200
files: dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h
description:
Bug 1645671 [Linux/VA-API] Create DMABufSurfaceWrapper directly at nsTAttay and disable DMABufSurfaceWrapper class copy and assignment constructors, r?jya
When DMABufSurfaceWrapper is added to nsTArray, a temporary local DMABufSurfaceWrapper object is created. When the temporary
object is deleted after the adding, associated dmabuf data is released which leads to rendering artifact during VA-API video playback.
As a fix in this patch we create DMABufSurfaceWrapper 'in-place' at nsTAttay.
We also disable DMABufSurfaceWrapper class copy and assignment constructors to avoid similar potential issues.
Differential Revision: https://phabricator.services.mozilla.com/D85152
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
@@ -777,17 +777,17 @@ MediaResult FFmpegVideoDecoder<LIBAV_VER
RESULT_DETAIL("Unable to get DMABufSurfaceYUV"));
}
# ifdef MOZ_LOGGING
static int uid = 0;
surface->SetUID(++uid);
FFMPEG_LOG("Created new DMABufSurface UID = %d", uid);
# endif
- mDMABufSurfaces.AppendElement(DMABufSurfaceWrapper(surface, mLib));
+ mDMABufSurfaces.EmplaceBack(surface, mLib);
surfaceWrapper = &(mDMABufSurfaces[mDMABufSurfaces.Length() - 1]);
} else {
surface = surfaceWrapper->GetDMABufSurface();
bool ret;
if (mVAAPIDeviceContext) {
ret = surface->UpdateYUVData(vaDesc);
} else {
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
@@ -70,16 +70,22 @@ class DMABufSurfaceWrapper final {
// Check if DMABufSurface is used by any gecko rendering process
// (WebRender or GL compositor) or by DMABUFSurfaceImage/VideoData.
bool IsUsed() const { return mSurface->IsGlobalRefSet(); }
RefPtr<DMABufSurfaceYUV> GetDMABufSurface() const {
return mSurface->GetAsDMABufSurfaceYUV();
}
+ // Don't allow DMABufSurfaceWrapper plain copy as it leads to
+ // enexpected DMABufSurface/HW buffer releases and we don't want to
+ // deep copy them.
+ DMABufSurfaceWrapper(const DMABufSurfaceWrapper&) = delete;
+ const DMABufSurfaceWrapper& operator=(DMABufSurfaceWrapper const&) = delete;
+
private:
const RefPtr<DMABufSurface> mSurface;
const FFmpegLibWrapper* mLib;
AVBufferRef* mAVHWFramesContext;
AVBufferRef* mHWAVBuffer;
};
#endif

28
mozilla-1656436.patch Normal file
View File

@ -0,0 +1,28 @@
diff -up firefox-79.0/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp.mozilla-1656436 firefox-79.0/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
--- firefox-79.0/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp.mozilla-1656436 2020-08-04 13:31:49.476663242 +0200
+++ firefox-79.0/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp 2020-08-04 13:32:28.201448682 +0200
@@ -766,6 +766,11 @@ MediaResult FFmpegVideoDecoder<LIBAV_VER
mDMABufSurfaces.EmplaceBack(surface, mLib);
surfaceWrapper = &(mDMABufSurfaces[mDMABufSurfaces.Length() - 1]);
} else {
+ // Release VAAPI surface data before we reuse it.
+ if (mVAAPIDeviceContext) {
+ surfaceWrapper->ReleaseVAAPIData();
+ }
+
surface = surfaceWrapper->GetDMABufSurface();
bool ret;
diff -up firefox-79.0/widget/gtk/DMABufSurface.cpp.mozilla-1656436 firefox-79.0/widget/gtk/DMABufSurface.cpp
--- firefox-79.0/widget/gtk/DMABufSurface.cpp.mozilla-1656436 2020-08-04 13:31:49.477663237 +0200
+++ firefox-79.0/widget/gtk/DMABufSurface.cpp 2020-08-04 13:33:07.666230023 +0200
@@ -744,7 +744,8 @@ bool DMABufSurfaceYUV::UpdateYUVData(con
return false;
}
if (mDmabufFds[0] >= 0) {
- ReleaseSurface();
+ NS_WARNING("DMABufSurfaceYUV is already created!");
+ return false;
}
mSurfaceFormat = gfx::SurfaceFormat::NV12;

View File

@ -1,11 +0,0 @@
--- a/layout/generic/nsIFrame.h.old 2016-07-11 13:41:39.688276559 +0200
+++ b/layout/generic/nsIFrame.h 2016-07-11 13:42:12.791406976 +0200
@@ -13,7 +13,7 @@
#error This header/class should only be used within Mozilla code. It should not be used by extensions.
#endif
-#define MAX_REFLOW_DEPTH 200
+#define MAX_REFLOW_DEPTH 1000
/* nsIFrame is in the process of being deCOMtaminated, i.e., this file is eventually
going to be eliminated, and all callers will use nsFrame instead. At the moment

View File

@ -0,0 +1,2 @@
#!/bin/sh
exec /usr/bin/node "$@" 2>&1 | cat -

View File

@ -1,44 +0,0 @@
diff -ur firefox-62.0.3/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/lib.rs firefox-62.0.3-20200525/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/lib.rs
--- firefox-62.0.3/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/lib.rs 2018-10-02 02:35:25.000000000 +0800
+++ firefox-62.0.3-20200525/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/lib.rs 2020-05-22 12:46:32.000000000 +0800
@@ -636,11 +636,11 @@
}
pub trait USecExt {
- fn to_bytes(self, spec: &SampleSpec) -> usize;
+ fn use_to_bytes(self, spec: &SampleSpec) -> usize;
}
impl USecExt for USec {
- fn to_bytes(self, spec: &SampleSpec) -> usize {
+ fn use_to_bytes(self, spec: &SampleSpec) -> usize {
unsafe { ffi::pa_usec_to_bytes(self, spec) }
}
}
diff -ur firefox-62.0.3/media/libcubeb/cubeb-pulse-rs/src/backend/stream.rs firefox-62.0.3-20200525/media/libcubeb/cubeb-pulse-rs/src/backend/stream.rs
--- firefox-62.0.3/media/libcubeb/cubeb-pulse-rs/src/backend/stream.rs 2018-10-02 02:35:24.000000000 +0800
+++ firefox-62.0.3-20200525/media/libcubeb/cubeb-pulse-rs/src/backend/stream.rs 2020-05-22 12:49:15.000000000 +0800
@@ -438,7 +438,7 @@
let stm = self.output_stream.as_ref().unwrap();
let r = match stm.get_time() {
Ok(r_usec) => {
- let bytes = r_usec.to_bytes(&self.output_sample_spec);
+ let bytes = r_usec.use_to_bytes(&self.output_sample_spec);
Ok((bytes / self.output_sample_spec.frame_size()) as u64)
}
Err(_) => Err(Error::error()),
diff -ur firefox-62.0.3/xpcom/base/Logging.h firefox-62.0.3-20200525/xpcom/base/Logging.h
--- firefox-62.0.3/xpcom/base/Logging.h 2018-10-02 02:35:35.000000000 +0800
+++ firefox-62.0.3-20200525/xpcom/base/Logging.h 2020-05-22 16:51:42.480111146 +0800
@@ -247,6 +247,11 @@
// MOZ_LOG even when logging is disabled to ensure the compiler sees that
// variables only used during logging code are actually used, even if the
// code will never be executed.) Hence, the following code.
+#if defined(__GNUC__)
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wformat-security"
+#endif
+
#if MOZ_LOGGING_ENABLED
#define MOZ_LOG(_module,_level,_args) \
do { \

113
pgo.patch Normal file
View File

@ -0,0 +1,113 @@
diff -up firefox-77.0.1/build/moz.configure/lto-pgo.configure.pgo firefox-77.0.1/build/moz.configure/lto-pgo.configure
--- firefox-77.0.1/build/moz.configure/lto-pgo.configure.pgo 2020-06-03 01:35:41.000000000 +0200
+++ firefox-77.0.1/build/moz.configure/lto-pgo.configure 2020-06-23 14:39:38.716560329 +0200
@@ -69,12 +69,14 @@ set_config('PGO_PROFILE_PATH', pgo_profi
@imports(_from='__builtin__', _import='min')
def pgo_flags(compiler, profdata, target_is_windows):
if compiler.type == 'gcc':
+ #profile_use = '-fprofile-use=$(topobjdir)'
+ profile_use = '-fprofile-use'
return namespace(
gen_cflags=['-fprofile-generate'],
gen_ldflags=['-fprofile-generate'],
- use_cflags=['-fprofile-use', '-fprofile-correction',
+ use_cflags=[profile_use, '-fprofile-correction',
'-Wcoverage-mismatch'],
- use_ldflags=['-fprofile-use'],
+ use_ldflags=[profile_use],
)
if compiler.type in ('clang-cl', 'clang'):
diff -up firefox-77.0.1/build/pgo/profileserver.py.pgo firefox-77.0.1/build/pgo/profileserver.py
--- firefox-77.0.1/build/pgo/profileserver.py.pgo 2020-06-03 03:04:50.000000000 +0200
+++ firefox-77.0.1/build/pgo/profileserver.py 2020-06-23 14:53:56.877736235 +0200
@@ -11,7 +11,7 @@ import glob
import subprocess
import mozcrash
-from mozbuild.base import MozbuildObject, BinaryNotFoundException
+from mozbuild.base import MozbuildObject, BinaryNotFoundException, BuildEnvironmentNotFoundException
from mozfile import TemporaryDirectory
from mozhttpd import MozHttpd
from mozprofile import FirefoxProfile, Preferences
@@ -84,9 +84,22 @@ if __name__ == '__main__':
port=PORT,
options='primary,privileged')
- old_profraw_files = glob.glob('*.profraw')
- for f in old_profraw_files:
- os.remove(f)
+ using_gcc = False
+ try:
+ if build.config_environment.substs.get('CC_TYPE') == 'gcc':
+ using_gcc = True
+ except BuildEnvironmentNotFoundException:
+ pass
+
+ if using_gcc:
+ for dirpath, _, filenames in os.walk('.'):
+ for f in filenames:
+ if f.endswith('.gcda'):
+ os.remove(os.path.join(dirpath, f))
+ else:
+ old_profraw_files = glob.glob('*.profraw')
+ for f in old_profraw_files:
+ os.remove(f)
with TemporaryDirectory() as profilePath:
# TODO: refactor this into mozprofile
@@ -191,6 +204,11 @@ if __name__ == '__main__':
print("Firefox exited successfully, but produced a crashreport")
sys.exit(1)
+
+ print('Copying profile data....')
+ os.system('pwd');
+ os.system('tar cf profdata.tar.gz `find . -name "*.gcda"`; cd ..; tar xf instrumented/profdata.tar.gz;');
+
llvm_profdata = env.get('LLVM_PROFDATA')
if llvm_profdata:
profraw_files = glob.glob('*.profraw')
diff -up firefox-77.0.1/build/unix/mozconfig.unix.pgo firefox-77.0.1/build/unix/mozconfig.unix
--- firefox-77.0.1/build/unix/mozconfig.unix.pgo 2020-06-03 01:35:41.000000000 +0200
+++ firefox-77.0.1/build/unix/mozconfig.unix 2020-06-23 14:39:38.716560329 +0200
@@ -6,6 +6,15 @@ if [ -n "$FORCE_GCC" ]; then
CC="$MOZ_FETCHES_DIR/gcc/bin/gcc"
CXX="$MOZ_FETCHES_DIR/gcc/bin/g++"
+ if [ -n "$MOZ_PGO" ]; then
+ if [ -z "$USE_ARTIFACT" ]; then
+ ac_add_options --enable-lto
+ fi
+ export AR="$topsrcdir/gcc/bin/gcc-ar"
+ export NM="$topsrcdir/gcc/bin/gcc-nm"
+ export RANLIB="$topsrcdir/gcc/bin/gcc-ranlib"
+ fi
+
# We want to make sure we use binutils and other binaries in the tooltool
# package.
mk_add_options "export PATH=$MOZ_FETCHES_DIR/gcc/bin:$PATH"
diff -up firefox-77.0.1/config/config.mk.pgo firefox-77.0.1/config/config.mk
diff -up firefox-77.0.1/extensions/spellcheck/src/moz.build.pgo firefox-77.0.1/extensions/spellcheck/src/moz.build
--- firefox-77.0.1/extensions/spellcheck/src/moz.build.pgo 2020-06-03 01:35:48.000000000 +0200
+++ firefox-77.0.1/extensions/spellcheck/src/moz.build 2020-06-23 14:39:38.717560324 +0200
@@ -31,3 +31,5 @@ EXPORTS.mozilla += [
if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
CXXFLAGS += ['-Wno-error=shadow']
+
+CXXFLAGS += ['-fno-devirtualize']
\ No newline at end of file
diff -up firefox-77.0.1/python/mozbuild/mozbuild/build_commands.py.pgo firefox-77.0.1/python/mozbuild/mozbuild/build_commands.py
--- firefox-77.0.1/python/mozbuild/mozbuild/build_commands.py.pgo 2020-06-03 01:36:46.000000000 +0200
+++ firefox-77.0.1/python/mozbuild/mozbuild/build_commands.py 2020-06-23 14:39:38.717560324 +0200
@@ -114,7 +114,8 @@ class Build(MachCommandBase):
return status
pgo_env = os.environ.copy()
- pgo_env['LLVM_PROFDATA'] = instr.config_environment.substs.get('LLVM_PROFDATA')
+ if instr.config_environment.substs.get('CC_TYPE') != 'gcc':
+ pgo_env['LLVM_PROFDATA'] = instr.config_environment.substs.get('LLVM_PROFDATA')
pgo_env['JARLOG_FILE'] = mozpath.join(orig_topobjdir, 'jarlog/en-US.log')
pgo_cmd = [
instr.virtualenv_manager.python_path,

View File

@ -1,12 +1,12 @@
diff -up mozilla-esr31/extensions/auth/nsAuthSambaNTLM.cpp.old mozilla-esr31/extensions/auth/nsAuthSambaNTLM.cpp diff -up firefox-60.5.0/extensions/auth/nsAuthSambaNTLM.cpp.rhbz-1173156 firefox-60.5.0/extensions/auth/nsAuthSambaNTLM.cpp
--- mozilla-esr31/extensions/auth/nsAuthSambaNTLM.cpp.old 2014-11-25 12:23:22.000000000 +0100 --- firefox-60.5.0/extensions/auth/nsAuthSambaNTLM.cpp.rhbz-1173156 2019-01-22 10:36:09.284069020 +0100
+++ mozilla-esr31/extensions/auth/nsAuthSambaNTLM.cpp 2014-12-23 15:26:36.606674625 +0100 +++ firefox-60.5.0/extensions/auth/nsAuthSambaNTLM.cpp 2019-01-22 10:37:12.669757744 +0100
@@ -174,7 +174,7 @@ nsAuthSambaNTLM::SpawnNTLMAuthHelper() @@ -161,7 +161,7 @@ nsresult nsAuthSambaNTLM::SpawnNTLMAuthH
return NS_ERROR_FAILURE; const char* username = PR_GetEnv("USER");
if (!username) return NS_ERROR_FAILURE;
const char* const args[] = { - const char* const args[] = {"ntlm_auth",
- "ntlm_auth", + const char* const args[] = {"/usr/bin/ntlm_auth",
+ "/usr/bin/ntlm_auth", "--helper-protocol",
"--helper-protocol", "ntlmssp-client-1", "ntlmssp-client-1",
"--use-cached-creds", "--use-cached-creds",
"--username", username,

View File

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

View File

@ -1,12 +1,12 @@
diff -up firefox-53.0/layout/base/nsIPresShell.h.1354671 firefox-53.0/layout/base/nsIPresShell.h diff -up firefox-70.0/layout/base/PresShell.h.1354671 firefox-70.0/layout/base/PresShell.h
--- firefox-53.0/layout/base/nsIPresShell.h.1354671 2017-04-27 13:07:43.808653320 +0200 --- firefox-70.0/layout/base/PresShell.h.1354671 2019-10-22 12:33:12.987775587 +0200
+++ firefox-53.0/layout/base/nsIPresShell.h 2017-04-27 13:09:40.404427641 +0200 +++ firefox-70.0/layout/base/PresShell.h 2019-10-22 12:36:39.999366086 +0200
@@ -212,7 +212,7 @@ public: @@ -257,7 +257,7 @@ class PresShell final : public nsStubDoc
* to the same aSize value. AllocateFrame is infallible and will abort * to the same aSize value. AllocateFrame is infallible and will abort
* on out-of-memory. * on out-of-memory.
*/ */
- void* AllocateFrame(nsQueryFrame::FrameIID aID, size_t aSize) - void* AllocateFrame(nsQueryFrame::FrameIID aID, size_t aSize) {
+ void* __attribute__((optimize("no-lifetime-dse"))) AllocateFrame(nsQueryFrame::FrameIID aID, size_t aSize) + void* __attribute__((optimize("no-lifetime-dse"))) AllocateFrame(nsQueryFrame::FrameIID aID, size_t aSize) {
{ #define FRAME_ID(classname, ...) \
void* result = mFrameArena.AllocateByFrameID(aID, aSize); static_assert(size_t(nsQueryFrame::FrameIID::classname##_id) == \
RecordAlloc(result); size_t(eArenaObjectID_##classname), \

View File

@ -1,68 +0,0 @@
diff --git a/third_party/rust/cssparser/src/parser.rs b/third_party/rust/cssparser/src/parser.rs
index 76736a8..83acaa6 100644
--- a/third_party/rust/cssparser/src/parser.rs
+++ b/third_party/rust/cssparser/src/parser.rs
@@ -555,28 +555,34 @@ impl<'i: 't, 't> Parser<'i, 't> {
}
let token_start_position = self.input.tokenizer.position();
- let token;
- match self.input.cached_token {
- Some(ref cached_token)
- if cached_token.start_position == token_start_position => {
- self.input.tokenizer.reset(&cached_token.end_state);
- match cached_token.token {
- Token::Function(ref name) => self.input.tokenizer.see_function(name),
- _ => {}
- }
- token = &cached_token.token
- }
- _ => {
- let new_token = self.input.tokenizer.next()
- .map_err(|()| self.new_basic_error(BasicParseErrorKind::EndOfInput))?;
- self.input.cached_token = Some(CachedToken {
- token: new_token,
- start_position: token_start_position,
- end_state: self.input.tokenizer.state(),
- });
- token = self.input.cached_token_ref()
+ let using_cached_token = self
+ .input
+ .cached_token
+ .as_ref()
+ .map_or(false, |cached_token| {
+ cached_token.start_position == token_start_position
+ });
+ let token = if using_cached_token {
+ let cached_token = self.input.cached_token.as_ref().unwrap();
+ self.input.tokenizer.reset(&cached_token.end_state);
+ match cached_token.token {
+ Token::Function(ref name) => self.input.tokenizer.see_function(name),
+ _ => {}
}
- }
+ &cached_token.token
+ } else {
+ let new_token = self
+ .input
+ .tokenizer
+ .next()
+ .map_err(|()| self.new_basic_error(BasicParseErrorKind::EndOfInput))?;
+ self.input.cached_token = Some(CachedToken {
+ token: new_token,
+ start_position: token_start_position,
+ end_state: self.input.tokenizer.state(),
+ });
+ self.input.cached_token_ref()
+ };
if let Some(block_type) = BlockType::opening(token) {
self.at_start_of = Some(block_type);
diff --git a/third_party/rust/cssparser/.cargo-checksum.json b/third_party/rust/cssparser/.cargo-checksum.json
index 48ec8cc..7debeb8 100644
--- a/third_party/rust/cssparser/.cargo-checksum.json
+++ b/third_party/rust/cssparser/.cargo-checksum.json
@@ -1 +1 @@
-{"files":{".travis.yml":"e8f586288c39dbaebefdd391f68376e58f3a4c568a8dc3cd97c4a362194716dd","Cargo.toml":"007ec70e8421e1889e8f28645d08967af29fdc2fbafa520f2b50a636de09e528","LICENSE":"fab3dd6bdab226f1c08630b1dd917e11fcb4ec5e1e020e2c16f83a0a13863e85","README.md":"c5781e673335f37ed3d7acb119f8ed33efdf6eb75a7094b7da2abe0c3230adb8","build.rs":"ce686e87cccb6aa85a8cd34688d809398c5a624f179fd9a172d1049892da3f4c","build/match_byte.rs":"0f7d39170e746d59deebf7894086f63ee39ea61fb161d24b0c7a3c1db3945e0d","docs/.nojekyll":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","docs/404.html":"025861f76f8d1f6d67c20ab624c6e418f4f824385e2dd8ad8732c4ea563c6a2e","docs/index.html":"025861f76f8d1f6d67c20ab624c6e418f4f824385e2dd8ad8732c4ea563c6a2e","src/color.rs":"c60f1b0ab7a2a6213e434604ee33f78e7ef74347f325d86d0b9192d8225ae1cc","src/cow_rc_str.rs":"541216f8ef74ee3cc5cbbc1347e5f32ed66588c401851c9a7d68b867aede1de0","src/from_bytes.rs":"331fe63af2123ae3675b61928a69461b5ac77799fff3ce9978c55cf2c558f4ff","src/lib.rs":"a474ee88ef8f73fcb7b7272d426e5eafb4ad10d104797a5a188d1676c8180972","src/macros.rs":"adb9773c157890381556ea83d7942dcc676f99eea71abbb6afeffee1e3f28960","src/nth.rs":"5c70fb542d1376cddab69922eeb4c05e4fcf8f413f27563a2af50f72a47c8f8c","src/parser.rs":"9ed4aec998221eb2d2ba99db2f9f82a02399fb0c3b8500627f68f5aab872adde","src/rules_and_declarations.rs":"be2c4f3f3bb673d866575b6cb6084f1879dff07356d583ca9a3595f63b7f916f","src/serializer.rs":"3e2dfc60613f885cb6f99abfc854fde2a1e00de507431bd2e51178b61abfd69b","src/size_of_tests.rs":"e5f63c8c18721cc3ff7a5407e84f9889ffa10e66da96e8510a696c3e00ad72d5","src/tests.rs":"80b02c80ab0fd580dad9206615c918e0db7dff63dfed0feeedb66f317d24b24b","src/tokenizer.rs":"429b2cba419cf8b923fbcc32d3bd34c0b39284ebfcb9fc29b8eb8643d8d5f312","src/unicode_range.rs":"191d50a1588e5c88608b84cfe9279def71f495f8e016fa093f90399bbd2b635f"},"package":"205647ffe2b63a9726a4c3bb6f31c7325e8ceff10e2f1b75a6fb7609e20419ea"}
\ No newline at end of file
+{"files":{".travis.yml":"e8f586288c39dbaebefdd391f68376e58f3a4c568a8dc3cd97c4a362194716dd","Cargo.toml":"007ec70e8421e1889e8f28645d08967af29fdc2fbafa520f2b50a636de09e528","LICENSE":"fab3dd6bdab226f1c08630b1dd917e11fcb4ec5e1e020e2c16f83a0a13863e85","README.md":"c5781e673335f37ed3d7acb119f8ed33efdf6eb75a7094b7da2abe0c3230adb8","build.rs":"ce686e87cccb6aa85a8cd34688d809398c5a624f179fd9a172d1049892da3f4c","build/match_byte.rs":"0f7d39170e746d59deebf7894086f63ee39ea61fb161d24b0c7a3c1db3945e0d","docs/.nojekyll":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","docs/404.html":"025861f76f8d1f6d67c20ab624c6e418f4f824385e2dd8ad8732c4ea563c6a2e","docs/index.html":"025861f76f8d1f6d67c20ab624c6e418f4f824385e2dd8ad8732c4ea563c6a2e","src/color.rs":"c60f1b0ab7a2a6213e434604ee33f78e7ef74347f325d86d0b9192d8225ae1cc","src/cow_rc_str.rs":"541216f8ef74ee3cc5cbbc1347e5f32ed66588c401851c9a7d68b867aede1de0","src/from_bytes.rs":"331fe63af2123ae3675b61928a69461b5ac77799fff3ce9978c55cf2c558f4ff","src/lib.rs":"a474ee88ef8f73fcb7b7272d426e5eafb4ad10d104797a5a188d1676c8180972","src/macros.rs":"adb9773c157890381556ea83d7942dcc676f99eea71abbb6afeffee1e3f28960","src/nth.rs":"5c70fb542d1376cddab69922eeb4c05e4fcf8f413f27563a2af50f72a47c8f8c","src/parser.rs":"6bd16e08c29cb31c358f3cfeb9c6659227f24a95d399c14cf969c8b1a0e931fd","src/rules_and_declarations.rs":"be2c4f3f3bb673d866575b6cb6084f1879dff07356d583ca9a3595f63b7f916f","src/serializer.rs":"3e2dfc60613f885cb6f99abfc854fde2a1e00de507431bd2e51178b61abfd69b","src/size_of_tests.rs":"e5f63c8c18721cc3ff7a5407e84f9889ffa10e66da96e8510a696c3e00ad72d5","src/tests.rs":"80b02c80ab0fd580dad9206615c918e0db7dff63dfed0feeedb66f317d24b24b","src/tokenizer.rs":"429b2cba419cf8b923fbcc32d3bd34c0b39284ebfcb9fc29b8eb8643d8d5f312","src/unicode_range.rs":"191d50a1588e5c88608b84cfe9279def71f495f8e016fa093f90399bbd2b635f"},"package":"205647ffe2b63a9726a4c3bb6f31c7325e8ceff10e2f1b75a6fb7609e20419ea"}

BIN
testing.tar.xz Normal file

Binary file not shown.