Index: third_party/WebKit/Source/core/fetch/ImageResource.cpp |
diff --git a/third_party/WebKit/Source/core/fetch/ImageResource.cpp b/third_party/WebKit/Source/core/fetch/ImageResource.cpp |
index c08e465ee78fe5722792924a619f9acb8341854e..7b525add53e5f7a33d53411658b96abeb18364d6 100644 |
--- a/third_party/WebKit/Source/core/fetch/ImageResource.cpp |
+++ b/third_party/WebKit/Source/core/fetch/ImageResource.cpp |
@@ -389,19 +389,21 @@ void ImageResource::updateImage(bool allDataReceived) |
// received all the data or the size is known. Each chunk from the |
// network causes observers to repaint, which will force that chunk |
// to decode. |
- if (sizeAvailable || allDataReceived) { |
- if (!m_image || m_image->isNull()) { |
- if (!errorOccurred()) |
- setStatus(DecodeError); |
- clear(); |
- if (memoryCache()->contains(this)) |
- memoryCache()->remove(this); |
- } |
- |
- // It would be nice to only redraw the decoded band of the image, but with the current design |
- // (decoding delayed until painting) that seems hard. |
- notifyObservers(); |
+ if (!sizeAvailable && !allDataReceived) |
+ return; |
+ if (errorOccurred()) |
+ return; |
+ if (!m_image || m_image->isNull()) { |
+ setStatus(DecodeError); |
+ if (!allDataReceived && m_loader) |
+ m_loader->didFinishLoading(nullptr, monotonicallyIncreasingTime(), encodedSize()); |
+ clear(); |
+ memoryCache()->remove(this); |
} |
+ |
+ // It would be nice to only redraw the decoded band of the image, but with the current design |
+ // (decoding delayed until painting) that seems hard. |
+ notifyObservers(); |
} |
void ImageResource::updateImageAndClearBuffer() |