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

Unified Diff: media/blink/multibuffer_reader.h

Issue 1954493002: Tweak multibuffer buffering strategy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 4 years, 7 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 | « media/blink/multibuffer_data_source.cc ('k') | media/blink/multibuffer_reader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/multibuffer_reader.h
diff --git a/media/blink/multibuffer_reader.h b/media/blink/multibuffer_reader.h
index 19e90617f76ae4f07101927bef962d6bbdbc09ef..cd64982086dcb4d721a5cae35964cc20f3141823 100644
--- a/media/blink/multibuffer_reader.h
+++ b/media/blink/multibuffer_reader.h
@@ -78,7 +78,12 @@ class MEDIA_BLINK_EXPORT MultiBufferReader
// The range [current_position - backward ... current_position + forward)
// will be locked in the cache. Calling Wait() or TryRead() with values
// larger than |forward| is not supported.
- void SetMaxBuffer(int64_t backward, int64_t forward);
+ void SetPinRange(int64_t backward, int64_t forward);
+
+ // Set how much memory usage we target. This memory is added to the global
+ // LRU and shared between all multibuffers. We may end up using more memory
+ // if no memory can be freed due to pinning.
+ void SetMaxBuffer(int64_t bytes);
// Returns true if we are currently loading data.
bool IsLoading() const;
@@ -136,6 +141,9 @@ class MEDIA_BLINK_EXPORT MultiBufferReader
int64_t max_buffer_forward_;
int64_t max_buffer_backward_;
+ // The amount of buffer we've added to the global LRU.
+ int64_t current_buffer_size_;
+
// Currently pinned range.
Interval<MultiBuffer::BlockId> pinned_range_;
« no previous file with comments | « media/blink/multibuffer_data_source.cc ('k') | media/blink/multibuffer_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698