Bug 1312800 - Remove dom/inputport. r=jst
authorMichelangelo De Simone <mdesimone@mozilla.com>
Thu, 10 Nov 2016 15:39:45 -0800
changeset 352259 ded0aa202c86c89310734d88c8a8369761d1ac06
parent 352258 2b174353e76a8c7b7595f29b21a797f8f84af72c
child 352260 53d701cacdeacc6b49f958844ea69d8670e3c1fa
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjst
bugs1312800
milestone52.0a1
Bug 1312800 - Remove dom/inputport. r=jst MozReview-Commit-ID: BhvPV6lIWd3
dom/base/Navigator.cpp
dom/base/Navigator.h
dom/inputport/AVInputPort.cpp
dom/inputport/AVInputPort.h
dom/inputport/DisplayPortInputPort.cpp
dom/inputport/DisplayPortInputPort.h
dom/inputport/FakeInputPortService.cpp
dom/inputport/FakeInputPortService.h
dom/inputport/HDMIInputPort.cpp
dom/inputport/HDMIInputPort.h
dom/inputport/InputPort.cpp
dom/inputport/InputPort.h
dom/inputport/InputPortData.cpp
dom/inputport/InputPortData.h
dom/inputport/InputPortListeners.cpp
dom/inputport/InputPortListeners.h
dom/inputport/InputPortManager.cpp
dom/inputport/InputPortManager.h
dom/inputport/InputPortServiceFactory.cpp
dom/inputport/InputPortServiceFactory.h
dom/inputport/moz.build
dom/inputport/nsIInputPortService.idl
dom/inputport/test/mochitest/mochitest.ini
dom/inputport/test/mochitest/test_inputport_connection_event.html
dom/inputport/test/mochitest/test_inputport_get_inputports.html
dom/inputport/test/xpcshell/test_inputport_data.js
dom/inputport/test/xpcshell/xpcshell.ini
dom/moz.build
dom/webidl/AVInputPort.webidl
dom/webidl/DisplayPortInputPort.webidl
dom/webidl/HDMIInputPort.webidl
dom/webidl/InputPort.webidl
dom/webidl/InputPortManager.webidl
dom/webidl/Navigator.webidl
dom/webidl/moz.build
layout/build/nsLayoutModule.cpp
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -35,17 +35,16 @@
 #ifdef MOZ_GAMEPAD
 #include "mozilla/dom/GamepadServiceTest.h"
 #endif
 #include "mozilla/dom/PowerManager.h"
 #include "mozilla/dom/WakeLock.h"
 #include "mozilla/dom/power/PowerManagerService.h"
 #include "mozilla/dom/FlyWebPublishedServer.h"
 #include "mozilla/dom/FlyWebService.h"
-#include "mozilla/dom/InputPortManager.h"
 #include "mozilla/dom/Permissions.h"
 #include "mozilla/dom/Presentation.h"
 #include "mozilla/dom/ServiceWorkerContainer.h"
 #include "mozilla/dom/StorageManager.h"
 #include "mozilla/dom/TCPSocket.h"
 #include "mozilla/dom/VRDisplay.h"
 #include "mozilla/dom/workers/RuntimeService.h"
 #include "mozilla/Hal.h"
@@ -202,17 +201,16 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMimeTypes)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPlugins)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPermissions)
   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(mInputPortManager)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mConnection)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mStorageManager)
 #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)
@@ -265,20 +263,16 @@ Navigator::Invalidate()
 
   mBatteryPromise = nullptr;
 
   if (mPowerManager) {
     mPowerManager->Shutdown();
     mPowerManager = nullptr;
   }
 
-  if (mInputPortManager) {
-    mInputPortManager = nullptr;
-  }
-
   if (mConnection) {
     mConnection->Shutdown();
     mConnection = nullptr;
   }
 
   mMediaDevices = nullptr;
 
 #ifdef MOZ_AUDIO_CHANNEL_MANAGER
@@ -1578,33 +1572,16 @@ Navigator::RequestWakeLock(const nsAStri
   if (!pmService) {
     aRv.Throw(NS_ERROR_UNEXPECTED);
     return nullptr;
   }
 
   return pmService->NewWakeLock(aTopic, mWindow, aRv);
 }
 
-InputPortManager*
-Navigator::GetInputPortManager(ErrorResult& aRv)
-{
-  if (!mInputPortManager) {
-    if (!mWindow) {
-      aRv.Throw(NS_ERROR_FAILURE);
-      return nullptr;
-    }
-    mInputPortManager = InputPortManager::Create(mWindow, aRv);
-    if (NS_WARN_IF(aRv.Failed())) {
-      return nullptr;
-    }
-  }
-
-  return mInputPortManager;
-}
-
 already_AddRefed<LegacyMozTCPSocket>
 Navigator::MozTCPSocket()
 {
   RefPtr<LegacyMozTCPSocket> socket = new LegacyMozTCPSocket(GetWindow());
   return socket.forget();
 }
 
 #ifdef MOZ_GAMEPAD
--- a/dom/base/Navigator.h
+++ b/dom/base/Navigator.h
@@ -68,17 +68,16 @@ class NavigatorUserMediaSuccessCallback;
 class NavigatorUserMediaErrorCallback;
 class MozGetUserMediaDevicesSuccessCallback;
 
 namespace network {
 class Connection;
 } // namespace network
 
 class PowerManager;
-class InputPortManager;
 class DeviceStorageAreaListener;
 class Presentation;
 class LegacyMozTCPSocket;
 class VRDisplay;
 class StorageManager;
 
 namespace time {
 class TimeManager;
@@ -204,17 +203,16 @@ public:
                          nsTArray<RefPtr<nsDOMDeviceStorage> >& aStores,
                          ErrorResult& aRv);
 
   already_AddRefed<nsDOMDeviceStorage>
   GetDeviceStorageByNameAndType(const nsAString& aName, const nsAString& aType,
                                 ErrorResult& aRv);
 
   DesktopNotificationCenter* GetMozNotification(ErrorResult& aRv);
-  InputPortManager* GetInputPortManager(ErrorResult& aRv);
   already_AddRefed<LegacyMozTCPSocket> MozTCPSocket();
   network::Connection* GetConnection(ErrorResult& aRv);
   MediaDevices* GetMediaDevices(ErrorResult& aRv);
 
 #ifdef MOZ_GAMEPAD
   void GetGamepads(nsTArray<RefPtr<Gamepad> >& aGamepads, ErrorResult& aRv);
   GamepadServiceTest* RequestGamepadServiceTest();
 #endif // MOZ_GAMEPAD
@@ -297,17 +295,16 @@ private:
   RefPtr<nsMimeTypeArray> mMimeTypes;
   RefPtr<nsPluginArray> mPlugins;
   RefPtr<Permissions> mPermissions;
   RefPtr<Geolocation> mGeolocation;
   RefPtr<DesktopNotificationCenter> mNotification;
   RefPtr<battery::BatteryManager> mBatteryManager;
   RefPtr<Promise> mBatteryPromise;
   RefPtr<PowerManager> mPowerManager;
-  RefPtr<InputPortManager> mInputPortManager;
   RefPtr<network::Connection> mConnection;
 #ifdef MOZ_AUDIO_CHANNEL_MANAGER
   RefPtr<system::AudioChannelManager> mAudioChannelManager;
 #endif
   RefPtr<MediaDevices> mMediaDevices;
   nsTArray<nsWeakPtr> mDeviceStorageStores;
   RefPtr<time::TimeManager> mTimeManager;
   RefPtr<ServiceWorkerContainer> mServiceWorkerContainer;
