Bug 1593860 - Correct error reporting when createImageBitmap() fails, r=smaug
authorAndrea Marchesini <amarchesini@mozilla.com>
Tue, 12 Nov 2019 17:08:17 +0000
changeset 501659 38c5042a680fa46d1a76d6d3f22fc1ad5335bd40
parent 501658 59dcb38e46932d516d5a704795900e13d0a9b41d
child 501660 e2df01b709f9ceed696ba3c89667588ae81ae81f
push id100346
push useramarchesini@mozilla.com
push dateTue, 12 Nov 2019 20:44:07 +0000
treeherderautoland@38c5042a680f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1593860
milestone72.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 1593860 - Correct error reporting when createImageBitmap() fails, r=smaug Differential Revision: https://phabricator.services.mozilla.com/D52654
dom/canvas/ImageBitmap.cpp
--- a/dom/canvas/ImageBitmap.cpp
+++ b/dom/canvas/ImageBitmap.cpp
@@ -1536,17 +1536,22 @@ nsresult CreateImageBitmapFromBlob::GetM
   }
 
   return asyncInputStream->AsyncWait(this, 0, 128, mMainThreadEventTarget);
 }
 
 NS_IMETHODIMP
 CreateImageBitmapFromBlob::OnInputStreamReady(nsIAsyncInputStream* aStream) {
   // The stream should have data now. Let's start from scratch again.
-  return MimeTypeAndDecodeAndCropBlob();
+  nsresult rv = MimeTypeAndDecodeAndCropBlob();
+  if (NS_WARN_IF(NS_FAILED(rv))) {
+    MimeTypeAndDecodeAndCropBlobCompletedMainThread(nullptr, rv);
+  }
+
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 CreateImageBitmapFromBlob::OnImageReady(imgIContainer* aImgContainer,
                                         nsresult aStatus) {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (NS_FAILED(aStatus)) {