summaryrefslogtreecommitdiffstats
path: root/webkit/glue/media
diff options
context:
space:
mode:
authorscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-21 15:34:59 +0000
committerscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-21 15:34:59 +0000
commitcef538b27bc50160a780551eb0aea82b6bf5e131 (patch)
treec06af8b631e730b2727785d717104ea6cea6ecb8 /webkit/glue/media
parentfa0afad01fb77371f1f3addd5973f078919440dc (diff)
downloadchromium_src-cef538b27bc50160a780551eb0aea82b6bf5e131.zip
chromium_src-cef538b27bc50160a780551eb0aea82b6bf5e131.tar.gz
chromium_src-cef538b27bc50160a780551eb0aea82b6bf5e131.tar.bz2
Replace initial media range request with an unbounded range request.
We typically are forced to make a second request to finish reading file headers. Starting with an unbounded range request results in reading more data than necessary, however we make one less round-trip request. Testing against a local server using an unbounded range request reduced startup latency by 60-100ms. BUG=none TEST=media tests, layout tests Review URL: http://codereview.chromium.org/6011004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69830 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/media')
-rw-r--r--webkit/glue/media/buffered_data_source.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/webkit/glue/media/buffered_data_source.cc b/webkit/glue/media/buffered_data_source.cc
index 8ddd5fa..b6efa16 100644
--- a/webkit/glue/media/buffered_data_source.cc
+++ b/webkit/glue/media/buffered_data_source.cc
@@ -191,12 +191,9 @@ void BufferedDataSource::InitializeTask() {
&BufferedDataSource::WatchDogTask);
if (url_.SchemeIs(kHttpScheme) || url_.SchemeIs(kHttpsScheme)) {
- // Fetch only first 1024 bytes as this usually covers the header portion
- // of a media file that gives enough information about the codecs, etc.
- // This also serve as a probe to determine server capability to serve
- // range request.
- // TODO(hclam): Do some experiments for the best approach.
- loader_ = CreateResourceLoader(0, 1024);
+ // Do an unbounded range request starting at the beginning. If the server
+ // responds with 200 instead of 206 we'll fall back into a streaming mode.
+ loader_ = CreateResourceLoader(0, kPositionNotSpecified);
loader_->Start(
NewCallback(this, &BufferedDataSource::HttpInitialStartCallback),
NewCallback(this, &BufferedDataSource::NetworkEventCallback),