Changeset 215574 in webkit
- Timestamp:
- Apr 20, 2017 1:09:47 PM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r215572 r215574 1 2017-04-20 Said Abou-Hallawa <sabouhallawa@apple.com> 2 3 CachedImage should cancel loading images for unsupported/unknown types 4 https://bugs.webkit.org/show_bug.cgi?id=170697 5 6 Reviewed by Youenn Fablet. 7 8 Currently when the image decoder detects an error with the incoming encoded 9 data of an image, we mark the image to be a broken image. But the network 10 process keeps feeding the web process with the rest of the data. We should 11 cancel loading the rest of the data to save network bandwidth and CPU time 12 loading and processing useless data. 13 14 * loader/cache/CachedImage.cpp: 15 (WebCore::CachedImage::addIncrementalDataBuffer): 16 (WebCore::CachedImage::finishLoading): 17 1 18 2017-04-20 Aaron Chu <aaron_chu@apple.com> 2 19 -
trunk/Source/WebCore/loader/cache/CachedImage.cpp
r215211 r215574 407 407 // Image decoding failed. Either we need more image data or the image data is malformed. 408 408 error(errorOccurred() ? status() : DecodeError); 409 if (m_loader && encodedDataStatus == EncodedDataStatus::Error) 410 m_loader->cancel(); 409 411 if (inCache()) 410 412 MemoryCache::singleton().remove(*this); … … 441 443 createImage(); 442 444 443 if (m_image) 444 m_image->setData(data, true); 445 446 if (!m_image || m_image->isNull()) { 445 EncodedDataStatus encodedDataStatus = m_image ? m_image->setData(data, true) : EncodedDataStatus::Error; 446 447 if (encodedDataStatus == EncodedDataStatus::Error || m_image->isNull()) { 447 448 // Image decoding failed; the image data is malformed. 448 449 error(errorOccurred() ? status() : DecodeError);
Note: See TracChangeset
for help on using the changeset viewer.