Chromium Code Reviews| 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 caaac704bf2695a5c38c3c53dec4c1098c0ea789..1368c652437fd27434e000f9808032b8f0d2b399 100644 |
| --- a/third_party/WebKit/Source/core/fetch/ImageResource.cpp |
| +++ b/third_party/WebKit/Source/core/fetch/ImageResource.cpp |
| @@ -465,19 +465,27 @@ void ImageResource::changedInRect(const blink::Image* image, const IntRect& rect |
| notifyObservers(&rect); |
| } |
| -void ImageResource::onePartInMultipartReceived(const ResourceResponse& response, bool isFirstPart) |
| +void ImageResource::onePartInMultipartReceived(const ResourceResponse& response) |
| { |
| ASSERT(m_multipartParser); |
| + ++m_numParsedPartsInMultipart; |
| + |
| m_response = response; |
| - if (m_data) { |
| - clear(); |
| - updateImage(true); |
| - m_data.clear(); |
| + if (m_numParsedPartsInMultipart == 1) { |
| + // We have nothing to do because we don't have any data. |
| + return; |
| + } |
| + clear(); |
|
hiroshige
2016/03/15 21:38:37
nit: this CL removes |if (m_data)| check. Is this
|
| + updateImage(true); |
| + m_data.clear(); |
| + |
| + if (m_numParsedPartsInMultipart == 2) { |
| + // Notify finished when the first part ends. |
| setLoading(false); |
| checkNotify(); |
| + if (m_loader) |
| + m_loader->didFinishLoadingOnePart(0, WebURLLoaderClient::kUnknownEncodedDataLength); |
| } |
| - if (!isFirstPart && m_loader) |
| - m_loader->didFinishLoadingOnePart(0, WebURLLoaderClient::kUnknownEncodedDataLength); |
| } |
| void ImageResource::multipartDataReceived(const char* bytes, size_t size) |