StorageOptions Class

The options of the storage of the origins (https://storage.spec.whatwg.org/), see BrowsingContextOptions.Storage: what navigator.storage (StorageManager) reports and enforces.

public sealed class StorageOptions : IEquatable<StorageOptions>
Implements

Constructors

NameDescription
StorageOptions()

StorageOptions()

StorageManager.cs
public StorageOptions()

No documentation is available.

Properties

NameDescription
QuotaGets the quota of the storage of an origin, in bytes (https://storage.spec.whatwg.org/#storage-quota): the quota that StorageManager.Estimate reports, enforced by the origin private file system (a write that makes the usage of the file system exceed it fails with a QuotaExceededError). The other storage endpoints have their own limits (e.g. StorageShed.Quota). The default is StorageOptions.DefaultQuota.
RequestPersistentStorageGets the callback called by StorageManager.Persist with the serialization of an origin, when the storage of the origin is not persistent yet: the host returns whether the "persistent-storage" permission is granted (a browser decides with its own heuristics, or asks the user). The default is null: the permission is denied, and the storage of the origins stays "best-effort".

Gets the quota of the storage of an origin, in bytes (https://storage.spec.whatwg.org/#storage-quota): the quota that StorageManager.Estimate reports, enforced by the origin private file system (a write that makes the usage of the file system exceed it fails with a QuotaExceededError). The other storage endpoints have their own limits (e.g. StorageShed.Quota). The default is StorageOptions.DefaultQuota.

public long Quota { get; init; }

Property value

long

RequestPersistentStorage

StorageManager.cs

Gets the callback called by StorageManager.Persist with the serialization of an origin, when the storage of the origin is not persistent yet: the host returns whether the "persistent-storage" permission is granted (a browser decides with its own heuristics, or asks the user). The default is null: the permission is denied, and the storage of the origins stays "best-effort".

public Func<string, bool>? RequestPersistentStorage { get; init; }

Property value

Func<string, bool>?

Methods

NameDescription
Equals(StorageOptions?)
Equals(object?)
GetHashCode()
ToString()

Equals overloads

Equals(StorageOptions?)

public bool Equals(StorageOptions? other)
Parameters
other StorageOptions?
Returns

bool

No documentation is available.

Equals(object?)

public override bool Equals(object? obj)
Parameters
obj object?
Returns

bool

No documentation is available.

GetHashCode()

public override int GetHashCode()

Returns

int

No documentation is available.

ToString()

public override string ToString()

Returns

string

No documentation is available.

Operators

NameDescription
operator ==(StorageOptions?, StorageOptions?)
operator !=(StorageOptions?, StorageOptions?)

operator ==(StorageOptions?, StorageOptions?)

public static bool operator ==(StorageOptions? left, StorageOptions? right)

Parameters

left StorageOptions?
right StorageOptions?

Returns

bool

No documentation is available.

operator !=(StorageOptions?, StorageOptions?)

public static bool operator !=(StorageOptions? left, StorageOptions? right)

Parameters

left StorageOptions?
right StorageOptions?

Returns

bool

No documentation is available.

Constants

NameDescription
DefaultQuotaThe default quota of an origin: 1 GiB.

DefaultQuota

The default quota of an origin: 1 GiB.

public const long DefaultQuota = 1073741824L