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

Unified Diff: media/blink/resource_multibuffer_data_provider.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/resource_multibuffer_data_provider.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/resource_multibuffer_data_provider.cc
diff --git a/media/blink/resource_multibuffer_data_provider.cc b/media/blink/resource_multibuffer_data_provider.cc
index fd408ab60f9645c9a5fc35c0acadfdb450eded97..627c47c69ea14b548df08fb8269ebef00375cca4 100644
--- a/media/blink/resource_multibuffer_data_provider.cc
+++ b/media/blink/resource_multibuffer_data_provider.cc
@@ -130,6 +130,16 @@ bool ResourceMultiBufferDataProvider::Available() const {
return false;
}
+int64_t ResourceMultiBufferDataProvider::AvailableBytes() const {
+ int64_t bytes = 0;
+ for (const auto i : fifo_) {
+ if (i->end_of_stream())
+ break;
+ bytes += i->data_size();
+ }
+ return bytes;
+}
+
scoped_refptr<DataBuffer> ResourceMultiBufferDataProvider::Read() {
DCHECK(Available());
scoped_refptr<DataBuffer> ret = fifo_.front();
@@ -353,8 +363,7 @@ void ResourceMultiBufferDataProvider::didReceiveData(WebURLLoader* loader,
data_length -= to_append;
}
- if (Available())
- url_data_->multibuffer()->OnDataProviderEvent(this);
+ url_data_->multibuffer()->OnDataProviderEvent(this);
// Beware, this object might be deleted here.
}
« no previous file with comments | « media/blink/resource_multibuffer_data_provider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698