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

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: Created 8 years, 7 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
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 "media/base/media_export.h" 10 #include "media/base/media_export.h"
11 11
12 namespace media { 12 namespace media {
13 13
14 class MEDIA_EXPORT DataSourceHost { 14 class MEDIA_EXPORT DataSourceHost {
15 public: 15 public:
16 virtual ~DataSourceHost();
17
18 // Set the total size of the media file. 16 // Set the total size of the media file.
19 virtual void SetTotalBytes(int64 total_bytes) = 0; 17 virtual void SetTotalBytes(int64 total_bytes) = 0;
20 18
21 // Sets the total number of bytes that are buffered on the client and ready to 19 // Sets the total number of bytes that are buffered on the client and ready to
22 // be played. 20 // be played.
23 virtual void SetBufferedBytes(int64 buffered_bytes) = 0; 21 virtual void SetBufferedBytes(int64 buffered_bytes) = 0;
24 22
25 // Sets the flag to indicate current network activity. 23 // Sets the flag to indicate current network activity.
26 virtual void SetNetworkActivity(bool is_downloading_data) = 0; 24 virtual void SetNetworkActivity(bool is_downloading_data) = 0;
25
26 protected:
27 virtual ~DataSourceHost();
27 }; 28 };
28 29
29 class MEDIA_EXPORT DataSource : public base::RefCountedThreadSafe<DataSource> { 30 class MEDIA_EXPORT DataSource : public base::RefCountedThreadSafe<DataSource> {
30 public: 31 public:
31 typedef base::Callback<void(int64, int64)> StatusCallback; 32 typedef base::Callback<void(int64, int64)> StatusCallback;
32 typedef base::Callback<void(int)> ReadCB; 33 typedef base::Callback<void(int)> ReadCB;
33 static const int kReadError; 34 static const int kReadError;
34 35
35 DataSource(); 36 DataSource();
36 37
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 71
71 private: 72 private:
72 DataSourceHost* host_; 73 DataSourceHost* host_;
73 74
74 DISALLOW_COPY_AND_ASSIGN(DataSource); 75 DISALLOW_COPY_AND_ASSIGN(DataSource);
75 }; 76 };
76 77
77 } // namespace media 78 } // namespace media
78 79
79 #endif // MEDIA_BASE_DATA_SOURCE_H_ 80 #endif // MEDIA_BASE_DATA_SOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698