storage
storage copied to clipboard
Add UsageDetails dictionary
This change adds a new dictionary to the result of StorageManager.estimate()
that breaks down usage by storage system.
I've opened a related TAG review here: https://github.com/w3ctag/design-reviews/issues/365
@domenic Comments have been addressed, PTAL. If you have no further comments, then thank you for the review!
@jarryd999 added "tentative" tests already in https://github.com/web-platform-tests/wpt/tree/master/storage (estimate-usage-details...
)
Thanks for the review!
- Are other implementers on board with exposing this?
There has been no public support, but also no opposition.
- Are there bugs filed against those implementations?
Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1565716 Safari: https://bugs.webkit.org/show_bug.cgi?id=199762
- Is there a PR to make the tests stop being tentative that we can land together with this assuming all is in order? (There's a couple minor things I wonder about with the tests we can maybe tackle there, e.g., I don't see a need to do || 0 for the new fields as they should always be defined in a compliant implementation.)
https://chromium-review.googlesource.com/c/chromium/src/+/1700564
@jarryd999 could you check if #86 would make it significantly easier to define this? It seems to me we'd only have to define storage usage of a bucket's area and this would all fall out automatically.
Is there a reason for excluding localStorage
?
@annevk I'm not seeing how #86 makes this significantly easier to define. I think we are partially aligned: I've always imagined usageDetails to show a breakdown of usage per-bucket. However, I am confused why the addition of buckets would mean this "would all fall out automatically", as I think the only change would be to the scope of usageDetails. Could you help me understand?
localStorage was excluded because it is currently not quota-managed. My thoughts on this are that all storage should be quota-managed, or that at the least, quota should be aware of all storage, and thus it should be displayed in usageDetails
. However, I'm not too familiar with the story around localStorage.
Various APIs fit into a single bucket, each assigned to an area. For this we'd only need to define the primitive of obtaining the size of an area and then with some loops we can fill in all the details.