diff options
Diffstat (limited to 'dom/storage')
-rw-r--r-- | dom/storage/DOMStorageCache.cpp | 5 | ||||
-rw-r--r-- | dom/storage/DOMStorageIPC.cpp | 17 | ||||
-rw-r--r-- | dom/storage/DOMStorageManager.cpp | 17 | ||||
-rw-r--r-- | dom/storage/DOMStorageManager.h | 6 | ||||
-rw-r--r-- | dom/storage/DOMStorageObserver.cpp | 13 |
5 files changed, 0 insertions, 58 deletions
diff --git a/dom/storage/DOMStorageCache.cpp b/dom/storage/DOMStorageCache.cpp index a2b5a6f73..ee9a22e96 100644 --- a/dom/storage/DOMStorageCache.cpp +++ b/dom/storage/DOMStorageCache.cpp @@ -205,11 +205,6 @@ DOMStorageCache::ProcessUsageDelta(const DOMStorage* aStorage, int64_t 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; diff --git a/dom/storage/DOMStorageIPC.cpp b/dom/storage/DOMStorageIPC.cpp index a8cd745f1..9d87a5788 100644 --- a/dom/storage/DOMStorageIPC.cpp +++ b/dom/storage/DOMStorageIPC.cpp @@ -11,7 +11,6 @@ #include "mozilla/dom/ContentChild.h" #include "mozilla/dom/ContentParent.h" #include "mozilla/Unused.h" -#include "nsIDiskSpaceWatcher.h" #include "nsThreadUtils.h" namespace mozilla { @@ -321,22 +320,6 @@ private: mozilla::Unused << mParent->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. - nsCOMPtr<nsIDiskSpaceWatcher> diskSpaceWatcher = - do_GetService("@mozilla.org/toolkit/disk-space-watcher;1"); - if (!diskSpaceWatcher) { - return NS_OK; - } - - bool lowDiskSpace = false; - diskSpaceWatcher->GetIsDiskFull(&lowDiskSpace); - - if (lowDiskSpace) { - mozilla::Unused << mParent->SendObserve( - nsDependentCString("low-disk-space"), EmptyString(), EmptyCString()); - } - return NS_OK; } diff --git a/dom/storage/DOMStorageManager.cpp b/dom/storage/DOMStorageManager.cpp index 156e846ba..8f50fcfb4 100644 --- a/dom/storage/DOMStorageManager.cpp +++ b/dom/storage/DOMStorageManager.cpp @@ -103,7 +103,6 @@ NS_IMPL_ISUPPORTS(DOMStorageManager, DOMStorageManager::DOMStorageManager(DOMStorage::StorageType aType) : mCaches(8) , mType(aType) - , mLowDiskSpace(false) { DOMStorageObserver* observer = DOMStorageObserver::Self(); NS_ASSERTION(observer, "No DOMStorageObserver, cannot observe private data delete notifications!"); @@ -566,22 +565,6 @@ DOMStorageManager::Observe(const char* aTopic, 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) { diff --git a/dom/storage/DOMStorageManager.h b/dom/storage/DOMStorageManager.h index 666e16a6f..0bfd21975 100644 --- a/dom/storage/DOMStorageManager.h +++ b/dom/storage/DOMStorageManager.h @@ -102,12 +102,6 @@ private: const DOMStorage::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; }; - void ClearCaches(uint32_t aUnloadFlags, const OriginAttributesPattern& aPattern, const nsACString& aKeyPrefix); diff --git a/dom/storage/DOMStorageObserver.cpp b/dom/storage/DOMStorageObserver.cpp index a2b3f1da8..fbbab8e54 100644 --- a/dom/storage/DOMStorageObserver.cpp +++ b/dom/storage/DOMStorageObserver.cpp @@ -70,9 +70,6 @@ DOMStorageObserver::Init() obs->AddObserver(sSelf, "profile-before-change", true); obs->AddObserver(sSelf, "xpcom-shutdown", true); - // Observe low device storage notifications. - obs->AddObserver(sSelf, "disk-space-watcher", true); - #ifdef DOM_STORAGE_TESTS // Testing obs->AddObserver(sSelf, "domstorage-test-flush-force", true); @@ -313,16 +310,6 @@ DOMStorageObserver::Observe(nsISupports* aSubject, 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(); |