Expose ServiceWorkerContainer.getRegistrations() and implement the
Service Workers algorithm for collecting registrations matching the
current client's storage key. Resolve the promise with a frozen array
of ServiceWorkerRegistration objects, matching the Web-exposed return
type.
Use OrderedHashMap for the temporary LibWeb registration map, since the
Service Workers spec defines the registration map as ordered and
getRegistrations() exposes that iteration order.
Add text coverage for the no-registration case used by TradingView's
startup path. Without this method, the page threw while calling
navigator.serviceWorker.getRegistrations() and aborted before rendering
its chart.
Previously we were inconsistent by generating code for enum definitions
but not generating code for dictionaries. With future changes to the
IDL generator to expose helpers to convert to and from IDL values
this produced circular depdendencies. To solve this problem, also
generate the dictionary definitions in bindings headers.
Previously, the LibWeb bindings generator would output multiple per
interface files like Prototype/Constructor/Namespace/GlobalMixin
depending on the contents of that IDL file.
This complicates the build system as it means that it does not know
what files will be generated without knowledge of the contents of that
IDL file.
Instead, for each IDL file only generate a single Bindings/<IDLFile>.h
and Bindings/<IDLFile>.cpp.
This patch implements the ready attribute on ServiceWorkerContainer,
a Promise that resolves when there's a ServiceWorkerRegistration
with an active worker for the current page. The promise never rejects
and stays pending if no active service worker exists.
This makes https://instagram.com/ load once again :^)
Before this change, we were going through the chain of base classes for
each IDL interface object and having them set the prototype to their
prototype.
Instead of doing that, reorder things so that we set the right prototype
immediately in Foo::initialize(), and then don't bother in all the base
class overrides.
This knocks off a ~1% profile item on Speedometer 3.