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

Unified Diff: webkit/media/buffered_data_source.h

Issue 9836102: Fold WebDataSource into BufferedDataSource. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src
Patch Set: dcheck-o-rama Created 8 years, 9 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/media/buffered_data_source.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/media/buffered_data_source.h
diff --git a/webkit/media/buffered_data_source.h b/webkit/media/buffered_data_source.h
index 9935c515dd2e67ab9aeb9ea851ed288d15fae153..42332da05aa67d26c67d5887c0482c6c8ce8c75e 100644
--- a/webkit/media/buffered_data_source.h
+++ b/webkit/media/buffered_data_source.h
@@ -12,17 +12,23 @@
#include "base/synchronization/lock.h"
#include "googleurl/src/gurl.h"
#include "media/base/data_source.h"
+#include "media/base/pipeline_status.h"
#include "webkit/media/buffered_resource_loader.h"
+class MessageLoop;
+
namespace media {
class MediaLog;
}
namespace webkit_media {
-// This class may be created on any thread, and is callable from the render
-// thread as well as media-specific threads.
-class BufferedDataSource : public WebDataSource {
+// A data source capable of loading URLs and buffering the data using an
+// in-memory sliding window.
+//
+// BufferedDataSource must be created and initialized on the render thread
+// before being passed to other threads. It may be deleted on any thread.
+class BufferedDataSource : public media::DataSource {
public:
BufferedDataSource(MessageLoop* render_loop,
WebKit::WebFrame* frame,
@@ -30,6 +36,26 @@ class BufferedDataSource : public WebDataSource {
virtual ~BufferedDataSource();
+ // Initialize this object using |url|. This object calls |status_cb| when
+ // initialization has completed.
+ //
+ // Method called on the render thread.
+ void Initialize(const GURL& url,
+ const media::PipelineStatusCB& status_cb);
+
+ // Returns true if the media resource has a single origin, false otherwise.
+ // Only valid to call after Initialize() has completed.
+ //
+ // Method called on the render thread.
+ bool HasSingleOrigin();
+
+ // Cancels initialization, any pending loaders, and any pending read calls
+ // from the demuxer. The caller is expected to release its reference to this
+ // object and never call it again.
+ //
+ // Method called on the render thread.
+ void Abort();
+
// media::DataSource implementation.
// Called from demuxer thread.
virtual void set_host(media::DataSourceHost* host) OVERRIDE;
@@ -43,12 +69,6 @@ class BufferedDataSource : public WebDataSource {
virtual void SetPreload(media::Preload preload) OVERRIDE;
virtual void SetBitrate(int bitrate) OVERRIDE;
- // webkit_glue::WebDataSource implementation.
- virtual void Initialize(
- const GURL& url, const media::PipelineStatusCB& initialize_cb) OVERRIDE;
- virtual bool HasSingleOrigin() OVERRIDE;
- virtual void Abort() OVERRIDE;
-
protected:
// A factory method to create a BufferedResourceLoader based on the read
// parameters. We can override this file to object a mock
« no previous file with comments | « no previous file | webkit/media/buffered_data_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698