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

Unified Diff: cc/tiles/software_image_decode_cache.h

Issue 2664703002: Move purging from OnMemoryState to OnPurgeMemory() in cc/ (Closed)
Patch Set: Don't call OnPurgeMemory() in OnStateChange() Created 3 years, 10 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.h
diff --git a/cc/tiles/software_image_decode_cache.h b/cc/tiles/software_image_decode_cache.h
index 1f3d72f27d83511d657d5c8d4220e364c996b2c4..277d4e77f58751e027d47e291ba55f687f30b553 100644
--- a/cc/tiles/software_image_decode_cache.h
+++ b/cc/tiles/software_image_decode_cache.h
@@ -271,8 +271,13 @@ class CC_EXPORT SoftwareImageDecodeCache
const char* cache_name,
base::trace_event::ProcessMemoryDump* pmd) const;
+ // Removes unlocked decoded images until the number of decoded images is
+ // reduced within the given limit.
+ void ReduceCacheUsageUntilWithinLimit(size_t limit);
+
// Overriden from base::MemoryCoordinatorClient.
void OnMemoryStateChange(base::MemoryState state) override;
+ void OnPurgeMemory() override;
// Helper method to get the different tasks. Note that this should be used as
// if it was public (ie, all of the locks need to be properly acquired).

Powered by Google App Engine
This is Rietveld 408576698