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

Unified Diff: media/blink/multibuffer.cc

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 | « media/blink/multibuffer.h ('k') | media/blink/multibuffer_data_source_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/multibuffer.cc
diff --git a/media/blink/multibuffer.cc b/media/blink/multibuffer.cc
index 6705afc4edfc264084f8537a1578c3e555c530be..c17d80c81aa6eef5565d7ed04b201792935c7407 100644
--- a/media/blink/multibuffer.cc
+++ b/media/blink/multibuffer.cc
@@ -389,9 +389,13 @@ void MultiBuffer::OnDataProviderEvent(DataProvider* provider_tmp) {
present_.SetInterval(start_pos, pos, 1);
Interval<BlockId> expanded_range = present_.find(start_pos).interval();
NotifyAvailableRange(expanded_range, expanded_range);
-
lru_->IncrementDataSize(blocks_added);
Prune(blocks_added * kMaxFreesPerAdd + 1);
+ } else {
+ // Make sure to give progress reports even when there
+ // aren't any new blocks yet.
+ NotifyAvailableRange(Interval<BlockId>(start_pos, start_pos + 1),
+ Interval<BlockId>(start_pos, start_pos));
}
// Check that it's still there before we try to delete it.
@@ -518,4 +522,11 @@ void MultiBuffer::IncrementMaxSize(int32_t size) {
// Pruning only happens when blocks are added.
}
+int64_t MultiBuffer::UncommittedBytesAt(const MultiBuffer::BlockId& block) {
+ auto i = writer_index_.find(block);
+ if (writer_index_.end() == i)
+ return 0;
+ return i->second->AvailableBytes();
+}
+
} // namespace media
« no previous file with comments | « media/blink/multibuffer.h ('k') | media/blink/multibuffer_data_source_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698