summaryrefslogtreecommitdiffstats
path: root/dom/storage
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
commitd8bbc7858622b6d9c278469aab701ca0b609cddf (patch)
treeeff41dc61d9f714852212739e6b3738b82a2af87 /dom/storage
parentReleasing progress-linux version 125.0.3-1~progress7.99u1. (diff)
downloadfirefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz
firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/storage')
-rw-r--r--dom/storage/LocalStorageCache.cpp9
-rw-r--r--dom/storage/Storage.cpp6
-rw-r--r--dom/storage/Storage.h9
3 files changed, 11 insertions, 13 deletions
diff --git a/dom/storage/LocalStorageCache.cpp b/dom/storage/LocalStorageCache.cpp
index 4b55482441..16ebe8ca3b 100644
--- a/dom/storage/LocalStorageCache.cpp
+++ b/dom/storage/LocalStorageCache.cpp
@@ -37,8 +37,11 @@ inline uint32_t GetDataSetIndex(bool aPrivateBrowsing,
}
inline uint32_t GetDataSetIndex(const LocalStorage* aStorage) {
+ // A session only mode doesn't exist anymore, so having a separate data set
+ // for it here is basically useless. This code is only kept until we remove
+ // the old / legacy LocalStorage implementation.
return GetDataSetIndex(aStorage->IsPrivateBrowsing(),
- aStorage->IsSessionScopedOrLess());
+ aStorage->IsPrivateBrowsingOrLess());
}
} // namespace
@@ -167,8 +170,8 @@ void LocalStorageCache::NotifyObservers(const LocalStorage* aStorage,
}
inline bool LocalStorageCache::Persist(const LocalStorage* aStorage) const {
- return mPersistent &&
- (aStorage->IsPrivateBrowsing() || !aStorage->IsSessionScopedOrLess());
+ return mPersistent && (aStorage->IsPrivateBrowsing() ||
+ !aStorage->IsPrivateBrowsingOrLess());
}
const nsCString LocalStorageCache::Origin() const {
diff --git a/dom/storage/Storage.cpp b/dom/storage/Storage.cpp
index cfc609969c..3602dcb9b1 100644
--- a/dom/storage/Storage.cpp
+++ b/dom/storage/Storage.cpp
@@ -38,18 +38,18 @@ Storage::Storage(nsPIDOMWindowInner* aWindow, nsIPrincipal* aPrincipal,
mPrincipal(aPrincipal),
mStoragePrincipal(aStoragePrincipal),
mPrivateBrowsing(false),
- mSessionScopedOrLess(false) {
+ mPrivateBrowsingOrLess(false) {
MOZ_ASSERT(aPrincipal);
if (mPrincipal->IsSystemPrincipal()) {
mPrivateBrowsing = false;
- mSessionScopedOrLess = false;
+ mPrivateBrowsingOrLess = false;
} else if (mWindow) {
uint32_t rejectedReason = 0;
StorageAccess access = StorageAllowedForWindow(mWindow, &rejectedReason);
mPrivateBrowsing = access == StorageAccess::ePrivateBrowsing;
- mSessionScopedOrLess = access <= StorageAccess::eSessionScoped;
+ mPrivateBrowsingOrLess = access <= StorageAccess::ePrivateBrowsing;
}
}
diff --git a/dom/storage/Storage.h b/dom/storage/Storage.h
index 81546a0b0e..cea49f3114 100644
--- a/dom/storage/Storage.h
+++ b/dom/storage/Storage.h
@@ -52,7 +52,7 @@ class Storage : public nsISupports, public nsWrapperCache {
bool IsPrivateBrowsing() const { return mPrivateBrowsing; }
- bool IsSessionScopedOrLess() const { return mSessionScopedOrLess; }
+ bool IsPrivateBrowsingOrLess() const { return mPrivateBrowsingOrLess; }
// WebIDL
JSObject* WrapObject(JSContext* aCx,
@@ -98,11 +98,6 @@ class Storage : public nsISupports, public nsWrapperCache {
virtual void Clear(nsIPrincipal& aSubjectPrincipal, ErrorResult& aRv) = 0;
- // The attribute in the WebIDL interface has rather confusing name. So we
- // shouldn't use this method internally. IsSessionScopedOrLess should be used
- // directly.
- bool IsSessionOnly() const { return IsSessionScopedOrLess(); }
-
//////////////////////////////////////////////////////////////////////////////
// Testing Methods:
//
@@ -172,7 +167,7 @@ class Storage : public nsISupports, public nsWrapperCache {
// Whether storage is set to persist data only per session, may change
// dynamically and is set by CanUseStorage function that is called
// before any operation on the storage.
- bool mSessionScopedOrLess : 1;
+ bool mPrivateBrowsingOrLess : 1;
};
} // namespace mozilla::dom