Intent to Implement: Storage Quota Usage Details

62 views
Skip to first unread message

Jarryd Goodman

unread,
Nov 26, 2018, 8:45:21 PM11/26/18
to blink-dev

Spec

http://crbug.com/904000


Contact emails

jar...@chromium.org, pwn...@chromium.org, jsb...@chromium.org


Explainer

https://github.com/whatwg/storage/issues/63#issuecomment-441857897


Design doc/Spec

Not yet available.


This is a small change and we’ve discussed the change with the other browser vendors so we don’t feel that a TAG review is necessary.


Summary

This change will add a dictionary to the returned dictionary of `navigator.storage.estimate()` that contains details about usage for each storage backend. The goal is to aid in debugging issues around overuse of specific storage systems.


Motivation

There have been frequent requests from users of `navigator.storage.estimate()` to provide a per storage type breakdown estimation.  Currently, a call to this function yields only an estimate of the quota usage for all storage systems combined, making it difficult to reason about what is using up quota.  With a detailed per system usage breakdown, apps are provided more context and clues to detect and diagnose storage overuse problems.


For example, one can consider an email client that uses IndexedDB to store text and Cache Storage to store attachments.  With the proposed change, said app would be able to debug problematic storage scenarios: high Cache Storage usage but low IndexedDB usage would suggest the app forgot to delete attachments when evicting messages from the local cache.  If there was high usage for both storage backends, this would mean the app is caching too many messages, suggesting the eviction policy is not behaving correctly.



Risks

Interoperability and Compatibility

Firefox: Public support

Edge: No public signals

Safari: No public signals

Web developers: Positive


Ergonomics

This change is simply extending a modern promise-based API, so no ergonomic issues should be introduced.


Activation

The new usage details dictionary is added to the return value of a method that already exists, so this new information should be easy to consume.



Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes


Is this feature fully tested by web-platform-tests?

Yes, a single test included in the CL with more coming for all other storage backends in a separate CL.  Doc will be updated to include link to second PR when changes are submitted.

(https://github.com/web-platform-tests/wpt/pull/13883/files)


Link to entry on the feature dashboard

https://www.chromestatus.com/features/5737131066523648


Requesting approval to ship?

No




Reply all
Reply to author
Forward
0 new messages