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

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: Rebase Created 4 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: 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 79434ab7747c290c63dac987a3487767faf8b3ea..03b465d816bee7fc7762d1e9bd4b5d102df4c9d6 100644
--- a/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
@@ -361,19 +361,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();
}
@@ -637,7 +637,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.
@@ -723,7 +723,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