Bug 1299390 - part 2: Remove AudioChannelService methods required by BrowserElementAudioChannel only. r=alwu draft
authorbtian <btian@mozilla.com>
Tue, 16 May 2017 10:57:28 +0800
changeset 578596 1f807d085cceeda04f6c7bf523538d08e22604f2
parent 578595 cd01ee2e7990925ceacd31d5d8ff9d519ef5ff62
child 578597 3bf10664baab61ab3a1721424378c49ee6b747b2
push id58978
push userbmo:btian@mozilla.com
push dateTue, 16 May 2017 07:56:34 +0000
reviewersalwu
bugs1299390
milestone55.0a1
Bug 1299390 - part 2: Remove AudioChannelService methods required by BrowserElementAudioChannel only. r=alwu MozReview-Commit-ID: FEuoSJs3ptH
dom/audiochannel/AudioChannelService.cpp
dom/audiochannel/AudioChannelService.h
dom/audiochannel/moz.build
dom/audiochannel/nsIAudioChannelService.idl
dom/browser-element/BrowserElementChildPreload.js
dom/browser-element/BrowserElementParent.js
dom/browser-element/nsIBrowserElementAPI.idl
dom/ipc/PBrowser.ipdl
dom/ipc/TabChild.cpp
dom/ipc/TabChild.h
dom/ipc/TabParent.cpp
dom/ipc/TabParent.h
--- a/dom/audiochannel/AudioChannelService.cpp
+++ b/dom/audiochannel/AudioChannelService.cpp
@@ -325,18 +325,16 @@ AudioChannelService::Shutdown()
 /* static */ bool
 AudioChannelService::IsEnableAudioCompeting()
 {
   CreateServiceIfNeeded();
   return sAudioChannelCompeting;
 }
 
 NS_INTERFACE_MAP_BEGIN(AudioChannelService)
-  NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIAudioChannelService)
-  NS_INTERFACE_MAP_ENTRY(nsIAudioChannelService)
   NS_INTERFACE_MAP_ENTRY(nsIObserver)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_ADDREF(AudioChannelService)
 NS_IMPL_RELEASE(AudioChannelService)
 
 AudioChannelService::AudioChannelService()
   : mDefChannelChildID(CONTENT_PROCESS_ID_UNKNOWN)
@@ -662,42 +660,16 @@ AudioChannelService::Observe(nsISupports
 
     RemoveChildStatus(childID);
   }
 
   return NS_OK;
 }
 
 void
