Bug 1842798 - Part 2: Remove use of MozPromise to wait for module imports to load r=smaug
This replaces the use of a promise to wait for all imports of a module to load with a counter of reminaing imports in the parent and a pointer to the parent that is waiting in the child. The parent request is updated immediately rather than by dispatching a runnable. Differential Revision: https://phabricator.services.mozilla.com/D183273
This commit is contained in:
@@ -1210,6 +1210,13 @@ bool WorkerScriptLoader::EvaluateScript(JSContext* aCx,
|
||||
}
|
||||
|
||||
void WorkerScriptLoader::TryShutdown() {
|
||||
{
|
||||
MutexAutoLock lock(CleanUpLock());
|
||||
if (CleanedUp()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (AllScriptsExecuted() && AllModuleRequestsLoaded()) {
|
||||
ShutdownScriptLoader(!mExecutionAborted, mMutedErrorFlag);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user