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

Unified Diff: cc/tiles/software_image_decode_cache.cc

Issue 2795803002: Clear Image Decode Cache on Navigation (Closed)
Patch Set: feedback Created 3 years, 9 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: cc/tiles/software_image_decode_cache.cc
diff --git a/cc/tiles/software_image_decode_cache.cc b/cc/tiles/software_image_decode_cache.cc
index a113be9dd198ca6faeb12bb6092c98033554cea9..c40e5561bbd40c35efd77fab9d421e01f068a2a3 100644
--- a/cc/tiles/software_image_decode_cache.cc
+++ b/cc/tiles/software_image_decode_cache.cc
@@ -818,6 +818,11 @@ void SoftwareImageDecodeCache::ReduceCacheUsage() {
ReduceCacheUsageUntilWithinLimit(max_items_in_cache_);
}
+void SoftwareImageDecodeCache::ClearCache() {
+ base::AutoLock lock(lock_);
+ ReduceCacheUsageUntilWithinLimit(0);
+}
+
void SoftwareImageDecodeCache::RemovePendingTask(const ImageKey& key,
DecodeTaskType task_type) {
base::AutoLock lock(lock_);

Powered by Google App Engine
This is Rietveld 408576698