Bug 1809518 - Use stencil parsing to do the Javascript check for ORB in Utility Process r=farre,smaug,tcampbell
This patch allows JS Validator to parse the incoming data into stencil to verify if its a Javascript file. Differential Revision: https://phabricator.services.mozilla.com/D166484
This commit is contained in:
@@ -110,6 +110,15 @@ bool UtilityProcessChild::Init(mozilla::ipc::UntypedEndpoint&& aEndpoint,
|
||||
|
||||
mSandbox = (SandboxingKind)aSandboxingKind;
|
||||
|
||||
// At the moment, only ORB uses JSContext in the
|
||||
// Utility Process and ORB uses GENERIC_UTILITY
|
||||
if (mSandbox == SandboxingKind::GENERIC_UTILITY) {
|
||||
JS::DisableJitBackend();
|
||||
if (!JS_Init()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
profiler_set_process_name(nsCString("Utility Process"));
|
||||
|
||||
// Notify the parent process that we have finished our init and that it can
|
||||
@@ -117,9 +126,12 @@ bool UtilityProcessChild::Init(mozilla::ipc::UntypedEndpoint&& aEndpoint,
|
||||
SendInitCompleted();
|
||||
|
||||
RunOnShutdown(
|
||||
[] {
|
||||
[sandboxKind = mSandbox] {
|
||||
StaticMutexAutoLock lock(sUtilityProcessChildMutex);
|
||||
sUtilityProcessChild = nullptr;
|
||||
if (sandboxKind == SandboxingKind::GENERIC_UTILITY) {
|
||||
JS_ShutDown();
|
||||
}
|
||||
},
|
||||
ShutdownPhase::XPCOMShutdownFinal);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user