Backed out 4 changesets (bug 861920, bug 861894) for mochitest failures.
authorRyan VanderMeulen <ryanvm@gmail.com>
Fri, 10 May 2013 17:35:55 -0400
changeset 138302 519b04170b2f23961ee44d19982bed213e1e2e9f
parent 138301 22a77fd7ab35cf760481aa2620e737e7109a2b0a
child 138303 7a362c86108c533e7304ab7e32bfcdf841495aa3
push id3752
push userlsblakk@mozilla.com
push dateMon, 13 May 2013 17:21:10 +0000
treeherdermozilla-aurora@1580544aef0b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs861920, 861894
milestone23.0a1
backs out69fcebb240953db14a0501e9814e1c8a04198061
c39ceb11cb76a4b3399ef7da78cda8e024e68d07
d0aa77e7825ba80fc8833496ec28454562913aa7
81e072111e989546362b2313e31a2495cf7f1e25
Backed out 4 changesets (bug 861920, bug 861894) for mochitest failures. Backed out changeset 69fcebb24095 (bug 861920) Backed out changeset c39ceb11cb76 (bug 861920) Backed out changeset d0aa77e7825b (bug 861894) Backed out changeset 81e072111e98 (bug 861894)
dom/src/storage/DOMStorageCache.cpp
dom/src/storage/DOMStorageIPC.cpp
dom/src/storage/DOMStorageManager.cpp
dom/src/storage/DOMStorageManager.h
dom/src/storage/DOMStorageObserver.cpp
dom/tests/mochitest/ajax/offline/Makefile.in
dom/tests/mochitest/ajax/offline/test_lowDeviceStorage.html
dom/tests/mochitest/ajax/offline/test_lowDeviceStorageDuringUpdate.html
dom/tests/mochitest/localstorage/Makefile.in
dom/tests/mochitest/localstorage/test_lowDeviceStorage.html
uriloader/prefetch/nsOfflineCacheUpdate.cpp
uriloader/prefetch/nsOfflineCacheUpdate.h
uriloader/prefetch/nsOfflineCacheUpdateService.cpp
--- a/dom/src/storage/DOMStorageCache.cpp
+++ b/dom/src/storage/DOMStorageCache.cpp
@@ -189,21 +189,16 @@ bool
 DOMStorageCache::ProcessUsageDelta(const DOMStorage* aStorage, int64_t aDelta)
 {
   return ProcessUsageDelta(GetDataSetIndex(aStorage), aDelta);
 }
 
 bool
 DOMStorageCache::ProcessUsageDelta(uint32_t aGetDataSetIndex, const int64_t aDelta)
 {
-  // Check if we are in a low disk space situation
-  if (aDelta > 0 && mManager && mManager->IsLowDiskSpace()) {
-    return false;
-  }
-
   // Check limit per this origin
   Data& data = mData[aGetDataSetIndex];
   uint64_t newOriginUsage = data.mOriginQuotaUsage + aDelta;
   if (aDelta > 0 && newOriginUsage > DOMStorageManager::GetQuota()) {
     return false;
   }
 
   // Now check eTLD+1 limit
--- a/dom/src/storage/DOMStorageIPC.cpp
+++ b/dom/src/storage/DOMStorageIPC.cpp
@@ -4,17 +4,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "DOMStorageIPC.h"
 
 #include "DOMStorageManager.h"
 
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/unused.h"
-#include "nsIDiskSpaceWatcher.h"
 
 namespace mozilla {
 namespace dom {
 
 // ----------------------------------------------------------------------------
 // Child
 // ----------------------------------------------------------------------------
 
@@ -290,20 +289,20 @@ DOMStorageDBParent::ReleaseIPDLReference
 {
   NS_ABORT_IF_FALSE(mIPCOpen, "Attempting to release non-existent IPDL reference");
   mIPCOpen = false;
   Release();
 }
 
 namespace { // anon
 
-class SendInitialChildDataRunnable : public nsRunnable
+class SendScopesHavingDataRunnable : public nsRunnable
 {
 public:
-  SendInitialChildDataRunnable(DOMStorageDBParent* aParent)
+  SendScopesHavingDataRunnable(DOMStorageDBParent* aParent)
     : mParent(aParent)
   {}
 
 private:
   NS_IMETHOD Run()
   {
     if (!mParent->IPCOpen()) {
       return NS_OK;
@@ -311,31 +310,16 @@ private:
 
     DOMStorageDBBridge* db = DOMStorageCache::GetDatabase();
     if (db) {
       InfallibleTArray<nsCString> scopes;
       db->GetScopesHavingData(&scopes);
       mozilla::unused << mParent->SendScopesHavingData(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.
-    nsCOMPtr<nsIDiskSpaceWatcher> diskSpaceWatcher =
-      do_GetService("@mozilla.org/toolkit/disk-space-watcher;1");
-    if (!diskSpaceWatcher) {
-      NS_WARNING("Could not get disk information from DiskSpaceWatcher");
-      return NS_OK;
-    }
-    bool lowDiskSpace = false;
-    diskSpaceWatcher->GetIsDiskFull(&lowDiskSpace);
-    if (lowDiskSpace) {
-      mozilla::unused << mParent->SendObserve(
-        nsDependentCString("low-disk-space"), EmptyCString());
-    }
-
     return NS_OK;
   }
 
   nsRefPtr<DOMStorageDBParent> mParent;
 };
 
 } // anon
 
@@ -347,18 +331,18 @@ DOMStorageDBParent::DOMStorageDBParent()
     observer->AddSink(this);
   }
 
   // We are always open by IPC only
   AddIPDLReference();
 
   // Cannot send directly from here since the channel
   // is not completely built at this moment.
-  nsRefPtr<SendInitialChildDataRunnable> r =
-    new SendInitialChildDataRunnable(this);
+  nsRefPtr<SendScopesHavingDataRunnable> r =
+    new SendScopesHavingDataRunnable(this);
   NS_DispatchToCurrentThread(r);
 }
 
 DOMStorageDBParent::~DOMStorageDBParent()
 {
   DOMStorageObserver* observer = DOMStorageObserver::Self();
   if (observer) {
     observer->RemoveSink(this);
--- a/dom/src/storage/DOMStorageManager.cpp
+++ b/dom/src/storage/DOMStorageManager.cpp
@@ -104,17 +104,16 @@ PrincipalsEqual(nsIPrincipal* aObjectPri
   return true;
 }
 
 NS_IMPL_ISUPPORTS1(DOMStorageManager,
                    nsIDOMStorageManager)
 
 DOMStorageManager::DOMStorageManager(nsPIDOMStorage::StorageType aType)
   : mType(aType)
-  , mLowDiskSpace(false)
 {
   mCaches.Init(10);
   DOMStorageObserver* observer = DOMStorageObserver::Self();
   NS_ASSERTION(observer, "No DOMStorageObserver, cannot observe private data delete notifications!");
 
   if (observer) {
     observer->AddSink(this);
   }
@@ -562,32 +561,16 @@ DOMStorageManager::Observe(const char* a
     // For case caches are still referenced - clear them completely
     ClearCacheEnumeratorData data(DOMStorageCache::kUnloadComplete);
     mCaches.EnumerateEntries(ClearCacheEnumerator, &data);
 
     mCaches.Clear();
     return NS_OK;
   }
 
-  if (!strcmp(aTopic, "low-disk-space")) {
-    if (mType == LocalStorage) {
-      mLowDiskSpace = true;
-    }
-
-    return NS_OK;
-  }
-
-  if (!strcmp(aTopic, "no-low-disk-space")) {
-    if (mType == LocalStorage) {
-      mLowDiskSpace = false;
-    }
-
-    return NS_OK;
-  }
-
 #ifdef DOM_STORAGE_TESTS
   if (!strcmp(aTopic, "test-reload")) {
     if (mType != LocalStorage) {
       return NS_OK;
     }
 
     // This immediately completely reloads all caches from the database.
     ClearCacheEnumeratorData data(DOMStorageCache::kTestReload);
--- a/dom/src/storage/DOMStorageManager.h
+++ b/dom/src/storage/DOMStorageManager.h
@@ -82,22 +82,16 @@ private:
                               const nsAString& aDocumentURI,
                               bool aPrivate,
                               nsIDOMStorage** aRetval);
 
   // Scope->cache map
   nsTHashtable<DOMStorageCacheHashKey> mCaches;
   const nsPIDOMStorage::StorageType mType;
 
-  // 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; };
-
   static PLDHashOperator ClearCacheEnumerator(DOMStorageCacheHashKey* aCache,
                                               void* aClosure);
 
 protected:
   friend class DOMStorageCache;
   // Releases cache since it is no longer referrered by any DOMStorage object.
   virtual void DropCache(DOMStorageCache* aCache);
 };
--- a/dom/src/storage/DOMStorageObserver.cpp
+++ b/dom/src/storage/DOMStorageObserver.cpp
@@ -63,21 +63,16 @@ DOMStorageObserver::Init()
   obs->AddObserver(sSelf, "last-pb-context-exited", true);
   obs->AddObserver(sSelf, "webapps-clear-data", true);
 
   // Shutdown
   obs->AddObserver(sSelf, "profile-after-change", true);
   obs->AddObserver(sSelf, "profile-before-change", true);
   obs->AddObserver(sSelf, "xpcom-shutdown", true);
 
-  // Observe low device storage notifications. Only in the parent.
-  if (XRE_GetProcessType() == GeckoProcessType_Default) {
-    obs->AddObserver(sSelf, "disk-space-watcher", true);
-  }
-
 #ifdef DOM_STORAGE_TESTS
   // Testing
   obs->AddObserver(sSelf, "domstorage-test-flush-force", true);
   if (XRE_GetProcessType() == GeckoProcessType_Default) {
     // Only to forward to child process.
     obs->AddObserver(sSelf, "domstorage-test-flushed", true);
   }
 
@@ -300,26 +295,16 @@ DOMStorageObserver::Observe(nsISupports*
     rv = DOMStorageCache::StopDatabase();
     if (NS_FAILED(rv)) {
       NS_WARNING("Error while stopping DOMStorage DB background thread");
     }
 
     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")) {
     DOMStorageDBBridge* db = DOMStorageCache::GetDatabase();
     if (db) {
       db->AsyncFlush();
     }
 
     return NS_OK;
--- a/dom/tests/mochitest/ajax/offline/Makefile.in
+++ b/dom/tests/mochitest/ajax/offline/Makefile.in
@@ -90,15 +90,13 @@ MOCHITEST_FILES	= \
 	changing1Hour.sjs \
 	changingManifest.sjs \
 	offlineChild.html \
 	test_xhtmlManifest.xhtml \
 	test_missingManifest.html \
 	missing.html \
 	jupiter.jpg \
 	test_cancelOfflineCache.html \
-	test_lowDeviceStorage.html \
-	test_lowDeviceStorageDuringUpdate.html \
 	$(NULL)
 
 # test_offlineMode.html disabled due to bug 656943
 
 include $(topsrcdir)/config/rules.mk
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 recieve 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 = 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;
-
-function finish() {
-  obs.notifyObservers(updateService, "disk-space-watcher", "free");
-
-  OfflineTest.teardown();
-  OfflineTest.finish();
-}
-
-if (OfflineTest.setup()) {
-  obs.notifyObservers(updateService, "disk-space-watcher", "full");
-
-  var updateObserver = {
-    updateStateChanged: function (aUpdate, aState) {
-      switch(aState) {
-        case Ci.nsIOfflineCacheUpdateObserver.STATE_ERROR:
-          aUpdate.removeObserver(this);
-          errorReceived = true;
-          OfflineTest.ok(true, "Expected error. Update canceled");
-          finish();
-        break;
-        case Ci.nsIOfflineCacheUpdateObserver.STATE_FINISHED:
-          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 = "http://mochi.test:8888/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, null, null);
-  var documentURI = ioService.newURI(document.documentURI, null, null);
-  var update = updateService.scheduleUpdate(manifestURI, documentURI, 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,59 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/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.teardown();
-  OfflineTest.finish();
-}
-
-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/Makefile.in
+++ b/dom/tests/mochitest/localstorage/Makefile.in
@@ -46,17 +46,16 @@ MOCHITEST_FILES	= \
     test_localStorageOriginsPortDiffs.html \
     test_localStorageOriginsDomainDiffs.html \
     test_localStorageOriginsSchemaDiffs.html \
     test_localStorageReplace.html \
     test_localStorageQuota.html \
     test_localStorageQuotaSessionOnly.html \
     test_localStorageQuotaSessionOnly2.html \
     test_localStorageKeyOrder.html \
-    test_lowDeviceStorage.html \
     test_storageConstructor.html \
     $(NULL)
 
 MOCHITEST_CHROME_FILES = \
     test_localStorageBasePrivateBrowsing_perwindowpb.html \
     test_localStorageFromChrome.xhtml \
     test_localStorageQuotaPrivateBrowsing_perwindowpb.html \
     test_app_uninstall.html \
deleted file mode 100644
--- a/dom/tests/mochitest/localstorage/test_lowDeviceStorage.html
+++ /dev/null
@@ -1,76 +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>
-<script type="text/javascript" src="localStorageCommon.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";
-  os().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"), undefined,
-     "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"), undefined,
-       "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/uriloader/prefetch/nsOfflineCacheUpdate.cpp
+++ b/uriloader/prefetch/nsOfflineCacheUpdate.cpp
@@ -1773,26 +1773,16 @@ nsOfflineCacheUpdate::Begin()
 {
     LOG(("nsOfflineCacheUpdate::Begin [%p]", this));
 
     // Keep the object alive through a ProcessNextURI()/Finish() call.
     nsCOMPtr<nsIOfflineCacheUpdate> kungFuDeathGrip(this);
 
     mItemsInProgress = 0;
 
-    if (mState == STATE_CANCELLED) {
-      nsRefPtr<nsRunnableMethod<nsOfflineCacheUpdate> > errorNotification =
-        NS_NewRunnableMethod(this,
-                             &nsOfflineCacheUpdate::AsyncFinishWithError);
-      nsresult rv = NS_DispatchToMainThread(errorNotification);
-      NS_ENSURE_SUCCESS(rv, rv);
-
-      return NS_OK;
-    }
-
     if (mPartialUpdate) {
         mState = STATE_DOWNLOADING;
         NotifyState(nsIOfflineCacheUpdateObserver::STATE_DOWNLOADING);
         ProcessNextURI();
         return NS_OK;
     }
 
     // Start checking the manifest.
@@ -2158,23 +2148,16 @@ nsOfflineCacheUpdate::Finish()
 {
     nsresult rv = FinishNoNotify();
 
     NotifyState(nsIOfflineCacheUpdateObserver::STATE_FINISHED);
 
     return rv;
 }
 
-void
-nsOfflineCacheUpdate::AsyncFinishWithError()
-{
-    NotifyState(nsOfflineCacheUpdate::STATE_ERROR);
-    Finish();
-}
-
 static nsresult
 EvictOneOfCacheGroups(nsIApplicationCacheService *cacheService,
                       uint32_t count, const char * const *groups)
 {
     nsresult rv;
     unsigned int i;
 
     for (i = 0; i < count; i++) {
--- a/uriloader/prefetch/nsOfflineCacheUpdate.h
+++ b/uriloader/prefetch/nsOfflineCacheUpdate.h
@@ -234,18 +234,16 @@ private:
     bool CheckUpdateAvailability();
     void NotifyUpdateAvailability(bool updateAvailable);
 
     void GatherObservers(nsCOMArray<nsIOfflineCacheUpdateObserver> &aObservers);
     void NotifyState(uint32_t state);
     nsresult Finish();
     nsresult FinishNoNotify();
 
-    void AsyncFinishWithError();
-
     // Find one non-pinned cache group and evict it.
     nsresult EvictOneNonPinned();
 
     enum {
         STATE_UNINITIALIZED,
         STATE_INITIALIZED,
         STATE_CHECKING,
         STATE_DOWNLOADING,
@@ -352,12 +350,11 @@ public:
 
 private:
     nsresult ProcessNextUpdate();
 
     nsTArray<nsRefPtr<nsOfflineCacheUpdate> > mUpdates;
 
     bool mDisabled;
     bool mUpdateRunning;
-    bool mLowFreeSpace;
 };
 
 #endif
--- a/uriloader/prefetch/nsOfflineCacheUpdateService.cpp
+++ b/uriloader/prefetch/nsOfflineCacheUpdateService.cpp
@@ -41,17 +41,16 @@
 #include "nsServiceManagerUtils.h"
 #include "nsStreamUtils.h"
 #include "nsThreadUtils.h"
 #include "nsProxyRelease.h"
 #include "prlog.h"
 #include "nsIAsyncVerifyRedirectCallback.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Attributes.h"
-#include "nsIDiskSpaceWatcher.h"
 
 using namespace mozilla;
 
 static nsOfflineCacheUpdateService *gOfflineCacheUpdateService = nullptr;
 
 typedef mozilla::docshell::OfflineCacheUpdateParent OfflineCacheUpdateParent;
 typedef mozilla::docshell::OfflineCacheUpdateChild OfflineCacheUpdateChild;
 typedef mozilla::docshell::OfflineCacheUpdateGlue OfflineCacheUpdateGlue;
@@ -257,17 +256,16 @@ NS_IMPL_ISUPPORTS3(nsOfflineCacheUpdateS
 
 //-----------------------------------------------------------------------------
 // nsOfflineCacheUpdateService <public>
 //-----------------------------------------------------------------------------
 
 nsOfflineCacheUpdateService::nsOfflineCacheUpdateService()
     : mDisabled(false)
     , mUpdateRunning(false)
-    , mLowFreeSpace(false)
 {
 }
 
 nsOfflineCacheUpdateService::~nsOfflineCacheUpdateService()
 {
     gOfflineCacheUpdateService = nullptr;
 }
 
@@ -285,29 +283,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 */
 nsOfflineCacheUpdateService *
 nsOfflineCacheUpdateService::GetInstance()
@@ -418,21 +403,16 @@ 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
@@ -614,27 +594,16 @@ nsOfflineCacheUpdateService::Observe(nsI
                                      const PRUnichar *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
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP