mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-09 01:08:39 +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
|
|
@ -1113,6 +1113,12 @@ public:
|
|||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
Dispatch(ErrorResult& aRv)
|
||||
{
|
||||
WorkerMainThreadRunnable::Dispatch(Terminating, aRv);
|
||||
}
|
||||
|
||||
private:
|
||||
nsAString& mValue;
|
||||
GetterType mType;
|
||||
|
|
@ -1213,6 +1219,12 @@ public:
|
|||
return mFailed;
|
||||
}
|
||||
|
||||
void
|
||||
Dispatch(ErrorResult& aRv)
|
||||
{
|
||||
WorkerMainThreadRunnable::Dispatch(Terminating, aRv);
|
||||
}
|
||||
|
||||
private:
|
||||
const nsString mValue;
|
||||
SetterType mType;
|
||||
|
|
@ -1224,7 +1236,7 @@ already_AddRefed<URLWorker>
|
|||
FinishConstructor(JSContext* aCx, WorkerPrivate* aPrivate,
|
||||
ConstructorRunnable* aRunnable, ErrorResult& aRv)
|
||||
{
|
||||
aRunnable->Dispatch(aRv);
|
||||
aRunnable->Dispatch(Terminating, aRv);
|
||||
if (NS_WARN_IF(aRv.Failed())) {
|
||||
return nullptr;
|
||||
}
|
||||
|
|
@ -1302,7 +1314,7 @@ URLWorker::CreateObjectURL(const GlobalObject& aGlobal, Blob& aBlob,
|
|||
RefPtr<CreateURLRunnable> runnable =
|
||||
new CreateURLRunnable(workerPrivate, blobImpl, aOptions, aResult);
|
||||
|
||||
runnable->Dispatch(aRv);
|
||||
runnable->Dispatch(Terminating, aRv);
|
||||
if (NS_WARN_IF(aRv.Failed())) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -1325,7 +1337,7 @@ URLWorker::RevokeObjectURL(const GlobalObject& aGlobal, const nsAString& aUrl,
|
|||
RefPtr<RevokeURLRunnable> runnable =
|
||||
new RevokeURLRunnable(workerPrivate, aUrl);
|
||||
|
||||
runnable->Dispatch(aRv);
|
||||
runnable->Dispatch(Terminating, aRv);
|
||||
if (NS_WARN_IF(aRv.Failed())) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -1348,7 +1360,7 @@ URLWorker::IsValidURL(const GlobalObject& aGlobal, const nsAString& aUrl,
|
|||
RefPtr<IsValidURLRunnable> runnable =
|
||||
new IsValidURLRunnable(workerPrivate, aUrl);
|
||||
|
||||
runnable->Dispatch(aRv);
|
||||
runnable->Dispatch(Terminating, aRv);
|
||||
if (NS_WARN_IF(aRv.Failed())) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue