Bug 1206574 - Remove AbstractMediaDecoder::IsShutdown(). r=cpearce.
authorJW Wang <jwwang@mozilla.com>
Tue, 22 Sep 2015 10:56:17 +0800
changeset 263632 a1f056854e5d7e06a821c8d376f13f4bc56b4ed4
parent 263631 201ccc2e2e76e428c1a67c24bc21910712fff770
child 263633 9a0ca896c90edc42b0993b732d7dfc90bee3afb6
push id65382
push userjwwang@mozilla.com
push dateTue, 22 Sep 2015 02:58:36 +0000
treeherdermozilla-inbound@a1f056854e5d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1206574
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 1206574 - Remove AbstractMediaDecoder::IsShutdown(). r=cpearce.
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
@@ -47,19 +47,16 @@ enum class MediaDecoderEventVisibility :
  */
 class AbstractMediaDecoder : public nsIObserver
 {
 public:
   // Returns the monitor for other threads to synchronise access to
   // state.
   virtual ReentrantMonitor& GetReentrantMonitor() = 0;
 
-  // Returns true if the decoder is shut down.
-  virtual bool IsShutdown() const = 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
@@ -1297,22 +1297,16 @@ MediaDecoderStateMachine* MediaDecoder::
 void
 MediaDecoder::NotifyWaitingForResourcesStatusChanged()
 {
   if (mDecoderStateMachine) {
     mDecoderStateMachine->DispatchWaitingForResourcesStatusChanged();
   }
 }
 
-bool MediaDecoder::IsShutdown() const {
-  MOZ_ASSERT(NS_IsMainThread());
-  NS_ENSURE_TRUE(GetStateMachine(), true);
-  return mStateMachineIsShutdown;
-}
-
 // Drop reference to state machine.  Only called during shutdown dance.
 void MediaDecoder::BreakCycles() {
   SetStateMachine(nullptr);
 }
 
 MediaDecoderOwner* MediaDecoder::GetMediaOwner() const
 {
   return mOwner;
--- a/dom/media/MediaDecoder.h
+++ b/dom/media/MediaDecoder.h
@@ -525,19 +525,16 @@ public:
 
   MediaDecoderStateMachine* GetStateMachine() { return mDecoderStateMachine; }
   void SetStateMachine(MediaDecoderStateMachine* aStateMachine);
 
   // Returns the monitor for other threads to synchronise access to
   // state.
   ReentrantMonitor& GetReentrantMonitor() override;
 
-  // Returns true if the decoder is shut down
-  bool IsShutdown() const final 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
@@ -41,23 +41,16 @@ BufferDecoder::BeginDecoding(TaskQueue* 
 
 ReentrantMonitor&
 BufferDecoder::GetReentrantMonitor()
 {
   return mReentrantMonitor;
 }
 
 bool
-BufferDecoder::IsShutdown() const
-{
-  // BufferDecoder cannot be shut down.
-  return false;
-}
-
-bool
 BufferDecoder::OnStateMachineTaskQueue() const
 {
   // BufferDecoder doesn't have the concept of a state machine.
   return true;
 }
 
 bool
 BufferDecoder::OnDecodeTaskQueue() const
--- a/dom/media/webaudio/BufferDecoder.h
+++ b/dom/media/webaudio/BufferDecoder.h
@@ -28,18 +28,16 @@ public:
 
   NS_DECL_THREADSAFE_ISUPPORTS
 
   // This has to be called before decoding begins
   void BeginDecoding(TaskQueue* aTaskQueueIdentity);
 
   virtual ReentrantMonitor& GetReentrantMonitor() final override;
 
-  virtual bool IsShutdown() const 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;