diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-31 00:06:44 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-31 00:06:44 +0000 |
commit | 6c430207bf0821205fc287ee568042359a2e96b7 (patch) | |
tree | a112c2a2cbe8484b608a89ff7b99107beed02604 /webkit/media/buffered_data_source.h | |
parent | 07e8c4607a2cbd24a617757428611b4ff84ae5d3 (diff) | |
download | chromium_src-6c430207bf0821205fc287ee568042359a2e96b7.zip chromium_src-6c430207bf0821205fc287ee568042359a2e96b7.tar.gz chromium_src-6c430207bf0821205fc287ee568042359a2e96b7.tar.bz2 |
Move DataSource::SetPreload() to BufferedDataSource.
Preload is a concept that only applies to HTML media elements and is only implemented by BufferedDataSource. Since the preload value is known when BufferedDataSource is created by WebMediaPlayerImpl, we can remove a lot of unnecessary plumbing in the media code.
TEST=amount of data buffered (either visible on controls or via buffered attribute) is the same for each preload value (none, metadata, and auto). http://mastodon.sea/demos/preload contains a test page.
Review URL: https://chromiumcodereview.appspot.com/9864022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130004 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/media/buffered_data_source.h')
-rw-r--r-- | webkit/media/buffered_data_source.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/webkit/media/buffered_data_source.h b/webkit/media/buffered_data_source.h index 42332da..bdadaf5 100644 --- a/webkit/media/buffered_data_source.h +++ b/webkit/media/buffered_data_source.h @@ -14,6 +14,7 @@ #include "media/base/data_source.h" #include "media/base/pipeline_status.h" #include "webkit/media/buffered_resource_loader.h" +#include "webkit/media/preload.h" class MessageLoop; @@ -43,6 +44,9 @@ class BufferedDataSource : public media::DataSource { void Initialize(const GURL& url, const media::PipelineStatusCB& status_cb); + // Adjusts the buffering algorithm based on the given preload value. + void SetPreload(Preload preload); + // Returns true if the media resource has a single origin, false otherwise. // Only valid to call after Initialize() has completed. // @@ -66,7 +70,6 @@ class BufferedDataSource : public media::DataSource { const media::DataSource::ReadCB& read_cb) OVERRIDE; virtual bool GetSize(int64* size_out) OVERRIDE; virtual bool IsStreaming() OVERRIDE; - virtual void SetPreload(media::Preload preload) OVERRIDE; virtual void SetBitrate(int bitrate) OVERRIDE; protected: @@ -95,9 +98,6 @@ class BufferedDataSource : public media::DataSource { // and signals the buffered resource loader accordingly. void SetPlaybackRateTask(float playback_rate); - // This task saves the preload value for the media. - void SetPreloadTask(media::Preload preload); - // Tells |loader_| the bitrate of the media. void SetBitrateTask(int bitrate); @@ -211,7 +211,7 @@ class BufferedDataSource : public media::DataSource { // This variable holds the value of the preload attribute for the video // element. - media::Preload preload_; + Preload preload_; // Number of cache miss retries left. int cache_miss_retries_left_; |