storage: Scope WebStorage quota per storage type instead of per origin total
#56933
+86
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Change quota accounting for
WebStorageso that usage is tracked per storagetype instead of combining
localStorageandsessionStorageinto a single perorigin total.
The previous implementation summed the sizes of both storage types and applied
a shared quota limit. This could cause a write to
sessionStorageto fail dueto data stored in
localStorage(and vice-versa), and also resulted in origindescriptors being created even when only one storage type was in use.
This behavior is not consistent with other browsers, where quota is enforced
independently for each storage mechanism.
Testing: Existing unit and WPT tests continue to pass, a new WPT test has been
added
Reviewed in servo/servo#41531