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

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

Issue 1398523004: Revalidate using the same Resource, attempt #3 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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/core/fetch/ImageResource.cpp
diff --git a/third_party/WebKit/Source/core/fetch/ImageResource.cpp b/third_party/WebKit/Source/core/fetch/ImageResource.cpp
index fd5471d4645e1b3c93dbedc24c80e7cfab4f37c4..9eb384612948b7bc2a2cdca13adcc1340b477c57 100644
--- a/third_party/WebKit/Source/core/fetch/ImageResource.cpp
+++ b/third_party/WebKit/Source/core/fetch/ImageResource.cpp
@@ -297,6 +297,10 @@ void ImageResource::notifyObservers(const IntRect* changeRect)
ResourceClientWalker<ImageResourceClient> w(m_clients);
while (ImageResourceClient* c = w.next())
c->imageChanged(this, changeRect);
+
+ ResourceClientWalker<ImageResourceClient> w2(m_finishedClients);
+ while (ImageResourceClient* c = w2.next())
+ c->imageChanged(this, changeRect);
}
void ImageResource::clear()
@@ -396,15 +400,15 @@ void ImageResource::responseReceived(const ResourceResponse& response, PassOwnPt
{
if (loadingMultipartContent() && m_data)
finishOnePart();
+ Resource::responseReceived(response, handle);
if (RuntimeEnabledFeatures::clientHintsEnabled()) {
- m_devicePixelRatioHeaderValue = response.httpHeaderField("content-dpr").toFloat(&m_hasDevicePixelRatioHeaderValue);
+ m_devicePixelRatioHeaderValue = m_response.httpHeaderField("content-dpr").toFloat(&m_hasDevicePixelRatioHeaderValue);
if (!m_hasDevicePixelRatioHeaderValue || m_devicePixelRatioHeaderValue <= 0.0) {
m_devicePixelRatioHeaderValue = 1.0;
m_hasDevicePixelRatioHeaderValue = false;
}
}
- Resource::responseReceived(response, handle);
}
void ImageResource::decodedSizeChanged(const blink::Image* image, int delta)
@@ -437,6 +441,12 @@ bool ImageResource::shouldPauseAnimation(const blink::Image* image)
return false;
}
+ ResourceClientWalker<ImageResourceClient> w2(m_finishedClients);
+ while (ImageResourceClient* c = w2.next()) {
+ if (c->willRenderImage(this))
+ return false;
+ }
+
return true;
}
@@ -459,6 +469,12 @@ void ImageResource::updateImageAnimationPolicy()
break;
}
+ ResourceClientWalker<ImageResourceClient> w2(m_finishedClients);
+ while (ImageResourceClient* c = w2.next()) {
+ if (c->getImageAnimationPolicy(this, newPolicy))
+ break;
+ }
+
if (m_image->animationPolicy() != newPolicy) {
m_image->resetAnimation();
m_image->setAnimationPolicy(newPolicy);
« no previous file with comments | « third_party/WebKit/Source/core/fetch/FontResource.cpp ('k') | third_party/WebKit/Source/core/fetch/RawResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698