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

Unified Diff: media/filters/file_data_source.cc

Issue 8294025: Merge 105121 - Numerous fixes to audio/video buffered resource loading. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/874/src/
Patch Set: '' Created 9 years, 2 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/filters/file_data_source.h ('k') | webkit/glue/media/buffered_data_source.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/file_data_source.cc
===================================================================
--- media/filters/file_data_source.cc (revision 105891)
+++ media/filters/file_data_source.cc (working copy)
@@ -16,9 +16,16 @@
FileDataSource::FileDataSource()
: file_(NULL),
- file_size_(0) {
+ file_size_(0),
+ disable_file_size_(false) {
}
+FileDataSource::FileDataSource(bool disable_file_size)
+ : file_(NULL),
+ file_size_(0),
+ disable_file_size_(disable_file_size) {
+}
+
FileDataSource::~FileDataSource() {
DCHECK(!file_);
}
@@ -37,17 +44,18 @@
file_size_ = 0;
return PIPELINE_ERROR_URL_NOT_FOUND;
}
- if (host()) {
- host()->SetTotalBytes(file_size_);
- host()->SetBufferedBytes(file_size_);
- }
+ UpdateHostBytes();
return PIPELINE_OK;
}
void FileDataSource::set_host(FilterHost* filter_host) {
DataSource::set_host(filter_host);
- if (file_) {
+ UpdateHostBytes();
+}
+
+void FileDataSource::UpdateHostBytes() {
+ if (host() && file_) {
host()->SetTotalBytes(file_size_);
host()->SetBufferedBytes(file_size_);
}
@@ -103,13 +111,17 @@
DCHECK(file_);
base::AutoLock l(lock_);
*size_out = file_size_;
- return (NULL != file_);
+ return (NULL != file_ && !disable_file_size_);
}
bool FileDataSource::IsStreaming() {
return false;
}
-void FileDataSource::SetPreload(Preload preload) {}
+void FileDataSource::SetPreload(Preload preload) {
+}
+void FileDataSource::SetBitrate(int bitrate) {
+}
+
} // namespace media
« no previous file with comments | « media/filters/file_data_source.h ('k') | webkit/glue/media/buffered_data_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698