Index: content/renderer/media/buffered_data_source_host_impl.h |
diff --git a/content/renderer/media/buffered_data_source_host_impl.h b/content/renderer/media/buffered_data_source_host_impl.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..60ca6f0e8440774012c7c9215775dea23d2a4eb3 |
--- /dev/null |
+++ b/content/renderer/media/buffered_data_source_host_impl.h |
@@ -0,0 +1,51 @@ |
+// Copyright 2013 The Chromium Authors. All rights reserved. |
scherkus (not reviewing)
2014/04/08 04:36:18
heads up -- it's 2014!
sandersd (OOO until July 31)
2014/04/08 22:42:14
Oops, clearly I was on auto-pilot.
|
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CONTENT_RENDERER_MEDIA_BUFFERED_DATA_SOURCE_HOST_IMPL_H_ |
+#define CONTENT_RENDERER_MEDIA_BUFFERED_DATA_SOURCE_HOST_IMPL_H_ |
+ |
+#include "base/time/time.h" |
+#include "content/common/content_export.h" |
+#include "content/renderer/media/buffered_data_source.h" |
+#include "media/base/ranges.h" |
+ |
+namespace content { |
+ |
+// Implementation of BufferedDataSourceHost for use by WebMediaPlayerImpl. |
scherkus (not reviewing)
2014/04/08 04:36:18
nit: a better comment would answer why / the main
|
+class CONTENT_EXPORT BufferedDataSourceHostImpl |
+ : public BufferedDataSourceHost { |
+ public: |
+ BufferedDataSourceHostImpl() {}; |
scherkus (not reviewing)
2014/04/08 04:36:18
these should go to the .cc since we don't have a p
sandersd (OOO until July 31)
2014/04/08 22:42:14
Sorry, I'll get the hang of this eventually. You'l
|
+ ~BufferedDataSourceHostImpl() {}; |
+ |
+ // BufferedDataSourceHost implementation. |
+ virtual void SetTotalBytes(int64 total_bytes) OVERRIDE; |
+ virtual void AddBufferedByteRange(int64 start, int64 end) OVERRIDE; |
+ |
+ // Translate the byte ranges to time ranges and append them to the list. |
+ void AddBufferedTimeRanges( |
+ media::Ranges<base::TimeDelta>* buffered_time_ranges, |
+ base::TimeDelta media_duration); |
+ |
+ // TODO(sandersd): Change this to non-const along with Pipeline's version. |
+ // http://crbug.com/360251 |
+ bool DidLoadingProgress() const; |
+ |
+ private: |
+ // Total size of the data source. |
+ int64 total_bytes_; |
+ |
+ // List of buffered byte ranges for estimating buffered time. |
+ media::Ranges<int64> buffered_byte_ranges_; |
+ |
+ // True when AddBufferedByteRange() has been called more recently than |
+ // DidLoadingProgress(). |
+ mutable bool did_loading_progress_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(BufferedDataSourceHostImpl); |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_RENDERER_MEDIA_BUFFERED_DATA_SOURCE_HOST_IMPL_H_ |