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

[quota-api] API change suggestions

From: Tobie Langel <tobie@fb.com>
Date: Mon, 10 Sep 2012 10:46:41 +0000
To: Kinuko Yasuda <kinuko@chromium.org>, "public-webapps@w3.org" <public-webapps@w3.org>
Message-ID: <CC7391B5.23F77%tobie@fb.com>

I'm very happy with the API changes we where able to make to the Quota
API, but there's a method name we have left untouched and that I haven't
figured out how to tackle until today: queryUsageAndQuota.

The name is horrendous and is going to make developers cringe. It's also
not very extensible should need arise to provide extra information in the

Here's a suggestion to fix it:

1) create a new StorageQuotaInfo interface:


interface StorageQuotaInfo {
  readonly attribute unsigned long long quota;
  readonly attribute unsigned long long usage;

2) Rename StorageUsageCallback to StorageInfoCallback and pass it a
StorageQuotaInfo instead of two ints:

callback StorageInfoCallback = void (StorageQuotaInfo storageQuotaInfo);

3) Rename queryUsageAndQuota to getInfo:


interface StorageQuota {
  void getInfo (in StorageInfoCallback successCallback, in optional
StorageErrorCallback errorCallback);

The examples in the spec would be rewritten as shown here:


Again, happy to contribute those changes if there's interest.


Received on Monday, 10 September 2012 10:47:09 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:45 UTC