Skip to content
Browse files
Can't load a very large image as an image document

Reviewed by Jer Noble.

Stop flattening the SharedBuffer whenever we received a new segment.
The core logic change to support this was done in
but the CachedImage wasn't modified at the time (it should have been).

We have to use const_cast for now to minimize the change size, proper solution will be done in

* Source/WebCore/loader/cache/CachedImage.cpp:
* Source/WebCore/loader/cache/CachedImage.h:

Canonical link:
git-svn-id: 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
jyavenard committed Jun 3, 2022
1 parent 309956d commit 001e6462c97c7a180ace2e2a424010e586051394
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
@@ -471,9 +471,9 @@ inline void CachedImage::clearImage()
m_updateImageDataCount = 0;

void CachedImage::updateBufferInternal(const SharedBuffer& data)
void CachedImage::updateBufferInternal(const FragmentedSharedBuffer& data)
m_data = data.makeContiguous();
m_data = const_cast<FragmentedSharedBuffer*>(&data);

@@ -553,7 +553,7 @@ EncodedDataStatus CachedImage::updateImageData(bool allDataReceived)
void CachedImage::updateBuffer(const FragmentedSharedBuffer& buffer)
ASSERT(dataBufferingPolicy() == DataBufferingPolicy::BufferData);

void CachedImage::updateData(const SharedBuffer& data)
@@ -169,7 +169,7 @@ class CachedImage final : public CachedResource {
void changedInRect(const Image&, const IntRect*);
void scheduleRenderingUpdate(const Image&);

void updateBufferInternal(const SharedBuffer&);
void updateBufferInternal(const FragmentedSharedBuffer&);

void didReplaceSharedBufferContents() override;

0 comments on commit 001e646

Please sign in to comment.