mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 15:28: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
|
|
@ -950,7 +950,7 @@ ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, ImageData& aImageData,
|
|||
imageSize,
|
||||
aCropRect,
|
||||
getter_AddRefs(data));
|
||||
task->Dispatch(aRv);
|
||||
task->Dispatch(Terminating, aRv);
|
||||
}
|
||||
|
||||
if (NS_WARN_IF(!data)) {
|
||||
|
|
@ -1377,10 +1377,10 @@ private:
|
|||
RefPtr<DecodeBlobInMainThreadSyncTask> task =
|
||||
new DecodeBlobInMainThreadSyncTask(mWorkerPrivate, *mBlob, mCropRect,
|
||||
getter_AddRefs(data), sourceSize);
|
||||
task->Dispatch(rv); // This is a synchronous call.
|
||||
task->Dispatch(Terminating, rv); // This is a synchronous call.
|
||||
|
||||
// In case the worker is terminating, this rejection can be handled.
|
||||
if (NS_WARN_IF(rv.Failed())) {
|
||||
// XXXbz does this really make sense if we're shutting down? Ah, well.
|
||||
mPromise->MaybeReject(rv);
|
||||
return nullptr;
|
||||
}
|
||||
|
|
@ -2104,7 +2104,10 @@ ImageBitmap::Create(nsIGlobalObject* aGlobal,
|
|||
aFormat,
|
||||
aLayout,
|
||||
getter_AddRefs(data));
|
||||
task->Dispatch(aRv);
|
||||
task->Dispatch(Terminating, aRv);
|
||||
if (aRv.Failed()) {
|
||||
return promise.forget();
|
||||
}
|
||||
}
|
||||
|
||||
if (NS_WARN_IF(!data)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue