[Service Workers] Implement container.getRegistrations()
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Nov 2017 00:04:33 +0000 (00:04 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Nov 2017 00:04:33 +0000 (00:04 +0000)
https://bugs.webkit.org/show_bug.cgi?id=179672

Reviewed by Brady Eidson.

LayoutTests/imported/w3c:

Rebaseline test now that more checks are passing.

* web-platform-tests/service-workers/service-worker/getregistrations.https-expected.txt:

Source/WebCore:

Implement container.getRegistrations():
- https://w3c.github.io/ServiceWorker/#dom-serviceworkercontainer-getregistrations

No new tests, rebaselined existing test.

* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::getRegistration):
(WebCore::ServiceWorkerContainer::getRegistrations):
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerRegistration.cpp:
(WebCore::ServiceWorkerRegistration::getOrCreate):
* workers/service/ServiceWorkerRegistration.h:
* workers/service/ServiceWorkerRegistrationKey.cpp:
(WebCore::ServiceWorkerRegistrationKey::isMatching const):
(WebCore::ServiceWorkerRegistrationKey::originIsMatching const):
* workers/service/ServiceWorkerRegistrationKey.h:
* workers/service/server/SWClientConnection.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::getRegistrations):
* workers/service/server/SWServer.h:

Source/WebKit:

* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::getRegistrations):
* StorageProcess/ServiceWorker/WebSWServerConnection.h:
* StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::didGetRegistrations):
(WebKit::WebSWClientConnection::getRegistrations):
* WebProcess/Storage/WebSWClientConnection.h:
* WebProcess/Storage/WebSWClientConnection.messages.in:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224857 268f45cc-cd09-0410-ab3c-d52691b4dbfc

21 files changed:
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/getregistrations.https-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/workers/service/ServiceWorkerContainer.cpp
Source/WebCore/workers/service/ServiceWorkerContainer.h
Source/WebCore/workers/service/ServiceWorkerRegistration.cpp
Source/WebCore/workers/service/ServiceWorkerRegistration.h
Source/WebCore/workers/service/ServiceWorkerRegistrationKey.cpp
Source/WebCore/workers/service/ServiceWorkerRegistrationKey.h
Source/WebCore/workers/service/server/SWClientConnection.h
Source/WebCore/workers/service/server/SWServer.cpp
Source/WebCore/workers/service/server/SWServer.h
Source/WebCore/workers/service/server/SWServerRegistration.cpp
Source/WebCore/workers/service/server/SWServerRegistration.h
Source/WebKit/ChangeLog
Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.cpp
Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.h
Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.messages.in
Source/WebKit/WebProcess/Storage/WebSWClientConnection.cpp
Source/WebKit/WebProcess/Storage/WebSWClientConnection.h
Source/WebKit/WebProcess/Storage/WebSWClientConnection.messages.in

index afef485..12ceb1b 100644 (file)
@@ -1,3 +1,14 @@
+2017-11-14  Chris Dumez  <cdumez@apple.com>
+
+        [Service Workers] Implement container.getRegistrations()
+        https://bugs.webkit.org/show_bug.cgi?id=179672
+
+        Reviewed by Brady Eidson.
+
+        Rebaseline test now that more checks are passing.
+
+        * web-platform-tests/service-workers/service-worker/getregistrations.https-expected.txt:
+
 2017-11-14  Youenn Fablet  <youenn@apple.com>
 
         Implement ServiceWorker handle fetch for navigation loads
index 28c80b3..dfae850 100644 (file)
@@ -1,8 +1,8 @@
 
 PASS registrations are not returned following unregister 
-FAIL Register then getRegistrations assert_array_equals: getRegistrations should resolve with array of registrations. lengths differ, expected 1 got 0
-FAIL Register multiple times then getRegistrations assert_array_equals: getRegistrations should resolve with array of registrations. lengths differ, expected 2 got 0
+PASS Register then getRegistrations 
+PASS Register multiple times then getRegistrations 
 PASS Register then Unregister then getRegistrations 
 FAIL Register then Unregister with controlled frame then getRegistrations assert_equals: expected "activated" but got "redundant"
-FAIL getRegistrations promise resolves only with same origin registrations. assert_array_equals: getRegistrations should only return same origin registrations. lengths differ, expected 1 got 0
+PASS getRegistrations promise resolves only with same origin registrations. 
 
