Re: Storage Quota API

The callback style is prevalent in the File API, as well as IndexedDB. It seems quite fitting to me. Am I missing something?

They are using vendor prefixing (WebKit).

From what I read, WebSQL is temporary: I've not confirmed this.

I'm super surprised that Chrome treats IDB as temporary. That seems like a major WebKit bug.

The enum style is also borrowed from
FileSystem. I'd rather have strings too, but I've accepted the 0/1 enum values from File API as the way things are going to be.

Any ideas on how to express temp v. Perm to IndexedDB?

AppCache is temp, I'm sure, though I'd want it as perm on installed web apps.

-Charles



On Sep 26, 2011, at 4:43 PM, Jonas Sicking <jonas@sicking.cc> wrote:

> Please don't use errorCallback/SuccessCallback. That's not used in any
> other APIs that are part of the cross-browser web platform. Instead
> return a request object on which events are fired.
> 
> Don't use enums as the syntax sucks in JS. Use strings instead. We're
> making the same transition in a lot of other APIs.
> 
> There's also a problem in that Gecko treats IndexedDB as permanent
> quota by default and Chrome treats it as temporary. Not sure how to
> solve that problem.
> 
> You guys have this prefixed in your implementation for now, right?
> 
> / Jonas
> 
> On Mon, Sep 26, 2011 at 2:49 PM, Charles Pritchard <chuck@jumis.com> wrote:
>> 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 23:54:17 UTC