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

Unified Diff: Source/platform/graphics/DeferredImageDecoder.cpp

Issue 244243002: Pass SharedBuffer by reference to DeferredImageDecoder::setData() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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: Source/platform/graphics/DeferredImageDecoder.cpp
diff --git a/Source/platform/graphics/DeferredImageDecoder.cpp b/Source/platform/graphics/DeferredImageDecoder.cpp
index 88fc0e885f855207e3bc988972073ac64db61153..b73d967212909074a4c2f062a05630d98f9bd5bd 100644
--- a/Source/platform/graphics/DeferredImageDecoder.cpp
+++ b/Source/platform/graphics/DeferredImageDecoder.cpp
@@ -117,21 +117,21 @@ ImageFrame* DeferredImageDecoder::frameBufferAtIndex(size_t index)
return 0;
}
-void DeferredImageDecoder::setData(SharedBuffer* data, bool allDataReceived)
+void DeferredImageDecoder::setData(SharedBuffer& data, bool allDataReceived)
{
if (m_actualDecoder) {
- const bool firstData = !m_data && data;
- const bool moreData = data && data->size() > m_lastDataSize;
+ const bool firstData = !m_data;
+ const bool moreData = data.size() > m_lastDataSize;
m_dataChanged = firstData || moreData;
- m_data = data;
- m_lastDataSize = data->size();
Inactive 2014/04/20 13:16:51 There was no null check here.
+ m_data = RefPtr<SharedBuffer>(data);
+ m_lastDataSize = data.size();
m_allDataReceived = allDataReceived;
- m_actualDecoder->setData(data, allDataReceived);
+ m_actualDecoder->setData(&data, allDataReceived);
prepareLazyDecodedFrames();
}
if (m_frameGenerator)
- m_frameGenerator->setData(data, allDataReceived);
+ m_frameGenerator->setData(&data, allDataReceived);
}
bool DeferredImageDecoder::isSizeAvailable()
« no previous file with comments | « Source/platform/graphics/DeferredImageDecoder.h ('k') | Source/platform/graphics/DeferredImageDecoderTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698