summaryrefslogtreecommitdiffstats
path: root/dom/quota/StorageOriginAttributes.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /dom/quota/StorageOriginAttributes.h
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-adbda400be353e676059e335c3c0aaf99e719475.tar.xz
firefox-adbda400be353e676059e335c3c0aaf99e719475.zip
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/quota/StorageOriginAttributes.h')
-rw-r--r--dom/quota/StorageOriginAttributes.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/dom/quota/StorageOriginAttributes.h b/dom/quota/StorageOriginAttributes.h
index 5d8f416b38..b68fdc804b 100644
--- a/dom/quota/StorageOriginAttributes.h
+++ b/dom/quota/StorageOriginAttributes.h
@@ -15,12 +15,32 @@ namespace mozilla {
// in OriginAttributes class anymore.
class StorageOriginAttributes {
public:
+ StorageOriginAttributes() : mInIsolatedMozBrowser(false) {}
+
+ explicit StorageOriginAttributes(bool aInIsolatedMozBrowser)
+ : mInIsolatedMozBrowser(aInIsolatedMozBrowser) {}
+
bool InIsolatedMozBrowser() const { return mInIsolatedMozBrowser; }
uint32_t UserContextId() const { return mOriginAttributes.mUserContextId; }
// New getters can be added here incrementally.
+ void SetInIsolatedMozBrowser(bool aInIsolatedMozBrowser) {
+ mInIsolatedMozBrowser = aInIsolatedMozBrowser;
+ }
+
+ void SetUserContextId(uint32_t aUserContextId) {
+ mOriginAttributes.mUserContextId = aUserContextId;
+ }
+
+ // New setters can be added here incrementally.
+
+ // Serializes/Deserializes non-default values into the suffix format, i.e.
+ // |^key1=value1&key2=value2|. If there are no non-default attributes, this
+ // returns an empty string
+ void CreateSuffix(nsACString& aStr) const;
+
[[nodiscard]] bool PopulateFromSuffix(const nsACString& aStr);
// Populates the attributes from a string like
@@ -31,7 +51,7 @@ class StorageOriginAttributes {
private:
OriginAttributes mOriginAttributes;
- bool mInIsolatedMozBrowser = false;
+ bool mInIsolatedMozBrowser;
};
} // namespace mozilla