Closed Bug 960707 Opened 12 years ago Closed 1 year ago

Add support to quota manager to report localstorage usage.

Categories

(Core :: Storage: Quota Manager, enhancement)

enhancement

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: fabrice, Unassigned)

References

Details

(Whiteboard: dom-lws-bugdash-triage )

We would need to know this for apps, with the usual isBrowserElement flag.
If you can pass a principal, it would be simple, we build the scope key from it. There is DOMStorageUsage, internal class that loads usage of a scope (i.e. eTLD+1 X appId X inBrowser), find it at [1]. You can query it only via an internal API at [2], use the localstorage manager service ("@mozilla.org/dom/localStorage-manager;1") and expose an async function to get the usage value on it's interface. You will need a callback. The callback can be called somewhere around [3] or when the usage is already known (has been loaded) immediately. You will have to adjust helper LoadUsageRunnable class to give you the notification and also set a flag whether the usage has been loaded from the database. [1] http://hg.mozilla.org/mozilla-central/annotate/e44ba69207be/dom/src/storage/DOMStorageCache.h#l243 [2] http://hg.mozilla.org/mozilla-central/annotate/e44ba69207be/dom/src/storage/DOMStorageManager.cpp#l273 [3] http://hg.mozilla.org/mozilla-central/annotate/e44ba69207be/dom/src/storage/DOMStorageCache.cpp#l714 (Note: no time to work on this right now)
See Also: → 1318713
Component: DOM: Core & HTML → Storage: Quota Manager
Type: defect → enhancement
Severity: normal → S3

Fixed by LSNG.

Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → WORKSFORME
Whiteboard: dom-lws-bugdash-triage
You need to log in before you can comment on or make changes to this bug.