Chromium Code Reviews| Index: content/renderer/media/webmediaplayer_impl.h |
| diff --git a/content/renderer/media/webmediaplayer_impl.h b/content/renderer/media/webmediaplayer_impl.h |
| index 60d01387579bd297bd5c8cb0fdbc229074025f09..280cfa370d66a2505870c0233817446eba159da3 100644 |
| --- a/content/renderer/media/webmediaplayer_impl.h |
| +++ b/content/renderer/media/webmediaplayer_impl.h |
| @@ -13,6 +13,7 @@ |
| #include "base/memory/scoped_ptr.h" |
| #include "base/memory/weak_ptr.h" |
| #include "base/threading/thread.h" |
| +#include "content/renderer/media/buffered_data_source.h" |
| #include "content/renderer/media/crypto/proxy_decryptor.h" |
| #include "content/renderer/media/video_frame_compositor.h" |
| #include "media/base/audio_renderer_sink.h" |
| @@ -64,6 +65,7 @@ class WebTextTrackImpl; |
| // Encrypted Media. |
| class WebMediaPlayerImpl |
| : public blink::WebMediaPlayer, |
| + public BufferedDataSourceHost, |
| public base::SupportsWeakPtr<WebMediaPlayerImpl> { |
| public: |
| // Constructs a WebMediaPlayer implementation using Chromium's media stack. |
| @@ -156,6 +158,10 @@ class WebMediaPlayerImpl |
| virtual void setContentDecryptionModule( |
| blink::WebContentDecryptionModule* cdm); |
| + // BufferedDataSourceHost implementation. |
| + virtual void SetTotalBytes(int64 total_bytes) OVERRIDE; |
| + virtual void AddBufferedByteRange(int64 start, int64 end) OVERRIDE; |
| + |
| // Notifies blink that the entire media element region has been invalidated. |
| // This path is slower than notifying the compositor directly as it performs |
| // more work and can trigger layouts. It should only be used in two cases: |
| @@ -244,9 +250,6 @@ class WebMediaPlayerImpl |
| blink::WebMediaPlayer::NetworkState network_state_; |
| blink::WebMediaPlayer::ReadyState ready_state_; |
| - // Keep a list of buffered time ranges. |
| - blink::WebTimeRanges buffered_; |
| - |
| // Message loops for posting tasks on Chrome's main thread. Also used |
| // for DCHECKs so methods calls won't execute in the wrong thread. |
| const scoped_refptr<base::MessageLoopProxy> main_loop_; |
| @@ -265,6 +268,19 @@ class WebMediaPlayerImpl |
| // Cache of metadata for answering hasAudio(), hasVideo(), and naturalSize(). |
| media::PipelineMetadata pipeline_metadata_; |
| + // TODO(sandersd): comment. |
| + int64 total_bytes_; |
|
scherkus (not reviewing)
2014/04/03 21:59:37
nit: I'd stash all these variables together around
sandersd (OOO until July 31)
2014/04/04 23:48:41
Done.
|
| + |
| + // List of buffered byte ranges for estimating buffered time. |
| + media::Ranges<int64> buffered_byte_ranges_; |
| + |
| + // TODO(sandersd): comment. |
| + blink::WebTimeRanges buffered_; |
| + |
| + // True when AddBufferedByteRange() has been called more recently than |
| + // didLoadingProgress(). |
| + mutable bool did_loading_progress_; |
| + |
| // Playback state. |
| // |
| // TODO(scherkus): we have these because Pipeline favours the simplicity of a |