mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-09 01:08:39 +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
|
|
@ -214,7 +214,7 @@ private:
|
|||
mDone = true;
|
||||
#endif
|
||||
mCallback->SetResult(aResult);
|
||||
MOZ_ALWAYS_SUCCEEDS(mWorkerPrivate->DispatchToMainThread(mCallback));
|
||||
MOZ_ALWAYS_SUCCEEDS(NS_DispatchToMainThread(mCallback));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -500,7 +500,7 @@ public:
|
|||
if (mRegistration) {
|
||||
nsCOMPtr<nsIRunnable> runnable =
|
||||
new RegistrationUpdateRunnable(mRegistration, true /* time check */);
|
||||
aWorkerPrivate->DispatchToMainThread(runnable.forget());
|
||||
NS_DispatchToMainThread(runnable.forget());
|
||||
}
|
||||
|
||||
ExtendableEventWorkerRunnable::PostRun(aCx, aWorkerPrivate, aRunResult);
|
||||
|
|
@ -541,7 +541,7 @@ public:
|
|||
Cancel() override
|
||||
{
|
||||
mCallback->SetResult(false);
|
||||
MOZ_ALWAYS_SUCCEEDS(mWorkerPrivate->DispatchToMainThread(mCallback));
|
||||
MOZ_ALWAYS_SUCCEEDS(NS_DispatchToMainThread(mCallback));
|
||||
|
||||
return WorkerRunnable::Cancel();
|
||||
}
|
||||
|
|
@ -637,7 +637,7 @@ public:
|
|||
mDone = true;
|
||||
|
||||
mCallback->SetResult(aResult);
|
||||
nsresult rv = mWorkerPrivate->DispatchToMainThread(mCallback);
|
||||
nsresult rv = NS_DispatchToMainThread(mCallback);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
NS_RUNTIMEABORT("Failed to dispatch life cycle event handler.");
|
||||
}
|
||||
|
|
@ -768,7 +768,6 @@ public:
|
|||
|
||||
void Report(uint16_t aReason = nsIPushErrorReporter::DELIVERY_INTERNAL_ERROR)
|
||||
{
|
||||
WorkerPrivate* workerPrivate = mWorkerPrivate;
|
||||
mWorkerPrivate->AssertIsOnWorkerThread();
|
||||
mWorkerPrivate = nullptr;
|
||||
|
||||
|
|
@ -780,7 +779,7 @@ public:
|
|||
NewRunnableMethod<uint16_t>(this,
|
||||
&PushErrorReporter::ReportOnMainThread, aReason);
|
||||
MOZ_ALWAYS_TRUE(NS_SUCCEEDED(
|
||||
workerPrivate->DispatchToMainThread(runnable.forget())));
|
||||
NS_DispatchToMainThread(runnable.forget())));
|
||||
}
|
||||
|
||||
void ReportOnMainThread(uint16_t aReason)
|
||||
|
|
@ -1434,7 +1433,7 @@ public:
|
|||
Cancel() override
|
||||
{
|
||||
nsCOMPtr<nsIRunnable> runnable = new ResumeRequest(mInterceptedChannel);
|
||||
if (NS_FAILED(mWorkerPrivate->DispatchToMainThread(runnable))) {
|
||||
if (NS_FAILED(NS_DispatchToMainThread(runnable))) {
|
||||
NS_WARNING("Failed to resume channel on FetchEventRunnable::Cancel()!\n");
|
||||
}
|
||||
WorkerRunnable::Cancel();
|
||||
|
|
@ -1554,7 +1553,7 @@ private:
|
|||
NS_ERROR_INTERCEPTION_FAILED);
|
||||
}
|
||||
|
||||
MOZ_ALWAYS_SUCCEEDS(mWorkerPrivate->DispatchToMainThread(runnable.forget()));
|
||||
MOZ_ALWAYS_SUCCEEDS(NS_DispatchToMainThread(runnable));
|
||||
}
|
||||
|
||||
RefPtr<Promise> waitUntilPromise = event->GetPromise();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue