diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:50 +0000 |
commit | def92d1b8e9d373e2f6f27c366d578d97d8960c6 (patch) | |
tree | 2ef34b9ad8bb9a9220e05d60352558b15f513894 /dom/storage | |
parent | Adding debian version 125.0.3-1. (diff) | |
download | firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.tar.xz firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.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.cpp | 9 | ||||
-rw-r--r-- | dom/storage/Storage.cpp | 6 | ||||
-rw-r--r-- | dom/storage/Storage.h | 9 |
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 |