summaryrefslogtreecommitdiffstats
path: root/media/base/demuxer.h
diff options
context:
space:
mode:
authorrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-26 01:06:06 +0000
committerrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-26 01:06:06 +0000
commit512d03f78c442cf31bae077d93ecc4882a46b286 (patch)
tree428c50889d8a1ded265b3dd90775cb300f12e2ae /media/base/demuxer.h
parent8c672de7d601eba2b337446bb869f08dece73633 (diff)
downloadchromium_src-512d03f78c442cf31bae077d93ecc4882a46b286.zip
chromium_src-512d03f78c442cf31bae077d93ecc4882a46b286.tar.gz
chromium_src-512d03f78c442cf31bae077d93ecc4882a46b286.tar.bz2
RefCounted types should not have public destructors, delegate cleanup
For Delegate/Observer-type classes that specify an interface but do not have any particular lifetime requirements, make their destructors protected. This is to allow their interfaces to be implemented safely by RefCounted types. With public destructors, it's possible to do "scoped_ptr<Delegate> foo", and then assign a RefCountedDelegateImpl, which would lead to a double free. As none of these Delegates actually need public destructors (ownership of the Delegate* is not transferred during a function call / class constructor), mark the destructors protected so that it becomes a compile warning to try to delete them via the Delegate*. BUG=123295 TEST=it compiles Review URL: https://chromiumcodereview.appspot.com/10383262 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144086 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base/demuxer.h')
-rw-r--r--media/base/demuxer.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/media/base/demuxer.h b/media/base/demuxer.h
index 48d0e6a..3fdc37b 100644
--- a/media/base/demuxer.h
+++ b/media/base/demuxer.h
@@ -16,8 +16,6 @@ namespace media {
class MEDIA_EXPORT DemuxerHost : public DataSourceHost {
public:
- virtual ~DemuxerHost();
-
// Sets the duration of the media in microseconds.
// Duration may be kInfiniteDuration() if the duration is not known.
virtual void SetDuration(base::TimeDelta duration) = 0;
@@ -25,6 +23,9 @@ class MEDIA_EXPORT DemuxerHost : public DataSourceHost {
// Stops execution of the pipeline due to a fatal error. Do not call this
// method with PIPELINE_OK.
virtual void OnDemuxerError(PipelineStatus error) = 0;
+
+ protected:
+ virtual ~DemuxerHost();
};
class MEDIA_EXPORT Demuxer : public base::RefCountedThreadSafe<Demuxer> {