deleted file mode 100644
--- a/dom/inputport/AVInputPort.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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/. */
-
-#include "mozilla/dom/AVInputPort.h"
-#include "mozilla/dom/AVInputPortBinding.h"
-
-namespace mozilla {
-namespace dom {
-
-AVInputPort::AVInputPort(nsPIDOMWindowInner* aWindow)
-  : InputPort(aWindow)
-{
-}
-
-AVInputPort::~AVInputPort()
-{
-}
-
-/* static */ already_AddRefed<AVInputPort>
-AVInputPort::Create(nsPIDOMWindowInner* aWindow,
-                    nsIInputPortListener* aListener,
-                    nsIInputPortData* aData,
-                    ErrorResult& aRv)
-{
-  RefPtr<AVInputPort> inputport = new AVInputPort(aWindow);
-  inputport->Init(aData, aListener, aRv);
-  if (NS_WARN_IF(aRv.Failed())) {
-    return nullptr;
-  }
-  return inputport.forget();
-}
-
-JSObject*
-AVInputPort::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
-{
-  return AVInputPortBinding::Wrap(aCx, this, aGivenProto);
-}
-
-} // namespace dom
-} //namespace mozilla
deleted file mode 100644
--- a/dom/inputport/AVInputPort.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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_AVInputPort_h
-#define mozilla_dom_AVInputPort_h
-
-#include "mozilla/dom/InputPort.h"
-
-namespace mozilla {
-namespace dom {
-
-class AVInputPort final : public InputPort
-{
-public:
-  static already_AddRefed<AVInputPort> Create(nsPIDOMWindowInner* aWindow,
-                                              nsIInputPortListener* aListener,
-                                              nsIInputPortData* aData,
-                                              ErrorResult& aRv);
-
-  virtual JSObject* WrapObject(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
-
-private:
-  explicit AVInputPort(nsPIDOMWindowInner* aWindow);
-
-  ~AVInputPort();
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_AVInputPort_h
deleted file mode 100644
--- a/dom/inputport/DisplayPortInputPort.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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/. */
-
-#include "mozilla/dom/DisplayPortInputPort.h"
-#include "mozilla/dom/DisplayPortInputPortBinding.h"
-
-namespace mozilla {
-namespace dom {
-
-DisplayPortInputPort::DisplayPortInputPort(nsPIDOMWindowInner* aWindow)
-  : InputPort(aWindow)
-{
-}
-
-DisplayPortInputPort::~DisplayPortInputPort()
-{
-}
-
-/* static */ already_AddRefed<DisplayPortInputPort>
-DisplayPortInputPort::Create(nsPIDOMWindowInner* aWindow,
-                             nsIInputPortListener* aListener,
-                             nsIInputPortData* aData,
-                             ErrorResult& aRv)
-{
-  RefPtr<DisplayPortInputPort> inputport = new DisplayPortInputPort(aWindow);
-  inputport->Init(aData, aListener, aRv);
-  if (NS_WARN_IF(aRv.Failed())) {
-    return nullptr;
-  }
-  return inputport.forget();
-}
-
-JSObject*
-DisplayPortInputPort::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
-{
-  return DisplayPortInputPortBinding::Wrap(aCx, this, aGivenProto);
-}
-
-} // namespace dom
-} //namespace mozilla
deleted file mode 100644
--- a/dom/inputport/DisplayPortInputPort.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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_DisplayPortInputPort_h
-#define mozilla_dom_DisplayPortInputPort_h
-
-#include "mozilla/dom/InputPort.h"
-
-namespace mozilla {
-namespace dom {
-
-class DisplayPortInputPort final : public InputPort
-{
-public:
-  static already_AddRefed<DisplayPortInputPort>
-  Create(nsPIDOMWindowInner* aWindow,
-         nsIInputPortListener* aListener,
-         nsIInputPortData* aData,
-         ErrorResult& aRv);
-
-  virtual JSObject* WrapObject(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
-
-private:
-  explicit DisplayPortInputPort(nsPIDOMWindowInner* aWindow);
-
-  ~DisplayPortInputPort();
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_DisplayPortInputPort_h
deleted file mode 100644
--- a/dom/inputport/FakeInputPortService.cpp
+++ /dev/null
@@ -1,208 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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/. */
-
-#include "FakeInputPortService.h"
-#include "InputPortData.h"
-#include "mozilla/dom/InputPort.h"
-#include "nsIMutableArray.h"
-#include "nsITimer.h"
-#include "nsServiceManagerUtils.h"
-#include "nsThreadUtils.h"
-
-namespace mozilla {
-namespace dom {
-
-namespace {
-class InputPortServiceNotifyRunnable final : public Runnable
-{
-public:
-  InputPortServiceNotifyRunnable(
-      nsIInputPortServiceCallback* aCallback,
-      nsIArray* aDataList,
-      uint16_t aErrorCode = nsIInputPortServiceCallback::INPUTPORT_ERROR_OK)
-    : mCallback(aCallback)
-    , mDataList(aDataList)
-    , mErrorCode(aErrorCode)
-  {
-    MOZ_ASSERT(aCallback);
-    MOZ_ASSERT(aDataList);
-  }
-
-  NS_IMETHOD Run() override
-  {
-    if (mErrorCode == nsIInputPortServiceCallback::INPUTPORT_ERROR_OK) {
-      return mCallback->NotifySuccess(mDataList);
-    } else {
-      return mCallback->NotifyError(mErrorCode);
-    }
-  }
-
-private:
-  nsCOMPtr<nsIInputPortServiceCallback> mCallback;
-  nsCOMPtr<nsIArray> mDataList;
-  uint16_t mErrorCode;
-};
-
-class PortConnectionChangedCallback final : public nsITimerCallback
-{
-public:
-  NS_DECL_ISUPPORTS
-
-  PortConnectionChangedCallback(nsIInputPortData* aInputPortData,
-                                nsIInputPortListener* aInputPortListener,
-                                const bool aIsConnected)
-    : mInputPortData(aInputPortData)
-    , mInputPortListener(aInputPortListener)
-    , mIsConnected(aIsConnected)
-  {}
-
-  NS_IMETHOD
-  Notify(nsITimer* aTimer) override
-  {
-    InputPortData* portData = static_cast<InputPortData*>(mInputPortData.get());
-    portData->SetConnected(mIsConnected);
-    nsresult rv = mInputPortListener->NotifyConnectionChanged(
-      portData->GetId(), mIsConnected);
-    return rv;
-  }
-
-private:
-  ~PortConnectionChangedCallback() {}
-
-  nsCOMPtr<nsIInputPortData> mInputPortData;
-  nsCOMPtr<nsIInputPortListener> mInputPortListener;
-  bool mIsConnected;
-};
-
-} // namespace
-
-NS_IMPL_ISUPPORTS(PortConnectionChangedCallback, nsITimerCallback)
-
-NS_IMPL_CYCLE_COLLECTION_CLASS(FakeInputPortService)
-
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(FakeInputPortService)
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mInputPortListener)
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPortConnectionChangedTimer)
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPortDatas)
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
-
-NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(FakeInputPortService)
-  tmp->Shutdown();
-  NS_IMPL_CYCLE_COLLECTION_UNLINK(mInputPortListener)
-  NS_IMPL_CYCLE_COLLECTION_UNLINK(mPortConnectionChangedTimer)
-  NS_IMPL_CYCLE_COLLECTION_UNLINK(mPortDatas)
-NS_IMPL_CYCLE_COLLECTION_UNLINK_END
-
-NS_IMPL_CYCLE_COLLECTING_ADDREF(FakeInputPortService)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(FakeInputPortService)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(FakeInputPortService)
-  NS_INTERFACE_MAP_ENTRY(nsIInputPortService)
-  NS_INTERFACE_MAP_ENTRY(nsISupports)
-NS_INTERFACE_MAP_END
-
-FakeInputPortService::FakeInputPortService()
-{
-  Init();
-}
-
-FakeInputPortService::~FakeInputPortService()
-{
-  Shutdown();
-}
-
-void
-FakeInputPortService::Init()
-{
-  nsCOMPtr<nsIInputPortData> portData1 =
-      MockInputPort(NS_LITERAL_STRING("1"), NS_LITERAL_STRING("av"), true);
-  mPortDatas.AppendElement(portData1);
-
-  nsCOMPtr<nsIInputPortData> portData2 =
-      MockInputPort(NS_LITERAL_STRING("2"), NS_LITERAL_STRING("displayport"), false);
-  mPortDatas.AppendElement(portData2);
-
-  nsCOMPtr<nsIInputPortData> portData3 =
-      MockInputPort(NS_LITERAL_STRING("3"), NS_LITERAL_STRING("hdmi"), true);
-  mPortDatas.AppendElement(portData3);
-}
-
-void
-FakeInputPortService::Shutdown()
-{
-  if (mPortConnectionChangedTimer) {
-    mPortConnectionChangedTimer->Cancel();
-  }
-}
-
-NS_IMETHODIMP
-FakeInputPortService::GetInputPortListener(nsIInputPortListener** aInputPortListener)
-{
-  if (!mInputPortListener) {
-    *aInputPortListener = nullptr;
-    return NS_OK;
-  }
-
-  *aInputPortListener = mInputPortListener;
-  NS_ADDREF(*aInputPortListener);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-FakeInputPortService::SetInputPortListener(nsIInputPortListener* aInputPortListener)
-{
-  mInputPortListener = aInputPortListener;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-FakeInputPortService::GetInputPorts(nsIInputPortServiceCallback* aCallback)
-{
-  if (!aCallback) {
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  nsCOMPtr<nsIMutableArray> portDataList = do_CreateInstance(NS_ARRAY_CONTRACTID);
-  if (!portDataList) {
-    return NS_ERROR_OUT_OF_MEMORY;
-  }
-
-  for (uint32_t i = 0; i < mPortDatas.Length(); i++) {
-    portDataList->AppendElement(mPortDatas[i], false);
-  }
-
-  mPortConnectionChangedTimer = do_CreateInstance(NS_TIMER_CONTRACTID);
-  NS_ENSURE_TRUE(mPortConnectionChangedTimer, NS_ERROR_OUT_OF_MEMORY);
-  bool isConnected = false;
-  mPortDatas[0]->GetConnected(&isConnected);
-  //simulate the connection change event.
-  RefPtr<PortConnectionChangedCallback> connectionChangedCb =
-    new PortConnectionChangedCallback(mPortDatas[0], mInputPortListener, !isConnected);
-  nsresult rv = mPortConnectionChangedTimer->InitWithCallback(
-    connectionChangedCb, 100, nsITimer::TYPE_ONE_SHOT);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return rv;
-  }
-
-  nsCOMPtr<nsIRunnable> runnable =
-    new InputPortServiceNotifyRunnable(aCallback, portDataList);
-  return NS_DispatchToCurrentThread(runnable);
-}
-
-already_AddRefed<nsIInputPortData>
-FakeInputPortService::MockInputPort(const nsAString& aId,
-                                    const nsAString& aType,
-                                    bool aIsConnected)
-{
-  nsCOMPtr<nsIInputPortData> portData = new InputPortData();
-  portData->SetId(aId);
-  portData->SetType(aType);
-  portData->SetConnected(aIsConnected);
-  return portData.forget();
-}
-
-} // namespace dom
-} // namespace mozilla
deleted file mode 100644
--- a/dom/inputport/FakeInputPortService.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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_FakeInputPortService_h
-#define mozilla_dom_FakeInputPortService_h
-
-#include "nsCOMPtr.h"
-#include "nsCycleCollectionParticipant.h"
-#include "nsIInputPortService.h"
-#include "nsTArray.h"
-
-#define FAKE_INPUTPORT_SERVICE_CONTRACTID \
-  "@mozilla.org/inputport/fakeinputportservice;1"
-#define FAKE_INPUTPORT_SERVICE_CID \
-  { 0xea6b01c5, 0xad04, 0x4f2a, \
-    { 0x8a, 0xbe, 0x64, 0xdb, 0xa2, 0x22, 0xe3, 0x3d } }
-
-class nsITimer;
-class nsIInputPortData;
-
-namespace mozilla {
-namespace dom {
-
-class FakeInputPortService final : public nsIInputPortService
-{
-public:
-  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_CLASS(FakeInputPortService)
-  NS_DECL_NSIINPUTPORTSERVICE
-
-  FakeInputPortService();
-
-private:
-  ~FakeInputPortService();
-
-  void Init();
-
-  void Shutdown();
-
-  already_AddRefed<nsIInputPortData> MockInputPort(const nsAString& aId,
-                                                   const nsAString& aType,
-                                                   bool aIsConnected);
-
-  nsCOMPtr<nsIInputPortListener> mInputPortListener;
-  nsCOMPtr<nsITimer> mPortConnectionChangedTimer;
-  nsTArray<nsCOMPtr<nsIInputPortData>> mPortDatas;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_FakeInputPortService_h
deleted file mode 100644
--- a/dom/inputport/HDMIInputPort.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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/. */
-
-#include "mozilla/dom/HDMIInputPort.h"
-#include "mozilla/dom/HDMIInputPortBinding.h"
-
-namespace mozilla {
-namespace dom {
-
-HDMIInputPort::HDMIInputPort(nsPIDOMWindowInner* aWindow)
-  : InputPort(aWindow)
-{
-}
-
-HDMIInputPort::~HDMIInputPort()
-{
-}
-
-/* static */ already_AddRefed<HDMIInputPort>
-HDMIInputPort::Create(nsPIDOMWindowInner* aWindow,
-                      nsIInputPortListener* aListener,
-                      nsIInputPortData* aData,
-                      ErrorResult& aRv)
-{
-  RefPtr<HDMIInputPort> inputport = new HDMIInputPort(aWindow);
-  inputport->Init(aData, aListener, aRv);
-  if (NS_WARN_IF(aRv.Failed())) {
-    return nullptr;
-  }
-  return inputport.forget();
-}
-
-
-JSObject*
-HDMIInputPort::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
-{
-  return HDMIInputPortBinding::Wrap(aCx, this, aGivenProto);
-}
-
-} // namespace dom
-} //namespace mozilla
deleted file mode 100644
--- a/dom/inputport/HDMIInputPort.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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_HDMIInputPort_h
-#define mozilla_dom_HDMIInputPort_h
-
-#include "mozilla/dom/InputPort.h"
-
-namespace mozilla {
-namespace dom {
-
-class HDMIInputPort final : public InputPort
-{
-public:
-  static already_AddRefed<HDMIInputPort>
-  Create(nsPIDOMWindowInner* aWindow,
-         nsIInputPortListener* aListener,
-         nsIInputPortData* aData,
-         ErrorResult& aRv);
-
-  virtual JSObject* WrapObject(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
-
-private:
-  explicit HDMIInputPort(nsPIDOMWindowInner* aWindow);
-
-  ~HDMIInputPort();
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_HDMIInputPort_h
deleted file mode 100644
--- a/dom/inputport/InputPort.cpp
+++ /dev/null
@@ -1,119 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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/. */
-
-#include "MediaStreamGraph.h"
-#include "DOMMediaStream.h"
-#include "InputPortData.h"
-#include "InputPortListeners.h"
-#include "mozilla/AsyncEventDispatcher.h"
-#include "mozilla/dom/InputPort.h"
-
-namespace mozilla {
-namespace dom {
-
-NS_IMPL_CYCLE_COLLECTION_INHERITED(InputPort, DOMEventTargetHelper,
-                                   mStream,
-                                   mInputPortListener)
-
-NS_IMPL_ADDREF_INHERITED(InputPort, DOMEventTargetHelper)
-NS_IMPL_RELEASE_INHERITED(InputPort, DOMEventTargetHelper)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(InputPort)
-NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
-
-InputPort::InputPort(nsPIDOMWindowInner* aWindow)
-  : DOMEventTargetHelper(aWindow)
-  , mIsConnected(false)
-{
-}
-
-InputPort::~InputPort()
-{
-}
-
-void
-InputPort::Init(nsIInputPortData* aData, nsIInputPortListener* aListener, ErrorResult& aRv)
-{
-  MOZ_ASSERT(aData);
-  MOZ_ASSERT(aListener);
-
-  aRv = aData->GetId(mId);
-  if (NS_WARN_IF(aRv.Failed())) {
-    return;
-  }
-
-  if (NS_WARN_IF(mId.IsEmpty())) {
-    aRv.Throw(NS_ERROR_FAILURE);
-    return;
-  }
-
-  InputPortType type = static_cast<InputPortData*>(aData)->GetType();
-  if (NS_WARN_IF(type == InputPortType::EndGuard_)) {
-    aRv.Throw(NS_ERROR_FAILURE);
-    return;
-  }
-
-  aData->GetConnected(&mIsConnected);
-
-  mInputPortListener = static_cast<InputPortListener*>(aListener);
-  mInputPortListener->RegisterInputPort(this);
-
-  MediaStreamGraph* graph =
-    MediaStreamGraph::GetInstance(MediaStreamGraph::SYSTEM_THREAD_DRIVER,
-                                  AudioChannel::Normal);
-  mStream = DOMMediaStream::CreateSourceStreamAsInput(GetOwner(), graph);
-}
-
-void
-InputPort::Shutdown()
-{
-  MOZ_ASSERT(mInputPortListener);
-  if (mInputPortListener) {
-    mInputPortListener->UnregisterInputPort(this);
-    mInputPortListener = nullptr;
-  }
-}
-
-/* virtual */ JSObject*
-InputPort::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
-{
-  return InputPortBinding::Wrap(aCx, this, aGivenProto);
-}
-
-void
-InputPort::NotifyConnectionChanged(bool aIsConnected)
-{
-  MOZ_ASSERT(mIsConnected != aIsConnected);
-  mIsConnected = aIsConnected;
-
-  RefPtr<AsyncEventDispatcher> asyncDispatcher =
-    new AsyncEventDispatcher(this,
-                             aIsConnected ? NS_LITERAL_STRING("connect") :
-                                            NS_LITERAL_STRING("disconnect"),
-                             false);
-  asyncDispatcher->PostDOMEvent();
-}
-
-void
-InputPort::GetId(nsAString& aId) const
-{
-  aId = mId;
-}
-
-DOMMediaStream*
-InputPort::Stream() const
-{
-  return mStream;
-}
-
-bool
-InputPort::Connected() const
-{
-  return mIsConnected;
-}
-
-} // namespace dom
-} // namespace mozilla
deleted file mode 100644
--- a/dom/inputport/InputPort.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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_InputPort_h
-#define mozilla_dom_InputPort_h
-
-#include "InputPortListeners.h"
-#include "mozilla/DOMEventTargetHelper.h"
-#include "mozilla/dom/InputPortBinding.h"
-#include "nsIInputPortService.h"
-
-namespace mozilla {
-
-class DOMMediaStream;
-
-namespace dom {
-
-class InputPort : public DOMEventTargetHelper
-{
-public:
-  NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(InputPort, DOMEventTargetHelper)
-
-  // WebIDL (internal functions)
-  virtual JSObject* WrapObject(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
-
-  void NotifyConnectionChanged(bool aIsConnected);
-
-  // WebIDL (public APIs)
-  void GetId(nsAString& aId) const;
-
-  DOMMediaStream* Stream() const;
-
-  bool Connected() const;
-
-  IMPL_EVENT_HANDLER(connect);
-  IMPL_EVENT_HANDLER(disconnect);
-
-protected:
-  explicit InputPort(nsPIDOMWindowInner* aWindow);
-
-  virtual ~InputPort();
-
-  void Init(nsIInputPortData* aData, nsIInputPortListener* aListener, ErrorResult& aRv);
-  void Shutdown();
-
-  nsString mId;
-  RefPtr<DOMMediaStream> mStream;
-  RefPtr<InputPortListener> mInputPortListener;
-  bool mIsConnected;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_InputPort_h
deleted file mode 100644
--- a/dom/inputport/InputPortData.cpp
+++ /dev/null
@@ -1,113 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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/. */
-
-#include "InputPortData.h"
-#include "nsString.h"
-
-namespace mozilla {
-namespace dom {
-
-namespace {
-
-InputPortType
-ToInputPortType(const nsAString& aStr)
-{
-  if (aStr.EqualsLiteral("av")) {
-    return InputPortType::Av;
-  }
-
-  if (aStr.EqualsLiteral("displayport")) {
-    return InputPortType::Displayport;
-  }
-
-  if (aStr.EqualsLiteral("hdmi")) {
-    return InputPortType::Hdmi;
-  }
-
-  return InputPortType::EndGuard_;
-}
-
-} // namespace
-
-NS_IMPL_ISUPPORTS(InputPortData, nsIInputPortData)
-
-InputPortData::InputPortData()
-  : mIsConnected(false)
-{
-}
-
-InputPortData::~InputPortData()
-{
-}
-
-NS_IMETHODIMP
-InputPortData::GetId(nsAString& aId)
-{
-  aId = mId;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-InputPortData::SetId(const nsAString& aId)
-{
-  if (aId.IsEmpty()) {
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  mId = aId;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-InputPortData::GetType(nsAString& aType)
-{
-  aType = mType;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-InputPortData::SetType(const nsAString& aType)
-{
-  if (aType.IsEmpty()) {
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  if (InputPortType::EndGuard_ == ToInputPortType(aType)) {
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  mType = aType;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-InputPortData::GetConnected(bool* aIsConnected)
-{
-  *aIsConnected = mIsConnected;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-InputPortData::SetConnected(const bool aIsConnected)
-{
-  mIsConnected = aIsConnected;
-  return NS_OK;
-}
-
-const nsString&
-InputPortData::GetId() const
-{
-  return mId;
-}
-
-InputPortType
-InputPortData::GetType() const
-{
-  return ToInputPortType(mType);
-}
-
-} // namespace dom
-} // namespace mozilla
deleted file mode 100644
--- a/dom/inputport/InputPortData.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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_InputPortData_h
-#define mozilla_dom_InputPortData_h
-
-#include "mozilla/dom/InputPortBinding.h"
-#include "nsIInputPortService.h"
-
-class nsString;
-
-namespace mozilla {
-namespace dom {
-
-enum class InputPortType : uint32_t
-{
-  Av,
-  Displayport,
-  Hdmi,
-  EndGuard_
-};
-
-class InputPortData final : public nsIInputPortData
-{
-public:
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIINPUTPORTDATA
-
-  InputPortData();
-
-  const nsString& GetId() const;
-
-  InputPortType GetType() const;
-
-private:
-  ~InputPortData();
-
-  nsString mId;
-  nsString mType;
-  bool mIsConnected;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_InputPortData_h
deleted file mode 100644
--- a/dom/inputport/InputPortListeners.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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/. */
-
-#include "InputPortListeners.h"
-#include "mozilla/dom/InputPort.h"
-
-namespace mozilla {
-namespace dom {
-
-NS_IMPL_CYCLE_COLLECTION(InputPortListener, mInputPorts)
-
-NS_IMPL_CYCLE_COLLECTING_ADDREF(InputPortListener)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(InputPortListener)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(InputPortListener)
-  NS_INTERFACE_MAP_ENTRY(nsIInputPortListener)
-  NS_INTERFACE_MAP_ENTRY(nsISupports)
-NS_INTERFACE_MAP_END
-
-void
-InputPortListener::RegisterInputPort(InputPort* aPort)
-{
-  MOZ_ASSERT(!mInputPorts.Contains(aPort));
-  mInputPorts.AppendElement(aPort);
-}
-
-void
-InputPortListener::UnregisterInputPort(InputPort* aPort)
-{
-  MOZ_ASSERT(mInputPorts.Contains(aPort));
-  mInputPorts.RemoveElement(aPort);
-}
-
-NS_IMETHODIMP
-InputPortListener::NotifyConnectionChanged(const nsAString& aPortId,
-                                           bool aIsConnected)
-{
-  for (uint32_t i = 0; i < mInputPorts.Length(); ++i) {
-    nsString id;
-    mInputPorts[i]->GetId(id);
-    if (aPortId.Equals(id)) {
-      mInputPorts[i]->NotifyConnectionChanged(aIsConnected);
-      break;
-    }
-  }
-
-  return NS_OK;
-}
-
-} // namespace dom
-} // namespace mozilla
deleted file mode 100644
--- a/dom/inputport/InputPortListeners.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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_InputPortListeners_h
-#define mozilla_dom_InputPortListeners_h
-
-#include "nsCycleCollectionParticipant.h"
-#include "nsIInputPortService.h"
-#include "nsTArray.h"
-
-namespace mozilla {
-namespace dom {
-
-class InputPort;
-
-class InputPortListener final : public nsIInputPortListener
-{
-public:
-  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_CLASS(InputPortListener)
-  NS_DECL_NSIINPUTPORTLISTENER
-
-  void RegisterInputPort(InputPort* aPort);
-
-  void UnregisterInputPort(InputPort* aPort);
-
-private:
-  ~InputPortListener() {}
-
-  nsTArray<RefPtr<InputPort>> mInputPorts;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_InputPortListeners_h
deleted file mode 100644
--- a/dom/inputport/InputPortManager.cpp
+++ /dev/null
@@ -1,215 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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/. */
-
-#include "InputPortServiceFactory.h"
-#include "mozilla/dom/InputPort.h"
-#include "mozilla/dom/InputPortManager.h"
-#include "mozilla/dom/InputPortManagerBinding.h"
-#include "mozilla/dom/Promise.h"
-#include "nsArrayUtils.h"
-#include "nsIInputPortService.h"
-
-namespace mozilla {
-namespace dom {
-
-NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(InputPortManager,
-                                      mParent,
-                                      mInputPortService,
-                                      mPendingGetInputPortsPromises,
-                                      mInputPorts)
-
-NS_IMPL_CYCLE_COLLECTING_ADDREF(InputPortManager)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(InputPortManager)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(InputPortManager)
-  NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
-  NS_INTERFACE_MAP_ENTRY(nsISupports)
-  NS_INTERFACE_MAP_ENTRY(nsIInputPortServiceCallback)
-NS_INTERFACE_MAP_END
-
-InputPortManager::InputPortManager(nsPIDOMWindowInner* aWindow)
-  : mParent(aWindow)
-  , mIsReady(false)
-{
-}
-
-InputPortManager::~InputPortManager()
-{
-}
-
-/* static */ already_AddRefed<InputPortManager>
-InputPortManager::Create(nsPIDOMWindowInner* aWindow, ErrorResult& aRv)
-{
-  RefPtr<InputPortManager> manager = new InputPortManager(aWindow);
-  manager->Init(aRv);
-  if (NS_WARN_IF(aRv.Failed())) {
-    return nullptr;
-  }
-  return manager.forget();
-}
-
-void
-InputPortManager::Init(ErrorResult& aRv)
-{
-  mInputPortService = InputPortServiceFactory::AutoCreateInputPortService();
-  if (NS_WARN_IF(!mInputPortService)) {
-    aRv.Throw(NS_ERROR_FAILURE);
-    return;
-  }
-
-  aRv = mInputPortService->GetInputPorts(this);
-  if (NS_WARN_IF(aRv.Failed())) {
-    return;
-  }
-}
-
-nsPIDOMWindowInner*
-InputPortManager::GetParentObject() const
-{
-  return mParent;
-}
-
-JSObject*
-InputPortManager::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
-{
-  return InputPortManagerBinding::Wrap(aCx, this, aGivenProto);
-}
-
-void
-InputPortManager::RejectPendingGetInputPortsPromises(nsresult aRv)
-{
-  // Reject pending promises.
-  uint32_t length = mPendingGetInputPortsPromises.Length();
-  for(uint32_t i = 0; i < length; i++) {
-    mPendingGetInputPortsPromises[i]->MaybeReject(aRv);
-  }
-  mPendingGetInputPortsPromises.Clear();
-}
-
-nsresult
-InputPortManager::SetInputPorts(const nsTArray<RefPtr<InputPort>>& aPorts)
-{
-  MOZ_ASSERT(!mIsReady);
-  // Should be called only when InputPortManager hasn't been ready yet.
-  if (mIsReady) {
-    return NS_ERROR_DOM_INVALID_STATE_ERR;
-  }
-
-  mInputPorts = aPorts;
-  mIsReady = true;
-
-  // Resolve pending promises.
-  uint32_t length = mPendingGetInputPortsPromises.Length();
-  for(uint32_t i = 0; i < length; i++) {
-    mPendingGetInputPortsPromises[i]->MaybeResolve(mInputPorts);
-  }
-  mPendingGetInputPortsPromises.Clear();
-  return NS_OK;
-}
-
-already_AddRefed<Promise>
-InputPortManager::GetInputPorts(ErrorResult& aRv)
-{
-  nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(GetParentObject());
-  MOZ_ASSERT(global);
-
-  RefPtr<Promise> promise = Promise::Create(global, aRv);
-  if (NS_WARN_IF(aRv.Failed())) {
-    return nullptr;
-  }
-
-  if (mIsReady) {
-    promise->MaybeResolve(mInputPorts);
-  } else {
-    mPendingGetInputPortsPromises.AppendElement(promise);
-  }
-
-  return promise.forget();
-}
-
-NS_IMETHODIMP
-InputPortManager::NotifySuccess(nsIArray* aDataList)
-{
-  MOZ_ASSERT(aDataList);
-
-  if (!aDataList) {
-    RejectPendingGetInputPortsPromises(NS_ERROR_DOM_ABORT_ERR);
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  uint32_t length;
-  nsresult rv = aDataList->GetLength(&length);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return rv;
-  }
-
-  nsCOMPtr<nsIInputPortListener> portListener;
-  rv = mInputPortService->GetInputPortListener(
-    getter_AddRefs(portListener));
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return rv;
-  }
-
-  ErrorResult erv;
-  nsTArray<RefPtr<InputPort>> ports(length);
-  for (uint32_t i = 0; i < length; i++) {
-    nsCOMPtr<nsIInputPortData> portData = do_QueryElementAt(aDataList, i);
-    if (NS_WARN_IF(!portData)) {
-      continue;
-    }
-
-    InputPortData* data = static_cast<InputPortData*>(portData.get());
-    RefPtr<InputPort> port;
-    switch (data->GetType()) {
-    case InputPortType::Av:
-      port = AVInputPort::Create(GetParentObject(), portListener,
-                                 portData, erv);
-      break;
-    case InputPortType::Displayport:
-      port = DisplayPortInputPort::Create(GetParentObject(),
-                                          portListener, portData, erv);
-      break;
-    case InputPortType::Hdmi:
-      port = HDMIInputPort::Create(GetParentObject(), portListener,
-                                   portData, erv);
-      break;
-    default:
-      MOZ_ASSERT_UNREACHABLE("Unknown InputPort type");
-      break;
-    }
-    MOZ_ASSERT(port);
-
-    ports.AppendElement(port);
-  }
-
-  if (NS_WARN_IF(erv.Failed())) {
-    return erv.StealNSResult();
-  }
-
-  erv = SetInputPorts(ports);
-
-  return erv.StealNSResult();
-}
-
-NS_IMETHODIMP
-InputPortManager::NotifyError(uint16_t aErrorCode)
-{
-  switch (aErrorCode) {
-  case nsIInputPortServiceCallback::INPUTPORT_ERROR_FAILURE:
-  case nsIInputPortServiceCallback::INPUTPORT_ERROR_INVALID_ARG:
-    RejectPendingGetInputPortsPromises(NS_ERROR_DOM_ABORT_ERR);
-    return NS_OK;
-  case nsIInputPortServiceCallback::INPUTPORT_ERROR_NOT_SUPPORTED:
-    RejectPendingGetInputPortsPromises(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
-    return NS_OK;
-  }
-
-  RejectPendingGetInputPortsPromises(NS_ERROR_DOM_ABORT_ERR);
-  return NS_ERROR_ILLEGAL_VALUE;
-}
-
-} // namespace dom
-} // namespace mozilla
deleted file mode 100644
--- a/dom/inputport/InputPortManager.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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_InputPortManager_h
-#define mozilla_dom_InputPortManager_h
-
-#include "nsIInputPortService.h"
-#include "nsISupports.h"
-#include "nsWrapperCache.h"
-
-class nsIInputPortService;
-class nsPIDOMWindowInner;
-
-namespace mozilla {
-namespace dom {
-
-class Promise;
-class InputPort;
-
-class InputPortManager final : public nsIInputPortServiceCallback,
-                               public nsWrapperCache
-{
-public:
-  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(InputPortManager)
-  NS_DECL_NSIINPUTPORTSERVICECALLBACK
-
-  static already_AddRefed<InputPortManager>
-  Create(nsPIDOMWindowInner* aWindow, ErrorResult& aRv);
-
-  // WebIDL (internal functions)
-  nsPIDOMWindowInner* GetParentObject() const;
-
-  virtual JSObject* WrapObject(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
-
-  // WebIDL (public APIs)
-  already_AddRefed<Promise> GetInputPorts(ErrorResult& aRv);
-
-private:
-  explicit InputPortManager(nsPIDOMWindowInner* aWindow);
-
-  ~InputPortManager();
-
-  void Init(ErrorResult& aRv);
-
-  void RejectPendingGetInputPortsPromises(nsresult aRv);
-
-  nsresult SetInputPorts(const nsTArray<RefPtr<InputPort>>& aPorts);
-
-  nsTArray<RefPtr<Promise>> mPendingGetInputPortsPromises;
-  nsTArray<RefPtr<InputPort>> mInputPorts;
-  nsCOMPtr<nsPIDOMWindowInner> mParent;
-  nsCOMPtr<nsIInputPortService> mInputPortService;
-  bool mIsReady;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_InputPortManager_h__
deleted file mode 100644
--- a/dom/inputport/InputPortServiceFactory.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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/. */
-
-#include "FakeInputPortService.h"
-#include "InputPortListeners.h"
-#include "InputPortServiceFactory.h"
-#include "mozilla/Preferences.h"
-#include "nsIInputPortService.h"
-#include "nsServiceManagerUtils.h"
-
-namespace mozilla {
-namespace dom {
-
-/* static */ already_AddRefed<FakeInputPortService>
-InputPortServiceFactory::CreateFakeInputPortService()
-{
-  RefPtr<FakeInputPortService> service = new FakeInputPortService();
-  return service.forget();
-}
-
-/* static */ already_AddRefed<nsIInputPortService>
-InputPortServiceFactory::AutoCreateInputPortService()
-{
-  nsresult rv;
-  nsCOMPtr<nsIInputPortService> service =
-    do_GetService(INPUTPORT_SERVICE_CONTRACTID);
-  if (!service) {
-    // Fallback to the fake service.
-    service = do_GetService(FAKE_INPUTPORT_SERVICE_CONTRACTID, &rv);
-    if (NS_WARN_IF(NS_FAILED(rv))) {
-      return nullptr;
-    }
-  }
-  MOZ_ASSERT(service);
-  rv = service->SetInputPortListener(new InputPortListener());
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return nullptr;
-  }
-
-  return service.forget();
-}
-
-} // namespace dom
-} // namespace mozilla
deleted file mode 100644
--- a/dom/inputport/InputPortServiceFactory.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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_InputPortServiceFactory_h
-#define mozilla_dom_InputPortServiceFactory_h
-
-#include "nsCOMPtr.h"
-
-class nsIInputPortService;
-
-namespace mozilla {
-namespace dom {
-
-class FakeInputPortService;
-
-class InputPortServiceFactory final
-{
-public:
-  static already_AddRefed<FakeInputPortService> CreateFakeInputPortService();
-
-  static already_AddRefed<nsIInputPortService> AutoCreateInputPortService();
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_InputPortServiceFactory_h
deleted file mode 100644
--- a/dom/inputport/moz.build
+++ /dev/null
@@ -1,46 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# 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/.
-
-EXPORTS.mozilla.dom += [
-    'AVInputPort.h',
-    'DisplayPortInputPort.h',
-    'HDMIInputPort.h',
-    'InputPort.h',
-    'InputPortManager.h',
-]
-
-EXPORTS += [
-    'FakeInputPortService.h',
-    'InputPortData.h',
-    'InputPortListeners.h',
-    'InputPortServiceFactory.h',
-]
-
-UNIFIED_SOURCES += [
-    'AVInputPort.cpp',
-    'DisplayPortInputPort.cpp',
-    'FakeInputPortService.cpp',
-    'HDMIInputPort.cpp',
-    'InputPort.cpp',
-    'InputPortData.cpp',
-    'InputPortListeners.cpp',
-    'InputPortManager.cpp',
-    'InputPortServiceFactory.cpp',
-]
-
-XPIDL_SOURCES += [
-    'nsIInputPortService.idl',
-]
-
-XPIDL_MODULE = 'dom_inputport'
-
-MOCHITEST_MANIFESTS += ['test/mochitest/mochitest.ini']
-
-XPCSHELL_TESTS_MANIFESTS += ['test/xpcshell/xpcshell.ini']
-
-include('/ipc/chromium/chromium-config.mozbuild')
-
-FINAL_LIBRARY = 'xul'
deleted file mode 100644
--- a/dom/inputport/nsIInputPortService.idl
+++ /dev/null
@@ -1,75 +0,0 @@
-/* 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 nsIArray;
-
-%{C++
-#define INPUTPORT_DATA_CID \
-  { 0x90b192d1, 0x357a, 0x4793, { 0xab, 0x58, 0x04, 0xee, 0x21, 0x62, 0x27, 0xda } }
-#define INPUTPORT_DATA_CONTRACTID \
-  "@mozilla.org/inputport/inputportdata;1"
-%}
-
-/**
- * XPCOM component which acts as the container for input port data.
- */
-[scriptable, builtinclass, uuid(244a2b1d-aa1f-4188-a639-ddb56c554b6d)]
-interface nsIInputPortData : nsISupports
-{
-  attribute DOMString id;
-  attribute DOMString type;
-  attribute boolean connected;
-};
-
-[builtinclass, uuid(32a62e7c-f698-4846-81f7-617c87854d32)]
-interface nsIInputPortListener : nsISupports
-{
-  void notifyConnectionChanged(in DOMString portId,
-                               in boolean isConnected);
-};
-
-[builtinclass, uuid(c2a47757-25f6-4bc8-bd27-c23af2d87381)]
-interface nsIInputPortServiceCallback : nsISupports
-{
-  const unsigned short INPUTPORT_ERROR_OK = 0;
-  const unsigned short INPUTPORT_ERROR_FAILURE = 1;
-  const unsigned short INPUTPORT_ERROR_INVALID_ARG = 2;
-  const unsigned short INPUTPORT_ERROR_NOT_SUPPORTED = 3;
-
-  /**
-   * Called when something wrong happens.
-   *
-   * @param errorCode Error code listed above from the underlying layer.
-   */
-  void notifyError(in unsigned short errorCode);
-
-  /**
-   * Called when the operation succeeds.
-   *
-   * @param dataList A list of data.
-   *                 An array of |nsIInputPortData| when used for |getInputPorts()|.
-   *
-   * NOTE: |nsIArray| is adopted to prevent this interface from being split into
-   * multiple interfaces with different |notifySuccess|. Though the
-   * implementation of TV service may need |nsIMutableArray| to fill in the
-   * array, it doesn't seem necessary for other places to use the mutable one.
-   */
-  void notifySuccess([optional] in nsIArray dataList);
-};
-
-
-%{C++
-#define INPUTPORT_SERVICE_CONTRACTID \
-  "@mozilla.org/inputport/inputportservice;1"
-%}
-
-[uuid(6214dae0-840e-11e4-b4a9-0800200c9a66)]
-interface nsIInputPortService : nsISupports
-{
-  attribute nsIInputPortListener inputPortListener;
-
-  void getInputPorts(in nsIInputPortServiceCallback callback);
-};
deleted file mode 100644
--- a/dom/inputport/test/mochitest/mochitest.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[DEFAULT]
-skip-if = buildapp != 'b2g'
-
-[test_inputport_get_inputports.html]
-[test_inputport_connection_event.html]
\ No newline at end of file
deleted file mode 100644
--- a/dom/inputport/test/mochitest/test_inputport_connection_event.html
+++ /dev/null
@@ -1,72 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=1026350
--->
-<head>
-<meta charset="utf-8">
-<title>Test Inputport Connection Event</title>
-<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1026350">Test Inputport Connection Event
-</a>
-<script type="application/javascript;version=1.8">
-
-'use strict';
-
-SimpleTest.waitForExplicitFinish();
-
-function testInputportConnectionEvent() {
-  return new Promise(function(resolve, reject) {
-    var inputPortMgr = navigator.inputPortManager;
-    inputPortMgr.getInputPorts().then(
-      function(aPorts) {
-        ok(aPorts.length > 0, "Got at least 1 inputport.");
-        var port0 = aPorts[0];
-        var port0_isConnected = port0.connected;
-        port0.onconnect = function(aEvent) {
-          var port = aEvent.target;
-          is(port.id, port0.id, "The inputport ID should be the same");
-          ok(port.connected, "The connected value matches the connect evnet purpose");
-          is(port.connected, !port0_isConnected, "The connected value should change");
-          resolve();
-        }
-        port0.ondisconnect = function (aEvent) {
-          var port = aEvent.target;
-          is(port.id, port0.id, "The inputport ID should be the same");
-          ok(!port.connected, "The connected value matches the disconnect evnet purpose");
-          is(port.connected, !port0_isConnected, "The connected value should change");
-          resolve();
-        }
-      },
-      function(aError) {
-        ok(false, "Fail to get input ports: " + aError);
-        resolve();
-      }
-    );
-  });
-}
-
-function runTest() {
-  ok(navigator.inputPortManager, 'should have navigator.inputPortManager');
-
-  testInputportConnectionEvent()
-  .then(function() {
-    info('test finished');
-    SimpleTest.finish();
-  });
-}
-
-SpecialPowers.pushPrefEnv({"set": [["dom.inputport.enabled", true],
-                                    //to ignore app scope check.
-                                   ["dom.ignore_webidl_scope_checks", true]]}, function() {
-  SpecialPowers.pushPermissions(
-    [{'type': 'inputport', 'allow': true, 'context': document}], runTest);
-});
-
- </script>
- </pre>
- </body>
- </html>
deleted file mode 100644
--- a/dom/inputport/test/mochitest/test_inputport_get_inputports.html
+++ /dev/null
@@ -1,63 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=1026350
--->
-<head>
-<meta charset="utf-8">
-<title>Inputport API Test</title>
-<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1026350">Test Inputport API</a>
-<script type="application/javascript;version=1.8">
-
-'use strict';
-
-SimpleTest.waitForExplicitFinish();
-
-function testGetInputports() {
-  return new Promise(function(resolve, reject) {
-    var inputPortMgr = navigator.inputPortManager;
-    inputPortMgr.getInputPorts().then(
-      function(aPorts) {
-        ok(aPorts.length > 0, "Got at least 1 inputport.");
-        for (var i=0; i < aPorts.length; ++i) {
-          var port = aPorts[i];
-          ok(port instanceof InputPort, "Inputport " + i + " should be in the right type.");
-          ok('id' in port, "Inputport " + i + " should have an ID.");
-          ok('connected' in port, "Inputport " + i + " should have a connected property.");
-          ok(port.stream, "Inputport " + i + " should have non null stream.");
-          resolve();
-        }
-      },
-      function(aError) {
-        ok(false, "Fail to get input ports: " + aError);
-        resolve();
-      }
-    );
-  });
-}
-
-function runTest() {
-  ok(navigator.inputPortManager, 'should have navigator.inputPortManager');
-
-  testGetInputports()
-  .then(function() {
-    info('test finished');
-    SimpleTest.finish();
-  });
-}
-
-SpecialPowers.pushPrefEnv({"set": [["dom.inputport.enabled", true],
-                                    //to ignore app scope check.
-                                   ["dom.ignore_webidl_scope_checks", true]]}, function() {
-  SpecialPowers.pushPermissions(
-    [{'type': 'inputport', 'allow': true, 'context': document}], runTest);
-});
-
- </script>
- </pre>
- </body>
- </html>
deleted file mode 100644
--- a/dom/inputport/test/xpcshell/test_inputport_data.js
+++ /dev/null
@@ -1,61 +0,0 @@
-"use strict";
-
-var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
-
-function run_test() {
-  run_next_test();
-}
-
-add_test(function test_valid_inputport_id() {
-  var inputportId = "inputportId";
-
-  var data = Cc["@mozilla.org/inputport/inputportdata;1"].
-             createInstance(Ci.nsIInputPortData);
-  data.id = inputportId;
-
-  equal(data.id, inputportId);
-
-  run_next_test();
-});
-
-add_test(function test_empty_inputport_id() {
-  var data = Cc["@mozilla.org/inputport/inputportdata;1"].
-             createInstance(Ci.nsIInputPortData);
-  Assert.throws(function() {
-    data.id = "";
-  }, /NS_ERROR_ILLEGAL_VALUE/i);
-
-  run_next_test();
-});
-
-add_test(function test_valid_type() {
-  var  inputportType = "hdmi";
-
-  var data = Cc["@mozilla.org/inputport/inputportdata;1"].
-             createInstance(Ci.nsIInputPortData);
-  data.type = inputportType;
-
-  equal(data.type, inputportType);
-
-  run_next_test();
-});
-
-add_test(function test_empty_type() {
-  var data = Cc["@mozilla.org/inputport/inputportdata;1"].
-             createInstance(Ci.nsIInputPortData);
-  Assert.throws(function() {
-    data.type = "";
-  }, /NS_ERROR_ILLEGAL_VALUE/i);
-
-  run_next_test();
-});
-
-add_test(function test_is_connected() {
-  var data = Cc["@mozilla.org/inputport/inputportdata;1"].
-             createInstance(Ci.nsIInputPortData);
-  data.connected = true;
-
-  ok(data.connected);
-
-  run_next_test();
-});
deleted file mode 100644
--- a/dom/inputport/test/xpcshell/xpcshell.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[DEFAULT]
-skip-if = buildapp != 'b2g'
-head =
-tail =
-
-[test_inputport_data.js]
\ No newline at end of file
--- a/dom/moz.build
+++ b/dom/moz.build
@@ -53,17 +53,16 @@ DIRS += [
     'fetch',
     'filehandle',
     'filesystem',
     'flyweb',
     'gamepad',
     'geolocation',
     'grid',
     'html',
-    'inputport',
     'json',
     'jsurl',
     'asmjscache',
     'mathml',
     'media',
     'notification',
     'offline',
     'power',
deleted file mode 100644
--- a/dom/webidl/AVInputPort.webidl
+++ /dev/null
@@ -1,9 +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/.
- */
-
-[Pref="dom.inputport.enabled", ChromeOnly]
- interface AVInputPort : InputPort {
- };
deleted file mode 100644
--- a/dom/webidl/DisplayPortInputPort.webidl
+++ /dev/null
@@ -1,9 +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/.
- */
-
-[Pref="dom.inputport.enabled", ChromeOnly]
- interface DisplayPortInputPort : InputPort {
- };
deleted file mode 100644
--- a/dom/webidl/HDMIInputPort.webidl
+++ /dev/null
@@ -1,9 +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/.
- */
-
-[Pref="dom.inputport.enabled", ChromeOnly]
- interface HDMIInputPort : InputPort {
- };
deleted file mode 100644
--- a/dom/webidl/InputPort.webidl
+++ /dev/null
@@ -1,16 +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/.
- *
- * Reference https://wiki.mozilla.org/Input_Port_API#Basic_Port_Interface
- */
-
-[Pref="dom.inputport.enabled", ChromeOnly]
-interface InputPort : EventTarget {
-  readonly attribute DOMString id;
-  readonly attribute MediaStream stream;
-  readonly attribute boolean connected;
-  attribute EventHandler onconnect;
-  attribute EventHandler ondisconnect;
-};
deleted file mode 100644
--- a/dom/webidl/InputPortManager.webidl
+++ /dev/null
@@ -1,13 +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/.
- *
- * Reference https://wiki.mozilla.org/Input_Port_API#InputPortManager
- */
-
-[Pref="dom.inputport.enabled", ChromeOnly]
- interface InputPortManager {
-   [Throws]
-   Promise<sequence<InputPort>> getInputPorts();
- };
--- a/dom/webidl/Navigator.webidl
+++ b/dom/webidl/Navigator.webidl
@@ -349,21 +349,16 @@ partial interface Navigator {
 
 partial interface Navigator {
   [Throws, Pref="beacon.enabled"]
   boolean sendBeacon(DOMString url,
                      optional (ArrayBufferView or Blob or DOMString or FormData)? data = null);
 };
 
 partial interface Navigator {
-  [Throws, Pref="dom.inputport.enabled", ChromeOnly]
-  readonly attribute InputPortManager inputPortManager;
-};
-
-partial interface Navigator {
   [Throws, Pref="dom.presentation.enabled", SameObject]
   readonly attribute Presentation? presentation;
 };
 
 partial interface Navigator {
   [NewObject, Func="mozilla::dom::TCPSocket::ShouldTCPSocketExist"]
   readonly attribute LegacyMozTCPSocket mozTCPSocket;
 };
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -42,17 +42,16 @@ WEBIDL_FILES = [
     'AudioListener.webidl',
     'AudioNode.webidl',
     'AudioParam.webidl',
     'AudioProcessingEvent.webidl',
     'AudioStreamTrack.webidl',
     'AudioTrack.webidl',
     'AudioTrackList.webidl',
     'AutocompleteInfo.webidl',
-    'AVInputPort.webidl',
     'BarProp.webidl',
     'BaseKeyframeTypes.webidl',
     'BatteryManager.webidl',
     'BeforeAfterKeyboardEvent.webidl',
     'BeforeUnloadEvent.webidl',
     'BiquadFilterNode.webidl',
     'Blob.webidl',
     'BoxObject.webidl',
@@ -108,17 +107,16 @@ WEBIDL_FILES = [
     'DecoderDoctorNotification.webidl',
     'DedicatedWorkerGlobalScope.webidl',
     'DelayNode.webidl',
     'DesktopNotification.webidl',
     'DeviceMotionEvent.webidl',
     'DeviceStorage.webidl',
     'DeviceStorageAreaListener.webidl',
     'Directory.webidl',
-    'DisplayPortInputPort.webidl',
     'Document.webidl',
     'DocumentFragment.webidl',
     'DocumentTimeline.webidl',
     'DocumentType.webidl',
     'DOMCursor.webidl',
     'DOMError.webidl',
     'DOMException.webidl',
     'DOMImplementation.webidl',
@@ -167,17 +165,16 @@ WEBIDL_FILES = [
     'FontFaceSource.webidl',
     'FormData.webidl',
     'Function.webidl',
     'GainNode.webidl',
     'Geolocation.webidl',
     'GeometryUtils.webidl',
     'GetUserMediaRequest.webidl',
     'Grid.webidl',
-    'HDMIInputPort.webidl',
     'Headers.webidl',
     'HeapSnapshot.webidl',
     'History.webidl',
     'HTMLAllCollection.webidl',
     'HTMLAnchorElement.webidl',
     'HTMLAppletElement.webidl',
     'HTMLAreaElement.webidl',
     'HTMLAudioElement.webidl',
@@ -270,18 +267,16 @@ WEBIDL_FILES = [
     'IIRFilterNode.webidl',
     'ImageBitmap.webidl',
     'ImageBitmapRenderingContext.webidl',
     'ImageCapture.webidl',
     'ImageData.webidl',
     'ImageDocument.webidl',
     'InputEvent.webidl',
     'InputMethod.webidl',
-    'InputPort.webidl',
-    'InputPortManager.webidl',
     'InspectorUtils.webidl',
     'IntersectionObserver.webidl',
     'IterableIterator.webidl',
     'KeyAlgorithm.webidl',
     'KeyboardEvent.webidl',
     'KeyEvent.webidl',
     'KeyframeAnimationOptions.webidl',
     'KeyframeEffect.webidl',
--- a/layout/build/nsLayoutModule.cpp
+++ b/layout/build/nsLayoutModule.cpp
@@ -196,21 +196,16 @@ static void Shutdown();
 #include "mozilla/dom/FlyWebService.h"
 
 #include "mozilla/dom/power/PowerManagerService.h"
 #include "mozilla/dom/time/TimeService.h"
 #include "StreamingProtocolService.h"
 
 #include "nsIPresentationService.h"
 
-#include "FakeInputPortService.h"
-#include "InputPortData.h"
-#include "InputPortServiceFactory.h"
-#include "nsIInputPortService.h"
-
 #ifdef MOZ_WIDGET_GONK
 #include "GonkGPSGeolocationProvider.h"
 #endif
 #include "MediaManager.h"
 
 #include "GMPService.h"
 
 #include "mozilla/dom/PresentationDeviceManager.h"
@@ -335,19 +330,16 @@ NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR
 // we need it to be constructed sometime after nsIPowerManagerService.
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsVolumeService,
                                          nsVolumeService::GetSingleton)
 #endif
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIMediaManagerService,
                                          MediaManager::GetInstance)
 NS_GENERIC_FACTORY_CONSTRUCTOR(PresentationDeviceManager)
 NS_GENERIC_FACTORY_CONSTRUCTOR(TextInputProcessor)
-NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(FakeInputPortService,
-                                         InputPortServiceFactory::CreateFakeInputPortService)
-NS_GENERIC_FACTORY_CONSTRUCTOR(InputPortData)
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIPresentationService,
                                          NS_CreatePresentationService)
 NS_GENERIC_FACTORY_CONSTRUCTOR(PresentationTCPSessionTransport)
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(NotificationTelemetryService, Init)
 NS_GENERIC_FACTORY_CONSTRUCTOR(PushNotifier)
 
 //-----------------------------------------------------------------------------
 
@@ -783,19 +775,16 @@ NS_DEFINE_NAMED_CID(NS_POCKETSPHINX_SPEE
 #ifdef MOZ_WEBSPEECH
 NS_DEFINE_NAMED_CID(NS_SYNTHVOICEREGISTRY_CID);
 #endif
 
 #ifdef ACCESSIBILITY
 NS_DEFINE_NAMED_CID(NS_ACCESSIBILITY_SERVICE_CID);
 #endif
 
-NS_DEFINE_NAMED_CID(FAKE_INPUTPORT_SERVICE_CID);
-NS_DEFINE_NAMED_CID(INPUTPORT_DATA_CID);
-
 NS_DEFINE_NAMED_CID(GECKO_MEDIA_PLUGIN_SERVICE_CID);
 
 NS_DEFINE_NAMED_CID(PRESENTATION_SERVICE_CID);
 NS_DEFINE_NAMED_CID(PRESENTATION_DEVICE_MANAGER_CID);
 NS_DEFINE_NAMED_CID(PRESENTATION_TCP_SESSION_TRANSPORT_CID);
 
 NS_DEFINE_NAMED_CID(TEXT_INPUT_PROCESSOR_CID);
 
@@ -1069,18 +1058,16 @@ static const mozilla::Module::CIDEntry k
   { &kNS_MEDIAMANAGERSERVICE_CID, false, nullptr, nsIMediaManagerServiceConstructor },
 #ifdef ACCESSIBILITY
   { &kNS_ACCESSIBILITY_SERVICE_CID, false, nullptr, CreateA11yService },
 #endif
   { &kPRESENTATION_SERVICE_CID, false, nullptr, nsIPresentationServiceConstructor },
   { &kPRESENTATION_DEVICE_MANAGER_CID, false, nullptr, PresentationDeviceManagerConstructor },
   { &kPRESENTATION_TCP_SESSION_TRANSPORT_CID, false, nullptr, PresentationTCPSessionTransportConstructor },
   { &kTEXT_INPUT_PROCESSOR_CID, false, nullptr, TextInputProcessorConstructor },
-  { &kFAKE_INPUTPORT_SERVICE_CID, false, nullptr, FakeInputPortServiceConstructor },
-  { &kINPUTPORT_DATA_CID, false, nullptr, InputPortDataConstructor },
 #ifdef MOZ_B2G
   { &kNS_HARDWARE_KEY_HANDLER_CID, false, nullptr, nsIHardwareKeyHandlerConstructor },
 #endif
   { nullptr }
 };
 
 static const mozilla::Module::ContractIDEntry kLayoutContracts[] = {
   XPCONNECT_CONTRACTS
@@ -1218,18 +1205,16 @@ static const mozilla::Module::ContractID
   { "@mozilla.org/accessibilityService;1", &kNS_ACCESSIBILITY_SERVICE_CID },
   { "@mozilla.org/accessibleRetrieval;1", &kNS_ACCESSIBILITY_SERVICE_CID },
 #endif
   { "@mozilla.org/gecko-media-plugin-service;1",  &kGECKO_MEDIA_PLUGIN_SERVICE_CID },
   { PRESENTATION_SERVICE_CONTRACTID, &kPRESENTATION_SERVICE_CID },
   { PRESENTATION_DEVICE_MANAGER_CONTRACTID, &kPRESENTATION_DEVICE_MANAGER_CID },
   { PRESENTATION_TCP_SESSION_TRANSPORT_CONTRACTID, &kPRESENTATION_TCP_SESSION_TRANSPORT_CID },
   { "@mozilla.org/text-input-processor;1", &kTEXT_INPUT_PROCESSOR_CID },
-  { FAKE_INPUTPORT_SERVICE_CONTRACTID, &kFAKE_INPUTPORT_SERVICE_CID },
-  { INPUTPORT_DATA_CONTRACTID, &kINPUTPORT_DATA_CID },
 #ifdef MOZ_B2G
   { NS_HARDWARE_KEY_HANDLER_CONTRACTID, &kNS_HARDWARE_KEY_HANDLER_CID },
 #endif
   { nullptr }
 };
 
 static const mozilla::Module::CategoryEntry kLayoutCategories[] = {
   XPCONNECT_CATEGORIES