Yes we have updates on the quota API in M13.
I think we'll make more proper announcement or some Web page to
explain the API, but here's a quick update.
The quota API is not standardized (yet) and is subject to change, but
in M13 we will be releasing following API:
--------------------------------------------------------------------
Window implements QuotaStorageEnvironment;
[NoInterfaceObject]
interface QuotaStorageEnvironment {
// Note: the attribute name is prefixed by 'webkit'
readonly attribute StorageInfo webkitStorageInfo;
};
interface StorageInfo {
const unsigned short TEMPORARY = 0;
const unsigned short PERSISTENT = 1;
// Queries the current quota and how much data is stored for the host.
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);
};
[NoInterfaceObject, Callback=FunctionOnly]
interface StorageInfoUsageCallback {
void handleEvent(unsigned long long currentUsageInBytes,
unsigned long long currentQuotaInBytes);
};
[NoInterfaceObject, Callback=FunctionOnly]
interface StorageInfoQuotaCallback {
void handleEvent(unsigned long long grantedQuotaInBytes);
};
[NoInterfaceObject, Callback=FunctionOnly]
interface StorageInfoErrorCallback {
void handleEvent(DOMCoreException error);
};
--------------------------------------------------------------------
In short, you'll be able to get the current quota and usage for your
origin/host by calling:
webkitStorageInfo.queryUsageAndQuota(
webkitStorageInfo.TEMPORARY, // or PERSISTENT
usageCallback,
errorCallback);
And you'll be able to request a new quota by calling:
webkitStorageInfo.requestQuota(
webkitStorageInfo.TEMPORARY, // or PERSISTENT
quotaCallback,
errorCallback);
The data stored in TEMPORARY filesystem or Web SQL DB are charged as
'TEMPORARY' storage data,
while data stored in PERSISTENT filesystem will be charged as
'PERSISTENT' storage data.
We are going to add appcache and IndexedDB under the same quota
management, but it may not happen in M13.
By default webapps/sites will be given some modest TEMPORARY storage quota and
*zero* PERSISTENT quota (except for apps/extensions that have
'unlimitedStorage' permission).
Any attempts to store more data than the granted quota will fail with
QUOTA_EXCEEDED_ERR.
Webapps can request a larger quota than the current quota but it may
require an explicit user permission
and chrome may show an infoBar for prompting.
(Or the request may be silently rejected and the current quota or
smaller quota might be returned.)
Important note: application data stored in TEMPORARY storage (e.g.
data stored in TEMPORARY
filesystem or in SQL DB) may be deleted at the browser's discretion
when the local disk's available space
is getting tight. When the browser deletes temporary data stored for
an origin it will delete
the entire data for the origin, so that it won't corrupt app data in
an unexpected way.
As a known limitation, the usage reported by the quota API may not
match up precisely with the
size of the user data, as each storage may need some extra bytes to
store their meta data or
there might be some time lag until updates are reflected to the quota API.
Kinuko
> --
> You received this message because you are subscribed to the Google Groups "Chromium HTML5" group.
> To post to this group, send email to chromiu...@chromium.org.
> To unsubscribe from this group, send email to chromium-html...@chromium.org.
> For more options, visit this group at http://groups.google.com/a/chromium.org/group/chromium-html5/?hl=en.
>
>
On Fri, Jun 3, 2011 at 10:27 PM, Jordon Wii <jord...@gmail.com> wrote:
> Wow, thanks for all the info Kinuko. Is LocalStorage counted under
> either of the Persistent or Temporary quotas, or is it separate?
No I don't think we have a plan to add LocalStorage under the new
quota management. It will likely keep having 5MB upper limit.
> To post to this group, send email to chromiu...@chromium.org.
> To unsubscribe from this group, send email to chromium-html...@chromium.org.
So IndexedDB will be stored in the Temporary storage?
As I remember data from temporary storage can be removed at any time
by browser. So data in IndexedDB(or whole DB) can be removed by
browser.
Am I correct?
On Wed, Jun 8, 2011 at 1:17 AM, Kinuko Yasuda <kin...@chromium.org> wrote:+dgrogan, hoping that he could answer better for your question.On Wed, Jun 8, 2011 at 5:56 AM, Anton Podviaznikov <podvia...@gmail.com> wrote:
So IndexedDB will be stored in the Temporary storage?
Yes.
As I remember data from temporary storage can be removed at any time
by browser. So data in IndexedDB(or whole DB) can be removed by
browser.
Am I correct?
You are. I think it's important to note that if the quota system does evict your origin's indexeddb data, it will also evict your origin's appcache data, temporary filesystem data, websql data, etc.
I thought we're going to / eventually want to have two tiers of storage, temporary (evictable) and permanent for IndexedDB too.
Also correct, though the timeline is unclear.
This is very much a work in progress. The state of affairs in m13 or m14 is not the final resting place for this feature.
On Wed, Jun 8, 2011 at 11:53 AM, Anton Podviaznikov <podvia...@gmail.com> wrote:
David,Can you please explain why was made decision to put IndexedDB and WebSQL into Temporary storage?I'm just interesting what was the motivation.
We intend to provide a means to create PERSISTENT IndexedDBs and WebSQLDBs in the future. It's just not done yet. For the time being the only storage type that has an API to put data in the PERSISTENT bucket is the FileSystem.
What are the cases for using IndexedDB if it can be deleted any time?
Apps+Extensions continue to be protected from deletion via the 'remove all cookies' dialog. Furthermore, Apps+Extensions that set the 'unlimitedStorage' right are also not subject to quota based eviction.So there are means in place to satisfy a variety of use cases.
I don't see problem with AppCache because AppCache can be any time retrieved from server in background.
This is not entirely true... what if you happen to be offline?
But with this change to IndexedDB and WebSQL it would be much harder to implement few types of applications.E.x. I created music player (https://chrome.google.com/webstore/detail/lhjjnnhpfomdbcgnmkejhacbcdppljic?hl=en-US).Previously it has no server at all. So IndexedDB was the only way to store data about songs, artists etc.And now I need to store these data on server-side and than repopulate IndexedDB when it will be deleted?This can have very bad impact on user experience because it'll probably will take some time to get all information about all songs from server (or one more time parse that data from music files).If I understood planning changes correctly it may have very bad impact on some types of apps (in my case it would be even better to move away from IndexedDB).Just wanted to tell you about impact of such decision and here your thoughts about it.
I'd suggest relying on the additional privileges granted to HostedApps in the m13/m14 timeframe.
On Wed, Jun 8, 2011 at 1:17 AM, Kinuko Yasuda <kin...@chromium.org> wrote:
+dgrogan, hoping that he could answer better for your question.On Wed, Jun 8, 2011 at 5:56 AM, Anton Podviaznikov <podvia...@gmail.com> wrote:
So IndexedDB will be stored in the Temporary storage?
Yes.
As I remember data from temporary storage can be removed at any time
by browser. So data in IndexedDB(or whole DB) can be removed by
browser.
Am I correct?
You are. I think it's important to note that if the quota system does evict your origin's indexeddb data, it will also evict your origin's appcache data, temporary filesystem data, websql data, etc.
I thought we're going to / eventually want to have two tiers of storage, temporary (evictable) and permanent for IndexedDB too.
Also correct, though the timeline is unclear.
Best regards,
Jenn
I'm just curious which one am I? M13? M12? M14? I will reiterate...i honestly don't have problems helping you "get noticed", but why can't you stop redirecting and using all my accounts? I can't go into a few sites because my name is flagged. So you guys are the one's doing this, for over 6 months. I still haven't gone "there" yet. Why can't I be an active part instead of the old lady that your team hacked? I could be useful. Just tired of losing my devices.
Jenn
--
You received this message because you are subscribed to the Google Groups "Chromium HTML5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-html...@chromium.org.
To post to this group, send email to chromiu...@chromium.org.
Visit this group at https://groups.google.com/a/chromium.org/group/chromium-html5/.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.