InMemoryIndexedDBBackend Class

An IndexedDBBackend that keeps the databases in memory: the default backend of the browsing contexts (see BrowsingContextOptions.IndexedDB). It is thread-safe, and can be shared by several browsing contexts.

public sealed class InMemoryIndexedDBBackend : IndexedDBBackend
Inheritance
IndexedDBBackend InMemoryIndexedDBBackend

Constructors

NameDescription
InMemoryIndexedDBBackend()

InMemoryIndexedDBBackend()

InMemoryIndexedDBBackend.cs
public InMemoryIndexedDBBackend()

No documentation is available.

Methods

NameDescription
BeginTransaction(string, string, IdbTransactionMode, IReadOnlyList<long>)Begins a transaction on a database. A IdbTransactionMode.VersionChange transaction creates the database (with the version 0 and no object store) when it does not exist; aborting this transaction deletes it.
DeleteDatabase(string, string)Deletes a database and its data (https://w3c.github.io/IndexedDB/#delete-a-database). Does nothing when it does not exist.
GetDatabase(string, string)Returns the schema of a database, or null when the database does not exist.
GetDatabases(string)Returns the name and the version of the databases of an origin (https://w3c.github.io/IndexedDB/#dom-idbfactory-databases).
GetUsage(string)Returns an estimation of the number of bytes used by the databases of an origin (navigator.storage.estimate()). The default is 0: the usage is not reported.

BeginTransaction(string, string, IdbTransactionMode, IReadOnlyList<long>)

InMemoryIndexedDBBackend.cs

Begins a transaction on a database. A IdbTransactionMode.VersionChange transaction creates the database (with the version 0 and no object store) when it does not exist; aborting this transaction deletes it.

public override IndexedDBBackendTransaction BeginTransaction(string origin, string name, IdbTransactionMode mode, IReadOnlyList<long> objectStoreIds)

Parameters

origin string
The serialization of the origin.
name string
The name of the database.
mode IdbTransactionMode
The mode of the transaction.
objectStoreIds IReadOnlyList<long>
The ids of the object stores of the scope of the transaction (all the object stores for a version change transaction).

Returns

IndexedDBBackendTransaction

DeleteDatabase(string, string)

InMemoryIndexedDBBackend.cs

Deletes a database and its data (https://w3c.github.io/IndexedDB/#delete-a-database). Does nothing when it does not exist.

public override void DeleteDatabase(string origin, string name)

Parameters

origin string
The serialization of the origin.
name string
The name of the database.

GetDatabase(string, string)

InMemoryIndexedDBBackend.cs

Returns the schema of a database, or null when the database does not exist.

public override IndexedDBDatabaseSchema? GetDatabase(string origin, string name)

Parameters

origin string
The serialization of the origin.
name string
The name of the database.

Returns

IndexedDBDatabaseSchema?

GetDatabases(string)

InMemoryIndexedDBBackend.cs

Returns the name and the version of the databases of an origin (https://w3c.github.io/IndexedDB/#dom-idbfactory-databases).

public override IReadOnlyList<IndexedDBDatabaseInfo> GetDatabases(string origin)

Parameters

origin string
The serialization of the origin (e.g. https://example.com).

Returns

IReadOnlyList<IndexedDBDatabaseInfo>

Returns an estimation of the number of bytes used by the databases of an origin (navigator.storage.estimate()). The default is 0: the usage is not reported.

public override long GetUsage(string origin)

Parameters

origin string
The serialization of the origin.

Returns

long