-AudioChannelService::RefreshAgentsVolumeAndPropagate(AudioChannel aAudioChannel,
-                                                     nsPIDOMWindowOuter* aWindow)
-{
-  MOZ_ASSERT(aWindow);
-  MOZ_ASSERT(aWindow->IsOuterWindow());
-
-  nsCOMPtr<nsPIDOMWindowOuter> topWindow = aWindow->GetScriptableTop();
-  if (!topWindow) {
-    return;
-  }
-
-  AudioChannelWindow* winData = GetWindowData(topWindow->WindowID());
-  if (!winData) {
-    return;
-  }
-
-  for (uint32_t i = 0; i < mTabParents.Length(); ++i) {
-    mTabParents[i]->AudioChannelChangeNotification(aWindow, aAudioChannel,
-                                                   winData->mChannels[(uint32_t)aAudioChannel].mVolume,
-                                                   winData->mChannels[(uint32_t)aAudioChannel].mMuted);
-  }
-
-  RefreshAgentsVolume(aWindow);
-}
-
-void
 AudioChannelService::RefreshAgents(nsPIDOMWindowOuter* aWindow,
                                    const std::function<void(AudioChannelAgent*)>& aFunc)
 {
   MOZ_ASSERT(aWindow);
   MOZ_ASSERT(aWindow->IsOuterWindow());
 
   nsCOMPtr<nsPIDOMWindowOuter> topWindow = aWindow->GetScriptableTop();
   if (!topWindow) {
@@ -864,172 +836,16 @@ AudioChannelService::GetWindowData(uint6
     if (next->mWindowID == aWindowID) {
       return next;
     }
   }
 
   return nullptr;
 }
 
-float
-AudioChannelService::GetAudioChannelVolume(nsPIDOMWindowOuter* aWindow,
-                                           AudioChannel aAudioChannel)
-{
-  MOZ_ASSERT(NS_IsMainThread());
-  MOZ_ASSERT(aWindow);
-  MOZ_ASSERT(aWindow->IsOuterWindow());
-
-  AudioChannelWindow* winData = GetOrCreateWindowData(aWindow);
-  return winData->mChannels[(uint32_t)aAudioChannel].mVolume;
-}
-
-NS_IMETHODIMP
-AudioChannelService::GetAudioChannelVolume(mozIDOMWindowProxy* aWindow,
-                                           unsigned short aAudioChannel,
-                                           float* aVolume)
-{
-  MOZ_ASSERT(NS_IsMainThread());
-
-  auto* window = nsPIDOMWindowOuter::From(aWindow)->GetScriptableTop();
-  if (!window) {
-    *aVolume = 0.f;
-    return NS_ERROR_FAILURE;
-  }
-  *aVolume = GetAudioChannelVolume(window, (AudioChannel)aAudioChannel);
-  return NS_OK;
-}
-
-void
-AudioChannelService::SetAudioChannelVolume(nsPIDOMWindowOuter* aWindow,
-                                           AudioChannel aAudioChannel,
-                                           float aVolume)
-{
-  MOZ_ASSERT(NS_IsMainThread());
-  MOZ_ASSERT(aWindow);
-  MOZ_ASSERT(aWindow->IsOuterWindow());
-
-  MOZ_LOG(GetAudioChannelLog(), LogLevel::Debug,
-         ("AudioChannelService, SetAudioChannelVolume, window = %p, type = %" PRIu32 ", "
-          "volume = %f\n", aWindow, static_cast<uint32_t>(aAudioChannel), aVolume));
-
-  AudioChannelWindow* winData = GetOrCreateWindowData(aWindow);
-  winData->mChannels[(uint32_t)aAudioChannel].mVolume = aVolume;
-  RefreshAgentsVolumeAndPropagate(aAudioChannel, aWindow);
-}
-
-NS_IMETHODIMP
-AudioChannelService::SetAudioChannelVolume(mozIDOMWindowProxy* aWindow,
-                                           unsigned short aAudioChannel,
-                                           float aVolume)
-{
-  MOZ_ASSERT(NS_IsMainThread());
-
-  auto* window = nsPIDOMWindowOuter::From(aWindow)->GetScriptableTop();
-  if (!window) {
-    return NS_ERROR_FAILURE;
-  }
-  SetAudioChannelVolume(window, (AudioChannel)aAudioChannel, aVolume);
-  return NS_OK;
-}
-
-bool
-AudioChannelService::GetAudioChannelMuted(nsPIDOMWindowOuter* aWindow,
-                                          AudioChannel aAudioChannel)
-{
-  MOZ_ASSERT(NS_IsMainThread());
-  MOZ_ASSERT(aWindow);
-  MOZ_ASSERT(aWindow->IsOuterWindow());
-
-  AudioChannelWindow* winData = GetOrCreateWindowData(aWindow);
-  return winData->mChannels[(uint32_t)aAudioChannel].mMuted;
-}
-
-NS_IMETHODIMP
-AudioChannelService::GetAudioChannelMuted(mozIDOMWindowProxy* aWindow,
-                                          unsigned short aAudioChannel,
-                                          bool* aMuted)
-{
-  MOZ_ASSERT(NS_IsMainThread());
-
-  auto* window = nsPIDOMWindowOuter::From(aWindow)->GetScriptableTop();
-  if (!window) {
-    *aMuted = false;
-    return NS_ERROR_FAILURE;
-  }
-  *aMuted = GetAudioChannelMuted(window, (AudioChannel)aAudioChannel);
-  return NS_OK;
-}
-
-void
-AudioChannelService::SetAudioChannelMuted(nsPIDOMWindowOuter* aWindow,
-                                          AudioChannel aAudioChannel,
-                                          bool aMuted)
-{
-  MOZ_ASSERT(NS_IsMainThread());
-  MOZ_ASSERT(aWindow);
-  MOZ_ASSERT(aWindow->IsOuterWindow());
-
-  MOZ_LOG(GetAudioChannelLog(), LogLevel::Debug,
-         ("AudioChannelService, SetAudioChannelMuted, window = %p, type = %" PRIu32 ", "
-          "mute = %s\n", aWindow, static_cast<uint32_t>(aAudioChannel),
-          aMuted ? "true" : "false"));
-
-  if (aAudioChannel == AudioChannel::System) {
-    // Workaround for bug1183033, system channel type can always playback.
-    return;
-  }
-
-  AudioChannelWindow* winData = GetOrCreateWindowData(aWindow);
-  winData->mChannels[(uint32_t)aAudioChannel].mMuted = aMuted;
-  RefreshAgentsVolumeAndPropagate(aAudioChannel, aWindow);
-}
-
-NS_IMETHODIMP
-AudioChannelService::SetAudioChannelMuted(mozIDOMWindowProxy* aWindow,
-                                          unsigned short aAudioChannel,
-                                          bool aMuted)
-{
-  MOZ_ASSERT(NS_IsMainThread());
-
-  auto* window = nsPIDOMWindowOuter::From(aWindow)->GetScriptableTop();
-  if (!window) {
-    return NS_ERROR_FAILURE;
-  }
-  SetAudioChannelMuted(window, (AudioChannel)aAudioChannel, aMuted);
-  return NS_OK;
-}
-
-bool
-AudioChannelService::IsAudioChannelActive(nsPIDOMWindowOuter* aWindow,
-                                          AudioChannel aAudioChannel)
-{
-  MOZ_ASSERT(NS_IsMainThread());
-  MOZ_ASSERT(aWindow);
-  MOZ_ASSERT(aWindow->IsOuterWindow());
-
-  AudioChannelWindow* winData = GetOrCreateWindowData(aWindow);
-  return !!winData->mChannels[(uint32_t)aAudioChannel].mNumberOfAgents;
-}
-
-NS_IMETHODIMP
-AudioChannelService::IsAudioChannelActive(mozIDOMWindowProxy* aWindow,
-                                          unsigned short aAudioChannel,
-                                          bool* aActive)
-{
-  MOZ_ASSERT(NS_IsMainThread());
-
-  auto* window = nsPIDOMWindowOuter::From(aWindow)->GetScriptableTop();
-  if (!window) {
-    *aActive = false;
-    return NS_ERROR_FAILURE;
-  }
-  *aActive = IsAudioChannelActive(window, (AudioChannel)aAudioChannel);
-  return NS_OK;
-}
-
 bool
 AudioChannelService::IsWindowActive(nsPIDOMWindowOuter* aWindow)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   auto* window = nsPIDOMWindowOuter::From(aWindow)->GetScriptableTop();
   if (!window) {
     return false;
--- a/dom/audiochannel/AudioChannelService.h
+++ b/dom/audiochannel/AudioChannelService.h
@@ -2,17 +2,16 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_audiochannelservice_h__
 #define mozilla_dom_audiochannelservice_h__
 
-#include "nsIAudioChannelService.h"
 #include "nsAutoPtr.h"
 #include "nsIObserver.h"
 #include "nsTObserverArray.h"
 #include "nsTArray.h"
 
 #include "AudioChannelAgent.h"
 #include "nsAttrValue.h"
 #include "mozilla/dom/AudioChannelBinding.h"
@@ -53,23 +52,21 @@ public:
     mSuspend = aSuspended;
   }
 
   float mVolume;
   bool mMuted;
   uint32_t mSuspend;
 };
 
