StorageBucket Class
A storage bucket (https://wicg.github.io/storage-buckets/#storagebucket): the IndexedDB databases (StorageBucket.IndexedDB), the caches and the origin private file system (StorageBucket.GetDirectory) of a named bucket of the origin, with its persistence, its quota and its expiration time. Once the bucket is deleted, the methods fail with an UnknownError DomException.
public sealed class StorageBucketProperties
| Name | Description |
|---|---|
| IndexedDB | Gets the IndexedDB databases of the bucket. |
| Name | Gets the name of the bucket. |
IndexedDB
StorageBuckets.csGets the IndexedDB databases of the bucket.
public IdbFactory IndexedDB { get; }Gets the name of the bucket.
public string Name { get; }Methods
| Name | Description |
|---|---|
| Estimate() | Returns an estimation of the usage of the bucket (its databases, caches and file system) and its quota: the quota of the bucket, or the quota of the origin (StorageOptions.Quota). |
| Expires() | Returns the expiration time of the bucket, in milliseconds since the Unix epoch, or null (https://wicg.github.io/storage-buckets/#dom-storagebucket-expires). |
| GetDirectory() | Returns the root directory of the origin private file system of the bucket (https://wicg.github.io/storage-buckets/#dom-storagebucket-getdirectory), whose writes are limited by the quota of the bucket. The task fails with an InvalidStateError once the bucket is deleted (as in Chromium). |
| Persist() | Requests the bucket to be persistent (https://wicg.github.io/storage-buckets/#dom-storagebucket-persist), as StorageManager.Persist, and returns whether it is. |
| Persisted() | Returns whether the bucket is persistent (https://wicg.github.io/storage-buckets/#dom-storagebucket-persisted). |
| SetExpires(double) | Sets the expiration time of the bucket, in milliseconds since the Unix epoch (https://wicg.github.io/storage-buckets/#dom-storagebucket-setexpires). |
Estimate()
StorageBuckets.csReturns an estimation of the usage of the bucket (its databases, caches and file system) and its quota: the quota of the bucket, or the quota of the origin (StorageOptions.Quota).
public Task<StorageEstimate> Estimate()Expires()
StorageBuckets.csReturns the expiration time of the bucket, in milliseconds since the Unix epoch, or null (https://wicg.github.io/storage-buckets/#dom-storagebucket-expires).
GetDirectory()
StorageBuckets.csReturns the root directory of the origin private file system of the bucket (https://wicg.github.io/storage-buckets/#dom-storagebucket-getdirectory), whose writes are limited by the quota of the bucket. The task fails with an InvalidStateError once the bucket is deleted (as in Chromium).
public Task<FileSystemDirectoryHandle> GetDirectory()Persist()
StorageBuckets.csRequests the bucket to be persistent (https://wicg.github.io/storage-buckets/#dom-storagebucket-persist), as StorageManager.Persist, and returns whether it is.
Persisted()
StorageBuckets.csReturns whether the bucket is persistent (https://wicg.github.io/storage-buckets/#dom-storagebucket-persisted).
SetExpires(double)
StorageBuckets.csSets the expiration time of the bucket, in milliseconds since the Unix epoch (https://wicg.github.io/storage-buckets/#dom-storagebucket-setexpires).