Bug 1488401 - Remove the remnants of the DiskSpaceWatcher r=asuth,janv,smaug
authorGabriele Svelto <gsvelto@mozilla.com>
Thu, 13 Sep 2018 06:40:51 +0000
changeset 484520 3206c9b8db975f6b30bc4ee1a70402ccfdc68e36
parent 484519 78b3718b7edeb9c3187201e93ba05e89250b8a3a
child 484521 2c48f0cea901e588f152c4af229e0c99fcfc7359
push id241
push userfmarier@mozilla.com
push dateMon, 24 Sep 2018 21:48:02 +0000
reviewersasuth, janv, smaug
bugs1488401
milestone64.0a1
Bug 1488401 - Remove the remnants of the DiskSpaceWatcher r=asuth,janv,smaug Differential Revision: https://phabricator.services.mozilla.com/D4933
dom/indexedDB/ActorsParent.cpp
dom/indexedDB/IndexedDatabaseManager.cpp
dom/indexedDB/IndexedDatabaseManager.h
dom/indexedDB/test/helpers.js
dom/indexedDB/test/mochitest.ini
dom/indexedDB/test/test_lowDiskSpace.html
dom/indexedDB/test/unit/test_lowDiskSpace.js
dom/indexedDB/test/unit/xpcshell-head-parent-process.js
dom/indexedDB/test/unit/xpcshell-parent-process.ini
dom/storage/LocalStorageCache.cpp
dom/storage/LocalStorageManager.cpp
dom/storage/LocalStorageManager.h
dom/storage/StorageIPC.cpp
dom/storage/StorageObserver.cpp
dom/tests/mochitest/ajax/offline/mochitest.ini
dom/tests/mochitest/ajax/offline/test_lowDeviceStorage.html
dom/tests/mochitest/ajax/offline/test_lowDeviceStorageDuringUpdate.html
dom/tests/mochitest/localstorage/mochitest.ini
dom/tests/mochitest/localstorage/test_lowDeviceStorage.html
hal/Hal.cpp
hal/Hal.h
hal/fallback/FallbackDiskSpaceWatcher.cpp
hal/moz.build
hal/sandbox/SandboxHal.cpp
toolkit/components/diskspacewatcher/DiskSpaceWatcher.cpp
toolkit/components/diskspacewatcher/DiskSpaceWatcher.h
toolkit/components/diskspacewatcher/moz.build
toolkit/components/diskspacewatcher/nsIDiskSpaceWatcher.idl
toolkit/components/extensions/test/xpcshell/head_storage.js
toolkit/components/extensions/test/xpcshell/test_ext_storage_idb_data_migration.js
toolkit/components/extensions/test/xpcshell/test_ext_storage_tab.js
toolkit/components/extensions/test/xpcshell/xpcshell-remote.ini
toolkit/components/extensions/test/xpcshell/xpcshell.ini
toolkit/components/moz.build
uriloader/prefetch/nsOfflineCacheUpdate.h
uriloader/prefetch/nsOfflineCacheUpdateService.cpp
--- a/dom/indexedDB/ActorsParent.cpp
+++ b/dom/indexedDB/ActorsParent.cpp
@@ -4491,28 +4491,16 @@ CreateStorageConnection(nsIFile* aDBFile
   MOZ_ASSERT(aFMDirectory);
   MOZ_ASSERT(aConnection);
 
   AUTO_PROFILER_LABEL("CreateStorageConnection", DOM);
 
   nsresult rv;
   bool exists;
 
-  if (IndexedDatabaseManager::InLowDiskSpaceMode()) {
-    rv = aDBFile->Exists(&exists);
-    if (NS_WARN_IF(NS_FAILED(rv))) {
-      return rv;
-    }
-
-    if (!exists) {
-      NS_WARNING("Refusing to create database because disk space is low!");
-      return NS_ERROR_DOM_INDEXEDDB_QUOTA_ERR;
-    }
-  }
-
   nsCOMPtr<nsIFileURL> dbFileUrl;
   rv = GetDatabaseFileURL(aDBFile,
                           aPersistenceType,
                           aGroup,
                           aOrigin,
                           aTelemetryId,
                           getter_AddRefs(dbFileUrl));
   if (NS_WARN_IF(NS_FAILED(rv))) {
@@ -18895,33 +18883,16 @@ DatabaseMaintenance::DetermineMaintenanc
   // Don't do anything if the schema version is less than 18; before that
   // version no databases had |auto_vacuum == INCREMENTAL| set and we didn't
   // track the values needed for the heuristics below.
   if (schemaVersion < MakeSchemaVersion(18, 0)) {
     *aMaintenanceAction = MaintenanceAction::Nothing;
     return NS_OK;
   }
 
-  bool lowDiskSpace = IndexedDatabaseManager::InLowDiskSpaceMode();
-
-  if (QuotaManager::IsRunningXPCShellTests()) {
-    // If we're running XPCShell then we want to test both the low disk space
-    // and normal disk space code paths so pick semi-randomly based on the
-    // current time.
-    lowDiskSpace = ((PR_Now() / PR_USEC_PER_MSEC) % 2) == 0;
-  }
-
-  // If we're low on disk space then the best we can hope for is that an
-  // incremental vacuum might free some space. That is a journaled operation so
-  // it may not be possible even then.
-  if (lowDiskSpace) {
-    *aMaintenanceAction = MaintenanceAction::IncrementalVacuum;
-    return NS_OK;
-  }
-
   // This method shouldn't make any permanent changes to the database, so make
   // sure everything gets rolled back when we leave.
   mozStorageTransaction transaction(aConnection,
                                     /* aCommitOnComplete */ false);
 
   // Check to see when we last vacuumed this database.
   nsCOMPtr<mozIStorageStatement> stmt;
   rv = aConnection->CreateStatement(NS_LITERAL_CSTRING(
@@ -24003,21 +23974,16 @@ CreateFileOp::CreateMutableFile(MutableF
 nsresult
 CreateFileOp::DoDatabaseWork()
 {
   AssertIsOnIOThread();
   MOZ_ASSERT(mState == State::DatabaseWork);
 
   AUTO_PROFILER_LABEL("CreateFileOp::DoDatabaseWork", DOM);
 
-  if (NS_WARN_IF(IndexedDatabaseManager::InLowDiskSpaceMode())) {
-    NS_WARNING("Refusing to create file because disk space is low!");
-    return NS_ERROR_DOM_INDEXEDDB_QUOTA_ERR;
-  }
-
   if (NS_WARN_IF(QuotaManager::IsShuttingDown()) || !OperationMayProceed()) {
     IDB_REPORT_INTERNAL_ERR();
     return NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;
   }
 
   FileManager* fileManager = mDatabase->GetFileManager();
 
   mFileInfo = fileManager->GetNewFileInfo();
@@ -24146,20 +24112,16 @@ VersionChangeTransactionOp::Cleanup()
 nsresult
 CreateObjectStoreOp::DoDatabaseWork(DatabaseConnection* aConnection)
 {
   MOZ_ASSERT(aConnection);
   aConnection->AssertIsOnConnectionThread();
 
   AUTO_PROFILER_LABEL("CreateObjectStoreOp::DoDatabaseWork", DOM);
 
-  if (NS_WARN_IF(IndexedDatabaseManager::InLowDiskSpaceMode())) {
-    return NS_ERROR_DOM_INDEXEDDB_QUOTA_ERR;
-  }
-
 #ifdef DEBUG
   {
     // Make sure that we're not creating an object store with the same name as
     // another that already exists. This should be impossible because we should
     // have thrown an error long before now...
     DatabaseConnection::CachedStatement stmt;
     MOZ_ALWAYS_SUCCEEDS(
       aConnection->GetCachedStatement(NS_LITERAL_CSTRING(
@@ -24469,20 +24431,16 @@ DeleteObjectStoreOp::DoDatabaseWork(Data
 nsresult
 RenameObjectStoreOp::DoDatabaseWork(DatabaseConnection* aConnection)
 {
   MOZ_ASSERT(aConnection);
   aConnection->AssertIsOnConnectionThread();
 
   AUTO_PROFILER_LABEL("RenameObjectStoreOp::DoDatabaseWork", DOM);
 
-  if (NS_WARN_IF(IndexedDatabaseManager::InLowDiskSpaceMode())) {
-    return NS_ERROR_DOM_INDEXEDDB_QUOTA_ERR;
-  }
-
 #ifdef DEBUG
   {
     // Make sure that we're not renaming an object store with the same name as
     // another that already exists. This should be impossible because we should
     // have thrown an error long before now...
     DatabaseConnection::CachedStatement stmt;
     MOZ_ALWAYS_SUCCEEDS(
       aConnection->GetCachedStatement(NS_LITERAL_CSTRING(
@@ -24560,17 +24518,16 @@ CreateIndexOp::CreateIndexOp(VersionChan
   MOZ_ASSERT(!mDatabaseId.IsEmpty());
 }
 
 nsresult
 CreateIndexOp::InsertDataFromObjectStore(DatabaseConnection* aConnection)
 {
   MOZ_ASSERT(aConnection);
   aConnection->AssertIsOnConnectionThread();
-  MOZ_ASSERT(!IndexedDatabaseManager::InLowDiskSpaceMode());
   MOZ_ASSERT(mMaybeUniqueIndexTable);
 
   AUTO_PROFILER_LABEL("CreateIndexOp::InsertDataFromObjectStore", DOM);
 
   nsCOMPtr<mozIStorageConnection> storageConnection =
     aConnection->GetStorageConnection();
   MOZ_ASSERT(storageConnection);
 
@@ -24599,17 +24556,16 @@ CreateIndexOp::InsertDataFromObjectStore
 }
 
 nsresult
 CreateIndexOp::InsertDataFromObjectStoreInternal(
                                                 DatabaseConnection* aConnection)
 {
   MOZ_ASSERT(aConnection);
   aConnection->AssertIsOnConnectionThread();
-  MOZ_ASSERT(!IndexedDatabaseManager::InLowDiskSpaceMode());
   MOZ_ASSERT(mMaybeUniqueIndexTable);
 
   DebugOnly<void*> storageConnection = aConnection->GetStorageConnection();
   MOZ_ASSERT(storageConnection);
 
   DatabaseConnection::CachedStatement stmt;
   nsresult rv = aConnection->GetCachedStatement(NS_LITERAL_CSTRING(
     "UPDATE object_data "
@@ -24655,20 +24611,16 @@ CreateIndexOp::Init(TransactionBase* aTr
 nsresult
 CreateIndexOp::DoDatabaseWork(DatabaseConnection* aConnection)
 {
   MOZ_ASSERT(aConnection);
   aConnection->AssertIsOnConnectionThread();
 
   AUTO_PROFILER_LABEL("CreateIndexOp::DoDatabaseWork", DOM);
 
-  if (NS_WARN_IF(IndexedDatabaseManager::InLowDiskSpaceMode())) {
-    return NS_ERROR_DOM_INDEXEDDB_QUOTA_ERR;
-  }
-
 #ifdef DEBUG
   {
     // Make sure that we're not creating an index with the same name and object
     // store as another that already exists. This should be impossible because
     // we should have thrown an error long before now...
     DatabaseConnection::CachedStatement stmt;
     MOZ_ALWAYS_SUCCEEDS(
       aConnection->GetCachedStatement(NS_LITERAL_CSTRING(
@@ -25423,20 +25375,16 @@ DeleteIndexOp::DoDatabaseWork(DatabaseCo
 nsresult
 RenameIndexOp::DoDatabaseWork(DatabaseConnection* aConnection)
 {
   MOZ_ASSERT(aConnection);
   aConnection->AssertIsOnConnectionThread();
 
   AUTO_PROFILER_LABEL("RenameIndexOp::DoDatabaseWork", DOM);
 
-  if (NS_WARN_IF(IndexedDatabaseManager::InLowDiskSpaceMode())) {
-    return NS_ERROR_DOM_INDEXEDDB_QUOTA_ERR;
-  }
-
 #ifdef DEBUG
   {
     // Make sure that we're not renaming an index with the same name as another
     // that already exists. This should be impossible because we should have
     // thrown an error long before now...
     DatabaseConnection::CachedStatement stmt;
     MOZ_ALWAYS_SUCCEEDS(
       aConnection->GetCachedStatement(NS_LITERAL_CSTRING(
@@ -25924,20 +25872,16 @@ nsresult
 ObjectStoreAddOrPutRequestOp::DoDatabaseWork(DatabaseConnection* aConnection)
 {
   MOZ_ASSERT(aConnection);
   aConnection->AssertIsOnConnectionThread();
   MOZ_ASSERT(aConnection->GetStorageConnection());
 
   AUTO_PROFILER_LABEL("ObjectStoreAddOrPutRequestOp::DoDatabaseWork", DOM);
 
-  if (NS_WARN_IF(IndexedDatabaseManager::InLowDiskSpaceMode())) {
-    return NS_ERROR_DOM_INDEXEDDB_QUOTA_ERR;
-  }
-
   DatabaseConnection::AutoSavepoint autoSave;
   nsresult rv = autoSave.Start(Transaction());
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   bool objectStoreHasIndexes;
   rv = ObjectStoreHasIndexes(this,
--- a/dom/indexedDB/IndexedDatabaseManager.cpp
+++ b/dom/indexedDB/IndexedDatabaseManager.cpp
@@ -3,21 +3,19 @@
 /* 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 "IndexedDatabaseManager.h"
 
 #include "chrome/common/ipc_channel.h" // for IPC::Channel::kMaximumMessageSize
 #include "nsIConsoleService.h"
-#include "nsIDiskSpaceWatcher.h"
 #include "nsIDOMWindow.h"
 #include "nsIEventTarget.h"
 #include "nsIFile.h"
-#include "nsIObserverService.h"
 #include "nsIScriptError.h"
 #include "nsIScriptGlobalObject.h"
 
 #include "jsapi.h"
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/CondVar.h"
 #include "mozilla/ContentEvents.h"
 #include "mozilla/EventDispatcher.h"
@@ -58,21 +56,16 @@
 #include "mozilla/dom/IDBObjectStoreBinding.h"
 #include "mozilla/dom/IDBOpenDBRequestBinding.h"
 #include "mozilla/dom/IDBRequestBinding.h"
 #include "mozilla/dom/IDBTransactionBinding.h"
 #include "mozilla/dom/IDBVersionChangeEventBinding.h"
 
 #define IDB_STR "indexedDB"
 
-// The two possible values for the data argument when receiving the disk space
-// observer notification.
-#define LOW_DISK_SPACE_DATA_FULL "full"
-#define LOW_DISK_SPACE_DATA_FREE "free"
-
 namespace mozilla {
 namespace dom {
 namespace indexedDB {
 
 using namespace mozilla::dom::quota;
 using namespace mozilla::ipc;
 
 class FileManagerInfo
@@ -308,50 +301,30 @@ bool IndexedDatabaseManager::sIsMainProc
 bool IndexedDatabaseManager::sFullSynchronousMode = false;
 
 mozilla::LazyLogModule IndexedDatabaseManager::sLoggingModule("IndexedDB");
 
 Atomic<IndexedDatabaseManager::LoggingMode>
   IndexedDatabaseManager::sLoggingMode(
     IndexedDatabaseManager::Logging_Disabled);
 
-mozilla::Atomic<bool> IndexedDatabaseManager::sLowDiskSpaceMode(false);
-
 // static
 IndexedDatabaseManager*
 IndexedDatabaseManager::GetOrCreate()
 {
   NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
 
   if (IsClosed()) {
     NS_ERROR("Calling GetOrCreate() after shutdown!");
     return nullptr;
   }
 
   if (!gDBManager) {
     sIsMainProcess = XRE_IsParentProcess();
 
-    if (sIsMainProcess && Preferences::GetBool("disk_space_watcher.enabled", false)) {
-      // See if we're starting up in low disk space conditions.
-      nsCOMPtr<nsIDiskSpaceWatcher> watcher =
-        do_GetService(DISKSPACEWATCHER_CONTRACTID);
-      if (watcher) {
-        bool isDiskFull;
-        if (NS_SUCCEEDED(watcher->GetIsDiskFull(&isDiskFull))) {
-          sLowDiskSpaceMode = isDiskFull;
-        }
-        else {
-          NS_WARNING("GetIsDiskFull failed!");
-        }
-      }
-      else {
-        NS_WARNING("No disk space watcher component available!");
-      }
-    }
-
     RefPtr<IndexedDatabaseManager> instance(new IndexedDatabaseManager());
 
     nsresult rv = instance->Init();
     NS_ENSURE_SUCCESS(rv, nullptr);
 
     if (gInitialized.exchange(true)) {
       NS_ERROR("Initialized more than once?!");
     }
@@ -375,23 +348,16 @@ IndexedDatabaseManager::Get()
 nsresult
 IndexedDatabaseManager::Init()
 {
   NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
 
   // During Init() we can't yet call IsMainProcess(), just check sIsMainProcess
   // directly.
   if (sIsMainProcess) {
-    nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
-    NS_ENSURE_STATE(obs);
-
-    nsresult rv =
-      obs->AddObserver(this, DISKSPACEWATCHER_OBSERVER_TOPIC, false);
-    NS_ENSURE_SUCCESS(rv, rv);
-
     mDeleteTimer = NS_NewTimer();
     NS_ENSURE_STATE(mDeleteTimer);
 
     if (QuotaManager* quotaManager = QuotaManager::Get()) {
       NoteLiveQuotaManager(quotaManager);
     }
   }
 
@@ -689,26 +655,16 @@ IndexedDatabaseManager::IsMainProcess()
 {
   NS_ASSERTION(gDBManager,
                "IsMainProcess() called before indexedDB has been initialized!");
   NS_ASSERTION((XRE_IsParentProcess()) ==
                sIsMainProcess, "XRE_GetProcessType changed its tune!");
   return sIsMainProcess;
 }
 
-//static
-bool
-IndexedDatabaseManager::InLowDiskSpaceMode()
-{
-  NS_ASSERTION(gDBManager,
-               "InLowDiskSpaceMode() called before indexedDB has been "
-               "initialized!");
-  return sLowDiskSpaceMode;
-}
-
 // static
 IndexedDatabaseManager::LoggingMode
 IndexedDatabaseManager::GetLoggingMode()
 {
   MOZ_ASSERT(gDBManager,
              "GetLoggingMode called before IndexedDatabaseManager has been "
              "initialized!");
 
@@ -1104,47 +1060,17 @@ IndexedDatabaseManager::GetLocale()
   IndexedDatabaseManager* idbManager = Get();
   MOZ_ASSERT(idbManager, "IDBManager is not ready!");
 
   return idbManager->mLocale;
 }
 
 NS_IMPL_ADDREF(IndexedDatabaseManager)
 NS_IMPL_RELEASE_WITH_DESTROY(IndexedDatabaseManager, Destroy())
-NS_IMPL_QUERY_INTERFACE(IndexedDatabaseManager, nsIObserver, nsITimerCallback,
-                        nsINamed)
-
-NS_IMETHODIMP
-IndexedDatabaseManager::Observe(nsISupports* aSubject, const char* aTopic,
-                                const char16_t* aData)
-{
-  NS_ASSERTION(IsMainProcess(), "Wrong process!");
-  NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
-
-  if (!strcmp(aTopic, DISKSPACEWATCHER_OBSERVER_TOPIC)) {
-    NS_ASSERTION(aData, "No data?!");
-
-    const nsDependentString data(aData);
-
-    if (data.EqualsLiteral(LOW_DISK_SPACE_DATA_FULL)) {
-      sLowDiskSpaceMode = true;
-    }
-    else if (data.EqualsLiteral(LOW_DISK_SPACE_DATA_FREE)) {
-      sLowDiskSpaceMode = false;
-    }
-    else {
-      MOZ_ASSERT_UNREACHABLE("Unknown data value!");
-    }
-
-    return NS_OK;
-  }
-
-   MOZ_ASSERT_UNREACHABLE("Unknown topic!");
-   return NS_ERROR_UNEXPECTED;
-}
+NS_IMPL_QUERY_INTERFACE(IndexedDatabaseManager, nsITimerCallback, nsINamed)
 
 NS_IMETHODIMP
 IndexedDatabaseManager::Notify(nsITimer* aTimer)
 {
   MOZ_ASSERT(IsMainProcess());
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(mBackgroundThread);
 
--- a/dom/indexedDB/IndexedDatabaseManager.h
+++ b/dom/indexedDB/IndexedDatabaseManager.h
@@ -2,18 +2,16 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_indexeddatabasemanager_h__
 #define mozilla_dom_indexeddatabasemanager_h__
 
-#include "nsIObserver.h"
-
 #include "js/TypeDecls.h"
 #include "mozilla/Atomics.h"
 #include "mozilla/dom/quota/PersistenceType.h"
 #include "mozilla/Mutex.h"
 #include "nsClassHashtable.h"
 #include "nsCOMPtr.h"
 #include "nsHashKeys.h"
 #include "nsINamed.h"
@@ -39,18 +37,17 @@ namespace indexedDB {
 
 class BackgroundUtilsChild;
 class FileManager;
 class FileManagerInfo;
 
 } // namespace indexedDB
 
 class IndexedDatabaseManager final
-  : public nsIObserver
-  , public nsITimerCallback
+  : public nsITimerCallback
   , public nsINamed
 {
   typedef mozilla::dom::quota::PersistenceType PersistenceType;
   typedef mozilla::dom::quota::QuotaManager QuotaManager;
   typedef mozilla::dom::indexedDB::FileManager FileManager;
   typedef mozilla::dom::indexedDB::FileManagerInfo FileManagerInfo;
 
 public:
@@ -59,17 +56,16 @@ public:
     Logging_Disabled = 0,
     Logging_Concise,
     Logging_Detailed,
     Logging_ConciseProfilerMarks,
     Logging_DetailedProfilerMarks
   };
 
   NS_DECL_ISUPPORTS
-  NS_DECL_NSIOBSERVER
   NS_DECL_NSITIMERCALLBACK
   NS_DECL_NSINAMED
 
   // Returns a non-owning reference.
   static IndexedDatabaseManager*
   GetOrCreate();
 
   // Returns a non-owning reference.
@@ -85,26 +81,16 @@ public:
   ;
 #else
   {
     return sIsMainProcess;
   }
 #endif
 
   static bool
-  InLowDiskSpaceMode()
-#ifdef DEBUG
-  ;
-#else
-  {
-    return !!sLowDiskSpaceMode;
-  }
-#endif
-
-  static bool
   InTestingMode();
 
   static bool
   FullSynchronous();
 
   static LoggingMode
   GetLoggingMode()
 #ifdef DEBUG
@@ -242,15 +228,14 @@ private:
   nsCString mLocale;
 
   indexedDB::BackgroundUtilsChild* mBackgroundActor;
 
   static bool sIsMainProcess;
   static bool sFullSynchronousMode;
   static LazyLogModule sLoggingModule;
   static Atomic<LoggingMode> sLoggingMode;
-  static mozilla::Atomic<bool> sLowDiskSpaceMode;
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif // mozilla_dom_indexeddatabasemanager_h__
--- a/dom/indexedDB/test/helpers.js
+++ b/dom/indexedDB/test/helpers.js
@@ -207,20 +207,16 @@ if (!window.runTest) {
   {
     SimpleTest.waitForExplicitFinish();
     testHarnessGenerator.next();
   };
 }
 
 function finishTest()
 {
-  SpecialPowers.notifyObserversInParentProcess(null,
-                                               "disk-space-watcher",
-                                               "free");
-
   SimpleTest.executeSoon(function() {
     clearAllDatabases(function() { SimpleTest.finish(); });
   });
 }
 
 function browserRunTest()
 {
   testGenerator.next();
--- a/dom/indexedDB/test/mochitest.ini
+++ b/dom/indexedDB/test/mochitest.ini
@@ -60,17 +60,16 @@ support-files =
   unit/test_invalid_cursor.js
   unit/test_invalid_version.js
   unit/test_invalidate.js
   unit/test_key_requirements.js
   unit/test_keys.js
   unit/test_locale_aware_indexes.js
   unit/test_locale_aware_index_getAll.js
   unit/test_locale_aware_index_getAllObjects.js
-  unit/test_lowDiskSpace.js
   unit/test_maximal_serialized_object_size.js
   unit/test_multientry.js
   unit/test_names_sorted.js
   unit/test_objectCursors.js
   unit/test_objectStore_getAllKeys.js
   unit/test_objectStore_inline_autoincrement_key_added_on_put.js
   unit/test_objectStore_openKeyCursor.js
   unit/test_objectStore_remove_values.js
@@ -205,18 +204,16 @@ skip-if = verify
 [test_invalid_cursor.html]
 [test_invalid_version.html]
 [test_invalidate.html]
 # disabled for the moment
 skip-if = true
 [test_key_requirements.html]
 [test_keys.html]
 [test_leaving_page.html]
-[test_lowDiskSpace.html]
-skip-if = toolkit == 'android' && debug # Bug 1328321
 [test_maximal_serialized_object_size.html]
 [test_message_manager_ipc.html]
 # This test is only supposed to run in the main process.
 skip-if = e10s
 [test_multientry.html]
 [test_names_sorted.html]
 [test_objectCursors.html]
 [test_objectStore_getAllKeys.html]
deleted file mode 100644
--- a/dom/indexedDB/test/test_lowDiskSpace.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<!--
-  Any copyright is dedicated to the Public Domain.
-  http://creativecommons.org/publicdomain/zero/1.0/
--->
-<html>
-<head>
-  <title>Indexed Database Low Disk Space Test</title>
-
-  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-
-  <script type="text/javascript" src="unit/test_lowDiskSpace.js"></script>
-  <script type="text/javascript" src="helpers.js"></script>
-
-</head>
-
-<body onload="runTest();"></body>
-
-</html>
deleted file mode 100644
--- a/dom/indexedDB/test/unit/test_lowDiskSpace.js
+++ /dev/null
@@ -1,753 +0,0 @@
-/**
- * Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-"use strict";
-
-var disableWorkerTest = "This test uses SpecialPowers";
-
-var self = this;
-
-var testGenerator = testSteps();
-
-function* testSteps()
-{
-  const dbName = self.window ? window.location.pathname : "test_lowDiskSpace";
-  const dbVersion = 1;
-
-  const objectStoreName = "foo";
-  const objectStoreOptions = { keyPath: "foo" };
-
-  const indexName = "bar";
-  const indexOptions = { unique: true };
-
-  const dbData = [
-    { foo: 0, bar: 0 },
-    { foo: 1, bar: 10 },
-    { foo: 2, bar: 20 },
-    { foo: 3, bar: 30 },
-    { foo: 4, bar: 40 },
-    { foo: 5, bar: 50 },
-    { foo: 6, bar: 60 },
-    { foo: 7, bar: 70 },
-    { foo: 8, bar: 80 },
-    { foo: 9, bar: 90 }
-  ];
-
-  let lowDiskMode = false;
-  function setLowDiskMode(val) {
-    let data = val ? "full" : "free";
-
-    if (val == lowDiskMode) {
-      info("Low disk mode is: " + data);
-    }
-    else {
-      info("Changing low disk mode to: " + data);
-      SpecialPowers.notifyObserversInParentProcess(null, "disk-space-watcher",
-                                                   data);
-      lowDiskMode = val;
-    }
-  }
-
-  { // Make sure opening works from the beginning.
-    info("Test 1");
-
-    setLowDiskMode(false);
-
-    let request = indexedDB.open(dbName, dbVersion);
-    request.onerror = errorHandler;
-    request.onsuccess = grabEventAndContinueHandler;
-    let event = yield undefined;
-
-    is(event.type, "success", "Opened database without setting low disk mode");
-
-    let db = event.target.result;
-    db.close();
-  }
-
-  { // Make sure delete works in low disk mode.
-    info("Test 2");
-
-    setLowDiskMode(true);
-
-    let request = indexedDB.deleteDatabase(dbName);
-    request.onerror = errorHandler;
-    request.onsuccess = grabEventAndContinueHandler;
-    let event = yield undefined;
-
-    is(event.type, "success", "Deleted database after setting low disk mode");
-  }
-
-  { // Make sure creating a db in low disk mode fails.
-    info("Test 3");
-
-    setLowDiskMode(true);
-
-    let request = indexedDB.open(dbName, dbVersion);
-    request.onerror = expectedErrorHandler("QuotaExceededError");
-    request.onupgradeneeded = unexpectedSuccessHandler;
-    request.onsuccess = unexpectedSuccessHandler;
-    let event = yield undefined;
-
-    is(event.type, "error", "Didn't create new database in low disk mode");
-  }
-
-  { // Make sure opening an already-existing db in low disk mode succeeds.
-    info("Test 4");
-
-    setLowDiskMode(false);
-
-    let request = indexedDB.open(dbName, dbVersion);
-    request.onerror = errorHandler;
-    request.onupgradeneeded = grabEventAndContinueHandler;
-    request.onsuccess = unexpectedSuccessHandler;
-    let event = yield undefined;
-
-    is(event.type, "upgradeneeded", "Upgrading database");
-
-    let db = event.target.result;
-    db.onerror = errorHandler;
-
-    request.onupgradeneeded = unexpectedSuccessHandler;
-    request.onsuccess = grabEventAndContinueHandler;
-    event = yield undefined;
-
-    is(event.type, "success", "Created database");
-    ok(event.target.result === db, "Got the same database");
-
-    db.close();
-
-    setLowDiskMode(true);
-
-    request = indexedDB.open(dbName);
-    request.onerror = errorHandler;
-    request.onupgradeneeded = unexpectedSuccessHandler;
-    request.onsuccess = grabEventAndContinueHandler;
-    event = yield undefined;
-
-    is(event.type, "success", "Opened existing database in low disk mode");
-
-    db = event.target.result;
-    db.close();
-  }
-
-  { // Make sure upgrading an already-existing db in low disk mode succeeds.
-    info("Test 5");
-
-    setLowDiskMode(true);
-
-    let request = indexedDB.open(dbName, dbVersion + 1);
-    request.onerror = errorHandler;
-    request.onupgradeneeded = grabEventAndContinueHandler;
-    request.onsuccess = unexpectedSuccessHandler;
-
-    let event = yield undefined;
-
-    is(event.type, "upgradeneeded", "Upgrading database");
-
-    let db = event.target.result;
-    db.onerror = errorHandler;
-
-    request.onupgradeneeded = unexpectedSuccessHandler;
-    request.onsuccess = grabEventAndContinueHandler;
-    event = yield undefined;
-
-    is(event.type, "success", "Created database");
-    ok(event.target.result === db, "Got the same database");
-
-    db.close();
-  }
-
-  { // Make sure creating objectStores in low disk mode fails.
-    info("Test 6");
-
-    setLowDiskMode(true);
-
-    let request = indexedDB.open(dbName, dbVersion + 2);
-    request.onerror = errorHandler;
-    request.onupgradeneeded = grabEventAndContinueHandler;
-    request.onsuccess = unexpectedSuccessHandler;
-
-    let event = yield undefined;
-
-    is(event.type, "upgradeneeded", "Upgrading database");
-
-    let db = event.target.result;
-    db.onerror = errorHandler;
-
-    let txn = event.target.transaction;
-    txn.onerror = expectedErrorHandler("AbortError");
-    txn.onabort = grabEventAndContinueHandler;
-
-    db.createObjectStore(objectStoreName, objectStoreOptions);
-
-    request.onupgradeneeded = unexpectedSuccessHandler;
-    event = yield undefined;
-
-    is(event.type, "abort", "Got correct event type");
-    is(event.target.error.name, "QuotaExceededError", "Got correct error type");
-
-    request.onerror = expectedErrorHandler("AbortError");
-    event = yield undefined;
-  }
-
-  { // Make sure creating indexes in low disk mode fails.
-    info("Test 7");
-
-    setLowDiskMode(false);
-
-    let request = indexedDB.open(dbName, dbVersion + 2);
-    request.onerror = errorHandler;
-    request.onupgradeneeded = grabEventAndContinueHandler;
-    request.onsuccess = unexpectedSuccessHandler;
-
-    let event = yield undefined;
-
-    is(event.type, "upgradeneeded", "Upgrading database");
-
-    let db = event.target.result;
-    db.onerror = errorHandler;
-
-    let objectStore = db.createObjectStore(objectStoreName, objectStoreOptions);
-
-    request.onupgradeneeded = unexpectedSuccessHandler;
-    request.onsuccess = grabEventAndContinueHandler;
-    event = yield undefined;
-
-    is(event.type, "success", "Upgraded database");
-    ok(event.target.result === db, "Got the same database");
-
-    db.close();
-
-    setLowDiskMode(true);
-
-    request = indexedDB.open(dbName, dbVersion + 3);
-    request.onerror = errorHandler;
-    request.onupgradeneeded = grabEventAndContinueHandler;
-    request.onsuccess = unexpectedSuccessHandler;
-    event = yield undefined;
-
-    is(event.type, "upgradeneeded", "Upgrading database");
-
-    db = event.target.result;
-    db.onerror = errorHandler;
-    let txn = event.target.transaction;
-    txn.onerror = expectedErrorHandler("AbortError");
-    txn.onabort = grabEventAndContinueHandler;
-
-    objectStore = event.target.transaction.objectStore(objectStoreName);
-    objectStore.createIndex(indexName, indexName, indexOptions);
-
-    request.onupgradeneeded = unexpectedSuccessHandler;
-    event = yield undefined;
-
-    is(event.type, "abort", "Got correct event type");
-    is(event.target.error.name, "QuotaExceededError", "Got correct error type");
-
-    request.onerror = expectedErrorHandler("AbortError");
-    event = yield undefined;
-  }
-
-  { // Make sure deleting indexes in low disk mode succeeds.
-    info("Test 8");
-
-    setLowDiskMode(false);
-
-    let request = indexedDB.open(dbName, dbVersion + 3);
-    request.onerror = errorHandler;
-    request.onupgradeneeded = grabEventAndContinueHandler;
-    request.onsuccess = unexpectedSuccessHandler;
-
-    let event = yield undefined;
-
-    is(event.type, "upgradeneeded", "Upgrading database");
-
-    let db = event.target.result;
-    db.onerror = errorHandler;
-
-    let objectStore = event.target.transaction.objectStore(objectStoreName);
-    objectStore.createIndex(indexName, indexName, indexOptions);
-
-    request.onupgradeneeded = unexpectedSuccessHandler;
-    request.onsuccess = grabEventAndContinueHandler;
-    event = yield undefined;
-
-    is(event.type, "success", "Upgraded database");
-    ok(event.target.result === db, "Got the same database");
-
-    db.close();
-
-    setLowDiskMode(true);
-
-    request = indexedDB.open(dbName, dbVersion + 4);
-    request.onerror = errorHandler;
-    request.onupgradeneeded = grabEventAndContinueHandler;
-    request.onsuccess = unexpectedSuccessHandler;
-    event = yield undefined;
-
-    is(event.type, "upgradeneeded", "Upgrading database");
-
-    db = event.target.result;
-    db.onerror = errorHandler;
-
-    objectStore = event.target.transaction.objectStore(objectStoreName);
-    objectStore.deleteIndex(indexName);
-
-    request.onupgradeneeded = unexpectedSuccessHandler;
-    request.onsuccess = grabEventAndContinueHandler;
-    event = yield undefined;
-
-    is(event.type, "success", "Upgraded database");
-    ok(event.target.result === db, "Got the same database");
-
-    db.close();
-  }
-
-  { // Make sure deleting objectStores in low disk mode succeeds.
-    info("Test 9");
-
-    setLowDiskMode(true);
-
-    let request = indexedDB.open(dbName, dbVersion + 5);
-    request.onerror = errorHandler;
-    request.onupgradeneeded = grabEventAndContinueHandler;
-    request.onsuccess = unexpectedSuccessHandler;
-
-    let event = yield undefined;
-
-    is(event.type, "upgradeneeded", "Upgrading database");
-
-    let db = event.target.result;
-    db.onerror = errorHandler;
-
-    db.deleteObjectStore(objectStoreName);
-
-    request.onupgradeneeded = unexpectedSuccessHandler;
-    request.onsuccess = grabEventAndContinueHandler;
-    event = yield undefined;
-
-    is(event.type, "success", "Upgraded database");
-    ok(event.target.result === db, "Got the same database");
-
-    db.close();
-
-    // Reset everything.
-    indexedDB.deleteDatabase(dbName);
-  }
-
-
-  { // Add data that the rest of the tests will use.
-    info("Adding test data");
-
-    setLowDiskMode(false);
-
-    let request = indexedDB.open(dbName, dbVersion);
-    request.onerror = errorHandler;
-    request.onupgradeneeded = grabEventAndContinueHandler;
-    request.onsuccess = unexpectedSuccessHandler;
-    let event = yield undefined;
-
-    is(event.type, "upgradeneeded", "Upgrading database");
-
-    let db = event.target.result;
-    db.onerror = errorHandler;
-
-    let objectStore = db.createObjectStore(objectStoreName, objectStoreOptions);
-    objectStore.createIndex(indexName, indexName, indexOptions);
-
-    for (let data of dbData) {
-      objectStore.add(data);
-    }
-
-    request.onupgradeneeded = unexpectedSuccessHandler;
-    request.onsuccess = grabEventAndContinueHandler;
-    event = yield undefined;
-
-    is(event.type, "success", "Upgraded database");
-    ok(event.target.result === db, "Got the same database");
-
-    db.close();
-  }
-
-  { // Make sure read operations in readonly transactions succeed in low disk
-    // mode.
-    info("Test 10");
-
-    setLowDiskMode(true);
-
-    let request = indexedDB.open(dbName, dbVersion);
-    request.onerror = errorHandler;
-    request.onupgradeneeded = unexpectedSuccessHandler;
-    request.onsuccess = grabEventAndContinueHandler;
-    let event = yield undefined;
-
-    let db = event.target.result;
-    db.onerror = errorHandler;
-
-    let transaction = db.transaction(objectStoreName);
-    let objectStore = transaction.objectStore(objectStoreName);
-    let index = objectStore.index(indexName);
-
-    let data = dbData[0];
-
-    let requestCounter = new RequestCounter();
-
-    objectStore.get(data.foo).onsuccess = requestCounter.handler();
-    objectStore.mozGetAll().onsuccess = requestCounter.handler();
-    objectStore.count().onsuccess = requestCounter.handler();
-    index.get(data.bar).onsuccess = requestCounter.handler();
-    index.mozGetAll().onsuccess = requestCounter.handler();
-    index.getKey(data.bar).onsuccess = requestCounter.handler();
-    index.mozGetAllKeys().onsuccess = requestCounter.handler();
-    index.count().onsuccess = requestCounter.handler();
-
-    let objectStoreDataCount = 0;
-
-    request = objectStore.openCursor();
-    request.onsuccess = function(event) {
-      let cursor = event.target.result;
-      if (cursor) {
-        objectStoreDataCount++;
-        objectStoreDataCount % 2 ? cursor.continue() : cursor.advance(1);
-      }
-      else {
-        is(objectStoreDataCount, dbData.length, "Saw all data");
-        requestCounter.decr();
-      }
-    };
-    requestCounter.incr();
-
-    let indexDataCount = 0;
-
-    request = index.openCursor();
-    request.onsuccess = function(event) {
-      let cursor = event.target.result;
-      if (cursor) {
-        indexDataCount++;
-        indexDataCount % 2 ? cursor.continue() : cursor.advance(1);
-      }
-      else {
-        is(indexDataCount, dbData.length, "Saw all data");
-        requestCounter.decr();
-      }
-    };
-    requestCounter.incr();
-
-    let indexKeyDataCount = 0;
-
-    request = index.openCursor();
-    request.onsuccess = function(event) {
-      let cursor = event.target.result;
-      if (cursor) {
-        indexKeyDataCount++;
-        indexKeyDataCount % 2 ? cursor.continue() : cursor.advance(1);
-      }
-      else {
-        is(indexKeyDataCount, dbData.length, "Saw all data");
-        requestCounter.decr();
-      }
-    };
-    requestCounter.incr();
-
-    // Wait for all requests.
-    yield undefined;
-
-    transaction.oncomplete = grabEventAndContinueHandler;
-    event = yield undefined;
-
-    is(event.type, "complete", "Transaction succeeded");
-
-    db.close();
-  }
-
-  { // Make sure read operations in readwrite transactions succeed in low disk
-    // mode.
-    info("Test 11");
-
-    setLowDiskMode(true);
-
-    let request = indexedDB.open(dbName, dbVersion);
-    request.onerror = errorHandler;
-    request.onupgradeneeded = unexpectedSuccessHandler;
-    request.onsuccess = grabEventAndContinueHandler;
-    let event = yield undefined;
-
-    let db = event.target.result;
-    db.onerror = errorHandler;
-
-    let transaction = db.transaction(objectStoreName, "readwrite");
-    let objectStore = transaction.objectStore(objectStoreName);
-    let index = objectStore.index(indexName);
-
-    let data = dbData[0];
-
-    let requestCounter = new RequestCounter();
-
-    objectStore.get(data.foo).onsuccess = requestCounter.handler();
-    objectStore.mozGetAll().onsuccess = requestCounter.handler();
-    objectStore.count().onsuccess = requestCounter.handler();
-    index.get(data.bar).onsuccess = requestCounter.handler();
-    index.mozGetAll().onsuccess = requestCounter.handler();
-    index.getKey(data.bar).onsuccess = requestCounter.handler();
-    index.mozGetAllKeys().onsuccess = requestCounter.handler();
-    index.count().onsuccess = requestCounter.handler();
-
-    let objectStoreDataCount = 0;
-
-    request = objectStore.openCursor();
-    request.onsuccess = function(event) {
-      let cursor = event.target.result;
-      if (cursor) {
-        objectStoreDataCount++;
-        objectStoreDataCount % 2 ? cursor.continue() : cursor.advance(1);
-      }
-      else {
-        is(objectStoreDataCount, dbData.length, "Saw all data");
-        requestCounter.decr();
-      }
-    };
-    requestCounter.incr();
-
-    let indexDataCount = 0;
-
-    request = index.openCursor();
-    request.onsuccess = function(event) {
-      let cursor = event.target.result;
-      if (cursor) {
-        indexDataCount++;
-        indexDataCount % 2 ? cursor.continue() : cursor.advance(1);
-      }
-      else {
-        is(indexDataCount, dbData.length, "Saw all data");
-        requestCounter.decr();
-      }
-    };
-    requestCounter.incr();
-
-    let indexKeyDataCount = 0;
-
-    request = index.openCursor();
-    request.onsuccess = function(event) {
-      let cursor = event.target.result;
-      if (cursor) {
-        indexKeyDataCount++;
-        indexKeyDataCount % 2 ? cursor.continue() : cursor.advance(1);
-      }
-      else {
-        is(indexKeyDataCount, dbData.length, "Saw all data");
-        requestCounter.decr();
-      }
-    };
-    requestCounter.incr();
-
-    // Wait for all requests.
-    yield undefined;
-
-    transaction.oncomplete = grabEventAndContinueHandler;
-    event = yield undefined;
-
-    is(event.type, "complete", "Transaction succeeded");
-
-    db.close();
-  }
-
-  { // Make sure write operations in readwrite transactions fail in low disk
-    // mode.
-    info("Test 12");
-
-    setLowDiskMode(true);
-
-    let request = indexedDB.open(dbName, dbVersion);
-    request.onerror = errorHandler;
-    request.onupgradeneeded = unexpectedSuccessHandler;
-    request.onsuccess = grabEventAndContinueHandler;
-    let event = yield undefined;
-
-    let db = event.target.result;
-    db.onerror = errorHandler;
-
-    let transaction = db.transaction(objectStoreName, "readwrite");
-    let objectStore = transaction.objectStore(objectStoreName);
-    let index = objectStore.index(indexName);
-
-    let data = dbData[0];
-    let newData = { foo: 999, bar: 999 };
-
-    let requestCounter = new RequestCounter();
-
-    objectStore.add(newData).onerror = requestCounter.errorHandler();
-    objectStore.put(newData).onerror = requestCounter.errorHandler();
-
-    objectStore.get(data.foo).onsuccess = requestCounter.handler();
-    objectStore.mozGetAll().onsuccess = requestCounter.handler();
-    objectStore.count().onsuccess = requestCounter.handler();
-    index.get(data.bar).onsuccess = requestCounter.handler();
-    index.mozGetAll().onsuccess = requestCounter.handler();
-    index.getKey(data.bar).onsuccess = requestCounter.handler();
-    index.mozGetAllKeys().onsuccess = requestCounter.handler();
-    index.count().onsuccess = requestCounter.handler();
-
-    let objectStoreDataCount = 0;
-
-    request = objectStore.openCursor();
-    request.onsuccess = function(event) {
-      let cursor = event.target.result;
-      if (cursor) {
-        objectStoreDataCount++;
-        cursor.update(cursor.value).onerror = requestCounter.errorHandler();
-        objectStoreDataCount % 2 ? cursor.continue() : cursor.advance(1);
-      }
-      else {
-        is(objectStoreDataCount, dbData.length, "Saw all data");
-        requestCounter.decr();
-      }
-    };
-    requestCounter.incr();
-
-    let indexDataCount = 0;
-
-    request = index.openCursor();
-    request.onsuccess = function(event) {
-      let cursor = event.target.result;
-      if (cursor) {
-        indexDataCount++;
-        cursor.update(cursor.value).onerror = requestCounter.errorHandler();
-        indexDataCount % 2 ? cursor.continue() : cursor.advance(1);
-      }
-      else {
-        is(indexDataCount, dbData.length, "Saw all data");
-        requestCounter.decr();
-      }
-    };
-    requestCounter.incr();
-
-    let indexKeyDataCount = 0;
-
-    request = index.openCursor();
-    request.onsuccess = function(event) {
-      let cursor = event.target.result;
-      if (cursor) {
-        indexKeyDataCount++;
-        cursor.update(cursor.value).onerror = requestCounter.errorHandler();
-        indexKeyDataCount % 2 ? cursor.continue() : cursor.advance(1);
-      }
-      else {
-        is(indexKeyDataCount, dbData.length, "Saw all data");
-        requestCounter.decr();
-      }
-    };
-    requestCounter.incr();
-
-    // Wait for all requests.
-    yield undefined;
-
-    transaction.oncomplete = grabEventAndContinueHandler;
-    event = yield undefined;
-
-    is(event.type, "complete", "Transaction succeeded");
-
-    db.close();
-  }
-
-  { // Make sure deleting operations in readwrite transactions succeed in low
-    // disk mode.
-    info("Test 13");
-
-    setLowDiskMode(true);
-
-    let request = indexedDB.open(dbName, dbVersion);
-    request.onerror = errorHandler;
-    request.onupgradeneeded = unexpectedSuccessHandler;
-    request.onsuccess = grabEventAndContinueHandler;
-    let event = yield undefined;
-
-    let db = event.target.result;
-    db.onerror = errorHandler;
-
-    let transaction = db.transaction(objectStoreName, "readwrite");
-    let objectStore = transaction.objectStore(objectStoreName);
-    let index = objectStore.index(indexName);
-
-    let dataIndex = 0;
-    let data = dbData[dataIndex++];
-
-    let requestCounter = new RequestCounter();
-
-    objectStore.delete(data.foo).onsuccess = requestCounter.handler();
-
-    objectStore.openCursor().onsuccess = function(event) {
-      let cursor = event.target.result;
-      if (cursor) {
-        cursor.delete().onsuccess = requestCounter.handler();
-      }
-      requestCounter.decr();
-    };
-    requestCounter.incr();
-
-    index.openCursor(null, "prev").onsuccess = function(event) {
-      let cursor = event.target.result;
-      if (cursor) {
-        cursor.delete().onsuccess = requestCounter.handler();
-      }
-      requestCounter.decr();
-    };
-    requestCounter.incr();
-
-    yield undefined;
-
-    objectStore.count().onsuccess = grabEventAndContinueHandler;
-    event = yield undefined;
-
-    is(event.target.result, dbData.length - 3, "Actually deleted something");
-
-    objectStore.clear();
-    objectStore.count().onsuccess = grabEventAndContinueHandler;
-    event = yield undefined;
-
-    is(event.target.result, 0, "Actually cleared");
-
-    transaction.oncomplete = grabEventAndContinueHandler;
-    event = yield undefined;
-
-    is(event.type, "complete", "Transaction succeeded");
-
-    db.close();
-  }
-
-  finishTest();
-}
-
-function RequestCounter(expectedType) {
-  this._counter = 0;
-}
-RequestCounter.prototype = {
-  incr() {
-    this._counter++;
-  },
-
-  decr() {
-    if (!--this._counter) {
-      continueToNextStepSync();
-    }
-  },
-
-  handler(type, preventDefault) {
-    this.incr();
-    return event => {
-      is(event.type, type || "success", "Correct type");
-      this.decr();
-    };
-  },
-
-  errorHandler(eventType, errorName) {
-    this.incr();
-    return event => {
-      is(event.type, eventType || "error", "Correct type");
-      is(event.target.error.name, errorName || "QuotaExceededError",
-          "Correct error name");
-      event.preventDefault();
-      event.stopPropagation();
-      this.decr();
-    };
-  }
-};
--- a/dom/indexedDB/test/unit/xpcshell-head-parent-process.js
+++ b/dom/indexedDB/test/unit/xpcshell-head-parent-process.js
@@ -56,19 +56,16 @@ if (!this.runTest) {
   };
 }
 
 function finishTest()
 {
   if (SpecialPowers.isMainProcess()) {
     resetExperimental();
     resetTesting();
-
-    SpecialPowers.notifyObserversInParentProcess(null, "disk-space-watcher",
-                                                 "free");
   }
 
   SpecialPowers.removeFiles();
 
   executeSoon(function() {
     do_test_finished();
   });
 }
--- a/dom/indexedDB/test/unit/xpcshell-parent-process.ini
+++ b/dom/indexedDB/test/unit/xpcshell-parent-process.ini
@@ -42,17 +42,16 @@ support-files =
 [test_file_copy_failure.js]
 [test_idbSubdirUpgrade.js]
 [test_globalObjects_ipc.js]
 skip-if = toolkit == 'android'
 [test_idle_maintenance.js]
 [test_invalidate.js]
 # disabled for the moment.
 skip-if = true
-[test_lowDiskSpace.js]
 [test_maximal_serialized_object_size.js]
 [test_metadata2Restore.js]
 [test_metadataRestore.js]
 [test_mutableFileUpgrade.js]
 [test_oldDirectories.js]
 [test_quotaExceeded_recovery.js]
 [test_readwriteflush_disabled.js]
 [test_schema18upgrade.js]
--- a/dom/storage/LocalStorageCache.cpp
+++ b/dom/storage/LocalStorageCache.cpp
@@ -240,22 +240,16 @@ LocalStorageCache::ProcessUsageDelta(con
   return ProcessUsageDelta(GetDataSetIndex(aStorage), aDelta, aSource);
 }
 
 bool
 LocalStorageCache::ProcessUsageDelta(uint32_t aGetDataSetIndex,
                                      const int64_t aDelta,
                                      const MutationSource aSource)
 {
-  // Check if we are in a low disk space situation
-  if (aSource == ContentMutation &&
-      aDelta > 0 && mManager && mManager->IsLowDiskSpace()) {
-    return false;
-  }
-
   // Check limit per this origin
   Data& data = mData[aGetDataSetIndex];
   uint64_t newOriginUsage = data.mOriginQuotaUsage + aDelta;
   if (aSource == ContentMutation &&
       aDelta > 0 && newOriginUsage > LocalStorageManager::GetQuota()) {
     return false;
   }
 
--- a/dom/storage/LocalStorageManager.cpp
+++ b/dom/storage/LocalStorageManager.cpp
@@ -55,17 +55,16 @@ LocalStorageManager::GetQuota()
   return gQuotaLimit * 1024; // pref is in kBs
 }
 
 NS_IMPL_ISUPPORTS(LocalStorageManager,
                   nsIDOMStorageManager)
 
 LocalStorageManager::LocalStorageManager()
   : mCaches(8)
-  , mLowDiskSpace(false)
 {
   StorageObserver* observer = StorageObserver::Self();
   NS_ASSERTION(observer, "No StorageObserver, cannot observe private data delete notifications!");
 
   if (observer) {
     observer->AddSink(this);
   }
 
@@ -446,26 +445,16 @@ LocalStorageManager::Observe(const char*
 
   if (!strcmp(aTopic, "profile-change")) {
     // For case caches are still referenced - clear them completely
     ClearCaches(LocalStorageCache::kUnloadComplete, pattern, EmptyCString());
     mCaches.Clear();
     return NS_OK;
   }
 
-  if (!strcmp(aTopic, "low-disk-space")) {
-    mLowDiskSpace = true;
-    return NS_OK;
-  }
-
-  if (!strcmp(aTopic, "no-low-disk-space")) {
-    mLowDiskSpace = false;
-    return NS_OK;
-  }
-
 #ifdef DOM_STORAGE_TESTS
   if (!strcmp(aTopic, "test-reload")) {
     // This immediately completely reloads all caches from the database.
     ClearCaches(LocalStorageCache::kTestReload, pattern, EmptyCString());
     return NS_OK;
   }
 
   if (!strcmp(aTopic, "test-flushed")) {
--- a/dom/storage/LocalStorageManager.h
+++ b/dom/storage/LocalStorageManager.h
@@ -105,22 +105,16 @@ private:
                               const nsAString& aDocumentURI,
                               bool aPrivate,
                               Storage** aRetval);
 
   // Suffix->origin->cache map
   typedef nsTHashtable<LocalStorageCacheHashKey> CacheOriginHashtable;
   nsClassHashtable<nsCStringHashKey, CacheOriginHashtable> mCaches;
 
-  // If mLowDiskSpace is true it indicates a low device storage situation and
-  // so no localStorage writes are allowed. sessionStorage writes are still
-  // allowed.
-  bool mLowDiskSpace;
-  bool IsLowDiskSpace() const { return mLowDiskSpace; };
-
   void ClearCaches(uint32_t aUnloadFlags,
                    const OriginAttributesPattern& aPattern,
                    const nsACString& aKeyPrefix);
 
   // Global getter of localStorage manager service
   static LocalStorageManager* Self() { return sSelf; }
 
   // Like Self, but creates an instance if we're not yet initialized.
--- a/dom/storage/StorageIPC.cpp
+++ b/dom/storage/StorageIPC.cpp
@@ -10,17 +10,16 @@
 
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/ipc/BackgroundChild.h"
 #include "mozilla/ipc/BackgroundParent.h"
 #include "mozilla/ipc/PBackgroundChild.h"
 #include "mozilla/ipc/PBackgroundParent.h"
 #include "mozilla/Unused.h"
-#include "nsIDiskSpaceWatcher.h"
 #include "nsThreadUtils.h"
 
 namespace mozilla {
 namespace dom {
 
 namespace {
 
 typedef nsClassHashtable<nsCStringHashKey, nsTArray<LocalStorageCacheParent*>>
@@ -620,70 +619,16 @@ StorageDBParent::ReleaseIPDLReference()
 {
   MOZ_ASSERT(mIPCOpen, "Attempting to release non-existent IPDL reference");
   mIPCOpen = false;
   Release();
 }
 
 namespace {
 
-class CheckLowDiskSpaceRunnable
-  : public Runnable
-{
-  nsCOMPtr<nsIEventTarget> mOwningEventTarget;
-  RefPtr<StorageDBParent> mParent;
-  bool mLowDiskSpace;
-
-public:
-  explicit CheckLowDiskSpaceRunnable(StorageDBParent* aParent)
-    : Runnable("dom::CheckLowDiskSpaceRunnable")
-    , mOwningEventTarget(GetCurrentThreadEventTarget())
-    , mParent(aParent)
-    , mLowDiskSpace(false)
-  {
-    AssertIsOnBackgroundThread();
-    MOZ_ASSERT(aParent);
-  }
-
-private:
-  NS_IMETHOD Run() override
-  {
-    if (IsOnBackgroundThread()) {
-      MOZ_ASSERT(mParent);
-
-      if (!mParent->IPCOpen()) {
-        return NS_OK;
-      }
-
-      if (mLowDiskSpace) {
-        mozilla::Unused << mParent->SendObserve(
-          nsDependentCString("low-disk-space"), EmptyString(), EmptyCString());
-      }
-
-      mParent = nullptr;
-
-      return NS_OK;
-    }
-
-    MOZ_ASSERT(NS_IsMainThread());
-
-    nsCOMPtr<nsIDiskSpaceWatcher> diskSpaceWatcher =
-      do_GetService("@mozilla.org/toolkit/disk-space-watcher;1");
-    if (!diskSpaceWatcher) {
-      return NS_OK;
-    }
-
-    diskSpaceWatcher->GetIsDiskFull(&mLowDiskSpace);
-
-    MOZ_ALWAYS_SUCCEEDS(mOwningEventTarget->Dispatch(this, NS_DISPATCH_NORMAL));
-
-    return NS_OK;
-  }
-};
-
 } // namespace
 
 StorageDBParent::StorageDBParent(const nsString& aProfilePath)
   : mProfilePath(aProfilePath)
   , mIPCOpen(false)
 {
   AssertIsOnBackgroundThread();
 
@@ -715,24 +660,16 @@ StorageDBParent::Init()
   }
 
   StorageDBThread* storageThread = StorageDBThread::Get();
   if (storageThread) {
     InfallibleTArray<nsCString> scopes;
     storageThread->GetOriginsHavingData(&scopes);
     mozilla::Unused << SendOriginsHavingData(scopes);
   }
-
-  // We need to check if the device is in a low disk space situation, so
-  // we can forbid in that case any write in localStorage.
-
-  RefPtr<CheckLowDiskSpaceRunnable> runnable =
-    new CheckLowDiskSpaceRunnable(this);
-
-  MOZ_ALWAYS_SUCCEEDS(NS_DispatchToMainThread(runnable));
 }
 
 StorageDBParent::CacheParentBridge*
 StorageDBParent::NewCache(const nsACString& aOriginSuffix,
                           const nsACString& aOriginNoSuffix)
 {
   return new CacheParentBridge(this, aOriginSuffix, aOriginNoSuffix);
 }
--- a/dom/storage/StorageObserver.cpp
+++ b/dom/storage/StorageObserver.cpp
@@ -69,19 +69,16 @@ StorageObserver::Init()
   obs->AddObserver(sSelf, "extension:purge-localStorage", true);
 
   // Shutdown
   obs->AddObserver(sSelf, "profile-after-change", true);
   if (XRE_IsParentProcess()) {
     obs->AddObserver(sSelf, "profile-before-change", true);
   }
 
-  // Observe low device storage notifications.
-  obs->AddObserver(sSelf, "disk-space-watcher", true);
-
   // Testing
 #ifdef DOM_STORAGE_TESTS
   Preferences::RegisterCallbackAndCall(TestingPrefChanged, kTestingPref);
 #endif
 
   return NS_OK;
 }
 
@@ -405,26 +402,16 @@ StorageObserver::Observe(nsISupports* aS
       MOZ_ALWAYS_TRUE(SpinEventLoopUntil([&]() { return done; }));
 
       mBackgroundThread = nullptr;
     }
 
     return NS_OK;
   }
 
-  if (!strcmp(aTopic, "disk-space-watcher")) {
-    if (NS_LITERAL_STRING("full").Equals(aData)) {
-      Notify("low-disk-space");
-    } else if (NS_LITERAL_STRING("free").Equals(aData)) {
-      Notify("no-low-disk-space");
-    }
-
-    return NS_OK;
-  }
-
 #ifdef DOM_STORAGE_TESTS
   if (!strcmp(aTopic, "domstorage-test-flush-force")) {
     StorageDBChild* storageChild = StorageDBChild::GetOrCreate();
     if (NS_WARN_IF(!storageChild)) {
       return NS_ERROR_FAILURE;
     }
 
     storageChild->SendAsyncFlush();
--- a/dom/tests/mochitest/ajax/offline/mochitest.ini
+++ b/dom/tests/mochitest/ajax/offline/mochitest.ini
@@ -75,18 +75,16 @@ support-files =
 [test_bug744719.html]
 [test_bug765203.html]
 [test_bypass.html]
 [test_cancelOfflineCache.html]
 [test_changingManifest.html]
 [test_fallback.html]
 [test_foreign.html]
 [test_identicalManifest.html]
-[test_lowDeviceStorage.html]
-[test_lowDeviceStorageDuringUpdate.html]
 [test_missingFile.html]
 [test_missingManifest.html]
 [test_noManifest.html]
 [test_obsolete.html]
 [test_offlineIFrame.html]
 [test_offlineMode.html]
 skip-if = true # disabled due to bug 656943
 [test_overlap.html]
deleted file mode 100644
--- a/dom/tests/mochitest/ajax/offline/test_lowDeviceStorage.html
+++ /dev/null
@@ -1,91 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<title>Low device storage</title>
-
-<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-<script type="text/javascript" src="/tests/dom/tests/mochitest/ajax/offline/offlineTests.js"></script>
-<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-
-<script type="text/javascript">
-
-/**
- * This test checks that an offline cache update scheduled *after* a low device
- * storage situation appears is canceled. It basically does:
- *
- * 1. Notifies to the offline cache update service about a fake
- *    low device storage situation.
- * 2. Schedules an update and observes for its notifications.
- * 3. We are supposed to receive an error event notifying about the cancelation
- *    of the update because of the low storage situation.
- * 4. Notifies to the offline cache update service that we've recovered from
- *    the low storage situation.
- */
-
-var updateService = SpecialPowers.Cc['@mozilla.org/offlinecacheupdate-service;1']
-                                 .getService(Ci.nsIOfflineCacheUpdateService);
-
-var obs = SpecialPowers.Cc["@mozilla.org/observer-service;1"]
-                       .getService(SpecialPowers.Ci.nsIObserverService);
-
-var errorReceived = false;
-
-var systemPrincipal = SpecialPowers.Services.scriptSecurityManager.getSystemPrincipal();
-
-function finish() {
-  obs.notifyObservers(updateService, "disk-space-watcher", "free");
-
-  OfflineTest.teardownAndFinish();
-}
-
-if (OfflineTest.setup()) {
-  obs.notifyObservers(updateService, "disk-space-watcher", "full");
-
-  var updateObserver = SpecialPowers.wrapCallbackObject({
-    updateStateChanged: function (aUpdate, aState) {
-      switch(aState) {
-        case Ci.nsIOfflineCacheUpdateObserver.STATE_ERROR:
-          errorReceived = true;
-          OfflineTest.ok(true, "Expected error. Update canceled");
-        break;
-        case Ci.nsIOfflineCacheUpdateObserver.STATE_FINISHED:
-          aUpdate.removeObserver(this);
-          OfflineTest.ok(errorReceived,
-                         "Finished after receiving the expected error");
-          finish();
-        break;
-        case Ci.nsIOfflineCacheUpdateObserver.STATE_NOUPDATE:
-          aUpdate.removeObserver(this);
-          OfflineTest.ok(false, "No update");
-          finish();
-          break;
-        case Ci.nsIOfflineCacheUpdateObserver.STATE_DOWNLOADING:
-        case Ci.nsIOfflineCacheUpdateObserver.STATE_ITEMSTARTED:
-        case Ci.nsIOfflineCacheUpdateObserver.STATE_ITEMPROGRESS:
-          aUpdate.removeObserver(this);
-          OfflineTest.ok(false, "The update was supposed to be canceled");
-          finish();
-          break;
-      }
-    },
-    applicationCacheAvailable: function() {}
-  });
-
-  var manifest = "https://example.com/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest";
-  var ioService = Cc["@mozilla.org/network/io-service;1"]
-                  .getService(Ci.nsIIOService);
-  var manifestURI = ioService.newURI(manifest);
-  var documentURI = ioService.newURI(document.documentURI);
-  var update = updateService.scheduleUpdate(manifestURI, documentURI, systemPrincipal, window);
-  update.addObserver(updateObserver, false);
-}
-
-SimpleTest.waitForExplicitFinish();
-
-</script>
-
-</head>
-
-<body>
-
-</body>
-</html>
deleted file mode 100644
--- a/dom/tests/mochitest/ajax/offline/test_lowDeviceStorageDuringUpdate.html
+++ /dev/null
@@ -1,58 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml" manifest="https://example.com/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest">
-<head>
-<title>Low device storage during update</title>
-
-<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-<script type="text/javascript" src="/tests/dom/tests/mochitest/ajax/offline/offlineTests.js"></script>
-<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-
-<script type="text/javascript">
-
-/**
- * This test checks that an offline cache update is canceled when a low device
- * storage condition is detected during the update.
- */
-
-var updateService = Cc['@mozilla.org/offlinecacheupdate-service;1']
-                    .getService(Ci.nsIOfflineCacheUpdateService);
-
-var obs = SpecialPowers.Cc["@mozilla.org/observer-service;1"]
-                       .getService(SpecialPowers.Ci.nsIObserverService);
-
-function finish() {
-  obs.notifyObservers(updateService, "disk-space-watcher", "free");
-
-  OfflineTest.teardownAndFinish();
-}
-
-function onError() {
-  OfflineTest.ok(true, "Expected error: Update canceled");
-  finish();
-}
-
-function onUnexpectedEvent() {
-  OfflineTest.ok(false, "The update was supposed to be canceled");
-  finish();
-}
-
-function onChecking() {
-  obs.notifyObservers(updateService, "disk-space-watcher", "full");
-}
-
-if (OfflineTest.setup()) {
-  applicationCache.onerror = OfflineTest.priv(onError);
-  applicationCache.onprogress = OfflineTest.priv(onUnexpectedEvent);
-  applicationCache.oncached = OfflineTest.priv(onUnexpectedEvent);
-  applicationCache.onchecking = OfflineTest.priv(onChecking);
-}
-
-SimpleTest.waitForExplicitFinish();
-
-</script>
-
-</head>
-
-<body>
-
-</body>
-</html>
--- a/dom/tests/mochitest/localstorage/mochitest.ini
+++ b/dom/tests/mochitest/localstorage/mochitest.ini
@@ -43,13 +43,11 @@ skip-if = toolkit == 'android' #TIMED_OU
 [test_localStorageQuota.html]
 skip-if = toolkit == 'android' #TIMED_OUT
 [test_localStorageQuotaSessionOnly.html]
 skip-if = toolkit == 'android' || (verify && (os == 'linux' || os == 'win')) #TIMED_OUT
 [test_localStorageQuotaSessionOnly2.html]
 skip-if = true # bug 1347690
 [test_localStorageReplace.html]
 skip-if = toolkit == 'android'
-[test_lowDeviceStorage.html]
-skip-if = verify
 [test_storageConstructor.html]
 [test_localStorageSessionPrefOverride.html]
 [test_firstPartyOnlyPermission.html]
deleted file mode 100644
--- a/dom/tests/mochitest/localstorage/test_lowDeviceStorage.html
+++ /dev/null
@@ -1,75 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<title>Test localStorage usage while in a low device storage situation</title>
-
-<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-
-<script type="text/javascript">
-
-/*
-This test does the following:
-- Stores an item in localStorage.
-- Checks the stored value.
-- Emulates a low device storage situation.
-- Gets the stored item again.
-- Removes the stored item.
-- Fails storing a new value.
-- Emulates recovering from a low device storage situation.
-- Stores a new value.
-- Checks the stored value.
-*/
-
-function lowDeviceStorage(lowStorage) {
-  var data = lowStorage ? "full" : "free";
-  SpecialPowers.Services.obs.notifyObservers(null, "disk-space-watcher", data);
-}
-
-function startTest() {
-  // Add a test item.
-  localStorage.setItem("item", "value");
-  is(localStorage.getItem("item"), "value", "getItem()");
-
-  // Emulates a low device storage situation.
-  lowDeviceStorage(true);
-
-  // Checks that we can still access to the stored item.
-  is(localStorage.getItem("item"), "value",
-     "getItem() during a device storage situation");
-
-  // Removes the stored item.
-  localStorage.removeItem("item");
-  is(localStorage.getItem("item"), null,
-     "getItem() after removing the item");
-
-  // Fails storing a new item.
-  try {
-    localStorage.setItem("newItem", "value");
-    ok(false, "Storing a new item is expected to fail");
-  } catch(e) {
-    ok(true, "Got an expected exception " + e);
-  } finally {
-    is(localStorage.getItem("newItem"), null,
-       "setItem while device storage is low");
-  }
-
-  // Emulates recovering from a low device storage situation.
-  lowDeviceStorage(false);
-
-  // Add a test item after recovering from the low device storage situation.
-  localStorage.setItem("newItem", "value");
-  is(localStorage.getItem("newItem"), "value",
-     "getItem() with available storage");
-
-  SimpleTest.finish();
-}
-
-SimpleTest.waitForExplicitFinish();
-
-</script>
-
-</head>
-
-<body onload="startTest();">
-</body>
-</html>
--- a/hal/Hal.cpp
+++ b/hal/Hal.cpp
@@ -76,22 +76,16 @@ AssertMainThread()
 }
 
 bool
 InSandbox()
 {
   return GeckoProcessType_Content == XRE_GetProcessType();
 }
 
-void
-AssertMainProcess()
-{
-  MOZ_ASSERT(GeckoProcessType_Default == XRE_GetProcessType());
-}
-
 bool
 WindowIsActive(nsPIDOMWindowInner* aWindow)
 {
   nsIDocument* document = aWindow->GetDoc();
   NS_ENSURE_TRUE(document, false);
 
   return !document->Hidden();
 }
@@ -533,32 +527,16 @@ ProcessPriorityToString(ProcessPriority 
     return "UNKNOWN";
   default:
     MOZ_ASSERT(false);
     return "???";
   }
 }
 
 void
-StartDiskSpaceWatcher()
-{
-  AssertMainProcess();
-  AssertMainThread();
-  PROXY_IF_SANDBOXED(StartDiskSpaceWatcher());
-}
-
-void
-StopDiskSpaceWatcher()
-{
-  AssertMainProcess();
-  AssertMainThread();
-  PROXY_IF_SANDBOXED(StopDiskSpaceWatcher());
-}
-
-void
 Init()
 {
   MOZ_ASSERT(!sInitialized);
 
   if (!InSandbox()) {
     gLastIDToVibrate = new WindowIdentifier::IDArrayType();
   }
 
--- a/hal/Hal.h
+++ b/hal/Hal.h
@@ -252,30 +252,16 @@ bool SetProcessPrioritySupported();
  * Set the priority of the given process.
  *
  * Exactly what this does will vary between platforms.  On *nix we might give
  * background processes higher nice values.  On other platforms, we might
  * ignore this call entirely.
  */
 void SetProcessPriority(int aPid, hal::ProcessPriority aPriority);
 
-/**
- * Start monitoring disk space for low space situations.
- *
- * This API is currently only allowed to be used from the main process.
- */
-void StartDiskSpaceWatcher();
-
-/**
- * Stop monitoring disk space for low space situations.
- *
- * This API is currently only allowed to be used from the main process.
- */
-void StopDiskSpaceWatcher();
-
 } // namespace MOZ_HAL_NAMESPACE
 } // namespace mozilla
 
 #ifdef MOZ_DEFINED_HAL_NAMESPACE
 # undef MOZ_DEFINED_HAL_NAMESPACE
 # undef MOZ_HAL_NAMESPACE
 #endif
 
deleted file mode 100644
--- a/hal/fallback/FallbackDiskSpaceWatcher.cpp
+++ /dev/null
@@ -1,19 +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/. */
-
-namespace mozilla {
-namespace hal_impl {
-
-void
-StartDiskSpaceWatcher()
-{
-}
-
-void
-StopDiskSpaceWatcher()
-{
-}
-
-} // namespace hal_impl
-} // namespace mozilla
--- a/hal/moz.build
+++ b/hal/moz.build
@@ -99,21 +99,16 @@ else:
     UNIFIED_SOURCES += [
         'fallback/FallbackBattery.cpp',
         'fallback/FallbackProcessPriority.cpp',
         'fallback/FallbackScreenConfiguration.cpp',
         'fallback/FallbackSensor.cpp',
         'fallback/FallbackVibration.cpp',
     ]
 
-# Fallbacks for backends no longer implemented.
-UNIFIED_SOURCES += [
-    'fallback/FallbackDiskSpaceWatcher.cpp',
-]
-
 # Fallbacks for backends implemented on Android only.
 if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android':
     UNIFIED_SOURCES += [
         'fallback/FallbackNetwork.cpp',
     ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     UNIFIED_SOURCES += [
--- a/hal/sandbox/SandboxHal.cpp
+++ b/hal/sandbox/SandboxHal.cpp
@@ -200,28 +200,16 @@ SetProcessPriority(int aPid, ProcessPrio
 }
 
 bool
 SetProcessPrioritySupported()
 {
   MOZ_CRASH("Only the main process may call SetProcessPrioritySupported().");
 }
 
-void
-StartDiskSpaceWatcher()
-{
-  MOZ_CRASH("StartDiskSpaceWatcher() can't be called from sandboxed contexts.");
-}
-
-void
-StopDiskSpaceWatcher()
-{
-  MOZ_CRASH("StopDiskSpaceWatcher() can't be called from sandboxed contexts.");
-}
-
 class HalParent : public PHalParent
                 , public BatteryObserver
                 , public NetworkObserver
                 , public ISensorObserver
                 , public WakeLockObserver
                 , public ScreenConfigurationObserver
 {
 public:
deleted file mode 100644
--- a/toolkit/components/diskspacewatcher/DiskSpaceWatcher.cpp
+++ /dev/null
@@ -1,157 +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 "DiskSpaceWatcher.h"
-#include "nsIObserverService.h"
-#include "nsXULAppAPI.h"
-#include "mozilla/Hal.h"
-#include "mozilla/ModuleUtils.h"
-#include "mozilla/Preferences.h"
-#include "mozilla/ClearOnShutdown.h"
-#include "mozilla/Services.h"
-
-#define NS_DISKSPACEWATCHER_CID \
-  { 0xab218518, 0xf197, 0x4fb4, { 0x8b, 0x0f, 0x8b, 0xb3, 0x4d, 0xf2, 0x4b, 0xf4 } }
-
-using namespace mozilla;
-
-StaticRefPtr<DiskSpaceWatcher> gDiskSpaceWatcher;
-
-NS_IMPL_ISUPPORTS(DiskSpaceWatcher, nsIDiskSpaceWatcher, nsIObserver)
-
-uint64_t DiskSpaceWatcher::sFreeSpace = 0;
-bool DiskSpaceWatcher::sIsDiskFull = false;
-
-DiskSpaceWatcher::DiskSpaceWatcher()
-{
-  MOZ_ASSERT(NS_IsMainThread());
-  MOZ_ASSERT(!gDiskSpaceWatcher);
-}
-
-DiskSpaceWatcher::~DiskSpaceWatcher()
-{
-  MOZ_ASSERT(!gDiskSpaceWatcher);
-}
-
-already_AddRefed<DiskSpaceWatcher>
-DiskSpaceWatcher::FactoryCreate()
-{
-  if (!XRE_IsParentProcess()) {
-    return nullptr;
-  }
-
-  MOZ_ASSERT(NS_IsMainThread());
-
-  if (!Preferences::GetBool("disk_space_watcher.enabled", false)) {
-    return nullptr;
-  }
-
-  if (!gDiskSpaceWatcher) {
-    gDiskSpaceWatcher = new DiskSpaceWatcher();
-    ClearOnShutdown(&gDiskSpaceWatcher);
-  }
-
-  RefPtr<DiskSpaceWatcher> service = gDiskSpaceWatcher.get();
-  return service.forget();
-}
-
-NS_IMETHODIMP
-DiskSpaceWatcher::Observe(nsISupports* aSubject, const char* aTopic,
-                          const char16_t* aData)
-{
-  MOZ_ASSERT(NS_IsMainThread());
-
-  if (!strcmp(aTopic, "profile-after-change")) {
-    nsCOMPtr<nsIObserverService> observerService =
-      mozilla::services::GetObserverService();
-    observerService->AddObserver(this, "profile-before-change", false);
-    mozilla::hal::StartDiskSpaceWatcher();
-    return NS_OK;
-  }
-
-  if (!strcmp(aTopic, "profile-before-change")) {
-    nsCOMPtr<nsIObserverService> observerService =
-      mozilla::services::GetObserverService();
-    observerService->RemoveObserver(this, "profile-before-change");
-    mozilla::hal::StopDiskSpaceWatcher();
-    return NS_OK;
-  }
-
-  MOZ_ASSERT(false, "DiskSpaceWatcher got unexpected topic!");
-  return NS_ERROR_UNEXPECTED;
-}
-
-NS_IMETHODIMP DiskSpaceWatcher::GetIsDiskFull(bool* aIsDiskFull)
-{
-  *aIsDiskFull = sIsDiskFull;
-  return NS_OK;
-}
-
-// GetFreeSpace is a macro on windows, and that messes up with the c++
-// compiler.
-#ifdef XP_WIN
-#undef GetFreeSpace
-#endif
-NS_IMETHODIMP DiskSpaceWatcher::GetFreeSpace(uint64_t* aFreeSpace)
-{
-  *aFreeSpace = sFreeSpace;
-  return NS_OK;
-}
-
-// static
-void DiskSpaceWatcher::UpdateState(bool aIsDiskFull, uint64_t aFreeSpace)
-{
-  MOZ_ASSERT(NS_IsMainThread());
-  if (!gDiskSpaceWatcher) {
-    return;
-  }
-
-  nsCOMPtr<nsIObserverService> observerService =
-    mozilla::services::GetObserverService();
-
-  sIsDiskFull = aIsDiskFull;
-  sFreeSpace = aFreeSpace;
-
-  if (!observerService) {
-    return;
-  }
-
-  const char16_t stateFull[] = { 'f', 'u', 'l', 'l', 0 };
-  const char16_t stateFree[] = { 'f', 'r', 'e', 'e', 0 };
-
-  nsCOMPtr<nsISupports> subject;
-  CallQueryInterface(gDiskSpaceWatcher.get(), getter_AddRefs(subject));
-  MOZ_ASSERT(subject);
-  observerService->NotifyObservers(subject,
-                                   DISKSPACEWATCHER_OBSERVER_TOPIC,
-                                   sIsDiskFull ? stateFull : stateFree);
-}
-
-NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(DiskSpaceWatcher,
-                                         DiskSpaceWatcher::FactoryCreate)
-
-NS_DEFINE_NAMED_CID(NS_DISKSPACEWATCHER_CID);
-
-static const mozilla::Module::CIDEntry kDiskSpaceWatcherCIDs[] = {
-  { &kNS_DISKSPACEWATCHER_CID, false, nullptr, DiskSpaceWatcherConstructor },
-  { nullptr }
-};
-
-static const mozilla::Module::ContractIDEntry kDiskSpaceWatcherContracts[] = {
-  { "@mozilla.org/toolkit/disk-space-watcher;1", &kNS_DISKSPACEWATCHER_CID },
-  { nullptr }
-};
-
-static const mozilla::Module::CategoryEntry kDiskSpaceWatcherCategories[] = {
-  { nullptr }
-};
-
-static const mozilla::Module kDiskSpaceWatcherModule = {
-  mozilla::Module::kVersion,
-  kDiskSpaceWatcherCIDs,
-  kDiskSpaceWatcherContracts,
-  kDiskSpaceWatcherCategories
-};
-
-NSMODULE_DEFN(DiskSpaceWatcherModule) = &kDiskSpaceWatcherModule;
deleted file mode 100644
--- a/toolkit/components/diskspacewatcher/DiskSpaceWatcher.h
+++ /dev/null
@@ -1,32 +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/. */
-
-#ifndef __DISKSPACEWATCHER_H__
-
-#include "nsIDiskSpaceWatcher.h"
-#include "nsIObserver.h"
-#include "nsCOMPtr.h"
-
-class DiskSpaceWatcher final : public nsIDiskSpaceWatcher,
-                               public nsIObserver
-{
-public:
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIDISKSPACEWATCHER
-  NS_DECL_NSIOBSERVER
-
-  static already_AddRefed<DiskSpaceWatcher>
-  FactoryCreate();
-
-  static void UpdateState(bool aIsDiskFull, uint64_t aFreeSpace);
-
-private:
-  DiskSpaceWatcher();
-  ~DiskSpaceWatcher();
-
-  static uint64_t sFreeSpace;
-  static bool     sIsDiskFull;
-};
-
-#endif // __DISKSPACEWATCHER_H__
deleted file mode 100644
--- a/toolkit/components/diskspacewatcher/moz.build
+++ /dev/null
@@ -1,26 +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/.
-
-with Files('**'):
-    BUG_COMPONENT = ('Toolkit', 'General')
-
-XPIDL_SOURCES += [
-    'nsIDiskSpaceWatcher.idl',
-]
-
-EXPORTS += [
-    'DiskSpaceWatcher.h'
-]
-
-XPIDL_MODULE = 'diskspacewatcher'
-
-SOURCES = [
-    'DiskSpaceWatcher.cpp',
-]
-
-include('/ipc/chromium/chromium-config.mozbuild')
-
-FINAL_LIBRARY = 'xul'
deleted file mode 100644
--- a/toolkit/components/diskspacewatcher/nsIDiskSpaceWatcher.idl
+++ /dev/null
@@ -1,25 +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"
-
-%{ C++
-#ifdef XP_WIN
-#undef GetFreeSpace
-#endif
-%}
-
-[scriptable, uuid(3aceba74-2ed5-4e99-8fe4-06e90e2b8ef0)]
-interface nsIDiskSpaceWatcher : nsISupports
-{
-  readonly attribute bool isDiskFull; // True if we are low on disk space.
-  readonly attribute unsigned long long freeSpace; // The free space currently available.
-};
-
-%{ C++
-#define DISKSPACEWATCHER_CONTRACTID "@mozilla.org/toolkit/disk-space-watcher;1"
-
-// The data for this notification will be either 'free' or 'full'.
-#define DISKSPACEWATCHER_OBSERVER_TOPIC "disk-space-watcher"
-%}
deleted file mode 100644
--- a/toolkit/components/extensions/test/xpcshell/head_storage.js
+++ /dev/null
@@ -1,21 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-/* exported setLowDiskMode */
-
-// Small test helper to trigger the QuotaExceededError (it is basically the same
-// test helper defined in "dom/indexedDB/test/unit/test_lowDiskSpace.js", but it doesn't
-// use SpecialPowers).
-let lowDiskMode = false;
-function setLowDiskMode(val) {
-  let data = val ? "full" : "free";
-
-  if (val == lowDiskMode) {
-    info("Low disk mode is: " + data);
-  } else {
-    info("Changing low disk mode to: " + data);
-    Services.obs.notifyObservers(null, "disk-space-watcher", data);
-    lowDiskMode = val;
-  }
-}
--- a/toolkit/components/extensions/test/xpcshell/test_ext_storage_idb_data_migration.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_storage_idb_data_migration.js
@@ -78,17 +78,16 @@ function assertTelemetryEvents(extension
     return {method: event[2], extra: event[5]};
   });
 
   Assert.deepEqual(migrateEvents, expectedEvents, "Got the expected telemetry events");
 }
 
 add_task(async function setup() {
   Services.prefs.setBoolPref(ExtensionStorageIDB.BACKEND_ENABLED_PREF, true);
-  setLowDiskMode(false);
 
   await promiseStartupManager();
 
   // Telemetry test setup needed to ensure that the builtin events are defined
   // and they can be collected and verified.
   await TelemetryController.testSetup();
 
   // This is actually only needed on Android, because it does not properly support unified telemetry
@@ -353,83 +352,21 @@ add_task(async function test_storage_loc
         has_olddata: "n",
       },
     },
   ]);
 
   await extension.unload();
 });
 
-// Test that if the data migration fails because of a QuotaExceededError raised when creating the
-// storage into the IndexedDB backend, the extension does not migrate to the new backend if
-// there was a JSONFile to migrate.
-add_task(async function test_storage_local_data_migration_quota_exceeded_error() {
-  const EXTENSION_ID = "extension-quota-exceeded-error@mozilla.org";
-  const data = {"test_key_string": "test_value"};
-
-  // Set the low disk mode to force the quota manager to raise a QuotaExceededError.
-  setLowDiskMode(true);
-
-  // Store some fake data in the storage.local file backend before starting the extension.
-  await createExtensionJSONFileWithData(EXTENSION_ID, data);
-
-  async function background() {
-    const result = await browser.storage.local.get("test_key_string");
-    browser.test.assertEq("test_value", result.test_key_string,
-                          "Got the expected storage.local.get result");
-
-    browser.test.sendMessage("storage-local-quota-exceeded");
-  }
-
-  clearMigrationHistogram();
-
-  let extension = ExtensionTestUtils.loadExtension({
-    manifest: {
-      permissions: ["storage"],
-      applications: {
-        gecko: {
-          id: EXTENSION_ID,
-        },
-      },
-    },
-    background,
-  });
-
-  await extension.startup();
-
-  await extension.awaitMessage("storage-local-quota-exceeded");
-
-  equal(Services.prefs.getBoolPref(`${IDB_MIGRATED_PREF_BRANCH}.${EXTENSION_ID}`, false),
-        false, `Got ${IDB_MIGRATED_PREF_BRANCH} preference set to false as expected`);
-
-  await extension.unload();
-
-  assertTelemetryEvents(EXTENSION_ID, [
-    {
-      method: "migrateResult",
-      extra: {
-        backend: "JSONFile",
-        error_name: "QuotaExceededError",
-      },
-    },
-  ]);
-
-  assertMigrationHistogramCount("success", 0);
-  assertMigrationHistogramCount("failure", 1);
-});
-
 // Test that if the data migration fails to store the old data into the IndexedDB backend
 // then the expected telemetry histogram is being updated.
 add_task(async function test_storage_local_data_migration_failure() {
   const EXTENSION_ID = "extension-data-migration-failure@mozilla.org";
 
-  // Reset the low disk mode, we don't want the quota manager to raise a QuotaExceededError
-  // during this test case.
-  setLowDiskMode(false);
-
   // Create the file under the expected directory tree.
   const {
     jsonFile,
     oldStorageFilename,
   } = await createExtensionJSONFileWithData(EXTENSION_ID, {});
 
   // Store a fake invalid value which is going to fail to be saved into IndexedDB
   // (because it can't be cloned and it is going to raise a DataCloneError), which
@@ -486,12 +423,11 @@ add_task(async function test_storage_loc
   assertMigrationHistogramCount("success", 0);
   assertMigrationHistogramCount("failure", 1);
 });
 
 add_task(async function test_storage_local_data_migration_clear_pref() {
   Services.prefs.clearUserPref(LEAVE_STORAGE_PREF);
   Services.prefs.clearUserPref(LEAVE_UUID_PREF);
   Services.prefs.clearUserPref(ExtensionStorageIDB.BACKEND_ENABLED_PREF);
-  setLowDiskMode(false);
   await promiseShutdownManager();
   await TelemetryController.testShutdown();
 });
--- a/toolkit/components/extensions/test/xpcshell/test_ext_storage_tab.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_storage_tab.js
@@ -194,118 +194,8 @@ add_task(async function test_storage_loc
   return runWithPrefs([[ExtensionStorageIDB.BACKEND_ENABLED_PREF, false]],
                       test_storage_local_call_from_destroying_context);
 });
 
 add_task(async function test_storage_local_idb_backend_destroyed_context_promise() {
   return runWithPrefs([[ExtensionStorageIDB.BACKEND_ENABLED_PREF, true]],
                       test_storage_local_call_from_destroying_context);
 });
-
-add_task(async function test_storage_local_should_not_cache_idb_open_rejections() {
-  const EXTENSION_ID = "@an-already-migrated-extension";
-
-  async function test_storage_local_on_idb_disk_full_rejection() {
-    let extension = ExtensionTestUtils.loadExtension({
-      async background() {
-        browser.test.sendMessage("ext-page-url", browser.runtime.getURL("tab.html"));
-      },
-      files: {
-        "tab.html": `<!DOCTYPE html>
-        <html>
-          <head>
-            <meta charset="utf-8">
-            <script src="tab.js"></script>
-          </head>
-        </html>`,
-
-        "tab.js"() {
-          browser.test.onMessage.addListener(async ({msg, expectErrorOnSet, errorShouldInclude}) => {
-            if (msg !== "call-storage-local") {
-              return;
-            }
-
-            const expectedValue = "newvalue";
-
-            try {
-              await browser.storage.local.set({"newkey": expectedValue});
-            } catch (err) {
-              if (expectErrorOnSet && err.message.includes(errorShouldInclude)) {
-                browser.test.sendMessage("storage-local-set-rejected");
-                return;
-              }
-
-              browser.test.fail(`Got an unexpected exception on storage.local.get: ${err}`);
-              throw err;
-            }
-
-            try {
-              const res = await browser.storage.local.get("newkey");
-              browser.test.assertEq(expectedValue, res.newkey);
-              browser.test.sendMessage("storage-local-get-resolved");
-            } catch (err) {
-              browser.test.fail(`Got an unexpected exception on storage.local.get: ${err}`);
-              throw err;
-            }
-          });
-
-          browser.test.sendMessage("extension-tab-ready");
-        },
-      },
-      manifest: {
-        permissions: ["storage"],
-        applications: {
-          gecko: {
-            id: EXTENSION_ID,
-          },
-        },
-      },
-    });
-
-    await extension.startup();
-    const url = await extension.awaitMessage("ext-page-url");
-
-    let contentPage = await ExtensionTestUtils.loadContentPage(url, {extension});
-    await extension.awaitMessage("extension-tab-ready");
-
-    // Turn the low disk mode on (so that opening an IndexedDB connection raises a
-    // QuotaExceededError).
-    setLowDiskMode(true);
-    extension.sendMessage({
-      msg: "call-storage-local",
-      expectErrorOnSet: true,
-      errorShouldInclude: "QuotaExceededError",
-    });
-    info(`Wait the storage.local.set API call to reject while the disk is full`);
-    await extension.awaitMessage("storage-local-set-rejected");
-    info("Got the a rejection on storage.local.set while the disk is full as expected");
-
-    setLowDiskMode(false);
-    extension.sendMessage({msg: "call-storage-local", expectErrorOnSet: false});
-    info(`Wait the storage.local API calls to resolve successfully once the disk is free again`);
-    await extension.awaitMessage("storage-local-get-resolved");
-    info("storage.local.set and storage.local.get resolve successfully once the disk is free again");
-
-    // Turn the low disk mode on again (so that we can trigger an aborted transaction in the
-    // ExtensionStorageIDB set method, now that there is an open IndexedDb connection).
-    setLowDiskMode(true);
-    extension.sendMessage({
-      msg: "call-storage-local",
-      expectErrorOnSet: true,
-      errorShouldInclude: "QuotaExceededError",
-    });
-    info(`Wait the storage.local.set transaction to be aborted while the disk is full`);
-    await extension.awaitMessage("storage-local-set-rejected");
-    info("Got the a rejection on storage.local.set while the disk is full as expected");
-
-    setLowDiskMode(false);
-    contentPage.close();
-    await extension.unload();
-  }
-
-  return runWithPrefs([
-    [ExtensionStorageIDB.BACKEND_ENABLED_PREF, true],
-    // Set the migrated preference for the test extension to prevent the extension
-    // from falling back to the JSONFile storage because of an QuotaExceededError
-    // raised while migrating to the IndexedDB backend.
-    [`${ExtensionStorageIDB.IDB_MIGRATED_PREF_BRANCH}.${EXTENSION_ID}`, true],
-  ], test_storage_local_on_idb_disk_full_rejection);
-});
--- a/toolkit/components/extensions/test/xpcshell/xpcshell-remote.ini
+++ b/toolkit/components/extensions/test/xpcshell/xpcshell-remote.ini
@@ -1,10 +1,10 @@
 [DEFAULT]
-head = head.js head_remote.js head_e10s.js head_telemetry.js head_storage.js
+head = head.js head_remote.js head_e10s.js head_telemetry.js
 tail =
 firefox-appdir = browser
 skip-if = appname == "thunderbird" || os == "android"
 dupe-manifest =
 support-files =
   data/**
   xpcshell-content.ini
 tags = webextensions remote-webextensions
--- a/toolkit/components/extensions/test/xpcshell/xpcshell.ini
+++ b/toolkit/components/extensions/test/xpcshell/xpcshell.ini
@@ -1,10 +1,10 @@
 [DEFAULT]
-head = head.js head_telemetry.js head_storage.js
+head = head.js head_telemetry.js
 firefox-appdir = browser
 dupe-manifest =
 support-files =
   data/**
   head_sync.js
   xpcshell-content.ini
 tags = webextensions in-process-webextensions
 
--- a/toolkit/components/moz.build
+++ b/toolkit/components/moz.build
@@ -25,17 +25,16 @@ DIRS += [
     'cleardata',
     'clearsitedata',
     'cloudstorage',
     'commandlines',
     'contentprefs',
     'contextualidentity',
     'crashes',
     'crashmonitor',
-    'diskspacewatcher',
     'downloads',
     'enterprisepolicies',
     'extensions',
     'filewatcher',
     'finalizationwitness',
     'find',
     'jsoncpp/src/lib_json',
     'lz4',
--- a/uriloader/prefetch/nsOfflineCacheUpdate.h
+++ b/uriloader/prefetch/nsOfflineCacheUpdate.h
@@ -367,12 +367,11 @@ private:
 
     nsresult ProcessNextUpdate();
 
     nsTArray<RefPtr<nsOfflineCacheUpdate> > mUpdates;
     static nsTHashtable<nsCStringHashKey>* mAllowedDomains;
 
     bool mDisabled;
     bool mUpdateRunning;
-    bool mLowFreeSpace;
 };
 
 #endif
--- a/uriloader/prefetch/nsOfflineCacheUpdateService.cpp
+++ b/uriloader/prefetch/nsOfflineCacheUpdateService.cpp
@@ -32,17 +32,16 @@
 #include "nsStreamUtils.h"
 #include "nsThreadUtils.h"
 #include "nsProxyRelease.h"
 #include "mozilla/Logging.h"
 #include "nsIAsyncVerifyRedirectCallback.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/Unused.h"
-#include "nsIDiskSpaceWatcher.h"
 #include "nsIDocShell.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIDocShellTreeOwner.h"
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/dom/PermissionMessageUtils.h"
 #include "nsContentUtils.h"
 #include "mozilla/Unused.h"
 
@@ -240,17 +239,16 @@ NS_IMPL_ISUPPORTS(nsOfflineCacheUpdateSe
 
 //-----------------------------------------------------------------------------
 // nsOfflineCacheUpdateService <public>
 //-----------------------------------------------------------------------------
 
 nsOfflineCacheUpdateService::nsOfflineCacheUpdateService()
     : mDisabled(false)
     , mUpdateRunning(false)
-    , mLowFreeSpace(false)
 {
     MOZ_ASSERT(NS_IsMainThread());
     Preferences::AddBoolVarCache(&sAllowOfflineCache,
                                  "browser.cache.offline.enable",
                                  true);
     Preferences::AddBoolVarCache(&sAllowInsecureOfflineCache,
                                  "browser.cache.offline.insecure.enable",
                                  true);
@@ -274,29 +272,16 @@ nsOfflineCacheUpdateService::Init()
     if (!observerService)
       return NS_ERROR_FAILURE;
 
     nsresult rv = observerService->AddObserver(this,
                                                NS_XPCOM_SHUTDOWN_OBSERVER_ID,
                                                true);
     NS_ENSURE_SUCCESS(rv, rv);
 
-    // Get the current status of the disk in terms of free space and observe
-    // low device storage notifications.
-    nsCOMPtr<nsIDiskSpaceWatcher> diskSpaceWatcherService =
-      do_GetService("@mozilla.org/toolkit/disk-space-watcher;1");
-    if (diskSpaceWatcherService) {
-      diskSpaceWatcherService->GetIsDiskFull(&mLowFreeSpace);
-    } else {
-      NS_WARNING("Could not get disk status from nsIDiskSpaceWatcher");
-    }
-
-    rv = observerService->AddObserver(this, "disk-space-watcher", false);
-    NS_ENSURE_SUCCESS(rv, rv);
-
     gOfflineCacheUpdateService = this;
 
     return NS_OK;
 }
 
 /* static */
 already_AddRefed<nsOfflineCacheUpdateService>
 nsOfflineCacheUpdateService::GetInstance()
@@ -400,21 +385,17 @@ nsOfflineCacheUpdateService::ProcessNext
     if (mDisabled)
         return NS_ERROR_ABORT;
 
     if (mUpdateRunning)
         return NS_OK;
 
     if (mUpdates.Length() > 0) {
         mUpdateRunning = true;
-        // Canceling the update before Begin() call will make the update
-        // asynchronously finish with an error.
-        if (mLowFreeSpace) {
-            mUpdates[0]->Cancel();
-        }
+
         return mUpdates[0]->Begin();
     }
 
     return NS_OK;
 }
 
 //-----------------------------------------------------------------------------
 // nsOfflineCacheUpdateService::nsIOfflineCacheUpdateService
@@ -574,27 +555,16 @@ nsOfflineCacheUpdateService::Observe(nsI
                                      const char16_t *aData)
 {
     if (!strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID)) {
         if (mUpdates.Length() > 0)
             mUpdates[0]->Cancel();
         mDisabled = true;
     }
 
-    if (!strcmp(aTopic, "disk-space-watcher")) {
-        if (NS_LITERAL_STRING("full").Equals(aData)) {
-            mLowFreeSpace = true;
-            for (uint32_t i = 0; i < mUpdates.Length(); i++) {
-                mUpdates[i]->Cancel();
-            }
-        } else if (NS_LITERAL_STRING("free").Equals(aData)) {
-            mLowFreeSpace = false;
-        }
-    }
-
     return NS_OK;
 }
 
 //-----------------------------------------------------------------------------
 // nsOfflineCacheUpdateService::nsIOfflineCacheUpdateService
 //-----------------------------------------------------------------------------
 
 static nsresult