Bug 1322505 - part1 : rename audio channel wrapper's function. r=baku
authorAlastor Wu <alwu@mozilla.com>
Mon, 23 Jan 2017 10:52:04 +0800
changeset 330608 6a8c89e67f9a4395be69ead4bfc0eb053aa75201
parent 330607 26db8aff32c8b9c2eda34b791b4f0e24f764db89
child 330609 5e90eada67cf0c69eb35530bee6af8bbf0b094db
push id31244
push usercbook@mozilla.com
push dateMon, 23 Jan 2017 10:09:02 +0000
treeherdermozilla-central@f1f53d0897bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1322505
milestone53.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 1322505 - part1 : rename audio channel wrapper's function. r=baku Rename function and modify the comment. MozReview-Commit-ID: F5JTmPvH7GC
dom/html/HTMLMediaElement.cpp
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -650,22 +650,23 @@ public:
       }
 
       mPlayingThroughTheAudioChannel = playingThroughTheAudioChannel;
       NotifyAudioChannelAgent(mPlayingThroughTheAudioChannel);
     }
   }
 
   void
-  NotifyPlayStarted()
+  NotifyPlayStateChanged()
   {
     MOZ_ASSERT(!mIsShutDown);
-    // Reset the suspend type because the media element might be paused by
-    // audio channel before calling play(). eg. paused by Fennec media control,
-    // but resumed it from page.
+    // When owner's play state changed, we should reset the suspend type. If
+    // owner is playing, the suspend type should be 'NONE_SUSPENDED', and if
+    // owner paused, the suspend type also needs to be reset because the agent
+    // maybe need to be unregistered.
     SetSuspended(nsISuspendedTypes::NONE_SUSPENDED);
     UpdateAudioChannelPlayingState();
   }
 
   NS_IMETHODIMP
   WindowVolumeChanged(float aVolume, bool aMuted) override
   {
     MOZ_ASSERT(mAudioChannelAgent);
@@ -7127,17 +7128,17 @@ HTMLMediaElement::MarkAsContentSource(Ca
        this, isVisible, aAPI));
 }
 
 void
 HTMLMediaElement::UpdateCustomPolicyAfterPlayed()
 {
   OpenUnsupportedMediaWithExternalAppIfNeeded();
   if (mAudioChannelWrapper) {
-    mAudioChannelWrapper->NotifyPlayStarted();
+    mAudioChannelWrapper->NotifyPlayStateChanged();
   }
 }
 
 nsTArray<RefPtr<Promise>>
 HTMLMediaElement::TakePendingPlayPromises()
 {
   return Move(mPendingPlayPromises);
 }