-class AudioChannelService final : public nsIAudioChannelService
-                                , public nsIObserver
+class AudioChannelService final : public nsIObserver
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIOBSERVER
-  NS_DECL_NSIAUDIOCHANNELSERVICE
 
   /**
    * eNotAudible : agent is not audible
    * eMaybeAudible : agent is not audible now, but it might be audible later
    * eAudible : agent is audible now
    */
   enum AudibleState : uint8_t {
     eNotAudible = 0,
@@ -137,29 +134,16 @@ public:
    * Called this method when the audible state of the audio playback changed,
    * it would dispatch the playback event to observers which want to know the
    * actual audible state of the window.
    */
   void AudioAudibleChanged(AudioChannelAgent* aAgent,
                            AudibleState aAudible,
                            AudibleChangedReasons aReason);
 
-  /* Methods for the BrowserElementAudioChannel */
-  float GetAudioChannelVolume(nsPIDOMWindowOuter* aWindow, AudioChannel aChannel);
-
-  void SetAudioChannelVolume(nsPIDOMWindowOuter* aWindow, AudioChannel aChannel,
-                             float aVolume);
-
-  bool GetAudioChannelMuted(nsPIDOMWindowOuter* aWindow, AudioChannel aChannel);
-
-  void SetAudioChannelMuted(nsPIDOMWindowOuter* aWindow, AudioChannel aChannel,
-                            bool aMuted);
-
-  bool IsAudioChannelActive(nsPIDOMWindowOuter* aWindow, AudioChannel aChannel);
-
   bool IsWindowActive(nsPIDOMWindowOuter* aWindow);
 
   /**
    * Return true if there is a telephony channel active in this process
    * or one of its subprocesses.
    */
   bool TelephonyChannelIsActive();
 
@@ -179,19 +163,16 @@ public:
                                               bool aVisible);
 
   bool AnyAudioChannelIsActive();
 
   void RefreshAgentsVolume(nsPIDOMWindowOuter* aWindow);
   void RefreshAgentsSuspend(nsPIDOMWindowOuter* aWindow,
                             nsSuspendedTypes aSuspend);
 
