Bug 1319686 - Remove the use of AutoNoJSAPI from HTMLMediaElement::NotifyAudioChannelAgent r=jwwang
authorKilik Kuo <kikuo@mozilla.com>
Wed, 23 Nov 2016 18:16:31 +0800
changeset 324057 ac16df8810f60d0bd4514b5d4975e63e7004e3ce
parent 324056 809655f44e1988e72f4efb0f7ccb22b64a8f8a4d
child 324058 464230532ba3c56157be845ac68f4c79b686cd60
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersjwwang
bugs1319686
milestone53.0a1
Bug 1319686 - Remove the use of AutoNoJSAPI from HTMLMediaElement::NotifyAudioChannelAgent r=jwwang MozReview-Commit-ID: FMKloJPpT93
dom/html/HTMLMediaElement.cpp
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -5955,21 +5955,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;