mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-15 08:53:07 +09:00
Stop using the MainThreadTaskQueue from service workers.
This commit is contained in:
parent
01216fbc62
commit
3b98b8ca9a
7 changed files with 23 additions and 36 deletions
|
|
@ -400,13 +400,7 @@ void RespondWithCopyComplete(void* aClosure, nsresult aStatus)
|
|||
data->mScriptSpec,
|
||||
data->mResponseURLSpec);
|
||||
}
|
||||
// In theory this can happen after the worker thread is terminated.
|
||||
WorkerPrivate* worker = GetCurrentThreadWorkerPrivate();
|
||||
if (worker) {
|
||||
MOZ_ALWAYS_SUCCEEDS(worker->DispatchToMainThread(event.forget()));
|
||||
} else {
|
||||
MOZ_ALWAYS_SUCCEEDS(NS_DispatchToMainThread(event.forget()));
|
||||
}
|
||||
MOZ_ALWAYS_SUCCEEDS(NS_DispatchToMainThread(event));
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
|
@ -734,13 +728,7 @@ RespondWithHandler::CancelRequest(nsresult aStatus)
|
|||
{
|
||||
nsCOMPtr<nsIRunnable> runnable =
|
||||
new CancelChannelRunnable(mInterceptedChannel, mRegistration, aStatus);
|
||||
// Note, this may run off the worker thread during worker termination.
|
||||
WorkerPrivate* worker = GetCurrentThreadWorkerPrivate();
|
||||
if (worker) {
|
||||
MOZ_ALWAYS_SUCCEEDS(worker->DispatchToMainThread(runnable.forget()));
|
||||
} else {
|
||||
MOZ_ALWAYS_SUCCEEDS(NS_DispatchToMainThread(runnable.forget()));
|
||||
}
|
||||
NS_DispatchToMainThread(runnable);
|
||||
mRequestWasHandled = true;
|
||||
}
|
||||
|
||||
|
|
@ -873,8 +861,8 @@ public:
|
|||
mColumn = column;
|
||||
}
|
||||
|
||||
MOZ_ALWAYS_SUCCEEDS(mWorkerPrivate->DispatchToMainThread(
|
||||
NewRunnableMethod(this, &WaitUntilHandler::ReportOnMainThread)));
|
||||
MOZ_ALWAYS_SUCCEEDS(
|
||||
NS_DispatchToMainThread(NewRunnableMethod(this, &WaitUntilHandler::ReportOnMainThread)));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue