Bug 1224596 part 7. Switch ImageBitmap to using the new WorkerMainThreadRunnable::Dispatch signature. r=khuey
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 24 Nov 2015 00:04:20 -0500
changeset 273921 7b5ae79da708346b67937122f758a37225120326
parent 273920 e4fd08e815a2898b120adde628d0d0db93157648
child 273922 a26838a7eb481a2aad110a7eaf196b79856b8591
push id29715
push userkwierso@gmail.com
push dateTue, 24 Nov 2015 21:54:25 +0000
treeherdermozilla-central@d9243e369c22 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs1224596
milestone45.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1224596 part 7. Switch ImageBitmap to using the new WorkerMainThreadRunnable::Dispatch signature. r=khuey
dom/canvas/ImageBitmap.cpp
--- a/dom/canvas/ImageBitmap.cpp
+++ b/dom/canvas/ImageBitmap.cpp
@@ -675,17 +675,17 @@ ImageBitmap::CreateInternal(nsIGlobalObj
       = new CreateImageFromRawDataInMainThreadSyncTask(array.Data(),
                                                        dataLength,
                                                        imageStride,
                                                        FORMAT,
                                                        imageSize,
                                                        aCropRect,
                                                        aRv,
                                                        getter_AddRefs(data));
-    task->Dispatch(GetCurrentThreadWorkerPrivate()->GetJSContext());
+    task->Dispatch(aRv);
   }
 
   if (NS_WARN_IF(aRv.Failed())) {
     return nullptr;
   }
 
   // Create an ImageBimtap.
   RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal, data);
@@ -1019,17 +1019,17 @@ class CreateImageBitmapFromBlobWorkerTas
     {
     }
 
     bool MainThreadRun() override
     {
       RefPtr<layers::Image> image = DecodeAndCropBlob(mBlob, mCropRect, mError);
 
       if (NS_WARN_IF(mError.Failed())) {
-        return false;
+        return true;
       }
 
       image.forget(mImage);
 
       return true;
     }
 
   private:
@@ -1058,19 +1058,20 @@ private:
   already_AddRefed<ImageBitmap> CreateImageBitmap() override
   {
     RefPtr<layers::Image> data;
 
     ErrorResult rv;
     RefPtr<DecodeBlobInMainThreadSyncTask> task =
       new DecodeBlobInMainThreadSyncTask(mWorkerPrivate, *mBlob, mCropRect,
                                          rv, getter_AddRefs(data));
-    task->Dispatch(mWorkerPrivate->GetJSContext()); // This is a synchronous call.
+    task->Dispatch(rv); // This is a synchronous call.
 
     if (NS_WARN_IF(rv.Failed())) {
+      // XXXbz does this really make sense if we're shutting down?  Ah, well.
       mPromise->MaybeReject(rv);
       return nullptr;
     }
 
     // Create ImageBitmap object.
     RefPtr<ImageBitmap> imageBitmap = new ImageBitmap(mGlobalObject, data);
     return imageBitmap.forget();
   }