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

Unified Diff: media/filters/decrypting_demuxer_stream.h

Issue 13813016: Remove reference counting from media::Demuxer and friends. (Closed) Base URL: http://git.chromium.org/chromium/src.git@vd_scoped
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
Index: media/filters/decrypting_demuxer_stream.h
diff --git a/media/filters/decrypting_demuxer_stream.h b/media/filters/decrypting_demuxer_stream.h
index b51ce3e8b7a08a9f6b091c0a0ca8973a8824dd1a..996adc857a8bfae7d8685634a7091779541fea42 100644
--- a/media/filters/decrypting_demuxer_stream.h
+++ b/media/filters/decrypting_demuxer_stream.h
@@ -7,6 +7,7 @@
#include "base/callback.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
#include "media/base/decryptor.h"
#include "media/base/demuxer_stream.h"
@@ -27,8 +28,9 @@ class MEDIA_EXPORT DecryptingDemuxerStream : public DemuxerStream {
DecryptingDemuxerStream(
const scoped_refptr<base::MessageLoopProxy>& message_loop,
const SetDecryptorReadyCB& set_decryptor_ready_cb);
+ virtual ~DecryptingDemuxerStream();
- void Initialize(const scoped_refptr<DemuxerStream>& stream,
+ void Initialize(DemuxerStream* stream,
const PipelineStatusCB& status_cb);
void Reset(const base::Closure& closure);
@@ -39,9 +41,6 @@ class MEDIA_EXPORT DecryptingDemuxerStream : public DemuxerStream {
virtual Type type() OVERRIDE;
virtual void EnableBitstreamConverter() OVERRIDE;
- protected:
- virtual ~DecryptingDemuxerStream();
-
private:
// For a detailed state diagram please see this link: http://goo.gl/8jAok
// TODO(xhwang): Add a ASCII state diagram in this file after this class
@@ -56,10 +55,6 @@ class MEDIA_EXPORT DecryptingDemuxerStream : public DemuxerStream {
kWaitingForKey,
};
- // Carries out the initialization operation scheduled by Initialize().
- void DoInitialize(const scoped_refptr<DemuxerStream>& stream,
- const PipelineStatusCB& status_cb);
-
// Callback for DecryptorHost::RequestDecryptor().
void SetDecryptor(Decryptor* decryptor);
@@ -67,20 +62,12 @@ class MEDIA_EXPORT DecryptingDemuxerStream : public DemuxerStream {
void DecryptBuffer(DemuxerStream::Status status,
const scoped_refptr<DecoderBuffer>& buffer);
- // Carries out the buffer decryption operation scheduled by DecryptBuffer().
- void DoDecryptBuffer(DemuxerStream::Status status,
- const scoped_refptr<DecoderBuffer>& buffer);
-
void DecryptPendingBuffer();
// Callback for Decryptor::Decrypt().
void DeliverBuffer(Decryptor::Status status,
const scoped_refptr<DecoderBuffer>& decrypted_buffer);
- // Carries out the frame delivery operation scheduled by DeliverBuffer().
- void DoDeliverBuffer(Decryptor::Status status,
- const scoped_refptr<DecoderBuffer>& decrypted_buffer);
-
// Callback for the |decryptor_| to notify this object that a new key has been
// added.
void OnKeyAdded();
@@ -92,9 +79,11 @@ class MEDIA_EXPORT DecryptingDemuxerStream : public DemuxerStream {
Decryptor::StreamType GetDecryptorStreamType() const;
// Sets |{audio|video}_config_| from |stream|.
- void SetDecoderConfig(const scoped_refptr<DemuxerStream>& stream);
+ void SetDecoderConfig(DemuxerStream* stream);
scoped_refptr<base::MessageLoopProxy> message_loop_;
+ base::WeakPtrFactory<DecryptingDemuxerStream> weak_factory_;
+ base::WeakPtr<DecryptingDemuxerStream> weak_this_;
State state_;
@@ -103,7 +92,7 @@ class MEDIA_EXPORT DecryptingDemuxerStream : public DemuxerStream {
base::Closure reset_cb_;
// Pointer to the input demuxer stream that will feed us encrypted buffers.
- scoped_refptr<DemuxerStream> demuxer_stream_;
+ DemuxerStream* demuxer_stream_;
Type stream_type_;
scoped_ptr<AudioDecoderConfig> audio_config_;

Powered by Google App Engine
This is Rietveld 408576698