Bug 1357649 - Remove remnants of AudioChannelManager. r?bz draft
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 19 Apr 2017 15:55:28 +0900
changeset 564973 3e1a64f5947403794df8a72184658e87fde4f9c6
parent 564972 416c3a44a23eaebab6eccbc26ca5b74c716065d5
child 624867 b5bf384ad4fd6d481fa1c40d1c475664d36d51a3
push id54733
push userbmo:mh+mozilla@glandium.org
push dateWed, 19 Apr 2017 06:55:50 +0000
reviewersbz
bugs1357649
milestone55.0a1
Bug 1357649 - Remove remnants of AudioChannelManager. r?bz
dom/base/Navigator.cpp
dom/base/Navigator.h
dom/bindings/Bindings.conf
dom/webidl/AudioChannelManager.webidl
dom/webidl/Navigator.webidl
dom/webidl/moz.build
old-configure.in
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -68,20 +68,16 @@
 #include "TimeManager.h"
 #include "nsStreamUtils.h"
 #include "WidgetUtils.h"
 #include "nsIPresentationService.h"
 
 #include "mozilla/dom/MediaDevices.h"
 #include "MediaManager.h"
 
-#ifdef MOZ_AUDIO_CHANNEL_MANAGER
-#include "AudioChannelManager.h"
-#endif
-
 #include "nsIDOMGlobalPropertyInitializer.h"
 #include "nsJSUtils.h"
 
 #include "nsScriptNameSpaceManager.h"
 
 #include "mozilla/dom/NavigatorBinding.h"
 #include "mozilla/dom/Promise.h"
 
@@ -202,19 +198,16 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mGeolocation)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mNotification)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mBatteryManager)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mBatteryPromise)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPowerManager)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mConnection)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mStorageManager)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAuthentication)
-#ifdef MOZ_AUDIO_CHANNEL_MANAGER
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAudioChannelManager)
-#endif
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMediaDevices)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTimeManager)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mServiceWorkerContainer)
 
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mWindow)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMediaKeySystemAccessManager)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPresentation)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mGamepadServiceTest)
@@ -266,22 +259,16 @@ Navigator::Invalidate()
 
   if (mConnection) {
     mConnection->Shutdown();
     mConnection = nullptr;
   }
 
   mMediaDevices = nullptr;
 
-#ifdef MOZ_AUDIO_CHANNEL_MANAGER
-  if (mAudioChannelManager) {
-    mAudioChannelManager = nullptr;
-  }
-#endif
-
   if (mTimeManager) {
     mTimeManager = nullptr;
   }
 
   if (mPresentation) {
     mPresentation = nullptr;
   }
 
@@ -1688,33 +1675,16 @@ Navigator::CheckPermission(nsPIDOMWindow
   if (!aWindow) {
     return false;
   }
 
   uint32_t permission = GetPermission(aWindow, aType);
   return permission == nsIPermissionManager::ALLOW_ACTION;
 }
 
-#ifdef MOZ_AUDIO_CHANNEL_MANAGER
-system::AudioChannelManager*
-Navigator::GetMozAudioChannelManager(ErrorResult& aRv)
-{
-  if (!mAudioChannelManager) {
-    if (!mWindow) {
-      aRv.Throw(NS_ERROR_UNEXPECTED);
-      return nullptr;
-    }
-    mAudioChannelManager = new system::AudioChannelManager();
-    mAudioChannelManager->Init(mWindow);
-  }
-
-  return mAudioChannelManager;
-}
-#endif
-
 JSObject*
 Navigator::WrapObject(JSContext* cx, JS::Handle<JSObject*> aGivenProto)
 {
   return NavigatorBinding::Wrap(cx, this, aGivenProto);
 }
 
 /* static */
 bool
--- a/dom/base/Navigator.h
+++ b/dom/base/Navigator.h
@@ -79,22 +79,16 @@ class LegacyMozTCPSocket;
 class VRDisplay;
 class VRServiceTest;
 class StorageManager;
 
 namespace time {
 class TimeManager;
 } // namespace time
 
