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 17d815c5049c96f11bf0829b3427eecc716e092f..c361c5b307450c79d0bae24ff1cb89d6563ec282 100644 |
--- a/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp |
+++ b/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp |
@@ -118,6 +118,11 @@ void BitmapImage::destroyDecodedData() |
notifyMemoryChanged(); |
} |
+PassRefPtr<SharedBuffer> BitmapImage::data() |
+{ |
+ return m_source.data(); |
+} |
+ |
void BitmapImage::notifyMemoryChanged() |
{ |
if (getImageObserver()) |
@@ -184,6 +189,20 @@ bool BitmapImage::getHotSpot(IntPoint& hotSpot) const |
return m_source.getHotSpot(hotSpot); |
} |
+bool BitmapImage::setData(PassRefPtr<SharedBuffer> data, bool allDataReceived) |
+{ |
+ if (!data.get()) |
+ return true; |
+ |
+ int length = data->size(); |
+ if (!length) |
+ return true; |
+ |
+ m_source.setData(*data, allDataReceived); |
+ |
+ return dataChanged(allDataReceived); |
+} |
+ |
bool BitmapImage::dataChanged(bool allDataReceived) |
{ |
TRACE_EVENT0("blink", "BitmapImage::dataChanged"); |
@@ -218,8 +237,6 @@ bool BitmapImage::dataChanged(bool allDataReceived) |
// Feed all the data we've seen so far to the image decoder. |
m_allDataReceived = allDataReceived; |
- ASSERT(data()); |
- m_source.setData(*data(), allDataReceived); |
m_haveFrameCount = false; |
return isSizeAvailable(); |