Storage Quota API

Though unstable, Chromium via WebKit has introduced an API for working 
with storage quotas:

https://groups.google.com/a/chromium.org/group/chromium-html5/msg/5261d24266ba4366

In brief:

   void queryUsageAndQuota(
       unsigned short storageType,
       optional StorageInfoUsageCallback successCallback,
       optional StorageInfoErrorCallback errorCallback);
   // Requests a new quota.  Requesting a larger quota may require user's
   // explicit permission via UI prompting / infobar.

   void requestQuota(
       unsigned short storageType,
       unsigned long long newQuotaInBytes,
       optional StorageInfoQuotaCallback successCallback,
       optional StorageInfoErrorCallback errorCallback);
};


This API works across all storage types except localStorage, as 
localStorage is unique.

It spans IndexedDB, FileSystem, AppCache and for those that are carrying 
it, WebSQL.


-Charles

Received on Monday, 26 September 2011 21:50:00 UTC