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

Unified Diff: third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp

Issue 1812273003: Eliminate copies of encoded image data (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/image-decoders/jpeg/JPEGImageDecoder.cpp
diff --git a/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp b/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
index d6b36fa9478d7a636e7ef4c35e0ed50e31e328c0..8992a0a59495be6661d7905514ee93f8e5c0ec3d 100644
--- a/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
@@ -394,19 +394,19 @@ public:
return true;
}
- void setData(SharedBuffer* data)
+ void setData(SegmentReader* data)
{
if (m_data.get() == data)
return;
m_data = data;
- // If a restart is needed, the next call to fillBuffer will read from the new SharedBuffer.
+ // If a restart is needed, the next call to fillBuffer will read from the new SegmentReader.
if (m_needsRestart)
return;
// Otherwise, empty the buffer, and leave the position the same, so fillBuffer continues
- // reading from the same position in the new SharedBuffer.
+ // reading from the same position in the new SegmentReader.
m_nextReadPosition -= m_info.src->bytes_in_buffer;
clearBuffer();
}
@@ -700,7 +700,7 @@ private:
m_lastSetByte = nullptr;
}
- RefPtr<SharedBuffer> m_data;
+ RefPtr<SegmentReader> m_data;
JPEGImageDecoder* m_decoder;
// Input reading: True if we need to back up to m_restartPosition.
@@ -791,7 +791,7 @@ bool JPEGImageDecoder::setSize(unsigned width, unsigned height)
return true;
}
-void JPEGImageDecoder::onSetData(SharedBuffer* data)
+void JPEGImageDecoder::onSetData(SegmentReader* data)
{
if (m_reader)
m_reader->setData(data);

Powered by Google App Engine
This is Rietveld 408576698