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

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

Issue 248012: Change how <video> fetch a resource to make it friendly to sparse caching (Closed)
Patch Set: style Created 11 years, 3 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 | « no previous file | webkit/glue/media/buffered_data_source.cc » ('j') | webkit/glue/media/buffered_data_source.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/media/buffered_data_source.h
diff --git a/webkit/glue/media/buffered_data_source.h b/webkit/glue/media/buffered_data_source.h
index f3282ccf3961d13571224152129b7321a7af297d..093e2787b6b96c30a0c1d74195c2c71b7c55d0c4 100644
--- a/webkit/glue/media/buffered_data_source.h
+++ b/webkit/glue/media/buffered_data_source.h
@@ -51,8 +51,6 @@ class BufferedResourceLoader :
// |callback| is called with the following values:
// - net::OK
// The request has started successfully.
- // - net::ERR_REQUEST_RANGE_NOT_SATISFIABLE
- // A range request was made to the server but the server doesn't support it.
// - net::ERR_FAILED
// The request has failed because of an error with the network.
// - net::ERR_INVALID_RESPONSE
@@ -85,6 +83,10 @@ class BufferedResourceLoader :
// the size is unknown.
virtual int64 instance_size() { return 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() { return partial_response_; }
+
/////////////////////////////////////////////////////////////////////////////
// webkit_glue::ResourceLoaderBridge::Peer implementations.
virtual void OnUploadProgress(uint64 position, uint64 size) {}
@@ -137,10 +139,18 @@ class BufferedResourceLoader :
// A sliding window of buffer.
scoped_ptr<media::SeekableBuffer> buffer_;
+ // True if resource loading is deffered.
scherkus (not reviewing) 2009/09/29 23:10:34 deffered -> deferred
bool deferred_;
+
+ // True if resource loading is completed.
scherkus (not reviewing) 2009/09/29 23:10:34 is -> has
bool completed_;
+
+ // True if a range request is made.
scherkus (not reviewing) 2009/09/29 23:10:34 is -> was
bool range_requested_;
+ // True if response data received is a partial range.
scherkus (not reviewing) 2009/09/29 23:10:34 is -> was
+ bool partial_response_;
+
webkit_glue::MediaResourceLoaderBridgeFactory* bridge_factory_;
GURL url_;
int64 first_byte_position_;
@@ -257,10 +267,6 @@ class BufferedDataSource : public media::DataSource {
// initial request is received.
void InitialStartCallback(int error);
- // Callback method for |probe_loader_|. This method is called when the
- // response for probe request is received.
- void ProbeStartCallback(int error);
-
// Callback method to be passed to BufferedResourceLoader during range
// request. Once a resource request has started, this method will be called
// with the error code. This method will be executed on the thread
@@ -293,9 +299,6 @@ class BufferedDataSource : public media::DataSource {
// A resource loader for the media resource.
scoped_refptr<BufferedResourceLoader> loader_;
- // A resource loader that probes the server's ability to serve range requests.
- scoped_refptr<BufferedResourceLoader> probe_loader_;
-
// Callback method from the pipeline for initialization.
scoped_ptr<media::FilterCallback> initialize_callback_;
@@ -307,12 +310,6 @@ class BufferedDataSource : public media::DataSource {
base::Time read_submitted_time_;
int read_attempts_;
- // This flag is set to true if the initial request has started.
- bool initial_response_received_;
-
- // This flag is set to true if the probe request has started.
- bool probe_response_received_;
-
// This buffer is intermediate, we use it for BufferedResourceLoader to write
// to. And when read in BufferedResourceLoader is done, we copy data from
// this buffer to |read_buffer_|. The reason for an additional copy is that
« no previous file with comments | « no previous file | webkit/glue/media/buffered_data_source.cc » ('j') | webkit/glue/media/buffered_data_source.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698