Re: Quota API to query/request quota for offline storages (e.g. IndexedDB, FileSystem)

>> Should probably be QuotaInfo or even QuotaManager ? Storage can and
>> will be confused with Web Storage.
>>
>>>    // storage type
>>>     const unsigned short TEMPORARY = 0;
>>>     const unsigned short PERSISTENT = 1;
>>>
>>
>> Only two values seem not enough for me and I disagre with the
>> nomenclature. Would be betteer to have
>> LOCAL_STORAGE, SESSION_STORAGE, WEB_SQL_DBS, INDEXED_DB and so on. But
>> that would create artificial dependencies with the other specs, so it
>> would be better if "type" passed to the query and request functions to
>> just be an opaque string which would allow any offline storage spec to
>> refer to this one instead and specify a type of their own like
>> "localStorage", "sessionStorage", "indexedDb".
>
> The point is that apps and users should be able to communicate about
> how much disk space should be used.  Why would users care which API a
> web app is using for its storage?  If google.com needs 10MB to store
> my email, why should I care whether it's in indexedDB, localStorage,
> or the FileSystem?
>

Before storing X amount of data with an API, the code requests enough
space for the storage area that API covers. That's how I understand
the use case. Then it's up to the user agent to communicate that
appropriately to the user, if applicable.
APIs are web dev scope, not user scope, so storage areas need to be
differentiated. I doubt that any browser ATM shares a single quota
between all different storage types. Opera doesn't for instance.

>>>     // To query how much storage is available and currently in use.
>>>     void queryUsage(unsigned short storageType,
>>>                     UsageCallback usageCallback);
>>>
>>
>> Given that quota values are usually just preferences, hence
>> lightweight enough, this function should be sync for the sake of
>> simplicity.
>
> This doesn't request just the preference; it returns how much space is
> actually used.  That might be an expensive operation, might require
> disk IO to fetch a value from an internal database, etc.

Hum, right. But then my comment does apply to "requestQuota" no ? No
need to ping data files to store a new value for the quota, which is
usually just a pref.

Received on Thursday, 3 February 2011 17:24:06 UTC