diff options
Diffstat (limited to 'dom/quota/StorageOriginAttributes.h')
-rw-r--r-- | dom/quota/StorageOriginAttributes.h | 22 |
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 |