Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1097)

Unified Diff: third_party/WebKit/Source/platform/graphics/BitmapImage.cpp

Issue 2173603003: Revert of Cancel image loads if decoding failed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/graphics/BitmapImage.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp b/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp
index 8788a62448b541c25446cbdcf3b0bc34e93d1bd0..c361c5b307450c79d0bae24ff1cb89d6563ec282 100644
--- a/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp
+++ b/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp
@@ -189,24 +189,21 @@
return m_source.getHotSpot(hotSpot);
}
-Image::SizeAvailability BitmapImage::setData(PassRefPtr<SharedBuffer> data, bool allDataReceived)
+bool BitmapImage::setData(PassRefPtr<SharedBuffer> data, bool allDataReceived)
{
if (!data.get())
- return SizeAvailable;
+ return true;
int length = data->size();
if (!length)
- return SizeAvailable;
-
- // If ImageSource::setData() returns Invalid, we know that this is a decode error.
- // Report size available so that it gets registered as such in ImageResource.
- if (m_source.setData(*data, allDataReceived) == ImageDecoder::SniffResult::Invalid)
- return SizeAvailable;
+ return true;
+
+ m_source.setData(*data, allDataReceived);
return dataChanged(allDataReceived);
}
-Image::SizeAvailability BitmapImage::dataChanged(bool allDataReceived)
+bool BitmapImage::dataChanged(bool allDataReceived)
{
TRACE_EVENT0("blink", "BitmapImage::dataChanged");
@@ -242,7 +239,7 @@
m_allDataReceived = allDataReceived;
m_haveFrameCount = false;
- return isSizeAvailable() ? SizeAvailable : SizeUnavailable;
+ return isSizeAvailable();
}
bool BitmapImage::hasColorProfile() const

Powered by Google App Engine
This is Rietveld 408576698