summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webmediaplayer_impl.cc
diff options
context:
space:
mode:
authorvrk@google.com <vrk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-05 16:28:20 +0000
committervrk@google.com <vrk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-05 16:28:20 +0000
commit23a8b1d8f4c8c3b3c37811f310891256f45c8063 (patch)
tree3576777d4ec689cbba94c172f92ee5ed1e3077f9 /webkit/glue/webmediaplayer_impl.cc
parent702b280dbaa67b88d0b07da22dc73f2f3116afee (diff)
downloadchromium_src-23a8b1d8f4c8c3b3c37811f310891256f45c8063.zip
chromium_src-23a8b1d8f4c8c3b3c37811f310891256f45c8063.tar.gz
chromium_src-23a8b1d8f4c8c3b3c37811f310891256f45c8063.tar.bz2
Implementing preload=metadata for video
This patch implements the logic necessary to respect the preload attribute when it is set to MetaData. This also refactors the BufferedResourceLoader to determine its buffering techniques based on a DeferStrategy value. BUG=16482,76555 TEST=media/video-preload.html, test_shell_tests Review URL: http://codereview.chromium.org/6625059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80465 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webmediaplayer_impl.cc')
-rw-r--r--webkit/glue/webmediaplayer_impl.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/webkit/glue/webmediaplayer_impl.cc b/webkit/glue/webmediaplayer_impl.cc
index 527a297..c01b331 100644
--- a/webkit/glue/webmediaplayer_impl.cc
+++ b/webkit/glue/webmediaplayer_impl.cc
@@ -387,6 +387,8 @@ void WebMediaPlayerImpl::load(const WebKit::WebURL& url) {
// Handle any volume changes that occured before load().
setVolume(GetClient()->volume());
+ // Get the preload value.
+ setPreload(GetClient()->preload());
// Initialize the pipeline.
SetNetworkState(WebKit::WebMediaPlayer::Loading);
@@ -500,10 +502,18 @@ void WebMediaPlayerImpl::setVisible(bool visible) {
return;
}
-bool WebMediaPlayerImpl::setAutoBuffer(bool autoBuffer) {
+#define COMPILE_ASSERT_MATCHING_ENUM(webkit_name, chromium_name) \
+ COMPILE_ASSERT(int(WebKit::WebMediaPlayer::webkit_name) == \
+ int(media::chromium_name), \
+ mismatching_enums)
+COMPILE_ASSERT_MATCHING_ENUM(None, NONE);
+COMPILE_ASSERT_MATCHING_ENUM(MetaData, METADATA);
+COMPILE_ASSERT_MATCHING_ENUM(Auto, AUTO);
+
+void WebMediaPlayerImpl::setPreload(WebKit::WebMediaPlayer::Preload preload) {
DCHECK(MessageLoop::current() == main_loop_);
- return false;
+ pipeline_->SetPreload(static_cast<media::Preload>(preload));
}
bool WebMediaPlayerImpl::totalBytesKnown() {