Bug 60355 - Support unified quota API across various storage types
Summary: Support unified quota API across various storage types
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 57849 57918 57927 58648 58784 59681
Blocks:
  Show dependency treegraph
 
Reported: 2011-05-06 01:26 PDT by Kinuko Yasuda
Modified: 2012-05-07 09:32 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kinuko Yasuda 2011-05-06 01:26:34 PDT
Per public discussion on public-webapps, it'd be great to support the unified quota API (vendor-prefixed one) that allows webapps to query the current origin's usage/quota or request a new storage quota for the requesting origin across various storage APIs (like IndexedDB, SQL DB and FileSystem API).
http://lists.w3.org/Archives/Public/public-webapps/2011JanMar/0346.html

This is an umbrella bug for supporting/implementing unified quota API.

Related issue: bug 53983
Comment 1 Kinuko Yasuda 2011-06-03 01:13:07 PDT
The quota API update:

We have added following app-facing APIs to WebKit.
Current chromium is the only embedder that implements this API.

In the latest chromium port SQL DB and FileSystem API are under the unified quota management.
There's an ongoing work to put Appcache and IndexedDB under quota management too.
--------------------------------------------------------------------
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 permission and the embedder
  // browser may show some user notification UI to prompt the user.
  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);
};
--------------------------------------------------------------------