-  void RefreshAgentsVolumeAndPropagate(AudioChannel aAudioChannel,
-                                       nsPIDOMWindowOuter* aWindow);
-
   // This method needs to know the inner window that wants to capture audio. We
   // group agents per top outer window, but we can have multiple innerWindow per
   // top outerWindow (subiframes, etc.) and we have to identify all the agents
   // just for a particular innerWindow.
   void SetWindowAudioCaptured(nsPIDOMWindowOuter* aWindow,
                               uint64_t aInnerWindowID,
                               bool aCapture);
 
@@ -249,20 +230,17 @@ private:
   class AudioChannelWindow final
   {
   public:
     explicit AudioChannelWindow(uint64_t aWindowID)
       : mWindowID(aWindowID)
       , mIsAudioCaptured(false)
       , mOwningAudioFocus(!AudioChannelService::IsEnableAudioCompeting())
       , mShouldSendBlockStopEvent(false)
-    {
-      // Workaround for bug1183033, system channel type can always playback.
-      mChannels[(int16_t)AudioChannel::System].mMuted = false;
-    }
+    {}
 
     void AudioFocusChanged(AudioChannelAgent* aNewPlayingAgent);
     void AudioAudibleChanged(AudioChannelAgent* aAgent,
                              AudibleState aAudible,
                              AudibleChangedReasons aReason);
 
     void AppendAgent(AudioChannelAgent* aAgent, AudibleState aAudible);
     void RemoveAgent(AudioChannelAgent* aAgent);
--- a/dom/audiochannel/moz.build
+++ b/dom/audiochannel/moz.build
@@ -4,17 +4,16 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 with Files("**"):
     BUG_COMPONENT = ("Core", "DOM")
 
 XPIDL_SOURCES += [
     'nsIAudioChannelAgent.idl',
-    'nsIAudioChannelService.idl',
 ]
 
 XPIDL_MODULE = 'dom_audiochannel'
 
 EXPORTS += [
     'AudioChannelAgent.h',
     'AudioChannelService.h',
 ]
deleted file mode 100644
--- a/dom/audiochannel/nsIAudioChannelService.idl
+++ /dev/null
@@ -1,29 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
-* License, v. 2.0. If a copy of the MPL was not distributed with this
-* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-
-interface mozIDOMWindowProxy;
-
-[scriptable, builtinclass, uuid(5cb24dbc-36c7-46a4-9966-ac73141dc795)]
-interface nsIAudioChannelService : nsISupports
-{
-  float getAudioChannelVolume(in mozIDOMWindowProxy window,
-                              in unsigned short audioChannel);
-
-  void setAudioChannelVolume(in mozIDOMWindowProxy window,
-                             in unsigned short audioChannel,
-                             in float volume);
-
-  boolean getAudioChannelMuted(in mozIDOMWindowProxy window,
-                               in unsigned short audioChannel);
-
-  void setAudioChannelMuted(in mozIDOMWindowProxy window,
-                            in unsigned short audioChannel,
-                            in boolean muted);
-
-  boolean isAudioChannelActive(in mozIDOMWindowProxy window,
-                               in unsigned short audioChannel);
-};
--- a/dom/browser-element/BrowserElementChildPreload.js
+++ b/dom/browser-element/BrowserElementChildPreload.js
@@ -13,19 +13,16 @@ debug("loaded");
 var BrowserElementIsReady;
 
 var { classes: Cc, interfaces: Ci, results: Cr, utils: Cu }  = Components;
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/BrowserElementPromptService.jsm");
 Cu.import("resource://gre/modules/Task.jsm");
 
-XPCOMUtils.defineLazyServiceGetter(this, "acs",
-                                   "@mozilla.org/audiochannel/service;1",
-                                   "nsIAudioChannelService");
 XPCOMUtils.defineLazyModuleGetter(this, "ManifestFinder",
                                   "resource://gre/modules/ManifestFinder.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "ManifestObtainer",
                                   "resource://gre/modules/ManifestObtainer.jsm");
 
 
 var kLongestReturnedString = 128;
 
@@ -311,21 +308,16 @@ BrowserElementChild.prototype = {
       "entered-fullscreen": this._recvEnteredFullscreen,
       "exit-fullscreen": this._recvExitFullscreen,
       "activate-next-paint-listener": this._activateNextPaintListener,
       "deactivate-next-paint-listener": this._deactivateNextPaintListener,
       "find-all": this._recvFindAll,
       "find-next": this._recvFindNext,
       "clear-match": this._recvClearMatch,
       "execute-script": this._recvExecuteScript,
-      "get-audio-channel-volume": this._recvGetAudioChannelVolume,
-      "set-audio-channel-volume": this._recvSetAudioChannelVolume,
-      "get-audio-channel-muted": this._recvGetAudioChannelMuted,
-      "set-audio-channel-muted": this._recvSetAudioChannelMuted,
-      "get-is-audio-channel-active": this._recvIsAudioChannelActive,
       "get-web-manifest": this._recvGetWebManifest,
     }
 
     if (message.data.msg_name in mmCalls) {
       return mmCalls[message.data.msg_name].apply(self, arguments);
     }
   },
 
