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

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

Issue 892783003: Check the condition for animation policy of bitmapImage on notifyFinished. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Move updating policy to ImageLoader Created 5 years, 11 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
« no previous file with comments | « Source/core/fetch/ImageResource.h ('k') | Source/core/loader/ImageLoader.cpp » ('j') | 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 519dbfd352fd9e3a6e7fb3825fdcc0af19897447..4f2ee2546d13de09df08585e976a43d7c68fde97 100644
--- a/Source/core/fetch/ImageResource.cpp
+++ b/Source/core/fetch/ImageResource.cpp
@@ -473,15 +473,21 @@ void ImageResource::animationAdvanced(const blink::Image* image)
notifyObservers();
}
-void ImageResource::imageAnimationPolicy(const blink::Image* image, ImageAnimationPolicy& policy)
+void ImageResource::updateImageAnimationPolicy()
{
- if (!image || image != m_image)
+ if (!m_image)
return;
+ ImageAnimationPolicy newPolicy = ImageAnimationPolicyAllowed;
ResourceClientWalker<ImageResourceClient> w(m_clients);
while (ImageResourceClient* c = w.next()) {
- if (c->getImageAnimationPolicy(this, policy))
- return;
+ if (c->getImageAnimationPolicy(this, newPolicy))
+ break;
+ }
+
+ if (m_image->animationPolicy() != newPolicy) {
+ m_image->resetAnimation();
+ m_image->setAnimationPolicy(newPolicy);
}
}
« no previous file with comments | « Source/core/fetch/ImageResource.h ('k') | Source/core/loader/ImageLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698