aboutsummaryrefslogtreecommitdiffstats
path: root/mail/thunderbird
diff options
context:
space:
mode:
authorjbeich <jbeich@FreeBSD.org>2019-01-24 08:53:45 +0800
committerjbeich <jbeich@FreeBSD.org>2019-01-24 08:53:45 +0800
commit7d44a24992ac1c8f3e1d347d873f56ca1e3e358f (patch)
tree329ae9258e2749a4bf9447beaf79465cf47a1677 /mail/thunderbird
parent18c1573606ea25672a2f024647fadb2ab7ded156 (diff)
downloadfreebsd-ports-gnome-7d44a24992ac1c8f3e1d347d873f56ca1e3e358f.tar.gz
freebsd-ports-gnome-7d44a24992ac1c8f3e1d347d873f56ca1e3e358f.tar.zst
freebsd-ports-gnome-7d44a24992ac1c8f3e1d347d873f56ca1e3e358f.zip
mail/thunderbird: update to 60.5.0
Changes: https://www.thunderbird.net/thunderbird/60.5.0/releasenotes/ PR: 235161 Submitted by: cmt Security: b1f7d52f-fc42-48e8-8403-87d4c9d26229
Diffstat (limited to 'mail/thunderbird')
-rw-r--r--mail/thunderbird/Makefile7
-rw-r--r--mail/thunderbird/distinfo6
-rw-r--r--mail/thunderbird/files/patch-bug137507451
-rw-r--r--mail/thunderbird/files/patch-bug141148158
-rw-r--r--mail/thunderbird/files/patch-bug1438678312
-rw-r--r--mail/thunderbird/files/patch-bug144258322
-rw-r--r--mail/thunderbird/files/patch-bug144735948
-rw-r--r--mail/thunderbird/files/patch-bug145129218
-rw-r--r--mail/thunderbird/files/patch-bug145655612
-rw-r--r--mail/thunderbird/files/patch-bug150085026
-rw-r--r--mail/thunderbird/files/patch-z-bug1436911899
11 files changed, 703 insertions, 756 deletions
diff --git a/mail/thunderbird/Makefile b/mail/thunderbird/Makefile
index 864e976d2fde..7d29d9bca885 100644
--- a/mail/thunderbird/Makefile
+++ b/mail/thunderbird/Makefile
@@ -2,18 +2,17 @@
# $FreeBSD$
PORTNAME= thunderbird
-DISTVERSION= 60.4.0
-PORTREVISION= 3
+DISTVERSION= 60.5.0
CATEGORIES= mail news net-im ipv6
MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \
- MOZILLA/${PORTNAME}/candidates/${DISTVERSION}-candidates/build1/source
+ MOZILLA/${PORTNAME}/candidates/${DISTVERSION}-candidates/build2/source
DISTFILES= ${DISTNAME}.source${EXTRACT_SUFX}
MAINTAINER= gecko@FreeBSD.org
COMMENT= Mozilla Thunderbird is standalone mail and news that stands above
BUILD_DEPENDS= nspr>=4.19:devel/nspr \
- nss>=3.36.1:security/nss \
+ nss>=3.36.7:security/nss \
icu>=59.1,1:devel/icu \
libevent>=2.1.8:devel/libevent \
harfbuzz>=1.7.6:print/harfbuzz \
diff --git a/mail/thunderbird/distinfo b/mail/thunderbird/distinfo
index 8885e2c2ed75..efec9a2204c3 100644
--- a/mail/thunderbird/distinfo
+++ b/mail/thunderbird/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1545056672
-SHA256 (thunderbird-60.4.0.source.tar.xz) = 27a6cdd9cfdd7ce70b1d193c64739db6be6b39eec308f0122d8472a6cd243e75
-SIZE (thunderbird-60.4.0.source.tar.xz) = 284938284
+TIMESTAMP = 1548237843
+SHA256 (thunderbird-60.5.0.source.tar.xz) = 6f96e87e832e4089c69418db64e19afd54a0acefe3e0364087a8bc6f442b9566
+SIZE (thunderbird-60.5.0.source.tar.xz) = 285636196
diff --git a/mail/thunderbird/files/patch-bug1375074 b/mail/thunderbird/files/patch-bug1375074
index cede1e474e22..7289d1e34a86 100644
--- a/mail/thunderbird/files/patch-bug1375074
+++ b/mail/thunderbird/files/patch-bug1375074
@@ -40,43 +40,44 @@ diff --git js/src/vm/UnboxedObject.cpp js/src/vm/UnboxedObject.cpp
index c8c178965c488..5badf328ede4f 100644
--- js/src/vm/UnboxedObject.cpp
+++ js/src/vm/UnboxedObject.cpp
-@@ -95,7 +95,15 @@ UnboxedLayout::makeConstructorCode(JSContext* cx, HandleObjectGroup group)
+@@ -86,8 +86,15 @@ static const uintptr_t CLEAR_CONSTRUCTOR_CODE_TOKEN =
#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));
+- // 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();
++ // Initialize the PSP from the SP.
+ masm.initStackPtr();
#endif
-@@ -233,7 +241,22 @@ UnboxedLayout::makeConstructorCode(JSContext* cx, HandleObjectGroup group)
- masm.pop(ScratchDoubleReg);
- masm.PopRegsInMask(savedNonVolatileRegisters);
+@@ -239,7 +246,22 @@ static const uintptr_t CLEAR_CONSTRUCTOR_CODE_TOKEN =
+ if (ScratchDoubleReg.volatile_()) masm.pop(ScratchDoubleReg);
+ masm.PopRegsInMask(savedNonVolatileRegisters);
+#ifdef JS_CODEGEN_ARM64
-+ // Now restore the value that was in the PSP register on entry, and return.
++ // 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);
++ // 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));
++ // 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);
++ // Perform a plain Ret(), as abiret() will move SP <- PSP and that is wrong.
++ masm.Ret(vixl::lr);
+#else
- masm.abiret();
+ masm.abiret();
+#endif
- masm.bind(&failureStoreOther);
+ masm.bind(&failureStoreOther);
diff --git a/mail/thunderbird/files/patch-bug1411481 b/mail/thunderbird/files/patch-bug1411481
index d8e9992e264b..10ee86b96544 100644
--- a/mail/thunderbird/files/patch-bug1411481
+++ b/mail/thunderbird/files/patch-bug1411481
@@ -15,71 +15,69 @@ diff --git dom/canvas/CanvasRenderingContext2D.cpp dom/canvas/CanvasRenderingCon
index ef3f868bdbf7..8666564b4d0c 100644
--- dom/canvas/CanvasRenderingContext2D.cpp
+++ dom/canvas/CanvasRenderingContext2D.cpp
-@@ -1438,7 +1438,8 @@ CanvasRenderingContext2D::AllowOpenGLCanvas() const
+@@ -1358,7 +1358,8 @@ bool CanvasRenderingContext2D::AllowOpenGLCanvas() con
// HTMLCanvasElement::GetCompositorBackendType would return LAYERS_NONE
// as well, so it wouldn't help much.
- return (mCompositorBackend == LayersBackend::LAYERS_OPENGL) &&
+ return (mCompositorBackend == LayersBackend::LAYERS_OPENGL ||
+ mCompositorBackend == LayersBackend::LAYERS_WR) &&
- gfxPlatform::GetPlatform()->AllowOpenGLCanvas();
+ gfxPlatform::GetPlatform()->AllowOpenGLCanvas();
}
diff --git gfx/thebes/gfxPlatform.cpp gfx/thebes/gfxPlatform.cpp
index b9beea68d8c5..82635f9ab3ce 100644
--- gfx/thebes/gfxPlatform.cpp
+++ gfx/thebes/gfxPlatform.cpp
-@@ -1386,7 +1386,8 @@ bool gfxPlatform::AllowOpenGLCanvas()
- // so we let content process always assume correct compositor backend.
+@@ -1341,7 +1341,8 @@ bool gfxPlatform::AllowOpenGLCanvas() {
// The callers have to do the right thing.
- bool correctBackend = !XRE_IsParentProcess() ||
-- ((mCompositorBackend == LayersBackend::LAYERS_OPENGL) &&
-+ ((mCompositorBackend == LayersBackend::LAYERS_OPENGL ||
-+ mCompositorBackend == LayersBackend::LAYERS_WR) &&
- (GetContentBackendFor(mCompositorBackend) == BackendType::SKIA));
+ bool correctBackend =
+ !XRE_IsParentProcess() ||
+- ((mCompositorBackend == LayersBackend::LAYERS_OPENGL) &&
++ ((mCompositorBackend == LayersBackend::LAYERS_OPENGL ||
++ mCompositorBackend == LayersBackend::LAYERS_WR) &&
+ (GetContentBackendFor(mCompositorBackend) == BackendType::SKIA));
if (gfxPrefs::CanvasAzureAccelerated() && correctBackend) {
diff --git gfx/thebes/gfxPlatform.h gfx/thebes/gfxPlatform.h
index c988eb1168a8..3bbf2b763f26 100644
--- gfx/thebes/gfxPlatform.h
+++ gfx/thebes/gfxPlatform.h
-@@ -286,7 +286,7 @@ public:
- /// asking for it, we will examine the commands in the first few seconds
- /// of the canvas usage, and potentially change to accelerated or
- /// non-accelerated canvas.
-- bool AllowOpenGLCanvas();
-+ virtual bool AllowOpenGLCanvas();
- virtual void InitializeSkiaCacheLimits();
+@@ -265,7 +265,7 @@ class gfxPlatform {
+ /// asking for it, we will examine the commands in the first few seconds
+ /// of the canvas usage, and potentially change to accelerated or
+ /// non-accelerated canvas.
+- bool AllowOpenGLCanvas();
++ virtual bool AllowOpenGLCanvas();
+ virtual void InitializeSkiaCacheLimits();
- static bool AsyncPanZoomEnabled();
+ static bool AsyncPanZoomEnabled();
diff --git gfx/thebes/gfxWindowsPlatform.cpp gfx/thebes/gfxWindowsPlatform.cpp
index 9ba6f40c6cc0..4d65791d075f 100644
--- gfx/thebes/gfxWindowsPlatform.cpp
+++ gfx/thebes/gfxWindowsPlatform.cpp
-@@ -509,6 +509,13 @@ gfxWindowsPlatform::UpdateRenderMode()
+@@ -466,6 +466,11 @@ void gfxWindowsPlatform::UpdateRenderMode() {
}
}
-+bool
-+gfxWindowsPlatform::AllowOpenGLCanvas()
-+{
++bool gfxWindowsPlatform::AllowOpenGLCanvas() {
+ // OpenGL canvas is not supported on windows
+ return false;
+}
+
- mozilla::gfx::BackendType
- gfxWindowsPlatform::GetContentBackendFor(mozilla::layers::LayersBackend aLayers)
- {
+ mozilla::gfx::BackendType gfxWindowsPlatform::GetContentBackendFor(
+ mozilla::layers::LayersBackend aLayers) {
+ mozilla::gfx::BackendType defaultBackend =
diff --git gfx/thebes/gfxWindowsPlatform.h gfx/thebes/gfxWindowsPlatform.h
index 47048de8f5f5..47ec0e9e5547 100644
--- gfx/thebes/gfxWindowsPlatform.h
+++ gfx/thebes/gfxWindowsPlatform.h
-@@ -174,6 +174,8 @@ public:
- void SchedulePaintIfDeviceReset() override;
- void CheckForContentOnlyDeviceReset();
+@@ -171,6 +171,8 @@ class gfxWindowsPlatform : public gfxPlatform {
+ void SchedulePaintIfDeviceReset() override;
+ void CheckForContentOnlyDeviceReset();
-+ bool AllowOpenGLCanvas() override;
++ bool AllowOpenGLCanvas() override;
+
- mozilla::gfx::BackendType GetContentBackendFor(mozilla::layers::LayersBackend aLayers) override;
+ mozilla::gfx::BackendType GetContentBackendFor(
+ mozilla::layers::LayersBackend aLayers) override;
- mozilla::gfx::BackendType GetPreferredCanvasBackend() override;
diff --git a/mail/thunderbird/files/patch-bug1438678 b/mail/thunderbird/files/patch-bug1438678
index 47e8dec9ad5b..9758b775eca9 100644
--- a/mail/thunderbird/files/patch-bug1438678
+++ b/mail/thunderbird/files/patch-bug1438678
@@ -82,7 +82,7 @@ index e27f3eedc1b1..60be7005354b 100644
#include "ContentParent.h"
#include "TabParent.h"
-@@ -1998,61 +1999,56 @@ ContentParent::LaunchSubprocess(ProcessPriority aInitialPriority /* = PROCESS_PR
+@@ -1857,64 +1858,56 @@ bool ContentParent::LaunchSubprocess(
extraArgs.push_back(idStr);
extraArgs.push_back(IsForBrowser() ? "-isForBrowser" : "-notForBrowser");
@@ -100,31 +100,34 @@ index e27f3eedc1b1..60be7005354b 100644
- for (unsigned int i = 0; i < prefsLen; i++) {
- const char* prefName = ContentPrefs::GetEarlyPref(i);
-- MOZ_ASSERT(i == 0 || strcmp(prefName, ContentPrefs::GetEarlyPref(i - 1)) > 0,
-- "Content process preferences should be sorted alphabetically.");
+- MOZ_ASSERT(
+- i == 0 || strcmp(prefName, ContentPrefs::GetEarlyPref(i - 1)) > 0,
+- "Content process preferences should be sorted alphabetically.");
-
- if (!Preferences::MustSendToContentProcesses(prefName)) {
- continue;
- }
-
- switch (Preferences::GetType(prefName)) {
-- case nsIPrefBranch::PREF_INT:
-- intPrefs.Append(nsPrintfCString("%u:%d|", i, Preferences::GetInt(prefName)));
-- break;
-- case nsIPrefBranch::PREF_BOOL:
-- boolPrefs.Append(nsPrintfCString("%u:%d|", i, Preferences::GetBool(prefName)));
-- break;
-- case nsIPrefBranch::PREF_STRING: {
-- nsAutoCString value;
-- Preferences::GetCString(prefName, value);
-- stringPrefs.Append(nsPrintfCString("%u:%d;%s|", i, value.Length(), value.get()));
-- }
-- break;
-- case nsIPrefBranch::PREF_INVALID:
-- break;
-- default:
-- printf("preference type: %x\n", Preferences::GetType(prefName));
-- MOZ_CRASH();
+- case nsIPrefBranch::PREF_INT:
+- intPrefs.Append(
+- nsPrintfCString("%u:%d|", i, Preferences::GetInt(prefName)));
+- break;
+- case nsIPrefBranch::PREF_BOOL:
+- boolPrefs.Append(
+- nsPrintfCString("%u:%d|", i, Preferences::GetBool(prefName)));
+- break;
+- case nsIPrefBranch::PREF_STRING: {
+- nsAutoCString value;
+- Preferences::GetCString(prefName, value);
+- stringPrefs.Append(
+- nsPrintfCString("%u:%d;%s|", i, value.Length(), value.get()));
+- } break;
+- case nsIPrefBranch::PREF_INVALID:
+- break;
+- default:
+- printf("preference type: %x\n", Preferences::GetType(prefName));
+- MOZ_CRASH();
- }
+ // Set up the shared memory.
+ base::SharedMemory shm;
@@ -133,12 +136,12 @@ index e27f3eedc1b1..60be7005354b 100644
+ NS_ERROR("failed to create shared memory in the parent");
+ MarkAsDead();
+ return false;
-+ }
+ }
+ if (!shm.Map(prefs.Length())) {
+ NS_ERROR("failed to map shared memory in the parent");
+ MarkAsDead();
+ return false;
- }
++ }
- nsCString schedulerPrefs = Scheduler::GetPrefs();
+ // Copy the serialized prefs into the shared memory.
@@ -164,7 +167,7 @@ index e27f3eedc1b1..60be7005354b 100644
+ mSubprocess->AddHandleToShare(prefsHandle);
+ extraArgs.push_back("-prefsHandle");
+ extraArgs.push_back(
-+ nsPrintfCString("%zu", reinterpret_cast<uintptr_t>(prefsHandle)).get());
++ nsPrintfCString("%zu", reinterpret_cast<uintptr_t>(prefsHandle)).get());
+#else
+ // In contrast, Unix fds are per-process. So remap the fd to a fixed one that
+ // will be used in the child.
@@ -175,18 +178,18 @@ index e27f3eedc1b1..60be7005354b 100644
+ // remapping so it doesn't get closed in the child.
+ mSubprocess->AddFdToRemap(shm.handle().fd, kPrefsFileDescriptor);
+#endif
-+
+
+ // Pass the length via a command flag.
+ extraArgs.push_back("-prefsLen");
+ extraArgs.push_back(nsPrintfCString("%zu", uintptr_t(prefs.Length())).get());
-
++
// Scheduler prefs need to be handled differently because the scheduler needs
// to start up in the content process before the normal preferences service.
+ nsCString schedulerPrefs = Scheduler::GetPrefs();
extraArgs.push_back("-schedulerPrefs");
extraArgs.push_back(schedulerPrefs.get());
-@@ -2061,6 +2057,7 @@ ContentParent::LaunchSubprocess(ProcessPriority aInitialPriority /* = PROCESS_PR
+@@ -1923,6 +1916,7 @@ bool ContentParent::LaunchSubprocess(
}
if (!mSubprocess->LaunchAndWaitForProcessHandle(extraArgs)) {
@@ -215,24 +218,18 @@ index e3c1f16910c6..2441c8cb9224 100644
#include "mozilla/SandboxSettings.h"
#include "nsAppDirectoryServiceDefs.h"
#include "nsDirectoryService.h"
-@@ -81,6 +82,16 @@ SetUpSandboxEnvironment()
+@@ -76,14 +77,21 @@ static void SetUpSandboxEnvironment() {
}
#endif
+#ifdef ANDROID
+static int gPrefsFd = -1;
+
-+void
-+SetPrefsFd(int aFd)
-+{
-+ gPrefsFd = aFd;
-+}
++void SetPrefsFd(int aFd) { gPrefsFd = aFd; }
+#endif
+
- bool
- ContentProcess::Init(int aArgc, char* aArgv[])
- {
-@@ -88,9 +99,10 @@ ContentProcess::Init(int aArgc, char* aArgv[])
+ bool ContentProcess::Init(int aArgc, char* aArgv[]) {
+ // If passed in grab the application path for xpcom init
bool foundAppdir = false;
bool foundChildID = false;
bool foundIsForBrowser = false;
@@ -246,7 +243,7 @@ index e3c1f16910c6..2441c8cb9224 100644
bool foundSchedulerPrefs = false;
uint64_t childID;
-@@ -103,7 +115,8 @@ ContentProcess::Init(int aArgc, char* aArgv[])
+@@ -96,7 +104,8 @@ bool ContentProcess::Init(int aArgc, char* aArgv[]) {
#endif
char* schedulerPrefs = nullptr;
@@ -256,17 +253,20 @@ index e3c1f16910c6..2441c8cb9224 100644
for (int idx = aArgc; idx > 0; idx--) {
if (!aArgv[idx]) {
continue;
-@@ -134,54 +147,24 @@ ContentProcess::Init(int aArgc, char* aArgv[])
+@@ -128,55 +137,24 @@ bool ContentProcess::Init(int aArgc, char* aArgv[]) {
}
isForBrowser = strcmp(aArgv[idx], "-notForBrowser");
foundIsForBrowser = true;
- } else if (!strcmp(aArgv[idx], "-intPrefs")) {
-- char* str = aArgv[idx + 1];
++#ifdef XP_WIN
++ } else if (!strcmp(aArgv[idx], "-prefsHandle")) {
+ char* str = aArgv[idx + 1];
- while (*str) {
- int32_t index = strtol(str, &str, 10);
- MOZ_ASSERT(str[0] == ':');
- str++;
-- MaybePrefValue value(PrefValue(static_cast<int32_t>(strtol(str, &str, 10))));
+- MaybePrefValue value(
+- PrefValue(static_cast<int32_t>(strtol(str, &str, 10))));
- MOZ_ASSERT(str[0] == '|');
- str++;
- // XXX: we assume these values as default values, which may not be
@@ -278,8 +278,14 @@ index e3c1f16910c6..2441c8cb9224 100644
- }
- foundIntPrefs = true;
- } else if (!strcmp(aArgv[idx], "-boolPrefs")) {
-+#ifdef XP_WIN
-+ } else if (!strcmp(aArgv[idx], "-prefsHandle")) {
++ MOZ_ASSERT(str[0] != '\0');
++ // ContentParent uses %zu to print a word-sized unsigned integer. So even
++ // though strtoull() returns a long long int, it will fit in a uintptr_t.
++ prefsHandle = reinterpret_cast<HANDLE>(strtoull(str, &str, 10));
++ MOZ_ASSERT(str[0] == '\0');
++ foundPrefsHandle = true;
++#endif
++ } else if (!strcmp(aArgv[idx], "-prefsLen")) {
char* str = aArgv[idx + 1];
- while (*str) {
- int32_t index = strtol(str, &str, 10);
@@ -294,15 +300,7 @@ index e3c1f16910c6..2441c8cb9224 100644
- }
- foundBoolPrefs = true;
- } else if (!strcmp(aArgv[idx], "-stringPrefs")) {
-+ MOZ_ASSERT(str[0] != '\0');
-+ // ContentParent uses %zu to print a word-sized unsigned integer. So even
-+ // though strtoull() returns a long long int, it will fit in a uintptr_t.
-+ prefsHandle = reinterpret_cast<HANDLE>(strtoull(str, &str, 10));
-+ MOZ_ASSERT(str[0] == '\0');
-+ foundPrefsHandle = true;
-+#endif
-+ } else if (!strcmp(aArgv[idx], "-prefsLen")) {
- char* str = aArgv[idx + 1];
+- char* str = aArgv[idx + 1];
- while (*str) {
- int32_t index = strtol(str, &str, 10);
- MOZ_ASSERT(str[0] == ':');
@@ -327,25 +325,22 @@ index e3c1f16910c6..2441c8cb9224 100644
} else if (!strcmp(aArgv[idx], "-schedulerPrefs")) {
schedulerPrefs = aArgv[idx + 1];
foundSchedulerPrefs = true;
-@@ -209,21 +192,43 @@ ContentProcess::Init(int aArgc, char* aArgv[])
- bool allFound = foundAppdir
- && foundChildID
- && foundIsForBrowser
-- && foundIntPrefs
-- && foundBoolPrefs
-- && foundStringPrefs
-- && foundSchedulerPrefs;
+@@ -201,19 +179,42 @@ bool ContentProcess::Init(int aArgc, char* aArgv[]) {
+ #endif /* XP_MACOSX && MOZ_CONTENT_SANDBOX */
+
+ bool allFound = foundAppdir && foundChildID && foundIsForBrowser &&
+- foundIntPrefs && foundBoolPrefs && foundStringPrefs &&
+- foundSchedulerPrefs;
-
-+ && foundPrefsLen
-+ && foundSchedulerPrefs
++ foundPrefsLen && foundSchedulerPrefs
+#ifdef XP_WIN
-+ && foundPrefsHandle
++ && foundPrefsHandle
+#endif
#if defined(XP_MACOSX) && defined(MOZ_CONTENT_SANDBOX)
- allFound &= foundProfile;
-+ && foundProfile
++ && foundProfile
#endif
-+ && true;
++ && true;
if (allFound) {
break;
@@ -376,13 +371,13 @@ index e3c1f16910c6..2441c8cb9224 100644
+ prefsLen);
+
Scheduler::SetPrefs(schedulerPrefs);
- mContent.Init(IOThreadChild::message_loop(),
- ParentPid(),
+ mContent.Init(IOThreadChild::message_loop(), ParentPid(),
+ IOThreadChild::channel(), childID, isForBrowser);
diff --git dom/ipc/ContentProcess.h dom/ipc/ContentProcess.h
index a3854c761e10..6582c94da496 100644
--- dom/ipc/ContentProcess.h
+++ dom/ipc/ContentProcess.h
-@@ -49,6 +49,11 @@ private:
+@@ -45,6 +45,11 @@ class ContentProcess : public mozilla::ipc::ProcessChi
DISALLOW_EVIL_CONSTRUCTORS(ContentProcess);
};
@@ -391,18 +386,19 @@ index a3854c761e10..6582c94da496 100644
+void SetPrefsFd(int aFd);
+#endif
+
- } // namespace dom
- } // namespace mozilla
+ } // namespace dom
+ } // namespace mozilla
diff --git ipc/chromium/src/base/process_util_win.cc ipc/chromium/src/base/process_util_win.cc
index 3ed54cd744ac..46667985cd71 100644
--- ipc/chromium/src/base/process_util_win.cc
+++ ipc/chromium/src/base/process_util_win.cc
-@@ -354,6 +354,10 @@ bool LaunchApp(const std::wstring& cmdline,
+@@ -320,6 +320,11 @@ bool LaunchApp(const std::wstring& cmdline, const Laun
LPPROC_THREAD_ATTRIBUTE_LIST lpAttributeList = NULL;
std::vector<HANDLE> handlesToInherit;
for (HANDLE h : options.handles_to_inherit) {
-+ if (SetHandleInformation(h, HANDLE_FLAG_INHERIT, HANDLE_FLAG_INHERIT) == 0) {
++ if (SetHandleInformation(h, HANDLE_FLAG_INHERIT, HANDLE_FLAG_INHERIT) ==
++ 0) {
+ MOZ_DIAGNOSTIC_ASSERT(false, "SetHandleInformation failed");
+ return false;
+ }
@@ -413,19 +409,19 @@ diff --git ipc/glue/GeckoChildProcessHost.cpp ipc/glue/GeckoChildProcessHost.cpp
index d18ed9edd4ca..3be1c51d10bb 100644
--- ipc/glue/GeckoChildProcessHost.cpp
+++ ipc/glue/GeckoChildProcessHost.cpp
-@@ -1030,9 +1030,6 @@ GeckoChildProcessHost::PerformAsyncLaunchInternal(std::vector<std::string>& aExt
+@@ -1018,9 +1018,6 @@ bool GeckoChildProcessHost::PerformAsyncLaunchInternal
if (!CrashReporter::IsDummy()) {
PROsfd h = PR_FileDesc2NativeHandle(crashAnnotationWritePipe);
--# if defined(MOZ_SANDBOX)
+-#if defined(MOZ_SANDBOX)
- mSandboxBroker.AddHandleToShare(reinterpret_cast<HANDLE>(h));
--# endif // defined(MOZ_SANDBOX)
+-#endif // defined(MOZ_SANDBOX)
mLaunchOptions->handles_to_inherit.push_back(reinterpret_cast<HANDLE>(h));
std::string hStr = std::to_string(h);
cmdLine.AppendLooseValue(UTF8ToWide(hStr));
-@@ -1043,6 +1040,11 @@ GeckoChildProcessHost::PerformAsyncLaunchInternal(std::vector<std::string>& aExt
+@@ -1031,6 +1028,11 @@ bool GeckoChildProcessHost::PerformAsyncLaunchInternal
- # if defined(MOZ_SANDBOX)
+ #if defined(MOZ_SANDBOX)
if (shouldSandboxCurrentProcess) {
+ // Mark the handles to inherit as inheritable.
+ for (HANDLE h : mLaunchOptions->handles_to_inherit) {
@@ -434,24 +430,25 @@ index d18ed9edd4ca..3be1c51d10bb 100644
+
if (mSandboxBroker.LaunchApp(cmdLine.program().c_str(),
cmdLine.command_line_string().c_str(),
- mLaunchOptions->env_map,
-@@ -1180,7 +1182,7 @@ GeckoChildProcessHost::LaunchAndroidService(const char* type,
- const base::file_handle_mapping_vector& fds_to_remap,
- ProcessHandle* process_handle)
- {
+ mLaunchOptions->env_map, mProcessType,
+@@ -1154,7 +1156,7 @@ void GeckoChildProcessHost::LaunchAndroidService(
+ const char* type, const std::vector<std::string>& argv,
+ const base::file_handle_mapping_vector& fds_to_remap,
+ ProcessHandle* process_handle) {
- MOZ_ASSERT((fds_to_remap.size() > 0) && (fds_to_remap.size() <= 3));
+ MOZ_RELEASE_ASSERT((2 <= fds_to_remap.size()) && (fds_to_remap.size() <= 4));
JNIEnv* const env = mozilla::jni::GetEnvForThread();
MOZ_ASSERT(env);
-@@ -1189,21 +1191,25 @@ GeckoChildProcessHost::LaunchAndroidService(const char* type,
+@@ -1164,23 +1166,26 @@ void GeckoChildProcessHost::LaunchAndroidService(
for (int ix = 0; ix < argvSize; ix++) {
jargs->SetElement(ix, jni::StringParam(argv[ix].c_str(), env));
}
- base::file_handle_mapping_vector::const_iterator it = fds_to_remap.begin();
- int32_t ipcFd = it->first;
- it++;
-- // If the Crash Reporter is disabled, there will not be a second file descriptor.
+- // If the Crash Reporter is disabled, there will not be a second file
+- // descriptor.
+
+ // XXX: this processing depends entirely on the internals of
+ // ContentParent::LaunchSubprocess()
@@ -475,9 +472,11 @@ index d18ed9edd4ca..3be1c51d10bb 100644
+ crashFd = fds_to_remap[2].first;
+ crashAnnotationFd = fds_to_remap[3].first;
}
-- int32_t handle = java::GeckoProcessManager::Start(type, jargs, ipcFd, crashFd, crashAnnotationFd);
+- int32_t handle = java::GeckoProcessManager::Start(type, jargs, ipcFd, crashFd,
+- crashAnnotationFd);
+
-+ int32_t handle = java::GeckoProcessManager::Start(type, jargs, prefsFd, ipcFd, crashFd, crashAnnotationFd);
++ int32_t handle = java::GeckoProcessManager::Start(type, jargs, prefsFd, ipcFd,
++ crashFd, crashAnnotationFd);
if (process_handle) {
*process_handle = handle;
@@ -485,8 +484,8 @@ diff --git ipc/glue/GeckoChildProcessHost.h ipc/glue/GeckoChildProcessHost.h
index 631c42066bc7..0345e221abcc 100644
--- ipc/glue/GeckoChildProcessHost.h
+++ ipc/glue/GeckoChildProcessHost.h
-@@ -103,6 +103,16 @@ public:
- }
+@@ -94,6 +94,16 @@ class GeckoChildProcessHost : public ChildProcessHost
+ task_t GetChildTask() { return mChildTask; }
#endif
+#ifdef XP_WIN
@@ -676,22 +675,22 @@ diff --git modules/libpref/Preferences.cpp modules/libpref/Preferences.cpp
index 330ed4a09b54..b884591c9271 100644
--- modules/libpref/Preferences.cpp
+++ modules/libpref/Preferences.cpp
-@@ -2920,7 +2920,7 @@ public:
+@@ -2637,7 +2637,7 @@ class AddPreferencesMemoryReporterRunnable : public Ru
- } // namespace
+ } // namespace
-// A list of prefs sent early from the parent, via the command line.
+// A list of prefs sent early from the parent, via shared memory.
static InfallibleTArray<dom::Pref>* gEarlyDomPrefs;
/* static */ already_AddRefed<Preferences>
-@@ -3081,11 +3081,130 @@ NS_IMPL_ISUPPORTS(Preferences,
+@@ -2782,12 +2782,123 @@ Preferences::~Preferences() {
+ NS_IMPL_ISUPPORTS(Preferences, nsIPrefService, nsIObserver, nsIPrefBranch,
nsISupportsWeakReference)
- /* static */ void
--Preferences::SetEarlyPreferences(const nsTArray<dom::Pref>* aDomPrefs)
-+Preferences::SerializeEarlyPreferences(nsCString& aStr)
-+{
+-/* static */ void Preferences::SetEarlyPreferences(
+- const nsTArray<dom::Pref>* aDomPrefs) {
++/* static */ void Preferences::SerializeEarlyPreferences(nsCString& aStr) {
+ MOZ_RELEASE_ASSERT(InitStaticMembers());
+
+ nsAutoCStringN<256> boolPrefs, intPrefs, stringPrefs;
@@ -711,17 +710,17 @@ index 330ed4a09b54..b884591c9271 100644
+ switch (pref->Type()) {
+ case PrefType::Bool:
+ boolPrefs.Append(
-+ nsPrintfCString("%u:%d|", i, Preferences::GetBool(prefName)));
++ nsPrintfCString("%u:%d|", i, Preferences::GetBool(prefName)));
+ break;
+ case PrefType::Int:
+ intPrefs.Append(
-+ nsPrintfCString("%u:%d|", i, Preferences::GetInt(prefName)));
++ nsPrintfCString("%u:%d|", i, Preferences::GetInt(prefName)));
+ break;
+ case PrefType::String: {
+ nsAutoCString value;
+ Preferences::GetCString(prefName, value);
+ stringPrefs.Append(
-+ nsPrintfCString("%u:%d;%s|", i, value.Length(), value.get()));
++ nsPrintfCString("%u:%d;%s|", i, value.Length(), value.get()));
+ } break;
+ case PrefType::None:
+ break;
@@ -741,15 +740,14 @@ index 330ed4a09b54..b884591c9271 100644
+ aStr.Append('\0');
+}
+
-+/* static */ void
-+Preferences::DeserializeEarlyPreferences(char* aStr, size_t aStrLen)
- {
++/* static */ void Preferences::DeserializeEarlyPreferences(char* aStr,
++ size_t aStrLen) {
MOZ_ASSERT(!XRE_IsParentProcess());
- gEarlyDomPrefs = new InfallibleTArray<dom::Pref>(mozilla::Move(*aDomPrefs));
+ MOZ_ASSERT(!gEarlyDomPrefs);
+ gEarlyDomPrefs = new InfallibleTArray<dom::Pref>();
-+
+
+ char* p = aStr;
+
+ // XXX: we assume these pref values are default values, which may not be
@@ -767,9 +765,7 @@ index 330ed4a09b54..b884591c9271 100644
+ MOZ_ASSERT(p[0] == '|');
+ p++;
+ dom::Pref pref(nsCString(dom::ContentPrefs::GetEarlyPref(index)),
-+ /* isLocked */ false,
-+ value,
-+ dom::MaybePrefValue());
++ /* isLocked */ false, value, dom::MaybePrefValue());
+ gEarlyDomPrefs->AppendElement(pref);
+ }
+ p++;
@@ -780,13 +776,11 @@ index 330ed4a09b54..b884591c9271 100644
+ MOZ_ASSERT(p[0] == ':');
+ p++;
+ dom::MaybePrefValue value(
-+ dom::PrefValue(static_cast<int32_t>(strtol(p, &p, 10))));
++ dom::PrefValue(static_cast<int32_t>(strtol(p, &p, 10))));
+ MOZ_ASSERT(p[0] == '|');
+ p++;
+ dom::Pref pref(nsCString(dom::ContentPrefs::GetEarlyPref(index)),
-+ /* isLocked */ false,
-+ value,
-+ dom::MaybePrefValue());
++ /* isLocked */ false, value, dom::MaybePrefValue());
+ gEarlyDomPrefs->AppendElement(pref);
+ }
+ p++;
@@ -801,9 +795,7 @@ index 330ed4a09b54..b884591c9271 100644
+ p++;
+ dom::MaybePrefValue value(dom::PrefValue(nsCString(p, length)));
+ dom::Pref pref(nsCString(dom::ContentPrefs::GetEarlyPref(index)),
-+ /* isLocked */ false,
-+ value,
-+ dom::MaybePrefValue());
++ /* isLocked */ false, value, dom::MaybePrefValue());
+ gEarlyDomPrefs->AppendElement(pref);
+ p += length + 1;
+ MOZ_ASSERT(*(p - 1) == '|');
@@ -815,25 +807,25 @@ index 330ed4a09b54..b884591c9271 100644
+ // We finished parsing on a '\0'. That should be the last char in the shared
+ // memory.
+ MOZ_ASSERT(aStr + aStrLen - 1 == p);
-
++
#ifdef DEBUG
MOZ_ASSERT(gPhase == ContentProcessPhase::eNoPrefsSet);
-@@ -4298,15 +4417,6 @@ Preferences::HasUserValue(const char* aPrefName)
- return pref && pref->HasUserValue();
- }
+ gPhase = ContentProcessPhase::eEarlyPrefsSet;
+@@ -3894,14 +4005,6 @@ static nsresult pref_ReadPrefFromJar(nsZipArchive* aJa
--/* static */ bool
--Preferences::MustSendToContentProcesses(const char* aPrefName)
--{
+ Pref* pref = pref_HashTableLookup(aPrefName);
+ return pref && pref->HasUserValue();
+-}
+-
+-/* static */ bool Preferences::MustSendToContentProcesses(
+- const char* aPrefName) {
- NS_ENSURE_TRUE(InitStaticMembers(), false);
-
- Pref* pref = pref_HashTableLookup(aPrefName);
- return pref && pref->MustSendToContentProcesses();
--}
--
- /* static */ int32_t
- Preferences::GetType(const char* aPrefName)
- {
+ }
+
+ /* static */ int32_t Preferences::GetType(const char* aPrefName) {
diff --git modules/libpref/Preferences.h modules/libpref/Preferences.h
index 1cb825ecbfe5..c149db62b525 100644
--- modules/libpref/Preferences.h
@@ -848,9 +840,9 @@ index 1cb825ecbfe5..c149db62b525 100644
+#endif
+
// Keep this in sync with PrefType in parser/src/lib.rs.
- enum class PrefValueKind : uint8_t
- {
-@@ -230,9 +235,6 @@ public:
+ enum class PrefValueKind : uint8_t { Default, User };
+
+@@ -191,9 +196,6 @@ class Preferences final : public nsIPrefService,
// Whether the pref has a user value or not.
static bool HasUserValue(const char* aPref);
@@ -860,7 +852,7 @@ index 1cb825ecbfe5..c149db62b525 100644
// Adds/Removes the observer for the root pref branch. See nsIPrefBranch.idl
// for details.
static nsresult AddStrongObserver(nsIObserver* aObserver, const char* aPref);
-@@ -328,11 +330,12 @@ public:
+@@ -277,11 +279,12 @@ class Preferences final : public nsIPrefService,
// When a content process is created these methods are used to pass prefs in
// bulk from the parent process. "Early" preferences are ones that are needed
@@ -881,21 +873,23 @@ diff --git mozglue/android/APKOpen.cpp mozglue/android/APKOpen.cpp
index 5f1ef55b605e..b57192488725 100644
--- mozglue/android/APKOpen.cpp
+++ mozglue/android/APKOpen.cpp
-@@ -392,7 +392,7 @@ FreeArgv(char** argv, int argc)
- }
-
+@@ -378,7 +378,8 @@ static void FreeArgv(char** argv, int argc) {
extern "C" APKOPEN_EXPORT void MOZ_JNICALL
--Java_org_mozilla_gecko_mozglue_GeckoLoader_nativeRun(JNIEnv *jenv, jclass jc, jobjectArray jargs, int ipcFd, int crashFd, int crashAnnotationFd)
-+Java_org_mozilla_gecko_mozglue_GeckoLoader_nativeRun(JNIEnv *jenv, jclass jc, jobjectArray jargs, int prefsFd, int ipcFd, int crashFd, int crashAnnotationFd)
- {
+ Java_org_mozilla_gecko_mozglue_GeckoLoader_nativeRun(JNIEnv* jenv, jclass jc,
+ jobjectArray jargs,
+- int ipcFd, int crashFd,
++ int prefsFd, int ipcFd,
++ int crashFd,
+ int crashAnnotationFd) {
int argc = 0;
char** argv = CreateArgvFromObjectArray(jenv, jargs, &argc);
-@@ -407,7 +407,7 @@ Java_org_mozilla_gecko_mozglue_GeckoLoader_nativeRun(JNIEnv *jenv, jclass jc, jo
+@@ -393,7 +394,8 @@ Java_org_mozilla_gecko_mozglue_GeckoLoader_nativeRun(J
gBootstrap->GeckoStart(jenv, argv, argc, sAppData);
ElfLoader::Singleton.ExpectShutdown(true);
} else {
- gBootstrap->XRE_SetAndroidChildFds(jenv, ipcFd, crashFd, crashAnnotationFd);
-+ gBootstrap->XRE_SetAndroidChildFds(jenv, prefsFd, ipcFd, crashFd, crashAnnotationFd);
++ gBootstrap->XRE_SetAndroidChildFds(jenv, prefsFd, ipcFd, crashFd,
++ crashAnnotationFd);
gBootstrap->XRE_SetProcessType(argv[argc - 1]);
XREChildData childData;
@@ -903,14 +897,17 @@ diff --git toolkit/xre/Bootstrap.cpp toolkit/xre/Bootstrap.cpp
index 5688519822a9..7e857969a4fb 100644
--- toolkit/xre/Bootstrap.cpp
+++ toolkit/xre/Bootstrap.cpp
-@@ -78,8 +78,8 @@ public:
+@@ -71,9 +71,11 @@ class BootstrapImpl final : public Bootstrap {
::GeckoStart(aEnv, argv, argc, aAppData);
}
-- virtual void XRE_SetAndroidChildFds(JNIEnv* aEnv, int aIPCFd, int aCrashFd, int aCrashAnnotationFd) override {
+- virtual void XRE_SetAndroidChildFds(JNIEnv* aEnv, int aIPCFd, int aCrashFd,
++ virtual void XRE_SetAndroidChildFds(JNIEnv* aEnv, int aPrefsFd, int aIPCFd,
++ int aCrashFd,
+ int aCrashAnnotationFd) override {
- ::XRE_SetAndroidChildFds(aEnv, aIPCFd, aCrashFd, aCrashAnnotationFd);
-+ virtual void XRE_SetAndroidChildFds(JNIEnv* aEnv, int aPrefsFd, int aIPCFd, int aCrashFd, int aCrashAnnotationFd) override {
-+ ::XRE_SetAndroidChildFds(aEnv, aPrefsFd, aIPCFd, aCrashFd, aCrashAnnotationFd);
++ ::XRE_SetAndroidChildFds(aEnv, aPrefsFd, aIPCFd, aCrashFd,
++ aCrashAnnotationFd);
}
#endif
@@ -918,12 +915,14 @@ diff --git toolkit/xre/Bootstrap.h toolkit/xre/Bootstrap.h
index 686d0a38e324..77adcef80e1f 100644
--- toolkit/xre/Bootstrap.h
+++ toolkit/xre/Bootstrap.h
-@@ -113,7 +113,7 @@ public:
- #ifdef MOZ_WIDGET_ANDROID
- virtual void GeckoStart(JNIEnv* aEnv, char** argv, int argc, const StaticXREAppData& aAppData) = 0;
-
-- virtual void XRE_SetAndroidChildFds(JNIEnv* aEnv, int aIPCFd, int aCrashFd, int aCrashAnnotationFd) = 0;
-+ virtual void XRE_SetAndroidChildFds(JNIEnv* aEnv, int aPrefsFd, int aIPCFd, int aCrashFd, int aCrashAnnotationFd) = 0;
+@@ -112,8 +112,8 @@ class Bootstrap {
+ virtual void GeckoStart(JNIEnv* aEnv, char** argv, int argc,
+ const StaticXREAppData& aAppData) = 0;
+
+- virtual void XRE_SetAndroidChildFds(JNIEnv* aEnv, int aIPCFd, int aCrashFd,
+- int aCrashAnnotationFd) = 0;
++ virtual void XRE_SetAndroidChildFds(JNIEnv* aEnv, int aPrefsFd, int aIPCFd,
++ int aCrashFd, int aCrashAnnotationFd) = 0;
#endif
#ifdef LIBFUZZER
@@ -931,13 +930,13 @@ diff --git toolkit/xre/nsEmbedFunctions.cpp toolkit/xre/nsEmbedFunctions.cpp
index 53bd2bc2eb47..83184e97ba92 100644
--- toolkit/xre/nsEmbedFunctions.cpp
+++ toolkit/xre/nsEmbedFunctions.cpp
-@@ -243,9 +243,10 @@ GeckoProcessType sChildProcessType = GeckoProcessType_Default;
+@@ -226,9 +226,10 @@ GeckoProcessType sChildProcessType = GeckoProcessType_
+ } // namespace mozilla
#if defined(MOZ_WIDGET_ANDROID)
- void
--XRE_SetAndroidChildFds (JNIEnv* env, int ipcFd, int crashFd, int crashAnnotationFd)
-+XRE_SetAndroidChildFds (JNIEnv* env, int prefsFd, int ipcFd, int crashFd, int crashAnnotationFd)
- {
+-void XRE_SetAndroidChildFds(JNIEnv* env, int ipcFd, int crashFd,
++void XRE_SetAndroidChildFds(JNIEnv* env, int prefsFd, int ipcFd, int crashFd,
+ int crashAnnotationFd) {
mozilla::jni::SetGeckoThreadEnv(env);
+ mozilla::dom::SetPrefsFd(prefsFd);
IPC::Channel::SetClientChannelFd(ipcFd);
@@ -989,12 +988,13 @@ diff --git xpcom/build/nsXULAppAPI.h xpcom/build/nsXULAppAPI.h
index 94f6daf864c9..d6ac10d51d76 100644
--- xpcom/build/nsXULAppAPI.h
+++ xpcom/build/nsXULAppAPI.h
-@@ -398,7 +398,7 @@ XRE_API(const char*,
+@@ -378,7 +378,8 @@ XRE_API(const char*, XRE_ChildProcessTypeToString,
#if defined(MOZ_WIDGET_ANDROID)
- XRE_API(void,
-- XRE_SetAndroidChildFds, (JNIEnv* env, int ipcFd, int crashFd, int crashAnnotationFd))
-+ XRE_SetAndroidChildFds, (JNIEnv* env, int prefsFd, int ipcFd, int crashFd, int crashAnnotationFd))
- #endif // defined(MOZ_WIDGET_ANDROID)
+ XRE_API(void, XRE_SetAndroidChildFds,
+- (JNIEnv * env, int ipcFd, int crashFd, int crashAnnotationFd))
++ (JNIEnv * env, int prefsFd, int ipcFd, int crashFd,
++ int crashAnnotationFd))
+ #endif // defined(MOZ_WIDGET_ANDROID)
- XRE_API(void,
+ XRE_API(void, XRE_SetProcessType, (const char* aProcessTypeString))
diff --git a/mail/thunderbird/files/patch-bug1442583 b/mail/thunderbird/files/patch-bug1442583
index ca2aa7057396..902a5f268283 100644
--- a/mail/thunderbird/files/patch-bug1442583
+++ b/mail/thunderbird/files/patch-bug1442583
@@ -21,19 +21,23 @@ index e763a9d68dc17..8a6d50b6a7845 100644
#include "gc/Memory.h"
+#ifdef JS_CODEGEN_ARM64
-+# include "jit/arm64/vixl/Cpu-vixl.h"
++#include "jit/arm64/vixl/Cpu-vixl.h"
+#endif
#include "threading/LockGuard.h"
#include "threading/Mutex.h"
#include "util/Windows.h"
-@@ -621,6 +624,10 @@ js::jit::DeallocateExecutableMemory(void* addr, size_t bytes)
- bool
- js::jit::InitProcessExecutableMemory()
- {
+@@ -574,7 +577,13 @@ void js::jit::DeallocateExecutableMemory(void* addr, s
+ execMemory.deallocate(addr, bytes, /* decommit = */ true);
+ }
+
+-bool js::jit::InitProcessExecutableMemory() { return execMemory.init(); }
++bool js::jit::InitProcessExecutableMemory() {
+#ifdef JS_CODEGEN_ARM64
-+ // Initialize instruction cache flushing.
-+ vixl::CPU::SetUp();
++ // Initialize instruction cache flushing.
++ vixl::CPU::SetUp();
+#endif
- return execMemory.init();
- }
++ return execMemory.init();
++}
+
+ void js::jit::ReleaseProcessExecutableMemory() { execMemory.release(); }
diff --git a/mail/thunderbird/files/patch-bug1447359 b/mail/thunderbird/files/patch-bug1447359
index 8116d9aece4f..e99792bfef47 100644
--- a/mail/thunderbird/files/patch-bug1447359
+++ b/mail/thunderbird/files/patch-bug1447359
@@ -15,31 +15,31 @@ diff --git js/src/jit/arm64/MacroAssembler-arm64-inl.h js/src/jit/arm64/MacroAss
index 7061cbfd93ebb..190442f7afa0a 100644
--- js/src/jit/arm64/MacroAssembler-arm64-inl.h
+++ js/src/jit/arm64/MacroAssembler-arm64-inl.h
-@@ -359,6 +359,7 @@ MacroAssembler::sub32FromStackPtrWithPatch(Register dest)
- {
- vixl::UseScratchRegisterScope temps(this);
- const ARMRegister scratch = temps.AcquireX();
-+ AutoForbidPools afp(this, /* max number of instructions in scope = */ 3);
- CodeOffset offs = CodeOffset(currentOffset());
- movz(scratch, 0, 0);
- movk(scratch, 0, 16);
+@@ -268,6 +268,7 @@ void MacroAssembler::add64(Imm64 imm, Register64 dest)
+ CodeOffset MacroAssembler::sub32FromStackPtrWithPatch(Register dest) {
+ vixl::UseScratchRegisterScope temps(this);
+ const ARMRegister scratch = temps.AcquireX();
++ AutoForbidPools afp(this, /* max number of instructions in scope = */ 3);
+ CodeOffset offs = CodeOffset(currentOffset());
+ movz(scratch, 0, 0);
+ movk(scratch, 0, 16);
diff --git js/src/jit/arm64/MacroAssembler-arm64.cpp js/src/jit/arm64/MacroAssembler-arm64.cpp
index 7b599b7e9d610..4e8fdb6a67019 100644
--- js/src/jit/arm64/MacroAssembler-arm64.cpp
+++ js/src/jit/arm64/MacroAssembler-arm64.cpp
-@@ -707,6 +707,7 @@ MacroAssembler::patchFarJump(CodeOffset farJump, uint32_t targetOffset)
- CodeOffset
- MacroAssembler::nopPatchableToCall(const wasm::CallSiteDesc& desc)
- {
-+ AutoForbidPools afp(this, /* max number of instructions in scope = */ 1);
- CodeOffset offset(currentOffset());
- Nop();
- append(desc, CodeOffset(currentOffset()));
-@@ -1077,6 +1078,7 @@ MacroAssembler::comment(const char* msg)
- CodeOffset
- MacroAssembler::wasmTrapInstruction()
- {
-+ AutoForbidPools afp(this, /* max number of instructions in scope = */ 1);
- CodeOffset offs(currentOffset());
- Unreachable();
- return offs;
+@@ -666,6 +666,7 @@ void MacroAssembler::patchNearJumpToNop(uint8_t* jump)
+ }
+
+ CodeOffset MacroAssembler::nopPatchableToCall(const wasm::CallSiteDesc& desc) {
++ AutoForbidPools afp(this, /* max number of instructions in scope = */ 1);
+ CodeOffset offset(currentOffset());
+ Nop();
+ append(desc, CodeOffset(currentOffset()));
+@@ -1002,6 +1003,7 @@ void MacroAssembler::comment(const char* msg) { Assemb
+ // wasm support
+
+ CodeOffset MacroAssembler::wasmTrapInstruction() {
++ AutoForbidPools afp(this, /* max number of instructions in scope = */ 1);
+ CodeOffset offs(currentOffset());
+ Unreachable();
+ return offs;
diff --git a/mail/thunderbird/files/patch-bug1451292 b/mail/thunderbird/files/patch-bug1451292
index b318ab619bb0..54e30883f3e3 100644
--- a/mail/thunderbird/files/patch-bug1451292
+++ b/mail/thunderbird/files/patch-bug1451292
@@ -19,15 +19,15 @@ diff --git js/src/jit/arm64/MacroAssembler-arm64.cpp js/src/jit/arm64/MacroAssem
index 4ea64b1225d00..a212de0ec2f45 100644
--- js/src/jit/arm64/MacroAssembler-arm64.cpp
+++ js/src/jit/arm64/MacroAssembler-arm64.cpp
-@@ -237,8 +237,9 @@ MacroAssemblerCompat::profilerEnterFrame(RegisterOrSP framePtr, Register scratch
- void
- MacroAssemblerCompat::breakpoint()
- {
-- static int code = 0xA77;
-- Brk((code++) & 0xffff);
-+ // Note, other payloads are possible, but GDB is known to misinterpret them
-+ // sometimes and iloop on the breakpoint instead of stopping properly.
-+ Brk(0);
+@@ -249,8 +249,9 @@ void MacroAssemblerCompat::profilerEnterFrame(Register
+ }
+
+ void MacroAssemblerCompat::breakpoint() {
+- static int code = 0xA77;
+- Brk((code++) & 0xffff);
++ // Note, other payloads are possible, but GDB is known to misinterpret them
++ // sometimes and iloop on the breakpoint instead of stopping properly.
++ Brk(0);
}
// Either `any` is valid or `sixtyfour` is valid. Return a 32-bit ARMRegister
diff --git a/mail/thunderbird/files/patch-bug1456556 b/mail/thunderbird/files/patch-bug1456556
index 4b2ccb7e1ffc..d7f3b4f690c5 100644
--- a/mail/thunderbird/files/patch-bug1456556
+++ b/mail/thunderbird/files/patch-bug1456556
@@ -11,12 +11,12 @@ diff --git dom/fetch/FetchConsumer.cpp dom/fetch/FetchConsumer.cpp
index 134bf7f2e703a..3c3687fea1d5a 100644
--- dom/fetch/FetchConsumer.cpp
+++ dom/fetch/FetchConsumer.cpp
-@@ -582,7 +582,7 @@ FetchBodyConsumer<Derived>::ContinueConsumeBody(nsresult aStatus,
- RefPtr<Promise> localPromise = mConsumePromise.forget();
+@@ -560,7 +560,7 @@ void FetchBodyConsumer<Derived>::ContinueConsumeBody(n
RefPtr<FetchBodyConsumer<Derived>> self = this;
-- auto autoReleaseObject = mozilla::MakeScopeExit([&] {
-+ auto autoReleaseObject = mozilla::MakeScopeExit([self] {
- self->ReleaseObject();
- });
+ auto autoReleaseObject =
+- mozilla::MakeScopeExit([&] { self->ReleaseObject(); });
++ mozilla::MakeScopeExit([self] { self->ReleaseObject(); });
+ if (aShuttingDown) {
+ // If shutting down, we don't want to resolve any promise.
diff --git a/mail/thunderbird/files/patch-bug1500850 b/mail/thunderbird/files/patch-bug1500850
deleted file mode 100644
index 906d91a5d8ab..000000000000
--- a/mail/thunderbird/files/patch-bug1500850
+++ /dev/null
@@ -1,26 +0,0 @@
-commit 4425b9140c4c
-Author: Martin Stransky <stransky@redhat.com>
-Date: Mon Oct 22 09:14:07 2018 +0000
-
- Bug 1500850 - [Wayland] Add missing dbus header dbus-glib-lowlevel.h. r=jhorak, a=RyanVM
-
- Differential Revision: https://phabricator.services.mozilla.com/D9365
-
- --HG--
- extra : source : 5203edd6ea29e4b73681674d2a5268dd6a310102
----
- widget/xremoteclient/DBusRemoteClient.cpp | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git widget/xremoteclient/DBusRemoteClient.cpp widget/xremoteclient/DBusRemoteClient.cpp
-index ba5bda06201d..b2f03dccc133 100644
---- widget/xremoteclient/DBusRemoteClient.cpp
-+++ widget/xremoteclient/DBusRemoteClient.cpp
-@@ -13,6 +13,7 @@
- #include "nsPrintfCString.h"
-
- #include <dlfcn.h>
-+#include <dbus/dbus-glib-lowlevel.h>
-
- using mozilla::LogLevel;
- static mozilla::LazyLogModule sRemoteLm("DBusRemoteClient");
diff --git a/mail/thunderbird/files/patch-z-bug1436911 b/mail/thunderbird/files/patch-z-bug1436911
index 22556194a653..c60f388ca00e 100644
--- a/mail/thunderbird/files/patch-z-bug1436911
+++ b/mail/thunderbird/files/patch-z-bug1436911
@@ -38,10 +38,10 @@ diff --git dom/ipc/ContentChild.cpp dom/ipc/ContentChild.cpp
index f61ab07b81e2..af1ef9cf4c7e 100644
--- dom/ipc/ContentChild.cpp
+++ dom/ipc/ContentChild.cpp
-@@ -1185,8 +1185,6 @@ void
- ContentChild::InitXPCOM(const XPCOMInitData& aXPCOMInit,
- const mozilla::dom::ipc::StructuredCloneData& aInitialData)
- {
+@@ -1094,8 +1094,6 @@ void ContentChild::InitGraphicsDeviceData(const Conten
+ void ContentChild::InitXPCOM(
+ const XPCOMInitData& aXPCOMInit,
+ const mozilla::dom::ipc::StructuredCloneData& aInitialData) {
- Preferences::SetLatePreferences(&aXPCOMInit.prefs());
-
// Do this as early as possible to get the parent process to initialize the
@@ -59,7 +59,7 @@ index 208bb47a970b..4ce5c6bf23d5 100644
#include "mozilla/Sprintf.h"
#ifdef MOZ_WEBRTC
-@@ -2009,7 +2008,7 @@ ContentParent::LaunchSubprocess(ProcessPriority aInitialPriority /* = PROCESS_PR
+@@ -1863,7 +1862,7 @@ bool ContentParent::LaunchSubprocess(
// Serialize the early prefs.
nsAutoCStringN<1024> prefs;
@@ -68,7 +68,7 @@ index 208bb47a970b..4ce5c6bf23d5 100644
// Set up the shared memory.
base::SharedMemory shm;
-@@ -2228,7 +2227,6 @@ ContentParent::InitInternal(ProcessPriority aInitialPriority)
+@@ -2034,7 +2033,6 @@ void ContentParent::InitInternal(ProcessPriority aInit
XPCOMInitData xpcomInit;
@@ -81,7 +81,7 @@ deleted file mode 100644
index 808b797d9bee..000000000000
--- dom/ipc/ContentPrefs.cpp
+++ /dev/null
-@@ -1,362 +0,0 @@
+@@ -1,360 +0,0 @@
-/* -*- 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
@@ -103,344 +103,342 @@ index 808b797d9bee..000000000000
- ******************************************************************************/
-
-const char* mozilla::dom::ContentPrefs::gEarlyPrefs[] = {
-- "accessibility.monoaudio.enable",
-- "accessibility.mouse_focuses_formcontrol",
-- "accessibility.tabfocus_applies_to_xul",
-- "app.update.channel",
-- "browser.autofocus",
-- "browser.dom.window.dump.enabled",
-- "browser.sessionhistory.max_entries",
-- "browser.sessionhistory.max_total_viewers",
+- "accessibility.monoaudio.enable",
+- "accessibility.mouse_focuses_formcontrol",
+- "accessibility.tabfocus_applies_to_xul",
+- "app.update.channel",
+- "browser.autofocus",
+- "browser.dom.window.dump.enabled",
+- "browser.sessionhistory.max_entries",
+- "browser.sessionhistory.max_total_viewers",
-#if defined(NIGHTLY_BUILD) || defined(DEBUG)
-- "browser.startup.record",
+- "browser.startup.record",
-#endif
-#if defined(ANDROID)
-- "consoleservice.logcat",
+- "consoleservice.logcat",
-#endif
-- "content.cors.disable",
-- "content.cors.no_private_data",
-- "content.notify.backoffcount",
-- "content.notify.interval",
-- "content.notify.ontimer",
-- "content.sink.enable_perf_mode",
-- "content.sink.event_probe_rate",
-- "content.sink.initial_perf_time",
-- "content.sink.interactive_deflect_count",
-- "content.sink.interactive_parse_time",
-- "content.sink.interactive_time",
-- "content.sink.pending_event_mode",
-- "content.sink.perf_deflect_count",
-- "content.sink.perf_parse_time",
-- "device.storage.prompt.testing",
-- "device.storage.writable.name",
-- "devtools.enabled",
-- "dom.allow_XUL_XBL_for_file",
-- "dom.allow_cut_copy",
-- "dom.animations-api.core.enabled",
-- "dom.animations-api.element-animate.enabled",
-- "dom.animations-api.pending-member.enabled",
-- "dom.enable_frame_timing",
-- "dom.enable_performance",
-- "dom.enable_performance_navigation_timing",
-- "dom.enable_resource_timing",
-- "dom.event.handling-user-input-time-limit",
-- "dom.event.touch.coalescing.enabled",
-- "dom.forms.autocomplete.formautofill",
-- "dom.forms.inputmode",
-- "dom.input.skip_cursor_move_for_same_value_set",
-- "dom.ipc.processPriorityManager.backgroundGracePeriodMS",
-- "dom.ipc.processPriorityManager.backgroundPerceivableGracePeriodMS",
-- "dom.ipc.useNativeEventProcessing.content",
-- "dom.max_chrome_script_run_time",
-- "dom.max_ext_content_script_run_time",
-- "dom.max_script_run_time",
-- "dom.mozBrowserFramesEnabled",
-- "dom.performance.enable_notify_performance_timing",
-- "dom.performance.enable_user_timing_logging",
-- "dom.placeholder.show_on_focus",
-- "dom.requestIdleCallback.enabled",
-- "dom.script_loader.bytecode_cache.enabled",
-- "dom.script_loader.bytecode_cache.strategy",
-- "dom.storage.testing",
-- "dom.url.encode_decode_hash",
-- "dom.url.getters_decode_hash",
-- "dom.use_watchdog",
-- "dom.vibrator.enabled",
-- "dom.vibrator.max_vibrate_list_len",
-- "dom.vibrator.max_vibrate_ms",
-- "dom.webcomponents.customelements.enabled",
-- "dom.webcomponents.shadowdom.enabled",
-- "focusmanager.testmode",
-- "font.size.inflation.disabledInMasterProcess",
-- "font.size.inflation.emPerLine",
-- "font.size.inflation.forceEnabled",
-- "font.size.inflation.lineThreshold",
-- "font.size.inflation.mappingIntercept",
-- "font.size.inflation.maxRatio",
-- "font.size.inflation.minTwips",
-- "font.size.systemFontScale",
-- "full-screen-api.allow-trusted-requests-only",
-- "full-screen-api.enabled",
-- "full-screen-api.unprefix.enabled",
+- "content.cors.disable",
+- "content.cors.no_private_data",
+- "content.notify.backoffcount",
+- "content.notify.interval",
+- "content.notify.ontimer",
+- "content.sink.enable_perf_mode",
+- "content.sink.event_probe_rate",
+- "content.sink.initial_perf_time",
+- "content.sink.interactive_deflect_count",
+- "content.sink.interactive_parse_time",
+- "content.sink.interactive_time",
+- "content.sink.pending_event_mode",
+- "content.sink.perf_deflect_count",
+- "content.sink.perf_parse_time",
+- "device.storage.prompt.testing",
+- "device.storage.writable.name",
+- "devtools.enabled",
+- "dom.allow_XUL_XBL_for_file",
+- "dom.allow_cut_copy",
+- "dom.animations-api.core.enabled",
+- "dom.animations-api.element-animate.enabled",
+- "dom.animations-api.pending-member.enabled",
+- "dom.enable_frame_timing",
+- "dom.enable_performance",
+- "dom.enable_performance_navigation_timing",
+- "dom.enable_resource_timing",
+- "dom.event.handling-user-input-time-limit",
+- "dom.event.touch.coalescing.enabled",
+- "dom.forms.autocomplete.formautofill",
+- "dom.forms.inputmode",
+- "dom.input.skip_cursor_move_for_same_value_set",
+- "dom.ipc.processPriorityManager.backgroundGracePeriodMS",
+- "dom.ipc.processPriorityManager.backgroundPerceivableGracePeriodMS",
+- "dom.ipc.useNativeEventProcessing.content",
+- "dom.max_chrome_script_run_time",
+- "dom.max_ext_content_script_run_time",
+- "dom.max_script_run_time",
+- "dom.mozBrowserFramesEnabled",
+- "dom.performance.enable_notify_performance_timing",
+- "dom.performance.enable_user_timing_logging",
+- "dom.placeholder.show_on_focus",
+- "dom.requestIdleCallback.enabled",
+- "dom.script_loader.bytecode_cache.enabled",
+- "dom.script_loader.bytecode_cache.strategy",
+- "dom.storage.testing",
+- "dom.url.encode_decode_hash",
+- "dom.url.getters_decode_hash",
+- "dom.use_watchdog",
+- "dom.vibrator.enabled",
+- "dom.vibrator.max_vibrate_list_len",
+- "dom.vibrator.max_vibrate_ms",
+- "dom.webcomponents.customelements.enabled",
+- "dom.webcomponents.shadowdom.enabled",
+- "focusmanager.testmode",
+- "font.size.inflation.disabledInMasterProcess",
+- "font.size.inflation.emPerLine",
+- "font.size.inflation.forceEnabled",
+- "font.size.inflation.lineThreshold",
+- "font.size.inflation.mappingIntercept",
+- "font.size.inflation.maxRatio",
+- "font.size.inflation.minTwips",
+- "font.size.systemFontScale",
+- "full-screen-api.allow-trusted-requests-only",
+- "full-screen-api.enabled",
+- "full-screen-api.unprefix.enabled",
-#ifdef FUZZING
-- "fuzzing.enabled",
+- "fuzzing.enabled",
-#endif
-- "gfx.font_rendering.opentype_svg.enabled",
-- "hangmonitor.timeout",
-- "html5.flushtimer.initialdelay",
-- "html5.flushtimer.subsequentdelay",
-- "html5.offmainthread",
-- "intl.charset.fallback.tld",
-- "intl.charset.fallback.utf8_for_file",
-- "intl.ime.hack.on_ime_unaware_apps.fire_key_events_for_composition",
-- "javascript.enabled",
-- "javascript.options.array_prototype_values",
-- "javascript.options.asmjs",
-- "javascript.options.asyncstack",
-- "javascript.options.baselinejit",
-- "javascript.options.baselinejit.threshold",
-- "javascript.options.baselinejit.unsafe_eager_compilation",
-- "javascript.options.discardSystemSource",
-- "javascript.options.dump_stack_on_debuggee_would_run",
-- "javascript.options.gczeal",
-- "javascript.options.gczeal.frequency",
-- "javascript.options.ion",
-- "javascript.options.ion.offthread_compilation",
-- "javascript.options.ion.threshold",
-- "javascript.options.ion.unsafe_eager_compilation",
-- "javascript.options.jit.full_debug_checks",
-- "javascript.options.native_regexp",
-- "javascript.options.parallel_parsing",
-- "javascript.options.shared_memory",
-- "javascript.options.spectre.index_masking",
-- "javascript.options.spectre.jit_to_C++_calls",
-- "javascript.options.spectre.object_mitigations.barriers",
-- "javascript.options.spectre.object_mitigations.misc",
-- "javascript.options.spectre.string_mitigations",
-- "javascript.options.spectre.value_masking",
-- "javascript.options.streams",
-- "javascript.options.strict",
-- "javascript.options.strict.debug",
-- "javascript.options.throw_on_asmjs_validation_failure",
-- "javascript.options.throw_on_debuggee_would_run",
-- "javascript.options.wasm",
-- "javascript.options.wasm_baselinejit",
-- "javascript.options.wasm_ionjit",
-- "javascript.options.werror",
-- "javascript.use_us_english_locale",
-- "jsloader.shareGlobal",
-- "layout.css.all-shorthand.enabled",
-- "layout.css.background-blend-mode.enabled",
-- "layout.css.box-decoration-break.enabled",
-- "layout.css.color-adjust.enabled",
-- "layout.css.column-span.enabled",
-- "layout.css.contain.enabled",
-- "layout.css.control-characters.visible",
-- "layout.css.emulate-moz-box-with-flex",
-- "layout.css.expensive-style-struct-assertions.enabled",
-- "layout.css.float-logical-values.enabled",
-- "layout.css.font-display.enabled",
-- "layout.css.font-variations.enabled",
-- "layout.css.frames-timing.enabled",
-- "layout.css.getBoxQuads.enabled",
-- "layout.css.grid-template-subgrid-value.enabled",
-- "layout.css.grid.enabled",
-- "layout.css.image-orientation.enabled",
-- "layout.css.individual-transform.enabled",
-- "layout.css.initial-letter.enabled",
-- "layout.css.isolation.enabled",
-- "layout.css.mix-blend-mode.enabled",
-- "layout.css.moz-document.content.enabled",
-- "layout.css.osx-font-smoothing.enabled",
-- "layout.css.overflow-clip-box.enabled",
-- "layout.css.overscroll-behavior.enabled",
-- "layout.css.prefixes.animations",
-- "layout.css.prefixes.border-image",
-- "layout.css.prefixes.box-sizing",
-- "layout.css.prefixes.device-pixel-ratio-webkit",
-- "layout.css.prefixes.font-features",
-- "layout.css.prefixes.gradients",
-- "layout.css.prefixes.transforms",
-- "layout.css.prefixes.transitions",
-- "layout.css.prefixes.webkit",
-- "layout.css.scope-pseudo.enabled",
-- "layout.css.scoped-style.enabled",
-- "layout.css.scroll-behavior.property-enabled",
-- "layout.css.scroll-snap.enabled",
+- "gfx.font_rendering.opentype_svg.enabled",
+- "hangmonitor.timeout",
+- "html5.flushtimer.initialdelay",
+- "html5.flushtimer.subsequentdelay",
+- "html5.offmainthread",
+- "intl.charset.fallback.tld",
+- "intl.charset.fallback.utf8_for_file",
+- "intl.ime.hack.on_ime_unaware_apps.fire_key_events_for_composition",
+- "javascript.enabled",
+- "javascript.options.array_prototype_values",
+- "javascript.options.asmjs",
+- "javascript.options.asyncstack",
+- "javascript.options.baselinejit",
+- "javascript.options.baselinejit.threshold",
+- "javascript.options.baselinejit.unsafe_eager_compilation",
+- "javascript.options.discardSystemSource",
+- "javascript.options.dump_stack_on_debuggee_would_run",
+- "javascript.options.gczeal",
+- "javascript.options.gczeal.frequency",
+- "javascript.options.ion",
+- "javascript.options.ion.offthread_compilation",
+- "javascript.options.ion.threshold",
+- "javascript.options.ion.unsafe_eager_compilation",
+- "javascript.options.jit.full_debug_checks",
+- "javascript.options.native_regexp",
+- "javascript.options.parallel_parsing",
+- "javascript.options.shared_memory",
+- "javascript.options.spectre.index_masking",
+- "javascript.options.spectre.jit_to_C++_calls",
+- "javascript.options.spectre.object_mitigations.barriers",
+- "javascript.options.spectre.object_mitigations.misc",
+- "javascript.options.spectre.string_mitigations",
+- "javascript.options.spectre.value_masking",
+- "javascript.options.streams",
+- "javascript.options.strict",
+- "javascript.options.strict.debug",
+- "javascript.options.throw_on_asmjs_validation_failure",
+- "javascript.options.throw_on_debuggee_would_run",
+- "javascript.options.wasm",
+- "javascript.options.wasm_baselinejit",
+- "javascript.options.wasm_ionjit",
+- "javascript.options.werror",
+- "javascript.use_us_english_locale",
+- "jsloader.shareGlobal",
+- "layout.css.all-shorthand.enabled",
+- "layout.css.background-blend-mode.enabled",
+- "layout.css.box-decoration-break.enabled",
+- "layout.css.color-adjust.enabled",
+- "layout.css.column-span.enabled",
+- "layout.css.contain.enabled",
+- "layout.css.control-characters.visible",
+- "layout.css.emulate-moz-box-with-flex",
+- "layout.css.expensive-style-struct-assertions.enabled",
+- "layout.css.float-logical-values.enabled",
+- "layout.css.font-display.enabled",
+- "layout.css.font-variations.enabled",
+- "layout.css.frames-timing.enabled",
+- "layout.css.getBoxQuads.enabled",
+- "layout.css.grid-template-subgrid-value.enabled",
+- "layout.css.grid.enabled",
+- "layout.css.image-orientation.enabled",
+- "layout.css.individual-transform.enabled",
+- "layout.css.initial-letter.enabled",
+- "layout.css.isolation.enabled",
+- "layout.css.mix-blend-mode.enabled",
+- "layout.css.moz-document.content.enabled",
+- "layout.css.osx-font-smoothing.enabled",
+- "layout.css.overflow-clip-box.enabled",
+- "layout.css.overscroll-behavior.enabled",
+- "layout.css.prefixes.animations",
+- "layout.css.prefixes.border-image",
+- "layout.css.prefixes.box-sizing",
+- "layout.css.prefixes.device-pixel-ratio-webkit",
+- "layout.css.prefixes.font-features",
+- "layout.css.prefixes.gradients",
+- "layout.css.prefixes.transforms",
+- "layout.css.prefixes.transitions",
+- "layout.css.prefixes.webkit",
+- "layout.css.scope-pseudo.enabled",
+- "layout.css.scoped-style.enabled",
+- "layout.css.scroll-behavior.property-enabled",
+- "layout.css.scroll-snap.enabled",
-#ifdef MOZ_STYLO
-- "layout.css.servo.chrome.enabled",
-- "layout.css.servo.enabled",
+- "layout.css.servo.chrome.enabled",
+- "layout.css.servo.enabled",
-#endif
-- "layout.css.shape-outside.enabled",
-- "layout.css.text-align-unsafe-value.enabled",
-- "layout.css.text-combine-upright-digits.enabled",
-- "layout.css.text-combine-upright.enabled",
-- "layout.css.text-justify.enabled",
-- "layout.css.touch_action.enabled",
-- "layout.css.visited_links_enabled",
-- "layout.idle_period.required_quiescent_frames",
-- "layout.idle_period.time_limit",
-- "layout.interruptible-reflow.enabled",
-- "mathml.disabled",
-- "media.audio-max-decode-error",
-- "media.cache_readahead_limit",
-- "media.cache_resume_threshold",
-- "media.cache_size",
-- "media.clearkey.persistent-license.enabled",
-- "media.cubeb.backend",
-- "media.cubeb.sandbox",
-- "media.cubeb_latency_msg_frames",
-- "media.cubeb_latency_playback_ms",
-- "media.decoder-doctor.wmf-disabled-is-failure",
-- "media.decoder.recycle.enabled",
-- "media.decoder.skip-to-next-key-frame.enabled",
-- "media.dormant-on-pause-timeout-ms",
-- "media.eme.audio.blank",
-- "media.eme.chromium-api.video-shmems",
-- "media.eme.enabled",
-- "media.eme.video.blank",
-- "media.ffmpeg.enabled",
-- "media.ffmpeg.low-latency.enabled",
-- "media.ffvpx.enabled",
-- "media.ffvpx.low-latency.enabled",
-- "media.flac.enabled",
-- "media.forcestereo.enabled",
-- "media.gmp.decoder.enabled",
-- "media.gmp.insecure.allow",
-- "media.gpu-process-decoder",
-- "media.hls.enabled",
-- "media.libavcodec.allow-obsolete",
-- "media.memory_cache_max_size",
-- "media.memory_caches_combined_limit_kb",
-- "media.memory_caches_combined_limit_pc_sysmem",
-- "media.mp4.enabled",
-- "media.navigator.mediadatadecoder_enabled",
-- "media.ogg.enabled",
-- "media.ogg.flac.enabled",
-- "media.playback.warnings-as-errors",
-- "media.playback.warnings-as-errors.stagefright-vs-rust",
-- "media.resampling.enabled",
-- "media.resume-bkgnd-video-on-tabhover",
-- "media.ruin-av-sync.enabled",
-- "media.rust.mp4parser",
-- "media.rust.test_mode",
-- "media.seamless-looping",
-- "media.suspend-bkgnd-video.delay-ms",
-- "media.suspend-bkgnd-video.enabled",
-- "media.use-blank-decoder",
-- "media.video-max-decode-error",
-- "media.video_stats.enabled",
-- "media.videocontrols.lock-video-orientation",
-- "media.volume_scale",
-- "media.webspeech.recognition.enable",
-- "media.webspeech.recognition.force_enable",
-- "media.webspeech.synth.force_global_queue",
-- "media.webspeech.test.enable",
-- "media.webspeech.test.fake_fsm_events",
-- "media.webspeech.test.fake_recognition_service",
-- "media.wmf.allow-unsupported-resolutions",
-- "media.wmf.enabled",
-- "media.wmf.skip-blacklist",
-- "media.wmf.vp9.enabled",
-- "network.IDN.blacklist_chars",
-- "network.IDN.restriction_profile",
-- "network.IDN.use_whitelist",
-- "network.IDN_show_punycode",
-- "network.buffer.cache.count",
-- "network.buffer.cache.size",
-- "network.captive-portal-service.enabled",
-- "network.cookie.cookieBehavior",
-- "network.cookie.lifetimePolicy",
-- "network.dns.disablePrefetch",
-- "network.dns.disablePrefetchFromHTTPS",
-- "network.file.disable_unc_paths",
-- "network.file.path_blacklist",
-- "network.http.tailing.enabled",
-- "network.jar.block-remote-files",
-- "network.loadinfo.skip_type_assertion",
-- "network.notify.changed",
-- "network.offline-mirrors-connectivity",
-- "network.protocol-handler.external.jar",
-- "network.proxy.type",
-- "network.security.ports.banned",
-- "network.security.ports.banned.override",
-- "network.standard-url.enable-rust",
-- "network.standard-url.max-length",
-- "network.standard-url.punycode-host",
-- "network.sts.max_time_for_events_between_two_polls",
-- "network.sts.max_time_for_pr_close_during_shutdown",
-- "network.tcp.keepalive.enabled",
-- "network.tcp.keepalive.idle_time",
-- "network.tcp.keepalive.probe_count",
-- "network.tcp.keepalive.retry_interval",
-- "network.tcp.sendbuffer",
-- "nglayout.debug.invalidation",
-- "privacy.donottrackheader.enabled",
-- "privacy.firstparty.isolate",
-- "privacy.firstparty.isolate.restrict_opener_access",
-- "privacy.reduceTimerPrecision",
-- "privacy.resistFingerprinting",
-- "privacy.resistFingerprinting.autoDeclineNoUserInputCanvasPrompts",
-- "privacy.resistFingerprinting.reduceTimerPrecision.jitter",
-- "privacy.resistFingerprinting.reduceTimerPrecision.microseconds",
-- "privacy.resistFingerprinting.target_video_res",
-- "privacy.resistFingerprinting.video_dropped_ratio",
-- "privacy.resistFingerprinting.video_frames_per_sec",
-- "privacy.trackingprotection.lower_network_priority",
-- "privacy.window.maxInnerHeight",
-- "privacy.window.maxInnerWidth",
-- "security.csp.enable",
-- "security.data_uri.block_toplevel_data_uri_navigations",
-- "security.data_uri.unique_opaque_origin",
-- "security.fileuri.strict_origin_policy",
-- "security.mixed_content.block_active_content",
-- "security.mixed_content.block_display_content",
-- "security.mixed_content.block_object_subrequest",
-- "security.mixed_content.hsts_priming_cache_timeout",
-- "security.mixed_content.send_hsts_priming",
-- "security.mixed_content.upgrade_display_content",
-- "security.mixed_content.use_hsts",
-- "security.sandbox.content.level",
-- "security.sandbox.content.tempDirSuffix",
-- "security.sandbox.logging.enabled",
-- "security.sandbox.mac.track.violations",
-- "security.sandbox.windows.log.stackTraceDepth",
-- "svg.disabled",
-- "svg.display-lists.hit-testing.enabled",
-- "svg.display-lists.painting.enabled",
-- "svg.new-getBBox.enabled",
-- "svg.path-caching.enabled",
-- "svg.transform-box.enabled",
-- "toolkit.asyncshutdown.crash_timeout",
-- "toolkit.asyncshutdown.log",
-- "toolkit.osfile.log",
-- "toolkit.osfile.log.redirect",
-- "toolkit.telemetry.enabled",
-- "toolkit.telemetry.idleTimeout",
-- "toolkit.telemetry.initDelay",
-- "toolkit.telemetry.log.dump",
-- "toolkit.telemetry.log.level",
-- "toolkit.telemetry.minSubsessionLength",
-- "toolkit.telemetry.scheduler.idleTickInterval",
-- "toolkit.telemetry.scheduler.tickInterval",
-- "toolkit.telemetry.testing.overridePreRelease",
-- "toolkit.telemetry.unified",
-- "ui.key.menuAccessKeyFocuses",
-- "ui.popup.disable_autohide",
-- "ui.use_activity_cursor",
-- "view_source.editor.external",
-- "zoom.maxPercent",
-- "zoom.minPercent"
--};
+- "layout.css.shape-outside.enabled",
+- "layout.css.text-align-unsafe-value.enabled",
+- "layout.css.text-combine-upright-digits.enabled",
+- "layout.css.text-combine-upright.enabled",
+- "layout.css.text-justify.enabled",
+- "layout.css.touch_action.enabled",
+- "layout.css.visited_links_enabled",
+- "layout.idle_period.required_quiescent_frames",
+- "layout.idle_period.time_limit",
+- "layout.interruptible-reflow.enabled",
+- "mathml.disabled",
+- "media.audio-max-decode-error",
+- "media.cache_readahead_limit",
+- "media.cache_resume_threshold",
+- "media.cache_size",
+- "media.clearkey.persistent-license.enabled",
+- "media.cubeb.backend",
+- "media.cubeb.sandbox",
+- "media.cubeb_latency_msg_frames",
+- "media.cubeb_latency_playback_ms",
+- "media.decoder-doctor.wmf-disabled-is-failure",
+- "media.decoder.recycle.enabled",
+- "media.decoder.skip-to-next-key-frame.enabled",
+- "media.dormant-on-pause-timeout-ms",
+- "media.eme.audio.blank",
+- "media.eme.chromium-api.video-shmems",
+- "media.eme.enabled",
+- "media.eme.video.blank",
+- "media.ffmpeg.enabled",
+- "media.ffmpeg.low-latency.enabled",
+- "media.ffvpx.enabled",
+- "media.ffvpx.low-latency.enabled",
+- "media.flac.enabled",
+- "media.forcestereo.enabled",
+- "media.gmp.decoder.enabled",
+- "media.gmp.insecure.allow",
+- "media.gpu-process-decoder",
+- "media.hls.enabled",
+- "media.libavcodec.allow-obsolete",
+- "media.memory_cache_max_size",
+- "media.memory_caches_combined_limit_kb",
+- "media.memory_caches_combined_limit_pc_sysmem",
+- "media.mp4.enabled",
+- "media.navigator.mediadatadecoder_enabled",
+- "media.ogg.enabled",
+- "media.ogg.flac.enabled",
+- "media.playback.warnings-as-errors",
+- "media.playback.warnings-as-errors.stagefright-vs-rust",
+- "media.resampling.enabled",
+- "media.resume-bkgnd-video-on-tabhover",
+- "media.ruin-av-sync.enabled",
+- "media.rust.mp4parser",
+- "media.rust.test_mode",
+- "media.seamless-looping",
+- "media.suspend-bkgnd-video.delay-ms",
+- "media.suspend-bkgnd-video.enabled",
+- "media.use-blank-decoder",
+- "media.video-max-decode-error",
+- "media.video_stats.enabled",
+- "media.videocontrols.lock-video-orientation",
+- "media.volume_scale",
+- "media.webspeech.recognition.enable",
+- "media.webspeech.recognition.force_enable",
+- "media.webspeech.synth.force_global_queue",
+- "media.webspeech.test.enable",
+- "media.webspeech.test.fake_fsm_events",
+- "media.webspeech.test.fake_recognition_service",
+- "media.wmf.allow-unsupported-resolutions",
+- "media.wmf.enabled",
+- "media.wmf.skip-blacklist",
+- "media.wmf.vp9.enabled",
+- "network.IDN.blacklist_chars",
+- "network.IDN.restriction_profile",
+- "network.IDN.use_whitelist",
+- "network.IDN_show_punycode",
+- "network.buffer.cache.count",
+- "network.buffer.cache.size",
+- "network.captive-portal-service.enabled",
+- "network.cookie.cookieBehavior",
+- "network.cookie.lifetimePolicy",
+- "network.dns.disablePrefetch",
+- "network.dns.disablePrefetchFromHTTPS",
+- "network.file.disable_unc_paths",
+- "network.file.path_blacklist",
+- "network.http.tailing.enabled",
+- "network.jar.block-remote-files",
+- "network.loadinfo.skip_type_assertion",
+- "network.notify.changed",
+- "network.offline-mirrors-connectivity",
+- "network.protocol-handler.external.jar",
+- "network.proxy.type",
+- "network.security.ports.banned",
+- "network.security.ports.banned.override",
+- "network.standard-url.enable-rust",
+- "network.standard-url.max-length",
+- "network.standard-url.punycode-host",
+- "network.sts.max_time_for_events_between_two_polls",
+- "network.sts.max_time_for_pr_close_during_shutdown",
+- "network.tcp.keepalive.enabled",
+- "network.tcp.keepalive.idle_time",
+- "network.tcp.keepalive.probe_count",
+- "network.tcp.keepalive.retry_interval",
+- "network.tcp.sendbuffer",
+- "nglayout.debug.invalidation",
+- "privacy.donottrackheader.enabled",
+- "privacy.firstparty.isolate",
+- "privacy.firstparty.isolate.restrict_opener_access",
+- "privacy.reduceTimerPrecision",
+- "privacy.resistFingerprinting",
+- "privacy.resistFingerprinting.autoDeclineNoUserInputCanvasPrompts",
+- "privacy.resistFingerprinting.reduceTimerPrecision.jitter",
+- "privacy.resistFingerprinting.reduceTimerPrecision.microseconds",
+- "privacy.resistFingerprinting.target_video_res",
+- "privacy.resistFingerprinting.video_dropped_ratio",
+- "privacy.resistFingerprinting.video_frames_per_sec",
+- "privacy.spoof_english",
+- "privacy.trackingprotection.lower_network_priority",
+- "privacy.window.maxInnerHeight",
+- "privacy.window.maxInnerWidth",
+- "security.csp.enable",
+- "security.data_uri.block_toplevel_data_uri_navigations",
+- "security.data_uri.unique_opaque_origin",
+- "security.fileuri.strict_origin_policy",
+- "security.mixed_content.block_active_content",
+- "security.mixed_content.block_display_content",
+- "security.mixed_content.block_object_subrequest",
+- "security.mixed_content.hsts_priming_cache_timeout",
+- "security.mixed_content.send_hsts_priming",
+- "security.mixed_content.upgrade_display_content",
+- "security.mixed_content.use_hsts",
+- "security.sandbox.content.level",
+- "security.sandbox.content.tempDirSuffix",
+- "security.sandbox.logging.enabled",
+- "security.sandbox.mac.track.violations",
+- "security.sandbox.windows.log.stackTraceDepth",
+- "svg.disabled",
+- "svg.display-lists.hit-testing.enabled",
+- "svg.display-lists.painting.enabled",
+- "svg.new-getBBox.enabled",
+- "svg.path-caching.enabled",
+- "svg.transform-box.enabled",
+- "toolkit.asyncshutdown.crash_timeout",
+- "toolkit.asyncshutdown.log",
+- "toolkit.osfile.log",
+- "toolkit.osfile.log.redirect",
+- "toolkit.telemetry.enabled",
+- "toolkit.telemetry.idleTimeout",
+- "toolkit.telemetry.initDelay",
+- "toolkit.telemetry.log.dump",
+- "toolkit.telemetry.log.level",
+- "toolkit.telemetry.minSubsessionLength",
+- "toolkit.telemetry.scheduler.idleTickInterval",
+- "toolkit.telemetry.scheduler.tickInterval",
+- "toolkit.telemetry.testing.overridePreRelease",
+- "toolkit.telemetry.unified",
+- "ui.key.menuAccessKeyFocuses",
+- "ui.popup.disable_autohide",
+- "ui.use_activity_cursor",
+- "view_source.editor.external",
+- "zoom.maxPercent",
+- "zoom.minPercent"};
-
--const char** mozilla::dom::ContentPrefs::GetEarlyPrefs(size_t* aCount)
--{
+-const char** mozilla::dom::ContentPrefs::GetEarlyPrefs(size_t* aCount) {
- *aCount = ArrayLength(ContentPrefs::gEarlyPrefs);
- return gEarlyPrefs;
-}
-
--const char* mozilla::dom::ContentPrefs::GetEarlyPref(size_t aIndex)
--{
+-const char* mozilla::dom::ContentPrefs::GetEarlyPref(size_t aIndex) {
- MOZ_ASSERT(aIndex < ArrayLength(ContentPrefs::gEarlyPrefs));
- return gEarlyPrefs[aIndex];
-}
@@ -465,16 +463,16 @@ index 72ce8d236c11..000000000000
-namespace dom {
-
-class ContentPrefs {
--public:
+- public:
- static const char** GetEarlyPrefs(size_t* aCount);
- static const char* GetEarlyPref(size_t aIndex);
-
--private:
+- private:
- static const char* gEarlyPrefs[];
-};
-
--}
--}
+-} // namespace dom
+-} // namespace mozilla
-
-#endif
diff --git dom/ipc/ContentProcess.cpp dom/ipc/ContentProcess.cpp
@@ -489,7 +487,7 @@ index 2441c8cb9224..c00283dc5084 100644
#include "base/shared_memory.h"
#include "mozilla/Preferences.h"
#include "mozilla/Scheduler.h"
-@@ -226,8 +225,8 @@ ContentProcess::Init(int aArgc, char* aArgv[])
+@@ -212,8 +211,8 @@ bool ContentProcess::Init(int aArgc, char* aArgv[]) {
NS_ERROR("failed to map shared memory in the child");
return false;
}
@@ -499,7 +497,7 @@ index 2441c8cb9224..c00283dc5084 100644
+ prefsLen);
Scheduler::SetPrefs(schedulerPrefs);
- mContent.Init(IOThreadChild::message_loop(),
+ mContent.Init(IOThreadChild::message_loop(), ParentPid(),
diff --git dom/ipc/PContent.ipdl dom/ipc/PContent.ipdl
index 5d077976569a..fb967ffc53a9 100644
--- dom/ipc/PContent.ipdl
@@ -549,7 +547,7 @@ diff --git layout/style/nsCSSProps.h layout/style/nsCSSProps.h
index dce44bf61b35..80288336a08b 100644
--- layout/style/nsCSSProps.h
+++ layout/style/nsCSSProps.h
-@@ -645,7 +645,7 @@ public:
+@@ -640,7 +640,7 @@ class nsCSSProps {
// In the child process, assert that we're not trying to parse stylesheets
// before we've gotten all our prefs.
MOZ_ASSERT_IF(!XRE_IsParentProcess(),
@@ -570,43 +568,38 @@ index fe780686f2eb..488095f49236 100644
#include "mozilla/dom/PContent.h"
#include "mozilla/HashFunctions.h"
#include "mozilla/Logging.h"
-@@ -131,6 +130,29 @@ enum class PrefType : uint8_t
+@@ -129,6 +128,25 @@ enum class PrefType : uint8_t {
Bool = 3,
};
+// This is used for pref names and string pref values. We encode the string
+// length, then a '/', then the string chars. This encoding means there are no
+// special chars that are forbidden or require escaping.
-+static void
-+SerializeAndAppendString(const char* aChars, nsCString& aStr)
-+{
++static void SerializeAndAppendString(const char* aChars, nsCString& aStr) {
+ aStr.AppendInt(uint32_t(strlen(aChars)));
+ aStr.Append('/');
+ aStr.Append(aChars);
+}
+
-+static char*
-+DeserializeString(char* aChars, nsCString& aStr)
-+{
++static char* DeserializeString(char* aChars, nsCString& aStr) {
+ char* p = aChars;
+ uint32_t length = strtol(p, &p, 10);
+ MOZ_ASSERT(p[0] == '/');
-+ p++; // move past the '/'
++ p++; // move past the '/'
+ aStr.Assign(p, length);
-+ p += length; // move past the string itself
++ p += length; // move past the string itself
+ return p;
+}
+
// Keep this in sync with PrefValue in prefs_parser/src/lib.rs.
union PrefValue {
const char* mStringVal;
-@@ -223,6 +245,64 @@ union PrefValue {
+@@ -215,6 +233,61 @@ union PrefValue {
MOZ_CRASH();
}
}
+
-+ void SerializeAndAppend(PrefType aType, nsCString& aStr)
-+ {
++ void SerializeAndAppend(PrefType aType, nsCString& aStr) {
+ switch (aType) {
+ case PrefType::Bool:
+ aStr.Append(mBoolVal ? 'T' : 'F');
@@ -627,10 +620,8 @@ index fe780686f2eb..488095f49236 100644
+ }
+ }
+
-+ static char* Deserialize(PrefType aType,
-+ char* aStr,
-+ dom::MaybePrefValue* aDomValue)
-+ {
++ static char* Deserialize(PrefType aType, char* aStr,
++ dom::MaybePrefValue* aDomValue) {
+ char* p = aStr;
+
+ switch (aType) {
@@ -665,7 +656,7 @@ index fe780686f2eb..488095f49236 100644
};
#ifdef DEBUG
-@@ -694,6 +774,159 @@ public:
+@@ -656,6 +729,157 @@ class Pref {
return false;
}
@@ -721,8 +712,7 @@ index fe780686f2eb..488095f49236 100644
+ // - "S-:10/my.string2:5/1.234:\n"
+ // - "S-:10/my.string3::7/string!\n"
+
-+ void SerializeAndAppend(nsCString& aStr)
-+ {
++ void SerializeAndAppend(nsCString& aStr) {
+ switch (Type()) {
+ case PrefType::Bool:
+ aStr.Append('B');
@@ -759,8 +749,7 @@ index fe780686f2eb..488095f49236 100644
+ aStr.Append('\n');
+ }
+
-+ static char* Deserialize(char* aStr, dom::Pref* aDomPref)
-+ {
++ static char* Deserialize(char* aStr, dom::Pref* aDomPref) {
+ char* p = aStr;
+
+ // The type.
@@ -775,7 +764,7 @@ index fe780686f2eb..488095f49236 100644
+ NS_ERROR("bad pref type");
+ type = PrefType::None;
+ }
-+ p++; // move past the type char
++ p++; // move past the type char
+
+ // Locked?
+ bool isLocked;
@@ -787,17 +776,17 @@ index fe780686f2eb..488095f49236 100644
+ NS_ERROR("bad pref locked status");
+ isLocked = false;
+ }
-+ p++; // move past the isLocked char
++ p++; // move past the isLocked char
+
+ MOZ_ASSERT(*p == ':');
-+ p++; // move past the ':'
++ p++; // move past the ':'
+
+ // The pref name.
+ nsCString name;
+ p = DeserializeString(p, name);
+
+ MOZ_ASSERT(*p == ':');
-+ p++; // move past the ':' preceding the default value
++ p++; // move past the ':' preceding the default value
+
+ dom::MaybePrefValue maybeDefaultValue;
+ if (*p != ':') {
@@ -806,7 +795,7 @@ index fe780686f2eb..488095f49236 100644
+ }
+
+ MOZ_ASSERT(*p == ':');
-+ p++; // move past the ':' between the default and user values
++ p++; // move past the ':' between the default and user values
+
+ dom::MaybePrefValue maybeUserValue;
+ if (*p != '\n') {
@@ -815,23 +804,22 @@ index fe780686f2eb..488095f49236 100644
+ }
+
+ MOZ_ASSERT(*p == '\n');
-+ p++; // move past the '\n' following the user value
++ p++; // move past the '\n' following the user value
+
+ *aDomPref = dom::Pref(name, isLocked, maybeDefaultValue, maybeUserValue);
+
+ return p;
+ }
+
- void AddSizeOfIncludingThis(MallocSizeOf aMallocSizeOf, PrefsSizes& aSizes)
- {
+ void AddSizeOfIncludingThis(MallocSizeOf aMallocSizeOf, PrefsSizes& aSizes) {
// Note: mName is allocated in gPrefNameArena, measured elsewhere.
-@@ -880,41 +1113,9 @@ pref_savePrefs()
+ aSizes.mPrefValues += aMallocSizeOf(this);
+@@ -817,57 +1041,17 @@ static PrefSaveData pref_savePrefs() {
#ifdef DEBUG
-// For content processes, what prefs have been initialized?
--enum class ContentProcessPhase
--{
+-enum class ContentProcessPhase {
- eNoPrefsSet,
- eEarlyPrefsSet,
- eEarlyAndLatePrefsSet,
@@ -840,36 +828,28 @@ index fe780686f2eb..488095f49236 100644
// Note that this never changes in the parent process, and is only read in
// content processes.
-static ContentProcessPhase gPhase = ContentProcessPhase::eNoPrefsSet;
--
--struct StringComparator
--{
++static bool gContentProcessPrefsAreInited = false;
+
+-struct StringComparator {
- const char* mPrefName;
-
-- explicit StringComparator(const char* aPrefName)
-- : mPrefName(aPrefName)
-- {
-- }
+- explicit StringComparator(const char* aPrefName) : mPrefName(aPrefName) {}
-
-- int operator()(const char* aPrefName) const
-- {
+- int operator()(const char* aPrefName) const {
- return strcmp(mPrefName, aPrefName);
- }
-};
-
--static bool
--IsEarlyPref(const char* aPrefName)
--{
+-static bool IsEarlyPref(const char* aPrefName) {
- size_t prefsLen;
- size_t found;
- const char** list = mozilla::dom::ContentPrefs::GetEarlyPrefs(&prefsLen);
- return BinarySearchIf(list, 0, prefsLen, StringComparator(aPrefName), &found);
-}
-+static bool gContentProcessPrefsAreInited = false;
-
- #endif // DEBUG
+-
+ #endif // DEBUG
-@@ -923,23 +1124,7 @@ pref_HashTableLookupInner(const char* aPrefName)
- {
+ static PrefEntry* pref_HashTableLookupInner(const char* aPrefName) {
MOZ_ASSERT(NS_IsMainThread() || mozilla::ServoStyleSet::IsInServoTraversal());
-#ifdef DEBUG
@@ -878,33 +858,34 @@ index fe780686f2eb..488095f49236 100644
- MOZ_CRASH_UNSAFE_PRINTF("accessing pref %s before early prefs are set",
- aPrefName);
- }
--
++ MOZ_ASSERT_IF(!XRE_IsParentProcess(), gContentProcessPrefsAreInited);
+
- if (gPhase == ContentProcessPhase::eEarlyPrefsSet &&
- !IsEarlyPref(aPrefName)) {
- // If you hit this crash, you have an early access of a non-early pref.
- // Consider moving the access later or add the pref to the whitelist of
- // early prefs in ContentPrefs.cpp and get review from a DOM peer.
- MOZ_CRASH_UNSAFE_PRINTF(
-- "accessing non-early pref %s before late prefs are set", aPrefName);
+- "accessing non-early pref %s before late prefs are set", aPrefName);
- }
- }
-#endif
-+ MOZ_ASSERT_IF(!XRE_IsParentProcess(), gContentProcessPrefsAreInited);
-
+-
return static_cast<PrefEntry*>(gHashTable->Search(aPrefName));
}
-@@ -2932,8 +3117,8 @@ public:
- } // namespace
+@@ -2637,8 +2821,8 @@ class AddPreferencesMemoryReporterRunnable : public Ru
+
+ } // namespace
-// A list of prefs sent early from the parent, via shared memory.
-static InfallibleTArray<dom::Pref>* gEarlyDomPrefs;
+// A list of changed prefs sent from the parent via shared memory.
+static InfallibleTArray<dom::Pref>* gChangedDomPrefs;
- static const char kTelemetryPref[] = "toolkit.telemetry.enabled";
- static const char kChannelPref[] = "app.update.channel";
-@@ -3050,12 +3235,12 @@ Preferences::GetInstanceForService()
+ /* static */ already_AddRefed<Preferences>
+ Preferences::GetInstanceForService() {
+@@ -2668,12 +2852,12 @@ Preferences::GetInstanceForService() {
}
if (!XRE_IsParentProcess()) {
@@ -922,19 +903,19 @@ index fe780686f2eb..488095f49236 100644
} else {
// Check if there is a deployment configuration file. If so, set up the
-@@ -3179,149 +3364,44 @@ NS_IMPL_ISUPPORTS(Preferences,
+@@ -2782,143 +2966,45 @@ Preferences::~Preferences() {
+ NS_IMPL_ISUPPORTS(Preferences, nsIPrefService, nsIObserver, nsIPrefBranch,
nsISupportsWeakReference)
- /* static */ void
--Preferences::SerializeEarlyPreferences(nsCString& aStr)
-+Preferences::SerializePreferences(nsCString& aStr)
- {
+-/* static */ void Preferences::SerializeEarlyPreferences(nsCString& aStr) {
++/* static */ void Preferences::SerializePreferences(nsCString& aStr) {
MOZ_RELEASE_ASSERT(InitStaticMembers());
- nsAutoCStringN<256> boolPrefs, intPrefs, stringPrefs;
- size_t numEarlyPrefs;
- dom::ContentPrefs::GetEarlyPrefs(&numEarlyPrefs);
--
++ aStr.Truncate();
+
- for (unsigned int i = 0; i < numEarlyPrefs; i++) {
- const char* prefName = dom::ContentPrefs::GetEarlyPref(i);
- MOZ_ASSERT_IF(i > 0,
@@ -943,34 +924,33 @@ index fe780686f2eb..488095f49236 100644
- Pref* pref = pref_HashTableLookup(prefName);
- if (!pref || !pref->MustSendToContentProcesses()) {
- continue;
-- }
-+ aStr.Truncate();
-
++ for (auto iter = gHashTable->Iter(); !iter.Done(); iter.Next()) {
++ Pref* pref = static_cast<PrefEntry*>(iter.Get())->mPref;
++ if (pref->MustSendToContentProcesses() && pref->HasAdvisablySizedValues()) {
++ pref->SerializeAndAppend(aStr);
+ }
+-
- switch (pref->Type()) {
- case PrefType::Bool:
- boolPrefs.Append(
-- nsPrintfCString("%u:%d|", i, Preferences::GetBool(prefName)));
+- nsPrintfCString("%u:%d|", i, Preferences::GetBool(prefName)));
- break;
- case PrefType::Int:
- intPrefs.Append(
-- nsPrintfCString("%u:%d|", i, Preferences::GetInt(prefName)));
+- nsPrintfCString("%u:%d|", i, Preferences::GetInt(prefName)));
- break;
- case PrefType::String: {
- nsAutoCString value;
- Preferences::GetCString(prefName, value);
- stringPrefs.Append(
-- nsPrintfCString("%u:%d;%s|", i, value.Length(), value.get()));
+- nsPrintfCString("%u:%d;%s|", i, value.Length(), value.get()));
- } break;
- case PrefType::None:
- break;
- default:
- printf_stderr("preference type: %d\n", int(pref->Type()));
- MOZ_CRASH();
-+ for (auto iter = gHashTable->Iter(); !iter.Done(); iter.Next()) {
-+ Pref* pref = static_cast<PrefEntry*>(iter.Get())->mPref;
-+ if (pref->MustSendToContentProcesses() && pref->HasAdvisablySizedValues()) {
-+ pref->SerializeAndAppend(aStr);
- }
+- }
}
- aStr.Truncate();
@@ -983,10 +963,10 @@ index fe780686f2eb..488095f49236 100644
aStr.Append('\0');
}
- /* static */ void
--Preferences::DeserializeEarlyPreferences(char* aStr, size_t aStrLen)
-+Preferences::DeserializePreferences(char* aStr, size_t aPrefsLen)
- {
+-/* static */ void Preferences::DeserializeEarlyPreferences(char* aStr,
+- size_t aStrLen) {
++/* static */ void Preferences::DeserializePreferences(char* aStr,
++ size_t aPrefsLen) {
MOZ_ASSERT(!XRE_IsParentProcess());
- MOZ_ASSERT(!gEarlyDomPrefs);
@@ -1011,26 +991,26 @@ index fe780686f2eb..488095f49236 100644
- MOZ_ASSERT(p[0] == '|');
- p++;
- dom::Pref pref(nsCString(dom::ContentPrefs::GetEarlyPref(index)),
-- /* isLocked */ false,
-- value,
-- dom::MaybePrefValue());
+- /* isLocked */ false, value, dom::MaybePrefValue());
- gEarlyDomPrefs->AppendElement(pref);
-- }
++ while (*p != '\0') {
++ dom::Pref pref;
++ p = Pref::Deserialize(p, &pref);
++ gChangedDomPrefs->AppendElement(pref);
+ }
- p++;
--
+
- // Get the int prefs.
- while (*p != '\n') {
- int32_t index = strtol(p, &p, 10);
- MOZ_ASSERT(p[0] == ':');
- p++;
- dom::MaybePrefValue value(
-- dom::PrefValue(static_cast<int32_t>(strtol(p, &p, 10))));
+- dom::PrefValue(static_cast<int32_t>(strtol(p, &p, 10))));
- MOZ_ASSERT(p[0] == '|');
- p++;
- dom::Pref pref(nsCString(dom::ContentPrefs::GetEarlyPref(index)),
-- /* isLocked */ false,
-- value,
-- dom::MaybePrefValue());
+- /* isLocked */ false, value, dom::MaybePrefValue());
- gEarlyDomPrefs->AppendElement(pref);
- }
- p++;
@@ -1045,9 +1025,7 @@ index fe780686f2eb..488095f49236 100644
- p++;
- dom::MaybePrefValue value(dom::PrefValue(nsCString(p, length)));
- dom::Pref pref(nsCString(dom::ContentPrefs::GetEarlyPref(index)),
-- /* isLocked */ false,
-- value,
-- dom::MaybePrefValue());
+- /* isLocked */ false, value, dom::MaybePrefValue());
- gEarlyDomPrefs->AppendElement(pref);
- p += length + 1;
- MOZ_ASSERT(*(p - 1) == '|');
@@ -1055,48 +1033,43 @@ index fe780686f2eb..488095f49236 100644
- p++;
-
- MOZ_ASSERT(*p == '\0');
-+ while (*p != '\0') {
-+ dom::Pref pref;
-+ p = Pref::Deserialize(p, &pref);
-+ gChangedDomPrefs->AppendElement(pref);
-+ }
-
+-
// We finished parsing on a '\0'. That should be the last char in the shared
- // memory.
- MOZ_ASSERT(aStr + aStrLen - 1 == p);
--
--#ifdef DEBUG
-- MOZ_ASSERT(gPhase == ContentProcessPhase::eNoPrefsSet);
-- gPhase = ContentProcessPhase::eEarlyPrefsSet;
--#endif
--}
--
--/* static */ void
--Preferences::SetLatePreferences(const nsTArray<dom::Pref>* aDomPrefs)
--{
-- MOZ_ASSERT(!XRE_IsParentProcess());
--
-- for (unsigned int i = 0; i < aDomPrefs->Length(); i++) {
-- Preferences::SetPreference(aDomPrefs->ElementAt(i));
-- }
+ // memory. (aPrefsLen includes the '\0'.)
+ MOZ_ASSERT(p == aStr + aPrefsLen - 1);
#ifdef DEBUG
-- MOZ_ASSERT(gPhase == ContentProcessPhase::eEarlyPrefsSet);
-- gPhase = ContentProcessPhase::eEarlyAndLatePrefsSet;
+- MOZ_ASSERT(gPhase == ContentProcessPhase::eNoPrefsSet);
+- gPhase = ContentProcessPhase::eEarlyPrefsSet;
+ MOZ_ASSERT(!gContentProcessPrefsAreInited);
+ gContentProcessPrefsAreInited = true;
#endif
}
-@@ -3558,36 +3638,12 @@ Preferences::GetPreference(dom::Pref* aDomPref)
+-/* static */ void Preferences::SetLatePreferences(
+- const nsTArray<dom::Pref>* aDomPrefs) {
+- MOZ_ASSERT(!XRE_IsParentProcess());
+-
+- for (unsigned int i = 0; i < aDomPrefs->Length(); i++) {
+- Preferences::SetPreference(aDomPrefs->ElementAt(i));
+- }
+-
+-#ifdef DEBUG
+- MOZ_ASSERT(gPhase == ContentProcessPhase::eEarlyPrefsSet);
+- gPhase = ContentProcessPhase::eEarlyAndLatePrefsSet;
+-#endif
+-}
+-
+ /* static */ void Preferences::InitializeUserPrefs() {
+ MOZ_ASSERT(XRE_IsParentProcess());
+ MOZ_ASSERT(!sPreferences->mCurrentFile, "Should only initialize prefs once");
+@@ -3133,32 +3219,10 @@ Preferences::SavePrefFile(nsIFile* aFile) {
}
}
--void
--Preferences::GetPreferences(InfallibleTArray<dom::Pref>* aDomPrefs)
--{
+-void Preferences::GetPreferences(InfallibleTArray<dom::Pref>* aDomPrefs) {
- MOZ_ASSERT(XRE_IsParentProcess());
- MOZ_ASSERT(NS_IsMainThread());
-
@@ -1119,10 +1092,8 @@ index fe780686f2eb..488095f49236 100644
-}
-
#ifdef DEBUG
- bool
--Preferences::AreAllPrefsSetInContentProcess()
-+Preferences::ArePrefsInitedInContentProcess()
- {
+-bool Preferences::AreAllPrefsSetInContentProcess() {
++bool Preferences::ArePrefsInitedInContentProcess() {
MOZ_ASSERT(!XRE_IsParentProcess());
- return gPhase == ContentProcessPhase::eEarlyAndLatePrefsSet;
+ return gContentProcessPrefsAreInited;
@@ -1133,8 +1104,8 @@ diff --git modules/libpref/Preferences.h modules/libpref/Preferences.h
index 0d976483daae..901425b5b663 100644
--- modules/libpref/Preferences.h
+++ modules/libpref/Preferences.h
-@@ -328,15 +328,10 @@ public:
- const char* aPref,
+@@ -277,15 +277,10 @@ class Preferences final : public nsIPrefService,
+ static nsresult AddFloatVarCache(float* aVariable, const char* aPref,
float aDefault = 0.0f);
- // When a content process is created these methods are used to pass prefs in
@@ -1153,7 +1124,7 @@ index 0d976483daae..901425b5b663 100644
// When a single pref is changed in the parent process, these methods are
// used to pass the update to content processes.
-@@ -344,7 +339,7 @@ public:
+@@ -293,7 +288,7 @@ class Preferences final : public nsIPrefService,
static void SetPreference(const dom::Pref& aPref);
#ifdef DEBUG