summaryrefslogtreecommitdiffstats
path: root/dom/canvas
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-07-05 13:04:44 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-07-05 13:04:44 +0200
commita80267e9e88b3dcebf7f8f1f6f10931a99ddf2ca (patch)
tree24d69034f60ed1f6bf79cccfbbe05f10c26238ff /dom/canvas
parentc3916ca1a0164dcb7742360a43d7ab36a80907fc (diff)
downloadUXP-a80267e9e88b3dcebf7f8f1f6f10931a99ddf2ca.tar
UXP-a80267e9e88b3dcebf7f8f1f6f10931a99ddf2ca.tar.gz
UXP-a80267e9e88b3dcebf7f8f1f6f10931a99ddf2ca.tar.lz
UXP-a80267e9e88b3dcebf7f8f1f6f10931a99ddf2ca.tar.xz
UXP-a80267e9e88b3dcebf7f8f1f6f10931a99ddf2ca.zip
Bug 604026 - Sync event loops in workers should be created only if compatible with the worker shutdown status
Diffstat (limited to 'dom/canvas')
-rw-r--r--dom/canvas/ImageBitmap.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/dom/canvas/ImageBitmap.cpp b/dom/canvas/ImageBitmap.cpp
index 6588e0aa3..e45cdfc6f 100644
--- a/dom/canvas/ImageBitmap.cpp
+++ b/dom/canvas/ImageBitmap.cpp
@@ -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)) {