Bug 1806501 - Start the JS Oracle process early. r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D167230
This commit is contained in:
Andreas Farre
2023-01-24 15:37:49 +00:00
parent ad29180b54
commit fba7fef652
4 changed files with 22 additions and 0 deletions

View File

@@ -6,6 +6,7 @@
#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
@@ -1762,6 +1763,12 @@ 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 =