| 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 180ec29bba7c2d0dc0142d04eaaf63ba5e5f78bb..ced7fa20be5d37b52973e14a9092060ed589e8f5 100644
|
| --- a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h
|
| +++ b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h
|
| @@ -279,7 +279,8 @@ class PLATFORM_EXPORT ImageDecoder {
|
| : 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
|
| @@ -332,6 +333,13 @@ class PLATFORM_EXPORT ImageDecoder {
|
| // 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, PNG, GIF, WEBP, ICO, BMP, Invalid };
|
|
|
|
|