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

Unified Diff: media/blink/multibuffer.h

Issue 1829163002: Lazily prune the multibuffer block cache. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | media/blink/multibuffer.cc » ('j') | media/blink/multibuffer.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/multibuffer.h
diff --git a/media/blink/multibuffer.h b/media/blink/multibuffer.h
index cecca4a2c2f988328607a4a26def8620bec9a91f..61a3a7ed5783f5edadf77edf4755542eba3a506e 100644
--- a/media/blink/multibuffer.h
+++ b/media/blink/multibuffer.h
@@ -137,6 +137,9 @@ class MEDIA_BLINK_EXPORT MultiBuffer {
// Virtual for testing purposes.
void Prune(int64_t max_to_free);
+ // Returns true if some blocks are prunable.
+ bool Pruneable() const;
+
void IncrementDataSize(int64_t blocks);
void IncrementMaxSize(int64_t blocks);
@@ -151,12 +154,21 @@ class MEDIA_BLINK_EXPORT MultiBuffer {
friend class base::RefCounted<GlobalLRU>;
~GlobalLRU();
+ // Schedule background pruning, if needed.
+ void SchedulePrune();
+
+ // Perform background pruning.
+ void PruneTask();
+
// Max number of blocks.
int64_t max_size_;
// Sum of all multibuffer::data_.size().
int64_t data_size_;
+ // True if there is a call to the background pruning outstanding.
+ bool background_pruning_active_;
+
// The LRU should contain all blocks which are not pinned from
// all multibuffers.
LRU<GlobalBlockId> lru_;
« no previous file with comments | « no previous file | media/blink/multibuffer.cc » ('j') | media/blink/multibuffer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698