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

Unified Diff: third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp

Issue 2365943005: Cap memory usage in webp catch up (Closed)
Patch Set: Moving purge check out of conditional branch. Created 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
diff --git a/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp b/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
index 914def5256a8fb57e0b10d6391df3ad6771b1441..40e600f0c69ea348d784d65e3d4bc9eee2b94b79 100644
--- a/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
@@ -256,6 +256,10 @@ bool WEBPImageDecoder::updateDemuxer() {
}
ASSERT(isDecodedSizeAvailable());
+
+ size_t frameCount = WebPDemuxGetI(m_demux, WEBP_FF_FRAME_COUNT);
+ updateAggressivePurging(frameCount);
+
return true;
}
@@ -486,6 +490,9 @@ void WEBPImageDecoder::decode(size_t index) {
// We need more data to continue decoding.
if (m_frameBufferCache[*i].getStatus() != ImageFrame::FrameComplete)
break;
+
+ if (m_purgeAggressively)
+ clearCacheExceptFrame(*i);
}
// It is also a fatal error if all data is received and we have decoded all
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698