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

Re: Updating Quota API: Promise, Events and some more

From: Jonas Sicking <jonas@sicking.cc>
Date: Fri, 16 Aug 2013 11:01:18 -0700
Message-ID: <CA+c2ei8rG4chuJ==pyE_vEVisZ-5EZtM+v-cx9jWz1ooDwZ=CA@mail.gmail.com>
To: Kinuko Yasuda <kinuko@chromium.org>
Cc: Web Applications Working Group WG <public-webapps@w3.org>, Joshua Bell <jsbell@chromium.org>
On Fri, Aug 16, 2013 at 6:56 AM, Kinuko Yasuda <kinuko@chromium.org> wrote:

I had a few bike-sheddy comments as well.

> Now the new draft looks like:
>
>  enum StorageType { "temporary", "persistent" };
>
>   partial interface Navigator {
>     readonly attribute StorageQuota storageQuota;
>   };
>
>   [NoInterfaceObject] interface StorageInfo {
>     unsigned long long usageInBytes;
>     unsigned long long quotaInBytes;
>   };

I think these can be simplified to simply 'usage' and 'quota'. The
fact that it's in bytes doesn't really need to be spelled out in the
property name I think. Feedback that we've gotten from authors is that
they prefer short names.

>   [NoInterfaceObject] interface StorageQuota {
>     readonly attribute StorageType[] supportedTypes;
>
>     // Queries the current storage info.
>     Promise<StorageInfo> queryStorageInfo(StorageType type);

I think simply 'getInfo' might be enough here. It should already be
obvious that it's storage-quota related.

>     // Requests a new quota for persistent storage.
>     Promise<StorageInfo> requestPersistentQuota(unsigned long long
> newQuotaInBytes);
>
>     // Creates a new StorageWatcher object to watch the storage changes.
>     StorageWatcher createStorageWatcher(StorageType type)

This could probably simply be done using a constructor. I.e.

new StorageWatcher("persistent");

>   [NoInterfaceObject] interface createStorageWatcher {
>     // Fired when when the remaining storage space becomes lower
>     // than 10% of all available space for the type, or before the quota
> backend
>     // triggers eviction (for temporary case), whichever happens first.
>     attribute EventHandler onstoragelow;
>   };

Actually, the other two events made sense to me. Without onstorageok
the page has to poll queryStorageInfo to know when it's "out of the
woods".

Actually, *only* having onstoragechange would solve both the use case
of detecting when you are running low on storage, as well as when you
are "out of the woods". Especially if we provide both the quota and
the amount of used space in the event.

/ Jonas
Received on Friday, 16 August 2013 18:02:16 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:14:12 UTC