Bug 1593860 - Correct error reporting when createImageBitmap() fails, r=smaug
authorAndrea Marchesini <amarchesini@mozilla.com>
Tue, 12 Nov 2019 17:08:17 +0000
changeset 501642 38c5042a680fa46d1a76d6d3f22fc1ad5335bd40
parent 501641 59dcb38e46932d516d5a704795900e13d0a9b41d
child 501643 e2df01b709f9ceed696ba3c89667588ae81ae81f
push id36797
push useropoprus@mozilla.com
push dateWed, 13 Nov 2019 09:55:25 +0000
treeherdermozilla-central@2f19e7b646e0 [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)) {