diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-12-22 01:23:56 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-12-22 01:26:49 +0100 |
commit | 54091ecab46c93c2e1b2c689e9179a980beaabe6 (patch) | |
tree | 5cead66d889007e1b06c5dbb8e3d37b2538d0557 /uriloader | |
parent | c1013e9122456b342d65e4eb4c38a7281d8d83d2 (diff) | |
parent | 492624a7106ecbc18994b465ca1dd23fa472bf7e (diff) | |
download | UXP-54091ecab46c93c2e1b2c689e9179a980beaabe6.tar UXP-54091ecab46c93c2e1b2c689e9179a980beaabe6.tar.gz UXP-54091ecab46c93c2e1b2c689e9179a980beaabe6.tar.lz UXP-54091ecab46c93c2e1b2c689e9179a980beaabe6.tar.xz UXP-54091ecab46c93c2e1b2c689e9179a980beaabe6.zip |
Forward to new tree structure.
Diffstat (limited to 'uriloader')
-rw-r--r-- | uriloader/prefetch/nsOfflineCacheUpdate.h | 1 | ||||
-rw-r--r-- | uriloader/prefetch/nsOfflineCacheUpdateService.cpp | 32 |
2 files changed, 1 insertions, 32 deletions
diff --git a/uriloader/prefetch/nsOfflineCacheUpdate.h b/uriloader/prefetch/nsOfflineCacheUpdate.h index 4ccba4135..2e6d6d30c 100644 --- a/uriloader/prefetch/nsOfflineCacheUpdate.h +++ b/uriloader/prefetch/nsOfflineCacheUpdate.h @@ -375,7 +375,6 @@ private: bool mDisabled; bool mUpdateRunning; - bool mLowFreeSpace; }; #endif diff --git a/uriloader/prefetch/nsOfflineCacheUpdateService.cpp b/uriloader/prefetch/nsOfflineCacheUpdateService.cpp index adb3fd516..6a67af013 100644 --- a/uriloader/prefetch/nsOfflineCacheUpdateService.cpp +++ b/uriloader/prefetch/nsOfflineCacheUpdateService.cpp @@ -39,7 +39,6 @@ #include "mozilla/Preferences.h" #include "mozilla/Attributes.h" #include "mozilla/Unused.h" -#include "nsIDiskSpaceWatcher.h" #include "nsIDocShell.h" #include "nsIDocShellTreeItem.h" #include "nsIDocShellTreeOwner.h" @@ -246,7 +245,6 @@ NS_IMPL_ISUPPORTS(nsOfflineCacheUpdateService, nsOfflineCacheUpdateService::nsOfflineCacheUpdateService() : mDisabled(false) , mUpdateRunning(false) - , mLowFreeSpace(false) { MOZ_ASSERT(NS_IsMainThread()); Preferences::AddBoolVarCache(&sAllowOfflineCache, @@ -273,19 +271,6 @@ nsOfflineCacheUpdateService::Init() 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; @@ -407,11 +392,7 @@ nsOfflineCacheUpdateService::ProcessNextUpdate() 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(); } @@ -582,17 +563,6 @@ nsOfflineCacheUpdateService::Observe(nsISupports *aSubject, 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; } |