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

Unified Diff: media/blink/multibuffer_data_source.h

Issue 2272163002: Delete now deprecated BufferedDataSource and friends. (Closed)
Patch Set: Delete BufferedResourceLoader too. Created 4 years, 4 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 | « media/blink/buffered_resource_loader_unittest.cc ('k') | media/blink/multibuffer_data_source.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/multibuffer_data_source.h
diff --git a/media/blink/multibuffer_data_source.h b/media/blink/multibuffer_data_source.h
index 456477504f3e37d59551c1e5a8919349331eb614..c6ace437d74eafe3950e419f4d409d1b9322bb1d 100644
--- a/media/blink/multibuffer_data_source.h
+++ b/media/blink/multibuffer_data_source.h
@@ -18,7 +18,6 @@
#include "base/synchronization/lock.h"
#include "media/base/data_source.h"
#include "media/base/ranges.h"
-#include "media/blink/buffered_data_source.h"
#include "media/blink/media_blink_export.h"
#include "media/blink/url_index.h"
#include "url/gurl.h"
@@ -28,6 +27,7 @@ class SingleThreadTaskRunner;
}
namespace media {
+class BufferedDataSourceHost;
class MediaLog;
class MultiBufferReader;
@@ -36,11 +36,31 @@ class MultiBufferReader;
//
// MultibufferDataSource must be created and destroyed on the thread associated
// with the |task_runner| passed in the constructor.
-class MEDIA_BLINK_EXPORT MultibufferDataSource
- : NON_EXPORTED_BASE(public BufferedDataSourceInterface) {
+class MEDIA_BLINK_EXPORT MultibufferDataSource : public DataSource {
public:
typedef base::Callback<void(bool)> DownloadingCB;
+ // Used to specify video preload states. They are "hints" to the browser about
+ // how aggressively the browser should load and buffer data.
+ // Please see the HTML5 spec for the descriptions of these values:
+ // http://www.w3.org/TR/html5/video.html#attr-media-preload
+ //
+ // Enum values must match the values in blink::WebMediaPlayer::Preload and
+ // there will be assertions at compile time if they do not match.
+ enum Preload {
+ NONE,
+ METADATA,
+ AUTO,
+ };
+
+ // Enum values must match the values in
+ // blink::WebMediaPlayer::BufferingStrategy and there will be assertions at
+ // compile time if they do not match.
+ enum BufferingStrategy {
+ BUFFERING_STRATEGY_NORMAL,
+ BUFFERING_STRATEGY_AGGRESSIVE,
+ };
+
// |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.
@@ -58,50 +78,51 @@ class MEDIA_BLINK_EXPORT MultibufferDataSource
// Executes |init_cb| with the result of initialization when it has completed.
//
// Method called on the render thread.
- void Initialize(const InitializeCB& init_cb) override;
+ typedef base::Callback<void(bool)> InitializeCB;
+ void Initialize(const InitializeCB& init_cb);
// Adjusts the buffering algorithm based on the given preload value.
- void SetPreload(Preload preload) override;
+ void SetPreload(Preload preload);
// Adjusts the buffering algorithm based on the given buffering strategy
// value.
- void SetBufferingStrategy(BufferingStrategy buffering_strategy) override;
+ void SetBufferingStrategy(BufferingStrategy buffering_strategy);
// 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() override;
+ bool HasSingleOrigin();
// Returns true if the media resource passed a CORS access control check.
- bool DidPassCORSAccessCheck() const override;
+ bool DidPassCORSAccessCheck() const;
// 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() override;
+ void Abort();
// Notifies changes in playback state for controlling media buffering
// behavior.
- void MediaPlaybackRateChanged(double playback_rate) override;
- void MediaIsPlaying() override;
- bool media_has_played() const override;
+ void MediaPlaybackRateChanged(double playback_rate);
+ void MediaIsPlaying();
+ bool media_has_played() const;
// Returns true if the resource is local.
- bool assume_fully_buffered() override;
+ bool assume_fully_buffered();
// Cancels any open network connections once reaching the deferred state. If
// |always_cancel| is false this is done only for preload=metadata, non-
// streaming resources that have not started playback. If |always_cancel| is
// true, all resource types will have their connections canceled. If already
// deferred, connections will be immediately closed.
- void OnBufferingHaveEnough(bool always_cancel) override;
+ void OnBufferingHaveEnough(bool always_cancel);
- int64_t GetMemoryUsage() const override;
+ int64_t GetMemoryUsage() const;
- GURL GetUrlAfterRedirects() const override;
+ GURL GetUrlAfterRedirects() const;
// DataSource implementation.
// Called from demuxer thread.
« no previous file with comments | « media/blink/buffered_resource_loader_unittest.cc ('k') | media/blink/multibuffer_data_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698