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

Side by Side Diff: media/base/data_source.h

Issue 10383262: RefCounted types should not have public destructors, delegate cleanup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make win bot happy Created 8 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « media/audio/audio_output_controller.h ('k') | media/base/demuxer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_BASE_DATA_SOURCE_H_ 5 #ifndef MEDIA_BASE_DATA_SOURCE_H_
6 #define MEDIA_BASE_DATA_SOURCE_H_ 6 #define MEDIA_BASE_DATA_SOURCE_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/time.h" 10 #include "base/time.h"
11 #include "media/base/media_export.h" 11 #include "media/base/media_export.h"
12 12
13 namespace media { 13 namespace media {
14 14
15 class MEDIA_EXPORT DataSourceHost { 15 class MEDIA_EXPORT DataSourceHost {
16 public: 16 public:
17 virtual ~DataSourceHost();
18
19 // Set the total size of the media file. 17 // Set the total size of the media file.
20 virtual void SetTotalBytes(int64 total_bytes) = 0; 18 virtual void SetTotalBytes(int64 total_bytes) = 0;
21 19
22 // Notify the host that byte range [start,end] has been buffered. 20 // Notify the host that byte range [start,end] has been buffered.
23 // TODO(fischman): remove this method when demuxing is push-based instead of 21 // TODO(fischman): remove this method when demuxing is push-based instead of
24 // pull-based. http://crbug.com/131444 22 // pull-based. http://crbug.com/131444
25 virtual void AddBufferedByteRange(int64 start, int64 end) = 0; 23 virtual void AddBufferedByteRange(int64 start, int64 end) = 0;
26 24
27 // Notify the host that time range [start,end] has been buffered. 25 // Notify the host that time range [start,end] has been buffered.
28 virtual void AddBufferedTimeRange(base::TimeDelta start, 26 virtual void AddBufferedTimeRange(base::TimeDelta start,
29 base::TimeDelta end) = 0; 27 base::TimeDelta end) = 0;
28
29 protected:
30 virtual ~DataSourceHost();
30 }; 31 };
31 32
32 class MEDIA_EXPORT DataSource : public base::RefCountedThreadSafe<DataSource> { 33 class MEDIA_EXPORT DataSource : public base::RefCountedThreadSafe<DataSource> {
33 public: 34 public:
34 typedef base::Callback<void(int64, int64)> StatusCallback; 35 typedef base::Callback<void(int64, int64)> StatusCallback;
35 typedef base::Callback<void(int)> ReadCB; 36 typedef base::Callback<void(int)> ReadCB;
36 static const int kReadError; 37 static const int kReadError;
37 38
38 DataSource(); 39 DataSource();
39 40
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 74
74 private: 75 private:
75 DataSourceHost* host_; 76 DataSourceHost* host_;
76 77
77 DISALLOW_COPY_AND_ASSIGN(DataSource); 78 DISALLOW_COPY_AND_ASSIGN(DataSource);
78 }; 79 };
79 80
80 } // namespace media 81 } // namespace media
81 82
82 #endif // MEDIA_BASE_DATA_SOURCE_H_ 83 #endif // MEDIA_BASE_DATA_SOURCE_H_
OLDNEW
« no previous file with comments | « media/audio/audio_output_controller.h ('k') | media/base/demuxer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698