Skip to content
Permalink
Browse files
Remove unnecessary calls to CachedResource::updateBuffer and CachedRe…
…source::updateData

https://bugs.webkit.org/show_bug.cgi?id=240126

Patch by Alex Christensen <achristensen@webkit.org> on 2022-05-05
Reviewed by Chris Dumez.

It adds a function call that does nothing but a redundant assert.

* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::updateBufferInternal):
(WebCore::CachedImage::updateBuffer):
(WebCore::CachedImage::updateData):

Canonical link: https://commits.webkit.org/250322@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@293857 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Alex Christensen authored and webkit-commit-queue committed May 5, 2022
1 parent 572bbd3 commit b799cb0956e39d94d5e644608cd91a81b07415cc
Showing 2 changed files with 16 additions and 4 deletions.
@@ -1,3 +1,17 @@
2022-05-05 Alex Christensen <achristensen@webkit.org>

Remove unnecessary calls to CachedResource::updateBuffer and CachedResource::updateData
https://bugs.webkit.org/show_bug.cgi?id=240126

Reviewed by Chris Dumez.

It adds a function call that does nothing but a redundant assert.

* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::updateBufferInternal):
(WebCore::CachedImage::updateBuffer):
(WebCore::CachedImage::updateData):

2022-05-05 Said Abou-Hallawa <said@apple.com>

[GPU Process] NativeImage should share the ShareableBitmap data when it's sent to GPU Process
@@ -506,10 +506,10 @@ void CachedImage::updateBufferInternal(const SharedBuffer& data)
if (encodedDataStatus == EncodedDataStatus::Error || m_image->isNull()) {
// Image decoding failed. Either we need more image data or the image data is malformed.
error(errorOccurred() ? status() : DecodeError);
if (m_loader && encodedDataStatus == EncodedDataStatus::Error)
m_loader->cancel();
if (inCache())
MemoryCache::singleton().remove(*this);
if (m_loader && encodedDataStatus == EncodedDataStatus::Error)
m_loader->cancel();
return;
}

@@ -554,14 +554,12 @@ void CachedImage::updateBuffer(const FragmentedSharedBuffer& buffer)
{
ASSERT(dataBufferingPolicy() == DataBufferingPolicy::BufferData);
updateBufferInternal(buffer.makeContiguous());
CachedResource::updateBuffer(buffer);
}

void CachedImage::updateData(const SharedBuffer& data)
{
ASSERT(dataBufferingPolicy() == DataBufferingPolicy::DoNotBufferData);
updateBufferInternal(data);
CachedResource::updateData(data);
}

void CachedImage::finishLoading(const FragmentedSharedBuffer* data, const NetworkLoadMetrics& metrics)

0 comments on commit b799cb0

Please sign in to comment.