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

Unified Diff: media/base/demuxer.h

Issue 9968117: Move Demuxer::set_host() to Initialize(). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src
Patch Set: fixes Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | media/base/demuxer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/demuxer.h
diff --git a/media/base/demuxer.h b/media/base/demuxer.h
index 3647a9d54505106fb160ed5061cdbd7433b133b7..4458ce0418a7e419f4e1f514a7d3e06a7ebfca4d 100644
--- a/media/base/demuxer.h
+++ b/media/base/demuxer.h
@@ -34,22 +34,16 @@ class MEDIA_EXPORT DemuxerHost : public DataSourceHost {
virtual void OnDemuxerError(PipelineStatus error) = 0;
};
-class MEDIA_EXPORT Demuxer
- : public base::RefCountedThreadSafe<Demuxer> {
+class MEDIA_EXPORT Demuxer : public base::RefCountedThreadSafe<Demuxer> {
public:
Demuxer();
- // Sets the private member |host_|. This is the first method called by
- // the DemuxerHost after a demuxer is created. The host holds a strong
- // reference to the demuxer. The reference held by the host is guaranteed
- // to be released before the host object is destroyed by the pipeline.
- virtual void set_host(DemuxerHost* host);
-
// Completes initialization of the demuxer.
//
- // TODO(scherkus): pass in DemuxerHost here instead of using set_host(),
- // see http://crbug.com/111585
- virtual void Initialize(const PipelineStatusCB& status_cb) = 0;
+ // The demuxer does not own |host| as it is guaranteed to outlive the
+ // lifetime of the demuxer. Don't delete it!
+ virtual void Initialize(DemuxerHost* host,
+ const PipelineStatusCB& status_cb) = 0;
// The pipeline playback rate has been changed. Demuxers may implement this
// method if they need to respond to this call.
@@ -90,19 +84,10 @@ class MEDIA_EXPORT Demuxer
virtual bool IsSeekable() = 0;
protected:
- // Only allow derived objects access to the DemuxerHost. This is
- // kept out of the public interface because demuxers need to be
- // aware of all calls made to the host object so they can insure
- // the state presented to the host is always consistent with its own
- // state.
- DemuxerHost* host() { return host_; }
-
friend class base::RefCountedThreadSafe<Demuxer>;
virtual ~Demuxer();
private:
- DemuxerHost* host_;
-
DISALLOW_COPY_AND_ASSIGN(Demuxer);
};
« no previous file with comments | « no previous file | media/base/demuxer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698