From b6d0a7193611f1fd5fbd2111aaf3b31d7f7fd6d8 Mon Sep 17 00:00:00 2001 From: Sandor Molnar Date: Tue, 24 Jan 2023 18:31:34 +0200 Subject: [PATCH] Backed out 2 changesets (bug 1812035, bug 1806501) for causing bc failures in ipc/glue/test/browser/browser_utility_audioDecodeCrash.js CLOSED TREE Backed out changeset d7f1a776a986 (bug 1806501) Backed out changeset 4a44daa59af4 (bug 1812035) --- browser/components/BrowserGlue.sys.mjs | 8 -------- dom/base/ChromeUtils.cpp | 13 ------------- dom/base/ChromeUtils.h | 4 ---- dom/chrome-webidl/ChromeUtils.webidl | 11 ----------- ipc/glue/UtilityProcessManager.h | 3 +-- .../aboutmemory/tests/test_aboutmemory5.xhtml | 2 +- .../aboutmemory/tests/test_memoryReporters.xhtml | 2 +- .../tests/test_memoryReporters2.xhtml | 4 ++-- xpcom/base/nsMemoryReporterManager.cpp | 16 +++++++--------- 9 files changed, 12 insertions(+), 51 deletions(-) diff --git a/browser/components/BrowserGlue.sys.mjs b/browser/components/BrowserGlue.sys.mjs index 17fc138c15ff..13a169d9ae04 100644 --- a/browser/components/BrowserGlue.sys.mjs +++ b/browser/components/BrowserGlue.sys.mjs @@ -2855,14 +2855,6 @@ BrowserGlue.prototype = { }, }, - { - // Starts the JSOracle process for ORB JavaScript validation, if it hasn't started already. - name: "start-orb-javascript-oracle", - task: () => { - ChromeUtils.ensureJSOracleStarted(); - }, - }, - { name: "browser-startup-idle-tasks-finished", task: () => { diff --git a/dom/base/ChromeUtils.cpp b/dom/base/ChromeUtils.cpp index 7a0828a9b102..8f58ddf397ef 100644 --- a/dom/base/ChromeUtils.cpp +++ b/dom/base/ChromeUtils.cpp @@ -6,7 +6,6 @@ #include "ChromeUtils.h" -#include "JSOracleParent.h" #include "js/CharacterEncoding.h" #include "js/Object.h" // JS::GetClass #include "js/PropertyAndElement.h" // JS_DefineProperty, JS_DefinePropertyById, JS_Enumerate, JS_GetProperty, JS_GetPropertyById, JS_SetProperty, JS_SetPropertyById, JS::IdVector @@ -1763,16 +1762,4 @@ bool ChromeUtils::IsDarkBackground(GlobalObject&, Element& aElement) { double ChromeUtils::DateNow(GlobalObject&) { return JS_Now() / 1000.0; } -/* static */ -void ChromeUtils::EnsureJSOracleStarted(GlobalObject&) { - JSOracleParent::WithJSOracle( - [](JSOracleParent* aParent) { MOZ_DIAGNOSTIC_ASSERT(aParent); }); -} - -/* static */ -unsigned ChromeUtils::AliveUtilityProcesses(const GlobalObject&) { - const auto& utilityProcessManager = - mozilla::ipc::UtilityProcessManager::GetIfExists(); - return utilityProcessManager ? utilityProcessManager->AliveProcesses() : 0; -} } // namespace mozilla::dom diff --git a/dom/base/ChromeUtils.h b/dom/base/ChromeUtils.h index 9b570d9d92b4..464cd9cd9992 100644 --- a/dom/base/ChromeUtils.h +++ b/dom/base/ChromeUtils.h @@ -284,10 +284,6 @@ class ChromeUtils { static bool IsDarkBackground(GlobalObject&, Element&); static double DateNow(GlobalObject&); - - static void EnsureJSOracleStarted(GlobalObject&); - - static unsigned AliveUtilityProcesses(const GlobalObject&); }; } // namespace dom diff --git a/dom/chrome-webidl/ChromeUtils.webidl b/dom/chrome-webidl/ChromeUtils.webidl index 564a2d069c0c..f8f0b02ee7c3 100644 --- a/dom/chrome-webidl/ChromeUtils.webidl +++ b/dom/chrome-webidl/ChromeUtils.webidl @@ -653,17 +653,6 @@ partial namespace ChromeUtils { * Returns whether the background of the element is dark. */ boolean isDarkBackground(Element element); - - /** - * Starts the JSOracle process for ORB JavaScript validation, if it hasn't started already. - */ - undefined ensureJSOracleStarted(); - - /** - * The number of currently alive utility processes. - */ - [ChromeOnly] - readonly attribute unsigned long aliveUtilityProcesses; }; /* diff --git a/ipc/glue/UtilityProcessManager.h b/ipc/glue/UtilityProcessManager.h index edf534d35966..70c763546c66 100644 --- a/ipc/glue/UtilityProcessManager.h +++ b/ipc/glue/UtilityProcessManager.h @@ -130,8 +130,6 @@ class UtilityProcessManager final : public UtilityProcessHost::Listener { // Shutdown all utility processes void CleanShutdownAllProcesses(); - uint16_t AliveProcesses(); - private: ~UtilityProcessManager(); @@ -198,6 +196,7 @@ class UtilityProcessManager final : public UtilityProcessHost::Listener { RefPtr GetProcess(SandboxingKind); bool NoMoreProcesses(); + uint16_t AliveProcesses(); }; } // namespace ipc diff --git a/toolkit/components/aboutmemory/tests/test_aboutmemory5.xhtml b/toolkit/components/aboutmemory/tests/test_aboutmemory5.xhtml index a5cb757a9431..dcec9620aa7e 100644 --- a/toolkit/components/aboutmemory/tests/test_aboutmemory5.xhtml +++ b/toolkit/components/aboutmemory/tests/test_aboutmemory5.xhtml @@ -132,7 +132,7 @@ socketProcessRunning = 1; } - let m2 = (vsizes.length == (4 + socketProcessRunning + ChromeUtils.aliveUtilityProcesses) && + let m2 = (vsizes.length == (4 + socketProcessRunning) && endOfBrowsers.length == 3); ok(m2, "three content processes present in loaded data"); good = good && !!m2; diff --git a/toolkit/components/aboutmemory/tests/test_memoryReporters.xhtml b/toolkit/components/aboutmemory/tests/test_memoryReporters.xhtml index 6abf47b8c375..1f563eec5b53 100644 --- a/toolkit/components/aboutmemory/tests/test_memoryReporters.xhtml +++ b/toolkit/components/aboutmemory/tests/test_memoryReporters.xhtml @@ -230,7 +230,7 @@ if (SpecialPowers.Services.io.socketProcessLaunched) { socketProcessRunning = 1; } - is(aAmounts.length, (1 + socketProcessRunning + ChromeUtils.aliveUtilityProcesses), + ok(aAmounts.length == (1 + socketProcessRunning), aName + " has " + aAmounts.length + " report"); let n = aAmounts[0]; if (!aCanBeUnreasonable) { diff --git a/toolkit/components/aboutmemory/tests/test_memoryReporters2.xhtml b/toolkit/components/aboutmemory/tests/test_memoryReporters2.xhtml index 3475687db2e0..d457c15164ca 100644 --- a/toolkit/components/aboutmemory/tests/test_memoryReporters2.xhtml +++ b/toolkit/components/aboutmemory/tests/test_memoryReporters2.xhtml @@ -22,7 +22,7 @@ socketProcessRunning = 1; } let numToOpen = 3; - const expectedNumRemotes = numToOpen + socketProcessRunning + ChromeUtils.aliveUtilityProcesses; + const expectedNumRemotes = numToOpen + socketProcessRunning; let numReady = 0; // Create some remote processes, and set up message-passing so that @@ -89,7 +89,7 @@ } else { ok(processes[i].startsWith("Browser (") || processes[i].startsWith("Web Content (") || (processes[i].startsWith("Socket (") && socketProcessRunning) - || processes[i].startsWith("web (") || processes[i].startsWith("Utility ("), + || processes[i].startsWith("web ("), "correct non-empty process name prefix: " + processes[i]); numNonEmptyProcesses++; } diff --git a/xpcom/base/nsMemoryReporterManager.cpp b/xpcom/base/nsMemoryReporterManager.cpp index 58b7bce261de..064ba4e0b88a 100644 --- a/xpcom/base/nsMemoryReporterManager.cpp +++ b/xpcom/base/nsMemoryReporterManager.cpp @@ -1870,15 +1870,13 @@ nsresult nsMemoryReporterManager::StartGettingReports() { } } - if (!IsRegistrationBlocked()) { - if (RefPtr utility = - UtilityProcessManager::GetIfExists()) { - for (RefPtr& parent : - utility->GetAllProcessesProcessParent()) { - if (RefPtr proc = - utility->GetProcessMemoryReporter(parent)) { - s->mChildrenPending.AppendElement(proc.forget()); - } + if (RefPtr utility = + UtilityProcessManager::GetIfExists()) { + for (RefPtr& parent : + utility->GetAllProcessesProcessParent()) { + if (RefPtr proc = + utility->GetProcessMemoryReporter(parent)) { + s->mChildrenPending.AppendElement(proc.forget()); } } }