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

Side by Side Diff: content/renderer/media/buffered_data_source_host_impl.h

Issue 224093011: Move DataSourceHost to BufferedDataSourceHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add unittest. Created 6 years, 8 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 unified diff | Download patch
OLDNEW
(Empty)
1 // 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.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_RENDERER_MEDIA_BUFFERED_DATA_SOURCE_HOST_IMPL_H_
6 #define CONTENT_RENDERER_MEDIA_BUFFERED_DATA_SOURCE_HOST_IMPL_H_
7
8 #include "base/time/time.h"
9 #include "content/common/content_export.h"
10 #include "content/renderer/media/buffered_data_source.h"
11 #include "media/base/ranges.h"
12
13 namespace content {
14
15 // 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
16 class CONTENT_EXPORT BufferedDataSourceHostImpl
17 : public BufferedDataSourceHost {
18 public:
19 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
20 ~BufferedDataSourceHostImpl() {};
21
22 // BufferedDataSourceHost implementation.
23 virtual void SetTotalBytes(int64 total_bytes) OVERRIDE;
24 virtual void AddBufferedByteRange(int64 start, int64 end) OVERRIDE;
25
26 // Translate the byte ranges to time ranges and append them to the list.
27 void AddBufferedTimeRanges(
28 media::Ranges<base::TimeDelta>* buffered_time_ranges,
29 base::TimeDelta media_duration);
30
31 // TODO(sandersd): Change this to non-const along with Pipeline's version.
32 // http://crbug.com/360251
33 bool DidLoadingProgress() const;
34
35 private:
36 // Total size of the data source.
37 int64 total_bytes_;
38
39 // List of buffered byte ranges for estimating buffered time.
40 media::Ranges<int64> buffered_byte_ranges_;
41
42 // True when AddBufferedByteRange() has been called more recently than
43 // DidLoadingProgress().
44 mutable bool did_loading_progress_;
45
46 DISALLOW_COPY_AND_ASSIGN(BufferedDataSourceHostImpl);
47 };
48
49 } // namespace content
50
51 #endif // CONTENT_RENDERER_MEDIA_BUFFERED_DATA_SOURCE_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698