@@ -1376,64 +1368,16 @@ BrowserElementChild.prototype = {
     let webNav = docShell.QueryInterface(Ci.nsIWebNavigation);
     webNav.stop(webNav.STOP_NETWORK);
   },
 
   _recvZoom: function(data) {
     docShell.contentViewer.fullZoom = data.json.zoom;
   },
 
-  _recvGetAudioChannelVolume: function(data) {
-    debug("Received getAudioChannelVolume message: (" + data.json.id + ")");
-
-    let volume = acs.getAudioChannelVolume(content,
-                                           data.json.args.audioChannel);
-    sendAsyncMsg('got-audio-channel-volume', {
-      id: data.json.id, successRv: volume
-    });
-  },
-
-  _recvSetAudioChannelVolume: function(data) {
-    debug("Received setAudioChannelVolume message: (" + data.json.id + ")");
-
-    acs.setAudioChannelVolume(content,
-                              data.json.args.audioChannel,
-                              data.json.args.volume);
-    sendAsyncMsg('got-set-audio-channel-volume', {
-      id: data.json.id, successRv: true
-    });
-  },
-
-  _recvGetAudioChannelMuted: function(data) {
-    debug("Received getAudioChannelMuted message: (" + data.json.id + ")");
-
-    let muted = acs.getAudioChannelMuted(content, data.json.args.audioChannel);
-    sendAsyncMsg('got-audio-channel-muted', {
-      id: data.json.id, successRv: muted
-    });
-  },
-
-  _recvSetAudioChannelMuted: function(data) {
-    debug("Received setAudioChannelMuted message: (" + data.json.id + ")");
-
-    acs.setAudioChannelMuted(content, data.json.args.audioChannel,
-                             data.json.args.muted);
-    sendAsyncMsg('got-set-audio-channel-muted', {
-      id: data.json.id, successRv: true
-    });
-  },
-
-  _recvIsAudioChannelActive: function(data) {
-    debug("Received isAudioChannelActive message: (" + data.json.id + ")");
-
-    let active = acs.isAudioChannelActive(content, data.json.args.audioChannel);
-    sendAsyncMsg('got-is-audio-channel-active', {
-      id: data.json.id, successRv: active
-    });
-  },
   _recvGetWebManifest: Task.async(function* (data) {
     debug(`Received GetWebManifest message: (${data.json.id})`);
     let manifest = null;
     let hasManifest = ManifestFinder.contentHasManifestLink(content);
     if (hasManifest) {
       try {
         manifest = yield ManifestObtainer.contentObtainManifest(content);
       } catch (e) {
--- a/dom/browser-element/BrowserElementParent.js
+++ b/dom/browser-element/BrowserElementParent.js
@@ -175,21 +175,16 @@ BrowserElementParent.prototype = {
       "exit-dom-fullscreen": this._exitDomFullscreen,
       "got-visible": this._gotDOMRequestResult,
       "visibilitychange": this._childVisibilityChange,
       "got-set-input-method-active": this._gotDOMRequestResult,
       "scrollviewchange": this._handleScrollViewChange,
       "caretstatechanged": this._handleCaretStateChanged,
       "findchange": this._handleFindChange,
       "execute-script-done": this._gotDOMRequestResult,
-      "got-audio-channel-volume": this._gotDOMRequestResult,
-      "got-set-audio-channel-volume": this._gotDOMRequestResult,
-      "got-audio-channel-muted": this._gotDOMRequestResult,
-      "got-set-audio-channel-muted": this._gotDOMRequestResult,
-      "got-is-audio-channel-active": this._gotDOMRequestResult,
       "got-web-manifest": this._gotDOMRequestResult,
     };
 
     let mmSecuritySensitiveCalls = {
       "audioplaybackchange": this._fireEventFromMsg,
       "showmodalprompt": this._handleShowModalPrompt,
       "contextmenu": this._fireCtxMenuEvent,
       "securitychange": this._fireEventFromMsg,
@@ -891,43 +886,16 @@ BrowserElementParent.prototype = {
     };
     if (!this._domRequestReady) {
       this._pendingAPICalls.push(run);
     } else {
       run();
     }
   },
 
-  getAudioChannelVolume: function(aAudioChannel) {
-    return this._sendDOMRequest('get-audio-channel-volume',
-                                {audioChannel: aAudioChannel});
-  },
-
-  setAudioChannelVolume: function(aAudioChannel, aVolume) {
-    return this._sendDOMRequest('set-audio-channel-volume',
-                                {audioChannel: aAudioChannel,
-                                 volume: aVolume});
-  },
-
-  getAudioChannelMuted: function(aAudioChannel) {
-    return this._sendDOMRequest('get-audio-channel-muted',
-                                {audioChannel: aAudioChannel});
-  },
-
-  setAudioChannelMuted: function(aAudioChannel, aMuted) {
-    return this._sendDOMRequest('set-audio-channel-muted',
-                                {audioChannel: aAudioChannel,
-                                 muted: aMuted});
-  },
-
-  isAudioChannelActive: function(aAudioChannel) {
-    return this._sendDOMRequest('get-is-audio-channel-active',
-                                {audioChannel: aAudioChannel});
-  },
-
   getWebManifest: defineDOMRequestMethod('get-web-manifest'),
   /**
    * Called when the visibility of the window which owns this iframe changes.
    */
   _ownerVisibilityChange: function() {
     this._sendAsyncMsg('owner-visibility-change',
                        {visible: !this._window.document.hidden});
   },
--- a/dom/browser-element/nsIBrowserElementAPI.idl
+++ b/dom/browser-element/nsIBrowserElementAPI.idl
@@ -87,24 +87,16 @@ interface nsIBrowserElementAPI : nsISupp
   nsIDOMDOMRequest getMuted();
 
   void setVolume(in float volume);
   nsIDOMDOMRequest getVolume();
 
   void addNextPaintListener(in nsIBrowserElementNextPaintListener listener);
   void removeNextPaintListener(in nsIBrowserElementNextPaintListener listener);
 
-  nsIDOMDOMRequest getAudioChannelVolume(in uint32_t audioChannel);
-  nsIDOMDOMRequest setAudioChannelVolume(in uint32_t audioChannel, in float volume);
-
-  nsIDOMDOMRequest getAudioChannelMuted(in uint32_t audioChannel);
-  nsIDOMDOMRequest setAudioChannelMuted(in uint32_t audioChannel, in bool muted);
-
-  nsIDOMDOMRequest isAudioChannelActive(in uint32_t audioChannel);
-
   nsIDOMDOMRequest executeScript(in DOMString script, in jsval options);
 
   /**
    * Returns an object that represents a Web Manifest:
    * http://w3c.github.io/manifest/
    */
   nsIDOMDOMRequest getWebManifest();
 };
--- a/dom/ipc/PBrowser.ipdl
+++ b/dom/ipc/PBrowser.ipdl
@@ -827,23 +827,16 @@ child:
      * @param event keyboard event
      * @param isTrusted true if triggered by a trusted key event
      * @param modifierMask indicates which accesskey modifiers are pressed
      */
     async HandleAccessKey(WidgetKeyboardEvent event,
                           uint32_t[] charCodes, int32_t modifierMask);
 
     /**
-     * Propagate a refresh to the child process
-     */
-    async AudioChannelChangeNotification(uint32_t aAudioChannel,
-                                         float aVolume,
-                                         bool aMuted);
-
-    /**
      * Tells the root child docShell whether or not to use
      * global history. This is sent right after the PBrowser
      * is bound to a frameloader element.
      */
     async SetUseGlobalHistory(bool aUse);
 
     /**
      * HandledWindowedPluginKeyEvent() is always called after posting a native
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -2322,37 +2322,16 @@ TabChild::RecvHandleAccessKey(const Widg
       }
     }
   }
 
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
-TabChild::RecvAudioChannelChangeNotification(const uint32_t& aAudioChannel,
-                                             const float& aVolume,
-                                             const bool& aMuted)
-{
-  nsCOMPtr<nsPIDOMWindowOuter> window = do_GetInterface(WebNavigation());
-  if (window) {
-    RefPtr<AudioChannelService> service = AudioChannelService::GetOrCreate();
-    MOZ_ASSERT(service);
-
-    service->SetAudioChannelVolume(window,
-                                   static_cast<AudioChannel>(aAudioChannel),
-                                   aVolume);
-    service->SetAudioChannelMuted(window,
-                                  static_cast<AudioChannel>(aAudioChannel),
-                                  aMuted);
-  }
-
-  return IPC_OK();
-}
-
-mozilla::ipc::IPCResult
 TabChild::RecvSetUseGlobalHistory(const bool& aUse)
 {
   nsCOMPtr<nsIDocShell> docShell = do_GetInterface(WebNavigation());
   MOZ_ASSERT(docShell);
 
   nsresult rv = docShell->SetUseGlobalHistory(aUse);
   if (NS_FAILED(rv)) {
     NS_WARNING("Failed to set UseGlobalHistory on TabChild docShell");
--- a/dom/ipc/TabChild.h
+++ b/dom/ipc/TabChild.h
@@ -585,20 +585,16 @@ public:
 
   virtual mozilla::ipc::IPCResult
   RecvThemeChanged(nsTArray<LookAndFeelInt>&& aLookAndFeelIntCache) override;
 
   virtual mozilla::ipc::IPCResult RecvHandleAccessKey(const WidgetKeyboardEvent& aEvent,
                                                       nsTArray<uint32_t>&& aCharCodes,
                                                       const int32_t& aModifierMask) override;
 
-  virtual mozilla::ipc::IPCResult RecvAudioChannelChangeNotification(const uint32_t& aAudioChannel,
-                                                                     const float& aVolume,
-                                                                     const bool& aMuted) override;
-
   virtual mozilla::ipc::IPCResult RecvSetUseGlobalHistory(const bool& aUse) override;
 
   virtual mozilla::ipc::IPCResult RecvHandledWindowedPluginKeyEvent(
     const mozilla::NativeEventData& aKeyEventData,
     const bool& aIsConsumed) override;
 
   virtual mozilla::ipc::IPCResult RecvPrint(const uint64_t& aOuterWindowID,
                                             const PrintData& aPrintData) override;
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -3226,43 +3226,16 @@ TabParent::GetShowInfo()
     return ShowInfo(name, allowFullscreen, isPrivate, false,
                     isTransparent, mDPI, mRounding, mDefaultScale.scale);
   }
 
   return ShowInfo(EmptyString(), false, false, false,
                   false, mDPI, mRounding, mDefaultScale.scale);
 }
 
-void
-TabParent::AudioChannelChangeNotification(nsPIDOMWindowOuter* aWindow,
-                                          AudioChannel aAudioChannel,
-                                          float aVolume,
-                                          bool aMuted)
-{
-  if (!mFrameElement || !mFrameElement->OwnerDoc()) {
-    return;
-  }
-
-  nsCOMPtr<nsPIDOMWindowOuter> window = mFrameElement->OwnerDoc()->GetWindow();
-  while (window) {
-    if (window == aWindow) {
-      Unused << SendAudioChannelChangeNotification(static_cast<uint32_t>(aAudioChannel),
-                                                   aVolume, aMuted);
-      break;
-    }
-
-    nsCOMPtr<nsPIDOMWindowOuter> win = window->GetScriptableParentOrNull();
-    if (!win) {
-      break;
-    }
-
-    window = win;
-  }
-}
-
 mozilla::ipc::IPCResult
 TabParent::RecvGetTabCount(uint32_t* aValue)
 {
   *aValue = 0;
 
   nsCOMPtr<nsIXULBrowserWindow> xulBrowserWindow = GetXULBrowserWindow();
   NS_ENSURE_TRUE(xulBrowserWindow, IPC_OK());
 
--- a/dom/ipc/TabParent.h
+++ b/dom/ipc/TabParent.h
@@ -570,20 +570,16 @@ public:
 
   void AddInitialDnDDataTo(DataTransfer* aDataTransfer);
 
   bool TakeDragVisualization(RefPtr<mozilla::gfx::SourceSurface>& aSurface,
                              LayoutDeviceIntRect* aDragRect);
 
   layout::RenderFrameParent* GetRenderFrame();
 
-  void AudioChannelChangeNotification(nsPIDOMWindowOuter* aWindow,
-                                      AudioChannel aAudioChannel,
-                                      float aVolume,
-                                      bool aMuted);
   bool SetRenderFrame(PRenderFrameParent* aRFParent);
   bool GetRenderFrameInfo(TextureFactoryIdentifier* aTextureFactoryIdentifier,
                           uint64_t* aLayersId);
 
   mozilla::ipc::IPCResult RecvEnsureLayersConnected(CompositorOptions* aCompositorOptions) override;
 
   // LiveResizeListener implementation
   void LiveResizeStarted() override;