W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2011

Re: Storage Quota API

From: Michael Nordman <michaeln@google.com>
Date: Mon, 26 Sep 2011 17:07:15 -0700
Message-ID: <CAHpoE=j9grTh58mOnenE3wPOvK4Rvh93e0SE=0cRvuH5=npKdw@mail.gmail.com>
To: Charles Pritchard <chuck@jumis.com>
Cc: Jonas Sicking <jonas@sicking.cc>, public-webapps <public-webapps@w3.org>
On Mon, Sep 26, 2011 at 4:53 PM, Charles Pritchard <chuck@jumis.com> wrote:

> 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 storage policy is not a function of webkit. Chrome policies are distinct
from Safari or any other webkit based browsers.


>
> 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?
>

There is no way to express that for IDB, ditto for WebSQL or AppCache. The
only storage api in which Perm can be expressed is in FileSystem. It's
possible to make a way to say "perm" for other types. We feel pretty
strongly that there's value in being able to use these interfaces w/o
prompts and that's the motivation for the general TEMP policy.


> 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 Tuesday, 27 September 2011 00:07:43 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:47 GMT