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

Unified Diff: Source/core/fetch/ImageResource.cpp

Issue 1102803002: Remove the pending container size requests list (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove now redundant virtual method Created 5 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
« Source/core/fetch/ImageResource.h ('K') | « Source/core/fetch/ImageResource.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/ImageResource.cpp
diff --git a/Source/core/fetch/ImageResource.cpp b/Source/core/fetch/ImageResource.cpp
index fbf8f64c416281fa751e7d9231fcce257b4a75b1..61ba6527e741ecb0fb573845da6e9cbcc070d6bc 100644
--- a/Source/core/fetch/ImageResource.cpp
+++ b/Source/core/fetch/ImageResource.cpp
@@ -110,33 +110,12 @@ void ImageResource::didRemoveClient(ResourceClient* c)
{
ASSERT(c);
ASSERT(c->resourceClientType() == ImageResourceClient::expectedType());
- m_pendingContainerSizeRequests.remove(static_cast<ImageResourceClient*>(c));
if (m_imageForContainerMap)
m_imageForContainerMap->remove(static_cast<ImageResourceClient*>(c));
Resource::didRemoveClient(c);
}
-void ImageResource::switchClientsToRevalidatedResource()
-{
- ASSERT(resourceToRevalidate());
- ASSERT(resourceToRevalidate()->isImage());
- // Pending container size requests need to be transferred to the revalidated resource.
- if (!m_pendingContainerSizeRequests.isEmpty()) {
- // A copy of pending size requests is needed as they are deleted during Resource::switchClientsToRevalidateResource().
- ContainerSizeRequests switchContainerSizeRequests;
- for (const auto& containerSizeRequest : m_pendingContainerSizeRequests)
- switchContainerSizeRequests.set(containerSizeRequest.key, containerSizeRequest.value);
- Resource::switchClientsToRevalidatedResource();
- ImageResource* revalidatedImageResource = toImageResource(resourceToRevalidate());
- for (const auto& containerSizeRequest : switchContainerSizeRequests)
- revalidatedImageResource->setContainerSizeForLayoutObject(containerSizeRequest.key, containerSizeRequest.value.first, containerSizeRequest.value.second);
- return;
- }
-
- Resource::switchClientsToRevalidatedResource();
-}
-
bool ImageResource::isSafeToUnlock() const
{
// Note that |m_image| holds a reference to |m_data| in addition to the one held by the Resource parent class.
@@ -155,7 +134,6 @@ void ImageResource::destroyDecodedDataIfPossible()
void ImageResource::allClientsRemoved()
{
- m_pendingContainerSizeRequests.clear();
if (m_image && !errorOccurred())
m_image->resetAnimation();
Resource::allClientsRemoved();
@@ -223,10 +201,8 @@ void ImageResource::setContainerSizeForLayoutObject(const ImageResourceClient* l
return;
ASSERT(layoutObject);
ASSERT(containerZoom);
- if (!m_image) {
- m_pendingContainerSizeRequests.set(layoutObject, SizeAndZoom(containerSize, containerZoom));
+ if (!m_image)
return;
- }
if (!m_image->isSVGImage()) {
m_image->setContainerSize(containerSize);
return;
@@ -307,7 +283,6 @@ void ImageResource::clear()
{
prune();
clearImage();
- m_pendingContainerSizeRequests.clear();
setEncodedSize(0);
}
@@ -329,15 +304,6 @@ inline void ImageResource::createImage()
} else {
m_image = BitmapImage::create(this);
}
-
- if (m_image) {
- // Send queued container size requests.
- if (m_image->usesContainerSize()) {
- for (const auto& containerSizeRequest : m_pendingContainerSizeRequests)
- setContainerSizeForLayoutObject(containerSizeRequest.key, containerSizeRequest.value.first, containerSizeRequest.value.second);
- }
- m_pendingContainerSizeRequests.clear();
- }
}
inline void ImageResource::clearImage()
« Source/core/fetch/ImageResource.h ('K') | « Source/core/fetch/ImageResource.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698