storage icon indicating copy to clipboard operation
storage copied to clipboard

Add UsageDetails dictionary

Open jarryd999 opened this issue 5 years ago • 6 comments

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


Preview | Diff

jarryd999 avatar Apr 22 '19 21:04 jarryd999

@domenic Comments have been addressed, PTAL. If you have no further comments, then thank you for the review!

jarryd999 avatar Jun 04 '19 17:06 jarryd999

@jarryd999 added "tentative" tests already in https://github.com/web-platform-tests/wpt/tree/master/storage (estimate-usage-details...)

inexorabletash avatar Jun 10 '19 19:06 inexorabletash

Thanks for the review!

  1. Are other implementers on board with exposing this?

There has been no public support, but also no opposition.

  1. 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

  1. 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 avatar Jul 12 '19 22:07 jarryd999

@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 avatar May 04 '20 10:05 annevk

@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.

jarryd999 avatar May 06 '20 19:05 jarryd999

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.

annevk avatar May 07 '20 04:05 annevk