mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-15 08:53:07 +09:00
Bug 604026 - Sync event loops in workers should be created only if compatible with the worker shutdown status
This commit is contained in:
parent
df880ae53f
commit
98546534b0
17 changed files with 102 additions and 56 deletions
|
|
@ -2118,12 +2118,16 @@ LoadAllScripts(WorkerPrivate* aWorkerPrivate,
|
|||
aWorkerPrivate->AssertIsOnWorkerThread();
|
||||
NS_ASSERTION(!aLoadInfos.IsEmpty(), "Bad arguments!");
|
||||
|
||||
AutoSyncLoopHolder syncLoop(aWorkerPrivate);
|
||||
AutoSyncLoopHolder syncLoop(aWorkerPrivate, Terminating);
|
||||
nsCOMPtr<nsIEventTarget> syncLoopTarget = syncLoop.GetEventTarget();
|
||||
if (!syncLoopTarget) {
|
||||
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
RefPtr<ScriptLoaderRunnable> loader =
|
||||
new ScriptLoaderRunnable(aWorkerPrivate, syncLoop.EventTarget(),
|
||||
aLoadInfos, aIsMainScript, aWorkerScriptType,
|
||||
aRv);
|
||||
new ScriptLoaderRunnable(aWorkerPrivate, syncLoopTarget, aLoadInfos,
|
||||
aIsMainScript, aWorkerScriptType, aRv);
|
||||
|
||||
NS_ASSERTION(aLoadInfos.IsEmpty(), "Should have swapped!");
|
||||
|
||||
|
|
@ -2184,7 +2188,7 @@ ChannelFromScriptURLWorkerThread(JSContext* aCx,
|
|||
new ChannelGetterRunnable(aParent, aScriptURL, aChannel);
|
||||
|
||||
ErrorResult rv;
|
||||
getter->Dispatch(rv);
|
||||
getter->Dispatch(Terminating, rv);
|
||||
if (rv.Failed()) {
|
||||
NS_ERROR("Failed to dispatch!");
|
||||
return rv.StealNSResult();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue