Bug 1299493 - Remove Navigator.get/hasFeature(); r=baku
authorEhsan Akhgari <ehsan@mozilla.com>
Wed, 31 Aug 2016 12:04:23 -0400
changeset 353425 13fa37287020756d516179d333c97d2125d3e9a9
parent 353424 4585f2f66645a64533ec7d95f0e008add35e5197
child 353426 659772c16de7e305134440a8ab9a0a30d37f3873
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1299493
milestone51.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1299493 - Remove Navigator.get/hasFeature(); r=baku
dom/base/Navigator.cpp
dom/base/Navigator.h
dom/base/test/chrome.ini
dom/base/test/test_getFeature_with_perm.html
dom/base/test/test_hasFeature.html
dom/ipc/ContentChild.cpp
dom/ipc/ContentChild.h
dom/ipc/ContentParent.cpp
dom/ipc/ContentParent.h
dom/ipc/PContent.ipdl
dom/webidl/Navigator.webidl
hal/Hal.cpp
hal/Hal.h
hal/fallback/FallbackMemory.cpp
hal/linux/LinuxMemory.cpp
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -115,20 +115,16 @@
 #endif
 #include "mozilla/dom/ContentChild.h"
 
 #ifdef MOZ_EME
 #include "mozilla/EMEUtils.h"
 #include "mozilla/DetailedPromise.h"
 #endif
 
-#ifdef MOZ_WIDGET_GONK
-#include <cutils/properties.h>
-#endif
-
 namespace mozilla {
 namespace dom {
 
 static bool sVibratorEnabled   = false;
 static uint32_t sMaxVibrateMS  = 0;
 static uint32_t sMaxVibrateListLen = 0;
 static const char* kVibrationPermissionType = "vibration";
 
@@ -1634,167 +1630,16 @@ Navigator::PublishServer(const nsAString
                    },
                    [domPromise] (nsresult aStatus) {
                      domPromise->MaybeReject(aStatus);
                    });
 
   return domPromise.forget();
 }
 
