InMemoryServiceWorkerBackend Class

A ServiceWorkerBackend that keeps the registrations in memory: the default backend of the browsing contexts (see BrowsingContextOptions.ServiceWorkers). It is thread-safe, and can be shared by several browsing contexts.

public sealed class InMemoryServiceWorkerBackend : ServiceWorkerBackend
Inheritance
ServiceWorkerBackend InMemoryServiceWorkerBackend

Constructors

NameDescription
InMemoryServiceWorkerBackend()

InMemoryServiceWorkerBackend()

InMemoryServiceWorkerBackend.cs
public InMemoryServiceWorkerBackend()

No documentation is available.

Methods

NameDescription
DeleteRegistration(string, string)Deletes the registration of a scope, and returns true, or returns false when there is no such registration.
GetRegistrations(string)Returns the registrations of an origin.
SaveRegistration(string, StoredServiceWorkerRegistration)Saves a registration: replaces the registration with the same StoredServiceWorkerRegistration.ScopeUrl, or adds it.

DeleteRegistration(string, string)

InMemoryServiceWorkerBackend.cs

Deletes the registration of a scope, and returns true, or returns false when there is no such registration.

public override bool DeleteRegistration(string origin, string scopeUrl)

Parameters

origin string
The serialization of the origin.
scopeUrl string
The serialized scope URL of the registration.

Returns

bool

GetRegistrations(string)

InMemoryServiceWorkerBackend.cs

Returns the registrations of an origin.

public override IReadOnlyList<StoredServiceWorkerRegistration> GetRegistrations(string origin)

Parameters

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

Returns

IReadOnlyList<StoredServiceWorkerRegistration>

SaveRegistration(string, StoredServiceWorkerRegistration)

InMemoryServiceWorkerBackend.cs

Saves a registration: replaces the registration with the same StoredServiceWorkerRegistration.ScopeUrl, or adds it.

public override void SaveRegistration(string origin, StoredServiceWorkerRegistration registration)

Parameters

origin string
The serialization of the origin.
registration StoredServiceWorkerRegistration
The registration.