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

Unified Diff: webkit/glue/media/buffered_resource_loader.h

Issue 6815012: Only make Range requests when the desired range doesn't cover the whole file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unit tests Created 9 years, 8 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
Index: webkit/glue/media/buffered_resource_loader.h
diff --git a/webkit/glue/media/buffered_resource_loader.h b/webkit/glue/media/buffered_resource_loader.h
index 06b05903c14cff9ab0fcb5836960c5cdc5d3a46c..245d3bd29b9eb3943f69f8b349790efe67be1e58 100644
--- a/webkit/glue/media/buffered_resource_loader.h
+++ b/webkit/glue/media/buffered_resource_loader.h
@@ -103,9 +103,8 @@ class BufferedResourceLoader :
// |kPositionNotSpecified|, then the size is unknown.
virtual int64 instance_size();
- // Returns true if the response for this loader is a partial response.
- // It means a 206 response in HTTP/HTTPS protocol.
- virtual bool partial_response();
+ // Returns true if the server supports byte range requests.
+ virtual bool range_supported();
// Returns true if network is currently active.
virtual bool network_activity();
@@ -208,6 +207,10 @@ class BufferedResourceLoader :
bool HasPendingRead() { return read_callback_.get() != NULL; }
+ // Helper function that returns true if the request range is for the
+ // whole file (ie. 0-).
Ami GONE FROM CHROMIUM 2011/04/08 03:02:10 s/)/ or 0-max)/
acolwell GONE FROM CHROMIUM 2011/04/18 22:09:56 This method doesn't return true if 0-max is specif
+ bool IsWholeFileRange() const;
+
// A sliding window of buffer.
scoped_ptr<media::SeekableBuffer> buffer_;
@@ -223,8 +226,8 @@ class BufferedResourceLoader :
// True if a range request was made.
bool range_requested_;
- // True if response data received is a partial range.
- bool partial_response_;
+ // True if Range header is supported.
+ bool range_supported_;
// Does the work of loading and sends data back to this client.
scoped_ptr<WebKit::WebURLLoader> url_loader_;

Powered by Google App Engine
This is Rietveld 408576698