<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[287507] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/287507">287507</a></dd>
<dt>Author</dt> <dd>jya@apple.com</dd>
<dt>Date</dt> <dd>2022-01-01 16:19:00 -0800 (Sat, 01 Jan 2022)</dd>
</dl>

<h3>Log Message</h3>
<pre>ScalableImageDecoder should be using SharedBuffer instead of DataSegment
https://bugs.webkit.org/show_bug.cgi?id=233441
rdar://problem/85854204

Reviewed by Darin Adler.

DataSegment should be a SharedBuffer's implementation details and not
be used outside SharedBuffer's code.
Historically, using the inner DataSegment was required as it was thread
safe while SharedBuffer wasn't: This is no longer the case.
SharedBuffer and DataSegment are semantically very similar, so this is
mostly a find/replace change.
Flattening the FragmentedSharedBuffer is still required as most decoders
require reading the raw bytes.

No change in observable behaviour.

* platform/graphics/ImageBackingStore.h:
(WebCore::ImageBackingStore::setSize):
(WebCore::ImageBackingStore::ImageBackingStore):
* platform/image-decoders/ScalableImageDecoder.h:
* platform/image-decoders/avif/AVIFImageReader.cpp:
(WebCore::AVIFImageReader::parseHeader):
(WebCore::AVIFImageReader::decodeFrame):
* platform/image-decoders/avif/AVIFImageReader.h:
* platform/image-decoders/bmp/BMPImageReader.h:
(WebCore::BMPImageReader::readUint16):
(WebCore::BMPImageReader::readUint32):
(WebCore::BMPImageReader::setData):
* platform/image-decoders/gif/GIFImageReader.h:
(GIFImageReader::setData):
* platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
(WebCore::JPEGImageReader::decode):
* platform/image-decoders/jpeg2000/JPEG2000ImageDecoder.cpp:
(WebCore::JPEG2000ImageDecoder::decode):
* platform/image-decoders/png/PNGImageDecoder.cpp:
(WebCore::PNGImageReader::decode):
* platform/image-decoders/webp/WEBPImageDecoder.cpp:
(WebCore::WEBPImageDecoder::decode):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsImageBackingStoreh">trunk/Source/WebCore/platform/graphics/ImageBackingStore.h</a></li>
<li><a href="#trunkSourceWebCoreplatformimagedecodersScalableImageDecoderh">trunk/Source/WebCore/platform/image-decoders/ScalableImageDecoder.h</a></li>
<li><a href="#trunkSourceWebCoreplatformimagedecodersavifAVIFImageReadercpp">trunk/Source/WebCore/platform/image-decoders/avif/AVIFImageReader.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformimagedecodersavifAVIFImageReaderh">trunk/Source/WebCore/platform/image-decoders/avif/AVIFImageReader.h</a></li>
<li><a href="#trunkSourceWebCoreplatformimagedecodersbmpBMPImageReaderh">trunk/Source/WebCore/platform/image-decoders/bmp/BMPImageReader.h</a></li>
<li><a href="#trunkSourceWebCoreplatformimagedecodersgifGIFImageReaderh">trunk/Source/WebCore/platform/image-decoders/gif/GIFImageReader.h</a></li>
<li><a href="#trunkSourceWebCoreplatformimagedecodersjpegJPEGImageDecodercpp">trunk/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformimagedecodersjpeg2000JPEG2000ImageDecodercpp">trunk/Source/WebCore/platform/image-decoders/jpeg2000/JPEG2000ImageDecoder.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformimagedecoderspngPNGImageDecodercpp">trunk/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformimagedecoderswebpWEBPImageDecodercpp">trunk/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (287506 => 287507)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2022-01-02 00:09:19 UTC (rev 287506)
+++ trunk/Source/WebCore/ChangeLog      2022-01-02 00:19:00 UTC (rev 287507)
</span><span class="lines">@@ -1,5 +1,47 @@
</span><span class="cx"> 2022-01-01  Jean-Yves Avenard  <jya@apple.com>
</span><span class="cx"> 
</span><ins>+        ScalableImageDecoder should be using SharedBuffer instead of DataSegment
+        https://bugs.webkit.org/show_bug.cgi?id=233441
+        rdar://problem/85854204
+
+        Reviewed by Darin Adler.
+
+        DataSegment should be a SharedBuffer's implementation details and not
+        be used outside SharedBuffer's code.
+        Historically, using the inner DataSegment was required as it was thread
+        safe while SharedBuffer wasn't: This is no longer the case.
+        SharedBuffer and DataSegment are semantically very similar, so this is
+        mostly a find/replace change.
+        Flattening the FragmentedSharedBuffer is still required as most decoders
+        require reading the raw bytes.
+
+        No change in observable behaviour.
+
+        * platform/graphics/ImageBackingStore.h:
+        (WebCore::ImageBackingStore::setSize):
+        (WebCore::ImageBackingStore::ImageBackingStore):
+        * platform/image-decoders/ScalableImageDecoder.h:
+        * platform/image-decoders/avif/AVIFImageReader.cpp:
+        (WebCore::AVIFImageReader::parseHeader):
+        (WebCore::AVIFImageReader::decodeFrame):
+        * platform/image-decoders/avif/AVIFImageReader.h:
+        * platform/image-decoders/bmp/BMPImageReader.h:
+        (WebCore::BMPImageReader::readUint16):
+        (WebCore::BMPImageReader::readUint32):
+        (WebCore::BMPImageReader::setData):
+        * platform/image-decoders/gif/GIFImageReader.h:
+        (GIFImageReader::setData):
+        * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
+        (WebCore::JPEGImageReader::decode):
+        * platform/image-decoders/jpeg2000/JPEG2000ImageDecoder.cpp:
+        (WebCore::JPEG2000ImageDecoder::decode):
+        * platform/image-decoders/png/PNGImageDecoder.cpp:
+        (WebCore::PNGImageReader::decode):
+        * platform/image-decoders/webp/WEBPImageDecoder.cpp:
+        (WebCore::WEBPImageDecoder::decode):
+
+2022-01-01  Jean-Yves Avenard  <jya@apple.com>
+
</ins><span class="cx">         make SharedBuffer::copy() return a contiguous SharedBuffer
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=234622
</span><span class="cx">         rdar://problem/86829527
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsImageBackingStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ImageBackingStore.h (287506 => 287507)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ImageBackingStore.h       2022-01-02 00:09:19 UTC (rev 287506)
+++ trunk/Source/WebCore/platform/graphics/ImageBackingStore.h  2022-01-02 00:19:00 UTC (rev 287507)
</span><span class="lines">@@ -233,6 +233,7 @@
</span><span class="cx">         return PackedColor::ARGB { result }.value;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    // m_pixels type should be identical to the one set in ImageBackingStoreCairo.cpp
</ins><span class="cx">     RefPtr<FragmentedSharedBuffer::DataSegment> m_pixels;
</span><span class="cx">     uint32_t* m_pixelsPtr { nullptr };
</span><span class="cx">     IntSize m_size;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformimagedecodersScalableImageDecoderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/image-decoders/ScalableImageDecoder.h (287506 => 287507)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/image-decoders/ScalableImageDecoder.h      2022-01-02 00:09:19 UTC (rev 287506)
+++ trunk/Source/WebCore/platform/image-decoders/ScalableImageDecoder.h 2022-01-02 00:19:00 UTC (rev 287507)
</span><span class="lines">@@ -76,9 +76,8 @@
</span><span class="cx">         if (m_encodedDataStatus == EncodedDataStatus::Error)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        auto contiguousData = data.makeContiguous();
-        if (contiguousData->data())
-            m_data = contiguousData->begin()->segment.copyRef();
</del><ins>+        m_data = data.makeContiguous();
+
</ins><span class="cx">         if (m_encodedDataStatus == EncodedDataStatus::TypeAvailable) {
</span><span class="cx">             m_decodingSizeFromSetData = true;
</span><span class="cx">             tryDecodeSize(allDataReceived);
</span><span class="lines">@@ -194,7 +193,7 @@
</span><span class="cx">     std::optional<IntPoint> hotSpot() const override { return std::nullopt; }
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><del>-    RefPtr<FragmentedSharedBuffer::DataSegment> m_data;
</del><ins>+    RefPtr<const SharedBuffer> m_data;
</ins><span class="cx">     Vector<ScalableImageDecoderFrame, 1> m_frameBufferCache WTF_GUARDED_BY_LOCK(m_lock);
</span><span class="cx">     mutable Lock m_lock;
</span><span class="cx">     bool m_premultiplyAlpha;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformimagedecodersavifAVIFImageReadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/image-decoders/avif/AVIFImageReader.cpp (287506 => 287507)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/image-decoders/avif/AVIFImageReader.cpp    2022-01-02 00:09:19 UTC (rev 287506)
+++ trunk/Source/WebCore/platform/image-decoders/avif/AVIFImageReader.cpp       2022-01-02 00:19:00 UTC (rev 287507)
</span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx"> 
</span><span class="cx"> AVIFImageReader::~AVIFImageReader() = default;
</span><span class="cx"> 
</span><del>-bool AVIFImageReader::parseHeader(const FragmentedSharedBuffer::DataSegment& data, bool allDataReceived)
</del><ins>+bool AVIFImageReader::parseHeader(const SharedBuffer& data, bool allDataReceived)
</ins><span class="cx"> {
</span><span class="cx">     if (avifDecoderSetIOMemory(m_avifDecoder.get(), data.data(), data.size()) != AVIF_RESULT_OK)
</span><span class="cx">         return allDataReceived ? m_decoder->setFailed() : false;
</span><span class="lines">@@ -58,7 +58,7 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void AVIFImageReader::decodeFrame(size_t frameIndex, ScalableImageDecoderFrame& buffer, const FragmentedSharedBuffer::DataSegment& data)
</del><ins>+void AVIFImageReader::decodeFrame(size_t frameIndex, ScalableImageDecoderFrame& buffer, const SharedBuffer& data)
</ins><span class="cx"> {
</span><span class="cx">     if (m_decoder->failed())
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformimagedecodersavifAVIFImageReaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/image-decoders/avif/AVIFImageReader.h (287506 => 287507)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/image-decoders/avif/AVIFImageReader.h      2022-01-02 00:09:19 UTC (rev 287506)
+++ trunk/Source/WebCore/platform/image-decoders/avif/AVIFImageReader.h 2022-01-02 00:19:00 UTC (rev 287507)
</span><span class="lines">@@ -39,8 +39,8 @@
</span><span class="cx">     AVIFImageReader(RefPtr<AVIFImageDecoder>&&);
</span><span class="cx">     ~AVIFImageReader();
</span><span class="cx"> 
</span><del>-    bool parseHeader(const FragmentedSharedBuffer::DataSegment&, bool allDataReceived);
-    void decodeFrame(size_t index, ScalableImageDecoderFrame&, const FragmentedSharedBuffer::DataSegment&);
</del><ins>+    bool parseHeader(const SharedBuffer&, bool allDataReceived);
+    void decodeFrame(size_t index, ScalableImageDecoderFrame&, const SharedBuffer&);
</ins><span class="cx">     size_t imageCount() const;
</span><span class="cx">     double repetitionCount() const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformimagedecodersbmpBMPImageReaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/image-decoders/bmp/BMPImageReader.h (287506 => 287507)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/image-decoders/bmp/BMPImageReader.h        2022-01-02 00:09:19 UTC (rev 287506)
+++ trunk/Source/WebCore/platform/image-decoders/bmp/BMPImageReader.h   2022-01-02 00:19:00 UTC (rev 287507)
</span><span class="lines">@@ -42,7 +42,7 @@
</span><span class="cx"> public:
</span><span class="cx">     // Read a value from |data[offset]|, converting from little to native
</span><span class="cx">     // endianness.
</span><del>-    static inline uint16_t readUint16(const FragmentedSharedBuffer::DataSegment& data, int offset)
</del><ins>+    static inline uint16_t readUint16(const SharedBuffer& data, int offset)
</ins><span class="cx">     {
</span><span class="cx">         uint16_t result;
</span><span class="cx">         memcpy(&result, &data.data()[offset], 2);
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx">         return result;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    static inline uint32_t readUint32(const FragmentedSharedBuffer::DataSegment& data, int offset)
</del><ins>+    static inline uint32_t readUint32(const SharedBuffer& data, int offset)
</ins><span class="cx">     {
</span><span class="cx">         uint32_t result;
</span><span class="cx">         memcpy(&result, &data.data()[offset], 4);
</span><span class="lines">@@ -69,7 +69,7 @@
</span><span class="cx">     BMPImageReader(ScalableImageDecoder* parent, size_t decodedAndHeaderOffset, size_t imgDataOffset, bool usesAndMask);
</span><span class="cx"> 
</span><span class="cx">     void setBuffer(ScalableImageDecoderFrame* buffer) { m_buffer = buffer; }
</span><del>-    void setData(FragmentedSharedBuffer::DataSegment& data) { m_data = &data; }
</del><ins>+    void setData(const SharedBuffer& data) { m_data = &data; }
</ins><span class="cx"> 
</span><span class="cx">     // Does the actual decoding. If |onlySize| is true, decoding only
</span><span class="cx">     // progresses as far as necessary to get the image size. Returns
</span><span class="lines">@@ -272,7 +272,7 @@
</span><span class="cx">     ScalableImageDecoderFrame* m_buffer;
</span><span class="cx"> 
</span><span class="cx">     // The file to decode.
</span><del>-    RefPtr<FragmentedSharedBuffer::DataSegment> m_data;
</del><ins>+    RefPtr<const SharedBuffer> m_data;
</ins><span class="cx"> 
</span><span class="cx">     // An index into |m_data| representing how much we've already decoded.
</span><span class="cx">     size_t m_decodedOffset;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformimagedecodersgifGIFImageReaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/image-decoders/gif/GIFImageReader.h (287506 => 287507)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/image-decoders/gif/GIFImageReader.h        2022-01-02 00:09:19 UTC (rev 287506)
+++ trunk/Source/WebCore/platform/image-decoders/gif/GIFImageReader.h   2022-01-02 00:19:00 UTC (rev 287507)
</span><span class="lines">@@ -237,7 +237,7 @@
</span><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    void setData(WebCore::FragmentedSharedBuffer::DataSegment& data) { m_data = &data; }
</del><ins>+    void setData(const WebCore::SharedBuffer& data) { m_data = &data; }
</ins><span class="cx">     // FIXME: haltAtFrame should be size_t.
</span><span class="cx">     bool decode(WebCore::GIFImageDecoder::GIFQuery, unsigned haltAtFrame);
</span><span class="cx"> 
</span><span class="lines">@@ -316,6 +316,6 @@
</span><span class="cx">     Vector<std::unique_ptr<GIFFrameContext> > m_frames;
</span><span class="cx">     size_t m_currentDecodingFrame;
</span><span class="cx"> 
</span><del>-    RefPtr<WebCore::FragmentedSharedBuffer::DataSegment> m_data;
</del><ins>+    RefPtr<const WebCore::SharedBuffer> m_data;
</ins><span class="cx">     bool m_parseCompleted;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformimagedecodersjpegJPEGImageDecodercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp (287506 => 287507)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp   2022-01-02 00:09:19 UTC (rev 287506)
+++ trunk/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp      2022-01-02 00:19:00 UTC (rev 287507)
</span><span class="lines">@@ -317,7 +317,7 @@
</span><span class="cx">         m_bytesToSkip = std::max(numBytes - bytesToSkip, static_cast<long>(0));
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    bool decode(const FragmentedSharedBuffer::DataSegment& data, bool onlySize)
</del><ins>+    bool decode(const SharedBuffer& data, bool onlySize)
</ins><span class="cx">     {
</span><span class="cx">         m_decodingSizeOnly = onlySize;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformimagedecodersjpeg2000JPEG2000ImageDecodercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/image-decoders/jpeg2000/JPEG2000ImageDecoder.cpp (287506 => 287507)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/image-decoders/jpeg2000/JPEG2000ImageDecoder.cpp   2022-01-02 00:09:19 UTC (rev 287506)
+++ trunk/Source/WebCore/platform/image-decoders/jpeg2000/JPEG2000ImageDecoder.cpp      2022-01-02 00:19:00 UTC (rev 287507)
</span><span class="lines">@@ -380,7 +380,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     struct Reader {
</span><del>-        FragmentedSharedBuffer::DataSegment& data;
</del><ins>+        const SharedBuffer& data;
</ins><span class="cx">         size_t offset;
</span><span class="cx">     } reader = { *m_data, 0 };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformimagedecoderspngPNGImageDecodercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp (287506 => 287507)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp     2022-01-02 00:09:19 UTC (rev 287506)
+++ trunk/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp        2022-01-02 00:19:00 UTC (rev 287507)
</span><span class="lines">@@ -148,7 +148,7 @@
</span><span class="cx">         m_readOffset = 0;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    bool decode(const FragmentedSharedBuffer::DataSegment& data, bool sizeOnly, unsigned haltAtFrame)
</del><ins>+    bool decode(const SharedBuffer& data, bool sizeOnly, unsigned haltAtFrame)
</ins><span class="cx">     {
</span><span class="cx">         m_decodingSizeOnly = sizeOnly;
</span><span class="cx">         PNGImageDecoder* decoder = static_cast<PNGImageDecoder*>(png_get_progressive_ptr(m_png));
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformimagedecoderswebpWEBPImageDecodercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp (287506 => 287507)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp   2022-01-02 00:09:19 UTC (rev 287506)
+++ trunk/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp      2022-01-02 00:19:00 UTC (rev 287507)
</span><span class="lines">@@ -132,7 +132,7 @@
</span><span class="cx">     // This can be executed both in the main thread (when not using async decoding) or in the decoding thread.
</span><span class="cx">     // When executed in the decoding thread, a call to setData() from the main thread may change the data
</span><span class="cx">     // the WebPDemuxer is using, leaving it in an inconsistent state, so we need to protect the data.
</span><del>-    RefPtr<FragmentedSharedBuffer::DataSegment> protectedData(m_data);
</del><ins>+    RefPtr<const SharedBuffer> protectedData(m_data);
</ins><span class="cx">     WebPData inputData = { protectedData->data(), protectedData->size() };
</span><span class="cx">     WebPDemuxState demuxerState;
</span><span class="cx">     WebPDemuxer* demuxer = WebPDemuxPartial(&inputData, &demuxerState);
</span></span></pre>
</div>
</div>

</body>
</html>