index a438a5f..689e91b 100644 (file)
@@ -1,3 +1,32 @@
+2017-11-14  Chris Dumez  <cdumez@apple.com>
+
+        [Service Workers] Implement container.getRegistrations()
+        https://bugs.webkit.org/show_bug.cgi?id=179672
+
+        Reviewed by Brady Eidson.
+
+        Implement container.getRegistrations():
+        - https://w3c.github.io/ServiceWorker/#dom-serviceworkercontainer-getregistrations
+
+        No new tests, rebaselined existing test.
+
+        * workers/service/ServiceWorkerContainer.cpp:
+        (WebCore::ServiceWorkerContainer::getRegistration):
+        (WebCore::ServiceWorkerContainer::getRegistrations):
+        (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
+        * workers/service/ServiceWorkerContainer.h:
+        * workers/service/ServiceWorkerRegistration.cpp:
+        (WebCore::ServiceWorkerRegistration::getOrCreate):
+        * workers/service/ServiceWorkerRegistration.h:
+        * workers/service/ServiceWorkerRegistrationKey.cpp:
+        (WebCore::ServiceWorkerRegistrationKey::isMatching const):
+        (WebCore::ServiceWorkerRegistrationKey::originIsMatching const):
+        * workers/service/ServiceWorkerRegistrationKey.h:
+        * workers/service/server/SWClientConnection.h:
+        * workers/service/server/SWServer.cpp:
+        (WebCore::SWServer::getRegistrations):
+        * workers/service/server/SWServer.h:
+
 2017-11-14  Alex Christensen  <achristensen@webkit.org>
 
         Fix Windows build.
index d208d11..93cc430 100644 (file)
@@ -230,14 +230,8 @@ void ServiceWorkerContainer::getRegistration(const String& clientURL, Ref<Deferr
             return;
         }
 
-        RefPtr<ServiceWorkerRegistration> registration = m_registrations.get(result->identifier);
-        if (!registration) {
-            auto& context = *scriptExecutionContext();
-            // FIXME: We should probably not be constructing ServiceWorkerRegistration objects here. Instead, we should make
-            // sure that ServiceWorkerRegistration objects stays alive as long as their SWServerRegistration on server side.
-            registration = ServiceWorkerRegistration::create(context, *this, WTFMove(result.value()));
-        }
-        promise->resolve<IDLInterface<ServiceWorkerRegistration>>(registration.releaseNonNull());
+        auto registration = ServiceWorkerRegistration::getOrCreate(*scriptExecutionContext(), *this, WTFMove(result.value()));
+        promise->resolve<IDLInterface<ServiceWorkerRegistration>>(WTFMove(registration));
     });
 }
 
