Index: third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h |
diff --git a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h |
index 51c81a37251705429adeecc8aa2a694606ffd686..70fba8b3d6a92be752566883c17bb34568ddfde6 100644 |
--- a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h |
+++ b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h |
@@ -277,7 +277,8 @@ protected: |
ImageDecoder(AlphaOption alphaOption, GammaAndColorProfileOption colorOptions, size_t maxDecodedBytes) |
: m_premultiplyAlpha(alphaOption == AlphaPremultiplied) |
, m_ignoreGammaAndColorProfile(colorOptions == GammaAndColorProfileIgnored) |
- , m_maxDecodedBytes(maxDecodedBytes) { } |
+ , m_maxDecodedBytes(maxDecodedBytes) |
+ , m_purgeAggressively(false) { } |
// Calculates the most recent frame whose image data may be needed in |
// order to decode frame |frameIndex|, based on frame disposal methods |
@@ -330,6 +331,13 @@ protected: |
// memory devices. |
const size_t m_maxDecodedBytes; |
+ // While decoding, we may learn that there are so many animation frames that |
+ // we would go beyond our cache budget. |
+ // If that happens, m_purgeAggressively is set to true. This signals |
+ // future decodes to purge old frames as it goes. |
+ void updateAggressivePurging(size_t index); |
+ bool m_purgeAggressively; |
+ |
private: |
enum class SniffResult { |
JPEG, |