-already_AddRefed<Promise>
-Navigator::GetFeature(const nsAString& aName, ErrorResult& aRv)
-{
-  nsCOMPtr<nsIGlobalObject> go = do_QueryInterface(mWindow);
-  RefPtr<Promise> p = Promise::Create(go, aRv);
-  if (aRv.Failed()) {
-    return nullptr;
-  }
-
-#if defined(XP_LINUX)
-  if (aName.EqualsLiteral("hardware.memory")) {
-    // with seccomp enabled, fopen() should be in a non-sandboxed process
-    if (XRE_IsParentProcess()) {
-      uint32_t memLevel = mozilla::hal::GetTotalSystemMemoryLevel();
-      if (memLevel == 0) {
-        p->MaybeReject(NS_ERROR_NOT_AVAILABLE);
-        return p.forget();
-      }
-      p->MaybeResolve((int)memLevel);
-    } else {
-      mozilla::dom::ContentChild* cc =
-        mozilla::dom::ContentChild::GetSingleton();
-      RefPtr<Promise> ipcRef(p);
-      cc->SendGetSystemMemory(reinterpret_cast<uint64_t>(ipcRef.forget().take()));
-    }
-    return p.forget();
-  } // hardware.memory
-#endif
-
-#ifdef MOZ_WIDGET_GONK
-  if (StringBeginsWith(aName, NS_LITERAL_STRING("acl.")) &&
-      (aName.EqualsLiteral("acl.version") || CheckPermission("external-app"))) {
-    char value[PROPERTY_VALUE_MAX];
-    nsCString propertyKey("persist.");
-    propertyKey.Append(NS_ConvertUTF16toUTF8(aName));
-    uint32_t len = property_get(propertyKey.get(), value, nullptr);
-    if (len > 0) {
-      p->MaybeResolve(NS_ConvertUTF8toUTF16(value));
-      return p.forget();
-    }
-  }
-#endif
-
-  // Mirror the dom.apps.developer_mode pref to let apps get it read-only.
-  if (aName.EqualsLiteral("dom.apps.developer_mode")) {
-    p->MaybeResolve(Preferences::GetBool("dom.apps.developer_mode", false));
-    return p.forget();
-  }
-
-  p->MaybeResolveWithUndefined();
-  return p.forget();
-}
-
-already_AddRefed<Promise>
-Navigator::HasFeature(const nsAString& aName, ErrorResult& aRv)
-{
-  nsCOMPtr<nsIGlobalObject> go = do_QueryInterface(mWindow);
-  RefPtr<Promise> p = Promise::Create(go, aRv);
-  if (aRv.Failed()) {
-    return nullptr;
-  }
-
-  // Hardcoded extensions features which are b2g specific.
-#ifdef MOZ_B2G
-  if (aName.EqualsLiteral("web-extensions") ||
-      aName.EqualsLiteral("late-customization")) {
-    p->MaybeResolve(true);
-    return p.forget();
-  }
-#endif
-
-  // Hardcoded manifest features. Some are still b2g specific.
-  const char manifestFeatures[][64] = {
-    "manifest.origin"
-  , "manifest.redirects"
-#ifdef MOZ_B2G
-  , "manifest.chrome.navigation"
-  , "manifest.precompile"
-  , "manifest.role.homescreen"
-#endif
-  };
-
-  nsAutoCString feature = NS_ConvertUTF16toUTF8(aName);
-  for (uint32_t i = 0; i < MOZ_ARRAY_LENGTH(manifestFeatures); i++) {
-    if (feature.Equals(manifestFeatures[i])) {
-      p->MaybeResolve(true);
-      return p.forget();
-    }
-  }
-
-  NS_NAMED_LITERAL_STRING(apiWindowPrefix, "api.window.");
-  if (StringBeginsWith(aName, apiWindowPrefix)) {
-    const nsAString& featureName = Substring(aName, apiWindowPrefix.Length());
-
-    // Temporary hardcoded entry points due to technical constraints
-    if (featureName.EqualsLiteral("Navigator.mozTCPSocket")) {
-      p->MaybeResolve(Preferences::GetBool("dom.mozTCPSocket.enabled"));
-      return p.forget();
-    }
-
-    if (featureName.EqualsLiteral("Navigator.mozMobileConnections") ||
-        featureName.EqualsLiteral("MozMobileNetworkInfo")) {
-      p->MaybeResolve(Preferences::GetBool("dom.mobileconnection.enabled"));
-      return p.forget();
-    }
-
-    if (featureName.EqualsLiteral("Navigator.mozInputMethod")) {
-      p->MaybeResolve(Preferences::GetBool("dom.mozInputMethod.enabled"));
-      return p.forget();
-    }
-
-    if (featureName.EqualsLiteral("Navigator.getDeviceStorage")) {
-      p->MaybeResolve(Preferences::GetBool("device.storage.enabled"));
-      return p.forget();
-    }
-
-    if (featureName.EqualsLiteral("Navigator.mozNetworkStats")) {
-      p->MaybeResolve(Preferences::GetBool("dom.mozNetworkStats.enabled"));
-      return p.forget();
-    }
-
-    if (featureName.EqualsLiteral("Navigator.push")) {
-      p->MaybeResolve(Preferences::GetBool("services.push.enabled"));
-      return p.forget();
-    }
-
-    if (featureName.EqualsLiteral("Navigator.mozAlarms")) {
-      p->MaybeResolve(Preferences::GetBool("dom.mozAlarms.enabled"));
-      return p.forget();
-    }
-
-    if (featureName.EqualsLiteral("Navigator.mozCameras")) {
-      p->MaybeResolve(true);
-      return p.forget();
-    }
-
-    if (featureName.EqualsLiteral("XMLHttpRequest.mozSystem")) {
-      p->MaybeResolve(true);
-      return p.forget();
-    }
-
-    p->MaybeResolveWithUndefined();
-    return p.forget();
-  }
-
-  // resolve with <undefined> because the feature name is not supported
-  p->MaybeResolveWithUndefined();
-
-  return p.forget();
-}
-
 PowerManager*
 Navigator::GetMozPower(ErrorResult& aRv)
 {
   if (!mPowerManager) {
     if (!mWindow) {
       aRv.Throw(NS_ERROR_UNEXPECTED);
       return nullptr;
     }
--- a/dom/base/Navigator.h
+++ b/dom/base/Navigator.h
@@ -180,23 +180,16 @@ public:
                                nsIURI* aURI,
                                bool aIsCallerChrome,
                                nsAString& aUserAgent);
 
   // Clears the user agent cache by calling:
   // NavigatorBinding::ClearCachedUserAgentValue(this);
   void ClearUserAgentCache();
 
-  // Feature Detection API
-  already_AddRefed<Promise> GetFeature(const nsAString& aName,
-                                       ErrorResult& aRv);
-
-  already_AddRefed<Promise> HasFeature(const nsAString &aName,
-                                       ErrorResult& aRv);
-
   bool Vibrate(uint32_t aDuration);
   bool Vibrate(const nsTArray<uint32_t>& aDuration);
   void SetVibrationPermission(bool aPermitted, bool aPersistent);
   uint32_t MaxTouchPoints();
   void GetAppCodeName(nsString& aAppCodeName, ErrorResult& aRv)
   {
     aRv = GetAppCodeName(aAppCodeName);
   }
--- a/dom/base/test/chrome.ini
+++ b/dom/base/test/chrome.ini
@@ -21,11 +21,9 @@ support-files = file_navigator_resolve_i
 subsuite = clipboard
 [test_messagemanager_principal.html]
 [test_messagemanager_send_principal.html]
 skip-if = buildapp == 'mulet'
 [test_bug945152.html]
 [test_bug1008126.html]
 [test_sandboxed_blob_uri.html]
 [test_websocket_frame.html]
-[test_getFeature_with_perm.html]
-[test_hasFeature.html]
 [test_mozbrowser_apis_allowed.html]
deleted file mode 100644
--- a/dom/base/test/test_getFeature_with_perm.html
+++ /dev/null
@@ -1,135 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=979109
--->
-<head>
-  <meta charset="utf-8">
-  <title>Test for Bug 979109</title>
-  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=983502">Mozilla Bug 983502</a>
-<script type="application/javascript">
-
-function testSupported() {
-  var mem;
-  navigator.getFeature("hardware.memory").then(function(mem) {
-
-    var isLinux = (navigator.platform.indexOf('Linux') != -1);
-    var isAndroid = !!navigator.userAgent.includes("Android");
-    var isB2G = !isAndroid && /Mobile|Tablet/.test(navigator.userAgent);
-
-    if (isLinux) {
-      info("It is Linux version:");
-    }
-    if (isAndroid) {
-      info("It is Android version");
-    }
-    if (isB2G) {
-      info("It is B2G version");
-    }
-
-    if (isLinux || isAndroid || isB2G) {
-      ok(typeof mem === 'number' && (mem) % 1 === 0, "We should receive an integer on this platform");
-      ok(mem > 0, "hardware.memory is supported on this platform. mem=" + mem + "MiB");
-    } else {
-      ok(typeof mem === 'undefined', "hardware.memory is not support on this platform");
-    }
-
-    runNextTest();
-
-  },function(mem) {
-    ok(false, "The Promise should not be rejected");
-  });
-}
-
-function testNotSupported() {
-  var tv;
-  navigator.getFeature("hardware.tv").then(function(tv) {
-    ok(typeof tv === 'undefined', "Resolve the Promise with undefined value (hardware.tv)");
-    runNextTest();
-  },function(tv) {
-    ok(false, "The Promise should not be rejected");
-  });
-}
-
-function testNotSupportedManifest() {
-  navigator.getFeature("manifest.origin").then(function(feature) {
-    ok(typeof feature == 'undefined', "manifest.* resolves with undefined on getFeature");
-    runNextTest();
-  }, function() {
-    ok(false, "The Promise should not be rejected");
-  });
-}
-
-function createManifestTest(aFeature) {
-  return function() {
-    var res;
-    navigator.hasFeature(aFeature).then(function(res) {
-      ok(res === true, "Resolve the Promise with 'true' for " + aFeature);
-      runNextTest();
-    }, function(tv) {
-      ok(false, "The Promise should not be rejected");
-    });
-  }
-}
-
-function testDevMode(aExpected) {
-  return function() {
-    navigator.getFeature("dom.apps.developer_mode").then(res => {
-      is(res, aExpected, "dom.apps.developer_mode is " + aExpected);
-      runNextTest();
-    }, function() {
-      ok(false, "The Promise should not be rejected");
-    });
-  }
-}
-
-function enableDevMode() {
-  SpecialPowers.pushPrefEnv({"set": [["dom.apps.developer_mode", true]]}, runNextTest);
-}
-
-var currentTest = -1;
-var tests = [
-  testNotSupported,
-  testNotSupportedManifest,
-  testSupported,
-  createManifestTest("manifest.origin"),
-  createManifestTest("manifest.redirects"),
-  testDevMode(false),
-  enableDevMode,
-  testDevMode(true)
-];
-
-function runNextTest() {
-  currentTest++;
-  if (currentTest < tests.length) {
-    tests[currentTest]();
-  } else {
-    SimpleTest.finish();
-  }
-}
-
-info("About to run " + tests.length + " tests");
-
-ok('getFeature' in navigator, "navigator.getFeature should exist");
-ok('hasFeature' in navigator, "navigator.hasFeature should exist");
-// B2G specific manifest features.
-// Touching navigator before pushPermissions makes it fail.
-if (!navigator.userAgent.includes("Android") &&
-      /Mobile|Tablet/.test(navigator.userAgent)) {
-  info("Adding B2G specific tests");
-  tests.push(createManifestTest("manifest.chrome.navigation"));
-  tests.push(createManifestTest("manifest.precompile"));
-  tests.push(createManifestTest("manifest.role.homescreen"));
-}
-runNextTest();
-ok(true, "Test DONE");
-
-SimpleTest.waitForExplicitFinish();
-
-</script>
-</body>
-</html>
deleted file mode 100644
--- a/dom/base/test/test_hasFeature.html
+++ /dev/null
@@ -1,101 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=1009645
--->
-<head>
-  <meta charset="utf-8">
-  <title>Test for Bug 1009645</title>
-  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1009645">Mozilla Bug 1009645</a>
-<script type="application/javascript">
-
-var b2gOnly;
-
-function pref(name) {
-  try {
-    return SpecialPowers.getBoolPref(name);
-  } catch (e) {
-    return false;
-  }
-}
-
-function testAPIs() {
-  var APIEndPoints = [
-    { name: "MozMobileNetworkInfo", enabled: pref("dom.mobileconnection.enabled") },
-    // { name: "Navigator.mozBluetooth", enabled: b2gOnly }, // conditional on MOZ_B2G_BT, tricky to test
-    // Bug 1266035 { name: "Navigator.mozContacts", enabled: pref("dom.mozContacts.enabled") },
-    { name: "Navigator.getDeviceStorage", enabled: pref("device.storage.enabled") },
-    // Bug 1266035 { name: "Navigator.addIdleObserver", enabled: true },
-    { name: "Navigator.mozNetworkStats", enabled: pref("dom.mozNetworkStats.enabled") },
-    { name: "Navigator.push", enabled: pref("services.push.enabled") },
-    // { name: "Navigator.mozTime", enabled: b2gOnly }, // conditional on MOZ_TIME_MANAGER, tricky to test
-    // { name: "Navigator.mozFMRadio", enabled: b2gOnly }, // conditional on MOZ_B2G_FM, tricky to test
-    { name: "Navigator.mozCameras", enabled: true },
-    { name: "Navigator.mozAlarms", enabled: pref("dom.mozAlarms.enabled") },
-    { name: "Navigator.mozTCPSocket", enabled: pref("dom.mozTCPSocket.enabled") },
-    { name: "Navigator.mozInputMethod", enabled: pref("dom.mozInputMethod.enabled") },
-    { name: "Navigator.mozMobileConnections", enabled: pref("dom.mobileconnection.enabled") },
-    { name: "XMLHttpRequest.mozSystem", enabled: true }
-  ];
-
-  var promises = [];
-  APIEndPoints.forEach(function(v) {
-    promises.push(navigator.hasFeature("api.window." + v.name));
-  });
-
-  return Promise.all(promises).then(function(values) {
-    for (var i = 0; i < values.length; ++i) {
-      is(values[i], APIEndPoints[i].enabled,
-         "Endpoint " + APIEndPoints[i].name + " resolved with the correct value. " +
-         "If this is failing because you're changing how an API is exposed, you " +
-         "must contact the Marketplace team to let them know about the change.");
-    }
-  }, function() {
-    ok(false, "The Promise should not be rejected");
-  });
-}
-
-function testExtensions() {
-  if (!b2gOnly) {
-    return Promise.resolve();
-  }
-
-  var builtInFeatures = [
-    {feature: "web-extensions", value: true},
-    {feature: "late-customization", value: true}
-  ];
-
-  builtInFeatures.forEach(function(x) {
-    navigator.hasFeature(x.feature).then(function(value) {
-      is(value, x.value, "Resolve the Promise with " + value + " for feature: " + x.feature);
-    }).catch(function(ex) {
-      ok(false, "The Promise should not be rejected");
-    });
-  });
-  return Promise.resolve();
-}
-
-SpecialPowers.pushPermissions([
-  {type: "feature-detection", allow: true, context: document}
-], function() {
-  b2gOnly = (function() {
-    var isAndroid = !!navigator.userAgent.includes("Android");
-    var isMulet = pref("b2g.is_mulet");
-    var isB2g = isMulet || (!isAndroid && /Mobile|Tablet/.test(navigator.userAgent));
-    return isB2g ? true : undefined;
-  })();
-
-  ok('hasFeature' in navigator, "navigator.hasFeature should exist");
-  testAPIs().then(testExtensions).catch(function(e) {
-    ok(false, "The Promise should not be rejected: " + e);
-  }).then(SimpleTest.finish);
-});
-
-SimpleTest.waitForExplicitFinish();
-</script>
-</body>
-</html>
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -27,17 +27,16 @@
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/dom/DataTransfer.h"
 #include "mozilla/dom/DOMStorageIPC.h"
 #include "mozilla/dom/ExternalHelperAppChild.h"
 #include "mozilla/dom/FlyWebPublishedServerIPC.h"
 #include "mozilla/dom/GetFilesHelper.h"
 #include "mozilla/dom/PCrashReporterChild.h"
 #include "mozilla/dom/ProcessGlobal.h"
-#include "mozilla/dom/Promise.h"
 #include "mozilla/dom/workers/ServiceWorkerManager.h"
 #include "mozilla/dom/nsIContentChild.h"
 #include "mozilla/gfx/gfxVars.h"
 #include "mozilla/psm/PSMContentListener.h"
 #include "mozilla/hal_sandbox/PHalChild.h"
 #include "mozilla/ipc/BackgroundChild.h"
 #include "mozilla/ipc/FileDescriptorSetChild.h"
 #include "mozilla/ipc/FileDescriptorUtils.h"
@@ -2258,32 +2257,16 @@ nsresult
 ContentChild::AddRemoteAlertObserver(const nsString& aData,
                                      nsIObserver* aObserver)
 {
   NS_ASSERTION(aObserver, "Adding a null observer?");
   mAlertObservers.AppendElement(new AlertObserver(aObserver, aData));
   return NS_OK;
 }
 
-
-bool
-ContentChild::RecvSystemMemoryAvailable(const uint64_t& aGetterId,
-                                        const uint32_t& aMemoryAvailable)
-{
-  RefPtr<Promise> p = dont_AddRef(reinterpret_cast<Promise*>(aGetterId));
-
-  if (!aMemoryAvailable) {
-    p->MaybeReject(NS_ERROR_NOT_AVAILABLE);
-    return true;
-  }
-
-  p->MaybeResolve((int)aMemoryAvailable);
-  return true;
-}
-
 bool
 ContentChild::RecvPreferenceUpdate(const PrefSetting& aPref)
 {
   Preferences::SetPreference(aPref);
   return true;
 }
 
 bool
--- a/dom/ipc/ContentChild.h
+++ b/dom/ipc/ContentChild.h
@@ -399,19 +399,16 @@ public:
   virtual bool RecvBidiKeyboardNotify(const bool& isLangRTL,
                                       const bool& haveBidiKeyboards) override;
 
   virtual bool RecvNotifyVisited(const URIParams& aURI) override;
 
   // auto remove when alertfinished is received.
   nsresult AddRemoteAlertObserver(const nsString& aData, nsIObserver* aObserver);
 
-  virtual bool RecvSystemMemoryAvailable(const uint64_t& aGetterId,
-                                         const uint32_t& aMemoryAvailable) override;
-
   virtual bool RecvPreferenceUpdate(const PrefSetting& aPref) override;
   virtual bool RecvVarUpdate(const GfxVarUpdate& pref) override;
 
   virtual bool RecvDataStoragePut(const nsString& aFilename,
                                   const DataStorageItem& aItem) override;
 
   virtual bool RecvDataStorageRemove(const nsString& aFilename,
                                      const nsCString& aKey,
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -3905,30 +3905,16 @@ ContentParent::RecvNSSU2FTokenSign(nsTAr
 
   MOZ_ASSERT(buffer);
   aSignature->ReplaceElementsAt(0, aSignature->Length(), buffer, bufferlen);
   free(buffer);
   return NS_SUCCEEDED(rv);
 }
 
 bool
-ContentParent::RecvGetSystemMemory(const uint64_t& aGetterId)
-{
-  uint32_t memoryTotal = 0;
-
-#if defined(XP_LINUX)
-  memoryTotal = mozilla::hal::GetTotalSystemMemoryLevel();
-#endif
-
-  Unused << SendSystemMemoryAvailable(aGetterId, memoryTotal);
-
-  return true;
-}
-
-bool
 ContentParent::RecvGetLookAndFeelCache(nsTArray<LookAndFeelInt>* aLookAndFeelIntCache)
 {
   *aLookAndFeelIntCache = LookAndFeel::GetIntCache();
   return true;
 }
 
 bool
 ContentParent::RecvIsSecureURI(const uint32_t& type,
--- a/dom/ipc/ContentParent.h
+++ b/dom/ipc/ContentParent.h
@@ -1008,18 +1008,16 @@ private:
 
   virtual bool RecvAudioChannelChangeDefVolChannel(const int32_t& aChannel,
                                                    const bool& aHidden) override;
 
   virtual bool RecvAudioChannelServiceStatus(const bool& aTelephonyChannel,
                                              const bool& aContentOrNormalChannel,
                                              const bool& aAnyChannel) override;
 
-  virtual bool RecvGetSystemMemory(const uint64_t& getterId) override;
-
   virtual bool RecvGetLookAndFeelCache(nsTArray<LookAndFeelInt>* aLookAndFeelIntCache) override;
 
   virtual bool RecvSpeakerManagerGetSpeakerStatus(bool* aValue) override;
 
   virtual bool RecvSpeakerManagerForceSpeaker(const bool& aEnable) override;
 
   virtual bool RecvCreateFakeVolume(const nsString& aFsName,
                                     const nsString& aMountPoint) override;
--- a/dom/ipc/PContent.ipdl
+++ b/dom/ipc/PContent.ipdl
@@ -513,18 +513,16 @@ child:
 
     async ClearImageCache(bool privateLoader, bool chrome);
 
     async SetOffline(bool offline);
     async SetConnectivity(bool connectivity);
 
     async NotifyVisited(URIParams uri);
 
-    async SystemMemoryAvailable(uint64_t getterId, uint32_t memoryAvailable);
-
     async PreferenceUpdate(PrefSetting pref);
     async VarUpdate(GfxVarUpdate var);
 
     async DataStoragePut(nsString aFilename, DataStorageItem aItem);
     async DataStorageRemove(nsString aFilename, nsCString aKey, DataStorageType aType);
     async DataStorageClear(nsString aFilename);
 
     async NotifyAlertsObserver(nsCString topic, nsString data);
@@ -824,18 +822,16 @@ parent:
      * |challenge| The Challenge to satisfy in the response.
      * |keyHandle| The Key Handle opaque object to use.
      * |signature| The resulting signature.
      */
     sync NSSU2FTokenSign(uint8_t[] application, uint8_t[] challenge,
                          uint8_t[] keyHandle)
         returns (uint8_t[] signature);
 
-    async GetSystemMemory(uint64_t getterId);
-
     sync IsSecureURI(uint32_t type, URIParams uri, uint32_t flags)
         returns (bool isSecureURI);
 
     async AccumulateMixedContentHSTS(URIParams uri, bool active);
 
     sync GetLookAndFeelCache()
         returns (LookAndFeelInt[] lookAndFeelIntCache);
 
--- a/dom/webidl/Navigator.webidl
+++ b/dom/webidl/Navigator.webidl
@@ -24,17 +24,16 @@
 interface Navigator {
   // objects implementing this interface also implement the interfaces given below
 };
 Navigator implements NavigatorID;
 Navigator implements NavigatorLanguage;
 Navigator implements NavigatorOnLine;
 Navigator implements NavigatorContentUtils;
 Navigator implements NavigatorStorageUtils;
-Navigator implements NavigatorFeatures;
 Navigator implements NavigatorConcurrentHardware;
 
 [NoInterfaceObject, Exposed=(Window,Worker)]
 interface NavigatorID {
   // WebKit/Blink/Trident/Presto support this (hardcoded "Mozilla").
   [Constant, Cached]
   readonly attribute DOMString appCodeName; // constant "Mozilla"
   [Constant, Cached]
@@ -87,25 +86,16 @@ interface NavigatorContentUtils {
 };
 
 [NoInterfaceObject]
 interface NavigatorStorageUtils {
   // NOT IMPLEMENTED
   //void yieldForStorageUpdates();
 };
 
-[NoInterfaceObject]
-interface NavigatorFeatures {
-  [ChromeOnly, Throws]
-  Promise<any> getFeature(DOMString name);
-
-  [ChromeOnly, Throws]
-  Promise<any> hasFeature(DOMString name);
-};
-
 partial interface Navigator {
   [Throws]
   readonly attribute Permissions permissions;
 };
 
 // Things that definitely need to be in the spec and and are not for some
 // reason.  See https://www.w3.org/Bugs/Public/show_bug.cgi?id=22406
 partial interface Navigator {
--- a/hal/Hal.cpp
+++ b/hal/Hal.cpp
@@ -1207,22 +1207,16 @@ StopDiskSpaceWatcher()
 }
 
 uint32_t
 GetTotalSystemMemory()
 {
   return hal_impl::GetTotalSystemMemory();
 }
 
-uint32_t
-GetTotalSystemMemoryLevel()
-{
-  return hal_impl::GetTotalSystemMemoryLevel();
-}
-
 bool IsHeadphoneEventFromInputDev()
 {
   AssertMainThread();
   RETURN_PROXY_IF_SANDBOXED(IsHeadphoneEventFromInputDev(), false);
 }
 
 nsresult StartSystemService(const char* aSvcName, const char* aArgs)
 {
--- a/hal/Hal.h
+++ b/hal/Hal.h
@@ -623,24 +623,16 @@ void StopDiskSpaceWatcher();
 /**
  * Get total system memory of device being run on in bytes.
  *
  * Returns 0 if we are unable to determine this information from /proc/meminfo.
  */
 uint32_t GetTotalSystemMemory();
 
 /**
- * Get the level of total system memory on device in MiB.
- * (round the value up to the next power of two)
- *
- * Returns 0 if we are unable to determine this information from /proc/meminfo.
- */
-uint32_t GetTotalSystemMemoryLevel();
-
-/**
  * Determine whether the headphone switch event is from input device
  */
 bool IsHeadphoneEventFromInputDev();
 
 /**
  * Start the system service with the specified name and arguments.
  */
 nsresult StartSystemService(const char* aSvcName, const char* aArgs);
--- a/hal/fallback/FallbackMemory.cpp
+++ b/hal/fallback/FallbackMemory.cpp
@@ -11,16 +11,10 @@ namespace mozilla {
 namespace hal_impl {
 
 uint32_t
 GetTotalSystemMemory()
 {
 	return 0;
 }
 
-uint32_t
-GetTotalSystemMemoryLevel()
-{
-	return 0;
-}
-
 } // namespace hal_impl
 } // namespace mozilla
--- a/hal/linux/LinuxMemory.cpp
+++ b/hal/linux/LinuxMemory.cpp
@@ -30,42 +30,10 @@ GetTotalSystemMemory()
     if (fclose(fd) || rv != 1) {
       return 0;
     }
   }
 
   return sTotalMemory * 1024;
 }
 
-uint32_t
-GetTotalSystemMemoryLevel()
-{
-  static uint32_t sTotalMemoryLevel = 1;
-  uint32_t sTotalMemory;
-  static bool sTotalMemoryObtained = false;
-
-  if (!sTotalMemoryObtained) {
-    sTotalMemoryObtained = true;
-
-    FILE* fd = fopen("/proc/meminfo", "r");
-    if (!fd) {
-      return 0;
-    }
-
-    int rv = fscanf(fd, "MemTotal: %i kB", &sTotalMemory);
-
-    if (fclose(fd) || rv != 1) {
-      return 0;
-    }
-
-    // From KB to MiB
-    sTotalMemory /= 1024;
-
-    while (sTotalMemoryLevel <= sTotalMemory) {
-      sTotalMemoryLevel *= 2;
-    }
-  }
-
-  return sTotalMemoryLevel;
-}
-
 } // namespace hal_impl
 } // namespace mozilla