Bug 1235612 - part5 : rename NotifyAudibleStateChanged. draft
authorAlastor Wu <alwu@mozilla.com>
Tue, 03 May 2016 17:59:43 +0800
changeset 362841 fd0acc5b5ba0494b7e97f5f30bc79c49f55040a8
parent 362840 be9b7ee55e9394bdf7817eb9a2ee5e077f2a0922
child 362842 b83499a194404844a18d0de89d6ad35522b814b6
push id17043
push useralwu@mozilla.com
push dateTue, 03 May 2016 10:00:34 +0000
bugs1235612
milestone49.0a1
Bug 1235612 - part5 : rename NotifyAudibleStateChanged. MozReview-Commit-ID: LRikTbqoOch
dom/html/HTMLMediaElement.cpp
dom/html/HTMLMediaElement.h
dom/media/MediaDecoder.cpp
dom/media/MediaDecoderOwner.h
dom/media/gtest/MockMediaDecoderOwner.h
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -3365,17 +3365,17 @@ void HTMLMediaElement::UpdateSrcMediaStr
         &HTMLMediaElement::UpdateReadyStateInternal);
 
     mMediaStreamListener->Forget();
     mMediaStreamListener = nullptr;
   }
 
   // If the input is a media stream, we don't check its data and always regard
   // it as audible when it's playing.
-  NotifyAudibleStateChanged(shouldPlay);
+  SetAudibleState(shouldPlay);
 }
 
 void HTMLMediaElement::SetupSrcMediaStreamPlayback(DOMMediaStream* aStream)
 {
   NS_ASSERTION(!mSrcStream && !mMediaStreamListener && !mMediaStreamSizeListener,
                "Should have been ended already");
 
   mSrcStream = aStream;
@@ -5620,17 +5620,17 @@ HTMLMediaElement::IsCurrentlyPlaying() c
       return false;
     }
     return true;
   }
   return false;
 }
 
 void
-HTMLMediaElement::NotifyAudibleStateChanged(bool aAudible)
+HTMLMediaElement::SetAudibleState(bool aAudible)
 {
   if (mIsAudioTrackAudible != aAudible) {
     mIsAudioTrackAudible = aAudible;
     NotifyAudioPlaybackChanged();
   }
 }
 
 void
--- a/dom/html/HTMLMediaElement.h
+++ b/dom/html/HTMLMediaElement.h
@@ -445,17 +445,17 @@ public:
   }
 
   // Called by the media decoder object, on the main thread,
   // when the connection between Rtsp server and client gets lost.
   virtual void ResetConnectionState() final override;
 
   // Called by media decoder when the audible state changed or when input is
   // a media stream.
-  virtual void NotifyAudibleStateChanged(bool aAudible) final override;
+  virtual void SetAudibleState(bool aAudible) final override;
 
   // Notify agent when the MediaElement changes its audible state.
   void NotifyAudioPlaybackChanged();
 
   // XPCOM GetPreload() is OK
   void SetPreload(const nsAString& aValue, ErrorResult& aRv)
   {
     SetHTMLAttr(nsGkAtoms::preload, aValue, aRv);
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -1893,17 +1893,17 @@ MediaDecoder::DumpDebugInfo()
     GetStateMachine()->DumpDebugInfo();
   }
 }
 
 void
 MediaDecoder::NotifyAudibleStateChanged()
 {
   MOZ_ASSERT(!mShuttingDown);
-  mOwner->NotifyAudibleStateChanged(mIsAudioDataAudible);
+  mOwner->SetAudibleState(mIsAudioDataAudible);
 }
 
 MediaMemoryTracker::MediaMemoryTracker()
 {
 }
 
 void
 MediaMemoryTracker::InitMemoryReporter()
--- a/dom/media/MediaDecoderOwner.h
+++ b/dom/media/MediaDecoderOwner.h
@@ -129,17 +129,17 @@ public:
   // ImageContainer containing the video data.
   virtual VideoFrameContainer* GetVideoFrameContainer() = 0;
 
   // Called by the media decoder object, on the main thread,
   // when the connection between Rtsp server and client gets lost.
   virtual void ResetConnectionState() = 0;
 
   // Called by media decoder when the audible state changed
-  virtual void NotifyAudibleStateChanged(bool aAudible) = 0;
+  virtual void SetAudibleState(bool aAudible) = 0;
 
 #ifdef MOZ_EME
   // Dispatches a "encrypted" event to the HTMLMediaElement, with the
   // provided init data. Actual dispatch may be delayed until HAVE_METADATA.
   // Main thread only.
   virtual void DispatchEncrypted(const nsTArray<uint8_t>& aInitData,
                                  const nsAString& aInitDataType) = 0;
 #endif // MOZ_EME
--- a/dom/media/gtest/MockMediaDecoderOwner.h
+++ b/dom/media/gtest/MockMediaDecoderOwner.h
@@ -43,13 +43,13 @@ public:
   void DownloadResumed(bool aForceNetworkLoading) override {}
   void NotifySuspendedByCache(bool aIsSuspended) override {}
   void NotifyDecoderPrincipalChanged() override {}
   VideoFrameContainer* GetVideoFrameContainer() override
   {
     return nullptr;
   }
   void ResetConnectionState() override {}
-  void NotifyAudibleStateChanged(bool aAudible) override {}
+  void SetAudibleState(bool aAudible) override {}
 };
 }
 
 #endif