| 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 a1899b76c58a16ade0f7b558d53ad33f19046303..9eab17e59e5a0b32d2b8faa49bcffc0a13df4fc9 100644
|
| --- a/third_party/WebKit/Source/core/fetch/ImageResource.cpp
|
| +++ b/third_party/WebKit/Source/core/fetch/ImageResource.cpp
|
| @@ -422,21 +422,25 @@ void ImageResource::updateImage(bool allDataReceived) {
|
| }
|
| }
|
|
|
| - if (!m_image || m_image->isNull()) {
|
| - size_t size = encodedSize();
|
| - clear();
|
| - if (!errorOccurred())
|
| - setStatus(DecodeError);
|
| - if (!allDataReceived && loader())
|
| - loader()->didFinishLoading(nullptr, monotonicallyIncreasingTime(), size);
|
| - memoryCache()->remove(this);
|
| - }
|
| + if (!m_image || m_image->isNull())
|
| + decodeError();
|
|
|
| // 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(allDataReceived);
|
| }
|
|
|
| +void ImageResource::decodeError() {
|
| + if (isLoading() && loader()) {
|
| + loader()->cancel(DecodeError);
|
| + } else if (!errorOccurred()) {
|
| + setStatus(DecodeError);
|
| + clear();
|
| + setEncodedSize(0);
|
| + memoryCache()->remove(this);
|
| + }
|
| +}
|
| +
|
| void ImageResource::updateImageAndClearBuffer() {
|
| clearImage();
|
| updateImage(true);
|
| @@ -461,11 +465,11 @@ void ImageResource::finish(double loadFinishTime) {
|
| Resource::finish(loadFinishTime);
|
| }
|
|
|
| -void ImageResource::error(const ResourceError& error) {
|
| +void ImageResource::error(const ResourceError& error, Status errorStatus) {
|
| if (m_multipartParser)
|
| m_multipartParser->cancel();
|
| clear();
|
| - Resource::error(error);
|
| + Resource::error(error, errorStatus);
|
| notifyObservers(true);
|
| }
|
|
|
|
|