-namespace system {
-#ifdef MOZ_AUDIO_CHANNEL_MANAGER
-class AudioChannelManager;
-#endif
-} // namespace system
-
 class Navigator final : public nsIDOMNavigator
                       , public nsIMozNavigatorNetwork
                       , public nsWrapperCache
 {
 public:
   explicit Navigator(nsPIDOMWindowInner* aInnerWindow);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
@@ -202,19 +196,16 @@ public:
   void GetGamepads(nsTArray<RefPtr<Gamepad> >& aGamepads, ErrorResult& aRv);
   GamepadServiceTest* RequestGamepadServiceTest();
   already_AddRefed<Promise> GetVRDisplays(ErrorResult& aRv);
   void GetActiveVRDisplays(nsTArray<RefPtr<VRDisplay>>& aDisplays) const;
   VRServiceTest* RequestVRServiceTest();
 #ifdef MOZ_TIME_MANAGER
   time::TimeManager* GetMozTime(ErrorResult& aRv);
 #endif // MOZ_TIME_MANAGER
-#ifdef MOZ_AUDIO_CHANNEL_MANAGER
-  system::AudioChannelManager* GetMozAudioChannelManager(ErrorResult& aRv);
-#endif // MOZ_AUDIO_CHANNEL_MANAGER
 
   Presentation* GetPresentation(ErrorResult& aRv);
 
   bool SendBeacon(const nsAString& aUrl,
                   const Nullable<fetch::BodyInit>& aData,
                   ErrorResult& aRv);
 
   void MozGetUserMedia(const MediaStreamConstraints& aConstraints,
@@ -296,19 +287,16 @@ private:
   RefPtr<Permissions> mPermissions;
   RefPtr<Geolocation> mGeolocation;
   RefPtr<DesktopNotificationCenter> mNotification;
   RefPtr<battery::BatteryManager> mBatteryManager;
   RefPtr<Promise> mBatteryPromise;
   RefPtr<PowerManager> mPowerManager;
   RefPtr<network::Connection> mConnection;
   RefPtr<WebAuthentication> mAuthentication;
-#ifdef MOZ_AUDIO_CHANNEL_MANAGER
-  RefPtr<system::AudioChannelManager> mAudioChannelManager;
-#endif
   RefPtr<MediaDevices> mMediaDevices;
   RefPtr<time::TimeManager> mTimeManager;
   RefPtr<ServiceWorkerContainer> mServiceWorkerContainer;
   nsCOMPtr<nsPIDOMWindowInner> mWindow;
   RefPtr<Presentation> mPresentation;
   RefPtr<GamepadServiceTest> mGamepadServiceTest;
   nsTArray<RefPtr<Promise> > mVRGetDisplaysPromises;
   RefPtr<VRServiceTest> mVRServiceTest;
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -73,21 +73,16 @@ DOMInterfaces = {
 'ArchiveReader': {
     'nativeType': 'mozilla::dom::archivereader::ArchiveReader',
 },
 
 'ArchiveRequest': {
     'nativeType': 'mozilla::dom::archivereader::ArchiveRequest',
 },
 
-'AudioChannelManager': {
-    'nativeType': 'mozilla::dom::system::AudioChannelManager',
-    'headerFile': 'AudioChannelManager.h'
-},
-
 'AudioBuffer': {
     'implicitJSContext': [ 'copyToChannel' ],
 },
 
 'AudioBufferSourceNode': {
     'implicitJSContext': [ 'buffer' ],
 },
 
deleted file mode 100644
--- a/dom/webidl/AudioChannelManager.webidl
+++ /dev/null
@@ -1,37 +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/.
- */
-
-interface AudioChannelManager : EventTarget {
-  /**
-   * Indicates whether the headphones are plugged in or not.
-   */
-  readonly attribute boolean headphones;
-
-  /**
-   * Fired when the headphones are plugged or unplugged.
-   *
-   * When the headphones are unplugged, we may start playing audio through the
-   * system's speakers.  Similarly, when headphones are plugged in, we may
-   * switch audio from speakers to headphones.
-   *
-   * If audio is currently playing in this window or in one of its children, we
-   * will fire this event before we switch the audio output from headphones to
-   * speakers (or vice versa).  This allows you to, for example, pause your
-   * window's audio when the headphones are unplugged.
-   */
-  attribute EventHandler onheadphoneschange;
-
-  /**
-   * Indicates which audio channel is used to adjust volume when pressing HW
-   * volume keys.
-   */
-  attribute DOMString volumeControlChannel;
-
-  [Pure, Cached, Throws,
-   Pref="dom.mozBrowserFramesEnabled",
-   ChromeOnly]
-  readonly attribute sequence<BrowserElementAudioChannel> allowedAudioChannels;
-};
--- a/dom/webidl/Navigator.webidl
+++ b/dom/webidl/Navigator.webidl
@@ -282,24 +282,16 @@ partial interface Navigator {
 #ifdef MOZ_TIME_MANAGER
 // nsIDOMMozNavigatorTime
 partial interface Navigator {
   [Throws, ChromeOnly, UnsafeInPrerendering]
   readonly attribute MozTimeManager mozTime;
 };
 #endif // MOZ_TIME_MANAGER
 
-#ifdef MOZ_AUDIO_CHANNEL_MANAGER
-// nsIMozNavigatorAudioChannelManager
-partial interface Navigator {
-  [Throws]
-  readonly attribute AudioChannelManager mozAudioChannelManager;
-};
-#endif // MOZ_AUDIO_CHANNEL_MANAGER
-
 callback NavigatorUserMediaSuccessCallback = void (MediaStream stream);
 callback NavigatorUserMediaErrorCallback = void (MediaStreamError error);
 
 partial interface Navigator {
   [Throws, Func="Navigator::HasUserMediaSupport"]
   readonly attribute MediaDevices mediaDevices;
 
   // Deprecated. Use mediaDevices.getUserMedia instead.
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -969,21 +969,16 @@ WEBIDL_FILES = [
     'XPathNSResolver.webidl',
     'XPathResult.webidl',
     'XSLTProcessor.webidl',
     'XULCommandEvent.webidl',
     'XULDocument.webidl',
     'XULElement.webidl',
 ]
 
-if CONFIG['MOZ_AUDIO_CHANNEL_MANAGER']:
-    WEBIDL_FILES += [
-        'AudioChannelManager.webidl',
-    ]
-
 if CONFIG['MOZ_WEBRTC']:
     WEBIDL_FILES += [
         'DataChannel.webidl',
         'MediaStreamList.webidl',
         'PeerConnectionImpl.webidl',
         'PeerConnectionImplEnums.webidl',
         'PeerConnectionObserver.webidl',
         'PeerConnectionObserverEnums.webidl',
--- a/old-configure.in
+++ b/old-configure.in
@@ -2195,17 +2195,16 @@ MOZ_XUL=1
 MOZ_ZIPWRITER=1
 MOZ_NO_SMART_CARDS=
 NECKO_COOKIES=1
 MOZ_USE_NATIVE_POPUP_WINDOWS=
 MOZ_EXCLUDE_HYPHENATION_DICTIONARIES=
 MOZ_INSTALL_TRACKING=
 ACCESSIBILITY=1
 MOZ_TIME_MANAGER=
-MOZ_AUDIO_CHANNEL_MANAGER=
 MOZ_CONTENT_SANDBOX=
 MOZ_GMP_SANDBOX=
 MOZ_SANDBOX=1
 MOZ_BINARY_EXTENSIONS=
 MOZ_DEVTOOLS=server
 
 case "$target_os" in
     mingw*)
@@ -4400,24 +4399,16 @@ dnl ====================================
 dnl = Enable Support for Time Manager API
 dnl ========================================================
 if test -n "$MOZ_TIME_MANAGER"; then
     AC_DEFINE(MOZ_TIME_MANAGER)
 fi
 AC_SUBST(MOZ_TIME_MANAGER)
 
 dnl ========================================================
-dnl = Enable Support for AudioChannelManager API
-dnl ========================================================
-if test -n "$MOZ_AUDIO_CHANNEL_MANAGER"; then
-    AC_DEFINE(MOZ_AUDIO_CHANNEL_MANAGER)
-fi
-AC_SUBST(MOZ_AUDIO_CHANNEL_MANAGER)
-
-dnl ========================================================
 dnl = Enable Support for Secure Element API
 dnl ========================================================
    MOZ_SECUREELEMENT=1,
 if test -n "$MOZ_SECUREELEMENT"; then
    AC_DEFINE(MOZ_SECUREELEMENT)
 fi
  AC_SUBST(MOZ_SECUREELEMENT)