Bug 1067858 - Apply |AutoNoJSAPI| before calling mAudioChannelAgent->SetVisibilityState in order not to hit nsContentUtils::IsCallerChrome() in HTMLMediaElement::CanPlayChanged(). r=bz, a=sledru
authorJW Wang <jwwang@mozilla.com>
Tue, 16 Sep 2014 19:31:00 +1200
changeset 216810 de5e77b26504
parent 216809 91f4e2aed979
child 216811 68fdd69ee9bb
push id3921
push userryanvm@gmail.com
push date2014-09-22 15:03 +0000
treeherdermozilla-beta@f8eec8fe1b2b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz, sledru
bugs1067858
milestone33.0
Bug 1067858 - Apply |AutoNoJSAPI| before calling mAudioChannelAgent->SetVisibilityState in order not to hit nsContentUtils::IsCallerChrome() in HTMLMediaElement::CanPlayChanged(). r=bz, a=sledru
content/html/content/src/HTMLMediaElement.cpp
--- a/content/html/content/src/HTMLMediaElement.cpp
+++ b/content/html/content/src/HTMLMediaElement.cpp
@@ -3439,16 +3439,17 @@ void HTMLMediaElement::NotifyOwnerDocume
     mDecoder->SetElementVisibility(!ownerDoc->Hidden());
     mDecoder->SetDormantIfNecessary(ownerDoc->Hidden());
   }
 
   // SetVisibilityState will update mMuted with MUTED_BY_AUDIO_CHANNEL via the
   // CanPlayChanged callback.
   if (UseAudioChannelService() && mPlayingThroughTheAudioChannel &&
       mAudioChannelAgent) {
+    AutoNoJSAPI nojsapi;
     mAudioChannelAgent->SetVisibilityState(!ownerDoc->Hidden());
   }
   bool suspendEvents = !ownerDoc->IsActive() || !ownerDoc->IsVisible();
   bool pauseElement = suspendEvents || (mMuted & MUTED_BY_AUDIO_CHANNEL);
 
   SuspendOrResumeElement(pauseElement, suspendEvents);
 
   AddRemoveSelfReference();