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

Unified Diff: cc/tiles/software_image_decode_cache.cc

Issue 2795803002: Clear Image Decode Cache on Navigation (Closed)
Patch Set: 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..4db80bbc6e6748b8a7c2a337558a48f24e3de48f 100644
--- a/cc/tiles/software_image_decode_cache.cc
+++ b/cc/tiles/software_image_decode_cache.cc
@@ -818,6 +818,12 @@ void SoftwareImageDecodeCache::ReduceCacheUsage() {
ReduceCacheUsageUntilWithinLimit(max_items_in_cache_);
}
+void SoftwareImageDecodeCache::ClearCache() {
+ base::AutoLock lock(lock_);
+ LOG(ERROR) << "Clearing " << decoded_images_.size() << " images.";
vmpstr 2017/04/03 18:46:10 Debugging? Can this be a trace instead?
ericrk 2017/04/04 00:26:03 my bad - left this in from debugging. removed.
+ ReduceCacheUsageUntilWithinLimit(0);
+}
+
void SoftwareImageDecodeCache::RemovePendingTask(const ImageKey& key,
DecodeTaskType task_type) {
base::AutoLock lock(lock_);

Powered by Google App Engine
This is Rietveld 408576698