Bug 1319686 - Remove the use of AutoNoJSAPI from HTMLMediaElement::NotifyAudioChannelAgent draft
authorKilik Kuo <kikuo@mozilla.com>
Wed, 23 Nov 2016 18:16:31 +0800
changeset 442842 eefab355396830c3aa111d50cc9def74a0dd1f29
parent 442775 0ddfec7126ec503b54df9c4b7c3b988906f6c882
child 537906 caf160aa958e10d97fe533de296de02b4ec1c996
push id36837
push userbmo:kikuo@mozilla.com
push dateWed, 23 Nov 2016 10:17:54 +0000
bugs1319686
milestone53.0a1
Bug 1319686 - Remove the use of AutoNoJSAPI from HTMLMediaElement::NotifyAudioChannelAgent MozReview-Commit-ID: FMKloJPpT93
dom/html/HTMLMediaElement.cpp
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -5852,21 +5852,16 @@ HTMLMediaElement::UpdateAudioChannelPlay
     mPlayingThroughTheAudioChannel = playingThroughTheAudioChannel;
     NotifyAudioChannelAgent(mPlayingThroughTheAudioChannel);
   }
 }
 
 void
 HTMLMediaElement::NotifyAudioChannelAgent(bool aPlaying)
 {
-  // This is needed to pass nsContentUtils::IsCallerChrome().
-  // AudioChannel API should not called from content but it can happen that
-  // this method has some content JS in its stack.
-  AutoNoJSAPI nojsapi;
-
   if (aPlaying) {
     // The reason we don't call NotifyStartedPlaying after the media element
     // really becomes audible is because there is another case needs to block
     // element as early as we can, we would hear sound leaking if we block it
     // too late. In that case (block autoplay in non-visited-tab), we need to
     // create a connection before decoding, because we don't want user hearing
     // any sound.
     AudioPlaybackConfig config;