@@ -259,8 +253,28 @@ void ServiceWorkerContainer::scheduleTaskToUpdateRegistrationState(ServiceWorker
 
 void ServiceWorkerContainer::getRegistrations(RegistrationsPromise&& promise)
 {
-    // FIXME: Implement getRegistrations algorithm, for now pretend there is no registration.
-    promise.resolve({ });
+    auto* context = scriptExecutionContext();
+    if (!context) {
+        promise.reject(Exception { InvalidStateError });
+        return;
+    }
+
+    if (!m_swConnection)
+        m_swConnection = &ServiceWorkerProvider::singleton().serviceWorkerConnectionForSession(context->sessionID());
+
+    return m_swConnection->getRegistrations(context->topOrigin(), context->url(), [this, pendingActivity = makePendingActivity(*this), promise = WTFMove(promise)] (auto&& registrationDatas) mutable {
+        if (m_isStopped)
+            return;
+
+        Vector<Ref<ServiceWorkerRegistration>> registrations;
+        registrations.reserveInitialCapacity(registrationDatas.size());
+        for (auto& registrationData : registrationDatas) {
+            auto registration = ServiceWorkerRegistration::getOrCreate(*scriptExecutionContext(), *this, WTFMove(registrationData));
+            registrations.uncheckedAppend(WTFMove(registration));
+        }
+
+        promise.resolve(WTFMove(registrations));
+    });
 }
 
 void ServiceWorkerContainer::startMessages()
@@ -305,13 +319,11 @@ void ServiceWorkerContainer::jobResolvedWithRegistration(ServiceWorkerJob& job,
     }
 
     context->postTask([this, protectedThis = makeRef(*this), job = makeRef(job), data = WTFMove(data), promiseResolvedHandler = WTFMove(promiseResolvedHandler)](ScriptExecutionContext& context) mutable {
-        RefPtr<ServiceWorkerRegistration> registration = m_registrations.get(data.identifier);
-        if (!registration)
-            registration = ServiceWorkerRegistration::create(context, *this, WTFMove(data));
+        auto registration = ServiceWorkerRegistration::getOrCreate(context, *this, WTFMove(data));
 
-        LOG(ServiceWorker, "Container %p resolved job with registration %p", this, registration.get());
+        LOG(ServiceWorker, "Container %p resolved job with registration %p", this, registration.ptr());
 
-        job->promise().resolve<IDLInterface<ServiceWorkerRegistration>>(*registration);
+        job->promise().resolve<IDLInterface<ServiceWorkerRegistration>>(WTFMove(registration));
 
         MicrotaskQueue::mainThreadQueue().append(std::make_unique<VoidMicrotask>([promiseResolvedHandler = WTFMove(promiseResolvedHandler)] {
             promiseResolvedHandler();
index eb4ad3b..41e92e9 100644 (file)
@@ -71,6 +71,8 @@ public:
     using RegistrationsPromise = DOMPromiseDeferred<IDLSequence<IDLInterface<ServiceWorkerRegistration>>>;
     void getRegistrations(RegistrationsPromise&&);
 
+    ServiceWorkerRegistration* registration(ServiceWorkerRegistrationIdentifier identifier) const { return m_registrations.get(identifier); }
+
     void addRegistration(ServiceWorkerRegistration&);
     void removeRegistration(ServiceWorkerRegistration&);
 
index 80de925..cdf1759 100644 (file)
 
 namespace WebCore {
 
+Ref<ServiceWorkerRegistration> ServiceWorkerRegistration::getOrCreate(ScriptExecutionContext& context, Ref<ServiceWorkerContainer>&& container, ServiceWorkerRegistrationData&& data)
+{
+    if (auto* registration = container->registration(data.identifier))
+        return *registration;
+
+    return adoptRef(*new ServiceWorkerRegistration(context, WTFMove(container), WTFMove(data)));
+}
+
 ServiceWorkerRegistration::ServiceWorkerRegistration(ScriptExecutionContext& context, Ref<ServiceWorkerContainer>&& container, ServiceWorkerRegistrationData&& registrationData)
     : ActiveDOMObject(&context)
     , m_registrationData(WTFMove(registrationData))
index 084fe83..62b97fe 100644 (file)
@@ -41,10 +41,7 @@ class ServiceWorkerContainer;
 
 class ServiceWorkerRegistration final : public RefCounted<ServiceWorkerRegistration>, public EventTargetWithInlineData, public ActiveDOMObject {
 public:
-    template <typename... Args> static Ref<ServiceWorkerRegistration> create(Args&&... args)
-    {
-        return adoptRef(*new ServiceWorkerRegistration(std::forward<Args>(args)...));
-    }
+    static Ref<ServiceWorkerRegistration> getOrCreate(ScriptExecutionContext&, Ref<ServiceWorkerContainer>&&, ServiceWorkerRegistrationData&&);
 
     ~ServiceWorkerRegistration();
 
index 440729b..4793aa0 100644 (file)
@@ -67,13 +67,15 @@ ServiceWorkerRegistrationKey ServiceWorkerRegistrationKey::isolatedCopy() const
 
 bool ServiceWorkerRegistrationKey::isMatching(const SecurityOriginData& topOrigin, const URL& clientURL) const
 {
-    if (topOrigin != m_topOrigin)
-        return false;
+    return originIsMatching(topOrigin, clientURL) && clientURL.string().startsWith(m_scope);
+}
 
-    if (!protocolHostAndPortAreEqual(clientURL, m_scope))
+bool ServiceWorkerRegistrationKey::originIsMatching(const SecurityOriginData& topOrigin, const URL& clientURL) const
+{
+    if (topOrigin != m_topOrigin)
         return false;
 
-    return clientURL.string().startsWith(m_scope);
+    return protocolHostAndPortAreEqual(clientURL, m_scope);
 }
 
 #ifndef NDEBUG
index 0bf2cbd..81b01bc 100644 (file)
@@ -42,6 +42,7 @@ public:
 
     bool operator==(const ServiceWorkerRegistrationKey&) const;
     bool isMatching(const SecurityOriginData& topOrigin, const URL& clientURL) const;
+    bool originIsMatching(const SecurityOriginData& topOrigin, const URL& clientURL) const;
     size_t scopeLength() const { return m_scope.string().length(); }
 
     const SecurityOriginData& topOrigin() const { return m_topOrigin; }
index 68c3d26..8f7745e 100644 (file)
@@ -55,6 +55,9 @@ public:
     using RegistrationCallback = WTF::CompletionHandler<void(std::optional<ServiceWorkerRegistrationData>&&)>;
     virtual void matchRegistration(const SecurityOrigin& topOrigin, const URL& clientURL, RegistrationCallback&&) = 0;
 
+    using GetRegistrationsCallback = WTF::CompletionHandler<void(Vector<ServiceWorkerRegistrationData>&&)>;
+    virtual void getRegistrations(const SecurityOrigin& topOrigin, const URL& clientURL, GetRegistrationsCallback&&) = 0;
+
     virtual void addServiceWorkerRegistrationInServer(const ServiceWorkerRegistrationKey&, ServiceWorkerRegistrationIdentifier) = 0;
     virtual void removeServiceWorkerRegistrationInServer(const ServiceWorkerRegistrationKey&, ServiceWorkerRegistrationIdentifier) = 0;
 
index 8f845a8..8619602 100644 (file)
@@ -109,6 +109,24 @@ void SWServer::removeRegistration(const ServiceWorkerRegistrationKey& key)
     m_originStore->remove(topOrigin);
 }
 
+Vector<ServiceWorkerRegistrationData> SWServer::getRegistrations(const SecurityOriginData& topOrigin, const URL& clientURL)
+{
+    Vector<SWServerRegistration*> matchingRegistrations;
+    for (auto& item : m_registrations) {
+        if (!item.value->isUninstalling() && item.key.originIsMatching(topOrigin, clientURL))
+            matchingRegistrations.append(item.value.get());
+    }
+    // The specification mandates that registrations are returned in the insertion order.
+    std::sort(matchingRegistrations.begin(), matchingRegistrations.end(), [](auto& a, auto& b) {
+        return a->creationTime() < b->creationTime();
+    });
+    Vector<ServiceWorkerRegistrationData> matchingRegistrationDatas;
+    matchingRegistrationDatas.reserveInitialCapacity(matchingRegistrations.size());
+    for (auto* registration : matchingRegistrations)
+        matchingRegistrationDatas.uncheckedAppend(registration->data());
+    return matchingRegistrationDatas;
+}
+
 void SWServer::clearAll()
 {
     m_jobQueues.clear();
index 30b12ca..47c9ab5 100644 (file)
@@ -100,6 +100,7 @@ public:
     SWServerRegistration* getRegistration(const ServiceWorkerRegistrationKey&);
     void addRegistration(std::unique_ptr<SWServerRegistration>&&);
     void removeRegistration(const ServiceWorkerRegistrationKey&);
+    WEBCORE_EXPORT Vector<ServiceWorkerRegistrationData> getRegistrations(const SecurityOriginData& topOrigin, const URL& clientURL);
 
     void scheduleJob(const ServiceWorkerJobData&);
     void rejectJob(const ServiceWorkerJobData&, const ExceptionData&);
index d6e14b4..0c15ace 100644 (file)
@@ -47,6 +47,7 @@ SWServerRegistration::SWServerRegistration(SWServer& server, const ServiceWorker
     , m_scopeURL(scopeURL)
     , m_scriptURL(scriptURL)
     , m_server(server)
+    , m_creationTime(MonotonicTime::now())
 {
     m_scopeURL.removeFragmentIdentifier();
 }
index a54cfa5..fe0e65a 100644 (file)
@@ -31,6 +31,7 @@
 #include "ServiceWorkerRegistrationData.h"
 #include "ServiceWorkerTypes.h"
 #include <wtf/HashCountedSet.h>
+#include <wtf/MonotonicTime.h>
 
 namespace WebCore {
 
@@ -69,6 +70,8 @@ public:
     SWServerWorker* waitingWorker() const { return m_waitingWorker.get(); }
     SWServerWorker* activeWorker() const { return m_activeWorker.get(); }
 
+    MonotonicTime creationTime() const { return m_creationTime; }
+
 private:
     void forEachConnection(const WTF::Function<void(SWServer::Connection&)>&);
 
@@ -87,6 +90,8 @@ private:
     
     HashCountedSet<uint64_t> m_connectionsWithClientRegistrations;
     SWServer& m_server;
+
+    MonotonicTime m_creationTime;
 };
 
 } // namespace WebCore
index ddea1ee..25e5c25 100644 (file)
@@ -1,3 +1,20 @@
+2017-11-14  Chris Dumez  <cdumez@apple.com>
+
+        [Service Workers] Implement container.getRegistrations()
+        https://bugs.webkit.org/show_bug.cgi?id=179672
+
+        Reviewed by Brady Eidson.
+
+        * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
+        (WebKit::WebSWServerConnection::getRegistrations):
+        * StorageProcess/ServiceWorker/WebSWServerConnection.h:
+        * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
+        * WebProcess/Storage/WebSWClientConnection.cpp:
+        (WebKit::WebSWClientConnection::didGetRegistrations):
+        (WebKit::WebSWClientConnection::getRegistrations):
+        * WebProcess/Storage/WebSWClientConnection.h:
+        * WebProcess/Storage/WebSWClientConnection.messages.in:
+
 2017-11-14  Youenn Fablet  <youenn@apple.com>
 
         Implement ServiceWorker handle fetch for navigation loads
index 0c24a12..385a102 100644 (file)
@@ -160,6 +160,12 @@ void WebSWServerConnection::matchRegistration(uint64_t registrationMatchRequestI
     send(Messages::WebSWClientConnection::DidMatchRegistration { registrationMatchRequestIdentifier, std::nullopt });
 }
 
+void WebSWServerConnection::getRegistrations(uint64_t registrationMatchRequestIdentifier, const SecurityOriginData& topOrigin, const URL& clientURL)
+{
+    auto registrations = server().getRegistrations(topOrigin, clientURL);
+    send(Messages::WebSWClientConnection::DidGetRegistrations { registrationMatchRequestIdentifier, registrations });
+}
+
 template<typename U> void WebSWServerConnection::sendToContextProcess(U&& message)
 {
     if (auto* connection = StorageProcess::singleton().globalServerToContextConnection())
index 3f4ca5b..f84f375 100644 (file)
@@ -72,7 +72,8 @@ private:
 
     void postMessageToServiceWorkerGlobalScope(WebCore::ServiceWorkerIdentifier destinationIdentifier, const IPC::DataReference& message, uint64_t sourceScriptExecutionContextIdentifier, const String& sourceOrigin);
 
-    void matchRegistration(uint64_t registrationMatchRequestIdentifier, const WebCore::SecurityOriginData&, const WebCore::URL& clientURL);
+    void matchRegistration(uint64_t registrationMatchRequestIdentifier, const WebCore::SecurityOriginData& topOrigin, const WebCore::URL& clientURL);
+    void getRegistrations(uint64_t registrationMatchRequestIdentifier, const WebCore::SecurityOriginData& topOrigin, const WebCore::URL& clientURL);
 
     IPC::Connection* messageSenderConnection() final { return m_contentConnection.ptr(); }
     uint64_t messageSenderDestinationID() final { return identifier(); }
index 42c3fc6..ec44c08 100644 (file)
@@ -35,6 +35,7 @@ messages -> WebSWServerConnection {
     DidResolveRegistrationPromise(WebCore::ServiceWorkerRegistrationKey key)
 
     MatchRegistration(uint64_t serviceRegistrationMatchRequestIdentifier, struct WebCore::SecurityOriginData topOrigin, WebCore::URL clientURL)
+    GetRegistrations(uint64_t serviceRegistrationMatchRequestIdentifier, struct WebCore::SecurityOriginData topOrigin, WebCore::URL clientURL)
 }
 
 #endif // ENABLE(SERVICE_WORKER)
index bceefbb..b08285a 100644 (file)
@@ -118,6 +118,12 @@ void WebSWClientConnection::didMatchRegistration(uint64_t matchingRequest, std::
         completionHandler(WTFMove(result));
 }
 
+void WebSWClientConnection::didGetRegistrations(uint64_t matchingRequest, Vector<ServiceWorkerRegistrationData>&& registrations)
+{
+    if (auto completionHandler = m_ongoingGetRegistrationsTasks.take(matchingRequest))
+        completionHandler(WTFMove(registrations));
+}
+
 void WebSWClientConnection::matchRegistration(const SecurityOrigin& topOrigin, const URL& clientURL, RegistrationCallback&& callback)
 {
     if (!mayHaveServiceWorkerRegisteredForOrigin(topOrigin)) {
@@ -130,6 +136,18 @@ void WebSWClientConnection::matchRegistration(const SecurityOrigin& topOrigin, c
     send(Messages::WebSWServerConnection::MatchRegistration(requestIdentifier, SecurityOriginData::fromSecurityOrigin(topOrigin), clientURL));
 }
 
+void WebSWClientConnection::getRegistrations(const SecurityOrigin& topOrigin, const URL& clientURL, GetRegistrationsCallback&& callback)
+{
+    if (!mayHaveServiceWorkerRegisteredForOrigin(topOrigin)) {
+        callback({ });
+        return;
+    }
+
+    uint64_t requestIdentifier = ++m_previousGetRegistrationsTaskIdentifier;
+    m_ongoingGetRegistrationsTasks.add(requestIdentifier, WTFMove(callback));
+    send(Messages::WebSWServerConnection::GetRegistrations(requestIdentifier, SecurityOriginData::fromSecurityOrigin(topOrigin), clientURL));
+}
+
 Ref<ServiceWorkerClientFetch> WebSWClientConnection::startFetch(WebServiceWorkerProvider& provider, Ref<WebCore::ResourceLoader>&& loader, uint64_t identifier, ServiceWorkerClientFetch::Callback&& callback)
 {
     ASSERT(loader->options().serviceWorkersMode != ServiceWorkersMode::None && loader->options().serviceWorkerIdentifier);
index 8aa1320..6020f06 100644 (file)
@@ -72,6 +72,9 @@ private:
 
     void matchRegistration(const WebCore::SecurityOrigin& topOrigin, const WebCore::URL& clientURL, RegistrationCallback&&) final;
     void didMatchRegistration(uint64_t matchRequestIdentifier, std::optional<WebCore::ServiceWorkerRegistrationData>&&);
+    void didGetRegistrations(uint64_t matchRequestIdentifier, Vector<WebCore::ServiceWorkerRegistrationData>&&);
+
+    void getRegistrations(const WebCore::SecurityOrigin& topOrigin, const WebCore::URL& clientURL, GetRegistrationsCallback&&) final;
 
     void didResolveRegistrationPromise(const WebCore::ServiceWorkerRegistrationKey&) final;
 
@@ -92,6 +95,9 @@ private:
     uint64_t m_previousMatchRegistrationTaskIdentifier { 0 };
     HashMap<uint64_t, RegistrationCallback> m_ongoingMatchRegistrationTasks;
 
+    uint64_t m_previousGetRegistrationsTaskIdentifier { 0 };
+    HashMap<uint64_t, GetRegistrationsCallback> m_ongoingGetRegistrationsTasks;
+
 }; // class WebSWServerConnection
 
 } // namespace WebKit
index e1a53d6..efcd65b 100644 (file)
@@ -37,6 +37,7 @@ messages -> WebSWClientConnection {
     PostMessageToServiceWorkerClient(uint64_t destinationScriptExecutionContextIdentifier, IPC::DataReference message, struct WebCore::ServiceWorkerData source, String sourceOrigin)
 
     DidMatchRegistration(uint64_t matchRequestIdentifier, std::optional<WebCore::ServiceWorkerRegistrationData> data)
+    DidGetRegistrations(uint64_t matchRequestIdentifier, Vector<WebCore::ServiceWorkerRegistrationData> registrations)
 }
 
 #endif // ENABLE(SERVICE_WORKER)