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

Unified Diff: content/renderer/media/buffered_data_source.h

Issue 306953005: Changing constructor of BufferedDataSource to accept GURL and CORSMode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removing inline Created 6 years, 7 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 | content/renderer/media/buffered_data_source.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/buffered_data_source.h
diff --git a/content/renderer/media/buffered_data_source.h b/content/renderer/media/buffered_data_source.h
index 40acdcd0d9863130e8fe652b74031b3e7fc8e4fc..de44e3c9db2a3a4634642022531f1dd2e0c371e2 100644
--- a/content/renderer/media/buffered_data_source.h
+++ b/content/renderer/media/buffered_data_source.h
@@ -50,24 +50,23 @@ class CONTENT_EXPORT BufferedDataSource : public media::DataSource {
public:
typedef base::Callback<void(bool)> DownloadingCB;
- // Buffered byte range changes will be reported to |host|. |downloading_cb|
- // will be called whenever the downloading/paused state of the source changes.
- BufferedDataSource(const scoped_refptr<base::MessageLoopProxy>& render_loop,
+ // |url| and |cors_mode| are passed to the object. Buffered byte range changes
+ // will be reported to |host|. |downloading_cb| will be called whenever the
+ // downloading/paused state of the source changes.
+ BufferedDataSource(const GURL& url,
+ BufferedResourceLoader::CORSMode cors_mode,
+ const scoped_refptr<base::MessageLoopProxy>& render_loop,
blink::WebFrame* frame,
media::MediaLog* media_log,
BufferedDataSourceHost* host,
const DownloadingCB& downloading_cb);
virtual ~BufferedDataSource();
- // Initialize this object using |url| and |cors_mode|, executing |init_cb|
- // with the result of initialization when it has completed.
+ // Executes |init_cb| with the result of initialization when it has completed.
//
// Method called on the render thread.
typedef base::Callback<void(bool)> InitializeCB;
- void Initialize(
- const GURL& url,
- BufferedResourceLoader::CORSMode cors_mode,
- const InitializeCB& init_cb);
+ void Initialize(const InitializeCB& init_cb);
// Adjusts the buffering algorithm based on the given preload value.
void SetPreload(Preload preload);
@@ -94,6 +93,9 @@ class CONTENT_EXPORT BufferedDataSource : public media::DataSource {
void MediaIsPlaying();
void MediaIsPaused();
+ // Returns true if the resource is local.
+ bool assume_fully_buffered() { return !url_.SchemeIsHTTPOrHTTPS(); }
+
// media::DataSource implementation.
// Called from demuxer thread.
virtual void Stop(const base::Closure& closure) OVERRIDE;
@@ -157,10 +159,6 @@ class CONTENT_EXPORT BufferedDataSource : public media::DataSource {
// determined by reaching EOF.
int64 total_bytes_;
- // Some resources are assumed to be fully buffered (i.e., file://) so we don't
- // need to report what |loader_| has buffered.
- bool assume_fully_buffered_;
-
// This value will be true if this data source can only support streaming.
// i.e. range request is not supported.
bool streaming_;
« no previous file with comments | « no previous file | content/renderer/media/buffered_data_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698