Bug 1565542. We need to check to resolve image decode promises when we get the frame update notification too. r=aosmond a=jcristau
authorTimothy Nikkel <tnikkel@gmail.com>
Mon, 29 Jul 2019 13:05:14 +0000
changeset 537281 e635e759e439d595ef59d3aa9befbbe8da0fcfb6
parent 537280 cb3f768f7cd8d65be5234efa064b21a45a95c261
child 537282 02d9056ba76c565c57334ae0df1246d52823cc43
push id2122
push userarchaeopteryx@coole-files.de
push dateWed, 07 Aug 2019 14:22:14 +0000
treeherdermozilla-release@02d9056ba76c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaosmond, jcristau
bugs1565542
milestone68.0.2
Bug 1565542. We need to check to resolve image decode promises when we get the frame update notification too. r=aosmond a=jcristau When we reload the document the destruction of the old document triggers a discard request for the image. If timing is right we haven't locked the image in the new document yet so it discards. We call LoadImage on the image, it returns the existing entry from the image cache, but it needs to validate. When it validates we send out all the progress in the progress tracker already. This includes frame complete and decode complete even though we have no decoded surfaces for this image right now. The RequestDecodeForSize call in nsImageLoadingContent::MaybeResolveDecodePromises triggers a decode. When the decode finishes we send a frame update notification but we never send frame complete or decode complete because those are permanent once they happen. Differential Revision: https://phabricator.services.mozilla.com/D39585
dom/base/nsImageLoadingContent.cpp
--- a/dom/base/nsImageLoadingContent.cpp
+++ b/dom/base/nsImageLoadingContent.cpp
@@ -204,17 +204,18 @@ nsImageLoadingContent::Notify(imgIReques
         doc->AddBlockedNodeByClassifier(thisNode);
       }
     }
     nsresult status =
         reqStatus & imgIRequest::STATUS_ERROR ? NS_ERROR_FAILURE : NS_OK;
     return OnLoadComplete(aRequest, status);
   }
 
-  if (aType == imgINotificationObserver::FRAME_COMPLETE &&
+  if ((aType == imgINotificationObserver::FRAME_COMPLETE ||
+       aType == imgINotificationObserver::FRAME_UPDATE) &&
       mCurrentRequest == aRequest) {
     MaybeResolveDecodePromises();
   }
 
   if (aType == imgINotificationObserver::DECODE_COMPLETE) {
     nsCOMPtr<imgIContainer> container;
     aRequest->GetImage(getter_AddRefs(container));
     if (container) {