Bug 1211766 - Remove AbstractMediaDecoder::GetReentrantMonitor(). r=jya.
authorJW Wang <jwwang@mozilla.com>
Wed, 30 Sep 2015 07:04:49 +0800
changeset 266151 7563e84f6efc72e380aac6d43336df93ad004462
parent 266150 0c0c6ebfa5a5a5f10ca6373d3f352e184d3bf3b5
child 266152 ca240e275047843b4f2920f463fd436d2691ccd0
push id66135
push userjwwang@mozilla.com
push dateTue, 06 Oct 2015 05:53:50 +0000
treeherdermozilla-inbound@7563e84f6efc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1211766
milestone44.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1211766 - Remove AbstractMediaDecoder::GetReentrantMonitor(). r=jya.
dom/media/AbstractMediaDecoder.h
dom/media/MediaDecoder.cpp
dom/media/MediaDecoder.h
dom/media/webaudio/BufferDecoder.cpp
dom/media/webaudio/BufferDecoder.h
--- a/dom/media/AbstractMediaDecoder.h
+++ b/dom/media/AbstractMediaDecoder.h
@@ -43,20 +43,16 @@ enum class MediaDecoderEventVisibility :
 
 /**
  * The AbstractMediaDecoder class describes the public interface for a media decoder
  * and is used by the MediaReader classes.
  */
 class AbstractMediaDecoder : public nsIObserver
 {
 public:
-  // Returns the monitor for other threads to synchronise access to
-  // state.
-  virtual ReentrantMonitor& GetReentrantMonitor() = 0;
-
   // A special version of the above for the ogg decoder that is allowed to be
   // called cross-thread.
   virtual bool IsOggDecoderShutdown() { return false; }
 
   virtual bool OnStateMachineTaskQueue() const = 0;
 
   virtual bool OnDecodeTaskQueue() const = 0;
 
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -1264,21 +1264,16 @@ MediaDecoder::SetStateMachine(MediaDecod
     mBuffered.DisconnectIfConnected();
     mStateMachineIsShutdown.DisconnectIfConnected();
     mNextFrameStatus.DisconnectIfConnected();
     mCurrentPosition.DisconnectIfConnected();
     mPlaybackPosition.DisconnectIfConnected();
   }
 }
 
-ReentrantMonitor&
-MediaDecoder::GetReentrantMonitor() {
-  return mReentrantMonitor;
-}
-
 ImageContainer*
 MediaDecoder::GetImageContainer()
 {
   return mVideoFrameContainer ? mVideoFrameContainer->GetImageContainer() : nullptr;
 }
 
 void
 MediaDecoder::InvalidateWithFlags(uint32_t aFlags)
--- a/dom/media/MediaDecoder.h
+++ b/dom/media/MediaDecoder.h
@@ -519,20 +519,16 @@ public:
 
   bool OnStateMachineTaskQueue() const override;
 
   bool OnDecodeTaskQueue() const override;
 
   MediaDecoderStateMachine* GetStateMachine() const;
   void SetStateMachine(MediaDecoderStateMachine* aStateMachine);
 
-  // Returns the monitor for other threads to synchronise access to
-  // state.
-  ReentrantMonitor& GetReentrantMonitor() override;
-
   // Constructs the time ranges representing what segments of the media
   // are buffered and playable.
   virtual media::TimeIntervals GetBuffered();
 
   // Returns the size, in bytes, of the heap memory used by the currently
   // queued decoded video and audio data.
   size_t SizeOfVideoQueue();
   size_t SizeOfAudioQueue();
--- a/dom/media/webaudio/BufferDecoder.cpp
+++ b/dom/media/webaudio/BufferDecoder.cpp
@@ -11,18 +11,17 @@
 
 namespace mozilla {
 
 extern PRLogModuleInfo* gMediaDecoderLog;
 
 NS_IMPL_ISUPPORTS0(BufferDecoder)
 
 BufferDecoder::BufferDecoder(MediaResource* aResource)
-  : mReentrantMonitor("BufferDecoder")
-  , mResource(aResource)
+  : mResource(aResource)
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_COUNT_CTOR(BufferDecoder);
   if (!gMediaDecoderLog) {
     gMediaDecoderLog = PR_NewLogModule("MediaDecoder");
   }
 }
 
@@ -34,22 +33,16 @@ BufferDecoder::~BufferDecoder()
 
 void
 BufferDecoder::BeginDecoding(TaskQueue* aTaskQueueIdentity)
 {
   MOZ_ASSERT(!mTaskQueueIdentity && aTaskQueueIdentity);
   mTaskQueueIdentity = aTaskQueueIdentity;
 }
 
-ReentrantMonitor&
-BufferDecoder::GetReentrantMonitor()
-{
-  return mReentrantMonitor;
-}
-
 bool
 BufferDecoder::OnStateMachineTaskQueue() const
 {
   // BufferDecoder doesn't have the concept of a state machine.
   return true;
 }
 
 bool
--- a/dom/media/webaudio/BufferDecoder.h
+++ b/dom/media/webaudio/BufferDecoder.h
@@ -26,18 +26,16 @@ public:
   // of the caller to manage the memory of the MediaResource object.
   explicit BufferDecoder(MediaResource* aResource);
 
   NS_DECL_THREADSAFE_ISUPPORTS
 
   // This has to be called before decoding begins
   void BeginDecoding(TaskQueue* aTaskQueueIdentity);
 
-  virtual ReentrantMonitor& GetReentrantMonitor() final override;
-
   virtual bool OnStateMachineTaskQueue() const final override;
 
   virtual bool OnDecodeTaskQueue() const final override;
 
   virtual MediaResource* GetResource() const final override;
 
   virtual void NotifyBytesConsumed(int64_t aBytes, int64_t aOffset) final override;
 
@@ -62,20 +60,15 @@ public:
   virtual void OnReadMetadataCompleted() final override;
 
   virtual MediaDecoderOwner* GetOwner() final override;
 
   virtual void NotifyDataArrived(uint32_t, int64_t, bool) final override {};
 
 private:
   virtual ~BufferDecoder();
-
-  // This monitor object is not really used to synchronize access to anything.
-  // It's just there in order for us to be able to override
-  // GetReentrantMonitor correctly.
-  ReentrantMonitor mReentrantMonitor;
   nsRefPtr<TaskQueue> mTaskQueueIdentity;
   nsRefPtr<MediaResource> mResource;
 };
 
 } // namespace mozilla
 
 #endif /* BUFFER_DECODER_H_ */