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

Unified Diff: media/blink/multibuffer.h

Issue 1971373002: Fix progress reporting for multibuffers to report progress for every byte we receive. (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 | « no previous file | media/blink/multibuffer.cc » ('j') | no next file with comments »
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 29359b337e1f201132509080cf509f048e28347c..23280c8849074a3666b19be09af33e3230605235 100644
--- a/media/blink/multibuffer.h
+++ b/media/blink/multibuffer.h
@@ -114,6 +114,11 @@ class MEDIA_BLINK_EXPORT MultiBuffer {
// availble to read.
virtual bool Available() const = 0;
+ // Returns how many bytes are available, note that Available() may still
+ // return false even if AvailableBytes() returns a value greater than
+ // zero if less than a full block is available.
+ virtual int64_t AvailableBytes() const = 0;
+
// Returns the next block. Only valid if Available()
// returns true. Last block might be of a smaller size
// and after the last block we will get an end-of-stream
@@ -249,6 +254,11 @@ class MEDIA_BLINK_EXPORT MultiBuffer {
// Increment max cache size by |size| (counted in blocks).
void IncrementMaxSize(int32_t size);
+ // Returns how many bytes have been received by the data providers at position
+ // |block|, which have not yet been submitted to the multibuffer cache.
+ // The returned number should be less than the size of one block.
+ int64_t UncommittedBytesAt(const BlockId& block);
+
// Caller takes ownership of 'provider', cache will
// not call it anymore.
std::unique_ptr<DataProvider> RemoveProvider(DataProvider* provider);
« no previous file with comments | « no previous file | media/blink/multibuffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698